tmf: Update some Javadoc in tmf.ui
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 12 Jun 2012 21:06:15 +0000 (17:06 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 14 Jun 2012 19:59:49 +0000 (15:59 -0400)
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
14 files changed:
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterManager.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/filter/FilterView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/Histogram.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramRequest.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramScaledData.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/histogram/HistogramZoom.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/TmfStatisticsView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/AbsTmfStatisticsTree.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnData.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfBaseColumnDataProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/statistics/model/TmfStatisticsTreeRootFactory.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartAnalysisEntry.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartDecorationProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timechart/TimeChartEvent.java

index 4411927db5c34a68cb09dbd923fdd2a1b3974d4b..2b2d4c91269babbfb9792d5538e64b09ee10f2ad 100644 (file)
@@ -48,10 +48,21 @@ public class FilterManager {
         }\r
     }\r
 \r
+    /**\r
+     * Retrieve the currently saved filters\r
+     *\r
+     * @return The array of filters\r
+     */\r
     public static ITmfFilterTreeNode[] getSavedFilters() {\r
        return fRoot.clone().getChildren();\r
     }\r
 \r
+    /**\r
+     * Set the passed filters as the currently saved ones.\r
+     *\r
+     * @param filters\r
+     *            The filters to save\r
+     */\r
     public static void setSavedFilters(ITmfFilterTreeNode[] filters) {\r
        fRoot = new TmfFilterRootNode();\r
        for (ITmfFilterTreeNode filter : filters) {\r
index e45e76f7d729d5ed1be06bbf72dda4e8c07ce305..d9e60adaf02777e9c22c81a2ba31c3664c93dcec 100644 (file)
@@ -52,9 +52,10 @@ import org.xml.sax.SAXException;
  */\r
 public class FilterView extends TmfView {\r
 \r
-       public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.filter"; //$NON-NLS-1$\r
+    /** ID for the Filter view */\r
+    public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.filter"; //$NON-NLS-1$\r
 \r
-       private static final Image SAVE_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/save_button.gif"); //$NON-NLS-1$\r
+    private static final Image SAVE_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/save_button.gif"); //$NON-NLS-1$\r
     private static final Image ADD_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/add_button.gif"); //$NON-NLS-1$\r
     private static final Image DELETE_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/delete_button.gif"); //$NON-NLS-1$\r
     private static final Image IMPORT_IMAGE = Activator.getDefault().getImageFromPath("/icons/elcl16/import_button.gif"); //$NON-NLS-1$\r
@@ -64,16 +65,16 @@ public class FilterView extends TmfView {
     // Main data structures\r
     // ------------------------------------------------------------------------\r
 \r
-       private FilterViewer fViewer;\r
+    private FilterViewer fViewer;\r
     private final ITmfFilterTreeNode fRoot;\r
 \r
     private final IWorkspace fWorkspace;\r
 \r
     private SaveAction fSaveAction;\r
-       private AddAction fAddAction;\r
-       private DeleteAction fDeleteAction;\r
-       private ExportAction fExportAction;\r
-       private ImportAction fImportAction;\r
+    private AddAction fAddAction;\r
+    private DeleteAction fDeleteAction;\r
+    private ExportAction fExportAction;\r
+    private ImportAction fImportAction;\r
 \r
     /**\r
      * Getter for the Filter Tree Root\r
@@ -90,13 +91,13 @@ public class FilterView extends TmfView {
     // ------------------------------------------------------------------------\r
 \r
     /**\r
-     *  Default Constructor\r
+     * Default Constructor\r
      */\r
-       public FilterView() {\r
-               super("Filter"); //$NON-NLS-1$\r
+    public FilterView() {\r
+        super("Filter"); //$NON-NLS-1$\r
 \r
-               fWorkspace = ResourcesPlugin.getWorkspace();\r
-               try {\r
+        fWorkspace = ResourcesPlugin.getWorkspace();\r
+        try {\r
             fWorkspace.getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);\r
         } catch (CoreException e) {\r
             Activator.getDefault().logError("Error refreshing workspace", e); //$NON-NLS-1$\r
index 17efdea65009c00a2608b3f31e98d5621bbded2e..48d11d15757eccad2f37279c5c38066e100a3384 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011, 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
  *   Bernd Hufmann - Changed to updated histogram data model
@@ -39,7 +39,7 @@ import org.eclipse.swt.widgets.Text;
 
 /**
  * Re-usable histogram widget.
- * 
+ *
  * It has the following features:
  * <ul>
  * <li>Y-axis labels displaying min/max count values
@@ -70,7 +70,7 @@ import org.eclipse.swt.widgets.Text;
  * <li>end of the time range
  * <li>number of events in that time range
  * </ul>
- * 
+ *
  * @version 1.0
  * @author Francois Chouinard
  */
@@ -122,7 +122,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      */
     protected final HistogramDataModel fDataModel;
     /**
-     * The histogram data model scaled to current resolution and screen width. 
+     * The histogram data model scaled to current resolution and screen width.
      */
     protected HistogramScaledData fScaledData;
 
@@ -134,7 +134,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
     /**
      * Standard constructor.
-     * 
+     *
      * @param view A reference to the parent TMF view.
      * @param parent A parent composite
      */
@@ -291,8 +291,8 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         return fDataModel.getTimeLimit();
     }
 
-    /** 
-     * Returns a data model reference. 
+    /**
+     * Returns a data model reference.
      * @return data model.
      */
     public HistogramDataModel getDataModel() {
@@ -303,7 +303,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     // Operations
     // ------------------------------------------------------------------------
     /**
-     * Updates the time range. 
+     * Updates the time range.
      * @param startTime A start time
      * @param endTime A end time.
      */
@@ -319,8 +319,11 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
     /**
      * Increase the histogram bucket corresponding to [timestamp]
-     * 
+     *
+     * @param eventCount
+     *            The new event count
      * @param timestamp
+     *            The latest timestamp
      */
     public void countEvent(final long eventCount, final long timestamp) {
         fDataModel.countEvent(eventCount, timestamp);
@@ -328,8 +331,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
     /**
      * Sets the current event time and refresh the display
-     * 
+     *
      * @param timestamp
+     *            The time of the current event
      */
     public void setCurrentEvent(final long timestamp) {
         fCurrentEventTime = (timestamp > 0) ? timestamp : 0;
@@ -338,7 +342,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
     /**
      * Computes the timestamp of the bucket at [offset]
-     * 
+     *
      * @param offset offset from the left on the histogram
      * @return the start timestamp of the corresponding bucket
      */
@@ -353,59 +357,69 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
     /**
      * Computes the offset of the timestamp in the histogram
-     * 
+     *
      * @param timestamp the timestamp
      * @return the offset of the corresponding bucket (-1 if invalid)
      */
     public synchronized int getOffset(final long timestamp) {
-        if (timestamp < fDataModel.getFirstBucketTime() || timestamp > fDataModel.getEndTime())
+        if (timestamp < fDataModel.getFirstBucketTime() || timestamp > fDataModel.getEndTime()) {
             return -1;
+        }
         return (int) ((timestamp - fDataModel.getFirstBucketTime()) / fScaledData.fBucketDuration);
     }
 
     /**
      * Move the currently selected bar cursor to a non-empty bucket.
-     * 
+     *
      * @param keyCode the SWT key code
      */
     protected void moveCursor(final int keyCode) {
 
-        if (fScaledData.fCurrentBucket == HistogramScaledData.OUT_OF_RANGE_BUCKET)
+        if (fScaledData.fCurrentBucket == HistogramScaledData.OUT_OF_RANGE_BUCKET) {
             return;
+        }
 
         int index;
         switch (keyCode) {
 
             case SWT.HOME:
                 index = 0;
-                while (index < fScaledData.fLastBucket && fScaledData.fData[index] == 0)
+                while (index < fScaledData.fLastBucket && fScaledData.fData[index] == 0) {
                     index++;
-                if (index < fScaledData.fLastBucket)
+                }
+                if (index < fScaledData.fLastBucket) {
                     fScaledData.fCurrentBucket = index;
+                }
                 break;
 
             case SWT.ARROW_RIGHT:
                 index = fScaledData.fCurrentBucket + 1;
-                while (index < fScaledData.fWidth && fScaledData.fData[index] == 0)
+                while (index < fScaledData.fWidth && fScaledData.fData[index] == 0) {
                     index++;
-                if (index < fScaledData.fLastBucket)
+                }
+                if (index < fScaledData.fLastBucket) {
                     fScaledData.fCurrentBucket = index;
+                }
                 break;
 
             case SWT.END:
                 index = fScaledData.fLastBucket;
-                while (index >= 0 && fScaledData.fData[index] == 0)
+                while (index >= 0 && fScaledData.fData[index] == 0) {
                     index--;
-                if (index >= 0)
+                }
+                if (index >= 0) {
                     fScaledData.fCurrentBucket = index;
+                }
                 break;
 
             case SWT.ARROW_LEFT:
                 index = fScaledData.fCurrentBucket - 1;
-                while (index >= 0 && fScaledData.fData[index] == 0)
+                while (index >= 0 && fScaledData.fData[index] == 0) {
                     index--;
-                if (index >= 0)
+                }
+                if (index >= 0) {
                     fScaledData.fCurrentBucket = index;
+                }
                 break;
 
             default:
@@ -420,7 +434,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
      */
     @Override
     public void modelUpdated() {
-        if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null)
+        if (!fCanvas.isDisposed() && fCanvas.getDisplay() != null) {
             fCanvas.getDisplay().asyncExec(new Runnable() {
                 @Override
                 public void run() {
@@ -428,8 +442,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
                         // Retrieve and normalize the data
                         final int canvasWidth = fCanvas.getBounds().width;
                         final int canvasHeight = fCanvas.getBounds().height;
-                        if (canvasWidth <= 0 || canvasHeight <= 0)
+                        if (canvasWidth <= 0 || canvasHeight <= 0) {
                             return;
+                        }
                         fDataModel.setCurrentEvent(fCurrentEventTime);
                         fScaledData = fDataModel.scaleTo(canvasWidth, canvasHeight, HISTOGRAM_BAR_WIDTH);
                         synchronized(fScaledData) {
@@ -446,6 +461,7 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
                     }
                 }
             });
+        }
     }
 
     // ------------------------------------------------------------------------
@@ -473,8 +489,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
         final int canvasHeight = fCanvas.getBounds().height;
 
         // Make sure we have something to draw upon
-        if (canvasWidth <= 0 || canvasHeight <= 0)
+        if (canvasWidth <= 0 || canvasHeight <= 0) {
             return;
+        }
 
         // Retrieve image; re-create only if necessary
         Image image = (Image) fCanvas.getData(IMAGE_KEY);
@@ -492,8 +509,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
     private void formatImage(final GC imageGC, final Image image) {
 
-        if (fScaledData == null)
+        if (fScaledData == null) {
             return;
+        }
 
         final HistogramScaledData scaledData = new HistogramScaledData(fScaledData);
 
@@ -516,13 +534,15 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
 
             // Draw the current event bar
             final int currentBucket = scaledData.fCurrentBucket;
-            if (currentBucket >= 0 && currentBucket < limit)
+            if (currentBucket >= 0 && currentBucket < limit) {
                 drawDelimiter(imageGC, fCurrentEventColor, height, currentBucket);
+            }
 
             // Add a dashed line as a delimiter (at the right of the last bar)
             int lastEventIndex = limit - 1;
-            while (lastEventIndex >= 0 && scaledData.fData[lastEventIndex] == 0)
+            while (lastEventIndex >= 0 && scaledData.fData[lastEventIndex] == 0) {
                 lastEventIndex--;
+            }
             lastEventIndex += (lastEventIndex < limit - 1) ? 1 : 0;
             drawDelimiter(imageGC, fLastEventColor, height, lastEventIndex);
         } catch (final Exception e) {
@@ -595,8 +615,9 @@ public abstract class Histogram implements ControlListener, PaintListener, KeyLi
     private String formatToolTipLabel(final int index) {
         long startTime = fScaledData.getBucketStartTime(fScaledData.fCurrentBucket);
         // negative values are possible if time values came into the model in decreasing order
-        if (startTime < 0)
+        if (startTime < 0) {
             startTime = 0;
+        }
         final long endTime = fScaledData.getBucketEndTime(fScaledData.fCurrentBucket);
         final int nbEvents = (index >= 0) ? fScaledData.fData[index] : 0;
 
index 763191663166891e5e5685ab3c9e657cfe8546e4..433f080d94cff59977ce96636a89dfeceb378689 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2009, 2011, 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   William Bourque - Initial API and implementation
  *   Yuriy Vashchuk - Heritage correction.
@@ -23,7 +23,7 @@ import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 
 /**
  * Class to request events for given time range from a trace to fill a HistogramDataModel and HistogramView.
- * 
+ *
  * @version 1.0
  * @author Francois Chouinard
  * <p>
@@ -45,26 +45,37 @@ public class HistogramRequest extends TmfEventRequest<ITmfEvent> {
 
     /**
      * Constructor
-     * @param histogram The histogram data model
-     * @param range The time range to request data 
-     * @param rank The index of the first event to retrieve
-     * @param nbEvents The number of events requested
-     * @param blockSize the number of events per block
-     * @param priority the requested execution priority
-     * 
+     *
+     * @param histogram
+     *            The histogram data model
+     * @param range
+     *            The time range to request data
+     * @param rank
+     *            The index of the first event to retrieve
+     * @param nbEvents
+     *            The number of events requested
+     * @param blockSize
+     *            The number of events per block
+     * @param execType
+     *            The requested execution priority
+     *
      */
-    public HistogramRequest(HistogramDataModel histogram, TmfTimeRange range, int rank, int nbEvents, int blockSize, ITmfDataRequest.ExecutionType execType) {
-        super(ITmfEvent.class, range, rank, nbEvents, (blockSize > 0) ? blockSize : ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, execType);
+    public HistogramRequest(HistogramDataModel histogram, TmfTimeRange range,
+            int rank, int nbEvents, int blockSize,
+            ITmfDataRequest.ExecutionType execType) {
+        super(ITmfEvent.class, range, rank, nbEvents,
+                (blockSize > 0) ? blockSize : ITmfTrace.DEFAULT_TRACE_CACHE_SIZE,
+                execType);
         fHistogram = histogram;
     }
 
     // ------------------------------------------------------------------------
     // TmfEventRequest
     // ------------------------------------------------------------------------
-    
+
     /**
      * Handle the event from the trace by updating the histogram data model.
-     * 
+     *
      * @param event a event from the trace
      * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleData(org.eclipse.linuxtools.tmf.core.event.ITmfEvent)
      */
@@ -79,7 +90,7 @@ public class HistogramRequest extends TmfEventRequest<ITmfEvent> {
 
     /**
      * Complete the request. It also notifies the histogram model about the completion.
-     * 
+     *
      * @see org.eclipse.linuxtools.tmf.core.request.TmfDataRequest#handleCompleted()
      */
     @Override
index 77469afaef77ca580c9f9d6904f6c7dce38ef702..a21e73424f99e0c1a423a0d06913a34b8d9497e2 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011, 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
  *   Bernd Hufmann - Added setter and getter and bar width support
@@ -18,7 +18,7 @@ import java.util.Arrays;
 
 /**
  * Convenience class/struct for scaled histogram data.
- * 
+ *
  * @version 1.0
  * @author Francois Chouinard
  */
@@ -45,7 +45,7 @@ public class HistogramScaledData {
      */
     public int fHeight;
     /**
-     * Width of one histogram bar (number of pixels). 
+     * Width of one histogram bar (number of pixels).
      */
     public int fBarWidth;
     /**
@@ -57,7 +57,7 @@ public class HistogramScaledData {
      */
     public long fBucketDuration;
     /**
-     * The maximum number of events of all buckets. 
+     * The maximum number of events of all buckets.
      */
     public long fMaxValue;
     /**
@@ -65,7 +65,7 @@ public class HistogramScaledData {
      */
     public int fCurrentBucket;
     /**
-     * The index of the last bucket. 
+     * The index of the last bucket.
      */
     public int fLastBucket;
     /**
@@ -121,7 +121,7 @@ public class HistogramScaledData {
         fScalingFactor = other.fScalingFactor;
         fFirstBucketTime = other.fFirstBucketTime;
     }
-    
+
     // ------------------------------------------------------------------------
     // Setter and Getter
     // ------------------------------------------------------------------------
@@ -135,13 +135,13 @@ public class HistogramScaledData {
     }
 
     /**
-     * Set the first event time. 
-     * @param firstEventTime
+     * Set the first event time.
+     * @param firstEventTime The time to set
      */
     public void setFirstBucketTime(long firstEventTime) {
         fFirstBucketTime = firstEventTime;
     }
-    
+
     /**
      * Returns the time of the last bucket.
      * @return last bucket time
@@ -149,7 +149,7 @@ public class HistogramScaledData {
     public long getLastBucketTime() {
         return getBucketStartTime(fLastBucket);
     }
-    
+
     /**
      * Returns the time of the bucket start time for given index.
      * @param index A bucket index.
@@ -158,7 +158,7 @@ public class HistogramScaledData {
     public long getBucketStartTime(int index) {
         return fFirstBucketTime + index * fBucketDuration;
     }
-    
+
     /**
      * Returns the time of the bucket end time for given index.
      * @param index A bucket index.
index b42c807ccb00644f1c0536c104fbd5c7c66bec2a..1b2d88d6944ae28a12fb32ebb3d5dd81a623be07 100644 (file)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011, 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Francois Chouinard - Initial API and implementation
  *   Francois Chouinard - Moved from LTTng to TMF
@@ -19,7 +19,7 @@ import org.eclipse.swt.widgets.Canvas;
 
 /**
  * Class to handle zooming within histogram windows..
- * 
+ *
  * @version 1.0
  * @author Francois Chouinard
  * <p>
@@ -52,7 +52,20 @@ public class HistogramZoom implements MouseWheelListener {
     // Constructors
     // ------------------------------------------------------------------------
 
-    public HistogramZoom(Histogram histogram, Canvas canvas, long start, long end) {
+    /**
+     * Standard constructor.
+     *
+     * @param histogram
+     *            The parent histogram object
+     * @param canvas
+     *            The canvas
+     * @param start
+     *            The start time of the zoom area
+     * @param end
+     *            The end time of the zoom area
+     */
+    public HistogramZoom(Histogram histogram, Canvas canvas, long start,
+            long end) {
         fHistogram = histogram;
         fCanvas = canvas;
         fAbsoluteStartTime = start;
@@ -109,7 +122,7 @@ public class HistogramZoom implements MouseWheelListener {
 
     /**
      * The the full time range of the histogram
-     *   
+     *
      * @param startTime the start time the histogram
      * @param endTime the end time of the histogram
      */
@@ -124,15 +137,16 @@ public class HistogramZoom implements MouseWheelListener {
      * @param duration the duration
      */
     public synchronized void setNewRange(long startTime, long duration) {
-        if (startTime < fAbsoluteStartTime)
+        if (startTime < fAbsoluteStartTime) {
             startTime = fAbsoluteStartTime;
+        }
 
         long endTime = startTime + duration;
         if (endTime > fAbsoluteEndTime) {
             endTime = fAbsoluteEndTime;
-            if (endTime - duration > fAbsoluteStartTime)
+            if (endTime - duration > fAbsoluteStartTime) {
                 startTime = endTime - duration;
-            else {
+            else {
                 startTime = fAbsoluteStartTime;
             }
         }
@@ -174,18 +188,22 @@ public class HistogramZoom implements MouseWheelListener {
     }
 
     private long validateStart(long start) {
-        if (start < fAbsoluteStartTime)
+        if (start < fAbsoluteStartTime) {
             start = fAbsoluteStartTime;
-        if (start > fAbsoluteEndTime)
+        }
+        if (start > fAbsoluteEndTime) {
             start = fAbsoluteEndTime - fMinWindowSize;
+        }
         return start;
     }
 
     private long validateEnd(long start, long end) {
-        if (end > fAbsoluteEndTime)
+        if (end > fAbsoluteEndTime) {
             end = fAbsoluteEndTime;
-        if (end < start + fMinWindowSize)
+        }
+        if (end < start + fMinWindowSize) {
             end = start + fMinWindowSize;
+        }
         return end;
     }
 
@@ -215,7 +233,7 @@ public class HistogramZoom implements MouseWheelListener {
         // Constructors
         // --------------------------------------------------------------------
 
-        /** 
+        /**
          * Constructor of inner class to handle consecutive scrolls of mouse wheel.
          * @param zoom the histogram zoom reference
          */
@@ -227,7 +245,7 @@ public class HistogramZoom implements MouseWheelListener {
         // --------------------------------------------------------------------
         // Operation
         // --------------------------------------------------------------------
-        
+
         /**
          * Increments the number of scroll clicks.
          * @param nbScrolls the number to add to the current value
@@ -251,8 +269,9 @@ public class HistogramZoom implements MouseWheelListener {
                 }
             }
             // Done waiting. Notify the histogram.
-            if (!isInterrupted())
+            if (!isInterrupted()) {
                 fZoom.zoom(nbScrollClick);
+            }
         }
     }
 
index 6727a6b11ddf96ae3f01839aaf6a56cdea1b6cda..9f40de8aabc30c0cb91ee602407a520de3652cd5 100755 (executable)
@@ -1,15 +1,15 @@
 /*******************************************************************************
  * Copyright (c) 2011, 20112 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Mathieu Denis  (mathieu.denis@polymtl.ca)  - Generalized version based on LTTng
  *   Bernd Hufmann - Updated to use trace reference in TmfEvent and streaming
- *   
+ *
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics;
@@ -55,11 +55,11 @@ import org.eclipse.swt.widgets.Listener;
 
 /**
  * The generic Statistics View displays statistics for any kind of traces.
- * 
+ *
  * It is implemented according to the MVC pattern. - The model is a TmfStatisticsTreeNode built by the State Manager. - The view is built with a
  * TreeViewer. - The controller that keeps model and view synchronized is an observer of the model.
  * </p>
- * 
+ *
  * @version 1.0
  * @author @author Mathieu Denis
  */
@@ -73,7 +73,7 @@ public class TmfStatisticsView extends TmfView {
      */
     public static final String TMF_STATISTICS_VIEW = "StatisticsView"; //$NON-NLS-1$
     /**
-     *  Refresh frequency 
+     *  Refresh frequency
      */
     protected static final Long STATS_INPUT_CHANGED_REFRESH = 5000L;
     /**
@@ -107,23 +107,23 @@ public class TmfStatisticsView extends TmfView {
     /**
      *  Flag to force request the data from trace
      */
-    protected boolean fRequestData = false; 
+    protected boolean fRequestData = false;
     /**
      *  Object to store the cursor while waiting for the experiment to load
      */
     private Cursor fWaitCursor = null;
     /**
-     *  View instance counter (for multiple statistic views) 
+     *  View instance counter (for multiple statistic views)
      */
     private static int fCountInstance = 0;
     /**
      * Number of this instance. Used as an instance ID.
      */
-    private int fInstanceNb;
+    private final int fInstanceNb;
 
     /**
      * Constructor of a statistics view.
-     * 
+     *
      * @param viewName
      *            The name to give to the view.
      */
@@ -261,20 +261,25 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * Refresh the view.
+     *
+     * @param complete
+     *            Should a pending update be sent afterwards or not
      */
     public void modelInputChanged(boolean complete) {
         // Ignore update if disposed
-        if (fTreeViewer.getTree().isDisposed())
+        if (fTreeViewer.getTree().isDisposed()) {
             return;
+        }
 
         fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() {
             @Override
             public void run() {
-                if (!fTreeViewer.getTree().isDisposed())
+                if (!fTreeViewer.getTree().isDisposed()) {
                     fTreeViewer.refresh();
+                }
             }
         });
-        
+
         if (complete) {
             sendPendingUpdate();
         }
@@ -282,7 +287,7 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * Called when an experiment request has failed or has been canceled Remove the data retrieved from the experiment from the statistics tree.
-     * 
+     *
      * @param name The experiment name
      */
     public void modelIncomplete(String name) {
@@ -301,7 +306,7 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * Handles the signal about disposal of the current experiment.
-     * 
+     *
      * @param signal The disposed signal
      */
     @TmfSignalHandler
@@ -313,9 +318,9 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Handler called when an experiment is selected. Checks if the experiment has changed 
+     * Handler called when an experiment is selected. Checks if the experiment has changed
      * and requests the selected experiment if it has not yet been cached.
-     * 
+     *
      * @param signal Contains the information about the selection.
      */
     @TmfSignalHandler
@@ -350,7 +355,7 @@ public class TmfStatisticsView extends TmfView {
                     if (same) {
                         // no need to reload data, all traces are already loaded
                         fTreeViewer.setInput(experimentTreeNode);
-                        
+
                         resetUpdateSynchronization();
 
                         return;
@@ -372,7 +377,7 @@ public class TmfStatisticsView extends TmfView {
 
             // set input to a clean data model
             fTreeViewer.setInput(treeModelRoot);
-            
+
             if (fRequestData) {
                 requestData(experiment, experiment.getTimeRange());
                 fRequestData = false;
@@ -396,10 +401,10 @@ public class TmfStatisticsView extends TmfView {
         requestData(experiment, signal.getRange());
     }
 
-    
+
     /**
      * Return the size of the request when performing background request.
-     * 
+     *
      * @return the block size for background request.
      */
     protected int getIndexPageSize() {
@@ -408,7 +413,7 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * Returns the quantity of data to retrieve before a refresh of the view is performed
-     * 
+     *
      * @return the quantity of data to retrieve before a refresh of the view is performed.
      */
     protected long getInputChangedRefresh() {
@@ -417,7 +422,7 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * This method can be overridden to implement another way to represent the statistics data and to retrieve the information for display.
-     * 
+     *
      * @return a TmfStatisticsData object.
      */
     protected AbsTmfStatisticsTree getStatisticData() {
@@ -426,7 +431,7 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * This method can be overridden to change the representation of the data in the columns.
-     * 
+     *
      * @return an object implementing ITmfBaseColumnDataProvider.
      */
     protected ITmfColumnDataProvider getColumnDataProvider() {
@@ -435,8 +440,8 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * Constructs the ID based on the experiment name and <code>fInstanceNb</code>
-     * 
-     * @param experimentName the name of the trace name to show in the view 
+     *
+     * @param experimentName the name of the trace name to show in the view
      * @return a view ID
      */
     protected String getTreeID(String experimentName) {
@@ -445,7 +450,7 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * When the experiment is loading the cursor will be different so the user know the processing is not finished yet.
-     * 
+     *
      * @param waitInd Indicates if we need to show the waiting cursor, or the default one
      */
     protected void waitCursor(final boolean waitInd) {
@@ -475,7 +480,7 @@ public class TmfStatisticsView extends TmfView {
 
     /**
      * Perform the request for an experiment and populates the statistics tree with event.
-     * 
+     *
      * @param experiment experiment for which we need the statistics data.
      * @param timeRange to request
      */
@@ -501,7 +506,7 @@ public class TmfStatisticsView extends TmfView {
                     super.handleData(data);
                     if (data != null) {
                         AbsTmfStatisticsTree statisticsData = TmfStatisticsTreeRootFactory.getStatTree(getTreeID(experiment.getName()));
-                        
+
                         final String traceName = data.getTrace().getName();
                         ITmfExtraEventInfo extraInfo = new ITmfExtraEventInfo() {
                             @Override
@@ -553,7 +558,7 @@ public class TmfStatisticsView extends TmfView {
             fRequest.cancel();
         }
     }
-    
+
     /**
      * Reset update synchronization information
      */
@@ -565,10 +570,10 @@ public class TmfStatisticsView extends TmfView {
     }
 
     /**
-     * Checks if statistic update is ongoing. If it is ongoing the new time range is stored as pending 
-     * 
+     * Checks if statistic update is ongoing. If it is ongoing the new time range is stored as pending
+     *
      * @param timeRange - new time range
-     * @return true if statistic update is ongoing else false 
+     * @return true if statistic update is ongoing else false
      */
     protected boolean checkUpdateBusy(TmfTimeRange timeRange) {
         synchronized (fStatisticsUpdateSyncObj) {
@@ -576,7 +581,7 @@ public class TmfStatisticsView extends TmfView {
                 fStatisticsUpdatePending = true;
                 fStatisticsUpdateRange = timeRange;
                 return true;
-            } 
+            }
             fStatisticsUpdateBusy = true;
             return false;
         }
index 75e5e3528d44b4b0c8775b184cb92fe2897bab83..c62df8a373f1653cf9391e14f5c56980c42d1113 100755 (executable)
@@ -1,14 +1,14 @@
 /*******************************************************************************
  * Copyright (c) 2011, 2012 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca) - Implementation and Initial API
- *   
+ *   Mathieu Denis <mathieu.denis@polymtl.ca> - Implementation and Initial API
+ *
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -28,7 +28,7 @@ import org.eclipse.linuxtools.tmf.ui.views.statistics.ITmfExtraEventInfo;
  * It allow to implement a tree structure while avoiding the need to run through
  * the tree each time you need to add a node at a given place.
  * </p>
- * 
+ *
  *  @version 1.0
  *  @author Mathieu Denis
  */
@@ -45,15 +45,16 @@ public abstract class AbsTmfStatisticsTree {
 
     /**
      * <h4>Function to merge many string with more efficacy.</h4>
-     * 
+     *
      * @param strings
      *            Strings to merge.
      * @return A new string containing all the strings.
      */
     public synchronized static String mergeString(String... strings) {
         fBuilder.setLength(0);
-        for (String s : strings)
+        for (String s : strings) {
             fBuilder.append(s);
+        }
                 return fBuilder.toString();
     }
 
@@ -82,7 +83,7 @@ public abstract class AbsTmfStatisticsTree {
 
     /**
      * <h4>Get a node.</h4>
-     * 
+     *
      * @param path
      *            Path to the node.
      * @return The node or null.
@@ -93,7 +94,7 @@ public abstract class AbsTmfStatisticsTree {
 
     /**
      * <h4>Get the children of a node.</h4>
-     * 
+     *
      * @param path
      *            Path to the node.
      * @return Collection containing the children.
@@ -102,16 +103,16 @@ public abstract class AbsTmfStatisticsTree {
 
     /**
      * <h4>Get every children of a node, even if it doesn't have any registered events, as opposed to getChildren</h4>
-     * 
+     *
      * @param path
      *            Path to the node.
      * @return Collection containing all the children.
      */
     public abstract Collection<TmfStatisticsTreeNode> getAllChildren(final TmfFixedArray<String> path);
-    
+
     /**
      * <h4>Get the map of existing elements of path classified by parent.</h4>
-     * 
+     *
      * @return The map.
      */
     public Map<String, Set<String>> getKeys() {
@@ -120,7 +121,7 @@ public abstract class AbsTmfStatisticsTree {
 
     /**
      * <h4>Get or create a node.</h4>
-     * 
+     *
      * @param path
      *            Path to the node.
      * @return The node.
@@ -137,17 +138,18 @@ public abstract class AbsTmfStatisticsTree {
 
     /**
      * <h4>Get the parent of a node.</h4>
-     * 
+     *
      * @param path
      *            Path to the node.
      * @return Parent node or null.
      */
     public TmfStatisticsTreeNode getParent(final TmfFixedArray<String> path) {
         if (path.size() == 1) {
-            if (path.equals(ROOT))
+            if (path.equals(ROOT)) {
                 return null;
-            else
+            } else {
                 return get(ROOT);
+            }
         }
         return get(path.subArray(0, path.size() - 1));
     }
@@ -184,7 +186,7 @@ public abstract class AbsTmfStatisticsTree {
      * Must make sure the {@link #getChildren(TmfFixedArray)} on the parent node
      * will return the newly created node.
      * </p>
-     * 
+     *
      * @param path
      *            Path of the new node.
      */
@@ -195,7 +197,7 @@ public abstract class AbsTmfStatisticsTree {
      * <p>
      * Work recursively.
      * </p>
-     * 
+     *
      * @param path
      *            Path to the node.
      */
index 0b7ee870bfb2324486732b3526a6bb5e8bf97a2f..2600102e46650848bd1c9eee2c36b624cc0a3bb2 100755 (executable)
@@ -57,21 +57,41 @@ public class TmfBaseColumnData implements ITmfStatisticsColumnData {
      * Used to draw bar charts in columns.
      */
     public interface ITmfColumnPercentageProvider {
+
+        /**
+         * Percentage provider
+         *
+         * @param node
+         *            The statistics tree node
+         * @return The value as a percentage
+         */
         public double getPercentage(TmfStatisticsTreeNode node);
     }
 
     /**
      * Constructor with parameters
      *
-     * @param h header of the column. The name will be shown at the top of the column.
-     * @param w width of the column.
-     * @param a alignment of the text
-     * @param t text to shown as a tooltip when the cursor comes over the header
-     * @param l provide all the column element
-     * @param c used to compare element between them to be able to classify the content of the columns
-     * @param p provide the percentage of a specific element
-     */
-    public TmfBaseColumnData(String h, int w, int a, String t, ColumnLabelProvider l, ViewerComparator c, ITmfColumnPercentageProvider p) {
+     * @param h
+     *            header of the column. The name will be shown at the top of the
+     *            column.
+     * @param w
+     *            width of the column.
+     * @param a
+     *            alignment of the text
+     * @param t
+     *            text to shown as a tooltip when the cursor comes over the
+     *            header
+     * @param l
+     *            provide all the column element
+     * @param c
+     *            used to compare element between them to be able to classify
+     *            the content of the columns
+     * @param p
+     *            provide the percentage of a specific element
+     */
+    public TmfBaseColumnData(String h, int w, int a, String t,
+            ColumnLabelProvider l, ViewerComparator c,
+            ITmfColumnPercentageProvider p) {
         fHeader = h;
         fWidth = w;
         fAlignment = a;
index 309cb167df8fb4b06538fc1f8997c1e10e8e173f..62b8888e06c8550033cf92bd5a50ad23f006c4ef 100755 (executable)
@@ -1,13 +1,13 @@
 /*******************************************************************************
  * Copyright (c) 2011, 2011 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
- *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Implementation and Initial API
+ *   Mathieu Denis <mathieu.denis@polymtl.ca>  - Implementation and Initial API
  *******************************************************************************/
 
 package org.eclipse.linuxtools.tmf.ui.views.statistics.model;
@@ -30,7 +30,7 @@ import org.eclipse.ui.PlatformUI;
 
 /**
  * Create a basic list of columns with providers.
- * 
+ *
  * @version 1.0
  * @author Mathieu Denis
  */
index 02d8d745519379e047b0b39be2e3746dc1789c2a..1c90f0c5bc5f0f39c8924004abb0f13a4872b46c 100755 (executable)
@@ -1,11 +1,11 @@
 /*******************************************************************************
  * Copyright (c) 2011 Ericsson
- * 
+ *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * 
+ *
  * Contributors:
  *   Mathieu Denis      (mathieu.denis@polymtl.ca)  - Initial API
  *******************************************************************************/
@@ -17,11 +17,11 @@ import java.util.Map;
 
 /**
  * Factory class to create and store TMF statistic trees.
- * 
+ *
  * Based on a given tree node ID a TMF statistic tree is stored internally.
- * A root node is created for each tree. Using the tree node ID the statistics 
- * tree can be retrieved. 
- * 
+ * A root node is created for each tree. Using the tree node ID the statistics
+ * tree can be retrieved.
+ *
  * @version 1.0
  * @author Mathieu Denis
  *
@@ -42,7 +42,9 @@ public class TmfStatisticsTreeRootFactory {
 
     /**
      * Provide a statisticsTree instance per trace
-     * 
+     *
+     * @param traceUniqueId
+     *            Unique ID for the trace
      * @return the corresponding trace statistics tree
      */
     public static TmfStatisticsTreeNode getStatTreeRoot(String traceUniqueId) {
@@ -55,30 +57,37 @@ public class TmfStatisticsTreeRootFactory {
     }
 
     /**
-     * 
+     * Get the tree that's being used for statistics
+     *
      * @param traceUniqueId
+     *            Unique ID for the trace
      * @return the corresponding trace statistics tree
      */
     public static AbsTmfStatisticsTree getStatTree(String traceUniqueId) {
-        if (traceUniqueId == null)
+        if (traceUniqueId == null) {
             return null;
+        }
 
         AbsTmfStatisticsTree tree = fTreeInstances.get(traceUniqueId);
         return tree;
     }
 
     /**
-     * Add the new trace statistics data in the tree. Can be used later on if the same traces is selected back.
-     * 
+     * Add the new trace statistics data in the tree. Can be used later on if
+     * the same traces is selected back.
+     *
      * @param traceUniqueId
-     *            the name of the trace which will be used as a key to store the data. Must be different for each traces, otherwise the traces might
-     *            be overwritten which would trigger a reload of the same trace.
+     *            The name of the trace which will be used as a key to store the
+     *            data. Must be different for each traces, otherwise the traces
+     *            might be overwritten which would trigger a reload of the same
+     *            trace.
      * @param statsData
-     *            the information about the trace
+     *            The information about the trace
      */
     public static void addStatsTreeRoot(String traceUniqueId, AbsTmfStatisticsTree statsData) {
-        if (traceUniqueId == null || statsData == null)
+        if (traceUniqueId == null || statsData == null) {
             return;
+        }
 
         fTreeInstances.put(traceUniqueId, statsData);
         // if called for the first time, create the root node
@@ -86,8 +95,10 @@ public class TmfStatisticsTreeRootFactory {
     }
 
     /**
-     * 
+     * Return if the given trace is currently known by the statistics manager.
+     *
      * @param traceUniqueId
+     *            The unique ID of the trace
      * @return true if the trace id is known
      */
     public static boolean containsTreeRoot(String traceUniqueId) {
@@ -96,8 +107,9 @@ public class TmfStatisticsTreeRootFactory {
 
     /**
      * Remove previously registered statistics tree.
-     * 
+     *
      * @param traceUniqueId
+     *            The unique ID of the trace
      */
     public static void removeStatTreeRoot(String traceUniqueId) {
         if (traceUniqueId != null && fTreeInstances.containsKey(traceUniqueId)) {
index 1bf1a992db4072714e119ff87216a0ff0bc71ae1..c27c6d2c397b5520c761c764a684a84d4fde95ad 100644 (file)
@@ -158,6 +158,12 @@ public class TimeChartAnalysisEntry implements ITimeGraphEntry {
 \r
     }\r
 \r
+    /**\r
+     * Add a time event to the time chart entry\r
+     *\r
+     * @param timeEvent\r
+     *            The event to add\r
+     */\r
     public void addTraceEvent(ITimeEvent timeEvent) {\r
         long time = timeEvent.getTime();\r
         synchronized (fTraceEvents) {\r
@@ -239,14 +245,30 @@ public class TimeChartAnalysisEntry implements ITimeGraphEntry {
         }\r
     }\r
 \r
+    /**\r
+     * Retrieve the trace associated with this entry\r
+     *\r
+     * @return The trace object\r
+     */\r
     public ITmfTrace<?> getTrace() {\r
         return fTrace;\r
     }\r
 \r
+    /**\r
+     * Set the last rank of the entry\r
+     *\r
+     * @param rank\r
+     *            The rank to set\r
+     */\r
     public void setLastRank(long rank) {\r
         fLastRank = rank;\r
     }\r
 \r
+    /**\r
+     * Retrieve the last rank of the entry\r
+     *\r
+     * @return The last rank\r
+     */\r
     public long getLastRank() {\r
         return fLastRank;\r
     }\r
index 6458f65ab62d588c6c1f6a91c2235fdb192ad9e7..7ff3d589566241a329095417f7f198f677fad6d9 100644 (file)
@@ -36,54 +36,103 @@ public class TimeChartDecorationProvider {
     private ITmfFilter fFilterFilter;\r
     private ITmfFilter fSearchFilter;\r
 \r
-       public TimeChartDecorationProvider(IFile bookmarksFile) {\r
-           fBookmarksFile = bookmarksFile;\r
-           refreshBookmarks();\r
+    /**\r
+     * Constructor\r
+     *\r
+     * @param bookmarksFile\r
+     *            Bookmark file associated with the trace\r
+     */\r
+    public TimeChartDecorationProvider(IFile bookmarksFile) {\r
+        fBookmarksFile = bookmarksFile;\r
+        refreshBookmarks();\r
     }\r
 \r
-       public IFile getBookmarksFile() {\r
-               return fBookmarksFile;\r
-       }\r
+    /**\r
+     * Retrieve the bookmark file that was assigned to this provider\r
+     *\r
+     * @return The bookmark file\r
+     */\r
+    public IFile getBookmarksFile() {\r
+        return fBookmarksFile;\r
+    }\r
 \r
-       public boolean isBookmark(long rank) {\r
-           return fBookmarksSet.contains(rank);\r
+    /**\r
+     * Verify if the selected rank has a bookmark assigned to it.\r
+     *\r
+     * @param rank\r
+     *            The rank to check for\r
+     * @return If there is a bookmark there\r
+     */\r
+    public boolean isBookmark(long rank) {\r
+        return fBookmarksSet.contains(rank);\r
     }\r
 \r
-       public void refreshBookmarks() {\r
-               try {\r
-                       fBookmarksSet.clear();\r
-               for (IMarker bookmark : fBookmarksFile.findMarkers(IMarker.BOOKMARK, false, IResource.DEPTH_ZERO)) {\r
-                       int location = bookmark.getAttribute(IMarker.LOCATION, -1);\r
-                       if (location != -1) {\r
-                               Long rank = (long) location;\r
-                               fBookmarksSet.add(rank);\r
-                       }\r
-               }\r
+    /**\r
+     * Refresh the bookmark display.\r
+     */\r
+    public void refreshBookmarks() {\r
+        try {\r
+            fBookmarksSet.clear();\r
+            for (IMarker bookmark : fBookmarksFile.findMarkers(\r
+                    IMarker.BOOKMARK, false, IResource.DEPTH_ZERO)) {\r
+                int location = bookmark.getAttribute(IMarker.LOCATION, -1);\r
+                if (location != -1) {\r
+                    Long rank = (long) location;\r
+                    fBookmarksSet.add(rank);\r
+                }\r
+            }\r
         } catch (CoreException e) {\r
             Activator.getDefault().logError("Error refreshing bookmarks", e); //$NON-NLS-1$\r
         }\r
     }\r
 \r
-       public void filterApplied(ITmfFilter filter) {\r
-               fFilterFilter = filter;\r
+    /**\r
+     * Notify that a filter is now applied on the view.\r
+     *\r
+     * @param filter\r
+     *            The filter that was applied\r
+     */\r
+    public void filterApplied(ITmfFilter filter) {\r
+        fFilterFilter = filter;\r
     }\r
 \r
-       public boolean isVisible(ITmfEvent event) {\r
-               if (fFilterFilter != null) {\r
-                       return fFilterFilter.matches(event);\r
-               }\r
-               return true;\r
-       }\r
+    /**\r
+     * Check if an event is currently visible in the view or not.\r
+     *\r
+     * @param event\r
+     *            The event to check for\r
+     * @return If the event is visible or not\r
+     */\r
+    public boolean isVisible(ITmfEvent event) {\r
+        if (fFilterFilter != null) {\r
+            return fFilterFilter.matches(event);\r
+        }\r
+        return true;\r
+    }\r
 \r
-       public void searchApplied(ITmfFilter filter) {\r
-               fSearchFilter = filter;\r
+    /**\r
+     * Notify that a search is applied on the view.\r
+     *\r
+     * @param filter\r
+     *            The search filter that was applied\r
+     */\r
+    public void searchApplied(ITmfFilter filter) {\r
+        fSearchFilter = filter;\r
     }\r
 \r
-       public boolean isSearchMatch(ITmfEvent event) {\r
-               if (fSearchFilter != null) {\r
-                       return fSearchFilter.matches(event);\r
-               }\r
-               return false;\r
-       }\r
+    /**\r
+     * Verify if the currently active search filter applies to the given event\r
+     * or not.\r
+     *\r
+     * @param event\r
+     *            The event to check for\r
+     * @return If the event matches\r
+     */\r
+    public boolean isSearchMatch(ITmfEvent event) {\r
+        if (fSearchFilter != null) {\r
+            return fSearchFilter.matches(event);\r
+        }\r
+        return false;\r
+    }\r
 \r
 }\r
index 93efed807493bc8e588ead14f25b5760e5202cf9..57061c9aea6b480cb888112fa081550623b1ab1b 100644 (file)
@@ -44,7 +44,20 @@ public class TimeChartEvent implements ITimeEvent {
     private TimeChartAnalysisEntry fItemizedEntry;\r
     private boolean fItemizing;\r
 \r
-    public TimeChartEvent(TimeChartAnalysisEntry parentEntry, ITmfEvent event, long rank, TimeChartDecorationProvider decorationProvider) {\r
+    /**\r
+     * Standard constructor\r
+     *\r
+     * @param parentEntry\r
+     *            The parent entry\r
+     * @param event\r
+     *            The event from which this time chart event originates\r
+     * @param rank\r
+     *            The rank of the event in the trace\r
+     * @param decorationProvider\r
+     *            The decoration provider to use\r
+     */\r
+    public TimeChartEvent(TimeChartAnalysisEntry parentEntry, ITmfEvent event,\r
+            long rank, TimeChartDecorationProvider decorationProvider) {\r
         fParentEntry = parentEntry;\r
         fTime = event.getTimestamp().normalize(0, TIMESTAMP_SCALE).getValue();\r
         fDuration = 0;\r
@@ -72,18 +85,39 @@ public class TimeChartEvent implements ITimeEvent {
         return fDuration;\r
     }\r
 \r
+    /**\r
+     * Retrieve the rank of the trace event which started this time event.\r
+     *\r
+     * @return The rank of the beginning\r
+     */\r
     public long getFirstRank() {\r
         return fFirstRank;\r
     }\r
 \r
+    /**\r
+     * Retrieve the rank of the trace event which *finished* this time event.\r
+     *\r
+     * @return The rank of the end\r
+     */\r
     public long getLastRank() {\r
         return fLastRank;\r
     }\r
 \r
+    /**\r
+     * Get the list of rank ranges corresponding to this time event.\r
+     *\r
+     * @return The rank range list\r
+     */\r
     public RankRangeList getRankRangeList() {\r
         return fRankRangeList;\r
     }\r
 \r
+    /**\r
+     * Merge another time event with this one.\r
+     *\r
+     * @param event\r
+     *            The other event\r
+     */\r
     public void merge(TimeChartEvent event) {\r
        mergeDecorations(event);\r
         if (fTime == event.getTime() && fDuration == event.getDuration()) {\r
@@ -101,6 +135,13 @@ public class TimeChartEvent implements ITimeEvent {
         }\r
     }\r
 \r
+    /**\r
+     * Merge the decorations of another time event with the decorations of this\r
+     * one.\r
+     *\r
+     * @param event\r
+     *            The other event\r
+     */\r
     public void mergeDecorations(TimeChartEvent event) {\r
         fColorSettingPriority = Math.min(fColorSettingPriority, event.getColorSettingPriority());\r
         fIsBookmark |= event.fIsBookmark;\r
@@ -108,38 +149,87 @@ public class TimeChartEvent implements ITimeEvent {
        fIsSearchMatch |= event.fIsSearchMatch;\r
     }\r
 \r
+    /**\r
+     * Get the number of time events that have been merged with this one (starts\r
+     * counting at 1 if no merge happened).\r
+     *\r
+     * @return The current number of events in the bath\r
+     */\r
     public long getNbEvents() {\r
         return fNbEvents;\r
     }\r
 \r
+    /**\r
+     * Retrieve the color setting priority.\r
+     *\r
+     * @return The priority\r
+     */\r
     public int getColorSettingPriority() {\r
        return fColorSettingPriority;\r
     }\r
 \r
+    /**\r
+     * Set the color setting priority.\r
+     *\r
+     * @param priority\r
+     *            The priority to set\r
+     */\r
     public void setColorSettingPriority(int priority) {\r
        fColorSettingPriority = priority;\r
     }\r
 \r
+    /**\r
+     * Check if this time event is bookmarked\r
+     *\r
+     * @return Y/N\r
+     */\r
     public boolean isBookmarked() {\r
        return fIsBookmark;\r
     }\r
 \r
+    /**\r
+     * Set this time event to be bookmarked or not.\r
+     *\r
+     * @param isBookmarked\r
+     *            Should time time event become a bookmark, or not\r
+     */\r
     public void setIsBookmarked(boolean isBookmarked) {\r
        fIsBookmark = isBookmarked;\r
     }\r
 \r
+    /**\r
+     * Check if this time is currently visible or not.\r
+     *\r
+     * @return If the event is visible\r
+     */\r
     public boolean isVisible() {\r
        return fIsVisible;\r
     }\r
 \r
+    /**\r
+     * Set this time event to visible (or to non-visible).\r
+     *\r
+     * @param isVisible The new status\r
+     */\r
     public void setIsVisible(boolean isVisible) {\r
        fIsVisible = isVisible;\r
     }\r
 \r
+    /**\r
+     * Check if the time event matches the current search.\r
+     *\r
+     * @return If it matches, Y/N\r
+     */\r
     public boolean isSearchMatch() {\r
        return fIsSearchMatch;\r
     }\r
 \r
+    /**\r
+     * Mark this event as matching (or non-matching) the current search.\r
+     *\r
+     * @param isSearchMatch\r
+     *            The new matching status\r
+     */\r
     public void setIsSearchMatch(boolean isSearchMatch) {\r
        fIsSearchMatch = isSearchMatch;\r
     }\r
This page took 0.048819 seconds and 5 git commands to generate.