Java Doc and API clean up of TMF UML Sequence diagram framework
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / core / HotSpot.java
index 50c1089c2bd46312711e98487feb5b69ea14b8a0..b6c6ac1f8bd507fede2679342f544a48cf49d0c1 100755 (executable)
@@ -1,10 +1,11 @@
 /**********************************************************************
- * Copyright (c) 2005, 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * 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
- * $Id: HotSpot.java,v 1.2 2006/09/20 20:56:27 ewchan Exp $
  * 
  * Contributors: 
  * IBM - Initial API and implementation
@@ -14,61 +15,109 @@ package org.eclipse.linuxtools.tmf.ui.views.uml2sd.core;
 
 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.drawings.ISDPreferences;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.ISDPreferences;
 
 /**
+ * Class to add a hot spot marker.
+ * 
+ * @version 1.0
  * @author sveyrier
  */
 public class HotSpot extends GraphNode {
+    // ------------------------------------------------------------------------
+    // Constants
+    // ------------------------------------------------------------------------
+    /**
+     * The grahNode ID constant
+     */
+    public static final String GLYPH = "Glyph"; //$NON-NLS-1$
 
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+    /**
+     * The execution occurrence the hot spot marker is for.
+     */
     protected BasicExecutionOccurrence execOcc = null;
+    /**
+     * The occurrence number.
+     */
     protected int occurrence = 0;
+    /**
+     * The marker image to display.
+     */
     protected IImage image = null;
 
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+    
     /**
-     * The grahNode ID constant
+     * Default constructor
      */
-    public static final String GLYPH = "Glyph"; //$NON-NLS-1$
-
     public HotSpot() {
         prefId = ISDPreferences.PREF_EXEC;
     }
 
+    // ------------------------------------------------------------------------
+    // Methods
+    // ------------------------------------------------------------------------
+
+    /**
+     * Set the marker image.
+     * 
+     * @param img A image to set
+     */
     public void setImage(IImage img) {
         image = img;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getX()
+     */
     @Override
     public int getX() {
-        if (execOcc != null)
+        if (execOcc != null) {
             return execOcc.getX() - 3;
-        else
-            return 0;
-
+        }
+        return 0;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getY()
+     */
     @Override
     public int getY() {
-        if (execOcc != null)
+        if (execOcc != null){
             return execOcc.getY();
-        else
-            return 0;
+        }
+        return 0;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getWidth()
+     */
     @Override
     public int getWidth() {
-        if (execOcc != null)
+        if (execOcc != null) {
             return execOcc.getWidth() + 7;
-        else
-            return 0;
+        }
+        return 0;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getHeight()
+     */
     @Override
     public int getHeight() {
-        if (execOcc != null)
+        if (execOcc != null) {
             return execOcc.getWidth() + 10;
-        else
-            return 0;
+        }
+        return 0;
     }
 
     /**
@@ -90,14 +139,28 @@ public class HotSpot extends GraphNode {
         return execOcc;
     }
 
+    /**
+     * Returns the occurrence number. 
+     * 
+     * @return the occurrence number.
+     */
     public int getOccurrence() {
         return occurrence;
     }
 
+    /**
+     * Set the occurrence number.
+     * 
+     * @param occ A number to set.
+     */
     public void setOccurrence(int occ) {
         occurrence = occ;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#draw(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC)
+     */
     @Override
     public void draw(IGC context) {
 
@@ -113,16 +176,28 @@ public class HotSpot extends GraphNode {
         context.drawImage(image, getX(), getY(), getWidth(), getHeight());
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getArrayId()
+     */
     @Override
     public String getArrayId() {
         return GLYPH;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#isVisible(int, int, int, int)
+     */
     @Override
     public boolean isVisible(int x, int y, int width, int height) {
         return true;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#contains(int, int)
+     */
     @Override
     public boolean contains(int _x, int _y) {
         int x = getX();
This page took 0.027468 seconds and 5 git commands to generate.