From 3dca7aa5a929b803d1b2e4531bf576a1f44d43ad Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Fri, 4 Jan 2013 15:28:12 -0500 Subject: [PATCH] tmf: Fix remaining Java warnings in tmf.ui Change-Id: I02cc52ad3dca97512c29aa7d92c2ce32005e8e73 Signed-off-by: Alexandre Montplaisir Reviewed-on: https://git.eclipse.org/r/9467 Reviewed-by: Patrick Tasse IP-Clean: Patrick Tasse Tested-by: Hudson CI --- .../.settings/.api_filters | 11 ++++++++ .../tmf/ui/parsers/custom/CustomTxtTrace.java | 2 +- .../CustomTxtParserInputWizardPage.java | 26 +++++++++---------- .../CustomTxtParserOutputWizardPage.java | 4 +-- .../wizards/CustomTxtParserWizard.java | 4 +-- .../CustomXmlParserInputWizardPage.java | 24 +++++++---------- .../CustomXmlParserOutputWizardPage.java | 4 +-- .../wizards/CustomXmlParserWizard.java | 4 +-- .../wizards/ImportTraceWizardPage.java | 7 +++-- .../tmf/ui/viewers/events/TmfEventsCache.java | 24 ++++++++--------- .../tmf/ui/viewers/events/TmfEventsTable.java | 8 +++--- .../tmf/ui/views/timechart/TimeChartView.java | 24 ++++++++--------- .../ui/widgets/timegraph/TimeGraphViewer.java | 6 ----- .../timegraph/widgets/ITimeDataProvider.java | 7 ----- .../timegraph/widgets/TimeGraphControl.java | 2 -- .../timegraph/widgets/TimeGraphScale.java | 10 +++---- 16 files changed, 79 insertions(+), 88 deletions(-) create mode 100644 org.eclipse.linuxtools.tmf.ui/.settings/.api_filters diff --git a/org.eclipse.linuxtools.tmf.ui/.settings/.api_filters b/org.eclipse.linuxtools.tmf.ui/.settings/.api_filters new file mode 100644 index 0000000000..ff31090892 --- /dev/null +++ b/org.eclipse.linuxtools.tmf.ui/.settings/.api_filters @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java index fd5021692d..fbe1ea0358 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/custom/CustomTxtTrace.java @@ -313,7 +313,7 @@ public class CustomTxtTrace extends TmfTrace implements ITmfEventParser { } } } - if (! processed) { + if (!processed && currentInput != null) { final Matcher matcher = currentInput.getPattern().matcher(line); if (matcher.find()) { event.processGroups(currentInput, matcher); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java index c275eee831..9109e6dfd5 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserInputWizardPage.java @@ -496,8 +496,8 @@ public class CustomTxtParserInputWizardPage extends WizardPage { selectedLine.dispose(); } if (!(event.getSelection().isEmpty()) && event.getSelection() instanceof IStructuredSelection) { - IStructuredSelection selection = (IStructuredSelection) event.getSelection(); - InputLine inputLine = (InputLine) selection.getFirstElement(); + IStructuredSelection sel = (IStructuredSelection) event.getSelection(); + InputLine inputLine = (InputLine) sel.getFirstElement(); selectedLine = new Line(lineContainer, getName(inputLine), inputLine); lineContainer.layout(); lineScrolledComposite.setMinSize(lineContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, lineContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).y - 1); @@ -593,9 +593,9 @@ public class CustomTxtParserInputWizardPage extends WizardPage { private String getSelectionText() { if (this.selection instanceof IStructuredSelection) { - Object selection = ((IStructuredSelection)this.selection).getFirstElement(); - if (selection instanceof IFile) { - IFile file = (IFile)selection; + Object sel = ((IStructuredSelection) this.selection).getFirstElement(); + if (sel instanceof IFile) { + IFile file = (IFile)sel; BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(file.getContents())); @@ -756,7 +756,7 @@ public class CustomTxtParserInputWizardPage extends WizardPage { } } } - if (! processed) { + if (!processed && currentInput != null) { matcher = currentInput.getPattern().matcher(log); if (matcher.find()) { inputText.setStyleRange(new StyleRange(rawPos, length, @@ -1287,17 +1287,17 @@ public class CustomTxtParserInputWizardPage extends WizardPage { } inputLine.columns = new ArrayList(inputs.size()); for (int i = 0; i < inputs.size(); i++) { - InputGroup group = inputs.get(i); + InputGroup grp = inputs.get(i); InputData inputData = new InputData(); - if (group.tagCombo.getText().equals(CustomTraceDefinition.TAG_OTHER)) { - inputData.name = group.tagText.getText().trim(); + if (grp.tagCombo.getText().equals(CustomTraceDefinition.TAG_OTHER)) { + inputData.name = grp.tagText.getText().trim(); } else { - inputData.name = group.tagCombo.getText(); - if (group.tagCombo.getText().equals(CustomTraceDefinition.TAG_TIMESTAMP)) { - inputData.format = group.tagText.getText().trim(); + inputData.name = grp.tagCombo.getText(); + if (grp.tagCombo.getText().equals(CustomTraceDefinition.TAG_TIMESTAMP)) { + inputData.format = grp.tagText.getText().trim(); } } - inputData.action = group.actionCombo.getSelectionIndex(); + inputData.action = grp.actionCombo.getSelectionIndex(); inputLine.columns.add(inputData); } } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java index f9b443c99f..66560894de 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserOutputWizardPage.java @@ -123,8 +123,8 @@ public class CustomTxtParserOutputWizardPage extends WizardPage { super.dispose(); } - private void loadDefinition(final CustomTxtTraceDefinition definition) { - for (final OutputColumn outputColumn : definition.outputs) { + private void loadDefinition(final CustomTxtTraceDefinition def) { + for (final OutputColumn outputColumn : def.outputs) { final Output output = new Output(outputsContainer, outputColumn.name); outputs.add(output); } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserWizard.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserWizard.java index 5ecaa03afd..be8e104f41 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserWizard.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomTxtParserWizard.java @@ -68,8 +68,8 @@ public class CustomTxtParserWizard extends Wizard implements INewWizard { } @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.selection = selection; + public void init(IWorkbench workbench, IStructuredSelection sel) { + this.selection = sel; } } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserInputWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserInputWizardPage.java index b01d55403a..d6d0398470 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserInputWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserInputWizardPage.java @@ -551,8 +551,8 @@ public class CustomXmlParserInputWizardPage extends WizardPage { selectedElement.dispose(); } if (!(event.getSelection().isEmpty()) && event.getSelection() instanceof IStructuredSelection) { - IStructuredSelection selection = (IStructuredSelection) event.getSelection(); - InputElement inputElement = (InputElement) selection.getFirstElement(); + IStructuredSelection sel = (IStructuredSelection) event.getSelection(); + InputElement inputElement = (InputElement) sel.getFirstElement(); selectedElement = new ElementNode(elementContainer, inputElement); elementContainer.layout(); elementScrolledComposite.setMinSize(elementContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT).x, @@ -692,9 +692,9 @@ public class CustomXmlParserInputWizardPage extends WizardPage { private String getSelectionText() { InputStream inputStream = null; if (this.selection instanceof IStructuredSelection) { - Object selection = ((IStructuredSelection) this.selection).getFirstElement(); - if (selection instanceof IFile) { - IFile file = (IFile) selection; + Object sel = ((IStructuredSelection) this.selection).getFirstElement(); + if (sel instanceof IFile) { + IFile file = (IFile) sel; try { inputStream = file.getContents(); } catch (CoreException e) { @@ -773,10 +773,6 @@ public class CustomXmlParserInputWizardPage extends WizardPage { } } - private void updatePreviews() { - updatePreviews(false); - } - private void initValues() { timeStampValue = null; timeStampFormat = null; @@ -784,7 +780,7 @@ public class CustomXmlParserInputWizardPage extends WizardPage { logEntryFound = false; } - private void updatePreviews(boolean updateAll) { + private void updatePreviews() { if (inputText == null) { // early update during construction return; @@ -928,10 +924,10 @@ public class CustomXmlParserInputWizardPage extends WizardPage { @Override public void widgetSelected(SelectionEvent e) { - InputElement parent = ElementNode.this.inputElement.parentElement; - while (parent != null) { - parent.logEntry = false; - parent = parent.parentElement; + InputElement parentElem = ElementNode.this.inputElement.parentElement; + while (parentElem != null) { + parentElem.logEntry = false; + parentElem = parentElem.parentElement; } } }); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java index 1c83ba9572..5d6bc8739c 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserOutputWizardPage.java @@ -124,8 +124,8 @@ public class CustomXmlParserOutputWizardPage extends WizardPage { super.dispose(); } - private void loadDefinition(final CustomTraceDefinition definition) { - for (final OutputColumn outputColumn : definition.outputs) { + private void loadDefinition(final CustomTraceDefinition def) { + for (final OutputColumn outputColumn : def.outputs) { final Output output = new Output(outputsContainer, outputColumn.name); outputs.add(output); } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserWizard.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserWizard.java index fc17585b8c..ebf35cf441 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserWizard.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/internal/tmf/ui/parsers/wizards/CustomXmlParserWizard.java @@ -72,8 +72,8 @@ public class CustomXmlParserWizard extends Wizard implements INewWizard { } @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.selection = selection; + public void init(IWorkbench workbench, IStructuredSelection sel) { + this.selection = sel; } } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java index 4fb945d7a8..e5918136e0 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/ImportTraceWizardPage.java @@ -811,9 +811,8 @@ public class ImportTraceWizardPage extends WizardResourceImportPage { return false; } - String sourceDirPath; try { - sourceDirPath = sourceDir.getCanonicalPath(); + sourceDir.getCanonicalPath(); } catch (IOException e) { MessageDialog.openInformation(getContainer().getShell(), Messages.ImportTraceWizard_Information, Messages.ImportTraceWizard_InvalidTraceDirectory); @@ -835,7 +834,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage { } if (fileSystemObjects.size() > 0) { - boolean ok = importResources(sourceDirPath, fileSystemObjects); + boolean ok = importResources(fileSystemObjects); String traceBundle = null; String traceTypeId = null; String traceIcon = null; @@ -919,7 +918,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage { return false; } - private boolean importResources(String rootDirectory, Map fileSystemObjects) { + private boolean importResources(Map fileSystemObjects) { // Determine the sorted canonical list of items to import List fileList = new ArrayList(); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsCache.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsCache.java index 60e90767fa..4ccc41f2c1 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsCache.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsCache.java @@ -236,15 +236,15 @@ public class TmfEventsCache { final int index = current * fCache.length; class DataRequest extends TmfDataRequest { - ITmfFilter fFilter; - int fRank; - int fIndex; + ITmfFilter requestFilter; + int requestRank; + int requestIndex; - DataRequest(Class dataType, ITmfFilter filter, int start, int nbRequested) { + DataRequest(Class dataType, ITmfFilter reqFilter, int start, int nbRequested) { super(dataType, start, nbRequested); - fFilter = filter; - fRank = start; - fIndex = index; + requestFilter = reqFilter; + requestRank = start; + requestIndex = index; } @Override @@ -253,18 +253,18 @@ public class TmfEventsCache { if (isCancelled()) { return; } - if (fRank >= rank) { + if (requestRank >= rank) { cancel(); return; } - fRank++; - if (fFilter.matches(event)) { - fIndex++; + requestRank++; + if (requestFilter.matches(event)) { + requestIndex++; } } public int getFilteredIndex() { - return fIndex; + return requestIndex; } } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java index 00a85c1fdd..fdd2add807 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/events/TmfEventsTable.java @@ -1030,8 +1030,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS if (fHeaderState == HeaderState.SEARCH) { stopSearchThread(); final TmfFilterAndNode filter = new TmfFilterAndNode(null); - for (final TableColumn column : fTable.getColumns()) { - final Object filterObj = column.getData(Key.SEARCH_OBJ); + for (final TableColumn col : fTable.getColumns()) { + final Object filterObj = col.getData(Key.SEARCH_OBJ); if (filterObj instanceof ITmfFilterTreeNode) { filter.addChild((ITmfFilterTreeNode) filterObj); } @@ -1048,8 +1048,8 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS } } else if (fHeaderState == HeaderState.FILTER) { final TmfFilterAndNode filter = new TmfFilterAndNode(null); - for (final TableColumn column : fTable.getColumns()) { - final Object filterObj = column.getData(Key.FILTER_OBJ); + for (final TableColumn col : fTable.getColumns()) { + final Object filterObj = col.getData(Key.FILTER_OBJ); if (filterObj instanceof ITmfFilterTreeNode) { filter.addChild((ITmfFilterTreeNode) filterObj); } diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java index ddb1704fad..5d681099be 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartView.java @@ -320,16 +320,16 @@ public class TimeChartView extends TmfView implements ITimeGraphRangeListener, I private class ItemizeThread extends Thread { private final TimeChartAnalysisEntry fTimeAnalysisEntry; - private final long fStartTime; - private final long fStopTime; + private final long startTime; + private final long stopTime; private final long fMaxDuration; private ItemizeThread(TimeChartAnalysisEntry timeAnalysisEntry, long startTime, long stopTime) { super("Itemize Thread:" + timeAnalysisEntry.getName()); //$NON-NLS-1$ fTimeAnalysisEntry = timeAnalysisEntry; - fStartTime = startTime; - fStopTime = stopTime; - fMaxDuration = 3 * (fStopTime - fStartTime) / fDisplayWidth; + this.startTime = startTime; + this.stopTime = stopTime; + fMaxDuration = 3 * (stopTime - startTime) / fDisplayWidth; } @Override @@ -343,15 +343,15 @@ public class TimeChartView extends TmfView implements ITimeGraphRangeListener, I boolean hasNext = true; while (hasNext) { synchronized (timeAnalysisEntry) { - while (hasNext = iterator.hasNext()) { + while ((hasNext = iterator.hasNext()) == true) { event = (TimeChartEvent) iterator.next(); - if (event.getTime() + event.getDuration() > fStartTime && event.getTime() < fStopTime && event.getDuration() > fMaxDuration + if (event.getTime() + event.getDuration() > startTime && event.getTime() < stopTime && event.getDuration() > fMaxDuration && event.getNbEvents() > 1) { break; } } } - if (hasNext) { + if (hasNext && event != null) { if (event.getItemizedEntry() == null) { itemizeEvent(event); } else { @@ -432,12 +432,12 @@ public class TimeChartView extends TmfView implements ITimeGraphRangeListener, I boolean hasNext = true; while (!interrupted && hasNext) { synchronized (timeAnalysisEntry) { - while (hasNext = iterator.hasNext()) { + while ((hasNext = iterator.hasNext()) == true) { event = (TimeChartEvent) iterator.next(); break; } } - if (hasNext) { + if (hasNext && event != null) { // TODO possible concurrency problem here with ItemizeJob event.setColorSettingPriority(ColorSettingsManager.PRIORITY_NONE); if (event.getItemizedEntry() != null) { @@ -459,12 +459,12 @@ public class TimeChartView extends TmfView implements ITimeGraphRangeListener, I boolean hasNext = true; while (!interrupted && hasNext) { synchronized (timeAnalysisEntry) { - while (hasNext = iterator.hasNext()) { + while ((hasNext = iterator.hasNext()) == true) { event = (TimeChartEvent) iterator.next(); break; } } - if (hasNext) { + if (hasNext && event != null) { // TODO possible concurrency problem here with ItemizeJob if (event.getItemizedEntry() == null) { decorateEvent(event); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java index 944b9b294b..0f4f4d6bdc 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java @@ -918,12 +918,6 @@ public class TimeGraphViewer implements ITimeDataProvider, SelectionListener { _time1_extSynch = _time1; } - @Override - @Deprecated - public boolean isCalendarFormat() { - return timeFormat == TimeFormat.CALENDAR; - } - /** * @since 2.0 */ diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeDataProvider.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeDataProvider.java index 4b75ae8abb..1d8db4c729 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeDataProvider.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeDataProvider.java @@ -136,13 +136,6 @@ public interface ITimeDataProvider { */ int getTimeSpace(); - /** - * @return If the time format is calendar (true) or relative (false) - * @deprecated replaced by {@link #getTimeFormat()} - */ - @Deprecated - boolean isCalendarFormat(); - /** * @return the time format, one of: *
    diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java index 5e0a117a5a..227f82c6b5 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java @@ -1762,9 +1762,7 @@ public class TimeGraphControl extends TimeGraphBaseControl implements FocusListe redraw(); _dragState = DRAG_NONE; } else if (e.button == 3 && DRAG_ZOOM == _dragState) { - Point size = getCtrlSize(); int nameWidth = _timeProvider.getNameSpace(); - int x = e.x - nameWidth; if (Math.max(_dragX, _dragX0) > nameWidth && _dragX != _dragX0) { long time0 = getTimeAtX(_dragX0); long time1 = getTimeAtX(_dragX); diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java index d4b575f0b5..3cb48fa72d 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java @@ -112,7 +112,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements private void calcTimeDelta(int width, double pixelsPerNanoSec) { double minDelta = (pixelsPerNanoSec == 0) ? YEAR_IN_NS : width / pixelsPerNanoSec; long unit = 1; - if (_timeProvider != null && _timeProvider.isCalendarFormat()) { + if (_timeProvider != null && _timeProvider.getTimeFormat().equals(TimeFormat.CALENDAR)) { if (minDelta > 6 * MONTH_IN_NS) { unit = YEAR_IN_NS; } else if (minDelta > 3 * MONTH_IN_NS) { @@ -299,7 +299,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements _rect0.width = labelWidth; long time; - if (_timeProvider != null && _timeProvider.isCalendarFormat()) { + if (_timeProvider != null && _timeProvider.getTimeFormat().equals(TimeFormat.CALENDAR)) { time = floorToCalendar(time0, _timeDelta); } else { time = (time0 / _timeDelta) * _timeDelta; @@ -310,7 +310,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements int y = _rect0.y + _rect0.height; - if (_timeProvider != null && _timeProvider.isCalendarFormat()) { + if (_timeProvider != null && _timeProvider.getTimeFormat().equals(TimeFormat.CALENDAR)) { timeDraw.drawAbsHeader(gc, time, absHeaderRect); } @@ -329,7 +329,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements if (pixelsPerNanoSec == 0 || time > Long.MAX_VALUE - _timeDelta || _timeDelta == 0) { break; } - if (_timeProvider != null && _timeProvider.isCalendarFormat()) { + if (_timeProvider != null && _timeProvider.getTimeFormat().equals(TimeFormat.CALENDAR)) { if (_timeDelta >= YEAR_IN_NS) { long millis = time / 1000000L; GREGORIAN_CALENDAR.setTime(new Date(millis)); @@ -396,7 +396,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements int numDigits = 5; long timeRange = time1 - time0; - if (_timeProvider.isCalendarFormat()) { + if (_timeProvider.getTimeFormat().equals(TimeFormat.CALENDAR)) { // Calculate the number of digits to represent the minutes provided // 11:222 // HH:mm:ss -- 2.34.1