/**********************************************************************
- * 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;
/**
* 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[] fFillRGB;
/**
*/
protected IImage fEllipsesImage;
/**
- * The start time stamp.
+ * The start time stamp.
*/
protected ITmfTimestamp fStartTime;
/**
*/
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 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);
/**
* Set the red, green and blue value of the optional color to be used for filling the execution occurrence.
- *
+ *
* @param red A value for red.
* @param green A green value for green.
* @param blue A value blue.
/**
* Set the red, green and blue value of the optional color to be used for drawing the execution occurrence
- *
+ *
* @param red A value for red.
* @param green A green value for green.
* @param blue A value blue.
/**
* Set the corresponding image.
- *
+ *
* @param image A image to set.
*/
public void setImage(IImage image) {
/**
* Set the top ellipses image.
- *
+ *
* @param image A image to set.
*/
public void setTopEllipsesImage(IImage 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) {
- fStartTime = time.clone();
+ 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) {
- fEndTime = time.clone();
+ 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 fStartTime;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.ITimeRange#getEndTime()
+ /**
+ * @since 2.0
*/
@Override
public ITmfTimestamp getEndTime() {
return fEndTime;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.ITimeRange#hasTimeInfo()
- */
@Override
public boolean hasTimeInfo() {
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);
}
}
- /*
- * (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) {
ISDPreferences pref = SDViewPref.getInstance();
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 (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);
}
}