/**********************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- *
+ * Copyright (c) 2005, 2012 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.ui.views.uml2sd.drawings.IGC;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.ISDPreferences;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.SDViewPref;
/**
* <p>
* 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
*/
* The graphNode ID
*/
public static final String STOP = "STOP"; //$NON-NLS-1$
-
+
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
protected Lifeline fLifeline = null;
/**
* This basically represents the time when the stop occurs on the owning Lifeline
- *
+ *
* @see Lifeline Lifeline for more event occurence details
*/
protected int fEventOccurrence = 0;
/**
* Set the lifeline on which the stop must be draw
- *
+ *
* @param theLifeline The the stop owing lifeline
*/
public void setLifeline(Lifeline theLifeline) {
/**
* Set the event occurrence when this stop appears
- *
+ *
* @param occurrence the eventOccurence to assign to the stop
*/
public void setEventOccurrence(int occurrence) {
*/
@Override
public void draw(IGC context) {
+
+ ISDPreferences pref = SDViewPref.getInstance();
+
// Set the appropriate color depending if the graph node if selected or not
if (fLifeline.isSelected()) {
- context.setForeground(Frame.getUserPref().getBackGroundColorSelection());
+ context.setForeground(pref.getBackGroundColorSelection());
context.setLineWidth(Metrics.SELECTION_LINE_WIDTH);
int lastWidth = context.getLineWidth();
context.setLineWidth(9);
context.drawLine(getX() + getWidth(), getY(), getX(), getY() + getHeight());
// restore the context
context.setLineWidth(lastWidth);
- context.setBackground(Frame.getUserPref().getBackGroundColorSelection());
- context.setForeground(Frame.getUserPref().getForeGroundColorSelection());
+ context.setBackground(pref.getBackGroundColorSelection());
+ context.setForeground(pref.getForeGroundColorSelection());
} else {
- context.setBackground(Frame.getUserPref().getBackGroundColor(ISDPreferences.PREF_LIFELINE));
- context.setForeground(Frame.getUserPref().getForeGroundColor(ISDPreferences.PREF_LIFELINE));
+ context.setBackground(pref.getBackGroundColor(ISDPreferences.PREF_LIFELINE));
+ context.setForeground(pref.getForeGroundColor(ISDPreferences.PREF_LIFELINE));
}
int lastWidth = context.getLineWidth();
context.setLineWidth(3);