tmf/lttng: Remove unneeded (non-Javadoc) comments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / core / ExecutionOccurrence.java
index a7a1c7fdcaace502db0dbc3b020d1ab26092afb8..acadb480b3fe6c30e0b6177cd693ab57a4c3f59f 100755 (executable)
 /**********************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- * 
+ * Copyright (c) 2005, 2013 IBM Corporation, 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: 
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ *
+ * Contributors:
+ *     IBM - Initial API and implementation
+ *     Bernd Hufmann - Updated for TMF
  **********************************************************************/
+
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.core;
 
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IColor;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IImage;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.ISDPreferences;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.SDViewPref;
 
 /**
  * ExecutionOccurrence is the UML2 execution occurrence graphical representation. It is a BasicExecutionOccurrence on
  * which you can customize fill and/or.
- * 
+ *
  * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.Lifeline Lifeline for more event occurence details
- * @version 1.0 
+ * @version 1.0
  * @author sveyrier
- * 
+ *
  */
 public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITimeRange {
 
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
+
     /**
-     * Set the red, green and blue value of the optional color to be used for filling the execution occurrence. 
+     * Set the red, green and blue value of the optional color to be used for filling the execution occurrence.
      */
-    protected int[] fillRGB;
+    protected int[] fFillRGB;
     /**
      * Set the red, green and blue value of the optional color to be used for drawing the execution occurrence
      */
-    protected int[] strokeRGB;
+    protected int[] fStrokeRGB;
     /**
      * The occurrence image.
      */
-    protected IImage image;
+    protected IImage fImage;
     /**
      * The top ellipses image.
      */
-    protected IImage ellipsesImage;
+    protected IImage fEllipsesImage;
     /**
-     *  The start time stamp. 
+     *  The start time stamp.
      */
-    protected ITmfTimestamp startTime;
+    protected ITmfTimestamp fStartTime;
     /**
      * The end time stamp;
      */
-    protected ITmfTimestamp endTime;
+    protected ITmfTimestamp fEndTime;
     /**
-     * Flag to indicate whether time information is available or not. 
+     * Flag to indicate whether time information is available or not.
      */
-    protected boolean hasTime;
+    protected boolean fHasTimeInfo;
 
     // ------------------------------------------------------------------------
     // Methods
     // ------------------------------------------------------------------------
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BasicExecutionOccurrence#setLifeline(org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.Lifeline)
-     */
+
     @Override
     public void setLifeline(Lifeline theLifeline) {
         super.setLifeline(theLifeline);
-        if (lifeline != null && hasTime) {
-            lifeline.hasTime = true;
-            if (lifeline.getFrame() != null) {
-                lifeline.getFrame().setHasTimeInfo(true);
+        if (fLifeline != null && fHasTimeInfo) {
+            fLifeline.fHasTimeInfo = true;
+            if (fLifeline.getFrame() != null) {
+                fLifeline.getFrame().setHasTimeInfo(true);
             }
         }
     }
 
     /**
      * Set the red, green and blue value of the optional color to be used for filling the execution occurrence.
-     * 
-     * @param _r A value for red.
-     * @param _g A green value for green.
-     * @param _b A value blue.
-     */
-    public void setFillColor(int _r, int _g, int _b) {
-        fillRGB = new int[3];
-        fillRGB[0] = _r;
-        fillRGB[1] = _g;
-        fillRGB[2] = _b;
+     *
+     * @param red A value for red.
+     * @param green A green value for green.
+     * @param blue A value blue.
+     */
+    public void setFillColor(int red, int green, int blue) {
+        fFillRGB = new int[3];
+        fFillRGB[0] = red;
+        fFillRGB[1] = green;
+        fFillRGB[2] = blue;
     }
 
     /**
      * Set the red, green and blue value of the optional color to be used for drawing the execution occurrence
-     * 
-     * @param _r A value for red.
-     * @param _g A green value for green.
-     * @param _b A value blue.
-     */
-    public void setStrokeColor(int _r, int _g, int _b) {
-        strokeRGB = new int[3];
-        strokeRGB[0] = _r;
-        strokeRGB[1] = _g;
-        strokeRGB[2] = _b;
+     *
+     * @param red A value for red.
+     * @param green A green value for green.
+     * @param blue A value blue.
+     */
+    public void setStrokeColor(int red, int green, int blue) {
+        fStrokeRGB = new int[3];
+        fStrokeRGB[0] = red;
+        fStrokeRGB[1] = green;
+        fStrokeRGB[2] = blue;
     }
 
     /**
      * Set the corresponding image.
-     * 
-     * @param image_ A image to set.
+     *
+     * @param image A image to set.
      */
-    public void setImage(IImage image_) {
-        image = image_;
+    public void setImage(IImage image) {
+        fImage = image;
     }
 
     /**
      * Set the top ellipses image.
-     * 
-     * @param image_ A image to set.
+     *
+     * @param image A image to set.
      */
-    public void setTopEllipsesImage(IImage image_) {
-        ellipsesImage = image_;
+    public void setTopEllipsesImage(IImage image) {
+        fEllipsesImage = image;
     }
 
     /**
      * Set the time when the execution occurrence starts.
-     * 
+     *
      * @param time the time when the execution occurrence starts
+     * @since 2.0
      */
     public void setStartTime(ITmfTimestamp time) {
-        startTime = time.clone();
-        hasTime = true;
-        if (lifeline != null) {
-            lifeline.setTimeInfo(true);
+        fStartTime = time;
+        fHasTimeInfo = true;
+        if (fLifeline != null) {
+            fLifeline.setTimeInfo(true);
         }
     }
 
     /**
      * Set the time when the execution occurrence ends.
-     * 
+     *
      * @param time the time when the execution occurrence ends
+     * @since 2.0
      */
     public void setEndTime(ITmfTimestamp time) {
-        endTime = time.clone();
-        hasTime = true;
-        if (lifeline != null) {
-            lifeline.setTimeInfo(true);
+        fEndTime = time;
+        fHasTimeInfo = true;
+        if (fLifeline != null) {
+            fLifeline.setTimeInfo(true);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.ITimeRange#getStartTime()
+    /**
+     * @since 2.0
      */
     @Override
     public ITmfTimestamp getStartTime() {
-        return startTime;
+        return fStartTime;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.ITimeRange#getEndTime()
+    /**
+     * @since 2.0
      */
     @Override
     public ITmfTimestamp getEndTime() {
-        return endTime;
+        return fEndTime;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.ITimeRange#hasTimeInfo()
-     */
     @Override
     public boolean hasTimeInfo() {
-        return hasTime;
+        return fHasTimeInfo;
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BasicExecutionOccurrence#draw(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC)
-     */
     @Override
     public void draw(IGC context) {
         super.draw(context);
@@ -190,47 +180,38 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
         int y = getY();
         int width = getWidth();
         int height = getHeight();
-        if (image != null) {
-            context.drawImage(image, x + width - 4, y + height - 11, 8, 11);
+        if (fImage != null) {
+            context.drawImage(fImage, x + width - 4, y + height - 11, 8, 11);
         }
-        if (ellipsesImage != null) {
-            context.drawImage(ellipsesImage, x + width, y, 40, 10);
+        if (fEllipsesImage != null) {
+            context.drawImage(fEllipsesImage, x + width, y, 40, 10);
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BasicExecutionOccurrence#setUnselectedFillColor(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC)
-     */
     @Override
     protected IColor setUnselectedFillColor(IGC context) {
-        if (fillRGB != null) {
-            IColor tempFillColor = context.createColor(fillRGB[0], fillRGB[1], fillRGB[2]);
-            if (Frame.getUserPref().useGradienColor()) {
+        ISDPreferences pref = SDViewPref.getInstance();
+        if (fFillRGB != null) {
+            IColor tempFillColor = context.createColor(fFillRGB[0], fFillRGB[1], fFillRGB[2]);
+            if (pref.useGradienColor()) {
                 context.setGradientColor(tempFillColor);
-                context.setForeground(Frame.getUserPref().getForeGroundColor(ISDPreferences.PREF_EXEC));
-                context.setBackground(Frame.getUserPref().getBackGroundColor(ISDPreferences.PREF_FRAME));
+                context.setForeground(pref.getForeGroundColor(ISDPreferences.PREF_EXEC));
+                context.setBackground(pref.getBackGroundColor(ISDPreferences.PREF_FRAME));
             } else {
                 context.setBackground(tempFillColor);
             }
             return tempFillColor;
-        } else {
-            return super.setUnselectedFillColor(context);
         }
+        return super.setUnselectedFillColor(context);
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BasicExecutionOccurrence#setUnselectedStrokeColor(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC)
-     */
     @Override
     protected IColor setUnselectedStrokeColor(IGC context) {
-        if (strokeRGB != null) {
-            IColor tempStrokeColor = context.createColor(strokeRGB[0], strokeRGB[1], strokeRGB[2]);
+        if (fStrokeRGB != null) {
+            IColor tempStrokeColor = context.createColor(fStrokeRGB[0], fStrokeRGB[1], fStrokeRGB[2]);
             context.setForeground(tempStrokeColor);
             return tempStrokeColor;
-        } else {
-            return super.setUnselectedStrokeColor(context);
         }
+        return super.setUnselectedStrokeColor(context);
     }
 }
This page took 0.029171 seconds and 5 git commands to generate.