tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / core / HotSpot.java
index 669dc6201e5daddb5fe5525ffb1e7b7b7fb4890e..e058affdf50ad3449251296429e033ee142345b8 100755 (executable)
@@ -1,25 +1,25 @@
 /**********************************************************************
- * 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.drawings.IImage;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.ISDPreferences;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences.SDViewPref;
 
 /**
  * Class to add a hot spot marker.
- * 
+ *
  * @version 1.0
  * @author sveyrier
  */
@@ -51,7 +51,7 @@ public class HotSpot extends GraphNode {
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
-    
+
     /**
      * Default constructor
      */
@@ -65,7 +65,7 @@ public class HotSpot extends GraphNode {
 
     /**
      * Set the marker image.
-     * 
+     *
      * @param img A image to set
      */
     public void setImage(IImage img) {
@@ -122,7 +122,7 @@ public class HotSpot extends GraphNode {
 
     /**
      * Set the lifeline on which the execution occurrence appears.
-     * 
+     *
      * @param occ the parent lifeline
      */
     public void setExecution(BasicExecutionOccurrence occ) {
@@ -132,7 +132,7 @@ public class HotSpot extends GraphNode {
 
     /**
      * Get the lifeline on which the execution occurrence appears.
-     * 
+     *
      * @return - the parent lifeline
      */
     public BasicExecutionOccurrence getExecOcc() {
@@ -140,8 +140,8 @@ public class HotSpot extends GraphNode {
     }
 
     /**
-     * Returns the occurrence number. 
-     * 
+     * Returns the occurrence number.
+     *
      * @return the occurrence number.
      */
     public int getOccurrence() {
@@ -150,7 +150,7 @@ public class HotSpot extends GraphNode {
 
     /**
      * Set the occurrence number.
-     * 
+     *
      * @param occ A number to set.
      */
     public void setOccurrence(int occ) {
@@ -164,14 +164,16 @@ public class HotSpot extends GraphNode {
     @Override
     public void draw(IGC context) {
 
+        ISDPreferences pref = SDViewPref.getInstance();
+
         // The execution occurrence is selected
         // if the owning lifeline is selected
         if (isSelected() || (fExecOcc != null && fExecOcc.isSelected()) || (fExecOcc != null && fExecOcc.getLifeline() != null && fExecOcc.getLifeline().isSelected())) {
-            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_EXEC));
-            context.setForeground(Frame.getUserPref().getForeGroundColor(ISDPreferences.PREF_EXEC));
+            context.setBackground(pref.getBackGroundColor(ISDPreferences.PREF_EXEC));
+            context.setForeground(pref.getForeGroundColor(ISDPreferences.PREF_EXEC));
         }
         context.drawImage(fImage, getX(), getY(), getWidth(), getHeight());
     }
@@ -205,7 +207,7 @@ public class HotSpot extends GraphNode {
         int width = getWidth();
         int height = getHeight();
 
-        if (Frame.contains(x, y, width, height, xValue, yValue)) {
+        if (GraphNode.contains(x, y, width, height, xValue, yValue)) {
             return true;
         }
         return false;
This page took 0.025403 seconds and 5 git commands to generate.