tmf: API clean-up of sequence diagram framework
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Thu, 16 May 2013 12:08:11 +0000 (08:08 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Wed, 22 May 2013 11:14:17 +0000 (07:14 -0400)
Throughout the sequence diagram framework, most member variables
were declared protected. However, in many cases getter and setter
methods exists and the member could have been declared private.
In some other cases, some of the attributes are internal data
and should not be be protected. This commit changes the modifier
of attributes to private. Getter and setter methods were added
where needed.

Change-Id: I7bf18335ff487c7a89b0d521e41b51e0bc3d1ad0
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/12880
Tested-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>

61 files changed:
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/uml2sd/TmfAsyncSequenceDiagramEvent.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/uml2sd/TmfSyncSequenceDiagramEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DiagramToolTip.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DrawableToolTip.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/NGC.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDWidget.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDWidgetSelectionProvider.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/AsyncMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/AsyncMessageReturn.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/BaseMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/BasicExecutionOccurrence.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/BasicFrame.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/EllipsisMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/ExecutionOccurrence.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/Frame.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/GraphNode.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/HotSpot.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/Lifeline.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/LifelineCategories.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/SDTimeEvent.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/Stop.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/SyncMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/core/SyncMessageReturn.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/Criteria.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/FilterCriteria.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/FilterListDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/MinMaxDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/PagesDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SDPrintDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SDPrintDialogUI.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SearchFilterDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/TabContents.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/drawings/impl/ColorImpl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/drawings/impl/FontImpl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/drawings/impl/ImageImpl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/BaseSDAction.java [new file with mode: 0644]
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/ConfigureMinMax.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/FirstPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/LastPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDDown.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDLeft.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDRight.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDUp.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveToMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/NextPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDFiltersDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDFindDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDPagesDialog.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/PrevPage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/Print.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/ShowNodeEnd.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/ShowNodeStart.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/Zoom.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/load/LoadersManager.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfAsyncMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfSyncMessage.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewPref.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewerPage.java

index 1ba49ba99db7223c545f89772c1ea7ec16a60e5d..ad0e07e8fb9f39c1bed2db9ce1d65b380b3a5acc 100644 (file)
@@ -30,7 +30,7 @@ public class TmfAsyncSequenceDiagramEvent extends TmfSyncSequenceDiagramEvent im
     /**
      * The end time of the sequence diagram event (i.e. time when signal was received).
      */
-    final protected ITmfTimestamp fEndTime;
+    private final ITmfTimestamp fEndTime;
 
     // ------------------------------------------------------------------------
     // Constructors
index 462b6392ace6bcc51489826385d4fd1aa91e1753..aff49d792fb41ec4c5dd5f19ec94d52a8940bcce 100644 (file)
@@ -30,19 +30,19 @@ public class TmfSyncSequenceDiagramEvent implements ITmfSyncSequenceDiagramEvent
     /**
      * The start time of the sequence diagram event (i.e. time when signal was sent).
      */
-    final protected ITmfTimestamp fStartTime;
+    private final ITmfTimestamp fStartTime;
     /**
      * The name of the sender of the signal.
      */
-    final protected String fSender;
+    private final String fSender;
     /**
      * The name of the receiver of the signal.
      */
-    final protected String fReceiver;
+    private final String fReceiver;
     /**
      * The name of the signal
      */
-    final protected String fName;
+    private final String fName;
 
     // ------------------------------------------------------------------------
     // Constructors
index e0a2bf2207aea0369cb4509f4582de150bce0c86..ba71d0915d87c5463230b7ba8252fd031588e0dd 100755 (executable)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation, 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
@@ -38,19 +38,15 @@ public class DiagramToolTip {
     /**
      * The parent control where the tooltip must be drawn.
      */
-    protected Control fParent = null;
+    private Control fParent = null;
     /**
      * The tooltip shell.
      */
-    protected Shell fToolTipShell = null;
-    /**
-     * The tooltip text.
-     */
-    protected String fText = null;
+    private Shell fToolTipShell = null;
     /**
      * The text box.
      */
-    protected Text fTextBox = null;
+    private Text fTextBox = null;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -84,7 +80,6 @@ public class DiagramToolTip {
             return;
         }
 
-        fText = value;
         int w = fToolTipShell.getBounds().width;
         Point hr = Display.getDefault().getCursorLocation();
         int cursorH = 32;
@@ -111,7 +106,6 @@ public class DiagramToolTip {
         fToolTipShell.setSize(fTextBox.getSize());
         fTextBox.setVisible(true);
         fToolTipShell.setVisible(true);
-
     }
 
     /**
@@ -121,4 +115,12 @@ public class DiagramToolTip {
         fToolTipShell.setVisible(false);
     }
 
+    /**
+     * @return parent control
+     * @since 2.0
+     */
+    protected Control getParent() {
+        return fParent;
+    }
+
 }
index 4bcfb92f3ed470a8ea5a21c17b0acabbd8be38c1..5e63247b263fa20afb20b16c9a593af570e58816 100755 (executable)
@@ -45,19 +45,19 @@ public class DrawableToolTip implements PaintListener {
     /**
      * The parent control where the tooltip must be drawn
      */
-    protected Composite fParent = null;
+    private Composite fParent = null;
     /**
      * The tooltip shell
      */
-    protected Shell fToolTipShell = null;
+    private Shell fToolTipShell = null;
     /**
      * The Time range data.
      */
-    protected TmfTimeRange fMinMaxRange;
+    private TmfTimeRange fMinMaxRange;
     /**
      * The current time.
      */
-    protected ITmfTimestamp fCurrentValue;
+    private ITmfTimestamp fCurrentValue;
     /**
      * The horizontal margin used for drawing.
      */
@@ -77,11 +77,11 @@ public class DrawableToolTip implements PaintListener {
     /**
      * The text to display
      */
-    protected String fMessage;
+    private String fMessage;
     /**
      * The color array used to represent the 10 time range slices
      */
-    protected Color[] fColors;
+    private Color[] fColors;
 
     // ------------------------------------------------------------------------
     // Constructors
index 9869074255136840f36caaa6f2b8a21371e1db54..e1642a3ff9c73a6dda2b28cde51ff7b280b91782 100755 (executable)
@@ -45,47 +45,47 @@ public class NGC implements IGC {
     /**
      * The graphical context.
      */
-    protected GC fContext;
+    private GC fContext;
     /**
      * The reference to the sequence diagram view.
      */
-    protected SDWidget fView;
+    private SDWidget fView;
     /**
      * A reference to the last used font.
      */
-    protected Font fTempFont = null;
+    private Font fTempFont = null;
     /**
      * The color of the gradient.
      */
-    protected IColor fGradientColor = null;
+    private IColor fGradientColor = null;
     /**
      * The color of the background.
      */
-    protected IColor fBackground = null;
+    private IColor fBackground = null;
     /**
      * The color of the foreground.
      */
-    protected IColor fForeground = null;
+    private IColor fForeground = null;
     /**
      * The current visible y screen bounds
      */
-    protected int fVisibleY;
+    private int fVisibleY;
     /**
      * The current visible x screen bound.
      */
-    protected int fVisibleX;
+    private int fVisibleX;
     /**
      * The current yx value (view visible height - visible screen bounds)
      */
-    protected int yx;
+    private int yx;
     /**
      * The current xx value (view visible width - visible screen bounds)
      */
-    protected int xx;
+    private int xx;
     /**
      * <code>true</code> to draw with focus else <code>false</code>.
      */
-    protected boolean fDrawWithFocus = false;
+    private boolean fDrawWithFocus = false;
 
     /**
      * The static visible screen bounds.
@@ -124,22 +124,108 @@ public class NGC implements IGC {
 
     @Override
     public int getContentsX() {
-        return Math.round(fView.getContentsX() / fView.fZoomValue);
+        return Math.round(fView.getContentsX() / fView.getZoomValue());
     }
 
     @Override
     public int getContentsY() {
-        return Math.round(fView.getContentsY() / fView.fZoomValue);
+        return Math.round(fView.getContentsY() / fView.getZoomValue());
     }
 
     @Override
     public int getVisibleWidth() {
-        return Math.round(fView.getVisibleWidth() / fView.fZoomValue);
+        return Math.round(fView.getVisibleWidth() / fView.getZoomValue());
     }
 
     @Override
     public int getVisibleHeight() {
-        return Math.round(fView.getVisibleHeight() / fView.fZoomValue);
+        return Math.round(fView.getVisibleHeight() / fView.getZoomValue());
+    }
+
+    /**
+     * Returns the current visible y screen bounds.
+     *
+     * @return the current visible y screen bounds
+     * @since 2.0
+     */
+    protected int getVisibleY() {
+        return fVisibleY;
+    }
+
+    /**
+     * Sets the current visible y screen bounds.
+     *
+     * @param visibleY
+     *          the current visible y screen bounds
+     * @since 2.0
+     */
+    protected void setVisibleY(int visibleY) {
+        fVisibleY = visibleY;
+    }
+
+    /**
+     * Returns the current visible x screen bound.
+     *
+     * @return the current visible x screen bound.
+     * @since 2.0
+     *
+     */
+    protected int getfVisibleX() {
+        return fVisibleX;
+    }
+
+    /**
+     * Sets the current visible x screen bound.
+     *
+     * @param visibleX
+     *          the current visible x screen bound.
+     * @since 2.0
+     *
+     */
+    protected void setVisibleX(int visibleX) {
+        fVisibleX = visibleX;
+    }
+
+    /**
+     * Returns current yx value (view visible height - visible screen bounds).
+     *
+     * @return current yx value
+     * @since 2.0
+     */
+    protected int getYx() {
+        return yx;
+    }
+
+    /**
+     * Sets current yx value (view visible height - visible screen bounds).
+     *
+     * @param  yx
+     *       current yx value
+     * @since 2.0
+     */
+    protected void setYx(int yx) {
+        this.yx = yx;
+    }
+
+    /**
+     * Returns the current xx value (view visible width - visible screen bounds)
+     *
+     * @return the current xx value
+     * @since 2.0
+     */
+    protected int getXx() {
+        return xx;
+    }
+
+    /**
+     * Sets the current xx value (view visible width - visible screen bounds)
+     *
+     * @param xx
+     *      the current xx value
+     * @since 2.0
+     */
+    protected void setXx(int xx) {
+        this.xx = xx;
     }
 
     @Override
@@ -186,10 +272,10 @@ public class NGC implements IGC {
         int localX2 = x2;
         int localY2 = y2;
 
-        localX1 = Math.round(localX1 * fView.fZoomValue);
-        localY1 = Math.round(localY1 * fView.fZoomValue);
-        localX2 = Math.round(localX2 * fView.fZoomValue);
-        localY2 = Math.round(localY2 * fView.fZoomValue);
+        localX1 = Math.round(localX1 * fView.getZoomValue());
+        localY1 = Math.round(localY1 * fView.getZoomValue());
+        localX2 = Math.round(localX2 * fView.getZoomValue());
+        localY2 = Math.round(localY2 * fView.getZoomValue());
         localX1 = fView.contentsToViewX(localX1);
         localY1 = fView.contentsToViewY(localY1);
         localX2 = fView.contentsToViewX(localX2);
@@ -248,16 +334,16 @@ public class NGC implements IGC {
         int localWidth = width;
         int localHeight = height;
 
-        localX = Math.round(localX * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
         // Workaround to avoid problems for some special cases (not very nice)
         if (localY != getContentsY()) {
-            localY = Math.round(localY * fView.fZoomValue);
+            localY = Math.round(localY * fView.getZoomValue());
             localY = fView.contentsToViewY(localY);
         } else {
             localY = 0;
         }
-        localWidth = Math.round(localWidth * fView.fZoomValue);
-        localHeight = Math.round(localHeight * fView.fZoomValue);
+        localWidth = Math.round(localWidth * fView.getZoomValue());
+        localHeight = Math.round(localHeight * fView.getZoomValue());
         localX = fView.contentsToViewX(localX);
 
         if (localX < -fVisibleScreenBounds) {
@@ -301,10 +387,10 @@ public class NGC implements IGC {
             localHeight = -localHeight;
         }
 
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
-        localWidth = Math.round(localWidth * fView.fZoomValue);
-        localHeight = Math.round(localHeight * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
+        localWidth = Math.round(localWidth * fView.getZoomValue());
+        localHeight = Math.round(localHeight * fView.getZoomValue());
 
         setForeground(SDViewPref.getInstance().getForeGroundColorSelection());
         setBackground(SDViewPref.getInstance().getBackGroundColorSelection());
@@ -320,9 +406,9 @@ public class NGC implements IGC {
         int len = (points.length / 2) * 2;
         int[] localPoint = new int[len];
         for (int i = 0; i < len; i++) {
-            localPoint[i] = fView.contentsToViewX(Math.round(points[i] * fView.fZoomValue));
+            localPoint[i] = fView.contentsToViewX(Math.round(points[i] * fView.getZoomValue()));
             i++;
-            localPoint[i] = fView.contentsToViewY(Math.round(points[i] * fView.fZoomValue));
+            localPoint[i] = fView.contentsToViewY(Math.round(points[i] * fView.getZoomValue()));
         }
 
         if (validatePolygonHeight(localPoint) <= 0) {
@@ -337,9 +423,9 @@ public class NGC implements IGC {
         int len = (points.length / 2) * 2;
         int[] localPoint = new int[len];
         for (int i = 0; i < len; i++) {
-            localPoint[i] = fView.contentsToViewX(Math.round(points[i] * fView.fZoomValue));
+            localPoint[i] = fView.contentsToViewX(Math.round(points[i] * fView.getZoomValue()));
             i++;
-            localPoint[i] = fView.contentsToViewY(Math.round(points[i] * fView.fZoomValue));
+            localPoint[i] = fView.contentsToViewY(Math.round(points[i] * fView.getZoomValue()));
         }
 
         if (validatePolygonHeight(localPoint) <= 0) {
@@ -356,16 +442,16 @@ public class NGC implements IGC {
         int localWidth = width;
         int localHeight = height;
 
-        localX = Math.round(localX * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
         // Workaround to avoid problems for some special cases (not very nice)
         if (localY != getContentsY()) {
-            localY = Math.round(localY * fView.fZoomValue);
+            localY = Math.round(localY * fView.getZoomValue());
             localY = fView.contentsToViewY(localY) + 1;
         } else {
             localY = 1;
         }
-        localWidth = Math.round(localWidth * fView.fZoomValue) - 1;
-        localHeight = Math.round(localHeight * fView.fZoomValue) - 1;
+        localWidth = Math.round(localWidth * fView.getZoomValue()) - 1;
+        localHeight = Math.round(localHeight * fView.getZoomValue()) - 1;
         localX = fView.contentsToViewX(localX) + 1;
         if (localX < -fVisibleScreenBounds) {
             localWidth = localWidth + localX + fVisibleScreenBounds;
@@ -395,10 +481,10 @@ public class NGC implements IGC {
         int localWidth = width;
         int localHeight = height;
 
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
-        localWidth = Math.round(localWidth * fView.fZoomValue);
-        localHeight = Math.round(localHeight * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
+        localWidth = Math.round(localWidth * fView.getZoomValue());
+        localHeight = Math.round(localHeight * fView.getZoomValue());
         IColor tempColor = fForeground;
         setForeground(fGradientColor);
         localX = fView.contentsToViewX(localX);
@@ -442,8 +528,8 @@ public class NGC implements IGC {
         int localX = x;
         int localY = y;
 
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
         fContext.drawText(string, fView.contentsToViewX(localX), fView.contentsToViewY(localY), isTrans);
         if (fDrawWithFocus) {
             Point r = fContext.textExtent(string);
@@ -456,8 +542,8 @@ public class NGC implements IGC {
         int localX = x;
         int localY = y;
 
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
         fContext.drawText(string, fView.contentsToViewX(localX), fView.contentsToViewY(localY), true);
         if (fDrawWithFocus) {
             Point r = fContext.textExtent(string);
@@ -472,10 +558,10 @@ public class NGC implements IGC {
         int localWidth = width;
         int localHeight = height;
 
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
-        localWidth = Math.round(localWidth * fView.fZoomValue);
-        localHeight = Math.round(localHeight * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
+        localWidth = Math.round(localWidth * fView.getZoomValue());
+        localHeight = Math.round(localHeight * fView.getZoomValue());
         fContext.fillOval(fView.contentsToViewX(localX), fView.contentsToViewY(localY), localWidth, localHeight);
     }
 
@@ -572,15 +658,15 @@ public class NGC implements IGC {
         int localHeight = height;
 
         Point tx = fContext.textExtent(name);
-        localX = Math.round(localX * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
         int y = 0;
         // Workaround to avoid round problems for some special cases (not very nice)
         if (localY != getContentsY()) {
-            localY = Math.round(localY * fView.fZoomValue);
+            localY = Math.round(localY * fView.getZoomValue());
             y = fView.contentsToViewY(localY);
         }
-        localWidth = Math.round(localWidth * fView.fZoomValue);
-        localHeight = Math.round(localHeight * fView.fZoomValue);
+        localWidth = Math.round(localWidth * fView.getZoomValue());
+        localHeight = Math.round(localHeight * fView.getZoomValue());
         int x = fView.contentsToViewX(localX);
         if (tx.y > localHeight) {
             return;
@@ -625,10 +711,10 @@ public class NGC implements IGC {
         int localWidth = width;
         int localHeight = height;
 
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
-        localWidth = Math.round(localWidth * fView.fZoomValue);
-        localHeight = Math.round(localHeight * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
+        localWidth = Math.round(localWidth * fView.getZoomValue());
+        localHeight = Math.round(localHeight * fView.getZoomValue());
         int x = fView.contentsToViewX(localX);
         int y = fView.contentsToViewY(localY);
         if (fContext.textExtent(name).x <= localWidth) {
@@ -663,19 +749,19 @@ public class NGC implements IGC {
         if (image != null && image.getImage() instanceof Image) {
             img = (Image) image.getImage();
         } else {
-            localX = Math.round(localX * fView.fZoomValue);
-            localY = Math.round(localY * fView.fZoomValue);
+            localX = Math.round(localX * fView.getZoomValue());
+            localY = Math.round(localY * fView.getZoomValue());
             int x = fView.contentsToViewX(localX);
             int y = fView.contentsToViewY(localY);
-            float tempZoom = fView.fZoomValue;
+            float tempZoom = fView.getZoomValue();
             int width = Math.round(maxWith * tempZoom);
             int height = Math.round(maxHeight * tempZoom);
             fContext.setBackground(fView.getDisplay().getSystemColor(SWT.COLOR_RED));
             fContext.fillRectangle(x, y, width, height);
             return;
         }
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
         int x = fView.contentsToViewX(localX);
         int y = fView.contentsToViewY(localY);
         Rectangle b = ((Image) image.getImage()).getBounds();
@@ -687,11 +773,11 @@ public class NGC implements IGC {
         if (height > maxHeight) {
             height = maxHeight;
         }
-        float tempZoom = fView.fZoomValue;
+        float tempZoom = fView.getZoomValue();
         width = Math.round(width * tempZoom);
         height = Math.round(height * tempZoom);
 
-        if (fView.fIsPrinting && width > 0 && height > 0) {
+        if (fView.isPrinting() && width > 0 && height > 0) {
             Image dbuffer = new Image(fView.getDisplay(), width, height);
             GC tempgc = new GC(dbuffer);
             tempgc.drawImage(img, 0, 0, b.width, b.height, 0, 0, width, height);
@@ -712,10 +798,10 @@ public class NGC implements IGC {
         int localWidth = width;
         int localHeight = height;
 
-        localX = Math.round(localX * fView.fZoomValue);
-        localY = Math.round(localY * fView.fZoomValue);
-        localWidth = Math.round(localWidth * fView.fZoomValue);
-        localHeight = Math.round(localHeight * fView.fZoomValue);
+        localX = Math.round(localX * fView.getZoomValue());
+        localY = Math.round(localY * fView.getZoomValue());
+        localWidth = Math.round(localWidth * fView.getZoomValue());
+        localHeight = Math.round(localHeight * fView.getZoomValue());
         if (localWidth == 0 || localHeight == 0 || endAngle == 0) {
             return;
         }
@@ -726,8 +812,8 @@ public class NGC implements IGC {
     public void setFont(IFont font) {
         if (font.getFont() != null && ((Font) font.getFont()).getFontData().length > 0) {
             FontData fontData = ((Font) font.getFont()).getFontData()[0];
-            if (SDViewPref.getInstance().fontLinked() || fView.fIsPrinting) {
-                int h = Math.round(fontData.getHeight() * fView.fZoomValue);
+            if (SDViewPref.getInstance().fontLinked() || fView.isPrinting()) {
+                int h = Math.round(fontData.getHeight() * fView.getZoomValue());
                 if (h > 0) {
                     fontData.setHeight(h);
                 }
@@ -790,7 +876,7 @@ public class NGC implements IGC {
     @Override
     public float getZoom() {
         if (fView != null) {
-            return fView.fZoomValue;
+            return fView.getZoomValue();
         }
         return 1;
     }
@@ -838,6 +924,36 @@ public class NGC implements IGC {
         fVisibleScreenBounds = vBounds;
     }
 
+    /**
+     * Returns the graphical context.
+     *
+     * @return the graphical context
+     * @since 2.0
+     */
+    protected GC getGc() {
+        return fContext;
+    }
+
+    /**
+     * Returns the SD widget.
+     *
+     * @return the SD widget
+     * @since 2.0
+     */
+    protected SDWidget getSDWidget() {
+        return fView;
+    }
+
+    /**
+     * Returns the gradient color.
+     *
+     * @return the gradient color
+     * @since 2.0
+     */
+    protected IColor setGradientColor() {
+        return fGradientColor;
+    }
+
     // ------------------------------------------------------------------------
     // Helper methods
     // ------------------------------------------------------------------------
index 504b7fac1493d0bfe804503e838f44ca312a1918..541785d7006c0250dedb7851b488a072406c3bc6 100644 (file)
@@ -85,73 +85,117 @@ import org.eclipse.ui.views.properties.IPropertySheetPage;
  */
 public class SDView extends ViewPart {
 
+    // ------------------------------------------------------------------------
+    // Constants
+    // ------------------------------------------------------------------------
+    /**
+     * Name of menu separator for view modes
+     * @since 2.0
+     */
+    public final static String UML2SD_VIEW_MODES_SEPARATOR = "UML2SD_VIEW_MODES"; //$NON-NLS-1$
+    /**
+     * Name of menu separator for working set
+     * @since 2.0
+     */
+    public final static String UML2SD_WORKING_SET_SEPARATOR = "UML2SD_WORKING_SET"; //$NON-NLS-1$
+    /**
+     * Name of menu separator for sorting
+     * @since 2.0
+     */
+    public final static String UML2SD_SORTING_SEPARATOR = "UML2SD_SORTING"; //$NON-NLS-1$
+    /**
+     * Name of menu separator for filtering
+     * @since 2.0
+     */
+    public final static String UML2SD_FILTERING_SEPARATOR = "UML2SD_FILTERING"; //$NON-NLS-1$
+    /**
+     * Name of menu separator for view layout
+     * @since 2.0
+     */
+    public final static String UML2SD_VIEW_LAYOUT_SEPARATOR = "UML2SD_VIEW_LAYOUT"; //$NON-NLS-1$
+    /**
+     * Name of menu separator for link editor
+     * @since 2.0
+     */
+    public final static String UML2SD_LINK_EDITOR_SEPARATOR = "UML2SD_LINK_EDITOR"; //$NON-NLS-1$
+    /**
+     * Name of menu separator for other commands
+     * @since 2.0
+     */
+    public final static String UML2SD_OTHER_COMMANDS_SEPARATOR = "UML2SD_OTHER_COMMANDS"; //$NON-NLS-1$
+    /**
+     * Name of menu separator for other plug-in commands
+     * @since 2.0
+     */
+    public final static String UML2SD_OTHER_PLUGINS_COMMANDS_SEPARATOR = "UML2SD_OTHER_PLUGINS_COMMANDS"; //$NON-NLS-1$
+
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
     /**
      * The sequence diagram widget.
      */
-    protected SDWidget fSdWidget = null;
+    private SDWidget fSdWidget = null;
     /**
      * The time compression bar.
      */
-    protected TimeCompressionBar fTimeCompressionBar = null;
+    private TimeCompressionBar fTimeCompressionBar = null;
     /**
      * The sequence diagram find provider implementation.
      */
-    protected ISDFindProvider fSdFindProvider = null;
+    private ISDFindProvider fSdFindProvider = null;
     /**
      * The sequence diagram paging provider implementation.
      */
-    protected ISDPagingProvider fSdPagingProvider = null;
+    private ISDPagingProvider fSdPagingProvider = null;
     /**
      * The sequence diagram filter provider implementation.
      */
-    protected ISDFilterProvider fSdFilterProvider = null;
+    private ISDFilterProvider fSdFilterProvider = null;
     /**
      * The extended sequence diagram filter provider implementation.
      */
-    protected IExtendedFilterProvider fSdExFilterProvider = null;
+    private IExtendedFilterProvider fSdExFilterProvider = null;
     /**
      * The extended sequence diagram find provider implementation.
      */
-    protected IExtendedFindProvider fSdExFindProvider = null;
+    private IExtendedFindProvider fSdExFindProvider = null;
     /**
      * The extended sequence diagram action bar provider implementation.
      */
-    protected ISDExtendedActionBarProvider fSdExtendedActionBarProvider = null;
+    private ISDExtendedActionBarProvider fSdExtendedActionBarProvider = null;
     /**
      * The sequence diagram property provider implementation.
      */
-    protected ISDPropertiesProvider fSdPropertiesProvider = null;
+    private ISDPropertiesProvider fSdPropertiesProvider = null;
     /**
      * Button for executing the next page action.
      */
-    protected NextPage fNextPageButton = null;
+    private NextPage fNextPageButton = null;
     /**
      * Button for executing the previous page action.
      */
-    protected PrevPage fPrevPageButton = null;
+    private PrevPage fPrevPageButton = null;
     /**
      * Button for executing the first page page action.
      */
-    protected FirstPage fFirstPageButton = null;
+    private FirstPage fFirstPageButton = null;
     /**
      * Button for executing the last page action.
      */
-    protected LastPage fLastPageButton = null;
+    private LastPage fLastPageButton = null;
     /**
      * The menu manager reference.
      */
-    protected MenuManager fMenuMgr = null;
+    private MenuManager fMenuMgr = null;
     /**
      * Flag to indicate whether view needs initialization or not.
      */
-    protected boolean fNeedInit = true;
+    private boolean fNeedInit = true;
     /**
      * WaitCursor is the cursor to be displayed when long tasks are running
      */
-    protected Cursor fWaitCursor;
+    private Cursor fWaitCursor;
 
     // ------------------------------------------------------------------------
     // Methods
@@ -171,7 +215,7 @@ public class SDView extends ViewPart {
         GridData seqDiagLayoutData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL);
         fTimeCompressionBar = new TimeCompressionBar(parent, SWT.NONE);
         fTimeCompressionBar.setLayoutData(timeLayoutdata);
-        fSdWidget = new SDWidget(parent, SWT.NONE);// SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+        fSdWidget = new SDWidget(parent, SWT.NONE);
         fSdWidget.setLayoutData(seqDiagLayoutData);
         fSdWidget.setSite(this);
         fSdWidget.setTimeBar(fTimeCompressionBar);
@@ -308,7 +352,6 @@ public class SDView extends ViewPart {
     public void setSDFilterProvider(ISDFilterProvider provider) {
         fSdFilterProvider = provider;
         // Both systems can be used now, commenting out next statement
-        // sdExFilterProvider = null;
         createCoolbarContent();
     }
 
@@ -321,7 +364,6 @@ public class SDView extends ViewPart {
     public void setExtendedFilterProvider(IExtendedFilterProvider provider) {
         fSdExFilterProvider = provider;
         // Both systems can be used now, commenting out next statement
-        // sdFilterProvider = null;
         createCoolbarContent();
     }
 
@@ -424,6 +466,39 @@ public class SDView extends ViewPart {
         return fSdPropertiesProvider;
     }
 
+    /**
+     * Sets the sdWidget.
+     *
+     * @param sdWidget
+     *          A sdWidget to set
+     * @since 2.0
+     */
+    protected void setSDWidget(SDWidget sdWidget) {
+        fSdWidget = sdWidget;
+    }
+
+    /**
+     * Sets the time compression bar.
+     *
+     * @param timeCompressionbar
+     *          A sdWidget to set
+     * @since 2.0
+     */
+    protected void setTimeBar(TimeCompressionBar timeCompressionbar) {
+        fTimeCompressionBar = timeCompressionbar;
+    }
+
+    /**
+     * Sets the initialization flag.
+     *
+     * @param needInit
+     *          flag value to set
+     * @since 2.0
+     */
+    protected void setNeedInit(boolean needInit) {
+        fNeedInit = needInit;
+    }
+
     /**
      * Creates the basic sequence diagram menu
      */
@@ -457,7 +532,7 @@ public class SDView extends ViewPart {
      */
     protected void fillContextMenu(IMenuManager manager) {
         manager.add(new Separator("Additions")); //$NON-NLS-1$
-        if (getSDWidget() != null && getSDWidget().fCurrentGraphNode != null) {
+        if (getSDWidget() != null && getSDWidget().getCurrentGraphNode() != null) {
             ISelectionProvider selProvider = fSdWidget.getSelectionProvider();
             ISelection sel = selProvider.getSelection();
             int nbMessage = 0;
@@ -471,7 +546,7 @@ public class SDView extends ViewPart {
             if (nbMessage != 1) {
                 return;
             }
-            GraphNode node = getSDWidget().fCurrentGraphNode;
+            GraphNode node = getSDWidget().getCurrentGraphNode();
             if ((node instanceof SyncMessageReturn) && (((SyncMessageReturn) node).getMessage() != null)) {
                 Action goToMessage = new MoveToMessage(this);
                 goToMessage.setText(Messages.SequenceDiagram_GoToMessage);
@@ -526,21 +601,21 @@ public class SDView extends ViewPart {
         createMenuGroup();
 
         Zoom resetZoom = new Zoom(this, ZoomType.ZOOM_RESET);
-        bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", resetZoom);//$NON-NLS-1$
-        bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", resetZoom); //$NON-NLS-1$
+        bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, resetZoom);
+        bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, resetZoom);
 
         Zoom noZoom = new Zoom(this, ZoomType.ZOOM_NONE);
         noZoom.setChecked(true);
-        bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", noZoom);//$NON-NLS-1$
-        bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", noZoom); //$NON-NLS-1$
+        bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, noZoom);
+        bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, noZoom);
 
         Zoom zoomIn = new Zoom(this, ZoomType.ZOOM_IN);
-        bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", zoomIn);//$NON-NLS-1$
-        bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", zoomIn); //$NON-NLS-1$
+        bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, zoomIn);
+        bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, zoomIn);
 
         Zoom zoomOut = new Zoom(this, ZoomType.ZOOM_OUT);
-        bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", zoomOut);//$NON-NLS-1$
-        bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", zoomOut); //$NON-NLS-1$
+        bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, zoomOut);
+        bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, zoomOut);
 
         MenuManager navigation = new MenuManager(Messages.SequenceDiagram_Navigation);
 
@@ -558,12 +633,12 @@ public class SDView extends ViewPart {
         showNodeEnd.setActionDefinitionId("org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ShowNodeEnd");//$NON-NLS-1$
         navigation.add(showNodeEnd);
 
-        bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", navigation); //$NON-NLS-1$
+        bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, navigation);
 
         ConfigureMinMax minMax = new ConfigureMinMax(this);
         minMax.setText(Messages.SequenceDiagram_ConfigureMinMax);
         minMax.setId("org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ConfigureMinMax");//$NON-NLS-1$
-        bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", minMax); //$NON-NLS-1$
+        bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, minMax);
 
         if ((fSdWidget.getFrame() != null) && (fSdWidget.getFrame().hasTimeInfo())) {
             minMax.setEnabled(true);
@@ -574,24 +649,24 @@ public class SDView extends ViewPart {
         // Do we need to display a paging item
         if (fSdPagingProvider != null) {
             fNextPageButton = new NextPage(this);
-            bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", fNextPageButton); //$NON-NLS-1$
+            bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fNextPageButton);
             fNextPageButton.setEnabled(fSdPagingProvider.hasNextPage());
-            bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", fNextPageButton); //$NON-NLS-1$
+            bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fNextPageButton);
 
             fPrevPageButton = new PrevPage(this);
-            bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", fPrevPageButton); //$NON-NLS-1$
+            bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fPrevPageButton);
             fPrevPageButton.setEnabled(fSdPagingProvider.hasPrevPage());
-            bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", fPrevPageButton); //$NON-NLS-1$
+            bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fPrevPageButton);
 
             fFirstPageButton = new FirstPage(this);
-            bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", fFirstPageButton); //$NON-NLS-1$
+            bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fFirstPageButton);
             fFirstPageButton.setEnabled(fSdPagingProvider.hasPrevPage());
-            bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", fFirstPageButton); //$NON-NLS-1$
+            bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fFirstPageButton);
 
             fLastPageButton = new LastPage(this);
-            bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", fLastPageButton); //$NON-NLS-1$
+            bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fLastPageButton);
             fLastPageButton.setEnabled(fSdPagingProvider.hasNextPage());
-            bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", fLastPageButton); //$NON-NLS-1$
+            bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, fLastPageButton);
         }
 
         if (fSdExFilterProvider != null) {
@@ -607,15 +682,13 @@ public class SDView extends ViewPart {
                 if (action.getText() == null || action.getText().length() == 0) {
                     action.setText(Messages.SequenceDiagram_EditFilters);
                 }
-                bar.getMenuManager().prependToGroup("UML2SD_FILTERING", action); //$NON-NLS-1$
-                bar.getToolBarManager().prependToGroup("UML2SD_FILTERING", action); //$NON-NLS-1$
+                bar.getMenuManager().prependToGroup(UML2SD_FILTERING_SEPARATOR, action);
+                bar.getToolBarManager().prependToGroup(UML2SD_FILTERING_SEPARATOR, action);
             }
         }
         // Both systems can be used now: commenting out else keyword
-        /* else */if (fSdFilterProvider != null) {
-            bar.getMenuManager().appendToGroup("UML2SD_FILTERING", new OpenSDFiltersDialog(this, fSdFilterProvider)); //$NON-NLS-1$
-            // No longer in the coolbar: commenting out next statement
-            //bar.getToolBarManager().appendToGroup("UML2SD_FILTERING",new OpenSDFiltersDialog(this, sdFilterProvider));       //$NON-NLS-1$
+        if (fSdFilterProvider != null) {
+            bar.getMenuManager().appendToGroup(UML2SD_FILTERING_SEPARATOR, new OpenSDFiltersDialog(this, fSdFilterProvider));
         }
         if (fSdPagingProvider instanceof ISDAdvancedPagingProvider) {
             IContributionItem sdPaging = bar.getMenuManager().find(OpenSDPagesDialog.ID);
@@ -623,7 +696,7 @@ public class SDView extends ViewPart {
                 bar.getMenuManager().remove(sdPaging);
                 sdPaging = null;
             }
-            bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", new OpenSDPagesDialog(this, (ISDAdvancedPagingProvider) fSdPagingProvider)); //$NON-NLS-1$
+            bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, new OpenSDPagesDialog(this, (ISDAdvancedPagingProvider) fSdPagingProvider));
             updatePagesMenuItem(bar);
         }
 
@@ -639,12 +712,12 @@ public class SDView extends ViewPart {
                 if (action.getText() == null) {
                     action.setText(Messages.SequenceDiagram_Find + "..."); //$NON-NLS-1$
                 }
-                bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", action); //$NON-NLS-1$
-                bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", action); //$NON-NLS-1$
+                bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, action);
+                bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, action);
             }
         } else if (fSdFindProvider != null) {
-            bar.getMenuManager().appendToGroup("UML2SD_OTHER_COMMANDS", new OpenSDFindDialog(this)); //$NON-NLS-1$
-            bar.getToolBarManager().appendToGroup("UML2SD_OTHER_COMMANDS", new OpenSDFindDialog(this)); //$NON-NLS-1$
+            bar.getMenuManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, new OpenSDFindDialog(this));
+            bar.getToolBarManager().appendToGroup(UML2SD_OTHER_COMMANDS_SEPARATOR, new OpenSDFindDialog(this));
         }
 
         if (fSdExtendedActionBarProvider != null) {
@@ -976,6 +1049,15 @@ public class SDView extends ViewPart {
         return null;
     }
 
+    /**
+     * Gets the initialization flag.
+     * @return the value of the initialization flag.
+     * @since 2.0
+     */
+    private boolean isNeedInit() {
+        return fNeedInit;
+    }
+
     /**
      * Restores the loader for the view based on the view ID.
      *
@@ -983,13 +1065,11 @@ public class SDView extends ViewPart {
      */
     protected boolean restoreLoader() {
         String id = getViewSite().getId();
-        // System.err.println("restoreLoader() id="+id);
         if (id == null) {
             return true;
         }
         IUml2SDLoader loader = LoadersManager.getInstance().getCurrentLoader(id, this);
-        // System.err.println("restoreLoader() l="+l);
-        if ((loader != null)) {// &&( LoadersManager.getLoadersManager().getViewer(l)==this)){
+        if ((loader != null)) {
             loader.setViewer(this);
             return false;
         }
@@ -1025,22 +1105,22 @@ public class SDView extends ViewPart {
         if (bar == null) {
             return;
         }
-        bar.getToolBarManager().add(new Separator("UML2SD_VIEW_MODES")); //$NON-NLS-1$
-        bar.getToolBarManager().add(new Separator("UML2SD_WORKING_SET")); //$NON-NLS-1$
-        bar.getToolBarManager().add(new Separator("UML2SD_SORTING")); //$NON-NLS-1$
-        bar.getToolBarManager().add(new Separator("UML2SD_FILTERING")); //$NON-NLS-1$
-        bar.getToolBarManager().add(new Separator("UML2SD_VIEW_LAYOUT")); //$NON-NLS-1$
-        bar.getToolBarManager().add(new Separator("UML2SD_LINK_EDITOR")); //$NON-NLS-1$
-        bar.getToolBarManager().add(new Separator("UML2SD_OTHER_COMMANDS")); //$NON-NLS-1$
-        bar.getToolBarManager().add(new Separator("UML2SD_OTHER_PLUGINS_COMMANDS")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_VIEW_MODES")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_WORKING_SET")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_SORTING")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_FILTERING")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_VIEW_LAYOUT")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_LINK_EDITOR")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_OTHER_COMMANDS")); //$NON-NLS-1$
-        bar.getMenuManager().add(new Separator("UML2SD_OTHER_PLUGINS_COMMANDS")); //$NON-NLS-1$
+        bar.getToolBarManager().add(new Separator(UML2SD_VIEW_MODES_SEPARATOR));
+        bar.getToolBarManager().add(new Separator(UML2SD_WORKING_SET_SEPARATOR));
+        bar.getToolBarManager().add(new Separator(UML2SD_SORTING_SEPARATOR));
+        bar.getToolBarManager().add(new Separator(UML2SD_FILTERING_SEPARATOR));
+        bar.getToolBarManager().add(new Separator(UML2SD_VIEW_LAYOUT_SEPARATOR));
+        bar.getToolBarManager().add(new Separator(UML2SD_LINK_EDITOR_SEPARATOR));
+        bar.getToolBarManager().add(new Separator(UML2SD_OTHER_COMMANDS_SEPARATOR));
+        bar.getToolBarManager().add(new Separator(UML2SD_OTHER_PLUGINS_COMMANDS_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_VIEW_MODES_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_WORKING_SET_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_SORTING_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_FILTERING_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_VIEW_LAYOUT_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_LINK_EDITOR_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_OTHER_COMMANDS_SEPARATOR));
+        bar.getMenuManager().add(new Separator(UML2SD_OTHER_PLUGINS_COMMANDS_SEPARATOR));
     }
 
     @Override
index 93866f46cefd2eeb6de2bf312a73da026594dd1a..208fd8eb062079eb2a461ab2e03f4e5c6c60c61a 100755 (executable)
@@ -93,159 +93,159 @@ public class SDWidget extends ScrollView implements SelectionListener,
     /**
      * The frame to display in the sequence diagram widget.
      */
-    protected Frame fFrame;
+    private Frame fFrame;
     /**
      * The overview image to display.
      */
-    protected Image fOverView = null;
+    private Image fOverView = null;
     /**
      * The zoom in menu item.
      */
-    protected MenuItem fZoomIn = null;
+    private MenuItem fZoomIn = null;
     /**
      * The zoom out menu item.
      */
-    protected MenuItem fZoomOut = null;
+    private MenuItem fZoomOut = null;
     /**
      * The sequence diagram selection provider.
      */
-    protected SDWidgetSelectionProvider fSelProvider = null;
+    private SDWidgetSelectionProvider fSelProvider = null;
     /**
      * The current zoom value.
      */
-    public float fZoomValue = 1;
+    private float fZoomValue = 1;
     /**
      * The current zoomInMode (true for zoom in).
      */
-    protected boolean fZoomInMode = false;
+    private boolean fZoomInMode = false;
     /**
      * The current zoomOutMode (true for zoom out).
      */
-    protected boolean fZoomOutMode = false;
+    private boolean fZoomOutMode = false;
     /**
      * The current list of selected graph nodes.
      */
-    protected List<GraphNode> fSelectedNodeList = null;
+    private List<GraphNode> fSelectedNodeList = null;
     /**
      * Flag whether ctrl button is selected or not.
      */
-    protected boolean fCtrlSelection = false;
+    private boolean fCtrlSelection = false;
     /**
      * A reference to the view site.
      */
-    protected ViewPart fSite = null;
+    private ViewPart fSite = null;
     /**
      * The current graph node (the last selected one).
      */
-    public GraphNode fCurrentGraphNode = null;
+    private GraphNode fCurrentGraphNode = null;
     /**
      * The first graph node in list (multiple selection).
      */
-    public GraphNode fListStart = null;
+    private GraphNode fListStart = null;
     /**
      * The previous graph node (multiple selection).
      */
-    public List<GraphNode> fPrevList = null;
+    private List<GraphNode> fPrevList = null;
     /**
      * The time compression bar.
      */
-    protected TimeCompressionBar fTimeBar = null;
+    private TimeCompressionBar fTimeBar = null;
     /**
      * The current diagram tool tip.
      */
-    protected DiagramToolTip fToolTip = null;
+    private DiagramToolTip fToolTip = null;
     /**
      * The accessible object reference of view control.
      */
-    protected Accessible fAccessible = null;
+    private Accessible fAccessible = null;
     /**
      * The current node for the tooltip to display.
      */
-    protected GraphNode fToolTipNode;
+    private GraphNode fToolTipNode;
     /**
      * The life line to drag and drop.
      */
-    protected Lifeline fDragAndDrop = null;
+    private Lifeline fDragAndDrop = null;
     /**
      * The number of focused widgets.
      */
-    protected int fFocusedWidget = -1;
+    private int fFocusedWidget = -1;
     /**
      * The printer zoom.
      */
-    protected float fPrinterZoom = 0;
+    private float fPrinterZoom = 0;
     /**
      * Y coordinate for printer.
      */
-    protected int fPrinterY = 0;
+    private int fPrinterY = 0;
     /**
      * X coordinate for printer.
      */
-    protected int fPrinterX = 0;
+    private int fPrinterX = 0;
     /**
      * Flag whether drag and drop is enabled or not.
      */
-    protected boolean fIsDragAndDrop = false;
+    private boolean fIsDragAndDrop = false;
     /**
      * The x coordinate for drag.
      */
-    protected int fDragX = 0;
+    private int fDragX = 0;
     /**
      * The y coordinate for drag.
      */
-    protected int fDragY = 0;
+    private int fDragY = 0;
     /**
      * The reorder mode.
      */
-    protected boolean fReorderMode = false;
+    private boolean fReorderMode = false;
     /**
      * The collapse caret image.
      */
-    protected Image fCollapaseCaretImg = null;
+    private Image fCollapaseCaretImg = null;
     /**
      * The arrow up caret image.
      */
-    protected Image fArrowUpCaretImg = null;
+    private Image fArrowUpCaretImg = null;
     /**
      * The current caret image.
      */
-    protected Image fCurrentCaretImage = null;
+    private Image fCurrentCaretImage = null;
     /**
      * A sequence diagramm collapse provider (for collapsing graph nodes)
      */
-    protected ISDCollapseProvider fCollapseProvider = null;
+    private ISDCollapseProvider fCollapseProvider = null;
     /**
      * The insertion caret.
      */
-    protected Caret fInsertionCartet = null;
+    private Caret fInsertionCartet = null;
     /**
      * The reorder list when in reorder mode.
      */
-    protected List<Lifeline[]> fReorderList = null;
+    private List<Lifeline[]> fReorderList = null;
     /**
      * Flag to specify whether in printing mode or not.
      */
-    protected boolean fIsPrinting = false;
+    private boolean fIsPrinting = false;
     /**
      * A printer reference.
      */
-    protected Printer fPrinter = null;
+    private Printer fPrinter = null;
     /**
      * Flag whether shift was selected or not.
      */
-    protected boolean fShiftSelection = false;
+    private boolean fShiftSelection = false;
     /**
      * The scroll tooltip.
      */
-    protected DiagramToolTip fScrollToolTip = null;
+    private DiagramToolTip fScrollToolTip = null;
     /**
      * Timer for auto_scroll feature
      */
-    protected AutoScroll fLocalAutoScroll = null;
+    private AutoScroll fLocalAutoScroll = null;
     /**
      * TimerTask for auto_scroll feature !=null when auto scroll is running
      */
-    protected Timer fLocalAutoScrollTimer = null;
+    private Timer fLocalAutoScrollTimer = null;
 
     // ------------------------------------------------------------------------
     // Constructor
@@ -486,7 +486,6 @@ public class SDWidget extends ScrollView implements SelectionListener,
      * @param list of graph nodes
      */
     public void addSelection(List<GraphNode> list) {
-        // selectedNodeList.addAll(list);
         for (int i = 0; i < list.size(); i++) {
             if (!fSelectedNodeList.contains(list.get(i))) {
                 fSelectedNodeList.add(list.get(i));
@@ -577,7 +576,7 @@ public class SDWidget extends ScrollView implements SelectionListener,
      * Sets the zoom out mode.
      *
      * @param value
-     *            The mode value to set.
+     *          The mode value to set.
      */
     public void setZoomOutMode(boolean value) {
         if (value) {
@@ -586,6 +585,17 @@ public class SDWidget extends ScrollView implements SelectionListener,
         fZoomOutMode = value;
     }
 
+    /**
+     * Sets the current zoom value.
+     *
+     * @param zoomValue
+     *          The current zoom value
+     * @since 2.0
+     */
+    public void setZoomValue(float zoomValue) {
+        fZoomValue = zoomValue;
+    }
+
     /**
      * Moves the Sequence diagram to ensure the given node is visible and draw it selected
      *
@@ -656,6 +666,65 @@ public class SDWidget extends ScrollView implements SelectionListener,
         return fIsPrinting;
     }
 
+    /**
+     * Returns the current graph node.
+     *
+     * @return the current graph node
+     * @since 2.0
+     */
+    public GraphNode getCurrentGraphNode() {
+        return fCurrentGraphNode;
+    }
+
+    /**
+     * Returns the current zoom value.
+     *
+     * @return the current zoom value
+     * @since 2.0
+     */
+    public float getZoomValue() {
+        return fZoomValue;
+    }
+
+    /**
+     * Gets the zoom in mode.
+     *
+     * @return the mode value to set.
+     * @since 2.0
+     */
+    public boolean getZoomInMode() {
+        return fZoomInMode;
+    }
+
+
+    /**
+     * Gets the zoom out mode.
+     *
+     * @return the mode value to set.
+     * @since 2.0
+     */
+    public boolean getZoomOutMode() {
+        return fZoomOutMode;
+    }
+
+    /**
+     * Returns if ctrl selection
+     * @return true if ctrl selection else false
+     * @since 2.0
+     */
+    public boolean isCtrlSelection() {
+        return fCtrlSelection;
+    }
+
+    /**
+     * Returns if shift selection
+     * @return true if shift Selection else false
+     * @since 2.0
+     */
+    public boolean isShiftSelection() {
+        return fCtrlSelection;
+    }
+
     /**
      * Gets the overview image.
      *
@@ -852,7 +921,6 @@ public class SDWidget extends ScrollView implements SelectionListener,
         if (selectedNode instanceof BaseMessage) {
             node = fFrame.getNextLifelineMessage(((BaseMessage) selectedNode).getStartLifeline(), (BaseMessage) selectedNode);
         } else if (selectedNode instanceof Lifeline) {
-            // node = frame.getNextLifelineMessage((Lifeline)selectedNode,null);
             node = fFrame.getFirstExecution((Lifeline) selectedNode);
         } else if (selectedNode instanceof BasicExecutionOccurrence) {
             node = fFrame.getNextExecOccurrence((BasicExecutionOccurrence) selectedNode);
@@ -947,7 +1015,6 @@ public class SDWidget extends ScrollView implements SelectionListener,
         fPrinter.startJob(jobName);
 
         GC gc = new GC(fPrinter);
-//        Frame.setUserPref(SDViewPref.getInstance());
 
         float lastZoom = fZoomValue;
 
@@ -1123,8 +1190,6 @@ public class SDWidget extends ScrollView implements SelectionListener,
         String currentPageNum = String.valueOf(pageNum);
         int ii = context.textExtent(currentPageNum);
         int jj = context.getCurrentFontHeight();
-        // context.setBackground(ColorImpl.getSystemColor(SWT.COLOR_BLACK));
-        // context.setForeground(ColorImpl.getSystemColor(SWT.COLOR_WHITE));
         fZoomValue = fPrinterZoom * lastZoom;
         context.drawText(currentPageNum, Math.round(fPrinterX + getVisibleWidth() / fPrinterZoom - ii / fPrinterZoom), Math.round(fPrinterY + getVisibleHeight() / fPrinterZoom - jj / fPrinterZoom), false);
         fIsPrinting = false;
@@ -1525,7 +1590,6 @@ public class SDWidget extends ScrollView implements SelectionListener,
     protected void contentsMouseMoveEvent(MouseEvent e) {
         fScrollToolTip.hideToolTip();
         fToolTip.hideToolTip();
-        // super.contentsMouseMoveEvent(e);
         if (!(isFocusControl() || getViewControl().isFocusControl())) {
             Control[] child = getParent().getChildren();
             for (int i = 0; i < child.length; i++) {
@@ -1725,7 +1789,7 @@ public class SDWidget extends ScrollView implements SelectionListener,
             }
             // redraw also resize the scrollView content
             redraw();
-        } else {// if (event.button ==1)
+        } else {
             GraphNode node = null;
             int x = Math.round(event.x / fZoomValue);
             int y = Math.round(event.y / fZoomValue);
@@ -1808,7 +1872,6 @@ public class SDWidget extends ScrollView implements SelectionListener,
             gc.dispose();
             return;
         }
-        // Frame.setUserPref(SDViewPref.getInstance());
         SDViewPref.getInstance();
 
         Rectangle area = getClientArea();
index 87d053213134e68dba6260c4ab14c6748535a056..dcb2cd40086af88e2df6f76ca6d1848d3d5ac102 100755 (executable)
@@ -37,12 +37,12 @@ public class SDWidgetSelectionProvider implements ISelectionProvider {
     /**
      * The listener list
      */
-    protected List<ISelectionChangedListener> fListenerList = null;
+    private List<ISelectionChangedListener> fListenerList = null;
 
     /**
      * The current selection
      */
-    protected ISelection fCurrentSelection = null;
+    private ISelection fCurrentSelection = null;
 
     // ------------------------------------------------------------------------
     // Constructor
index 3c2f0eb0b665f5541427d52d7436edc815ea60c2..991ae5e0c28f144a5949abd50ceab6f795ed3203 100755 (executable)
@@ -62,7 +62,6 @@ public class ScrollView extends Composite {
     // Attributes
     // ------------------------------------------------------------------------
 
-    // Value for scroll bar mode, default is AUTO
     /**
      * Scroll bar mode AUTO
      */
@@ -86,101 +85,100 @@ public class ScrollView extends Composite {
     /**
      * Value of the contents height property.
      */
-    protected int fContentsHeight = 0;
+    private int fContentsHeight = 0;
     /**
      * Value of the contents width property.
      */
-    protected int fContentsWidth = 0;
+    private int fContentsWidth = 0;
     /**
      * Value of the contents x coordinate property
      */
-    protected int fContentsX = 0;
+    private int fContentsX = 0;
     /**
      * Value of the contents y coordinate property
      */
-    protected int fContentsY = 0;
+    private int fContentsY = 0;
     /**
      * Scroll bar mode of horizontal scroll bar.
      */
-    protected int fHorScrollbarMode = AUTO;
+    private int fHorScrollbarMode = AUTO;
     /**
      * Scroll bar mode of vertical scroll bar.
      */
-    protected int fVertScrollbarMode = AUTO;
+    private int fVertScrollbarMode = AUTO;
     /**
      * Increment for the horizontal scroll bar.
      */
-    protected int fHorScrollbarIncrement = 10;
+    private int fHorScrollbarIncrement = 10;
     /**
      * Increment for the vertical scroll bar.
      */
-    protected int fVertScrollbarIncrement = 10;
+    private int fVertScrollbarIncrement = 10;
     /**
      * Flag whether auto scroll is enabled or not.
      */
-    protected boolean fAutoScrollEnabled = true;
+    private boolean fAutoScrollEnabled = true;
     /**
      * Value of the auto scroll period.
      */
-    protected int fAutoScrollPeriod = 75;
+    private int fAutoScrollPeriod = 75;
     /**
      * The local paint listener reference.
      */
-    protected PaintListener fLocalPaintListener = null;
+    private PaintListener fLocalPaintListener = null;
     /**
      * The local mouse move listener reference.
      */
-    protected MouseMoveListener fLocalMouseMoveListener = null;
+    private MouseMoveListener fLocalMouseMoveListener = null;
     /**
      * The local mouse listener reference.
      */
-    protected MouseListener fLocalMouseListener = null;
+    private MouseListener fLocalMouseListener = null;
     /**
      * The local control listener reference.
      */
-    protected ControlListener fLocalControlListener = null;
+    private ControlListener fLocalControlListener = null;
     /**
      * The local key listener reference.
      */
-    protected KeyListener fLocalKeyListener = null;
+    private KeyListener fLocalKeyListener = null;
     // Canvas for vertical/horizontal Scroll Bar only ... because new ScrollBar() does works.
     /**
      * Canvas for horizontal scroll bar.
      */
-    protected Canvas fHorScrollBar;
+    private Canvas fHorScrollBar;
     /**
      * Canvas for vertical scroll bar.
      */
-    protected Canvas fVertScrollBar;
+    private Canvas fVertScrollBar;
     /**
      * Canvas for the view control.
      */
-    protected Canvas fViewControl;
+    private Canvas fViewControl;
     /**
      * Control used in the bottom right corner @see setCornerControl() and @see setOverviewEnabled(true)
      */
-    protected Control fCornerControl;
+    private Control fCornerControl;
     /**
      * Size of overview widget.
      */
-    protected int fOverviewSize = 100; // default size for overview
+    private int fOverviewSize = 100; // default size for overview
     /**
      * Timer for auto_scroll feature
      */
-    protected AutoScroll fAutoScroll = null;
+    private AutoScroll fAutoScroll = null;
     /**
      * TimerTask for auto_scroll feature !=null when auto scroll is running
      */
-    protected Timer fAutoScrollTimer = null;
+    private Timer fAutoScrollTimer = null;
     /**
      * where mouse down appear on contents area (x coordinate)
      */
-    protected int fMouseDownX = -1;
+    private int fMouseDownX = -1;
     /**
      * where mouse down appear on contents area (y coordinate)
      */
-    protected int fMousDownY = -1;
-
+    private int fMousDownY = -1;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -206,7 +204,7 @@ public class ScrollView extends Composite {
      * @param mouseWheel Flag to force scrollView to handles mouse wheel
      */
     public ScrollView(Composite c, int style, boolean mouseWheel) {
-        super(c, SWT.NONE); // style&(~(SWT.H_SCROLL|SWT.V_SCROLL)));
+        super(c, SWT.NONE);
 
         fHorScrollBar = new Canvas(this, SWT.H_SCROLL);
         if (mouseWheel) {
@@ -222,10 +220,6 @@ public class ScrollView extends Composite {
             fViewControl.getHorizontalBar().setVisible(false);
         }
         fVertScrollBar = new Canvas(this, SWT.V_SCROLL);
-        // make fVerScrollBar able to receive mouse wheel
-        // does not help as we can't set a MouseListener on fVerScrollBar.getVerticalBar()
-        // to set focus on viewcontrol_
-        // fVerScrollBar.addKeyListener( new KeyAdapter() {});
 
         setLayout(new SVLayout());
 
@@ -304,8 +298,10 @@ public class ScrollView extends Composite {
             @Override
             public void mouseDown(MouseEvent e) {
                 int ox = e.x, oy = e.y;
-                e.x = fMouseDownX = viewToContentsX(e.x);
-                e.y = fMousDownY = viewToContentsY(e.y);
+                e.x = viewToContentsX(e.x);
+                fMouseDownX = e.x;
+                e.y = viewToContentsY(e.y);
+                fMousDownY = e.y;
                 contentsMouseDownEvent(e);
                 e.x = ox;
                 e.y = oy;
@@ -319,8 +315,9 @@ public class ScrollView extends Composite {
                 contentsMouseUpEvent(e);
                 e.x = ox;
                 e.y = oy;
-                // here because class extenting me can catch mouse Up and want to scroll...
-                fMouseDownX = fMousDownY = -1;
+                // here because class extending me can catch mouse Up and want to scroll...
+                fMouseDownX = -1;
+                fMousDownY = -1;
             }
         };
         fViewControl.addMouseListener(fLocalMouseListener);
@@ -836,13 +833,13 @@ public class ScrollView extends Composite {
     protected static class AutoScroll extends TimerTask {
 
         /** X delta */
-        public int deltaX;
+        private int deltaX;
 
         /** Y delta */
-        public int deltaY;
+        private int deltaY;
 
         /** ScrollView object */
-        public ScrollView scrollView;
+        private ScrollView scrollView;
 
         /**
          * Constructor.
@@ -886,23 +883,23 @@ public class ScrollView extends Composite {
 
             int sx = 0, sy = 0;
 
-            int v_right = getContentsX() + getVisibleWidth();
-            int v_bottom = getContentsY() + getVisibleHeight();
+            int vRight = getContentsX() + getVisibleWidth();
+            int vBottom = getContentsY() + getVisibleHeight();
 
             // auto scroll... ?
             if (event.x < getContentsX()) {
                 sx = (getContentsX() - event.x);
                 fMouseDownX = getContentsX();
-            } else if (event.x > v_right) {
-                sx = -event.x + v_right;
-                fMouseDownX = v_right;
+            } else if (event.x > vRight) {
+                sx = -event.x + vRight;
+                fMouseDownX = vRight;
             }
             if (event.y < getContentsY()) {
                 sy = (getContentsY() - event.y);
                 fMousDownY = getContentsY();
-            } else if (event.y > v_bottom) {
-                sy = -event.y + v_bottom;
-                fMousDownY = v_bottom;
+            } else if (event.y > vBottom) {
+                sy = -event.y + vBottom;
+                fMousDownY = vBottom;
             }
 
             if (sx != 0 || sy != 0) {
@@ -994,13 +991,13 @@ public class ScrollView extends Composite {
             oldW = s;
         }
 
-        int vis_width = getVisibleWidth();
-        int vis_height = getVisibleHeight();
-        if (oldW < vis_width) {
-            if (localWidth > vis_width) {
-                localWidth = vis_width;
+        int visWidth = getVisibleWidth();
+        int visHeight = getVisibleHeight();
+        if (oldW < visWidth) {
+            if (localWidth > visWidth) {
+                localWidth = visWidth;
             }
-            fViewControl.redraw(getContentsX() + oldW, 0, localWidth - oldW, vis_height, true);
+            fViewControl.redraw(getContentsX() + oldW, 0, localWidth - oldW, visHeight, true);
         }
 
         if (oldH > localHeight) {
@@ -1009,11 +1006,11 @@ public class ScrollView extends Composite {
             oldH = s;
         }
 
-        if (oldH < vis_height) {
-            if (localHeight > vis_height) {
-                localHeight = vis_height;
+        if (oldH < visHeight) {
+            if (localHeight > visHeight) {
+                localHeight = visHeight;
             }
-            fViewControl.redraw(0, getContentsY() + oldH, vis_width, localHeight - oldH, true);
+            fViewControl.redraw(0, getContentsY() + oldH, visWidth, localHeight - oldH, true);
         }
         if (updateScrollBarVisiblity()) {
             layout();
@@ -1109,7 +1106,7 @@ public class ScrollView extends Composite {
         int cy = getContentsY();
         int right = getContentsX() + getVisibleWidth() - vbar;
         int bottom = getContentsY() + getVisibleHeight() - hbar;
-        boolean align_h = false, align_v = false;
+        boolean alignH = false, alignV = false;
 
         if (localX < getContentsX()) {
             cx = localX;
@@ -1123,13 +1120,13 @@ public class ScrollView extends Composite {
         }
 
         if (localWidth > getVisibleWidth()) {
-            align_h = true;
+            alignH = true;
         }
         if (localHeight > getVisibleHeight()) {
-            align_v = true;
+            alignV = true;
         }
         // compute alignment on visible area horizontally
-        if (align_h || (forceAlign && localX + localWidth > right)) {
+        if (alignH || (forceAlign && localX + localWidth > right)) {
             // use align flags
             if ((align & SWT.LEFT) != 0) {
                 cx = localX;
@@ -1140,7 +1137,7 @@ public class ScrollView extends Composite {
             }
         }
         // compute alignment on visible area vertically
-        if (align_v || (forceAlign && localY + localHeight > bottom)) {
+        if (alignV || (forceAlign && localY + localHeight > bottom)) {
             // use align flags
             if ((align & SWT.TOP) != 0) {
                 cy = localY;
@@ -1594,11 +1591,11 @@ public class ScrollView extends Composite {
     @Override
     public Rectangle computeTrim(int x, int y, int w, int h) {
         Rectangle r = new Rectangle(x, y, w, h);
-        int bar_vis = computeBarVisibility(w, h, false, false);
-        if ((bar_vis & VBAR) != 0) {
+        int barVis = computeBarVisibility(w, h, false, false);
+        if ((barVis & VBAR) != 0) {
             r.width += getVerticalBarWidth();
         }
-        if ((bar_vis & HBAR) != 0) {
+        if ((barVis & HBAR) != 0) {
             r.height += getHorizontalBarHeight();
         }
         return r;
@@ -1608,18 +1605,24 @@ public class ScrollView extends Composite {
      *  Internal layout for ScrollView, handle scrollbars, drawzone and corner control
      */
     protected class SVLayout extends Layout {
+
+        private final static int DEFAULT_X = 250;
+        private final static int DEFAULT_Y = 250;
+        private final static int MAX_SEEK = 10;
+        private final static int MIN_SEEK = 0;
+
         /**
          * The seek value
          */
-        int seek = 0;
+        private int seek = 0;
         /**
          * The do-it-not flag
          */
-        boolean dontLayout = false;
+        private boolean dontLayout = false;
 
         @Override
         protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
-            Point p = new Point(250, 250);
+            Point p = new Point(DEFAULT_X, DEFAULT_Y);
             if (fContentsWidth < p.x) {
                 p.x = fContentsWidth;
             }
@@ -1635,23 +1638,23 @@ public class ScrollView extends Composite {
                 return;
             }
             seek++;
-            if (seek > 10) {
+            if (seek > MAX_SEEK) {
                 dontLayout = true;
             }
 
             Point cs = composite.getSize();
-            int bar_vis = computeBarVisibility(cs.x, cs.y, false, false);
-            boolean vb_vis = (bar_vis & VBAR) != 0;
-            boolean hb_vis = (bar_vis & HBAR) != 0;
-            fVertScrollBar.setVisible(vb_vis);
-            fHorScrollBar.setVisible(hb_vis);
+            int barVis = computeBarVisibility(cs.x, cs.y, false, false);
+            boolean vbVis = (barVis & VBAR) != 0;
+            boolean hbVis = (barVis & HBAR) != 0;
+            fVertScrollBar.setVisible(vbVis);
+            fHorScrollBar.setVisible(hbVis);
             int vbw = getVerticalBarWidth();
             int hbh = getHorizontalBarHeight();
-            int wb = vb_vis ? vbw : 0;
-            int hb = hb_vis ? hbh : 0;
+            int wb = vbVis ? vbw : 0;
+            int hb = hbVis ? hbh : 0;
             int cww = 0, cwh = 0;
 
-            if (fCornerControl != null && (vb_vis || hb_vis)) { // corner_control_.getVisible())
+            if (fCornerControl != null && (vbVis || hbVis)) { // corner_control_.getVisible())
                 fCornerControl.setVisible(true);
                 cww = vbw;
                 cwh = hbh;
@@ -1661,28 +1664,28 @@ public class ScrollView extends Composite {
                 if (hb == 0) {
                     hb = hbh;
                 }
-            } else if (vb_vis && hb_vis) {
+            } else if (vbVis && hbVis) {
                 if (fCornerControl != null) {
                     fCornerControl.setVisible(false);
                 }
                 cww = vbw;
                 cwh = hbh;
             }
-            if (vb_vis || hb_vis) {
+            if (vbVis || hbVis) {
                 updateScrollBarsValues();
             }
 
-            int vw = cs.x - (vb_vis ? vbw : 0);
-            int vh = cs.y - (hb_vis ? hbh : 0);
+            int vw = cs.x - (vbVis ? vbw : 0);
+            int vh = cs.y - (hbVis ? hbh : 0);
             int vbx = cs.x - wb;
             int hby = cs.y - hb;
 
             fViewControl.setBounds(0, 0, vw, vh);
 
-            if (vb_vis) {
+            if (vbVis) {
                 fVertScrollBar.setBounds(vbx, 0, wb, cs.y - cwh);
             }
-            if (hb_vis) {
+            if (hbVis) {
                 fHorScrollBar.setBounds(0, hby, cs.x - cww, hb);
             }
             if (fCornerControl != null && fCornerControl.getVisible()) {
@@ -1691,39 +1694,49 @@ public class ScrollView extends Composite {
             updateScrollBarsValues();
 
             seek--;
-            if (seek == 0) {
+            if (seek == MIN_SEEK) {
                 dontLayout = false;
             }
         }
+
+        boolean isDontLayout() {
+            return dontLayout;
+        }
+
+        void setSontLayout(boolean dontLayout) {
+            this.dontLayout = dontLayout;
+        }
     }
 
     // static must take place here... cursor is created once.
-    volatile static Cursor fOverviewCursor;
+    private volatile static Cursor fOverviewCursor;
 
     /** Support for click-and-see overview shell on this ScrollView */
     protected class Overview {
 
+        private final static int REFRESH_FREQ = 4;
+
         /**
          *  factor for X from real and overview sizes, for mouse move speed.
          */
-        protected float fOverviewFactorX;
+        private float fOverviewFactorX;
 
         /**
          *  factor for Y from real and overview sizes, for mouse move speed.
          */
-        protected float fOverviewFactorY;
+        private float fOverviewFactorY;
         /**
          *  shell use to show overview
          */
-        protected Shell fOverview;
+        private Shell fOverview;
         /**
          * save mouse X cursor location for disappear();
          */
-        protected int fSaveCursorX;
+        private int fSaveCursorX;
         /**
          * save mouse Y cursor location for disappear();
          */
-        protected int fSaveCursorY;
+        private int fSaveCursorY;
 
         /**
          * Apply overview support on a control. Replace existing corner_widget
@@ -1799,7 +1812,7 @@ public class ScrollView extends Composite {
                 public void mouseMove(MouseEvent event) {
                     if (overviewing()) {
                         // Slow down the refresh
-                        if (refReshCount % 4 == 0) {
+                        if (refReshCount % REFRESH_FREQ == 0) {
                             overviewMove(event);
                         }
                         refReshCount++;
@@ -1843,7 +1856,6 @@ public class ScrollView extends Composite {
                 });
             }
             // always the same..
-            // overview.setBackground( viewcontrol_.getBackground() );
             fOverview.setForeground(fViewControl.getForeground());
 
             // get location of shell (in screeen coordinates)
@@ -1851,7 +1863,8 @@ public class ScrollView extends Composite {
             int x = p.x;
             int y = p.y;
             int w, h;
-            w = h = fOverviewSize;
+            h = fOverviewSize;
+            w = h;
             Rectangle scr = getDisplay().getBounds();
             Point ccs = fCornerControl.getSize();
             try {
@@ -1880,9 +1893,6 @@ public class ScrollView extends Composite {
             }
 
             // try pop-up on button, extending to bottom right,
-            // if outside screen, extend pop-up to top left
-            // if( x+w > scr.width ) x = scr.width-w; //x += corner_control_.getSize().x-w;
-            // if( y+h > scr.height ) y = scr.height-h;//y += corner_control_.getSize().y-h;
             if (x <= 0) {
                 x = 1;
             }
@@ -2020,17 +2030,17 @@ public class ScrollView extends Composite {
             Point p = new Point(x, y);
             for (Control c = loc; c != null; c = c.getParent()) {
                 // control might have client area with 'decorations'
-                int trim_x = 0, trim_y = 0;
+                int trimX = 0, trimY = 0;
                 // other kind of widget with trimming ??
                 if (c instanceof Scrollable) {
                     Scrollable s = (Scrollable) c;
                     Rectangle rr = s.getClientArea();
                     Rectangle tr = s.computeTrim(rr.x, rr.y, rr.width, rr.height);
-                    trim_x = rr.x - tr.x;
-                    trim_y = rr.y - tr.y;
+                    trimX = rr.x - tr.x;
+                    trimY = rr.y - tr.y;
                 }
-                p.x += c.getLocation().x + trim_x;
-                p.y += c.getLocation().y + trim_y;
+                p.x += c.getLocation().x + trimX;
+                p.y += c.getLocation().y + trimY;
             }
             return p;
         }
index 16b60b7bc0a0774119fb870ad3a61f3b9ae791d8..2b795a0cf15a67fd3d006807b232cd0e35c719c0 100755 (executable)
@@ -73,71 +73,67 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
     /**
      * The listener list
      */
-    protected List<ITimeCompressionListener> fListenerList = null;
+    private List<ITimeCompressionListener> fListenerList = null;
     /**
      * The current frame displayed.
      */
-    protected Frame fFrame = null;
+    private Frame fFrame = null;
     /**
      * List of time events.
      */
-    protected List<SDTimeEvent> fNodeList = null;
+    private List<SDTimeEvent> fNodeList = null;
     /**
      * The minimum time delta.
      */
-    protected ITmfTimestamp fMinTime = new TmfTimestamp();
+    private ITmfTimestamp fMinTime = new TmfTimestamp();
     /**
      * The maximum time delta.
      */
-    protected ITmfTimestamp fMaxTime = new TmfTimestamp();
+    private ITmfTimestamp fMaxTime = new TmfTimestamp();
     /**
      * The current zoom value.
      */
-    protected float fZoomValue = 1;
+    private float fZoomValue = 1;
     /**
      * The tooltip to display.
      */
-    protected DrawableToolTip fTooltip = null;
+    private DrawableToolTip fTooltip = null;
     /**
      *  Array of colors for displaying wight of time deltas.
      */
-    protected ColorImpl[] fColors;
+    private ColorImpl[] fColors;
     /**
      * The accessible object reference.
      */
-    protected Accessible fAccessible = null;
+    private Accessible fAccessible = null;
     /**
      * The focused widget reference.
      */
-    protected int fFocusedWidget = -1;
-    /**
-     * The sequence diagram view reference.
-     */
-    protected SDView view = null;
+    private int fFocusedWidget = -1;
     /**
      * The current lifeline.
      */
-    protected Lifeline fLifeline = null;
+    private Lifeline fLifeline = null;
     /**
      * The current start event value.
      */
-    protected int fLifelineStart = 0;
+    private int fLifelineStart = 0;
     /**
      * The current number of events.
      */
-    protected int fLifelineNumEvents = 0;
+    private int fLifelineNumEvents = 0;
     /**
      * The Current color of range to display.
      */
-    protected IColor fLifelineColor = null;
+    private IColor fLifelineColor = null;
     /**
      *  The next graph node y coordinate.
      */
-    protected int fNextNodeY = 0;
+    private int fNextNodeY = 0;
     /**
      *  The previous graph node y coordinate.
      */
-    protected int fPrevNodeY = 0;
+    private int fPrevNodeY = 0;
 
     // ------------------------------------------------------------------------
     // Constructors
index 6b6e226025b3b777d5f60a1c3860c59a2f5e6921..31867f8be4f789bb2d020789276766bd4934eed4 100755 (executable)
@@ -67,15 +67,15 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
     /**
      * Flag whether message has time information or not.
      */
-    protected boolean fHasTime = false;
+    private boolean fHasTime = false;
     /**
      * The time when the message begin
      */
-    protected ITmfTimestamp fEndTime = new TmfTimestamp();
+    private ITmfTimestamp fEndTime = new TmfTimestamp();
     /**
      * The time when the message end
      */
-    protected ITmfTimestamp fStartTime = new TmfTimestamp();
+    private ITmfTimestamp fStartTime = new TmfTimestamp();
     /**
      * The associated message.
      */
@@ -88,7 +88,7 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
      * Default constructor
      */
     public AsyncMessage() {
-        fPrefId = ISDPreferences.PREF_ASYNC_MESS;
+        setColorPrefId(ISDPreferences.PREF_ASYNC_MESS);
     }
 
     // ------------------------------------------------------------------------
@@ -99,11 +99,11 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
     public int getX() {
         int x = super.getX(true);
         int activationWidth = Metrics.EXECUTION_OCCURRENCE_WIDTH / 2;
-        if ((fStartLifeline != null) && (fEndLifeline != null) && (fStartLifeline.getX() > fEndLifeline.getX())) {
+        if ((getStartLifeline() != null) && (getEndLifeline() != null) && (getStartLifeline().getX() > getEndLifeline().getX())) {
             activationWidth = -activationWidth;
         }
 
-        if (isMessageStartInActivation(fStartEventOccurrence)) {
+        if (isMessageStartInActivation(getStartOccurrence())) {
             x = x + activationWidth;
         }
         return x;
@@ -111,8 +111,8 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
 
     @Override
     public int getY() {
-        if ((fStartLifeline != null) && (fEndLifeline != null)) {
-            return fEndLifeline.getY() + fEndLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * fStartEventOccurrence;
+        if ((getStartLifeline() != null) && (getEndLifeline() != null)) {
+            return getEndLifeline().getY() + getEndLifeline().getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * getStartOccurrence();
         }
         return super.getY();
     }
@@ -121,15 +121,15 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
     public int getWidth() {
         int width = super.getWidth(true);
         int activationWidth = Metrics.EXECUTION_OCCURRENCE_WIDTH / 2;
-        if ((fStartLifeline != null) && (fEndLifeline != null) && (fStartLifeline.getX() > fEndLifeline.getX())) {
+        if ((getStartLifeline() != null) && (getEndLifeline() != null) && (getStartLifeline().getX() > getEndLifeline().getX())) {
             activationWidth = -activationWidth;
         }
 
-        if (isMessageStartInActivation(fStartEventOccurrence)) {
+        if (isMessageStartInActivation(getStartOccurrence())) {
             width = width - activationWidth;
         }
 
-        if (isMessageEndInActivation(fEndEventOccurrence)) {
+        if (isMessageEndInActivation(getEndOccurrence())) {
             width = width - activationWidth;
         }
 
@@ -138,8 +138,8 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
 
     @Override
     public int getHeight() {
-        if ((fStartLifeline != null) && (fEndLifeline != null)) {
-            return (fEndLifeline.getY() + fEndLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * fEndEventOccurrence) - getY();
+        if ((getStartLifeline() != null) && (getEndLifeline() != null)) {
+            return (getEndLifeline().getY() + getEndLifeline().getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * getEndOccurrence()) - getY();
         }
         return super.getHeight();
     }
@@ -158,10 +158,11 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
      *
      * @param occurrence the event occurrence to set
      */
+    @Override
     public void setEndOccurrence(int occurrence) {
-        fEndEventOccurrence = occurrence;
+        super.setEndOccurrence(occurrence);
         if (getStartLifeline() == null) {
-            fStartEventOccurrence = occurrence;
+            setStartOccurrence(occurrence);
         }
         informFrame(getEndLifeline(), occurrence);
     }
@@ -185,10 +186,11 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
      *
      * @param occurrence the event occurrence to set
      */
+    @Override
     public void setStartOccurrence(int occurrence) {
-        fStartEventOccurrence = occurrence;
+        super.setStartOccurrence(occurrence);
         if (getEndLifeline() == null) {
-            fEndEventOccurrence = fStartEventOccurrence;
+            setEndOccurrence(getStartOccurrence());
         }
         informFrame(getStartLifeline(), occurrence);
     }
@@ -220,7 +222,7 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
         super.setStartLifeline(lifeline);
         setStartOccurrence(getStartLifeline().getEventOccurrence());
         if (getEndLifeline() == null) {
-            fEndEventOccurrence = fStartEventOccurrence;
+            setEndOccurrence(getStartOccurrence());
         }
     }
 
@@ -267,7 +269,7 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
     @Override
     public boolean contains(int x, int y) {
         // Is it a self message?
-        if (fStartLifeline == fEndLifeline) {
+        if (getStartLifeline() == getEndLifeline()) {
             return super.contains(x, y);
         }
         if (isNearSegment(getX(), getY(), getX() + getWidth(), getY() + getHeight(), x, y)) {
@@ -293,13 +295,13 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
      * @param context A graphical context to draw in.
      */
     protected void drawAsyncMessage(IGC context) {
-        if (fStartLifeline != null && fEndLifeline != null && fStartLifeline == fEndLifeline && (fStartEventOccurrence != fEndEventOccurrence)) {
+        if (getStartLifeline() != null && getEndLifeline() != null && getStartLifeline() == getEndLifeline() && (getStartOccurrence() != getEndOccurrence())) {
             int x = getX();
             int y = getY();
             int height = getHeight();
             int tempx = 0;
-            boolean startInActivation = isMessageStartInActivation(fStartEventOccurrence);
-            boolean endInActivation = isMessageEndInActivation(fEndEventOccurrence);
+            boolean startInActivation = isMessageStartInActivation(getStartOccurrence());
+            boolean endInActivation = isMessageEndInActivation(getEndOccurrence());
 
             if (endInActivation && !startInActivation) {
                 tempx = Metrics.EXECUTION_OCCURRENCE_WIDTH / 2;
@@ -341,7 +343,7 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
         ISDPreferences pref = SDViewPref.getInstance();
 
         // Draw it selected?
-        if (isSelected() && (fStartLifeline != null && fEndLifeline != null && fStartLifeline == fEndLifeline && (fStartEventOccurrence != fEndEventOccurrence))) {
+        if (isSelected() && (getStartLifeline() != null && getEndLifeline() != null && getStartLifeline() == getEndLifeline() && (getStartOccurrence() != getEndOccurrence()))) {
             /*
              * Draw it twice First time, bigger inverting selection colors Second time, regular drawing using selection
              * colors This create the highlight effect
@@ -353,8 +355,8 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
             context.setForeground(pref.getForeGroundColorSelection());
             // Second drawing is done after the else
         } else {
-            context.setBackground(pref.getBackGroundColor(fPrefId));
-            context.setForeground(pref.getForeGroundColor(fPrefId));
+            context.setBackground(pref.getBackGroundColor(getColorPrefId()));
+            context.setForeground(pref.getForeGroundColor(getColorPrefId()));
         }
         if (hasFocus()) {
             context.setDrawTextWithFocusStyle(true);
@@ -419,6 +421,14 @@ public class AsyncMessage extends BaseMessage implements ITimeRange {
         return fHasTime;
     }
 
+    /**
+     *  @return message return instance or null
+     *  @since 2.0
+     */
+    public AsyncMessageReturn getMessageReturn() {
+        return fMessageReturn;
+    }
+
     @Override
     public boolean isVisible(int x, int y, int width, int height) {
         int toDrawY = getY();
index 80dd448800d18958da754e748d8747d6c742c0cd..e1589b9275d614d5cedccb6929286df34bcb1248 100755 (executable)
@@ -56,7 +56,7 @@ public class AsyncMessageReturn extends AsyncMessage {
      * Default constructor.
      */
     public AsyncMessageReturn() {
-        fPrefId = ISDPreferences.PREF_ASYNC_MESS_RET;
+        setColorPrefId(ISDPreferences.PREF_ASYNC_MESS_RET);
     }
 
     // ------------------------------------------------------------------------
@@ -74,6 +74,16 @@ public class AsyncMessageReturn extends AsyncMessage {
         fMessage = parentMessage;
     }
 
+    /**
+     * Returns the associated message (the message it is the return).<br>
+     *
+     * @return parentMessage the message to associate
+     * @since 2.0
+     */
+    public AsyncMessage getMessage() {
+        return fMessage;
+    }
+
     @Override
     public void draw(IGC context) {
         if (!isVisible()) {
@@ -82,13 +92,13 @@ public class AsyncMessageReturn extends AsyncMessage {
 
         ISDPreferences pref = SDViewPref.getInstance();
 
-        fPrefId = ISDPreferences.PREF_ASYNC_MESS_RET;
+        setColorPrefId(ISDPreferences.PREF_ASYNC_MESS_RET);
         int oldStyle = context.getLineStyle();
         // Message return are dashed
         context.setLineStyle(context.getLineDotStyle());
         if (!isSelected()) {
-            context.setBackground(pref.getBackGroundColor(fPrefId));
-            context.setForeground(pref.getForeGroundColor(fPrefId));
+            context.setBackground(pref.getBackGroundColor(getColorPrefId()));
+            context.setForeground(pref.getForeGroundColor(getColorPrefId()));
         }
         super.draw(context);
         // restore the context
index ff24c32151fbd3ebeb279ee0f36f3918cad2f2ee..b35340b6ce7e0c5a3ec6ba0d0f277e395064a7a2 100755 (executable)
@@ -38,15 +38,15 @@ public abstract class BaseMessage extends GraphNode {
     /**
      * The lifeline which send the message
      */
-    protected Lifeline fStartLifeline = null;
+    private Lifeline fStartLifeline = null;
     /**
      * The lifeline which receive the message
      */
-    protected Lifeline fEndLifeline = null;
+    private Lifeline fEndLifeline = null;
     /**
      * The visiblitiy flag.
      */
-    protected boolean fVisible = true;
+    private boolean fVisible = true;
 
     // ------------------------------------------------------------------------
     // Methods
@@ -69,21 +69,21 @@ public abstract class BaseMessage extends GraphNode {
             /*
              * Regular message, both ends are attached to a lifeline
              */
-            return fEndLifeline.getY() + fEndLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * fEndEventOccurrence;
+            return fEndLifeline.getY() + fEndLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * getEndOccurrence();
 
         }
         /*
          * UML2 lost message kind
          */
         if (fStartLifeline != null) {
-            return fStartLifeline.getY() + fStartLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * fEndEventOccurrence;
+            return fStartLifeline.getY() + fStartLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * getEndOccurrence();
         }
 
         /*
          * UML2 found message kind
          */
         if (fEndLifeline != null) {
-            return fEndLifeline.getY() + fEndLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * fEndEventOccurrence;
+            return fEndLifeline.getY() + fEndLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * getEndOccurrence();
         }
         // return 0 by default
         return 0;
@@ -138,7 +138,7 @@ public abstract class BaseMessage extends GraphNode {
             activationWidth = -activationWidth;
         }
 
-        if (isMessageStartInActivation(fEndEventOccurrence)) {
+        if (isMessageStartInActivation(getEndOccurrence())) {
             x = x + activationWidth;
         }
 
@@ -186,11 +186,11 @@ public abstract class BaseMessage extends GraphNode {
             activationWidth = -activationWidth;
         }
 
-        if (isMessageStartInActivation(fEndEventOccurrence)) {
+        if (isMessageStartInActivation(getEndOccurrence())) {
             width = width - activationWidth;
         }
 
-        if (isMessageEndInActivation(fEndEventOccurrence)) {
+        if (isMessageEndInActivation(getEndOccurrence())) {
             width = width - activationWidth;
         }
 
@@ -274,7 +274,7 @@ public abstract class BaseMessage extends GraphNode {
      * @see Lifeline Lifeline for more event occurence details
      */
     protected void setEventOccurrence(int occurrence) {
-        fEndEventOccurrence = occurrence;
+        setEndOccurrence(occurrence);
     }
 
     /**
@@ -284,7 +284,7 @@ public abstract class BaseMessage extends GraphNode {
      * @see Lifeline Lifeline for more event occurence details
      */
     public int getEventOccurrence() {
-        return fEndEventOccurrence;
+        return getEndOccurrence();
     }
 
     /**
@@ -306,7 +306,7 @@ public abstract class BaseMessage extends GraphNode {
             int thisY = getY();
             for (int i = 0; i < fStartLifeline.getExecutions().size(); i++) {
                 BasicExecutionOccurrence toDraw = (BasicExecutionOccurrence) fStartLifeline.getExecutions().get(i);
-                if ((event >= toDraw.fStartEventOccurrence) && (event <= toDraw.fEndEventOccurrence)) {
+                if ((event >= toDraw.getStartOccurrence()) && (event <= toDraw.getEndOccurrence())) {
                     inActivation = true;
                 }
                 // if we are outside the visible area we stop right now
@@ -336,7 +336,7 @@ public abstract class BaseMessage extends GraphNode {
             // for drawing speed reason with only search on the visivle subset
             for (int i = 0; i < fEndLifeline.getExecutions().size(); i++) {
                 BasicExecutionOccurrence toDraw = (BasicExecutionOccurrence) fEndLifeline.getExecutions().get(i);
-                if ((event >= toDraw.fStartEventOccurrence) && (event <= toDraw.fEndEventOccurrence)) {
+                if ((event >= toDraw.getStartOccurrence()) && (event <= toDraw.getEndOccurrence())) {
                     inActivation = true;
                 }
                 // if we are outside the visible area we stop right now
@@ -407,8 +407,10 @@ public abstract class BaseMessage extends GraphNode {
      * @param context A graphical context to draw in.
      */
     protected void drawMessage(IGC context) {
-        int fX, fY, fW, fH;
-        fX = fY = fW = fH = 0;
+        int fX = 0;
+        int fY = 0;
+        int fW = 0;
+        int fH = 0;
 
         // temporary store the coordinates to avoid more methods calls
         int x = getX();
@@ -425,7 +427,7 @@ public abstract class BaseMessage extends GraphNode {
             // 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
             IColor temp = context.getForeground();
-            context.setForeground(pref.getFontColor(fPrefId));
+            context.setForeground(pref.getFontColor(getColorPrefId()));
             context.drawTextTruncatedCentred(getName(), x, y - Metrics.getMessageFontHeigth() - 2 * Metrics.MESSAGES_NAME_SPACING, width, 2 * Metrics.MESSAGES_NAME_SPACING + Metrics.getMessageFontHeigth(), !isSelected());
             context.setForeground(temp);
             int margin = 0;
@@ -469,7 +471,7 @@ public abstract class BaseMessage extends GraphNode {
                 context.fillOval(x + width - ray, y + height - ray, ray * 2, ray * 2);
             }
             context.setBackground(storedColor);
-            context.setForeground(pref.getFontColor(fPrefId));
+            context.setForeground(pref.getFontColor(getColorPrefId()));
             fX = x;
             fY = y - yt.intValue();
             fW = width;
@@ -530,7 +532,7 @@ public abstract class BaseMessage extends GraphNode {
             // 2*Metrics.MESSAGES_NAME_SPACING = space above the label + space below the label
 
             // the space available for the text is sorter if are drawing internal message on the last lifeline
-            context.setForeground(pref.getFontColor(fPrefId));
+            context.setForeground(pref.getFontColor(getColorPrefId()));
             if (fStartLifeline.getIndex() == fStartLifeline.getFrame().getHorizontalIndex()) {
                 context.drawTextTruncated(getName(), x + width + Metrics.INTERNAL_MESSAGE_V_MARGIN / 2, y, Metrics.swimmingLaneWidth() / 2 - Metrics.EXECUTION_OCCURRENCE_WIDTH + -Metrics.INTERNAL_MESSAGE_WIDTH, +Metrics.MESSAGES_NAME_SPACING
                         - Metrics.getMessageFontHeigth(), !isSelected());
@@ -595,7 +597,7 @@ public abstract class BaseMessage extends GraphNode {
             // 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
-            context.setForeground(pref.getFontColor(fPrefId));
+            context.setForeground(pref.getFontColor(getColorPrefId()));
             if (spaceBTWStartEnd > 0) {
                 context.drawTextTruncatedCentred(getName(), x, y + height / 2 - (2 * Metrics.MESSAGES_NAME_SPACING + Metrics.getMessageFontHeigth()), width, 2 * Metrics.MESSAGES_NAME_SPACING + Metrics.getMessageFontHeigth(), !isSelected());
             } else {
@@ -701,15 +703,15 @@ public abstract class BaseMessage extends GraphNode {
 
         ISDPreferences pref = SDViewPref.getInstance();
 
-        if ((fStartLifeline != fEndLifeline) && (fStartEventOccurrence == fEndEventOccurrence)) {
+        if ((fStartLifeline != fEndLifeline) && (getStartOccurrence() == getEndOccurrence())) {
             context.setLineStyle(context.getLineDotStyle());
             context.setLineWidth(Metrics.NORMAL_LINE_WIDTH);
             context.setBackground(pref.getBackGroundColorSelection());
             context.setForeground(pref.getForeGroundColorSelection());
             context.drawFocus(getX(), getY() - 3, getWidth(), getHeight() + 6);
-        } else if ((fStartLifeline == fEndLifeline) && (fStartEventOccurrence == fEndEventOccurrence)) {
+        } else if ((fStartLifeline == fEndLifeline) && (getStartOccurrence() == getEndOccurrence())) {
             context.drawFocus(getX(), getY() - 3, getWidth(), Metrics.SYNC_INTERNAL_MESSAGE_HEIGHT + 6);
-        } else if ((fStartLifeline != fEndLifeline) && (fStartEventOccurrence != fEndEventOccurrence)) {
+        } else if ((fStartLifeline != fEndLifeline) && (getStartOccurrence() != getEndOccurrence())) {
             context.setLineStyle(context.getLineDotStyle());
             context.setLineWidth(Metrics.NORMAL_LINE_WIDTH);
             context.setBackground(pref.getBackGroundColor(ISDPreferences.PREF_LIFELINE_HEADER));
index d915069f124a9252fa6fc490c9f6d0dba37875ff..9e0349715e588b8e83d507a108c873f8544ad0cb 100755 (executable)
@@ -43,7 +43,7 @@ public class BasicExecutionOccurrence extends GraphNode {
     /**
      * The corresponding lifeline.
      */
-    protected Lifeline fLifeline = null;
+    private Lifeline fLifeline = null;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -52,7 +52,7 @@ public class BasicExecutionOccurrence extends GraphNode {
      * Default constructore
      */
     public BasicExecutionOccurrence() {
-        fPrefId = ISDPreferences.PREF_EXEC;
+        setColorPrefId(ISDPreferences.PREF_EXEC);
     }
 
     // ------------------------------------------------------------------------
@@ -72,7 +72,7 @@ public class BasicExecutionOccurrence extends GraphNode {
         if (fLifeline == null) {
             return 0;
         }
-        return fLifeline.getY() + fLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * fStartEventOccurrence;
+        return fLifeline.getY() + fLifeline.getHeight() + (Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing()) * getStartOccurrence();
     }
 
     @Override
@@ -88,7 +88,7 @@ public class BasicExecutionOccurrence extends GraphNode {
         if (fLifeline == null) {
             return 0;
         }
-        return ((Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing())) * (fEndEventOccurrence - fStartEventOccurrence);
+        return ((Metrics.getMessageFontHeigth() + Metrics.getMessagesSpacing())) * (getEndOccurrence() - getStartOccurrence());
     }
 
     @Override
@@ -141,7 +141,7 @@ public class BasicExecutionOccurrence extends GraphNode {
      */
     @Override
     public int getStartOccurrence() {
-        return fStartEventOccurrence;
+        return super.getStartOccurrence();
     }
 
     /**
@@ -151,7 +151,7 @@ public class BasicExecutionOccurrence extends GraphNode {
      */
     @Override
     public int getEndOccurrence() {
-        return fEndEventOccurrence;
+        return super.getEndOccurrence();
     }
 
     /**
@@ -159,8 +159,9 @@ public class BasicExecutionOccurrence extends GraphNode {
      *
      * @param occurrence the start event occurrence to set
      */
+    @Override
     public void setStartOccurrence(int occurrence) {
-        fStartEventOccurrence = occurrence;
+        super.setStartOccurrence(occurrence);
     }
 
     /**
@@ -168,8 +169,9 @@ public class BasicExecutionOccurrence extends GraphNode {
      *
      * @param occurrence the end event occurrence to set
      */
+    @Override
     public void setEndOccurrence(int occurrence) {
-        fEndEventOccurrence = occurrence;
+        super.setEndOccurrence(occurrence);
     }
 
     @Override
index bcb89ea1e9861ff6be0c03ac5476420369769a5f..de9bbd7be25ba3198ddff0ee83d5554203d462c3 100755 (executable)
@@ -44,68 +44,68 @@ public class BasicFrame extends GraphNode {
     /**
      * Contains the max elapsed time between two consecutive messages in the whole frame
      */
-    protected ITmfTimestamp fMaxTime = new TmfTimestamp(0);
+    private ITmfTimestamp fMaxTime = new TmfTimestamp(0);
     /**
      * Contains the min elapsed time between two consecutive messages in the whole frame
      */
-    protected ITmfTimestamp fMinTime = new TmfTimestamp(0);
+    private ITmfTimestamp fMinTime = new TmfTimestamp(0);
     /**
      * Indicate if the min and max elapsed time between two consecutive messages in the whole frame need to be computed
      */
-    protected boolean fComputeMinMax = true;
+    private boolean fComputeMinMax = true;
     /**
      * Store the preference set by the user regarding the external time. This flag is used determine if the min and max
      * need to be recomputed in case this preference is changed.
      */
-    protected boolean fLastExternalTimePref = SDViewPref.getInstance().excludeExternalTime();
+    private boolean fLastExternalTimePref = SDViewPref.getInstance().excludeExternalTime();
     /**
      * The greater event occurrence created on graph nodes drawn in this Frame This directly impact the Frame height
      */
-    protected int fVerticalIndex = 0;
+    private int fVerticalIndex = 0;
     /**
      * The index along the x axis where the next lifeline will is drawn This directly impact the Frame width
      */
-    protected int fHorizontalIndex = 0;
+    private int fHorizontalIndex = 0;
     /**
      * The time information flag.
      */
-    protected boolean fHasTimeInfo = false;
+    private boolean fHasTimeInfo = false;
     /**
      * The current Frame visible area - x coordinates
      */
-    protected int fVisibleAreaX;
+    private int fVisibleAreaX;
     /**
      * The current Frame visible area - y coordinates
      */
-    protected int fVisibleAreaY;
+    private int fVisibleAreaY;
     /**
      * The current Frame visible area - width
      */
-    protected int fVisibleAreaWidth;
+    private int fVisibleAreaWidth;
     /**
      * The current Frame visible area - height
      */
-    protected int fVisibleAreaHeight;
+    private int fVisibleAreaHeight;
     /**
      * The event occurrence spacing (-1 for none)
      */
-    protected int fForceEventOccurrenceSpacing = -1;
+    private int fForceEventOccurrenceSpacing = -1;
     /**
      * Flag to indicate customized minumum and maximum.
      */
-    protected boolean fCustomMinMax = false;
+    private boolean fCustomMinMax = false;
     /**
      * The minimum time between messages of the sequence diagram frame.
      */
-    protected ITmfTimestamp fMinSDTime = new TmfTimestamp();
+    private ITmfTimestamp fMinSDTime = new TmfTimestamp();
     /**
      * The maximum time between messages of the sequence diagram frame.
      */
-    protected ITmfTimestamp fMaxSDTime = new TmfTimestamp();
+    private ITmfTimestamp fMaxSDTime = new TmfTimestamp();
     /**
      * Flag to indicate that initial minimum has to be computed.
      */
-    protected boolean fInitSDMin = true;
+    private boolean fInitSDMin = true;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -165,7 +165,7 @@ public class BasicFrame extends GraphNode {
 
     @Override
     public void addNode(GraphNode nodeToAdd) {
-        fComputeMinMax = true;
+        setComputeMinMax(true);
         super.addNode(nodeToAdd);
     }
 
@@ -201,6 +201,32 @@ public class BasicFrame extends GraphNode {
                 + Metrics.LIFELINE_NAME_H_MARGIN + Metrics.FRAME_NAME_H_MARGIN + Metrics.getLifelineFontHeigth() * 2;
     }
 
+    /**
+     * @return true if mininum and maximum time needs to be calculated else false
+     * @since 2.0
+     */
+    protected boolean isComputeMinMax() {
+        return fComputeMinMax;
+    }
+
+    /**
+     * @return true if mininum and maximum time needs to be calculated else false
+     * @since 2.0
+     */
+    protected boolean isCustomMinMax() {
+        return fCustomMinMax;
+    }
+
+    /**
+     * gets the initialization flag for SD minimum.
+     *
+     * @return the initialization flag for SD minimum
+     * @since 2.0
+     */
+    protected boolean getInitSDMin() {
+        return fInitSDMin;
+    }
+
     /**
      * Returns the graph node which contains the point given in parameter for the given graph node list and starting the
      * iteration at the given index<br>
@@ -371,11 +397,11 @@ public class BasicFrame extends GraphNode {
     public ITmfTimestamp getMinTime() {
         if (fLastExternalTimePref != SDViewPref.getInstance().excludeExternalTime()) {
             fLastExternalTimePref = SDViewPref.getInstance().excludeExternalTime();
-            fComputeMinMax = true;
+            setComputeMinMax(true);
         }
         if ((fComputeMinMax) && (!fCustomMinMax)) {
             computeMinMax();
-            fComputeMinMax = false;
+            setComputeMinMax(false);
         }
         return fMinTime;
     }
@@ -409,7 +435,7 @@ public class BasicFrame extends GraphNode {
      */
     public void resetCustomMinMax() {
         fCustomMinMax = false;
-        fComputeMinMax = true;
+        setComputeMinMax(true);
     }
 
     /**
@@ -421,11 +447,11 @@ public class BasicFrame extends GraphNode {
     public ITmfTimestamp getMaxTime() {
         if (fLastExternalTimePref != SDViewPref.getInstance().excludeExternalTime()) {
             fLastExternalTimePref = SDViewPref.getInstance().excludeExternalTime();
-            fComputeMinMax = true;
+            setComputeMinMax(true);
         }
         if (fComputeMinMax) {
             computeMinMax();
-            fComputeMinMax = false;
+            setComputeMinMax(false);
         }
         return fMaxTime;
     }
@@ -510,7 +536,7 @@ public class BasicFrame extends GraphNode {
                 fMinTime = new TmfTimestamp(0, m1.getTime().getScale(), m1.getTime().getPrecision());
             }
             fMaxTime = fMinTime;
-            fComputeMinMax = false;
+            setComputeMinMax(false);
         }
 
         if ((delta.compareTo(fMinTime, true) < 0) && (delta.compareTo(TmfTimestamp.ZERO, false) > 0)) {
@@ -528,15 +554,15 @@ public class BasicFrame extends GraphNode {
      * @return the time array else empty list.
      */
     protected List<SDTimeEvent> buildTimeArray() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return new ArrayList<SDTimeEvent>();
         }
 
-        Iterator<String> it = fForwardSort.keySet().iterator();
+        Iterator<String> it = getForwardSortMap().keySet().iterator();
         List<SDTimeEvent> timeArray = new ArrayList<SDTimeEvent>();
         while (it.hasNext()) {
             String nodeType = it.next();
-            List<GraphNode> list = fNodes.get(nodeType);
+            List<GraphNode> list = getNodeMap().get(nodeType);
             for (int i = 0; i < list.size(); i++) {
                 Object timedNode = list.get(i);
                 if ((timedNode instanceof ITimeRange) && ((ITimeRange) timedNode).hasTimeInfo()) {
@@ -545,7 +571,7 @@ public class BasicFrame extends GraphNode {
                     SDTimeEvent f = new SDTimeEvent(time, event, (ITimeRange) list.get(i));
                     timeArray.add(f);
                     if (event != list.get(i).getEndOccurrence()) {
-                        event = ((AsyncMessage) list.get(i)).getEndOccurrence();
+                        event = (list.get(i)).getEndOccurrence();
                         time = ((ITimeRange) list.get(i)).getEndTime();
                         f = new SDTimeEvent(time, event, (ITimeRange) list.get(i));
                         timeArray.add(f);
@@ -565,4 +591,43 @@ public class BasicFrame extends GraphNode {
     public boolean contains(int x, int y) {
         return false;
     }
+
+    /**
+     * @return true if frame has time info else false
+     * @since 2.0
+     */
+    public boolean hasTimeInfo() {
+        return fHasTimeInfo;
+    }
+
+    /**
+     * Sets the flag whether the frame has time info or not
+     * @since 2.0
+     * @param hasTimeInfo
+     *          true if frame has time info else false
+     */
+    public void setHasTimeInfo(boolean hasTimeInfo) {
+        fHasTimeInfo = hasTimeInfo;
+    }
+
+    /**
+     * Sets the flag for minimum and maximum computation.
+     * @param computeMinMax
+     *          true if mininum and maximum time needs to be calculated else false
+     * @since 2.0
+     */
+    public void setComputeMinMax(boolean computeMinMax) {
+        fComputeMinMax = computeMinMax;
+    }
+
+    /**
+     * Sets the initialization flag for SD minimum.
+     *
+     * @param initSDMin
+     *          the flag to set
+     * @since 2.0
+     */
+    public void setInitSDMin(boolean initSDMin) {
+        fInitSDMin = initSDMin;
+    }
 }
index 0af19ac7d3cdf46920b43b585bd9caf1ac4e5a3c..21990c88d1359fb82ad304ccf98cde5378ce8e76 100755 (executable)
@@ -28,7 +28,7 @@ public class EllipsisMessage extends AsyncMessage {
 
     @Override
     public int getX() {
-        if (fStartLifeline == null) {
+        if (getStartLifeline() == null) {
             return super.getX() + super.getWidth() - 16;
         }
         return super.getX();
@@ -53,7 +53,7 @@ public class EllipsisMessage extends AsyncMessage {
         int height = getHeight();
 
         // UML2 found message (always drawn from left to right)
-        if (fStartLifeline == null && fEndLifeline != null) {
+        if (getStartLifeline() == null && getEndLifeline() != 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
@@ -75,7 +75,7 @@ public class EllipsisMessage extends AsyncMessage {
             context.setBackground(storedColor);
         }
         // UML2 lost message (always drawn from left to right)
-        else if (fEndLifeline == null && fStartLifeline != null) {
+        else if (getEndLifeline() == null && getStartLifeline() != 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
index acadb480b3fe6c30e0b6177cd693ab57a4c3f59f..7d0667ab5fda9f25770b78e0d3686c7f1691bc1a 100755 (executable)
@@ -12,6 +12,8 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.core;
 
+import java.util.Arrays;
+
 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;
@@ -37,31 +39,31 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
     /**
      * Set the red, green and blue value of the optional color to be used for filling the execution occurrence.
      */
-    protected int[] fFillRGB;
+    private int[] fFillRGB;
     /**
      * Set the red, green and blue value of the optional color to be used for drawing the execution occurrence
      */
-    protected int[] fStrokeRGB;
+    private int[] fStrokeRGB;
     /**
      * The occurrence image.
      */
-    protected IImage fImage;
+    private IImage fImage;
     /**
      * The top ellipses image.
      */
-    protected IImage fEllipsesImage;
+    private IImage fEllipsesImage;
     /**
      *  The start time stamp.
      */
-    protected ITmfTimestamp fStartTime;
+    private ITmfTimestamp fStartTime;
     /**
      * The end time stamp;
      */
-    protected ITmfTimestamp fEndTime;
+    private ITmfTimestamp fEndTime;
     /**
      * Flag to indicate whether time information is available or not.
      */
-    protected boolean fHasTimeInfo;
+    private boolean fHasTimeInfo;
 
     // ------------------------------------------------------------------------
     // Methods
@@ -70,10 +72,10 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
     @Override
     public void setLifeline(Lifeline theLifeline) {
         super.setLifeline(theLifeline);
-        if (fLifeline != null && fHasTimeInfo) {
-            fLifeline.fHasTimeInfo = true;
-            if (fLifeline.getFrame() != null) {
-                fLifeline.getFrame().setHasTimeInfo(true);
+        if (getLifeline() != null && fHasTimeInfo) {
+            getLifeline().setTimeInfo(true);
+            if (getLifeline().getFrame() != null) {
+                getLifeline().getFrame().setHasTimeInfo(true);
             }
         }
     }
@@ -133,8 +135,8 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
     public void setStartTime(ITmfTimestamp time) {
         fStartTime = time;
         fHasTimeInfo = true;
-        if (fLifeline != null) {
-            fLifeline.setTimeInfo(true);
+        if (getLifeline() != null) {
+            getLifeline().setTimeInfo(true);
         }
     }
 
@@ -147,8 +149,8 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
     public void setEndTime(ITmfTimestamp time) {
         fEndTime = time;
         fHasTimeInfo = true;
-        if (fLifeline != null) {
-            fLifeline.setTimeInfo(true);
+        if (getLifeline() != null) {
+            getLifeline().setTimeInfo(true);
         }
     }
 
@@ -173,6 +175,44 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
         return fHasTimeInfo;
     }
 
+   /**
+    * @return the RGB of the occurrence filler.
+    * @since 2.0
+    */
+    public int[] getFillRGB() {
+       if (fFillRGB == null) {
+           return null;
+       }
+       return Arrays.copyOf(fFillRGB, fFillRGB.length);
+   }
+
+    /**
+     * @return the RGB of the occurrence filler.
+     * @since 2.0
+     */
+     public int[] getStrokeRGB() {
+        if (fStrokeRGB == null) {
+            return null;
+        }
+        return Arrays.copyOf(fStrokeRGB, fStrokeRGB.length);
+    }
+
+    /**
+     * @return the image.
+     * @since 2.0
+     */
+    protected IImage getImage() {
+        return fImage;
+    }
+
+    /**
+     * @return the image.
+     * @since 2.0
+     */
+    protected IImage getEllipsesImage() {
+        return fEllipsesImage;
+    }
+
     @Override
     public void draw(IGC context) {
         super.draw(context);
@@ -214,4 +254,14 @@ public class ExecutionOccurrence extends BasicExecutionOccurrence implements ITi
         }
         return super.setUnselectedStrokeColor(context);
     }
+
+    /**
+     * Sets the flag whether the frame has time info or not
+     * @since 2.0
+     * @param hasTimeInfo
+     *          true if frame has time info else false
+     */
+    public void setHasTimeInfo(boolean hasTimeInfo) {
+        fHasTimeInfo = hasTimeInfo;
+    }
 }
index 155df548a074f3341ba2251d255002911596ce90..6c54fde7ef44eaba7d0e42e4506d9d54a1e678a7 100755 (executable)
@@ -44,27 +44,27 @@ public class Frame extends BasicFrame {
     /**
      * The lifeline that is current highlighted.
      */
-    protected Lifeline fHighlightLifeline = null;
+    private Lifeline fHighlightLifeline = null;
     /**
      * The value of the start event.
      */
-    protected int fStartEvent = 0;
+    private int fStartEvent = 0;
     /**
-     * The nubmer of events in the frame.
+     * The number of events in the frame.
      */
-    protected int fNbEvent = 0;
+    private int fNbEvent = 0;
     /**
      * The color for highlighting.
      */
-    protected IColor fHighlightColor = null;
+    private IColor fHighlightColor = null;
     /**
      * The list of time events of the corresponding execution occurrences.
      */
-    protected List<SDTimeEvent> fExecutionOccurrencesWithTime;
+    private List<SDTimeEvent> fExecutionOccurrencesWithTime;
     /**
      * The Array of lifeline categories.
      */
-    protected LifelineCategories[] fLifelineCategories = null;
+    private LifelineCategories[] fLifelineCategories = null;
 
     // ------------------------------------------------------------------------
     // Methods
@@ -77,10 +77,10 @@ public class Frame extends BasicFrame {
      * @return the lifelines list
      */
     protected List<GraphNode> getLifelines() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return null;
         }
-        return fNodes.get(Lifeline.LIFELINE_TAG);
+        return getNodeMap().get(Lifeline.LIFELINE_TAG);
     }
 
     /**
@@ -116,10 +116,10 @@ public class Frame extends BasicFrame {
      * @return the syncMessages list
      */
     protected List<GraphNode> getSyncMessages() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return null;
         }
-        return fNodes.get(SyncMessage.SYNC_MESS_TAG);
+        return getNodeMap().get(SyncMessage.SYNC_MESS_TAG);
     }
 
     /**
@@ -154,10 +154,10 @@ public class Frame extends BasicFrame {
      * @return the asyncMessages list or <code>null</code>
      */
     protected List<GraphNode> getAsyncMessages() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return null;
         }
-        return fNodes.get(AsyncMessage.ASYNC_MESS_TAG);
+        return getNodeMap().get(AsyncMessage.ASYNC_MESS_TAG);
     }
 
     /**
@@ -192,10 +192,10 @@ public class Frame extends BasicFrame {
      * @return the syncMessages return list or <code>null</code>
      */
     protected List<GraphNode> getSyncMessagesReturn() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return null;
         }
-        return fNodes.get(SyncMessageReturn.SYNC_MESS_RET_TAG);
+        return getNodeMap().get(SyncMessageReturn.SYNC_MESS_RET_TAG);
     }
 
     /**
@@ -230,10 +230,10 @@ public class Frame extends BasicFrame {
      * @return the asyncMessageRetun list or <code>null</code>
      */
     protected List<GraphNode> getAsyncMessagesReturn() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return null;
         }
-        return fNodes.get(AsyncMessageReturn.ASYNC_MESS_RET_TAG);
+        return getNodeMap().get(AsyncMessageReturn.ASYNC_MESS_RET_TAG);
     }
 
     /**
@@ -268,7 +268,7 @@ public class Frame extends BasicFrame {
      * @param lifeline the lifeline to add
      */
     public void addLifeLine(Lifeline lifeline) {
-        fComputeMinMax = true;
+        setComputeMinMax(true);
         if (lifeline == null) {
             return;
         }
@@ -278,7 +278,7 @@ public class Frame extends BasicFrame {
         // and set the lifeline drawing order
         lifeline.setIndex(getNewHorizontalIndex());
         if (lifeline.hasTimeInfo()) {
-            fHasTimeInfo = true;
+            setHasTimeInfo(true);
         }
         // add the lifeline to the lifelines list
         addNode(lifeline);
@@ -290,10 +290,10 @@ public class Frame extends BasicFrame {
      * @return the first visible lifeline index
      */
     public int getFirstVisibleLifeline() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return 0;
-        } else if (fIndexes.get(Lifeline.LIFELINE_TAG) != null) {
-            return fIndexes.get(Lifeline.LIFELINE_TAG).intValue();
+        } else if (getIndexes().get(Lifeline.LIFELINE_TAG) != null) {
+            return getIndexes().get(Lifeline.LIFELINE_TAG).intValue();
         }
         return 0;
     }
@@ -304,10 +304,10 @@ public class Frame extends BasicFrame {
      * @return the first visible synchronous message index
      */
     public int getFirstVisibleSyncMessage() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return 0;
-        } else if (fIndexes.get(SyncMessage.SYNC_MESS_TAG) != null) {
-            return fIndexes.get(SyncMessage.SYNC_MESS_TAG).intValue();
+        } else if (getIndexes().get(SyncMessage.SYNC_MESS_TAG) != null) {
+            return getIndexes().get(SyncMessage.SYNC_MESS_TAG).intValue();
         }
         return 0;
     }
@@ -318,10 +318,10 @@ public class Frame extends BasicFrame {
      * @return the first visible synchronous message return index
      */
     public int getFirstVisibleSyncMessageReturn() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return 0;
-        } else if (fIndexes.get(SyncMessageReturn.SYNC_MESS_RET_TAG) != null) {
-            return fIndexes.get(SyncMessageReturn.SYNC_MESS_RET_TAG).intValue();
+        } else if (getIndexes().get(SyncMessageReturn.SYNC_MESS_RET_TAG) != null) {
+            return getIndexes().get(SyncMessageReturn.SYNC_MESS_RET_TAG).intValue();
         }
         return 0;
     }
@@ -332,10 +332,10 @@ public class Frame extends BasicFrame {
      * @return the first visible synchronous message index
      */
     public int getFirstVisibleAsyncMessage() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return 0;
-        } else if (fIndexes.get(AsyncMessage.ASYNC_MESS_TAG) != null) {
-            return fIndexes.get(AsyncMessage.ASYNC_MESS_TAG).intValue();
+        } else if (getIndexes().get(AsyncMessage.ASYNC_MESS_TAG) != null) {
+            return getIndexes().get(AsyncMessage.ASYNC_MESS_TAG).intValue();
         }
         return 0;
     }
@@ -346,10 +346,10 @@ public class Frame extends BasicFrame {
      * @return the first visible synchronous message return index
      */
     public int getFirstVisibleAsyncMessageReturn() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return 0;
-        } else if (fIndexes.get(AsyncMessageReturn.ASYNC_MESS_RET_TAG) != null) {
-            return fIndexes.get(AsyncMessageReturn.ASYNC_MESS_RET_TAG).intValue();
+        } else if (getIndexes().get(AsyncMessageReturn.ASYNC_MESS_RET_TAG) != null) {
+            return getIndexes().get(AsyncMessageReturn.ASYNC_MESS_RET_TAG).intValue();
         }
         return 0;
     }
@@ -529,7 +529,7 @@ public class Frame extends BasicFrame {
             if (SDViewPref.getInstance().excludeExternalTime() && ((m1.getGraphNode() instanceof BaseMessage) && (m2.getGraphNode() instanceof BaseMessage))) {
                 BaseMessage mes1 = (BaseMessage) m1.getGraphNode();
                 BaseMessage mes2 = (BaseMessage) m2.getGraphNode();
-                if ((mes2.fStartLifeline == null) || (mes1.fEndLifeline == null)) {
+                if ((mes2.getStartLifeline() == null) || (mes1.getEndLifeline() == null)) {
                     continue;
                 }
             }
@@ -574,24 +574,6 @@ public class Frame extends BasicFrame {
         return false;
     }
 
-    /**
-     * Set whether time information is available or not
-     *
-     * @param value <code>true</code> for has time information else <code>false</code>
-     */
-    protected void setHasTimeInfo(boolean value) {
-        fHasTimeInfo = value;
-    }
-
-    /**
-     * Returns whether frame has time info or not.
-     *
-     * @return <code>true</code> whether frame has time info else <code>false</code>
-     */
-    public boolean hasTimeInfo() {
-        return fHasTimeInfo;
-    }
-
     /**
      * Highlights the time compression.
      *
@@ -644,7 +626,7 @@ public class Frame extends BasicFrame {
     @Override
     public void draw(IGC context) {
         drawFrame(context);
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return;
         }
 
@@ -660,12 +642,12 @@ public class Frame extends BasicFrame {
         if (Metrics.swimmingLaneWidth() * context.getZoom() < Metrics.LIFELINE_SIGNIFICANT_HSPACING) {
             lifelineArryStep = Math.round(Metrics.LIFELINE_SIGNIFICANT_HSPACING / (Metrics.swimmingLaneWidth() * context.getZoom()));
         }
-        if (fIndexes.size() == 0) {
+        if (getIndexes().size() == 0) {
             return;
         }
-        int lifeLineDrawIndex = fIndexes.get(Lifeline.LIFELINE_TAG).intValue();
-        for (int i = lifeLineDrawIndex; i < fNodes.get(Lifeline.LIFELINE_TAG).size(); i = i + lifelineArryStep) {
-            Lifeline toDraw = (Lifeline) fNodes.get(Lifeline.LIFELINE_TAG).get(i);
+        int lifeLineDrawIndex = getIndexes().get(Lifeline.LIFELINE_TAG).intValue();
+        for (int i = lifeLineDrawIndex; i < getNodeMap().get(Lifeline.LIFELINE_TAG).size(); i = i + lifelineArryStep) {
+            Lifeline toDraw = (Lifeline) getNodeMap().get(Lifeline.LIFELINE_TAG).get(i);
             if (toDraw.getX() - Metrics.LIFELINE_SPACING / 2 > context.getContentsX() + context.getVisibleWidth()) {
                 break;
             }
@@ -684,7 +666,7 @@ public class Frame extends BasicFrame {
                             BasicExecutionOccurrence exec = (BasicExecutionOccurrence) toDraw.getExecutions().get(index);
                             int tempEvent = fStartEvent;
                             for (int j = 0; j < fNbEvent; j++) {
-                                if (((tempEvent >= exec.fStartEventOccurrence) && (tempEvent <= exec.fEndEventOccurrence) && (tempEvent + 1 >= exec.fStartEventOccurrence) && (tempEvent + 1 <= exec.fEndEventOccurrence))) {
+                                if (((tempEvent >= exec.getStartOccurrence()) && (tempEvent <= exec.getEndOccurrence()) && (tempEvent + 1 >= exec.getStartOccurrence()) && (tempEvent + 1 <= exec.getEndOccurrence()))) {
                                     toDraw.highlightExecOccurrenceRegion(context, tempEvent, 1, SDViewPref.getInstance().getTimeCompressionSelectionColor());
                                 }
                                 tempEvent = tempEvent + 1;
@@ -704,15 +686,15 @@ public class Frame extends BasicFrame {
     @Override
     protected List<SDTimeEvent> buildTimeArray() {
 
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return new ArrayList<SDTimeEvent>();
         }
 
         List<SDTimeEvent> timeArray = super.buildTimeArray();
         fExecutionOccurrencesWithTime = null;
         if (getLifelines() != null) {
-            for (int i = 0; i < fNodes.get(Lifeline.LIFELINE_TAG).size(); i++) {
-                Lifeline lifeline = (Lifeline) fNodes.get(Lifeline.LIFELINE_TAG).get(i);
+            for (int i = 0; i < getNodeMap().get(Lifeline.LIFELINE_TAG).size(); i++) {
+                Lifeline lifeline = (Lifeline) getNodeMap().get(Lifeline.LIFELINE_TAG).get(i);
                 if (lifeline.hasTimeInfo() && lifeline.getExecutions() != null) {
                     for (Iterator<GraphNode> j = lifeline.getExecutions().iterator(); j.hasNext();) {
                         GraphNode o = j.next();
@@ -1076,10 +1058,10 @@ public class Frame extends BasicFrame {
         BasicExecutionOccurrence result = null;
         for (int i = 0; i < list.size(); i++) {
             BasicExecutionOccurrence e = (BasicExecutionOccurrence) list.get(i);
-            if ((e.getStartOccurrence() < exec.fStartEventOccurrence) && (result == null)) {
+            if ((e.getStartOccurrence() < exec.getStartOccurrence()) && (result == null)) {
                 result = e;
             }
-            if ((e.getStartOccurrence() < exec.fStartEventOccurrence) && (result != null) && (e.getStartOccurrence() >= result.getEndOccurrence())) {
+            if ((e.getStartOccurrence() < exec.getStartOccurrence()) && (result != null) && (e.getStartOccurrence() >= result.getEndOccurrence())) {
                 result = e;
             }
         }
@@ -1107,10 +1089,10 @@ public class Frame extends BasicFrame {
         BasicExecutionOccurrence result = null;
         for (int i = 0; i < list.size(); i++) {
             BasicExecutionOccurrence e = (BasicExecutionOccurrence) list.get(i);
-            if ((e.getStartOccurrence() > exec.fStartEventOccurrence) && (result == null)) {
+            if ((e.getStartOccurrence() > exec.getStartOccurrence()) && (result == null)) {
                 result = e;
             }
-            if ((e.getStartOccurrence() > exec.fStartEventOccurrence) && (result != null) && (e.getStartOccurrence() <= result.getEndOccurrence())) {
+            if ((e.getStartOccurrence() > exec.getStartOccurrence()) && (result != null) && (e.getStartOccurrence() <= result.getEndOccurrence())) {
                 result = e;
             }
         }
@@ -1143,4 +1125,91 @@ public class Frame extends BasicFrame {
         }
         return result;
     }
-}
+
+    /**
+     * @return highlighted life line if set else null.
+     * @since 2.0
+     */
+    protected Lifeline getHighlightLifeline() {
+        return fHighlightLifeline;
+    }
+
+    /**
+     * @return the start event value.
+     * @since 2.0
+     */
+    protected int getStartEvent() {
+        return fStartEvent;
+    }
+
+    /**
+     * Returns the number of events
+     *
+     * @return the number of events
+     * @since 2.0
+     */
+    protected int getNumberOfEvents() {
+        return fNbEvent;
+    }
+
+    /**
+     * Returns the highlight color.
+     * @return the highlight color
+     * @since 2.0
+     */
+    protected IColor getHighlightColor() {
+        return fHighlightColor;
+    }
+
+    /**
+     * Set the highlighted life line.
+     * @param lifeline
+     *          The highlighted life line if set else null
+     * @since 2.0
+     */
+    protected void setHighlightLifeline(Lifeline lifeline) {
+        fHighlightLifeline = lifeline;
+    }
+
+    /**
+     * Sets the start event value
+     * @param startEvent
+     *           the start event value.
+     * @since 2.0
+     */
+    protected void setStartEvent(int startEvent) {
+        fStartEvent = startEvent;
+    }
+
+    /**
+     * Sets the number of events
+     *
+     * @param nbEvents
+     *          The number of events
+     * @since 2.0
+     */
+    protected void setNumberOfEvents(int nbEvents) {
+        fNbEvent = nbEvents;
+    }
+
+    /**
+     * Sets the highlight color.
+     * @param color
+     *          the highlight color
+     * @since 2.0
+     */
+    protected void setHighlightColor(IColor color) {
+        fHighlightColor = color;
+    }
+
+    /**
+     * sets the list of execution occurrences.
+     *
+     * @param occurences
+     *          the list of execution occurrences
+     * @since 2.0
+     */
+    protected void setExecutionOccurrencesWithTime(List<SDTimeEvent> occurences) {
+        fExecutionOccurrencesWithTime = occurences;
+    }
+}
\ No newline at end of file
index 34c79c1cf4239a32d210bd76cc3cc383e443ce7c..998a51152bd2ea277b33dc785cbd0139a4c064e8 100755 (executable)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation, 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
@@ -39,55 +39,55 @@ public abstract class GraphNode {
     /**
      * The start event occurrence.
      */
-    protected int fStartEventOccurrence = 0;
+    private int fStartEventOccurrence = 0;
     /**
      * The event event occurrence.
      */
-    protected int fEndEventOccurrence = 0;
+    private int fEndEventOccurrence = 0;
     /**
      * Preference ColorId to use to draw font
      */
-    public String fPrefId = ISDPreferences.PREF_SYNC_MESS;
+    private String fPrefId = ISDPreferences.PREF_SYNC_MESS;
     /**
      * The selection state of the graph node.
      */
-    protected boolean fSelected = false;
+    private boolean fSelected = false;
     /**
      * The focus state of the graph node.
      */
-    protected boolean fFocused = false;
+    private boolean fFocused = false;
     /**
      * Flag to indicate whether node has children or not.
      */
-    protected boolean fHasChilden = false;
+    private boolean fHasChilden = false;
     /**
      * The graph node name used to label the graph node in the View.
      */
-    protected String fName = ""; //$NON-NLS-1$
+    private String fName = ""; //$NON-NLS-1$
     /**
      * A map from node name to graph node.
      */
-    protected Map<String, List<GraphNode>> fNodes;
+    private Map<String, List<GraphNode>> fNodes;
     /**
      * A map from node name to graph node for forward sorting
      */
-    protected Map<String, List<GraphNode>> fForwardNodes;
+    private Map<String, List<GraphNode>> fForwardNodes;
     /**
      * A map from node name to graph node for backwards sorting.
      */
-    protected Map<String, List<GraphNode>> fBackwardNodes;
+    private Map<String, List<GraphNode>> fBackwardNodes;
     /**
      * A map from node name to index.
      */
-    protected Map<String, Integer> fIndexes;
+    private Map<String, Integer> fIndexes;
     /**
-     * A map from node name to index for forwards sorting.
+     * A map from node name to flag for forwards sorting.
      */
-    protected Map<String, Boolean> fForwardSort;
+    private Map<String, Boolean> fForwardSort;
     /**
-     * A map from node name to index for forwards sorting.
+     * A map from node name to flag for backwards sorting.
      */
-    protected Map<String, Boolean> fBackwardSort;
+    private Map<String, Boolean> fBackwardSort;
 
     // ------------------------------------------------------------------------
     // Methods
@@ -791,4 +791,116 @@ public abstract class GraphNode {
         }
         return (px >= locX) && (py >= locY) && ((px - locX) <= locWidth) && ((py - locY) <= locHeight);
     }
+
+    /**
+     * Sets the start event occurrence attached to this graphNode.
+     *
+     * @param occurence
+     *          the start event occurrence attached to the graphNode
+     * @since 2.0
+     */
+    protected void setStartOccurrence(int occurence) {
+        fStartEventOccurrence = occurence;
+    }
+
+    /**
+     * Sets the end event occurrence attached to this graphNode
+     *
+     * @param occurence
+     *          the start event occurrence attached to the graphNode
+     * @since 2.0
+     */
+    protected void setEndOccurrence(int occurence) {
+        fEndEventOccurrence = occurence;
+    }
+
+    /**
+     * Sets the color preference id
+     * @param id
+     *          The color preference id
+     * @since 2.0
+     */
+    protected void setColorPrefId(String id) {
+        fPrefId = id;
+    }
+
+    /**
+     * Gets the color preference id
+     * @return the color preference id
+     * @since 2.0
+     */
+    protected String getColorPrefId() {
+        return fPrefId;
+    }
+
+    /**
+     * @return if node has children or not
+     * @since 2.0
+     */
+    protected boolean hasChildren() {
+        return fHasChilden;
+    }
+
+    /**
+     * Sets the flag indicating where the node has children or not.
+     * @param hasChildren
+     *          if node has children or not
+     * @since 2.0
+     */
+    protected void hasChildren(boolean hasChildren) {
+        fHasChilden = hasChildren;
+    }
+    /**
+     * Returns a map from node name to graph node.
+     *
+     * @return map with children graph bodes
+     * @since 2.0
+     */
+    protected Map<String, List<GraphNode>> getNodeMap() {
+        return fNodes;
+    }
+    /**
+     * Returns a map from node name to graph node for forward sorting
+     *
+     * @return forward sorting map
+     * @since 2.0
+     */
+    protected Map<String, List<GraphNode>> getForwardNodes() {
+        return fForwardNodes;
+    }
+    /**
+     * Returns a map from node name to graph node for backwards sorting.
+     *
+     * @return backwards sorting map
+     * @since 2.0
+     */
+    protected Map<String, List<GraphNode>> getBackwardNodes() {
+        return fBackwardNodes;
+    }
+    /**
+     * Returns a map from node name to index.
+     *
+     * @return map with node name to index
+     * @since 2.0
+     */
+    protected Map<String, Integer> getIndexes() {
+        return fIndexes;
+    }
+
+    /**
+     * Returns a map from node name to sort flag for forwards sorting.
+     * @return a map from node name to sort flag
+     * @since 2.0
+     */
+    protected Map<String, Boolean> getForwardSortMap() {
+        return fForwardSort;
+    }
+    /**
+     * Returns a map from node name to flag for backwards sorting.
+     * @return map from node name to flag for backwards sorting.
+     * @since 2.0
+     */
+    protected Map<String, Boolean> getBackwardSortMap() {
+        return fBackwardSort;
+    }
 }
index 03aa62260a946202558b5aeadfc96efd06156a5b..14244622038f6123b902bb0659c97870c3dcd477 100755 (executable)
@@ -38,15 +38,15 @@ public class HotSpot extends GraphNode {
     /**
      * The execution occurrence the hot spot marker is for.
      */
-    protected BasicExecutionOccurrence fExecOcc = null;
+    private BasicExecutionOccurrence fExecOcc = null;
     /**
      * The occurrence number.
      */
-    protected int fOccurrence = 0;
+    private int fOccurrence = 0;
     /**
      * The marker image to display.
      */
-    protected IImage fImage = null;
+    private IImage fImage = null;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -56,7 +56,7 @@ public class HotSpot extends GraphNode {
      * Default constructor
      */
     public HotSpot() {
-        fPrefId = ISDPreferences.PREF_EXEC;
+        setColorPrefId(ISDPreferences.PREF_EXEC);
     }
 
     // ------------------------------------------------------------------------
@@ -72,6 +72,16 @@ public class HotSpot extends GraphNode {
         fImage = img;
     }
 
+    /**
+     * Returns the marker image.
+     *
+     * @return the image
+     * @since 2.0
+     */
+    protected IImage getImage() {
+        return fImage;
+    }
+
     @Override
     public int getX() {
         if (fExecOcc != null) {
index 1755eda41bc9cb5ecf63dc6a8fb5b2333e002dbe..35677712ab25a5288f97255e9bc2e2704cb7cb88 100755 (executable)
@@ -48,23 +48,23 @@ public class Lifeline extends GraphNode {
     /**
      * The lifeline position in the containing frame
      */
-    protected int fIndexInFrame = 0;
+    private int fIndexInFrame = 0;
     /**
      * The frame where the lifeline is drawn
      */
-    protected Frame fFrame = null;
+    private Frame fFrame = null;
     /**
      * The current event occurrence created in the lifeline
      */
-    protected int fEventOccurrence = 0;
+    private int fEventOccurrence = 0;
     /**
      * The lifeline category.
      */
-    protected int fCategory = -1;
+    private int fCategory = -1;
     /**
      * Flag whether lifeline has time information available or not
      */
-    protected boolean fHasTimeInfo = false;
+    private boolean fHasTimeInfo = false;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -73,7 +73,7 @@ public class Lifeline extends GraphNode {
      * Default constructor
      */
     public Lifeline() {
-        fPrefId = ISDPreferences.PREF_LIFELINE;
+        setColorPrefId(ISDPreferences.PREF_LIFELINE);
     }
 
     // ------------------------------------------------------------------------
@@ -112,6 +112,16 @@ public class Lifeline extends GraphNode {
         fCategory = arrayIndex;
     }
 
+    /**
+     * Gets the lifeline category for this lifeline.
+     *
+     * @return arrayIndex the index of the category to use
+     * @since 2.0
+     */
+    public int getCategory() {
+        return fCategory;
+    }
+
     /**
      * Returns the tooltip text for the lifeline. It is the combination between the category name(if any) and the
      * lifeline name
@@ -135,11 +145,11 @@ public class Lifeline extends GraphNode {
      * @return the first visible Execution Occurrence
      */
     public int getExecOccurrenceDrawIndex() {
-        if (!fHasChilden) {
+        if (!hasChildren()) {
             return 0;
         }
-        if (fIndexes.get(BasicExecutionOccurrence.EXEC_OCC_TAG) != null) {
-            return fIndexes.get(BasicExecutionOccurrence.EXEC_OCC_TAG).intValue();
+        if (getIndexes().get(BasicExecutionOccurrence.EXEC_OCC_TAG) != null) {
+            return getIndexes().get(BasicExecutionOccurrence.EXEC_OCC_TAG).intValue();
         }
         return 0;
     }
@@ -230,8 +240,8 @@ public class Lifeline extends GraphNode {
     public void addExecution(BasicExecutionOccurrence exec) {
         exec.setLifeline(this);
         addNode(exec);
-        if ((fFrame != null) && (fFrame.getMaxEventOccurrence() < exec.fEndEventOccurrence)) {
-            fFrame.setMaxEventOccurrence(exec.fEndEventOccurrence);
+        if ((fFrame != null) && (fFrame.getMaxEventOccurrence() < exec.getEndOccurrence())) {
+            fFrame.setMaxEventOccurrence(exec.getEndOccurrence());
         }
     }
 
@@ -261,8 +271,8 @@ public class Lifeline extends GraphNode {
      * @return the execution occurrence list
      */
     public List<GraphNode> getExecutions() {
-        if (fHasChilden) {
-            return fNodes.get(BasicExecutionOccurrence.EXEC_OCC_TAG);
+        if (hasChildren()) {
+            return getNodeMap().get(BasicExecutionOccurrence.EXEC_OCC_TAG);
         }
         return new ArrayList<GraphNode>();
     }
index 5a48dc4524d62b0a309b4ac7a0523dadefe1c95a..f0be1c24a738e18bb7ce2d4f1688510d8c6914c0 100755 (executable)
@@ -1,5 +1,5 @@
 /**********************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation, 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
@@ -33,11 +33,11 @@ public class LifelineCategories {
     /**
         * The category name
         */
-       protected String fName = null;
+       private String fName = null;
        /**
         * The category image
         */
-       protected IImage fCategoryImage = null;
+       private IImage fCategoryImage = null;
 
     // ------------------------------------------------------------------------
     // Methods
index d87cf58d1fbb76f8184abc1d9ce523e833e56247..54e6f4de119a430648fc898e62fb3b2e4ef1beed 100755 (executable)
@@ -30,15 +30,15 @@ public class SDTimeEvent {
     /**
      * The time stamp of the event
      */
-    protected ITmfTimestamp fTimestamp;
+    private final ITmfTimestamp fTimestamp;
     /**
      * The event index.
      */
-    protected int fEvent;
+    private final int fEvent;
     /**
      * The time range implementing node.
      */
-    protected ITimeRange fNode;
+    private final ITimeRange fNode;
 
     // ------------------------------------------------------------------------
     // Constructors
index bd06b7fffcb5dac6fa3d32db8e44990dae16f296..0c7858beb23ce6d0f3b25a6cf707bb7ace1c263a 100755 (executable)
@@ -42,13 +42,13 @@ public class Stop extends GraphNode {
     /**
      * The owning lifeline on which the stop appears
      */
-    protected Lifeline fLifeline = null;
+    private 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;
+    private int fEventOccurrence = 0;
 
     // ------------------------------------------------------------------------
     // Methods
@@ -95,6 +95,26 @@ public class Stop extends GraphNode {
         fLifeline = theLifeline;
     }
 
+    /**
+     * Get the lifeline on which the stop must be draw
+     *
+     * @return the the stop owing lifeline
+     * @since 2.0
+     */
+    public Lifeline getLifeline() {
+        return fLifeline;
+    }
+
+    /**
+     * Get the event occurrence when this stop appears
+     *
+     * @return the eventOccurence to assign to the stop
+     * @since 2.0
+     */
+    public int getEventOccurrence() {
+        return fEventOccurrence;
+    }
+
     /**
      * Set the event occurrence when this stop appears
      *
index a60386882ebc1ca9ea9f69624010102888670cce..aece1f32f7eaff8dba5d451f1378eaf2a02d76cf 100755 (executable)
@@ -68,15 +68,15 @@ public class SyncMessage extends BaseMessage implements ITimeRange {
     /**
      * The associated message return
      */
-    protected SyncMessageReturn fMessageReturn;
+    private SyncMessageReturn fMessageReturn;
     /**
      * The time when the message occurs
      */
-    protected ITmfTimestamp fEventTime = new TmfTimestamp();
+    private ITmfTimestamp fEventTime = new TmfTimestamp();
     /**
      * Flag whether the message has time information available or not
      */
-    protected boolean fHasTimeInfo = false;
+    private boolean fHasTimeInfo = false;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -86,7 +86,7 @@ public class SyncMessage extends BaseMessage implements ITimeRange {
      * Default constructor
      */
     public SyncMessage() {
-        fPrefId = ISDPreferences.PREF_SYNC_MESS;
+        setColorPrefId(ISDPreferences.PREF_SYNC_MESS);
     }
 
     // ------------------------------------------------------------------------
@@ -182,8 +182,8 @@ public class SyncMessage extends BaseMessage implements ITimeRange {
      */
     @Override
     protected void setEventOccurrence(int occurrence) {
-        fStartEventOccurrence = occurrence;
-        fEndEventOccurrence = occurrence;
+        setStartOccurrence(occurrence);
+        setEndOccurrence(occurrence);
     }
 
     /**
@@ -251,8 +251,8 @@ public class SyncMessage extends BaseMessage implements ITimeRange {
 
         // Draw it selected?
         if (!isSelected()) {
-            context.setBackground(pref.getBackGroundColor(fPrefId));
-            context.setForeground(pref.getForeGroundColor(fPrefId));
+            context.setBackground(pref.getBackGroundColor(getColorPrefId()));
+            context.setForeground(pref.getForeGroundColor(getColorPrefId()));
         }
         super.draw(context);
     }
@@ -267,7 +267,7 @@ public class SyncMessage extends BaseMessage implements ITimeRange {
 
         // UML2 lost/found message visibility special case
         // Others visibility cases are perform in the ***common*** case
-        if ((fEndLifeline == null && fStartLifeline != null) || (fEndLifeline != null && fStartLifeline == null)) {
+        if ((getEndLifeline() == null && getStartLifeline() != null) || (getEndLifeline() != null && getStartLifeline() == null)) {
             if (x + width > getX() + getWidth() && x < getX() + getWidth()) {
                 return true;
             }
index c2a700f80f8b21d0070f974eec3dd7a132213e0d..a0b665b9ad877222befe054e9d09ed4a87e22cc3 100755 (executable)
@@ -47,7 +47,7 @@ public class SyncMessageReturn extends SyncMessage {
     /**
      * The associated message(the message it is the return).
      */
-    protected SyncMessage fMessage = null;
+    private SyncMessage fMessage = null;
 
     // ------------------------------------------------------------------------
     // Constractors
@@ -57,7 +57,7 @@ public class SyncMessageReturn extends SyncMessage {
      * Default constructor
      */
     public SyncMessageReturn() {
-        fPrefId = ISDPreferences.PREF_SYNC_MESS_RET;
+        setColorPrefId(ISDPreferences.PREF_SYNC_MESS_RET);
     }
 
     // ------------------------------------------------------------------------
@@ -97,8 +97,8 @@ public class SyncMessageReturn extends SyncMessage {
         context.setLineStyle(context.getLineDotStyle());
         // Draw it selected?
         if (!isSelected()) {
-            context.setBackground(pref.getBackGroundColor(fPrefId));
-            context.setForeground(pref.getForeGroundColor(fPrefId));
+            context.setBackground(pref.getBackGroundColor(getColorPrefId()));
+            context.setForeground(pref.getForeGroundColor(getColorPrefId()));
         }
         super.draw(context);
         // restore the context
index 255792d124c59c27122e9a0eed69aff782b8468e..f65b9e23ca2684436622cc59c19e022184a0f39a 100755 (executable)
@@ -37,39 +37,39 @@ public class Criteria {
     /**
      * Flag whether lifeline is selected or not.
      */
-    protected boolean fLifeLineSelected = false;
+    private boolean fLifeLineSelected = false;
     /**
      * Flag whether synchronous message is selected or not.
      */
-    protected boolean fSyncMessageSelected = false;
+    private boolean fSyncMessageSelected = false;
     /**
      * Flag whether synchronous message return is selected or not.
      */
-    protected boolean fSyncMessageReturnSelected = false;
+    private boolean fSyncMessageReturnSelected = false;
     /**
      * Flag whether asynchronous message is selected or not.
      */
-    protected boolean fAsyncMessageSelected = false;
+    private boolean fAsyncMessageSelected = false;
     /**
      * Flag whether asynchronous message return is selected or not.
      */
-    protected boolean fAsyncMessageReturnSelected = false;
+    private boolean fAsyncMessageReturnSelected = false;
     /**
      * Flag whether case sensitive find is required or not.
      */
-    protected boolean fCaseSenstiveSelected = false;
+    private boolean fCaseSenstiveSelected = false;
     /**
      * Flag whether stop graph node is selected or not.
      */
-    protected boolean fStopSelected = false;
+    private boolean fStopSelected = false;
     /**
      * The find expression.
      */
-    protected String  fExpression = null;
+    private String  fExpression = null;
     /**
      * The find pattern as regular expression.
      */
-    protected Pattern pattern = null;
+    private Pattern pattern = null;
 
     // ------------------------------------------------------------------------
     // Constructors
index ed2d78c3546a5ff7ff5ee80d240a1e525bb70c34..d67a88e4a96d1a305804d3ecec63a182b0dabc6c 100755 (executable)
@@ -48,19 +48,19 @@ public class FilterCriteria {
     /**
      * The criteria reference.
      */
-    protected Criteria fCriteria;
+    private Criteria fCriteria;
     /**
      * Flag whether this criteria is active or not
      */
-    protected boolean fIsActive;
+    private boolean fIsActive;
     /**
      * Flag whether this criteria is for positive filter or not
      */
-    protected boolean fIsPositive;
+    private boolean fIsPositive;
     /**
      * The loader class name.
      */
-    protected String fLoaderClassName;
+    private String fLoaderClassName;
 
     // ------------------------------------------------------------------------
     // Constructor
index e2e62c5d156f2f39e9c8090a09e85eef3d5ee0ca..77a149e5ef5fcba4f86390037bb96bcac786f1cb 100755 (executable)
@@ -63,31 +63,31 @@ public class FilterListDialog extends Dialog {
     /**
      * The viewer and provided are kept here as attributes
      */
-    protected IViewPart fViewer = null;
+    private final IViewPart fViewer;
     /**
      * The filter provider implementation
      */
-    protected ISDFilterProvider fProvider = null;
+    private final ISDFilterProvider fProvider;
     /**
      * The filters are the result of editing this list
      */
-    protected List<FilterCriteria> fFilters;
+    private List<FilterCriteria> fFilters;
     /**
      * The add button.
      */
-    protected Button fAdd;
+    private Button fAdd;
     /**
      * The remove button.
      */
-    protected Button fRemove;
+    private Button fRemove;
     /**
      * The edit button.
      */
-    protected Button fEdit;
+    private Button fEdit;
     /**
      * The table with list of filters.
      */
-    protected Table fTable;
+    private Table fTable;
 
     // ------------------------------------------------------------------------
     // Constructor
index 0ff3fc82ccc077ba9cbbd5be661c9e9242f69737..b962a3d22e9f7f8494356fdd384e191ab411f81d 100755 (executable)
@@ -46,39 +46,39 @@ public class MinMaxDialog extends Dialog {
     /**
      * Label for minimum.
      */
-    protected Label fMinLabel;
+    private Label fMinLabel;
     /**
      * Label for maximum.
      */
-    protected Label fMaxLabel;
+    private Label fMaxLabel;
     /**
      * Label for scale
      */
-    protected Label fScaleLabel;
+    private Label fScaleLabel;
     /**
      * Label for precision.
      */
-    protected Label fPrecisionLabel;
+    private Label fPrecisionLabel;
     /**
      * Text field for minimum.
      */
-    protected Text fMinText;
+    private Text fMinText;
     /**
      * Text field for maximum.
      */
-    protected Text fMaxText;
+    private Text fMaxText;
     /**
      * Text field for scale.
      */
-    protected Text fScaleText;
+    private Text fScaleText;
     /**
      * Text field for precision.
      */
-    protected Text fPrecisionText;
+    private Text fPrecisionText;
     /**
      * The sequence diagram widget reference.
      */
-    protected SDWidget fSdWidget;
+    private SDWidget fSdWidget;
 
     // ------------------------------------------------------------------------
     // Constructor
index 729d1358a9e5b2af4d7e676982effdf0a07744bd..c3db012810b8563eb9ad69f69ba426ba243f7196 100755 (executable)
@@ -44,13 +44,13 @@ public class PagesDialog extends Dialog {
     /**
      * viewer and provided are kept here as attributes
      */
-    protected ISDAdvancedPagingProvider fProvider = null;
+    private ISDAdvancedPagingProvider fProvider = null;
 
     /** Current page */
-    protected TextArea fCurrentPage;
+    private TextArea fCurrentPage;
 
     /** Comment label */
-    protected Label fTotalPageComment;
+    private Label fTotalPageComment;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -111,7 +111,7 @@ public class PagesDialog extends Dialog {
     /**
      * Updates the comments texts.
      */
-    protected void updateComments() {
+    private void updateComments() {
         int pages = Math.max(0, fProvider.pagesCount());
         StringBuffer totalPageCommentText = new StringBuffer();
         totalPageCommentText.append(Messages.SequenceDiagram_Total);
index d63890a20313506bd5e7861fc6a907acf4c3afc4..6898a6d643691c9f2a94fd72daeb03c9165f18ac 100755 (executable)
@@ -40,23 +40,23 @@ public class SDPrintDialog extends Dialog {
     /**
      * The sequence dialog widget reference.
      */
-    protected SDWidget fSdView;
+    private SDWidget fSdView;
     /**
      * Sequence dialog print dialog UI
      */
-    protected SDPrintDialogUI fDialogUI;
+    private SDPrintDialogUI fDialogUI;
     /**
      * Error message to display.
      */
-    protected String fErrorMessage = null;
+    private String fErrorMessage = null;
     /**
      * A message label.
      */
-    protected Label fMessageLabel = null;
+    private Label fMessageLabel = null;
     /**
      * Flag whether the page is complete or not
      */
-    protected boolean fIsPageComplete = true;
+    private boolean fIsPageComplete = true;
 
     // ------------------------------------------------------------------------
     // Constructors
index aad3d78851b02dc6b7a0db6f223df6f799602599..f93a0fc73856266610990ba2e9c6e52ef6979d64 100755 (executable)
@@ -65,184 +65,184 @@ public class SDPrintDialogUI {
     /**
      * The set horizontal pages number.
      */
-    protected Button fSetHPagesNumber;
+    private Button fSetHPagesNumber;
     /**
      * The set vertical pages number.
      */
-    protected Button fSetVPagesNumber;
+    private Button fSetVPagesNumber;
     /**
      * Flag whether to use current zoom or not.
      */
-    protected Button fUseCurrentZoom;
+    private Button fUseCurrentZoom;
     /**
      * Flag whether to print all pages or not
      */
-    protected Button fAllPages;
+    private Button fAllPages;
     /**
      * Flag whether to print current page only
      */
-    protected Button fCurrentPage;
+    private Button fCurrentPage;
     /**
      * Button to select a page list.
      */
-    protected Button fPageList;
+    private Button fPageList;
     /**
      * Button to select a page range.
      */
-    protected Button fPageRange;
+    private Button fPageRange;
     /**
      * Text field to enter from page.
      */
-    protected Text fFromPage;
+    private Text fFromPage;
     /**
      * Text field to enter to page.
      */
-    protected Text fToPage;
+    private Text fToPage;
     /**
      *  The sequence diagram widget reference.
      */
-    protected SDWidget fSdView;
+    private SDWidget fSdView;
     /**
      * Text field for number of horizontal pages
      */
-    protected Text fHorPagesNum;
+    private Text fHorPagesNum;
     /**
      * Text field for number of vertical pages
      */
-    protected Text fVertPagesNum;
+    private Text fVertPagesNum;
     /**
      * Text field for toal number of pages
      */
-    protected Text fTotalPages;
+    private Text fTotalPages;
     /**
      * A modify listener implementation to handle modifications.
      */
-    protected ModifyListener fModifyListener;
+    private ModifyListener fModifyListener;
     /**
      * A selection listener implementation to handle selections.
      */
-    protected SelectionListener fSelectionListener;
+    private SelectionListener fSelectionListener;
     /**
      * Local canvas displaying sequence diagram overview.
      */
-    protected LocalSD fOverviewCanvas;
+    private LocalSD fOverviewCanvas;
     /**
      * Number of pages
      */
-    protected int fNbPages = 0;
+    private int fNbPages = 0;
     /**
      * Number of selected pages.
      */
-    protected int fPageNum = -1;
+    private int fPageNum = -1;
     /**
      * Number of first page.
      */
-    protected int fFirstPage = -1;
+    private int fFirstPage = -1;
     /**
      * List of pages to print.
      */
-    protected int fPagesList[];
+    private int fPagesList[];
 
     /**
      * Value for dividing the sequence diagram into pages
      */
-    protected float fStepX;
+    private float fStepX;
 
     /**
      * Value for dividing the sequence diagram into pages
      */
-    protected float fStepY;
+    private float fStepY;
 
     /**
      * Value for dividing the sequence diagram into pages
      */
-    protected float sTX;
+    private float sTX;
 
     /**
      * Value for dividing the sequence diagram into pages
      */
-    protected float sTY;
+    private float sTY;
 
     /**
      * Page which to print from.
      */
-    protected int fFrom;
+    private int fFrom;
     /**
      * Page which to print to.
      */
-    protected int fTo;
+    private int fTo;
     /**
      * Flag for enabling multi-selection.
      */
-    protected boolean fMultiSelection = false;
+    private boolean fMultiSelection = false;
     /**
      * Flag for enabling area selection.
      */
-    protected boolean fAreaSelection = false;
+    private boolean fAreaSelection = false;
     /**
      * Flag for printing all.
      */
-    protected boolean fPrintAll;
+    private boolean fPrintAll;
     /**
      * Flag for printing current page only.
      */
-    protected boolean fPrintCurrent;
+    private boolean fPrintCurrent;
     /**
      * Flag for printing a selection of pages.
      */
-    protected boolean fPrintSelection;
+    private boolean fPrintSelection;
     /**
      * Flag for printing a range of pages.
      */
-    protected boolean fPrintRange;
+    private boolean fPrintRange;
     /**
      * Number of selected rows
      */
-    protected int fNbRows;
+    private int fNbRows;
     /**
      * Number of selected lines
      */
-    protected int fNbLines;
+    private int fNbLines;
     /**
      * The zoom factor.
      */
-    protected float fZoomFactor;
+    private float fZoomFactor;
     /**
      * The printer data reference.
      */
-    protected PrinterData fPrinterData;
+    private PrinterData fPrinterData;
     /**
      * The diagram tooltip to show if necessary.
      */
-    protected DiagramToolTip fToolTip = null;
+    private DiagramToolTip fToolTip = null;
     /**
      * Label for current selection.
      */
-    protected Label fCurrentSelection;
+    private Label fCurrentSelection;
     /**
      * The shell reference.
      */
-    protected Shell fShell;
+    private Shell fShell;
     /**
      * Button to open printer dialog from OS.
      */
-    protected Button fPrinterDialog;
+    private Button fPrinterDialog;
     /**
      * Flag for showing print button.
      */
-    protected boolean fShowPrintButton;
+    private boolean fShowPrintButton;
     /**
      * Test value
      */
-    protected int fTest = 3;
+    private int fTest = 3;
     /**
      * Parent wizard page if used as wizard
      */
-    protected WizardPage fParentWizardPage = null;
+    private WizardPage fParentWizardPage = null;
     /**
      * Reference to parent print dialog.
      */
-    protected SDPrintDialog fParentDialog = null;
+    private SDPrintDialog fParentDialog = null;
 
     // ------------------------------------------------------------------------
     // Helper Class
@@ -251,7 +251,7 @@ public class SDPrintDialogUI {
      * Local sequence diagram widget used to display overview of sequence diagram to print.
      * @version 1.0
      */
-    protected class LocalSD extends SDWidget {
+    private class LocalSD extends SDWidget {
 
         /**
          * Constructor
@@ -265,7 +265,7 @@ public class SDPrintDialogUI {
         @Override
         public int getContentsHeight() {
             if (fSdView.getContentsHeight() > fSdView.getContentsHeight()) {
-                return (int) (fSdView.getVisibleHeight() / (float) fTest / fSdView.fZoomValue);
+                return (int) (fSdView.getVisibleHeight() / (float) fTest / fSdView.getZoomValue());
             }
             return super.getContentsHeight();
         }
@@ -273,7 +273,7 @@ public class SDPrintDialogUI {
         @Override
         public int getContentsWidth() {
             if (fSdView.getVisibleWidth() > fSdView.getContentsWidth()) {
-                return (int) (fSdView.getVisibleWidth() / (float) fTest / fSdView.fZoomValue);
+                return (int) (fSdView.getVisibleWidth() / (float) fTest / fSdView.getZoomValue());
             }
             return super.getContentsWidth();
         }
@@ -314,11 +314,11 @@ public class SDPrintDialogUI {
 
                     Image toDel = over;
                     if (fOverviewCanvas.isFocusControl()) {
-                        over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * fOverviewCanvas.fZoomValue)), contentsToViewY((int) (line * stepY * fOverviewCanvas.fZoomValue)),
-                                ((int) (stepX * fOverviewCanvas.fZoomValue)), ((int) (stepY * fOverviewCanvas.fZoomValue))), new RGB(0, 0, 128)));
+                        over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * fOverviewCanvas.getZoomValue())), contentsToViewY((int) (line * stepY * fOverviewCanvas.getZoomValue())),
+                                ((int) (stepX * fOverviewCanvas.getZoomValue())), ((int) (stepY * fOverviewCanvas.getZoomValue()))), new RGB(0, 0, 128)));
                     } else {
-                        over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * fOverviewCanvas.fZoomValue)), contentsToViewY((int) (line * stepY * fOverviewCanvas.fZoomValue)),
-                                ((int) (stepX * fOverviewCanvas.fZoomValue)), ((int) (stepY * fOverviewCanvas.fZoomValue))), new RGB(221, 208, 200)));
+                        over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * fOverviewCanvas.getZoomValue())), contentsToViewY((int) (line * stepY * fOverviewCanvas.getZoomValue())),
+                                ((int) (stepX * fOverviewCanvas.getZoomValue())), ((int) (stepY * fOverviewCanvas.getZoomValue()))), new RGB(221, 208, 200)));
                     }
                     toDel.dispose();
                 }
@@ -339,8 +339,8 @@ public class SDPrintDialogUI {
                 row--;
 
                 Image toDel = over;
-                over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * fOverviewCanvas.fZoomValue)), contentsToViewY((int) (line * stepY * fOverviewCanvas.fZoomValue)),
-                        ((int) (stepX * fOverviewCanvas.fZoomValue)), ((int) (stepY * fOverviewCanvas.fZoomValue))), new RGB(221, 208, 200)));
+                over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * fOverviewCanvas.getZoomValue())), contentsToViewY((int) (line * stepY * fOverviewCanvas.getZoomValue())),
+                        ((int) (stepX * fOverviewCanvas.getZoomValue())), ((int) (stepY * fOverviewCanvas.getZoomValue()))), new RGB(221, 208, 200)));
                 toDel.dispose();
             }
 
@@ -367,14 +367,14 @@ public class SDPrintDialogUI {
             computeStepXY();
             Image d;
 
-            int lw = (int) (getContentsWidth() / fZoomValue);
+            int lw = (int) (getContentsWidth() / getZoomValue());
             if (getContentsWidth() < getVisibleWidth()) {
-                lw = (int) (getVisibleWidth() / fZoomValue);
+                lw = (int) (getVisibleWidth() / getZoomValue());
             }
 
-            int lh = (int) (getContentsHeight() / fZoomValue);
+            int lh = (int) (getContentsHeight() / getZoomValue());
             if (getContentsHeight() < getVisibleHeight()) {
-                lh = (int) (getVisibleHeight() / fZoomValue);
+                lh = (int) (getVisibleHeight() / getZoomValue());
             }
             d = createPagesSelectionImages(dbuffer, lw, fStepX, lh, fStepY);
 
@@ -413,8 +413,8 @@ public class SDPrintDialogUI {
                 if (row == 0) {
                     line--;
                 }
-                if ((line + 1) * fStepY > (fOverviewCanvas.getContentsY() + fOverviewCanvas.getVisibleHeight()) / fOverviewCanvas.fZoomValue) {
-                    fOverviewCanvas.scrollBy(0, (int) (fStepY * fOverviewCanvas.fZoomValue));
+                if ((line + 1) * fStepY > (fOverviewCanvas.getContentsY() + fOverviewCanvas.getVisibleHeight()) / fOverviewCanvas.getZoomValue()) {
+                    fOverviewCanvas.scrollBy(0, (int) (fStepY * fOverviewCanvas.getZoomValue()));
                 }
             }
             if (e.keyCode == SWT.ARROW_UP) {
@@ -426,8 +426,8 @@ public class SDPrintDialogUI {
                 if (row == 0) {
                     line--;
                 }
-                if ((line) * fStepY <= fOverviewCanvas.getContentsY() / fOverviewCanvas.fZoomValue) {
-                    fOverviewCanvas.scrollBy(0, -(int) (fStepY * fOverviewCanvas.fZoomValue));
+                if ((line) * fStepY <= fOverviewCanvas.getContentsY() / fOverviewCanvas.getZoomValue()) {
+                    fOverviewCanvas.scrollBy(0, -(int) (fStepY * fOverviewCanvas.getZoomValue()));
                 }
             }
             if (e.keyCode == SWT.ARROW_LEFT) {
@@ -435,8 +435,8 @@ public class SDPrintDialogUI {
                     fPageNum--;
                 }
                 int row = fPageNum % getNbRow();
-                if ((row - 1) * fStepX < (fOverviewCanvas.getContentsX()) / fOverviewCanvas.fZoomValue) {
-                    fOverviewCanvas.scrollBy(-(int) (fStepX * fOverviewCanvas.fZoomValue), 0);
+                if ((row - 1) * fStepX < (fOverviewCanvas.getContentsX()) / fOverviewCanvas.getZoomValue()) {
+                    fOverviewCanvas.scrollBy(-(int) (fStepX * fOverviewCanvas.getZoomValue()), 0);
                 }
             }
             if (e.keyCode == SWT.ARROW_RIGHT) {
@@ -447,8 +447,8 @@ public class SDPrintDialogUI {
                 if (row == 0) {
                     row = getNbRow();
                 }
-                if ((row) * fStepX > (fOverviewCanvas.getContentsX() + fOverviewCanvas.getVisibleWidth()) / fOverviewCanvas.fZoomValue) {
-                    fOverviewCanvas.scrollBy((int) (fStepX * fOverviewCanvas.fZoomValue), 0);
+                if ((row) * fStepX > (fOverviewCanvas.getContentsX() + fOverviewCanvas.getVisibleWidth()) / fOverviewCanvas.getZoomValue()) {
+                    fOverviewCanvas.scrollBy((int) (fStepX * fOverviewCanvas.getZoomValue()), 0);
                 }
             }
 
@@ -521,8 +521,8 @@ public class SDPrintDialogUI {
         protected void contentsMouseDownEvent(MouseEvent event) {
 
             computeStepXY();
-            int x1 = (int) ((event.x / fOverviewCanvas.fZoomValue) / fStepX);
-            int x2 = (int) ((event.y / fOverviewCanvas.fZoomValue) / fStepY);
+            int x1 = (int) ((event.x / fOverviewCanvas.getZoomValue()) / fStepX);
+            int x2 = (int) ((event.y / fOverviewCanvas.getZoomValue()) / fStepY);
 
             int oldPage = fPageNum;
 
@@ -824,7 +824,7 @@ public class SDPrintDialogUI {
             fTest = 10;
         }
         fOverviewCanvas.setFrame(fSdView.getFrame(), true);
-        fOverviewCanvas.fZoomValue = (float) 1 / fTest;
+        fOverviewCanvas.setZoomValue((float) 1 / fTest);
         fOverviewCanvas.setCornerControl(null);
         seqDiagLayoutData.widthHint = fOverviewCanvas.getContentsWidth() / fTest;
         seqDiagLayoutData.widthHint = fOverviewCanvas.getFrame().getWidth() / fTest + 15;
@@ -903,8 +903,8 @@ public class SDPrintDialogUI {
 
             @Override
             public void mouseHover(MouseEvent e) {
-                int x1 = (int) (fOverviewCanvas.viewToContentsX(e.x) / fOverviewCanvas.fZoomValue / fStepX);
-                int x2 = (int) (fOverviewCanvas.viewToContentsY(e.y) / fOverviewCanvas.fZoomValue / fStepY);
+                int x1 = (int) (fOverviewCanvas.viewToContentsX(e.x) / fOverviewCanvas.getZoomValue() / fStepX);
+                int x2 = (int) (fOverviewCanvas.viewToContentsY(e.y) / fOverviewCanvas.getZoomValue() / fStepY);
                 int num = x1 + x2 * getNbRow() + 1;
                 if (num > maxNumOfPages()) {
                     return;
@@ -1065,8 +1065,8 @@ public class SDPrintDialogUI {
      * Computes value for X coordinates step and Y coordinates step.
      */
     protected void computeStepXY() {
-        float cw = fOverviewCanvas.getContentsWidth() / fOverviewCanvas.fZoomValue;
-        float ch = fOverviewCanvas.getContentsHeight() / fOverviewCanvas.fZoomValue;
+        float cw = fOverviewCanvas.getContentsWidth() / fOverviewCanvas.getZoomValue();
+        float ch = fOverviewCanvas.getContentsHeight() / fOverviewCanvas.getZoomValue();
         try {
             if (fPrinterData == null) {
                 fStepX = 0;
@@ -1168,7 +1168,7 @@ public class SDPrintDialogUI {
      */
     public int getNbRow() {
         if (!fSetHPagesNumber.isDisposed()) {
-            int cw = (int) (fOverviewCanvas.getContentsWidth() / fOverviewCanvas.fZoomValue);
+            int cw = (int) (fOverviewCanvas.getContentsWidth() / fOverviewCanvas.getZoomValue());
             int row = 1;
             if (fStepX != 0) {
                 row = (int) (cw / fStepX);
@@ -1190,7 +1190,7 @@ public class SDPrintDialogUI {
      */
     public int getNbLines() {
         if (!fSetVPagesNumber.isDisposed()) {
-            int ch = (int) (fOverviewCanvas.getContentsHeight() / fOverviewCanvas.fZoomValue);
+            int ch = (int) (fOverviewCanvas.getContentsHeight() / fOverviewCanvas.getZoomValue());
             int line = 1;
             if (fStepY != 0) {
                 line = (int) (ch / fStepY);
index 16c75c1eb04697d2d1d50455a20c114780cd6d52..fa1f929aede984ccfbcbee3dea366f097daa5ed0 100755 (executable)
@@ -75,22 +75,22 @@ public class SearchFilterDialog extends Dialog {
     /**
      * The sequence diagram view reference.
      */
-    protected SDView fSdView = null;
+    private final SDView fSdView;
 
     /**
      * The tab with the controls for a Criteria
      */
-    protected TabFolder fTabFolder = null;
+    private final TabFolder fTabFolder = null;
 
     /**
      * The Criteria updated by this dialog
      */
-    protected Criteria fCriteria = null;
+    private Criteria fCriteria = null;
 
     /**
      * The find/filter provider telling which graph nodes are supported
      */
-    protected ISDGraphNodeSupporter fProvider = null;
+    final private ISDGraphNodeSupporter fProvider;
 
     /**
      * The okText is the text for the Ok button and title is the title of the
index f70a0c769ebb87a2cb014a3e718e4782c9029c02..79ceffcbf78b50f2ca5f4a9f2952be048849c1da 100755 (executable)
@@ -41,55 +41,55 @@ public class TabContents extends Composite {
     /**
      * A graph node type listener implementation.
      */
-    protected GraphNodeTypeListener fGraphNodeTypeListener = null;
+    private final GraphNodeTypeListener fGraphNodeTypeListener;
     /**
      * A expression listener implementation.
      */
-    protected ExpressionListener fExpressionListener = null;
+    private final ExpressionListener fExpressionListener;
     /**
      * The button for lifelines.
      */
-    protected Button fLifelineButton = null;
+    private Button fLifelineButton;
     /**
      * The button for stops.
      */
-    protected Button fStopButton = null;
+    private Button fStopButton = null;
     /**
      * The button for synchronous messages
      */
-    protected Button fSynMessageButton = null;
+    private Button fSynMessageButton = null;
     /**
      * The button for synchronous return messages
      */
-    protected Button fSynMessageReturnButton = null;
+    private Button fSynMessageReturnButton = null;
     /**
      * The button for asynchronous messages
      */
-    protected Button fAsynMessageButton = null;
+    private Button fAsynMessageButton = null;
     /**
      * The button for asynchronous return messages
      */
-    protected Button fAsynMessageReturnButton = null;
+    private Button fAsynMessageReturnButton = null;
     /**
      * The search text combo box.
      */
-    protected Combo fSearchText = null;
+    private Combo fSearchText = null;
     /**
      * The group for selection kind.
      */
-    protected Group fKindSelection = null;
+    private Group fKindSelection = null;
     /**
      * The button for case sensitive expressions.
      */
-    protected Button fCaseSensitive = null;
+    private Button fCaseSensitive = null;
     /**
      * The label for the result string.
      */
-    protected Label fResult = null;
+    private Label fResult = null;
     /**
      * The button for notifying parent about valid data.
      */
-    protected Button fParentOkButton = null;
+    private Button fParentOkButton = null;
 
     // ------------------------------------------------------------------------
     // Constructors
index 413cecd6bc4b0b4282a5429e0cbdd2e78ebc8455..940565050a0511ff82913c7f993aa1b848072f60 100755 (executable)
@@ -31,11 +31,11 @@ public class ColorImpl implements IColor {
     /**
      * The color object.
      */
-    protected Color fColor = null;
+    private final Color fColor;
     /**
      * Flag to indicate that this object is managing the resource.
      */
-    protected boolean fManageColor = true;
+    private boolean fManageColor = true;
 
     // ------------------------------------------------------------------------
     // Constructors
index 789dda7567f2583a06998084b9dafdf6488032cc..6c7b2a95dafcc1a2394bfaa804526870eae016fb 100755 (executable)
@@ -33,7 +33,7 @@ public class FontImpl implements IFont {
     /**
      * The font object
      */
-    protected Font fFont = null;
+    private final Font fFont;
     /**
      * Flag to indicate that this object is managing the resource.
      */
index 64c7ec5d235df5f86c7e93b28415ad95e770d99c..9935315c6fd5f34e855c00dbb5260c86b513a2fd 100755 (executable)
@@ -36,7 +36,7 @@ public class ImageImpl implements IImage {
     /**
      * The image reference
      */
-    protected Image fImage = null;
+    private final Image fImage;
 
     // ------------------------------------------------------------------------
     // Constructors
diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/BaseSDAction.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/BaseSDAction.java
new file mode 100644 (file)
index 0000000..d32b029
--- /dev/null
@@ -0,0 +1,89 @@
+/**********************************************************************
+ * Copyright (c) 2013 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:
+ *     Bernd Hufmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
+
+/**
+ * Base class for sequence diagram actions.
+ *
+ * @author Bernd Hufmann
+ * @since 2.0
+ */
+public class BaseSDAction extends Action {
+
+    // ------------------------------------------------------------------------
+    // Attributes
+    // ------------------------------------------------------------------------
+    /**
+     * The sequence diagram view reference.
+     */
+    private SDView fView = null;
+
+    // ------------------------------------------------------------------------
+    // Constructors
+    // ------------------------------------------------------------------------
+    /**
+     * Default constructor
+     */
+    public BaseSDAction() {
+        this(null);
+    }
+
+    /**
+     * Constructor
+     *
+     * @param view
+     *          a sequence diagram view reference
+     */
+    public BaseSDAction(SDView view) {
+        super();
+        fView = view;
+    }
+
+    /**
+     * Constructor
+     * @param view
+     *          a sequence diagram view reference
+     * @param text
+     *          The action text
+     * @param style
+     *          The style
+     */
+    protected BaseSDAction(SDView view, String text, int style) {
+        super(text, style);
+        fView = view;
+    }
+
+    // ------------------------------------------------------------------------
+    // Operations
+    // ------------------------------------------------------------------------
+
+    /**
+     * Sets the active SD view.
+     *
+     * @param view The SD view.
+     */
+    public void setView(SDView view) {
+        fView = view;
+    }
+
+    /**
+     * Gets the active SD view.
+     *
+     * @return view The SD view.
+     * @since 2.0
+     */
+    public SDView getView() {
+        return fView;
+    }
+}
index ee0083339d7a386bcae3657eb70e70c510f2a3a7..a9e62c3af6d088e2a9251b2cbce3e0352aeb4487 100755 (executable)
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.MinMaxDialog;
-import org.eclipse.ui.IViewPart;
 
 /**
  * Action class implementation to configure minimum and maximum time range values.
@@ -24,40 +22,24 @@ import org.eclipse.ui.IViewPart;
  * @author sveyrier
  *
  */
-public class ConfigureMinMax extends Action {
+public class ConfigureMinMax extends BaseSDAction {
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
     /**
-     * The corresponding sequence diagram view reference.
+     * Constructor
+     * @param view
+     *          the sequence diagram view reference
+     * @since 2.0
      */
-    protected SDView fView = null;
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
-    /**
-     * Standard constructor.
-     *
-     * @param view The sequence diagram view for the action
-     */
-    public ConfigureMinMax(IViewPart view) {
-        super();
-        if (view instanceof SDView) {
-            fView = (SDView) view;
-        }
+    public ConfigureMinMax(SDView view) {
+        super(view);
     }
-
     // ------------------------------------------------------------------------
     // Methods
     // ------------------------------------------------------------------------
-
     @Override
     public void run() {
-        if ((fView != null) && (fView.getSDWidget() != null)) {
-            MinMaxDialog minMax = new MinMaxDialog(fView.getSite().getShell(), fView.getSDWidget());
+        if ((getView() != null) && (getView().getSDWidget() != null)) {
+            MinMaxDialog minMax = new MinMaxDialog(getView().getSite().getShell(), getView().getSDWidget());
             minMax.open();
         }
     }
index 3446c939da63568b9befe7dbd73cca13b2d76a20..dadf31b11fbf2954a9c26d305f3b2b9085841395 100644 (file)
@@ -11,9 +11,8 @@
  **********************************************************************/
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
 
@@ -23,7 +22,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
  * @version 1.0
  * @author Bernd Hufmann
  */
-public class FirstPage extends Action {
+public class FirstPage extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -34,15 +33,6 @@ public class FirstPage extends Action {
      */
     public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.firstpage"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -53,8 +43,7 @@ public class FirstPage extends Action {
      * @param view the view reference
      */
     public FirstPage(SDView view) {
-        super();
-        fView = view;
+        super(view);
         setText(Messages.SequenceDiagram_FirstPage);
         setToolTipText(Messages.SequenceDiagram_GoToFirstPage);
         setId(ID);
@@ -67,13 +56,13 @@ public class FirstPage extends Action {
 
     @Override
     public void run() {
-        if ((fView == null) || (fView.getSDWidget()) == null) {
+        if ((getView() == null) || (getView().getSDWidget()) == null) {
             return;
         }
-        if (fView.getSDPagingProvider() != null) {
-            fView.getSDPagingProvider().firstPage();
+        if (getView().getSDPagingProvider() != null) {
+            getView().getSDPagingProvider().firstPage();
         }
-        fView.updateCoolBar();
-        fView.getSDWidget().redraw();
+        getView().updateCoolBar();
+        getView().getSDWidget().redraw();
     }
 }
index 6cf8e7eeffa76856051c61314a320be0c17c9a0a..30f02c8fa3fc5bdf0e63d2561d4abc1bbb1643a5 100644 (file)
@@ -11,9 +11,8 @@
  **********************************************************************/
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
 
@@ -23,7 +22,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
  * @version 1.0
  * @author Bernd Hufmann
  */
-public class LastPage extends Action {
+public class LastPage extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -34,15 +33,6 @@ public class LastPage extends Action {
      */
     public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.lastpage"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -53,8 +43,7 @@ public class LastPage extends Action {
      * @param view the view reference
      */
     public LastPage(SDView view) {
-        super();
-        fView = view;
+        super(view);
         setText(Messages.SequenceDiagram_LastPage);
         setToolTipText(Messages.SequenceDiagram_GoToLastPage);
         setId(ID);
@@ -67,13 +56,13 @@ public class LastPage extends Action {
 
     @Override
     public void run() {
-        if ((fView == null) || (fView.getSDWidget()) == null) {
+        if ((getView() == null) || (getView().getSDWidget()) == null) {
             return;
         }
-        if (fView.getSDPagingProvider() != null) {
-            fView.getSDPagingProvider().lastPage();
+        if (getView().getSDPagingProvider() != null) {
+            getView().getSDPagingProvider().lastPage();
         }
-        fView.updateCoolBar();
-        fView.getSDWidget().redraw();
+        getView().updateCoolBar();
+        getView().getSDWidget().redraw();
     }
 }
index 04f859fcda6fb0f6b56aad45f81cd2c11e71b69e..d335244948c0748ee07d3718bb984340434326c9 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
 
@@ -23,7 +22,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
  * @author sveyrier
  *
  */
-public class MoveSDDown extends Action {
+public class MoveSDDown extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -33,14 +32,6 @@ public class MoveSDDown extends Action {
      */
     public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDDown"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference.
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -57,34 +48,23 @@ public class MoveSDDown extends Action {
      * @param view a sequence diagram view reference
      */
     public MoveSDDown(SDView view) {
-        super();
+        super(view);
         setId(ID);
         setActionDefinitionId(ID);
-        fView = view;
     }
 
     // ------------------------------------------------------------------------
     // Methods
     // ------------------------------------------------------------------------
-
     @Override
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
 
-        SDWidget viewer = fView.getSDWidget();
+        SDWidget viewer = getView().getSDWidget();
         if (viewer != null) {
             viewer.scrollBy(0, +viewer.getVisibleHeight());
         }
     }
-
-    /**
-     * Sets the active SD view.
-     *
-     * @param view The SD view.
-     */
-    public void setView(SDView view) {
-        fView = view;
-    }
 }
index 17fd8c15e11533feacb34b0f39c2288aa654c751..97b931ae4996e6650f49b893910c9b8712ce4f1f 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
 
@@ -23,7 +22,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
  * @author sveyrier
  *
  */
-public class MoveSDLeft extends Action {
+public class MoveSDLeft extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -33,14 +32,6 @@ public class MoveSDLeft extends Action {
      */
     public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDLeft"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference.
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -57,10 +48,9 @@ public class MoveSDLeft extends Action {
      * @param view a sequence diagram view reference
      */
     public MoveSDLeft(SDView view) {
-        super();
+        super(view);
         setId(ID);
         setActionDefinitionId(ID);
-        fView = view;
     }
 
    // ------------------------------------------------------------------------
@@ -70,22 +60,13 @@ public class MoveSDLeft extends Action {
     @Override
     public void run() {
 
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
 
-        SDWidget viewer = fView.getSDWidget();
+        SDWidget viewer = getView().getSDWidget();
         if (viewer != null) {
             viewer.scrollBy(-viewer.getVisibleWidth(), 0);
         }
     }
-
-    /**
-     * Sets the active SD view.
-     *
-     * @param view The SD view.
-     */
-   public void setView(SDView view) {
-        fView = view;
-    }
 }
index 4570a4e7f091077eb465d9cc3d0e817ab3093be8..ba15fe0f92dc4141f237d02fdcc81cbbc85dc8fc 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
 
@@ -24,7 +23,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
  *
  */
 
-public class MoveSDRight extends Action {
+public class MoveSDRight extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -34,14 +33,6 @@ public class MoveSDRight extends Action {
      */
      public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDRight"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-      * The sequence diagram view reference.
-      */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -58,10 +49,9 @@ public class MoveSDRight extends Action {
      * @param view a sequence diagram view reference
      */
     public MoveSDRight(SDView view) {
-        super();
+        super(view);
         setId(ID);
         setActionDefinitionId(ID);
-        fView = view;
     }
 
     // ------------------------------------------------------------------------
@@ -71,22 +61,13 @@ public class MoveSDRight extends Action {
     @Override
     public void run() {
 
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
 
-        SDWidget viewer = fView.getSDWidget();
+        SDWidget viewer = getView().getSDWidget();
         if (viewer != null) {
             viewer.scrollBy(+viewer.getVisibleWidth(), 0);
         }
     }
-
-    /**
-     * Sets the active SD view.
-     *
-     * @param view The SD view.
-     */
-   public void setView(SDView view) {
-        fView = view;
-    }
 }
index d0fa8482ebfb6ec9a9003f4a30abc2b7638df30a..f1eefc26af29e779b71e0879e7d3b3fb4ad3e8e2 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
 
@@ -23,7 +22,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
  * @version 1.0
  * @author sveyrier
  */
-public class MoveSDUp extends Action {
+public class MoveSDUp extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -33,14 +32,6 @@ public class MoveSDUp extends Action {
      */
     public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDUp"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference.
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -57,10 +48,9 @@ public class MoveSDUp extends Action {
      * @param view a sequence diagram view reference
      */
     public MoveSDUp(SDView view) {
-        super();
+        super(view);
         setId(ID);
         setActionDefinitionId(ID);
-        fView = view;
     }
 
     // ------------------------------------------------------------------------
@@ -69,21 +59,13 @@ public class MoveSDUp extends Action {
 
     @Override
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
-        SDWidget viewer = fView.getSDWidget();
+        SDWidget viewer = getView().getSDWidget();
 
         if (viewer != null) {
             viewer.scrollBy(0, -viewer.getVisibleHeight());
         }
     }
-
-    /**
-     * Sets the active SD view.
-     * @param view The SD view.
-     */
-    public void setView(SDView view) {
-        fView = view;
-    }
 }
index 3741071fc79dd61dfe905c2b561de6fd671029cd..8cd687dbe4f73a36405b8ca14986d90fb90709e8 100755 (executable)
@@ -14,12 +14,11 @@ package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
 import java.util.Iterator;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BaseMessage;
@@ -34,7 +33,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.SyncMessageReturn;
  * @author sveyrier
  *
  */
-public class MoveToMessage extends Action {
+public class MoveToMessage extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -44,14 +43,6 @@ public class MoveToMessage extends Action {
      */
     public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.GoToMessage"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference.
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -68,11 +59,10 @@ public class MoveToMessage extends Action {
      * @param view a sequence diagram view reference
      */
     public MoveToMessage(SDView view) {
-        super();
+        super(view);
         setId(ID);
         setActionDefinitionId(ID);
         setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_MATCH));
-        fView = view;
     }
 
     // ------------------------------------------------------------------------
@@ -81,11 +71,11 @@ public class MoveToMessage extends Action {
 
     @Override
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
 
-        SDWidget sdWidget = fView.getSDWidget();
+        SDWidget sdWidget = getView().getSDWidget();
 
         if (sdWidget == null) {
             return;
@@ -111,24 +101,13 @@ public class MoveToMessage extends Action {
             sdWidget.clearSelection();
             sdWidget.addSelection(node);
             sdWidget.ensureVisible(node);
-            // sdWidget.setFocusNode(node);
             sdWidget.redraw();
         } else if (selectedNode instanceof SyncMessage) {
             GraphNode node = ((SyncMessage) selectedNode).getMessageReturn();
             sdWidget.clearSelection();
             sdWidget.addSelection(node);
             sdWidget.ensureVisible(node);
-            // sdWidget.setFocusNode(node);
             sdWidget.redraw();
         }
     }
-
-    /**
-     * Sets the active SD view.
-     *
-     * @param view The SD view.
-     */
-    public void setView(SDView view) {
-        fView = view;
-    }
 }
index 04aec1d10e4b7444438dc80b66dcf82f87e24c67..3e533f0c3c988512658b9e4f9267bc10125db616 100755 (executable)
@@ -12,9 +12,8 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
 
@@ -25,7 +24,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
  * @author sveyrier
  *
  */
-public class NextPage extends Action {
+public class NextPage extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -35,14 +34,6 @@ public class NextPage extends Action {
      */
     public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.nextpage"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference.
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -52,8 +43,7 @@ public class NextPage extends Action {
      * @param view the view reference
      */
     public NextPage(SDView view) {
-        super();
-        fView = view;
+        super(view);
         setText(Messages.SequenceDiagram_NextPage);
         setToolTipText(Messages.SequenceDiagram_GoToNextPage);
         setId(ID);
@@ -66,13 +56,13 @@ public class NextPage extends Action {
 
      @Override
     public void run() {
-        if ((fView == null) || (fView.getSDWidget()) == null) {
+        if ((getView() == null) || (getView().getSDWidget()) == null) {
             return;
         }
-        if (fView.getSDPagingProvider() != null) {
-            fView.getSDPagingProvider().nextPage();
+        if (getView().getSDPagingProvider() != null) {
+            getView().getSDPagingProvider().nextPage();
         }
-        fView.updateCoolBar();
-        fView.getSDWidget().redraw();
+        getView().updateCoolBar();
+        getView().getSDWidget().redraw();
     }
 }
index ce6f93f1a2acf67cddbd902926c4fe3f04a72425..27fd1f25b468739bab3c0a9dc0e1b489a9f067b5 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
 import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
@@ -26,7 +25,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
  * @version 1.0
  * @author sveyrier
  */
-public class OpenSDFiltersDialog extends Action {
+public class OpenSDFiltersDialog extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -36,18 +35,10 @@ public class OpenSDFiltersDialog extends Action {
      */
     public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFilters"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView;
-
     /**
      * The filter provider reference
      */
-    protected ISDFilterProvider fProvider;
+    private final ISDFilterProvider fProvider;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -61,11 +52,11 @@ public class OpenSDFiltersDialog extends Action {
      *            The provider
      */
     public OpenSDFiltersDialog(SDView view, ISDFilterProvider provider) {
-        super(Messages.SequenceDiagram_HidePatterns);
+        super(view);
+        setText(Messages.SequenceDiagram_HidePatterns);
         setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_FILTERS));
         setId(ID);
         setToolTipText(Messages.SequenceDiagram_HidePatterns);
-        fView = view;
         fProvider = provider;
     }
 
@@ -75,10 +66,10 @@ public class OpenSDFiltersDialog extends Action {
 
     @Override
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
-        FilterListDialog dialog = new FilterListDialog(fView, fProvider);
+        FilterListDialog dialog = new FilterListDialog(getView(), fProvider);
         dialog.open();
     }
 }
index 0b1d44d58565a84ae833e6e0db8b6259cd55152d..38d0cb52fcd7f83f2941c3b6845cd41aef3015d9 100755 (executable)
@@ -12,9 +12,8 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.dialogs.SearchFilterDialog;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
@@ -27,7 +26,7 @@ import org.eclipse.swt.SWT;
  * @author sveyrier
  *
  */
-public class OpenSDFindDialog extends Action {
+public class OpenSDFindDialog extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -36,19 +35,12 @@ public class OpenSDFindDialog extends Action {
      * The action ID.
      */
     public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFind"; //$NON-NLS-1$
+
     /**
      * The action definition ID.
      */
     public final static String ACTION_DEFINITION_ID = "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -65,12 +57,12 @@ public class OpenSDFindDialog extends Action {
      * @param view The view reference
      */
     public OpenSDFindDialog(SDView view) {
-        super(Messages.SequenceDiagram_Find + "..."); //$NON-NLS-1$
+        super(view);
+        setText(Messages.SequenceDiagram_Find + "..."); //$NON-NLS-1$
         setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_SEARCH_SEQ));
         setId(ID);
         setActionDefinitionId(ACTION_DEFINITION_ID);
         setToolTipText(Messages.SequenceDiagram_Find + "..."); //$NON-NLS-1$
-        fView = view;
     }
 
     // ------------------------------------------------------------------------
@@ -79,7 +71,7 @@ public class OpenSDFindDialog extends Action {
 
     @Override
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
 
@@ -87,10 +79,10 @@ public class OpenSDFindDialog extends Action {
         this.setEnabled(false);
 
         try {
-            if ((fView.getExtendedFindProvider() != null) && (fView.getExtendedFindProvider().getFindAction() != null)) {
-                fView.getExtendedFindProvider().getFindAction().run();
-            } else if (fView.getSDFindProvider() != null) {
-                SearchFilterDialog dialog = new SearchFilterDialog(fView, fView.getSDFindProvider(), false, SWT.NORMAL);
+            if ((getView().getExtendedFindProvider() != null) && (getView().getExtendedFindProvider().getFindAction() != null)) {
+                getView().getExtendedFindProvider().getFindAction().run();
+            } else if (getView().getSDFindProvider() != null) {
+                SearchFilterDialog dialog = new SearchFilterDialog(getView(), getView().getSDFindProvider(), false, SWT.NORMAL);
                 dialog.open();
             }
         } finally {
@@ -98,13 +90,4 @@ public class OpenSDFindDialog extends Action {
             this.setEnabled(true);
         }
     }
-
-    /**
-     * Sets the active SD view.
-     *
-     * @param view The SD view.
-     */
-   public void setView(SDView view) {
-        fView = view;
-    }
 }
index 0d68d35d22ce9ffb0dc5daad2d5c8d33d3bbc14e..160a73aad7ab6c707c0c211084285e9d15997479 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
 import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
@@ -26,7 +25,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
  * @version 1.0
  * @author Bernd Hufmann
  */
-public class OpenSDPagesDialog extends Action {
+public class OpenSDPagesDialog extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -41,14 +40,10 @@ public class OpenSDPagesDialog extends Action {
     // Attributes
     // ------------------------------------------------------------------------
 
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView;
     /**
      * The advanced paging provider reference.
      */
-    protected ISDAdvancedPagingProvider fProvider;
+    private final ISDAdvancedPagingProvider fProvider;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -63,10 +58,10 @@ public class OpenSDPagesDialog extends Action {
      *            The provider
      */
     public OpenSDPagesDialog(SDView view, ISDAdvancedPagingProvider provider) {
-        super(Messages.SequenceDiagram_Pages);
+        super(view);
+        setText(Messages.SequenceDiagram_Pages);
         setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_GOTO_PAGE));
         setId(ID);
-        fView = view;
         fProvider = provider;
     }
 
@@ -76,10 +71,10 @@ public class OpenSDPagesDialog extends Action {
 
     @Override
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
-        PagesDialog dialog = new PagesDialog(fView, fProvider);
+        PagesDialog dialog = new PagesDialog(getView(), fProvider);
         dialog.open();
     }
 }
index ae292fbb59796edd3cb1f74f3f56cb76f1ed5137..6558ca1484985b18dc968a52561faa5afeefee6c 100755 (executable)
@@ -12,9 +12,8 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
 
@@ -25,7 +24,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
  * @author sveyrier
  *
  */
-public class PrevPage extends Action {
+public class PrevPage extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -36,15 +35,6 @@ public class PrevPage extends Action {
      */
     public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.prevpage"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    /**
-     * The sequence diagram view reference.
-     */
-    protected SDView fView = null;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -55,8 +45,7 @@ public class PrevPage extends Action {
      * @param view the view reference
      */
     public PrevPage(SDView view) {
-        super();
-        fView = view;
+        super(view);
         setText(Messages.SequenceDiagram_PreviousPage);
         setToolTipText(Messages.SequenceDiagram_GoToPreviousPage);
         setId(ID);
@@ -69,13 +58,13 @@ public class PrevPage extends Action {
 
     @Override
     public void run() {
-        if ((fView == null) || (fView.getSDWidget()) == null) {
+        if ((getView() == null) || (getView().getSDWidget()) == null) {
             return;
         }
-        if (fView.getSDPagingProvider() != null) {
-            fView.getSDPagingProvider().prevPage();
+        if (getView().getSDPagingProvider() != null) {
+            getView().getSDPagingProvider().prevPage();
         }
-        fView.updateCoolBar();
-        fView.getSDWidget().redraw();
+        getView().updateCoolBar();
+        getView().getSDWidget().redraw();
     }
 }
index 2b504b00803586884f47e032943cb647fcb631f8..9d638e90cb82d3b0518c186c2164d0d5c7c5f9e2 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 
 /**
@@ -21,7 +20,7 @@ import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
  * @version 1.0
  * @author sveyrier
  */
-public class Print extends Action {
+public class Print extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -32,15 +31,6 @@ public class Print extends Action {
      */
     public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.print"; //$NON-NLS-1$
 
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    /**
-     * The sequence diagram view reference
-     */
-    private SDView fView;
-
     // ------------------------------------------------------------------------
     // Constructors
     // ------------------------------------------------------------------------
@@ -51,9 +41,8 @@ public class Print extends Action {
      * @param view The view reference
      */
     public Print(SDView view) {
-        super();
+        super(view);
         setId(ID);
-        fView = view;
     }
 
     // ------------------------------------------------------------------------
@@ -62,10 +51,10 @@ public class Print extends Action {
 
     @Override
     public void run() {
-        if ((fView == null) || fView.getSDWidget() == null){
+        if ((getView() == null) || getView().getSDWidget() == null){
             return;
         }
 
-        fView.getSDWidget().print();
+        getView().getSDWidget().print();
     }
 }
index 614e885812ecf16a6670eb76a5bbebdc5de25146..614a16ab37865b8cca29ae75eb3b8edce9e15947 100755 (executable)
@@ -14,16 +14,14 @@ package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
 import java.util.Iterator;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode;
-import org.eclipse.ui.IViewPart;
 
 /**
  * Action class implementation to show end of a graph node.
@@ -31,15 +29,7 @@ import org.eclipse.ui.IViewPart;
  * @version 1.0
  * @author sveyrier
  */
-public class ShowNodeEnd extends Action {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView = null;
+public class ShowNodeEnd extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -55,12 +45,10 @@ public class ShowNodeEnd extends Action {
      * Constructor
      *
      * @param view The sequence diagram view reference
+     * @since 2.0
      */
-    public ShowNodeEnd(IViewPart view) {
-        super();
-        if (view instanceof SDView) {
-            fView = (SDView)view;
-        }
+    public ShowNodeEnd(SDView view) {
+        super(view);
         setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NODE_END));
     }
 
@@ -71,11 +59,11 @@ public class ShowNodeEnd extends Action {
     @Override
     @SuppressWarnings("rawtypes")
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
 
-        SDWidget sdWidget = fView.getSDWidget();
+        SDWidget sdWidget = getView().getSDWidget();
 
         if (sdWidget == null) {
             return;
@@ -99,13 +87,4 @@ public class ShowNodeEnd extends Action {
             }
         }
     }
-
-    /**
-     * Sets the active SD view.
-     *
-     * @param view The SD view.
-     */
-   public void setView(SDView view) {
-        fView = view;
-    }
 }
index 93ffafcd53e6d8ab551c24dd445142d3d77035bc..f199c408fcf274f1f65713237d0f70a0f3733f0f 100755 (executable)
@@ -14,16 +14,14 @@ package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
 import java.util.Iterator;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.internal.tmf.ui.Activator;
+import org.eclipse.linuxtools.internal.tmf.ui.ITmfImageConstants;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDView;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget;
 import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.GraphNode;
-import org.eclipse.ui.IViewPart;
 
 /**
  * Action class implementation to show end of a graph node.
@@ -31,16 +29,7 @@ import org.eclipse.ui.IViewPart;
  * @version 1.0
  * @author sveyrier
  */
-public class ShowNodeStart extends Action {
-
-    // ------------------------------------------------------------------------
-    // Attributes
-    // ------------------------------------------------------------------------
-
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView = null;
+public class ShowNodeStart extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -58,12 +47,10 @@ public class ShowNodeStart extends Action {
      *
      * @param view
      *            The sequence diagram view reference
+     * @since 2.0
      */
-    public ShowNodeStart(IViewPart view) {
-        super();
-        if (view instanceof SDView) {
-            fView = (SDView) view;
-        }
+    public ShowNodeStart(SDView view) {
+        super(view);
         setImageDescriptor(Activator.getDefault().getImageDescripterFromPath(ITmfImageConstants.IMG_UI_NODE_START));
     }
 
@@ -74,11 +61,11 @@ public class ShowNodeStart extends Action {
     @Override
     @SuppressWarnings("rawtypes")
     public void run() {
-        if (fView == null) {
+        if (getView() == null) {
             return;
         }
 
-        SDWidget sdWidget = fView.getSDWidget();
+        SDWidget sdWidget = getView().getSDWidget();
 
         if (sdWidget == null) {
             return;
@@ -100,14 +87,4 @@ public class ShowNodeStart extends Action {
             }
         }
     }
-
-    /**
-     * Sets the active SD view.
-     *
-     * @param view
-     *            The SD view.
-     */
-    public void setView(SDView view) {
-        fView = view;
-    }
 }
index 5cfc87ab064c99af3c0cfc9fb0a8cfd54b6fcfac..f51a5e0db3d2dd179d433f9601813d3b7494f42d 100755 (executable)
@@ -12,7 +12,6 @@
 
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers;
 
-import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.ActionContributionItem;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.IContributionItem;
@@ -34,7 +33,7 @@ import org.eclipse.ui.IActionBars;
  * @author sveyrier
  *
  */
-public class Zoom extends Action {
+public class Zoom extends BaseSDAction {
 
     // ------------------------------------------------------------------------
     // Constants
@@ -59,22 +58,14 @@ public class Zoom extends Action {
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
-    /**
-     * The sequence diagram view reference
-     */
-    protected SDView fView = null;
     /**
      * Flag to indicate last zoom in.
      */
-    protected boolean fLastZoomIn = false;
+    private boolean fLastZoomIn = false;
     /**
      * Flag to indicate last zoom out.
      */
-    protected boolean fLastZoomOut = false;
-    /**
-     * Flag to indicate last zoom.
-     */
-    protected boolean fLastZoom = true;
+    private boolean fLastZoomOut = false;
     /**
      * The cursor used when zooming in.
      */
@@ -108,9 +99,7 @@ public class Zoom extends Action {
      * @param type The type of zoom.
      */
     public Zoom(SDView view, ZoomType type) {
-        super("", AS_RADIO_BUTTON);//$NON-NLS-1$
-
-        fView = view;
+        super(view, "", AS_RADIO_BUTTON); //$NON-NLS-1$
 
         // Pre-create zooming cursors
         fZoomInCursor = new Cursor(Display.getCurrent(),
@@ -160,11 +149,11 @@ public class Zoom extends Action {
     @Override
     public void run() {
 
-        if ((fView == null) || (fView.getSDWidget() == null)) {
+        if ((getView() == null) || (getView().getSDWidget() == null)) {
             return;
         }
 
-        SDWidget viewer = fView.getSDWidget();
+        SDWidget viewer = getView().getSDWidget();
 
         if (getId().equals(ZOOM_OUT_ID)) {
             // Eclipse 3.0 M7 workaround
@@ -174,7 +163,6 @@ public class Zoom extends Action {
 
             viewer.setZoomOutMode(isChecked());
             fLastZoomOut = isChecked();
-            fLastZoom = false;
             if (isChecked()) {
                 viewer.setCursor(fZoomOutCursor);
                 setActionChecked(NO_ZOOM_ID, false);
@@ -190,7 +178,6 @@ public class Zoom extends Action {
 
             viewer.setZoomInMode(isChecked());
             fLastZoomIn = isChecked();
-            fLastZoom = false;
             if (isChecked()) {
                 viewer.setCursor(fZoomInCursor);
                 setActionChecked(NO_ZOOM_ID, false);
@@ -204,7 +191,6 @@ public class Zoom extends Action {
             // The reset action is a radio button only to uncheck the zoom in and out button
             // when it is clicked. This avoid adding code to do it manually
             // We only have to force it to false every time
-            fLastZoom = false;
             setChecked(false);
             setActionChecked(NO_ZOOM_ID, true);
         } else if (getId().equals(NO_ZOOM_ID)) {
@@ -222,8 +208,8 @@ public class Zoom extends Action {
      * @param checked true to check the action, false to uncheck the action
      */
     protected void setActionChecked(String id, boolean checked) {
-        if (fView != null) {
-            IActionBars bar = fView.getViewSite().getActionBars();
+        if (getView() != null) {
+            IActionBars bar = getView().getViewSite().getActionBars();
             if (bar == null) {
                 return;
             }
index ea7d60d8a9e46cfab0db95cd59e97b2d4cab9191..713206db409c585194235ece52ec986780b3eb58 100644 (file)
@@ -64,11 +64,11 @@ public class LoadersManager {
     /**
      * Map for caching information (view ID to loader class)
      */
-    protected Map<String, IUml2SDLoader> fViewLoaderMap = new HashMap<String, IUml2SDLoader>();
+    private Map<String, IUml2SDLoader> fViewLoaderMap = new HashMap<String, IUml2SDLoader>();
     /**
      * Map for caching information (view ID to list of configuration elements)
      */
-    protected Map<String, ArrayList<IConfigurationElement>> fViewLoadersList = new HashMap<String, ArrayList<IConfigurationElement>>();
+    private Map<String, ArrayList<IConfigurationElement>> fViewLoadersList = new HashMap<String, ArrayList<IConfigurationElement>>();
 
     // ------------------------------------------------------------------------
     // Constructor
index d358b38f65b4960ccad2084b3c5cbb196081e10b..d9c9e50db492a451e8518cb13847933274997895 100644 (file)
@@ -32,7 +32,7 @@ public class TmfAsyncMessage extends AsyncMessage implements ITmfAsyncSequenceDi
     /**
      * A asynchronous sequence diagram event implementation
      */
-    protected ITmfAsyncSequenceDiagramEvent fSdEvent;
+    private ITmfAsyncSequenceDiagramEvent fSdEvent;
 
     // ------------------------------------------------------------------------
     // Constructors
index bc07d3b41af1cac7fbe966e71e6acdf233027a4f..890901b3b3ee64b5f5cb9d08c802f7336d680c73 100644 (file)
@@ -33,7 +33,7 @@ public class TmfSyncMessage extends SyncMessage implements ITmfSyncSequenceDiagr
     /**
      * A synchronous sequence diagram event implementation
      */
-    protected ITmfSyncSequenceDiagramEvent fSdEvent;
+    private ITmfSyncSequenceDiagramEvent fSdEvent;
 
     // ------------------------------------------------------------------------
     // Constructors
index 2cf40b9c7a936730c4c84fdf19ca80e8c394ec74..f1007e6edb2d00e776ceb87eacb3845ef01fb4e1 100755 (executable)
@@ -13,6 +13,7 @@
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd.preferences;
 
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Hashtable;
 import java.util.Map;
 
@@ -78,8 +79,9 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
     private static final String[] PREF_TEXT_COLOR_LIST = { PREF_LIFELINE, PREF_SYNC_MESS, PREF_SYNC_MESS_RET, PREF_ASYNC_MESS, PREF_ASYNC_MESS_RET, PREF_LIFELINE_HEADER, PREF_FRAME_NAME };
     /**
      * Temporary tag
+     * @since 2.0
      */
-    protected static final String TEMP_TAG = "_TEMP";//$NON-NLS-1$
+    public static final String TEMP_TAG = "_TEMP";//$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -92,31 +94,32 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
     /**
      * Hashtable for font preferences
      */
-    protected Map<String, IFont> fFontPref;
+    private Map<String, IFont> fFontPref;
+
     /**
      * Hashtable for foreground color preferences
      */
-    protected Map<String, IColor> fForeColorPref;
+    private Map<String, IColor> fForeColorPref;
     /**
      * Hashtable for background color preferences
      */
-    protected Map<String, IColor> fBackColorPref;
+    private Map<String, IColor> fBackColorPref;
     /**
      * Hashtable for text color preferences
      */
-    protected Map<String, IColor> fTextColorPref;
+    private Map<String, IColor> fTextColorPref;
     /**
      * The reference to the preference store.
      */
-    protected IPreferenceStore fPrefStore = null;
+    private IPreferenceStore fPrefStore = null;
     /**
      * Color for the time compression selection
      */
-    protected IColor fTimeCompressionSelectionColor = null;
+    private IColor fTimeCompressionSelectionColor = null;
     /**
      * Flag whether no focus selection or not.
      */
-    protected boolean fNoFocusSelection = false;
+    private boolean fNoFocusSelection = false;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -417,6 +420,66 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
         fNoFocusSelection = v;
     }
 
+    /**
+     * Returns a unmodifiable map with font preferences.
+     *
+     * @return map with font preferences
+     * @since 2.0
+     */
+    protected Map<String, IFont> getFontPref() {
+        return Collections.unmodifiableMap(fFontPref);
+    }
+
+    /**
+     * Returns a unmodifiable map with foreground color preferences
+     *
+     * @return map with foreground color preferences
+     * @since 2.0
+     */
+    public Map<String, IColor> getForeColorPref() {
+        return Collections.unmodifiableMap(fForeColorPref);
+    }
+
+    /**
+     * Returns a unmodifiable map with background color preferences
+     *
+     * @return map with background color preferences
+     * @since 2.0
+     */
+    public Map<String, IColor> getBackColorPref() {
+        return Collections.unmodifiableMap(fBackColorPref);
+    }
+
+    /**
+     * Returns a unmodifiable map with text color preferences
+     *
+     * @return map with text color preferences
+     * @since 2.0
+     */
+    public Map<String, IColor> getTextColorPref() {
+        return Collections.unmodifiableMap(fTextColorPref);
+    }
+
+    /**
+     * Returns the preference store.
+     *
+     * @return the preference store
+     * @since 2.0
+     */
+    public IPreferenceStore getPrefStore() {
+        return fPrefStore;
+    }
+
+    /**
+     * Returns flag about focus selection
+     *
+     * @return flag about focus selection
+     * @since 2.0
+     */
+    public boolean isNoFocusSelection() {
+        return fNoFocusSelection;
+    }
+
     /**
      * Returns the static font list.
      *
index 30c59d4ebe90340df2082f247aceb54660c47623..a71446728202ce421ab647019266636aa318adb6 100755 (executable)
@@ -48,7 +48,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
     /**
      * Temporary preferences tag
      */
-    protected static final String TEMP_TAG = SDViewPref.TEMP_TAG;
+    private static final String TEMP_TAG = SDViewPref.TEMP_TAG;
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -56,51 +56,51 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
     /**
      * The preference handler used to access the PreferenceStore
      */
-    protected SDViewPref fPreferences = null;
+    private SDViewPref fPreferences = null;
     /**
      * BackGround color selector
      */
-    protected ColorFieldEditor fLineColor = null;
+    private ColorFieldEditor fLineColor = null;
     /**
      * Foreground color selector
      */
-    protected ColorFieldEditor fBackGroundColor = null;
+    private ColorFieldEditor fBackGroundColor = null;
     /**
      * Font color selector
      */
-    protected ColorFieldEditor fTextColor = null;
+    private ColorFieldEditor fTextColor = null;
     /**
      * List which display all modifiable sequence Diagram font
      */
-    protected List fClassItemList = null;
+    private List fClassItemList = null;
     /**
      * Font selector (The same is used for each modifiable font)
      */
-    protected FontFieldEditor fFont = null;
+    private FontFieldEditor fFont = null;
     /**
      * Link font when zooming selector
      */
-    protected BooleanFieldEditor fLink = null;
+    private BooleanFieldEditor fLink = null;
     /**
      * Enable tooltip selector
      */
-    protected BooleanFieldEditor fTooltip = null;
+    private BooleanFieldEditor fTooltip = null;
     /**
      * Do not take external time into account in the min max computation
      */
-    protected BooleanFieldEditor fNoExternalTime = null;
+    private BooleanFieldEditor fNoExternalTime = null;
     /**
      * Use gradient color selector
      */
-    protected BooleanFieldEditor fUseGrad = null;
+    private BooleanFieldEditor fUseGrad = null;
     /**
      * A button area.
      */
-    protected Composite fButtonArea;
+    private Composite fButtonArea;
     /**
      * SwimLane width selector
      */
-    protected IntegerFieldEditor fLifelineWidth = null;
+    private IntegerFieldEditor fLifelineWidth = null;
 
     // ------------------------------------------------------------------------
     // Methods
@@ -241,7 +241,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
         // and all the fonts and colors
         // fonts and colors are stored for each time because
         // we are using only one FontFieldEditor
-        Set<String> keySet = SDViewPref.getInstance().fFontPref.keySet();
+        Set<String> keySet = SDViewPref.getInstance().getFontPref().keySet();
         Iterator<String> it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
@@ -253,7 +253,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
             }
         }
 
-        keySet = SDViewPref.getInstance().fBackColorPref.keySet();
+        keySet = SDViewPref.getInstance().getBackColorPref().keySet();
         it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
@@ -270,7 +270,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
         fBackGroundColor.setPreferenceName(fontList[fClassItemList.getSelectionIndex()] + SDViewPref.BACK_COLOR_POSTFIX + TEMP_TAG);
         fBackGroundColor.load();
 
-        keySet = SDViewPref.getInstance().fForeColorPref.keySet();
+        keySet = SDViewPref.getInstance().getForeColorPref().keySet();
         it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
@@ -285,7 +285,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
         fLineColor.setPreferenceName(fontList[fClassItemList.getSelectionIndex()] + SDViewPref.FORE_COLOR_POSTFIX + TEMP_TAG);
         fLineColor.load();
 
-        keySet = SDViewPref.getInstance().fTextColorPref.keySet();
+        keySet = SDViewPref.getInstance().getTextColorPref().keySet();
         it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
@@ -358,7 +358,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
             TAG1 = TEMP_TAG;
             TAG2 = "";//$NON-NLS-1$
         }
-        Set<String> keySet = SDViewPref.getInstance().fFontPref.keySet();
+        Set<String> keySet = SDViewPref.getInstance().getFontPref().keySet();
         Iterator<String> it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
@@ -370,7 +370,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
             }
         }
 
-        keySet = SDViewPref.getInstance().fBackColorPref.keySet();
+        keySet = SDViewPref.getInstance().getBackColorPref().keySet();
         it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
@@ -382,7 +382,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
             }
         }
 
-        keySet = SDViewPref.getInstance().fForeColorPref.keySet();
+        keySet = SDViewPref.getInstance().getForeColorPref().keySet();
         it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
@@ -394,7 +394,7 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
             }
         }
 
-        keySet = SDViewPref.getInstance().fTextColorPref.keySet();
+        keySet = SDViewPref.getInstance().getTextColorPref().keySet();
         it = keySet.iterator();
         while (it.hasNext()) {
             Object prefName = it.next();
This page took 0.138826 seconds and 5 git commands to generate.