Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Hufmann2013-05-29 15:23:02 +0000
committerBernd Hufmann2013-05-30 17:02:52 +0000
commit3cc84d892e20fad0de4f05ed13a797f71a93ae64 (patch)
tree26f697148fca320ac5d32b91ccef3093dd5c60f2
parent5104ccaebf7909d32cab03f416464681681abdd5 (diff)
downloadorg.eclipse.linuxtools-3cc84d892e20fad0de4f05ed13a797f71a93ae64.tar.gz
org.eclipse.linuxtools-3cc84d892e20fad0de4f05ed13a797f71a93ae64.tar.xz
org.eclipse.linuxtools-3cc84d892e20fad0de4f05ed13a797f71a93ae64.zip
tmf: Fix more Sonar warnings in Sequence Diagram Framework
Change-Id: I235bca865940386735cf9f9823da6ce9d1b0721d Reviewed-on: https://git.eclipse.org/r/13342 Tested-by: Hudson CI Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com> IP-Clean: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DiagramToolTip.java11
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DrawableToolTip.java76
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java16
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java31
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java33
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/FilterListDialog.java1
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/MinMaxDialog.java40
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/PagesDialog.java6
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SearchFilterDialog.java53
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/TabContents.java50
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/KeyBindingsManager.java2
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDDown.java2
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDLeft.java2
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDRight.java2
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDUp.java2
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveToMessage.java2
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDFindDialog.java4
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/PrevPage.java2
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/Zoom.java8
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/provider/ISDGraphNodeSupporter.java12
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/load/LoadersManager.java2
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java22
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/ISDPreferences.java30
-rwxr-xr-xlttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewerPage.java24
24 files changed, 236 insertions, 197 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DiagramToolTip.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DiagramToolTip.java
index ba71d0915d..08accdd9f4 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DiagramToolTip.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DiagramToolTip.java
@@ -33,6 +33,12 @@ import org.eclipse.swt.widgets.Text;
public class DiagramToolTip {
// ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ private static final int CHARACTERS_PER_COLUMN = 100;
+ private static final int DEFAULT_CURSOR_HEIGHT = 32;
+
+ // ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
/**
@@ -82,7 +88,7 @@ public class DiagramToolTip {
int w = fToolTipShell.getBounds().width;
Point hr = Display.getDefault().getCursorLocation();
- int cursorH = 32;
+ int cursorH = DEFAULT_CURSOR_HEIGHT;
for (int i = 0; i < Display.getDefault().getCursorSizes().length; i++) {
if (Display.getDefault().getCursorSizes()[i].y < cursorH) {
cursorH = Display.getDefault().getCursorSizes()[i].y;
@@ -96,11 +102,10 @@ public class DiagramToolTip {
hr.x = hr.x - tempX;
}
fTextBox.setText(value);
- int charactersPerColumn = 100;
GC gc = new GC(fTextBox);
FontMetrics fm = gc.getFontMetrics();
gc.dispose();
- int width = charactersPerColumn * fm.getAverageCharWidth();
+ int width = CHARACTERS_PER_COLUMN * fm.getAverageCharWidth();
fTextBox.setSize(fTextBox.computeSize(width, fTextBox.getLineCount() * fTextBox.getLineHeight()));
fToolTipShell.setLocation(hr.x, hr.y + cursorH);
fToolTipShell.setSize(fTextBox.getSize());
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DrawableToolTip.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DrawableToolTip.java
index 5e63247b26..89d1a5a377 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DrawableToolTip.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/DrawableToolTip.java
@@ -39,14 +39,28 @@ import org.eclipse.swt.widgets.Shell;
public class DrawableToolTip implements PaintListener {
// ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ private static final int HORIZONTAL_MARGIN = 10;
+ private static final int VERTICAL_MARGIN = 10;
+ private static final int TEXT_SCALE_MARGIN = 20;
+ private static final int SCALE_LENGTH = 100;
+ private static final int SHELL_WIDTH = 200;
+ private static final int SHELL_HEIGHT = 50;
+ private static final int NUMBER_STEPS = 10;
+ private static final int BASE_RED_VALUE = 255;
+ private static final int BASE_GREEN_BLUE_VALUE = 225;
+ private static final int COLOR_STEP = 25;
+ private static final int BOUNDS_Y_OFFSET = 26;
+ private static final int RECTANGLE_HEIGHT = 11;
+ private static final int DEFAULT_LINE_WIDTH = 10;
+ private static final int BORDER_LINE_WIDTH = 14;
+
+ // ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
/**
- * The parent control where the tooltip must be drawn
- */
- private Composite fParent = null;
- /**
* The tooltip shell
*/
private Shell fToolTipShell = null;
@@ -61,19 +75,19 @@ public class DrawableToolTip implements PaintListener {
/**
* The horizontal margin used for drawing.
*/
- private static int fHorMargin = 10;
+ private static int fHorMargin = HORIZONTAL_MARGIN;
/**
* The vertical margin used for drawing.
*/
- private static int fVertMargin = 10;
+ private static int fVertMargin = VERTICAL_MARGIN;
/**
* The minimum text scale margin.
*/
- private static int fTextScaleMargin = 20;
+ private static int fTextScaleMargin = TEXT_SCALE_MARGIN;
/**
* The length of the text scale.
*/
- private static int fScaleLength = 100;
+ private static int fScaleLength = SCALE_LENGTH;
/**
* The text to display
*/
@@ -93,24 +107,19 @@ public class DrawableToolTip implements PaintListener {
* @param parent The parent composite.
*/
public DrawableToolTip(Composite parent) {
- fParent = parent;
- fToolTipShell = new Shell(fParent.getShell(), SWT.ON_TOP);
+ fToolTipShell = new Shell(parent.getShell(), SWT.ON_TOP);
fToolTipShell.setLayout(new RowLayout());
fToolTipShell.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
fToolTipShell.addPaintListener(this);
- fToolTipShell.setSize(200, 50);
+ fToolTipShell.setSize(SHELL_WIDTH, SHELL_HEIGHT);
- fColors = new Color[10];
- fColors[0] = new Color(Display.getDefault(), 255, 229, 229);
- fColors[1] = new Color(Display.getDefault(), 255, 204, 204);
- fColors[2] = new Color(Display.getDefault(), 255, 178, 178);
- fColors[3] = new Color(Display.getDefault(), 255, 153, 153);
- fColors[4] = new Color(Display.getDefault(), 255, 127, 127);
- fColors[5] = new Color(Display.getDefault(), 255, 102, 102);
- fColors[6] = new Color(Display.getDefault(), 255, 76, 76);
- fColors[7] = new Color(Display.getDefault(), 255, 51, 51);
- fColors[8] = new Color(Display.getDefault(), 255, 25, 25);
- fColors[9] = new Color(Display.getDefault(), 255, 0, 0);
+ fColors = new Color[NUMBER_STEPS];
+ int greenBlue = BASE_GREEN_BLUE_VALUE;
+ final int step = COLOR_STEP;
+ for (int i = 0; i < fColors.length; i++) {
+ fColors[i] = new Color(Display.getDefault(), BASE_RED_VALUE, greenBlue, greenBlue);
+ greenBlue -= step;
+ }
}
// ------------------------------------------------------------------------
@@ -221,7 +230,7 @@ public class DrawableToolTip implements PaintListener {
int w = fToolTipShell.getBounds().width;
int h = fToolTipShell.getBounds().height;
Point hr = Display.getDefault().getCursorLocation();
- fToolTipShell.setBounds(hr.x, hr.y + 26, w, h);
+ fToolTipShell.setBounds(hr.x, hr.y + BOUNDS_Y_OFFSET, w, h);
fToolTipShell.setVisible(true);
}
@@ -251,19 +260,16 @@ public class DrawableToolTip implements PaintListener {
event.gc.drawText(fMessage, fHorMargin, fVertMargin, true);
event.gc.drawLine(fHorMargin, fVertMargin + fTextScaleMargin + size.y, fHorMargin + fScaleLength, fVertMargin + fTextScaleMargin + size.y);
- int step = fScaleLength / 10;
+ int step = fScaleLength / NUMBER_STEPS;
- // double gr = (max - min) / 10;
ITmfTimestamp minMaxdelta = fMinMaxRange.getEndTime().getDelta(fMinMaxRange.getStartTime());
- double gr = (minMaxdelta.getValue()) / (double) 10;
+ double gr = (minMaxdelta.getValue()) / (double) NUMBER_STEPS;
- // double delta = currentValue-min;
ITmfTimestamp delta = fCurrentValue.getDelta(fMinMaxRange.getStartTime());
long absDelta = Math.abs(delta.getValue());
int colIndex = 0;
if (gr != 0) {
- // colIndex = Math.round((float)(Math.log(1+delta)/gr));
colIndex = Math.round((float) (absDelta / gr));
if (colIndex > fColors.length) {
colIndex = fColors.length;
@@ -274,12 +280,12 @@ public class DrawableToolTip implements PaintListener {
colIndex = 1;
}
- for (int i = 0; i <= 10; i++) {
- if (i < 10) {
+ for (int i = 0; i <= NUMBER_STEPS; i++) {
+ if (i < NUMBER_STEPS) {
event.gc.setBackground(fColors[i]);
}
- if ((i < colIndex) && (i < 10)) {
- event.gc.fillRectangle(fHorMargin + i * step, fVertMargin + fTextScaleMargin + size.y - 5, step, 11);
+ if ((i < colIndex) && (i < NUMBER_STEPS)) {
+ event.gc.fillRectangle(fHorMargin + i * step, fVertMargin + fTextScaleMargin + size.y - 5, step, RECTANGLE_HEIGHT);
}
if (i == 0) {
event.gc.drawText(Messages.SequenceDiagram_Min, fHorMargin, size.y + 2 * fVertMargin + fTextScaleMargin, true);
@@ -288,9 +294,9 @@ public class DrawableToolTip implements PaintListener {
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)) {
- lineWidth = 14;
+ int lineWidth = DEFAULT_LINE_WIDTH;
+ if ((i == 0) || (i == NUMBER_STEPS)) {
+ lineWidth = BORDER_LINE_WIDTH;
}
event.gc.drawLine(fHorMargin + i * step, fVertMargin + fTextScaleMargin + size.y - lineWidth / 2, fHorMargin + i * step, fVertMargin + fTextScaleMargin + size.y + lineWidth / 2);
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java
index 58385d2f32..a5e9a28be9 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/SDView.java
@@ -92,42 +92,42 @@ public class SDView extends ViewPart {
* Name of menu separator for view modes
* @since 2.0
*/
- public final static String UML2SD_VIEW_MODES_SEPARATOR = "UML2SD_VIEW_MODES"; //$NON-NLS-1$
+ public static final 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$
+ public static final 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$
+ public static final 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$
+ public static final 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$
+ public static final 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$
+ public static final 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$
+ public static final 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$
+ public static final String UML2SD_OTHER_PLUGINS_COMMANDS_SEPARATOR = "UML2SD_OTHER_PLUGINS_COMMANDS"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Attributes
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
index 991ae5e0c2..7ba6a39540 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/ScrollView.java
@@ -57,9 +57,8 @@ import org.eclipse.swt.widgets.Shell;
* @version 1.0
*/
public class ScrollView extends Composite {
-
// ------------------------------------------------------------------------
- // Attributes
+ // Constants
// ------------------------------------------------------------------------
/**
@@ -82,6 +81,16 @@ public class ScrollView extends Composite {
* Bit mask for visible horizontal scroll bar
*/
public static final int HBAR = 0x02;
+
+ private static final int DEFAULT_H_SCROLL_INCREMENT = 10;
+ private static final int DEFAULT_V_SCROLL_INCREMENT = 10;
+ private static final int DEFAULT_AUTO_SCROLL_PERIOD = 75;
+ private static final int DEFAULT_OVERVIEW_SIZE = 100;
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
/**
* Value of the contents height property.
*/
@@ -109,11 +118,11 @@ public class ScrollView extends Composite {
/**
* Increment for the horizontal scroll bar.
*/
- private int fHorScrollbarIncrement = 10;
+ private int fHorScrollbarIncrement = DEFAULT_H_SCROLL_INCREMENT;
/**
* Increment for the vertical scroll bar.
*/
- private int fVertScrollbarIncrement = 10;
+ private int fVertScrollbarIncrement = DEFAULT_V_SCROLL_INCREMENT;
/**
* Flag whether auto scroll is enabled or not.
*/
@@ -121,7 +130,7 @@ public class ScrollView extends Composite {
/**
* Value of the auto scroll period.
*/
- private int fAutoScrollPeriod = 75;
+ private int fAutoScrollPeriod = DEFAULT_AUTO_SCROLL_PERIOD;
/**
* The local paint listener reference.
*/
@@ -162,7 +171,7 @@ public class ScrollView extends Composite {
/**
* Size of overview widget.
*/
- private int fOverviewSize = 100; // default size for overview
+ private int fOverviewSize = DEFAULT_OVERVIEW_SIZE; // default size for overview
/**
* Timer for auto_scroll feature
*/
@@ -1606,10 +1615,10 @@ public class ScrollView extends Composite {
*/
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;
+ private static final int DEFAULT_X = 250;
+ private static final int DEFAULT_Y = 250;
+ private static final int MAX_SEEK = 10;
+ private static final int MIN_SEEK = 0;
/**
* The seek value
@@ -1714,7 +1723,7 @@ public class ScrollView extends Composite {
/** Support for click-and-see overview shell on this ScrollView */
protected class Overview {
- private final static int REFRESH_FREQ = 4;
+ private static final int REFRESH_FREQ = 4;
/**
* factor for X from real and overview sizes, for mouse move speed.
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java
index 2b795a0cf1..2e616ef596 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/TimeCompressionBar.java
@@ -67,6 +67,14 @@ import org.eclipse.swt.widgets.Display;
public class TimeCompressionBar extends ScrollView implements DisposeListener {
// ------------------------------------------------------------------------
+ // Constants
+ // ------------------------------------------------------------------------
+ private static final int BASE_RED_VALUE = 255;
+ private static final int BASE_GREEN_BLUE_VALUE = 225;
+ private static final int COLOR_STEP = 25;
+ private static final int NUMBER_STEPS = 10;
+
+ // ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
@@ -149,17 +157,13 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
setVScrollBarMode(ScrollView.ALWAYS_OFF);
setHScrollBarMode(ScrollView.ALWAYS_OFF);
fListenerList = new ArrayList<ITimeCompressionListener>();
- fColors = new ColorImpl[10];
- fColors[0] = new ColorImpl(Display.getDefault(), 255, 229, 229);
- fColors[1] = new ColorImpl(Display.getDefault(), 255, 204, 204);
- fColors[2] = new ColorImpl(Display.getDefault(), 255, 178, 178);
- fColors[3] = new ColorImpl(Display.getDefault(), 255, 153, 153);
- fColors[4] = new ColorImpl(Display.getDefault(), 255, 127, 127);
- fColors[5] = new ColorImpl(Display.getDefault(), 255, 102, 102);
- fColors[6] = new ColorImpl(Display.getDefault(), 255, 76, 76);
- fColors[7] = new ColorImpl(Display.getDefault(), 255, 51, 51);
- fColors[8] = new ColorImpl(Display.getDefault(), 255, 25, 25);
- fColors[9] = new ColorImpl(Display.getDefault(), 255, 0, 0);
+ fColors = new ColorImpl[NUMBER_STEPS];
+ int greenBlue = BASE_GREEN_BLUE_VALUE;
+ final int step = COLOR_STEP;
+ for (int i = 0; i < fColors.length; i++) {
+ fColors[i] = new ColorImpl(Display.getDefault(), BASE_RED_VALUE, greenBlue, greenBlue);
+ greenBlue -= step;
+ }
super.addDisposeListener(this);
fAccessible = getViewControl().getAccessible();
@@ -375,7 +379,7 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
fMinTime = fFrame.getMinTime();
fMaxTime = fFrame.getMaxTime();
ITmfTimestamp minMaxdelta = fMaxTime.getDelta(fMinTime);
- double gr = (minMaxdelta.getValue()) / (double) 10;
+ double gr = (minMaxdelta.getValue()) / (double) NUMBER_STEPS;
ITmfTimestamp delta = m2.getTime().getDelta(m1.getTime()).getDelta(fMinTime);
long absDelta = Math.abs(delta.getValue());
@@ -650,7 +654,7 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
}
ITmfTimestamp minMaxdelta = fMaxTime.getDelta(fMinTime);
- double gr = (minMaxdelta.getValue()) / (double) 10;
+ double gr = (minMaxdelta.getValue()) / (double) NUMBER_STEPS;
ITmfTimestamp delta = time2.getDelta(time1).getDelta(fMinTime);
long absDelta = Math.abs(delta.getValue());
@@ -748,7 +752,6 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
Control[] child = getParent().getChildren();
for (int i = 0; i < child.length; i++) {
if (child[i].isFocusControl()) {
- // getViewControl().setFocus();
break;
}
}
@@ -893,7 +896,7 @@ public class TimeCompressionBar extends ScrollView implements DisposeListener {
fPrevNodeY = m1Y;
fNextNodeY = m2Y;
ITmfTimestamp minMaxdelta = fMaxTime.getDelta(fMinTime);
- double gr = (minMaxdelta.getValue()) / (double) 10;
+ double gr = (minMaxdelta.getValue()) / (double) NUMBER_STEPS;
ITmfTimestamp delta = m2.getTime().getDelta(m1.getTime()).getDelta(fMinTime);
long absDelta = Math.abs(delta.getValue());
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/FilterListDialog.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/FilterListDialog.java
index 77a149e5ef..e71838e86e 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/FilterListDialog.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/FilterListDialog.java
@@ -104,7 +104,6 @@ public class FilterListDialog extends Dialog {
fViewer = view;
fProvider = loader;
fFilters = null;
- // filters = provider.getCurrentFilters();
setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/MinMaxDialog.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/MinMaxDialog.java
index b962a3d22e..e7d0f12008 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/MinMaxDialog.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/MinMaxDialog.java
@@ -44,22 +44,6 @@ public class MinMaxDialog extends Dialog {
// Attributes
// ------------------------------------------------------------------------
/**
- * Label for minimum.
- */
- private Label fMinLabel;
- /**
- * Label for maximum.
- */
- private Label fMaxLabel;
- /**
- * Label for scale
- */
- private Label fScaleLabel;
- /**
- * Label for precision.
- */
- private Label fPrecisionLabel;
- /**
* Text field for minimum.
*/
private Text fMinText;
@@ -122,34 +106,34 @@ public class MinMaxDialog extends Dialog {
g1layout.numColumns = 3;
g1.setLayout(g1layout);
- fMinLabel = new Label(g1, SWT.RADIO);
- fMinLabel.setText(Messages.SequenceDiagram_MinTime);
- fMinLabel.setLayoutData(newGridData(1));
+ Label minLabel = new Label(g1, SWT.RADIO);
+ minLabel.setText(Messages.SequenceDiagram_MinTime);
+ minLabel.setLayoutData(newGridData(1));
fMinText = new Text(g1, SWT.SINGLE | SWT.BORDER);
fMinText.setLayoutData(newGridData(2));
fMinText.setText(String.valueOf(fSdWidget.getFrame().getMinTime().getValue()));
- fMaxLabel = new Label(g1, SWT.RADIO);
- fMaxLabel.setText(Messages.SequenceDiagram_MaxTime);
- fMaxLabel.setLayoutData(newGridData(1));
+ Label maxLabel = new Label(g1, SWT.RADIO);
+ maxLabel.setText(Messages.SequenceDiagram_MaxTime);
+ maxLabel.setLayoutData(newGridData(1));
fMaxText = new Text(g1, SWT.SINGLE | SWT.BORDER);
fMaxText.setLayoutData(newGridData(2));
fMaxText.setText(String.valueOf(fSdWidget.getFrame().getMaxTime().getValue()));
- fScaleLabel = new Label(g1, SWT.RADIO);
- fScaleLabel.setText(Messages.SequenceDiagram_Scale);
- fScaleLabel.setLayoutData(newGridData(1));
+ Label scaleLabel = new Label(g1, SWT.RADIO);
+ scaleLabel.setText(Messages.SequenceDiagram_Scale);
+ scaleLabel.setLayoutData(newGridData(1));
fScaleText = new Text(g1, SWT.SINGLE | SWT.BORDER);
fScaleText.setLayoutData(newGridData(2));
fScaleText.setText(String.valueOf(fSdWidget.getFrame().getMinTime().getScale()));
- fPrecisionLabel = new Label(g1, SWT.RADIO);
- fPrecisionLabel.setText(Messages.SequenceDiagram_Precision);
- fPrecisionLabel.setLayoutData(newGridData(1));
+ Label precisionLabel = new Label(g1, SWT.RADIO);
+ precisionLabel.setText(Messages.SequenceDiagram_Precision);
+ precisionLabel.setLayoutData(newGridData(1));
fPrecisionText = new Text(g1, SWT.SINGLE | SWT.BORDER);
fPrecisionText.setLayoutData(newGridData(2));
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/PagesDialog.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/PagesDialog.java
index c3db012810..6243b7469d 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/PagesDialog.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/PagesDialog.java
@@ -139,15 +139,15 @@ public class PagesDialog extends Dialog {
/**
* The text field.
*/
- protected Text fText;
+ private Text fText;
/**
* The minimum page value
*/
- int fMin;
+ private int fMin;
/**
* The maximum page value
*/
- int fMax;
+ private int fMax;
/**
* Constructor
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SearchFilterDialog.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SearchFilterDialog.java
index fa1f929aed..6e28b5fb43 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SearchFilterDialog.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/SearchFilterDialog.java
@@ -90,7 +90,7 @@ public class SearchFilterDialog extends Dialog {
/**
* The find/filter provider telling which graph nodes are supported
*/
- final private ISDGraphNodeSupporter fProvider;
+ private final ISDGraphNodeSupporter fProvider;
/**
* The okText is the text for the Ok button and title is the title of the
@@ -98,25 +98,25 @@ public class SearchFilterDialog extends Dialog {
* Both depend (okText and title (below)) on the usage that is done of this
* dialog (find or filter).
*/
- protected String fOkText;
+ private String fOkText;
/**
* The title is the title of the dialog.<br>
* Both depend (okText and title) on the usage that is done of this dialog
* (find or filter).
*/
- protected String fTitle;
+ private String fTitle;
/**
* List of string expressions that have been searched already
*/
- protected String[] fExpressionList;
+ private String[] fExpressionList;
/**
* find is true if the dialog is for the find feature and false for filter
* feature
*/
- protected boolean fIsFind;
+ private boolean fIsFind;
// ------------------------------------------------------------------------
// Constructors
@@ -406,4 +406,47 @@ public class SearchFilterDialog extends Dialog {
public void setTitle(String title) {
fTitle = title;
}
+
+ /**
+ * Gets the text to be used for the ok button
+ *
+ * @return the text to be used for the ok button
+ * @since 2.0
+ */
+ public String getOkText() {
+ return fOkText;
+ }
+
+ /**
+ * Sets the IsFind flag (true for find, else for filter)
+ *
+ * @param flag value to set
+ * @since 2.0
+ */
+ protected void setIsFind(boolean flag) {
+ fIsFind = flag;
+ }
+
+ /**
+ * Gets the title to be used for the dialog box.
+ *
+ * @return the title to be used for the dialog box.
+ * @since 2.0
+ */
+ public String getTitle() {
+ return fTitle;
+ }
+
+ /**
+ * Gets the IsFind flag (true for find, else for filter)
+ *
+ * @return true for find, else for filter
+ * @since 2.0
+ */
+ protected boolean isFind() {
+ return fIsFind;
+ }
+
+
+
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/TabContents.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/TabContents.java
index 79ceffcbf7..98e5bf4efb 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/TabContents.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/dialogs/TabContents.java
@@ -39,14 +39,6 @@ public class TabContents extends Composite {
// Attributes
// ------------------------------------------------------------------------
/**
- * A graph node type listener implementation.
- */
- private final GraphNodeTypeListener fGraphNodeTypeListener;
- /**
- * A expression listener implementation.
- */
- private final ExpressionListener fExpressionListener;
- /**
* The button for lifelines.
*/
private Button fLifelineButton;
@@ -75,10 +67,6 @@ public class TabContents extends Composite {
*/
private Combo fSearchText = null;
/**
- * The group for selection kind.
- */
- private Group fKindSelection = null;
- /**
* The button for case sensitive expressions.
*/
private Button fCaseSensitive = null;
@@ -108,8 +96,8 @@ public class TabContents extends Composite {
fParentOkButton = okButton;
setLayout(new GridLayout());
- fGraphNodeTypeListener = new GraphNodeTypeListener();
- fExpressionListener = new ExpressionListener();
+ GraphNodeTypeListener graphNodeTypeListener = new GraphNodeTypeListener();
+ ExpressionListener expressionListener = new ExpressionListener();
// Inform the user how to fill the string to search
Label searchTitle = new Label(this, SWT.LEFT);
@@ -133,25 +121,25 @@ public class TabContents extends Composite {
fSearchText.add(expressionList[i]);
}
}
- fSearchText.addModifyListener(fExpressionListener);
+ fSearchText.addModifyListener(expressionListener);
// Create the case sensitive check button
fCaseSensitive = new Button(searchPart, SWT.CHECK);
fCaseSensitive.setText(Messages.SequenceDiagram_CaseSensitive);
// Create the group for searched graph node kind selection
- fKindSelection = new Group(this, SWT.SHADOW_NONE);
- fKindSelection.setText(Messages.SequenceDiagram_SearchFor);
+ Group kindSelection = new Group(this, SWT.SHADOW_NONE);
+ kindSelection.setText(Messages.SequenceDiagram_SearchFor);
// kindSelection.setLayoutData(tabLayoutData2);
GridLayout kindSelectionLayout = new GridLayout();
kindSelectionLayout.numColumns = 1;
- fKindSelection.setLayout(kindSelectionLayout);
+ kindSelection.setLayout(kindSelectionLayout);
GridData kindSelectionData = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
- fKindSelection.setLayoutData(kindSelectionData);
+ kindSelection.setLayoutData(kindSelectionData);
// Create the lifeline check button
if (provider != null && provider.isNodeSupported(ISDGraphNodeSupporter.LIFELINE)) {
- fLifelineButton = new Button(fKindSelection, SWT.CHECK);
+ fLifelineButton = new Button(kindSelection, SWT.CHECK);
String nodeName = provider.getNodeName(ISDGraphNodeSupporter.LIFELINE, null);
if (nodeName != null) {
fLifelineButton.setText(nodeName);
@@ -159,12 +147,12 @@ public class TabContents extends Composite {
fLifelineButton.setText(Messages.SequenceDiagram_Lifeline);
}
fLifelineButton.setEnabled(true);
- fLifelineButton.addSelectionListener(fGraphNodeTypeListener);
+ fLifelineButton.addSelectionListener(graphNodeTypeListener);
}
if (provider != null && provider.isNodeSupported(ISDGraphNodeSupporter.STOP)) {
// Create the stop check button
- fStopButton = new Button(fKindSelection, SWT.CHECK);
+ fStopButton = new Button(kindSelection, SWT.CHECK);
String nodeName = provider.getNodeName(ISDGraphNodeSupporter.STOP, null);
if (nodeName != null) {
fStopButton.setText(nodeName);
@@ -173,12 +161,12 @@ public class TabContents extends Composite {
}
fStopButton.setEnabled(true);
- fStopButton.addSelectionListener(fGraphNodeTypeListener);
+ fStopButton.addSelectionListener(graphNodeTypeListener);
}
if (provider != null && provider.isNodeSupported(ISDGraphNodeSupporter.SYNCMESSAGE)) {
// Create the synchronous message check button
- fSynMessageButton = new Button(fKindSelection, SWT.CHECK);
+ fSynMessageButton = new Button(kindSelection, SWT.CHECK);
String nodeName = provider.getNodeName(ISDGraphNodeSupporter.SYNCMESSAGE, null);
if (nodeName != null) {
fSynMessageButton.setText(nodeName);
@@ -186,12 +174,12 @@ public class TabContents extends Composite {
fSynMessageButton.setText(Messages.SequenceDiagram_SynchronousMessage);
}
fSynMessageButton.setEnabled(true);
- fSynMessageButton.addSelectionListener(fGraphNodeTypeListener);
+ fSynMessageButton.addSelectionListener(graphNodeTypeListener);
}
if (provider != null && provider.isNodeSupported(ISDGraphNodeSupporter.SYNCMESSAGERETURN)) {
// Create the synchronous message return check button
- fSynMessageReturnButton = new Button(fKindSelection, SWT.CHECK);
+ fSynMessageReturnButton = new Button(kindSelection, SWT.CHECK);
String nodeName = provider.getNodeName(ISDGraphNodeSupporter.SYNCMESSAGERETURN, null);
if (nodeName != null) {
fSynMessageReturnButton.setText(nodeName);
@@ -199,12 +187,12 @@ public class TabContents extends Composite {
fSynMessageReturnButton.setText(Messages.SequenceDiagram_SynchronousMessageReturn);
}
fSynMessageReturnButton.setEnabled(true);
- fSynMessageReturnButton.addSelectionListener(fGraphNodeTypeListener);
+ fSynMessageReturnButton.addSelectionListener(graphNodeTypeListener);
}
if (provider != null && provider.isNodeSupported(ISDGraphNodeSupporter.ASYNCMESSAGE)) {
// Create the asynchronous message check button
- fAsynMessageButton = new Button(fKindSelection, SWT.CHECK);
+ fAsynMessageButton = new Button(kindSelection, SWT.CHECK);
String nodeName = provider.getNodeName(ISDGraphNodeSupporter.ASYNCMESSAGE, null);
if (nodeName != null) {
fAsynMessageButton.setText(nodeName);
@@ -212,12 +200,12 @@ public class TabContents extends Composite {
fAsynMessageButton.setText(Messages.SequenceDiagram_AsynchronousMessage);
}
fAsynMessageButton.setEnabled(true);
- fAsynMessageButton.addSelectionListener(fGraphNodeTypeListener);
+ fAsynMessageButton.addSelectionListener(graphNodeTypeListener);
}
if (provider != null && provider.isNodeSupported(ISDGraphNodeSupporter.ASYNCMESSAGERETURN)) {
// Create the asynchronous message return check button
- fAsynMessageReturnButton = new Button(fKindSelection, SWT.CHECK);
+ fAsynMessageReturnButton = new Button(kindSelection, SWT.CHECK);
String nodeName = provider.getNodeName(ISDGraphNodeSupporter.ASYNCMESSAGERETURN, null);
if (nodeName != null) {
fAsynMessageReturnButton.setText(nodeName);
@@ -225,7 +213,7 @@ public class TabContents extends Composite {
fAsynMessageReturnButton.setText(Messages.SequenceDiagram_AsynchronousMessageReturn);
}
fAsynMessageReturnButton.setEnabled(true);
- fAsynMessageReturnButton.addSelectionListener(fGraphNodeTypeListener);
+ fAsynMessageReturnButton.addSelectionListener(graphNodeTypeListener);
}
fResult = new Label(this, SWT.LEFT);
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/KeyBindingsManager.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/KeyBindingsManager.java
index f239e204f6..58c88d51d4 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/KeyBindingsManager.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/KeyBindingsManager.java
@@ -105,7 +105,7 @@ public class KeyBindingsManager {
*
* @return the KeyBindingsManager singleton instance
*/
- public synchronized static KeyBindingsManager getInstance() {
+ public static synchronized KeyBindingsManager getInstance() {
if (fInstance == null) {
fInstance = new KeyBindingsManager();
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDDown.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDDown.java
index d335244948..d2726cb1c8 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDDown.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDDown.java
@@ -30,7 +30,7 @@ public class MoveSDDown extends BaseSDAction {
/**
* The action ID.
*/
- public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDDown"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDDown"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Constructors
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDLeft.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDLeft.java
index 97b931ae49..70c4b95cd2 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDLeft.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDLeft.java
@@ -30,7 +30,7 @@ public class MoveSDLeft extends BaseSDAction {
/**
* The action ID.
*/
- public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDLeft"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDLeft"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Constructors
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDRight.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDRight.java
index ba15fe0f92..6a20130f90 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDRight.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDRight.java
@@ -31,7 +31,7 @@ public class MoveSDRight extends BaseSDAction {
/**
* The action ID.
*/
- public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDRight"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDRight"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Constructors
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDUp.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDUp.java
index f1eefc26af..caf8ec5311 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDUp.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveSDUp.java
@@ -30,7 +30,7 @@ public class MoveSDUp extends BaseSDAction {
/**
* The action ID.
*/
- public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDUp"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.MoveSDUp"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Constructors
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveToMessage.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveToMessage.java
index 8cd687dbe4..4b966b195f 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveToMessage.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/MoveToMessage.java
@@ -41,7 +41,7 @@ public class MoveToMessage extends BaseSDAction {
/**
* The action ID.
*/
- public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.GoToMessage"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.GoToMessage"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Constructors
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDFindDialog.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDFindDialog.java
index 38d0cb52fc..92cffd8713 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDFindDialog.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/OpenSDFindDialog.java
@@ -34,12 +34,12 @@ public class OpenSDFindDialog extends BaseSDAction {
/**
* The action ID.
*/
- public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.sdFind"; //$NON-NLS-1$
+ public static final 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$
+ public static final String ACTION_DEFINITION_ID = "org.eclipse.ui.edit.findReplace"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Constructors
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/PrevPage.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/PrevPage.java
index 6558ca1484..19c7779e78 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/PrevPage.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/PrevPage.java
@@ -33,7 +33,7 @@ public class PrevPage extends BaseSDAction {
/**
* The action ID.
*/
- public final static String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.prevpage"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.prevpage"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Constructors
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/Zoom.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/Zoom.java
index f51a5e0db3..d5a36af4d4 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/Zoom.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/Zoom.java
@@ -41,19 +41,19 @@ public class Zoom extends BaseSDAction {
/**
* The Action ID for zooming in.
*/
- public final static String ZOOM_IN_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ZoomInCoolBar"; //$NON-NLS-1$
+ public static final String ZOOM_IN_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ZoomInCoolBar"; //$NON-NLS-1$
/**
* The Action ID for zooming out.
*/
- public final static String ZOOM_OUT_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ZoomOutCoolBar"; //$NON-NLS-1$
+ public static final String ZOOM_OUT_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ZoomOutCoolBar"; //$NON-NLS-1$
/**
* The Action ID for reset zooming.
*/
- public final static String RESET_ZOOM_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ResetZoom"; //$NON-NLS-1$
+ public static final String RESET_ZOOM_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.ResetZoom"; //$NON-NLS-1$
/**
* The Action ID for no zoominf.
*/
- public final static String NO_ZOOM_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.NoZoom"; //$NON-NLS-1$
+ public static final String NO_ZOOM_ID = "org.eclipse.linuxtools.tmf.ui.views.uml2sd.handlers.NoZoom"; //$NON-NLS-1$
// ------------------------------------------------------------------------
// Attributes
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/provider/ISDGraphNodeSupporter.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/provider/ISDGraphNodeSupporter.java
index 5efcc8fa18..0ec0a90032 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/provider/ISDGraphNodeSupporter.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/handlers/provider/ISDGraphNodeSupporter.java
@@ -34,27 +34,27 @@ public interface ISDGraphNodeSupporter {
/**
* Lifeline support ID
*/
- public static int LIFELINE = 0;
+ static int LIFELINE = 0;
/**
* Synchronous message support ID
*/
- public static int SYNCMESSAGE = 1;
+ static int SYNCMESSAGE = 1;
/**
* Synchronous message return support ID
*/
- public static int SYNCMESSAGERETURN = 2;
+ static int SYNCMESSAGERETURN = 2;
/**
* Asynchronous message support ID
*/
- public static int ASYNCMESSAGE = 3;
+ static int ASYNCMESSAGE = 3;
/**
* Asynchronous message return support ID
*/
- public static int ASYNCMESSAGERETURN = 4;
+ static int ASYNCMESSAGERETURN = 4;
/**
* Stop support ID
*/
- public static int STOP = 5;
+ static int STOP = 5;
// ------------------------------------------------------------------------
// Methods
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/load/LoadersManager.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/load/LoadersManager.java
index 713206db40..86fab0a55a 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/load/LoadersManager.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/load/LoadersManager.java
@@ -87,7 +87,7 @@ public class LoadersManager {
*
* @return the manager instance
*/
- public synchronized static LoadersManager getInstance() {
+ public static synchronized LoadersManager getInstance() {
if (fLoadersManager == null) {
fLoadersManager = new LoadersManager();
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
index d55aee7c4d..d514914403 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
@@ -108,15 +108,17 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
/**
* Default title name.
*/
- protected final static String TITLE = Messages.TmfUml2SDSyncLoader_ViewName;
+ protected static final String TITLE = Messages.TmfUml2SDSyncLoader_ViewName;
/**
* Default block size for background request.
*/
- protected final static int DEFAULT_BLOCK_SIZE = 50000;
+ protected static final int DEFAULT_BLOCK_SIZE = 50000;
/**
* Maximum number of messages per page.
*/
- protected final static int MAX_NUM_OF_MSG = 10000;
+ protected static final int MAX_NUM_OF_MSG = 10000;
+
+ private static final int INDEXING_THREAD_SLEEP_VALUE = 100;
// ------------------------------------------------------------------------
// Attributes
@@ -139,7 +141,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
/**
* Flag whether the time range signal was sent by this loader class or not
*/
- volatile protected boolean fIsSignalSent = false;
+ protected volatile boolean fIsSignalSent = false;
// The view and event attributes
/**
@@ -163,7 +165,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
/**
* The current page displayed.
*/
- volatile protected int fCurrentPage = 0;
+ protected volatile int fCurrentPage = 0;
/**
* The current time selected.
*/
@@ -171,7 +173,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
/**
* Flag to specify that selection of message is done by selection or by signal.
*/
- volatile protected boolean fIsSelect = false;
+ protected volatile boolean fIsSelect = false;
// Search attributes
/**
@@ -189,7 +191,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
/**
* The current find index within the list of found nodes (<code>fFindeResults</code> within a page.
*/
- volatile protected int fCurrentFindIndex = 0;
+ protected volatile int fCurrentFindIndex = 0;
// Filter attributes
/**
@@ -1210,7 +1212,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
/**
* The search event request.
*/
- final protected SearchEventRequest fSearchRequest;
+ protected final SearchEventRequest fSearchRequest;
/**
* Constructor
@@ -1296,7 +1298,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
/**
* The find criteria.
*/
- final private Criteria fCriteria;
+ private final Criteria fCriteria;
/**
* A progress monitor
*/
@@ -1421,7 +1423,7 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
protected IStatus run(IProgressMonitor monitor) {
while (!monitor.isCanceled()) {
try {
- Thread.sleep(100);
+ Thread.sleep(INDEXING_THREAD_SLEEP_VALUE);
} catch (InterruptedException e) {
return Status.OK_STATUS;
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/ISDPreferences.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/ISDPreferences.java
index 47c1cc40c4..0b184d59be 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/ISDPreferences.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/ISDPreferences.java
@@ -26,63 +26,63 @@ public interface ISDPreferences {
/**
* The link font with zoom preference name
*/
- public static final String PREF_LINK_FONT = "PREF_LINK_FONT"; //$NON-NLS-1$
+ static final String PREF_LINK_FONT = "PREF_LINK_FONT"; //$NON-NLS-1$
/**
* The exclude preference time preference name
*/
- public static final String PREF_EXCLUDE_EXTERNAL_TIME = "PREF_EXCLUDE_EXTERNAL_TIME"; //$NON-NLS-1$
+ static final String PREF_EXCLUDE_EXTERNAL_TIME = "PREF_EXCLUDE_EXTERNAL_TIME"; //$NON-NLS-1$
/**
* The use gradient color preferences name
*/
- public static final String PREF_USE_GRADIENT = "PREF_USE_GRADIENT"; //$NON-NLS-1$
+ static final String PREF_USE_GRADIENT = "PREF_USE_GRADIENT"; //$NON-NLS-1$
/**
* The lifeline spacing width preference name
*/
- public static final String PREF_LIFELINE_WIDTH = "PREF_LIFELINE_WIDTH"; //$NON-NLS-1$
+ static final String PREF_LIFELINE_WIDTH = "PREF_LIFELINE_WIDTH"; //$NON-NLS-1$
/**
* The time compression bar font preference name
*/
- public static final String PREF_TIME_COMP = "PREF_TIME_COMP"; //$NON-NLS-1$
+ static final String PREF_TIME_COMP = "PREF_TIME_COMP"; //$NON-NLS-1$
/**
* The lifeline font preference name
*/
- public static final String PREF_LIFELINE = "PREF_LIFELINE"; //$NON-NLS-1$
+ static final String PREF_LIFELINE = "PREF_LIFELINE"; //$NON-NLS-1$
/**
* The frame font preference name
*/
- public static final String PREF_FRAME = "PREF_FRAME"; //$NON-NLS-1$
+ static final String PREF_FRAME = "PREF_FRAME"; //$NON-NLS-1$
/**
* The frame name font preference name
*/
- public static final String PREF_FRAME_NAME = "PREF_FRAME_NAME"; //$NON-NLS-1$
+ static final String PREF_FRAME_NAME = "PREF_FRAME_NAME"; //$NON-NLS-1$
/**
* The execution occurrence font preference name
*/
- public static final String PREF_EXEC = "PREF_EXEC"; //$NON-NLS-1$
+ static final String PREF_EXEC = "PREF_EXEC"; //$NON-NLS-1$
/**
* The synchronous message font preference name
*/
- public static final String PREF_SYNC_MESS = "PREF_SYNC_MESS"; //$NON-NLS-1$
+ static final String PREF_SYNC_MESS = "PREF_SYNC_MESS"; //$NON-NLS-1$
/**
* The synchronous message return font preference name
*/
- public static final String PREF_SYNC_MESS_RET = "PREF_SYNC_MESS_RET"; //$NON-NLS-1$
+ static final String PREF_SYNC_MESS_RET = "PREF_SYNC_MESS_RET"; //$NON-NLS-1$
/**
* The asynchronous message font preference name
*/
- public static final String PREF_ASYNC_MESS = "PREF_ASYNC_MESS"; //$NON-NLS-1$
+ static final String PREF_ASYNC_MESS = "PREF_ASYNC_MESS"; //$NON-NLS-1$
/**
* The asynchronous message return font preference name
*/
- public static final String PREF_ASYNC_MESS_RET = "PREF_ASYNC_MESS_RET"; //$NON-NLS-1$
+ static final String PREF_ASYNC_MESS_RET = "PREF_ASYNC_MESS_RET"; //$NON-NLS-1$
/**
* The lifeline header font (header = the always visible part of a lifeline)
*/
- public static final String PREF_LIFELINE_HEADER = "PREF_LIFELINE_HEADER"; //$NON-NLS-1$
+ static final String PREF_LIFELINE_HEADER = "PREF_LIFELINE_HEADER"; //$NON-NLS-1$
/**
* The enable tooltip preference name
*/
- public static final String PREF_TOOLTIP = "PREF_TOOLTIP"; //$NON-NLS-1$
+ static final String PREF_TOOLTIP = "PREF_TOOLTIP"; //$NON-NLS-1$
/**
* Returns the background color for the given preference name (font preference name)
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewerPage.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewerPage.java
index a714467282..344c2f3e00 100755
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewerPage.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/uml2sd/preferences/SDViewerPage.java
@@ -352,20 +352,20 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
* @param toTemp Switch to the temporary preferences
*/
protected void swapPref(boolean toTemp) {
- String TAG1 = "";//$NON-NLS-1$
- String TAG2 = TEMP_TAG;
+ String tag1 = "";//$NON-NLS-1$
+ String tag2 = TEMP_TAG;
if (!toTemp) {
- TAG1 = TEMP_TAG;
- TAG2 = "";//$NON-NLS-1$
+ tag1 = TEMP_TAG;
+ tag2 = "";//$NON-NLS-1$
}
Set<String> keySet = SDViewPref.getInstance().getFontPref().keySet();
Iterator<String> it = keySet.iterator();
while (it.hasNext()) {
Object prefName = it.next();
if (prefName instanceof String) {
- fFont.setPreferenceName((String) prefName + TAG1);
+ fFont.setPreferenceName((String) prefName + tag1);
fFont.load();
- fFont.setPreferenceName((String) prefName + TAG2);
+ fFont.setPreferenceName((String) prefName + tag2);
fFont.store();
}
}
@@ -375,9 +375,9 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
while (it.hasNext()) {
Object prefName = it.next();
if (prefName instanceof String) {
- fBackGroundColor.setPreferenceName((String) prefName + TAG1);
+ fBackGroundColor.setPreferenceName((String) prefName + tag1);
fBackGroundColor.load();
- fBackGroundColor.setPreferenceName((String) prefName + TAG2);
+ fBackGroundColor.setPreferenceName((String) prefName + tag2);
fBackGroundColor.store();
}
}
@@ -387,9 +387,9 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
while (it.hasNext()) {
Object prefName = it.next();
if (prefName instanceof String) {
- fLineColor.setPreferenceName((String) prefName + TAG1);
+ fLineColor.setPreferenceName((String) prefName + tag1);
fLineColor.load();
- fLineColor.setPreferenceName((String) prefName + TAG2);
+ fLineColor.setPreferenceName((String) prefName + tag2);
fLineColor.store();
}
}
@@ -399,9 +399,9 @@ public class SDViewerPage extends PreferencePage implements IWorkbenchPreference
while (it.hasNext()) {
Object prefName = it.next();
if (prefName instanceof String) {
- fTextColor.setPreferenceName((String) prefName + TAG1);
+ fTextColor.setPreferenceName((String) prefName + tag1);
fTextColor.load();
- fTextColor.setPreferenceName((String) prefName + TAG2);
+ fTextColor.setPreferenceName((String) prefName + tag2);
fTextColor.store();
}
}

Back to the top