/**********************************************************************
- * 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
*
*/
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;
}
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
*/
@Override
public boolean contains(int x, int y) {
- // TODO Auto-generated method stub
return false;
}
}