diff options
author | Alexandre Montplaisir | 2012-06-14 22:49:55 +0000 |
---|---|---|
committer | Alexandre Montplaisir | 2012-06-18 19:53:23 +0000 |
commit | 06933b8be5e3a82852b9262f9beb0b09740213bd (patch) | |
tree | 627dff5f995cc7306249e7db15cb81dccb8a28fa /lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram | |
parent | 1d53b82b4561571a3107c1fbeb62413bac31eaa3 (diff) | |
download | org.eclipse.linuxtools-06933b8be5e3a82852b9262f9beb0b09740213bd.tar.gz org.eclipse.linuxtools-06933b8be5e3a82852b9262f9beb0b09740213bd.tar.xz org.eclipse.linuxtools-06933b8be5e3a82852b9262f9beb0b09740213bd.zip |
tmf: Simple warning fixes in tmf.ui and tests
Remove unecessary casts: makes the code more readable
Mark methods static wherever possible: potential memory savings
Remove unecessary else clauses: Makes it easier for the compiler
to optimize branching.
and other small things.
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Diffstat (limited to 'lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram')
2 files changed, 8 insertions, 7 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java index 48d11d1575..ec41e48077 100644 --- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java +++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java @@ -255,7 +255,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi fTimeRangeEndText.setLayoutData(gridData); } - private Font adjustFont(final Composite composite) { + private static Font adjustFont(final Composite composite) { // Reduce font size for a more pleasing rendering final int fontSizeAdjustment = -2; final Font font = composite.getFont(); @@ -550,7 +550,8 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi } } - private void drawDelimiter(final GC imageGC, final Color color, final int height, final int index) { + private static void drawDelimiter(final GC imageGC, final Color color, + final int height, final int index) { imageGC.setBackground(color); final int dash = height / 4; imageGC.fillRectangle(index, 0 * dash, 1, dash - 1); diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java index d5dcae7232..6ad857d434 100644 --- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java +++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramView.java @@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.Composite; * <li>the window span (size of the time window of the smaller histogram). * </ul> * The histograms x-axis show their respective time range. - * + * * @version 1.0 * @author Francois Chouinard */ @@ -267,7 +267,7 @@ public class HistogramView extends TmfView { /** * Returns the time range of the current selected window (base on default time scale). - * + * * @return the time range of current selected window. */ public TmfTimeRange getTimeRange() { @@ -370,10 +370,10 @@ public class HistogramView extends TmfView { } /** - * Handles experiment range updated signal. Extends histogram according to the new time range. If a + * Handles experiment range updated signal. Extends histogram according to the new time range. If a * HistogramRequest is already ongoing, it will be cancelled and a new request with the new range * will be issued. - * + * * @param signal the experiment range updated signal */ @TmfSignalHandler @@ -423,7 +423,7 @@ public class HistogramView extends TmfView { /** * Handles the current time updated signal. Sets the current time in the time range * histogram as well as the full histogram. - * + * * @param signal the signal to process */ @TmfSignalHandler |