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 / Stop.java
index 8b3f124b084413acfcd881b17fc6741356de3620..9273ab832d73aecc50e8f164750071d8917ddb49 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: Stop.java,v 1.2 2006/09/20 20:56:25 ewchan Exp $
  * 
  * Contributors: 
  * IBM - Initial API and implementation
 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.ISDPreferences;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.ISDPreferences;
 
 /**
- * It is the UML2 stop graphical representation in the sequence diagram viewer.<br>
- * This draw a cross on the lifeline. The stop y coordinate depend on the event occurrence when it appears.<br>
- * A stop is never drawn it is assigned to a lifeline.<br>
- * <br>
+ * <p>
+ * It is the UML2 stop graphical representation in the sequence diagram viewer.
+ * This draw a cross on the lifeline. The stop y coordinate depend on the event occurrence when it appears.
+ * A stop is never drawn it is assigned to a lifeline.
+ * </p>
  * 
+ * @version 1.0
  * @author sveyrier
  */
 public class Stop extends GraphNode {
 
-    /**
-     * The owning lifeline on which the stop appears
-     */
-    protected Lifeline lifeline = null;
-
+    // ------------------------------------------------------------------------
+    // Constants
+    // ------------------------------------------------------------------------
     /**
      * The graphNode ID
      */
     public static final String STOP = "STOP"; //$NON-NLS-1$
-
+    
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+    /**
+     * The owning lifeline on which the stop appears
+     */
+    protected Lifeline lifeline = null;
     /**
      * This basically represents the time when the stop occurs on the owning Lifeline
      * 
@@ -42,31 +50,55 @@ public class Stop extends GraphNode {
      */
     protected int eventOccurrence = 0;
 
+    // ------------------------------------------------------------------------
+    // Methods
+    // ------------------------------------------------------------------------
+
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getX()
+     */
     @Override
     public int getX() {
-        if (lifeline == null)
+        if (lifeline == null) {
             return 0;
+        }
         return lifeline.getX() + Metrics.getLifelineWidth() / 2 - Metrics.STOP_WIDTH / 2;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getY()
+     */
     @Override
     public int getY() {
-        if (lifeline == null)
+        if (lifeline == null) {
             return 0;
+        }
         return lifeline.getY() + lifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * eventOccurrence - Metrics.STOP_WIDTH / 2;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getWidth()
+     */
     @Override
     public int getWidth() {
-        if (lifeline == null)
+        if (lifeline == null) {
             return 0;
+        }
         return Metrics.STOP_WIDTH;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode#getHeight()
+     */
     @Override
     public int getHeight() {
-        if (lifeline == null)
+        if (lifeline == null) {
             return 0;
+        }
         return Metrics.STOP_WIDTH;
     }
 
@@ -88,6 +120,10 @@ public class Stop extends GraphNode {
         eventOccurrence = occurrence;
     }
 
+    /*
+     * (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) {
         // Set the appropriate color depending if the graph node if selected or not
@@ -131,7 +167,6 @@ public class Stop extends GraphNode {
      */
     @Override
     public boolean contains(int x, int y) {
-        // TODO Auto-generated method stub
         return false;
     }
 }
This page took 0.024908 seconds and 5 git commands to generate.