Fix static analysis warnings for UML2SD
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / core / SyncMessageReturn.java
index d9e43712cec340a62bad04f0e7a4341c82a836a8..7330d139d563c28ac7c1aa0dc5f63d61fac1aef4 100755 (executable)
@@ -1,10 +1,11 @@
 /**********************************************************************
- * 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: SyncMessageReturn.java,v 1.2 2006/09/20 20:56:25 ewchan Exp $
  * 
  * Contributors: 
  * IBM - Initial API and implementation
@@ -13,7 +14,7 @@
 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;
 
 /**
  * The message return graph node implementation.<br>
@@ -26,22 +27,42 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.ISDPreferences;
  * 
  * 
  * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.SyncMessage SyncMessage for usage example
+ * @version 1.0
  * @author sveyrier
  * 
  */
 public class SyncMessageReturn extends SyncMessage {
 
+    // ------------------------------------------------------------------------
+    // Constants
+    // ------------------------------------------------------------------------
     /**
-     * The associated message(the message it is the return).
+     * The graphNode ID
      */
-    protected SyncMessage message = null;
-
     public static final String SYNC_MESS_RET_TAG = "SyncMessageRet"; //$NON-NLS-1$
+    
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+    /**
+     * The associated message(the message it is the return).
+     */
+    protected SyncMessage fMessage = null;
 
+    // ------------------------------------------------------------------------
+    // Constractors
+    // ------------------------------------------------------------------------
+    
+    /**
+     * Default constructor
+     */
     public SyncMessageReturn() {
-        prefId = ISDPreferences.PREF_SYNC_MESS_RET;
+        fPrefId = ISDPreferences.PREF_SYNC_MESS_RET;
     }
 
+    // ------------------------------------------------------------------------
+    // Methods
+    // ------------------------------------------------------------------------
     /**
      * Set the associated message (the message it is the return).<br>
      * Setting the association will activate the navigation in the default sequence diagram implementation to the
@@ -50,8 +71,8 @@ public class SyncMessageReturn extends SyncMessage {
      * @param parentMessage the message to associate
      */
     public void setMessage(SyncMessage parentMessage) {
-        message = parentMessage;
-        message.setMessageReturn(this);
+        fMessage = parentMessage;
+        fMessage.setMessageReturn(this);
     }
 
     /**
@@ -60,26 +81,35 @@ public class SyncMessageReturn extends SyncMessage {
      * @return the associated message
      */
     public SyncMessage getMessage() {
-        return message;
+        return fMessage;
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.SyncMessage#draw(org.eclipse.linuxtools.tmf.ui.views.uml2sd.drawings.IGC)
+     */
     @Override
     public void draw(IGC context) {
-        if (!isVisible())
+        if (!isVisible()) {
             return;
+        }
         int oldStyle = context.getLineStyle();
         // Message return are dashed
         context.setLineStyle(context.getLineDotStyle());
-        // Draw it selected?*/
+        // Draw it selected?
         if (!isSelected()) {
-            context.setBackground(Frame.getUserPref().getBackGroundColor(prefId));
-            context.setForeground(Frame.getUserPref().getForeGroundColor(prefId));
+            context.setBackground(Frame.getUserPref().getBackGroundColor(fPrefId));
+            context.setForeground(Frame.getUserPref().getForeGroundColor(fPrefId));
         }
         super.draw(context);
         // restore the context
         context.setLineStyle(oldStyle);
     }
 
+    /*
+     * (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.SyncMessage#getArrayId()
+     */
     @Override
     public String getArrayId() {
         return SYNC_MESS_RET_TAG;
This page took 0.025461 seconds and 5 git commands to generate.