tmf: API clean-up of sequence diagram framework
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / uml2sd / DrawableToolTip.java
index 5deaee658a503c8a74ed52dc9e49bca1c0b5c738..5e63247b263fa20afb20b16c9a593af570e58816 100755 (executable)
@@ -1,21 +1,20 @@
 /**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 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
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
+ *     IBM - Initial API and implementation
+ *     Bernd Hufmann - Updated for TMF
  **********************************************************************/
+
 package org.eclipse.linuxtools.tmf.ui.views.uml2sd;
 
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.SDMessages;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.ui.views.uml2sd.util.Messages;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
@@ -46,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.
      */
@@ -78,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
@@ -213,6 +212,7 @@ public class DrawableToolTip implements PaintListener {
      * @param value the current in the scale
      * @param min the scale min
      * @param max the scale max
+     * @since 2.0
      */
     public void showToolTip(ITmfTimestamp value, ITmfTimestamp min, ITmfTimestamp max) {
         fMinMaxRange = new TmfTimeRange(min, max);
@@ -241,13 +241,9 @@ public class DrawableToolTip implements PaintListener {
         }
     }
 
-    /*
-     * (non-Javadoc)
-     * @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt.events.PaintEvent)
-     */
     @Override
     public void paintControl(PaintEvent event) {
-        fMessage = SDMessages._138 + " " +  fCurrentValue.toString(); //$NON-NLS-1$
+        fMessage = Messages.SequenceDiagram_Delta + " " +  fCurrentValue.toString(); //$NON-NLS-1$
         Point size = event.gc.textExtent(fMessage);
         if (size.x < fScaleLength) {
             size.x = fScaleLength;
@@ -286,11 +282,11 @@ public class DrawableToolTip implements PaintListener {
                 event.gc.fillRectangle(fHorMargin + i * step, fVertMargin + fTextScaleMargin + size.y - 5, step, 11);
             }
             if (i == 0) {
-                event.gc.drawText(SDMessages._56, fHorMargin, size.y + 2 * fVertMargin + fTextScaleMargin, true);
+                event.gc.drawText(Messages.SequenceDiagram_Min, fHorMargin, size.y + 2 * fVertMargin + fTextScaleMargin, true);
             }
             if (i == 0) {
-                int len = event.gc.textExtent(SDMessages._55).x;
-                event.gc.drawText(SDMessages._55, fHorMargin + fScaleLength - len + 1, size.y + 2 * fVertMargin + fTextScaleMargin, true);
+                int len = event.gc.textExtent(Messages.SequenceDiagram_Max).x;
+                event.gc.drawText(Messages.SequenceDiagram_Max, fHorMargin + fScaleLength - len + 1, size.y + 2 * fVertMargin + fTextScaleMargin, true);
             }
             int lineWidth = 10;
             if ((i == 0) || (i == 10)) {
This page took 0.027534 seconds and 5 git commands to generate.