Remove tmf.ui magic numbers
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 14 Nov 2014 20:58:10 +0000 (15:58 -0500)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 19 Nov 2014 14:54:08 +0000 (09:54 -0500)
Change-Id: Ia9499f01e3c184b878b19bdfdabb3a265b2a261b
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/36525
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/core/BaseMessage.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/dialogs/SDPrintDialogUI.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/drawings/impl/ColorImpl.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/preferences/SDViewPref.java
org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/widgets/TimeGraphScale.java

index 532cb51e90b0f768c3716f0b059458b7ffe0dc7e..84bb010b2605c133a82aee71b72bcaa121098651 100755 (executable)
@@ -32,6 +32,10 @@ import org.eclipse.tracecompass.tmf.ui.views.uml2sd.preferences.SDViewPref;
  */
 public abstract class BaseMessage extends GraphNode {
 
+    private static final int ARROW_LENGTH = 7;
+    private static final double ARROW_ANGLE = 0.75;
+    private static final Double ARROW_HEAD_Y = Double.valueOf(Math.sin(ARROW_ANGLE) * ARROW_LENGTH);
+    private static final Double ARROW_HEAD_X = Double.valueOf(Math.cos(ARROW_ANGLE) * ARROW_LENGTH);
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
@@ -438,8 +442,8 @@ public abstract class BaseMessage extends GraphNode {
             // Draw the message main line
             context.drawLine(x, y, x + width, y + height);
             // Draw the two little lines which make a arrow part of the message
-            Double xt = Double.valueOf(Math.cos(0.75) * 7);
-            Double yt = Double.valueOf(Math.sin(0.75) * 7);
+            Double xt = ARROW_HEAD_X;
+            Double yt = ARROW_HEAD_Y;
             if (context.getLineStyle() == context.getLineSolidStyle()) {
                 IColor backcolor = context.getBackground();
                 context.setBackground(context.getForeground());
@@ -494,8 +498,8 @@ public abstract class BaseMessage extends GraphNode {
             // Part 5
             context.drawLine(x, y + height + Metrics.SYNC_INTERNAL_MESSAGE_HEIGHT, x + Metrics.INTERNAL_MESSAGE_WIDTH / 2, y + height + Metrics.SYNC_INTERNAL_MESSAGE_HEIGHT);
 
-            Double xt = Double.valueOf(Math.cos(0.75) * 7);
-            Double yt = Double.valueOf(Math.sin(0.75) * 7);
+            Double xt = ARROW_HEAD_X;
+            Double yt = ARROW_HEAD_Y;
 
             fX = x;
             fY = y;
@@ -556,10 +560,10 @@ public abstract class BaseMessage extends GraphNode {
             if (spaceBTWStartEnd < 0) {
                 sign = -1;
             }
-            Double x1 = Double.valueOf(sign * Math.cos(angle - 0.75) * 7);
-            Double y1 = Double.valueOf(sign * Math.sin(angle - 0.75) * 7);
-            Double x2 = Double.valueOf(sign * Math.cos(angle + 0.75) * 7);
-            Double y2 = Double.valueOf(sign * Math.sin(angle + 0.75) * 7);
+            Double x1 = Double.valueOf(sign * Math.cos(angle - ARROW_ANGLE) * ARROW_LENGTH);
+            Double y1 = Double.valueOf(sign * Math.sin(angle - ARROW_ANGLE) * ARROW_LENGTH);
+            Double x2 = Double.valueOf(sign * Math.cos(angle + ARROW_ANGLE) * ARROW_LENGTH);
+            Double y2 = Double.valueOf(sign * Math.sin(angle + ARROW_ANGLE) * ARROW_LENGTH);
 
             fX = getX();
             fY = y + height - y2.intValue();
index 8780c8d2436b7411d8f3c6eb933f852d882332c8..bd0fe2b4b6ddcab573a54544da700f25eae9dfc9 100755 (executable)
@@ -253,6 +253,9 @@ public class SDPrintDialogUI {
      */
     private class LocalSD extends SDWidget {
 
+        private final RGB FOCUS_COLOR = new RGB(0, 0, 128);
+        private final RGB NON_FOCUS_COLOR = new RGB(221, 208, 200);
+
         /**
          * Constructor
          * @param c Parent composite
@@ -315,10 +318,10 @@ public class SDPrintDialogUI {
                     Image toDel = over;
                     if (fOverviewCanvas.isFocusControl()) {
                         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)));
+                                ((int) (stepX * fOverviewCanvas.getZoomValue())), ((int) (stepY * fOverviewCanvas.getZoomValue()))), FOCUS_COLOR));
                     } else {
                         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)));
+                                ((int) (stepX * fOverviewCanvas.getZoomValue())), ((int) (stepY * fOverviewCanvas.getZoomValue()))), NON_FOCUS_COLOR));
                     }
                     toDel.dispose();
                 }
@@ -340,7 +343,7 @@ public class SDPrintDialogUI {
 
                 Image toDel = over;
                 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)));
+                        ((int) (stepX * fOverviewCanvas.getZoomValue())), ((int) (stepY * fOverviewCanvas.getZoomValue()))), NON_FOCUS_COLOR));
                 toDel.dispose();
             }
 
@@ -380,7 +383,7 @@ public class SDPrintDialogUI {
 
             if (!isEnabled()) {
                 Image toDel = d;
-                d = new Image(super.getShell().getDisplay(), drawRegionSelected(d, new Rectangle(0, 0, lw, lh), new RGB(221, 208, 200)));
+                d = new Image(super.getShell().getDisplay(), drawRegionSelected(d, new Rectangle(0, 0, lw, lh), NON_FOCUS_COLOR));
                 toDel.dispose();
             }
 
index 25b5a689ac7a2a4f4dc60f0295c9356ecdb8ace7..0bb5be4107efee994b449a6da4849ca4cc5d8cea 100755 (executable)
@@ -13,6 +13,7 @@
 package org.eclipse.tracecompass.tmf.ui.views.uml2sd.drawings.impl;
 
 import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.tracecompass.tmf.ui.views.uml2sd.drawings.IColor;
 
@@ -52,6 +53,16 @@ public class ColorImpl implements IColor {
         fColor = new Color(display, r, g, b);
     }
 
+    /**
+     * Constructor
+     *
+     * @param display The display to use
+     * @param color the RGB color
+     */
+    public ColorImpl(Display display, RGB color) {
+        fColor = new Color(display, color.red, color.green, color.blue);
+    }
+
     /**
      * Copy constructor
      *
index 59f4aaf5afc7f1bac8025688da38d4a4704ee03b..60cfce0c773495ee496db164a73836fe10a3462b 100755 (executable)
@@ -34,14 +34,28 @@ import org.eclipse.tracecompass.tmf.ui.views.uml2sd.drawings.impl.FontImpl;
 import org.eclipse.tracecompass.tmf.ui.views.uml2sd.util.Messages;
 
 /**
- * This is the Sequence Diagram preference handler. This class is responsible for accessing the current user preferences
- * selection This class also provider getters for each modifiable preferences.
+ * This is the Sequence Diagram preference handler. This class is responsible
+ * for accessing the current user preferences selection This class also provider
+ * getters for each modifiable preferences.
  *
  * @version 1.0
  * @author sveyrier
  */
 public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
 
+    private static final RGB DEFAULT_TIME_COMP_RGB = new RGB(218, 232, 238);
+    private static final RGB DEFAULT_RGB = new RGB(134, 176, 212);
+    private static final RGB DEFAULT_LIFELINE_HEADER_RGB = new RGB(129, 127, 137);
+    private static final RGB DEFAULT_FRAME_RGB = new RGB(0, 0, 0);
+    private static final RGB DEFAULT_LIFELINE_RGB = new RGB(129, 129, 129);
+    private static final RGB FOREGROUND_LIFELINE_RGB = new RGB(129, 129, 129);
+    private static final RGB FOREGROUND_FRAME_RGB = new RGB(81, 153, 200);
+    private static final RGB FOREGROUND_LIFELINE_HEADER_RGB = new RGB(129, 127, 137);
+    private static final RGB FOREGROUND_RGB = new RGB(134, 176, 212);
+    private static final RGB BACKGROUND_DEFAULT_RGB = new RGB(255, 255, 255);
+    private static final RGB BACKGROUND_LIFELINE_HEADER_RGB = new RGB(245, 244, 244);
+    private static final RGB BACKGROUND_LIFELINE_RGB = new RGB(220, 220, 220);
+    private static final RGB BACKGROUND_FRAME_RGB = new RGB(201, 222, 233);
     // ------------------------------------------------------------------------
     // Constants
     // ------------------------------------------------------------------------
@@ -64,7 +78,8 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
     /**
      * A 2nd array of preference names
      */
-    private static final String[] FONT_LIST2 = { Messages.SequenceDiagram_Lifeline, Messages.SequenceDiagram_ExecutionOccurrence, Messages.SequenceDiagram_SyncMessage, Messages.SequenceDiagram_SyncMessageReturn, Messages.SequenceDiagram_AsyncMessage, Messages.SequenceDiagram_AsyncMessageReturn, Messages.SequenceDiagram_Frame, Messages.SequenceDiagram_LifelineHeader, Messages.SequenceDiagram_FrameTitle };
+    private static final String[] FONT_LIST2 = { Messages.SequenceDiagram_Lifeline, Messages.SequenceDiagram_ExecutionOccurrence, Messages.SequenceDiagram_SyncMessage, Messages.SequenceDiagram_SyncMessageReturn,
+            Messages.SequenceDiagram_AsyncMessage, Messages.SequenceDiagram_AsyncMessageReturn, Messages.SequenceDiagram_Frame, Messages.SequenceDiagram_LifelineHeader, Messages.SequenceDiagram_FrameTitle };
     /**
      * Array of background color preference names
      */
@@ -79,6 +94,7 @@ 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
      */
     public static final String TEMP_TAG = "_TEMP";//$NON-NLS-1$
@@ -126,8 +142,8 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
     // ------------------------------------------------------------------------
 
     /**
-     * Builds the Sequence Diagram preference handler: - Define the preference default values. - Load the currently used
-     * preferences setting
+     * Builds the Sequence Diagram preference handler: - Define the preference
+     * default values. - Load the currently used preferences setting
      */
     protected SDViewPref() {
         fPrefStore = Activator.getDefault().getPreferenceStore();
@@ -158,13 +174,13 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
         for (int i = 0; i < PREF_BACK_COLOR_LIST.length; i++) {
             IColor color;
             if ((PREF_BACK_COLOR_LIST[i].equals(PREF_EXEC)) || PREF_BACK_COLOR_LIST[i].equals(PREF_FRAME_NAME)) {
-                color = new ColorImpl(Display.getDefault(), 201, 222, 233);
+                color = new ColorImpl(Display.getDefault(), BACKGROUND_FRAME_RGB);
             } else if (PREF_BACK_COLOR_LIST[i].equals(PREF_LIFELINE)) {
-                color = new ColorImpl(Display.getDefault(), 220, 220, 220);
+                color = new ColorImpl(Display.getDefault(), BACKGROUND_LIFELINE_RGB);
             } else if (PREF_BACK_COLOR_LIST[i].equals(PREF_LIFELINE_HEADER)) {
-                color = new ColorImpl(Display.getDefault(), 245, 244, 244);
+                color = new ColorImpl(Display.getDefault(), BACKGROUND_LIFELINE_HEADER_RGB);
             } else {
-                color = new ColorImpl(Display.getDefault(), 255, 255, 255);
+                color = new ColorImpl(Display.getDefault(), BACKGROUND_DEFAULT_RGB);
             }
             PreferenceConverter.setDefault(fPrefStore, PREF_BACK_COLOR_LIST[i] + BACK_COLOR_POSTFIX, ((Color) color.getColor()).getRGB());
             PreferenceConverter.setDefault(fPrefStore, PREF_BACK_COLOR_LIST[i] + BACK_COLOR_POSTFIX + TEMP_TAG, ((Color) color.getColor()).getRGB());
@@ -174,13 +190,13 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
         for (int i = 0; i < PREF_FORE_COLOR_LIST.length; i++) {
             IColor color;
             if (PREF_FORE_COLOR_LIST[i].equals(PREF_LIFELINE)) {
-                color = new ColorImpl(Display.getDefault(), 129, 129, 129);
+                color = new ColorImpl(Display.getDefault(), FOREGROUND_LIFELINE_RGB);
             } else if (PREF_FORE_COLOR_LIST[i].equals(PREF_FRAME_NAME)) {
-                color = new ColorImpl(Display.getDefault(), 81, 153, 200);
+                color = new ColorImpl(Display.getDefault(), FOREGROUND_FRAME_RGB);
             } else if (PREF_FORE_COLOR_LIST[i].equals(PREF_LIFELINE_HEADER)) {
-                color = new ColorImpl(Display.getDefault(), 129, 127, 137);
+                color = new ColorImpl(Display.getDefault(), FOREGROUND_LIFELINE_HEADER_RGB);
             } else {
-                color = new ColorImpl(Display.getDefault(), 134, 176, 212);
+                color = new ColorImpl(Display.getDefault(), FOREGROUND_RGB);
             }
             PreferenceConverter.setDefault(fPrefStore, PREF_FORE_COLOR_LIST[i] + FORE_COLOR_POSTFIX, ((Color) color.getColor()).getRGB());
             PreferenceConverter.setDefault(fPrefStore, PREF_FORE_COLOR_LIST[i] + FORE_COLOR_POSTFIX + TEMP_TAG, ((Color) color.getColor()).getRGB());
@@ -190,20 +206,20 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
         for (int i = 0; i < PREF_TEXT_COLOR_LIST.length; i++) {
             IColor color;
             if (PREF_TEXT_COLOR_LIST[i].equals(PREF_LIFELINE)) {
-                color = new ColorImpl(Display.getDefault(), 129, 129, 129);
+                color = new ColorImpl(Display.getDefault(), DEFAULT_LIFELINE_RGB);
             } else if (PREF_TEXT_COLOR_LIST[i].equals(PREF_FRAME_NAME)) {
-                color = new ColorImpl(Display.getDefault(), 0, 0, 0);
+                color = new ColorImpl(Display.getDefault(), DEFAULT_FRAME_RGB);
             } else if (PREF_TEXT_COLOR_LIST[i].equals(PREF_LIFELINE_HEADER)) {
-                color = new ColorImpl(Display.getDefault(), 129, 127, 137);
+                color = new ColorImpl(Display.getDefault(), DEFAULT_LIFELINE_HEADER_RGB);
             } else {
-                color = new ColorImpl(Display.getDefault(), 134, 176, 212);
+                color = new ColorImpl(Display.getDefault(), DEFAULT_RGB);
             }
             PreferenceConverter.setDefault(fPrefStore, PREF_TEXT_COLOR_LIST[i] + TEXT_COLOR_POSTFIX, ((Color) color.getColor()).getRGB());
             PreferenceConverter.setDefault(fPrefStore, PREF_TEXT_COLOR_LIST[i] + TEXT_COLOR_POSTFIX + TEMP_TAG, ((Color) color.getColor()).getRGB());
             color.dispose();
         }
 
-        IColor color = new ColorImpl(Display.getDefault(), 218, 232, 238);
+        IColor color = new ColorImpl(Display.getDefault(), DEFAULT_TIME_COMP_RGB);
         PreferenceConverter.setDefault(fPrefStore, PREF_TIME_COMP, ((Color) color.getColor()).getRGB());
         color.dispose();
 
@@ -317,8 +333,9 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
     }
 
     /**
-     * Return true if the user do not want to take external time (basically found and lost messages with time) into
-     * account in the min max computation
+     * Return true if the user do not want to take external time (basically
+     * found and lost messages with time) into account in the min max
+     * computation
      *
      * @return true if checked false otherwise
      */
@@ -337,7 +354,8 @@ public class SDViewPref implements ISDPreferences, IPropertyChangeListener {
     }
 
     /**
-     * Builds the new colors and fonts according the current user selection when the OK or Apply button is clicked
+     * Builds the new colors and fonts according the current user selection when
+     * the OK or Apply button is clicked
      */
     private void buildFontsAndColors() {
 
index 250750c145ef08e17b7e037d9e887221a14dc641..6b75033d0ce9b8610396b8854c6a6b6e390eb86b 100644 (file)
@@ -50,6 +50,28 @@ import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeForma
 public class TimeGraphScale extends TimeGraphBaseControl implements
         MouseListener, MouseMoveListener {
 
+    private static final int BASE_10 = 10;
+    private static final int X_OFFSET = 4;
+    private static final int Y_OFFSET = 4;
+
+    private static final int MIN_SECOND_FACTOR = 20;
+    private static final int SECOND_FACTOR = 30;
+    private static final int MAX_SECOND_FACTOR = 30;
+
+    private static final int MIN_MINUTE_FACTOR = 10;
+    private static final int MINUTE_FACTOR = 15;
+    private static final int MAX_MINUTE_FACTOR = 30;
+
+    private static final int MIN_HOUR_FACTOR = 3;
+    private static final int HOUR_FACTOR = 6;
+    private static final int MAX_HOUR_FACTOR = 12;
+
+    private static final int MAX_DAY_FACTOR = 10;
+
+    private static final int MAX_MONTH_FACTOR = 6;
+    private static final int MONTH_FACTOR = 6;
+    private static final int MIN_MONTH_FACTOR = 3;
+
     private static final long MICROSEC_IN_NS = 1000;
     private static final long MILLISEC_IN_NS = 1000000;
     private static final long SEC_IN_NS = 1000000000;
@@ -179,24 +201,24 @@ public class TimeGraphScale extends TimeGraphBaseControl implements
         double minDelta = (pixelsPerNanoSec == 0) ? YEAR_IN_NS : width / pixelsPerNanoSec;
         long unit = 1;
         if (fTimeProvider != null && fTimeProvider.getTimeFormat() == TimeFormat.CALENDAR) {
-            if (minDelta > 6 * MONTH_IN_NS) {
+            if (minDelta > MAX_MONTH_FACTOR * MONTH_IN_NS) {
                 unit = YEAR_IN_NS;
-            } else if (minDelta > 3 * MONTH_IN_NS) {
-                unit = 6 * MONTH_IN_NS;
-            } else if (minDelta > 10 * DAY_IN_NS) {
+            } else if (minDelta > MIN_MONTH_FACTOR * MONTH_IN_NS) {
+                unit = MONTH_FACTOR * MONTH_IN_NS;
+            } else if (minDelta > MAX_DAY_FACTOR * DAY_IN_NS) {
                 unit = MONTH_IN_NS;
-            } else if (minDelta > 12 * HOUR_IN_NS) {
+            } else if (minDelta > MAX_HOUR_FACTOR * HOUR_IN_NS) {
                 unit = DAY_IN_NS;
-            } else if (minDelta > 3 * HOUR_IN_NS) {
-                unit = 6 * HOUR_IN_NS;
-            } else if (minDelta > 30 * MIN_IN_NS) {
+            } else if (minDelta > MIN_HOUR_FACTOR * HOUR_IN_NS) {
+                unit = HOUR_FACTOR * HOUR_IN_NS;
+            } else if (minDelta > MAX_MINUTE_FACTOR * MIN_IN_NS) {
                 unit = HOUR_IN_NS;
-            } else if (minDelta > 10 * MIN_IN_NS) {
-                unit = 15 * MIN_IN_NS;
-            } else if (minDelta > 30 * SEC_IN_NS) {
+            } else if (minDelta > MIN_MINUTE_FACTOR * MIN_IN_NS) {
+                unit = MINUTE_FACTOR * MIN_IN_NS;
+            } else if (minDelta > MAX_SECOND_FACTOR * SEC_IN_NS) {
                 unit = MIN_IN_NS;
-            } else if (minDelta > 20 * SEC_IN_NS) {
-                unit = 30 * SEC_IN_NS;
+            } else if (minDelta > MIN_SECOND_FACTOR * SEC_IN_NS) {
+                unit = SECOND_FACTOR * SEC_IN_NS;
             } else if (minDelta <= 1) {
                 timeDelta = 1;
                 return timeDelta;
@@ -206,15 +228,15 @@ public class TimeGraphScale extends TimeGraphBaseControl implements
         long pow10 = (long) log;
         double remainder = log - pow10;
         if (remainder < LOG10_1) {
-            timeDelta = (long) Math.pow(10, pow10) * unit;
+            timeDelta = (long) Math.pow(BASE_10, pow10) * unit;
         } else if (remainder < LOG10_2) {
-            timeDelta = 2 * (long) Math.pow(10, pow10) * unit;
+            timeDelta = 2 * (long) Math.pow(BASE_10, pow10) * unit;
         } else if (remainder < LOG10_3 && unit >= HOUR_IN_NS && unit < YEAR_IN_NS) {
-            timeDelta = 3 * (long) Math.pow(10, pow10) * unit;
+            timeDelta = 3 * (long) Math.pow(BASE_10, pow10) * unit;
         } else if (remainder < LOG10_5) {
-            timeDelta = 5 * (long) Math.pow(10, pow10) * unit;
+            timeDelta = 5 * (long) Math.pow(BASE_10, pow10) * unit;
         } else {
-            timeDelta = 10 * (long) Math.pow(10, pow10) * unit;
+            timeDelta = 10 * (long) Math.pow(BASE_10, pow10) * unit;
         }
         if (timeDelta <= 0) {
             timeDelta = 1;
@@ -290,11 +312,11 @@ public class TimeGraphScale extends TimeGraphBaseControl implements
 
         // draw top left area
         rect0.width = leftSpace;
-        rect0.x += 4;
-        rect0.width -= 4;
+        rect0.x += X_OFFSET;
+        rect0.width -= X_OFFSET;
         Rectangle absHeaderRect = new Rectangle(rect0.x, rect0.y, rect0.width, rect0.height);
-        rect0.x -= 4;
-        rect0.width += 4;
+        rect0.x -= X_OFFSET;
+        rect0.width += X_OFFSET;
 
         // prepare and draw right rect of the timescale
         rect0.x += leftSpace;
@@ -340,7 +362,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements
 
         // draw time scale ticks
         rect0.y = rect.y;
-        rect0.height = rect.height - 4;
+        rect0.height = rect.height - Y_OFFSET;
         rect0.width = labelWidth;
 
         long time;
@@ -365,7 +387,7 @@ public class TimeGraphScale extends TimeGraphBaseControl implements
                 break;
             }
             if (x >= rect.x + leftSpace) {
-                gc.drawLine(x, y, x, y + 4);
+                gc.drawLine(x, y, x, y + Y_OFFSET);
                 rect0.x = x;
                 if (x + rect0.width <= rect.x + rect.width) {
                     timeDraw.draw(gc, time, rect0);
This page took 0.034372 seconds and 5 git commands to generate.