tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / core / EllipsisMessage.java
index 273570d59924f4d16514c1944d65b704fd69f7cd..a16aff81fb87474f93b88d15559423b4d8914daf 100755 (executable)
@@ -1,30 +1,30 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 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.IColor;
 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;
 
 /**
  * Class to draw Ellipsis Message.
- * 
+ *
  * @version 1.0
  * @author sveyrier
- * 
+ *
  */
-public class EllipsisMessage extends AsyncMessage implements ITimeRange {
+public class EllipsisMessage extends AsyncMessage {
 
     /*
      * (non-Javadoc)
@@ -32,9 +32,9 @@ public class EllipsisMessage extends AsyncMessage implements ITimeRange {
      */
     @Override
     public int getX() {
-        if (startLifeline == null) {
+        if (fStartLifeline == null) {
             return super.getX() + super.getWidth() - 16;
-        } 
+        }
         return super.getX();
     }
 
@@ -59,7 +59,7 @@ public class EllipsisMessage extends AsyncMessage implements ITimeRange {
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessage#drawMessage(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC)
-     */  
+     */
     @Override
     protected void drawMessage(IGC context) {
         // temporary store the coordinates to avoid more methods calls
@@ -69,7 +69,7 @@ public class EllipsisMessage extends AsyncMessage implements ITimeRange {
         int height = getHeight();
 
         // UML2 found message (always drawn from left to right)
-        if (startLifeline == null && endLifeline != null) {
+        if (fStartLifeline == null && fEndLifeline != null) {
             // Draw the message label above the message and centered
             // The label is truncated if it cannot fit between the two message end
             // 2*Metrics.MESSAGES_NAME_SPACING = space above the label + space below the label
@@ -91,7 +91,7 @@ public class EllipsisMessage extends AsyncMessage implements ITimeRange {
             context.setBackground(storedColor);
         }
         // UML2 lost message (always drawn from left to right)
-        else if (endLifeline == null && startLifeline != null) {
+        else if (fEndLifeline == null && fStartLifeline != null) {
             // Draw the message label above the message and centered
             // The label is truncated if it cannot fit between the two message end
             // 2*Metrics.MESSAGES_NAME_SPACING = space above the label + space below the label
@@ -122,27 +122,31 @@ public class EllipsisMessage extends AsyncMessage implements ITimeRange {
     /*
      * (non-Javadoc)
      * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessage#draw(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC)
-     */  
+     */
     @Override
     public void draw(IGC context) {
         if (!isVisible()) {
             return;
         }
+
+        ISDPreferences pref = SDViewPref.getInstance();
+
         // Draw it selected?*/
         if (isSelected()) {
+
             /*
              * Draw it twice First time, bigger inverting selection colors Second time, regular drawing using selection
              * colors This create the highlight effect
              */
-            context.setForeground(Frame.getUserPref().getBackGroundColorSelection());
+            context.setForeground(pref.getBackGroundColorSelection());
             context.setLineWidth(Metrics.SELECTION_LINE_WIDTH);
             drawMessage(context);
-            context.setBackground(Frame.getUserPref().getBackGroundColorSelection());
-            context.setForeground(Frame.getUserPref().getForeGroundColorSelection());
+            context.setBackground(pref.getBackGroundColorSelection());
+            context.setForeground(pref.getForeGroundColorSelection());
             // Second drawing is done after the else
         } else {
-            context.setBackground(Frame.getUserPref().getBackGroundColor(ISDPreferences.PREF_ASYNC_MESS));
-            context.setForeground(Frame.getUserPref().getForeGroundColor(ISDPreferences.PREF_ASYNC_MESS));
+            context.setBackground(pref.getBackGroundColor(ISDPreferences.PREF_ASYNC_MESS));
+            context.setForeground(pref.getForeGroundColor(ISDPreferences.PREF_ASYNC_MESS));
         }
         if (hasFocus()) {
             context.setDrawTextWithFocusStyle(true);
This page took 0.0251 seconds and 5 git commands to generate.