import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.events.ShellListener;
-//import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
-//import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.graphics.Pattern;
-//import org.eclipse.swt.graphics.Point;
-//import org.eclipse.swt.graphics.Rectangle;
-//import org.eclipse.swt.graphics.Region;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-//import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-//import org.eclipse.swt.widgets.Listener;
-//import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
// Base Composite
private Composite baseComposite;
- // Title bar
- // private Composite titlebarComposite;
- // private Label titleLabel;
- // private DACustomButton minButton;
- // private DACustomButton maxButton;
- // private DACustomButton closeButton;
-
// Toolbar
private Composite toolbarComposite;
private DACustomCombo deviceCombo;
private Composite controlComposite;
private DACustomButton startButton;
- // private Composite timerComposite;
private TimerClock timerClock;
private DACustomButton saveTraceButton;
private DACustomButton openTraceButton;
private static final int TAB_FILE = 2;
private static final int TAB_THREAD = 3; // FIXME
- // Titlebar image
- // private final Image minImage = ImageResources.MIN;
- // private final Image minPushImage = ImageResources.MIN_PUSH;
- // private final Image minHoverImage = ImageResources.MIN_HOVER;
- // private final Image maxImage = ImageResources.MAX;
- // private final Image maxPushImage = ImageResources.MAX_PUSH;
- // private final Image maxHoverImage = ImageResources.MAX_HOVER;
- // private final Image restoreImage = ImageResources.RESTORE;
- // private final Image restorePushImage = ImageResources.RESTORE_PUSH;
- // private final Image restoreHoverImage = ImageResources.RESTORE_HOVER;
- // private final Image closeImage = ImageResources.CLOSE;
- // private final Image closePushImage = ImageResources.CLOSE_PUSH;
- // private final Image closeHoverImage = ImageResources.CLOSE_HOVER;
-
- // Toolbar image
- // private final Image iconImage = ImageResources.ICON;
- private final Image bracketImage = ImageResources.BRACKET;
- private final Image startImage = ImageResources.START;
- private final Image startPushImage = ImageResources.START_PUSH;
- private final Image startHoverImage = ImageResources.START_HOVER;
- private final Image startDisableImage = ImageResources.START_DISABLE;
- private final Image stopImage = ImageResources.STOP;
- private final Image stopPushImage = ImageResources.STOP_PUSH;
- private final Image stopHoverImage = ImageResources.STOP_HOVER;
- private final Image saveImage = ImageResources.SAVE;
- private final Image savePushImage = ImageResources.SAVE_PUSH;
- private final Image saveHoverImage = ImageResources.SAVE_HOVER;
- private final Image saveDisableImage = ImageResources.SAVE_DISABLE;
- private final Image openImage = ImageResources.OPEN;
- private final Image openPushImage = ImageResources.OPEN_PUSH;
- private final Image openHoverImage = ImageResources.OPEN_HOVER;
- private final Image openDisableImage = ImageResources.OPEN_DISABLE;
- private final Image replayImage = ImageResources.REPLAY;
- private final Image replayPushImage = ImageResources.REPLAY_PUSH;
- private final Image replayHoverImage = ImageResources.REPLAY_HOVER;
- private final Image replayDisableImage = ImageResources.REPLAY_DISABLE;
- private final Image settingsImage = ImageResources.SETTINGS;
- private final Image settingsPushImage = ImageResources.SETTINGS_PUSH;
- private final Image settingsHoverImage = ImageResources.SETTINGS_HOVER;
- private final Image settingsDisableImage = ImageResources.SETTINGS_DISABLE;
- private final Image aboutImage = ImageResources.ABOUT;
- private final Image aboutPushImage = ImageResources.ABOUT_PUSH;
- private final Image aboutHoverImage = ImageResources.ABOUT_HOVER;
- private final Image aboutDisableImage = ImageResources.ABOUT_DISABLE;
- private final Image viewSourceImage = ImageResources.VIEW_SOURCE;
- private final Image viewSourcePushImage = ImageResources.VIEW_SOURCE_PUSH;
- private final Image viewSourceHoverImage = ImageResources.VIEW_SOURCE_HOVER;
- private final Image viewSourceToggleImage = ImageResources.VIEW_SOURCE_TOGGLE;
- private final Image viewSourceDisableImage = ImageResources.VIEW_SOURCE_DISABLE;
-
- // Trim image
- // private final Image windowTopFrameImage = ImageResources.WINDOW_TOP;
- // private final Image topImage2 = ImageResources.WINDOW_TOP2;
- // private final Image windowLeftFrameImage = ImageResources.WINDOW_LEFT;
- // private final Image topLeftNormalImage = ImageResources.WINDOW_TOP_LEFT;
- // private final Image topLeftNormalImage2 =
- // ImageResources.WINDOW_TOP_LEFT2;
- // private final Image topLeftMaxImage = ImageResources.WINDOW_TOP_LEFT_MAX;
- // private final Image topRightNormalImage =
- // ImageResources.WINDOW_TOP_RIGHT;
- // private final Image topRightNormalImage2 =
- // ImageResources.WINDOW_TOP_RIGHT2;
- // private final Image topRightMaxImage =
- // ImageResources.WINDOW_TOP_RIGHT_MAX;
- // private final Image bottomLeftNormalImage =
- // ImageResources.WINDOW_BOTTOM_LEFT;
- // private final Image bottomLeftMaxImage =
- // ImageResources.WINDOW_BOTTOM_LEFT_MAX;
- // private final Image bottomRightNormalImage =
- // ImageResources.WINDOW_BOTTOM_RIGHT;
- // private final Image bottomRightMaxImage =
- // ImageResources.WINDOW_BOTTOM_RIGHT_MAX;
- // private final Image windowRightFrameGrayPart =
- // ImageResources.WINDOW_RIGHT_GRAY;
- // private final Image windowRightFrameDartGrayPart =
- // ImageResources.WINDOW_RIGHT_DARKGARY;
- // private final Image windowRightFrameBlackPart =
- // ImageResources.WINDOW_RIGHT_BLACK;
-
// Tab Image
private final Image tabNormalImage = ImageResources.TAB;
private final Image tabPushImage = ImageResources.TAB_PUSH;
private final Image tabHoverImage = ImageResources.TAB_HOVER;
private final Image tabDisableImage = ImageResources.TAB_DISABLE;
- // private Image topLeftImage = topLeftNormalImage;
- // private Image topRightImage = topRightNormalImage;
- // private Image bottomLeftImage = bottomLeftNormalImage;
- // private Image bottomRightImage = bottomRightNormalImage;
-
- // Color
- // private final Color titlebarColor = ColorResources.TITLEBAR_BG_COLOR;
- // private final Color titlebarTextColor =
- // ColorResources.TITLEBAR_TEXT_COLOR;
- //
- // private final Font titlebarTextFont = FontResources.TITLEBAR;
-
private Cursor cursor;
- // private static final int DEFAULT_WIDTH = 1024;
- // private static final int DEFAULT_HEIGHT = 768;
- // private int windowWidth = DEFAULT_WIDTH;
- // private int windowHeight = DEFAULT_HEIGHT;
- // private boolean isMaximized = false;
- // private Point oldSizeOfWindow;
- // private Point oldLocationOfWindow;
-
- // private static final int START = 0;
- // private static final int END = 100;
- // private static final int OFFSET_ZERO = 0;
- // private static final int OFFSET_ONE = 1;
- // private static final int OFFSET_TWO = 2;
- // private static final int OFFSET_THREE = 3;
- // private static final int OFFSET_FOUR = 4;
- // private static final int OFFSET_FIVE = 5;
- // private static final int OFFSET_TEN = 10;
private static final int TIMER_WIDTH = 148;
};
- // private Listener titlebarListener = new Listener() {
- // Point downPt = null;
- // Point downLocation = null;
- //
- // @Override
- // public void handleEvent(Event e) {
- // // Sets start location.
- // if (SWT.MouseDown == e.type && 1 == e.button) {
- // Display display = Display.getCurrent();
- // if (null == display)
- // display = Display.getDefault();
- // downPt = display.getCursorLocation();
- // downLocation = shell.getLocation();
- // }
- //
- // // Handles move of window.
- // if (SWT.MouseMove == e.type && 0 != (e.stateMask & SWT.BUTTON1)) {
- // Display display = Display.getCurrent();
- // if (null == display)
- // display = Display.getDefault();
- // Point p = display.getCursorLocation();
- // shell.setLocation(downLocation.x - (downPt.x - p.x),
- // downLocation.y - (downPt.y - p.y));
- // }
- //
- // // Handles maximization of window.
- // if (SWT.MouseDoubleClick == e.type && 1 == e.button) {
- // handleMaximization();
- // }
- // }
- // };
-
- // public int setCursorStyle(int oldCursorStyle, int width, int height, int
- // x,
- // int y) {
- // int ret = oldCursorStyle;
- //
- // if (x < OFFSET_TEN) {
- // if (y < OFFSET_TEN)
- // ret = SWT.CURSOR_SIZENW;
- // else if (y > (height - OFFSET_TEN))
- // ret = SWT.CURSOR_SIZESW;
- // else
- // ret = SWT.CURSOR_SIZEW;
- // } else if (x > (width - OFFSET_TEN)) {
- // if (y < OFFSET_TEN)
- // ret = SWT.CURSOR_SIZENE;
- // else if (y > (height - OFFSET_TEN))
- // ret = SWT.CURSOR_SIZESE;
- // else
- // ret = SWT.CURSOR_SIZEE;
- // } else {
- // if (y < OFFSET_TEN)
- // ret = SWT.CURSOR_SIZEN;
- // else if (y > (height - OFFSET_TEN))
- // ret = SWT.CURSOR_SIZES;
- // else
- // ;
- // }
-
- // return setCursor(oldCursorStyle, ret);
- // }
public int setCursor(int oldStyle, int newStyle) {
if (oldStyle == newStyle)
return newStyle;
}
- // private Display getDisplay() {
- // Display display = Display.getCurrent();
- // if (null == display)
- // display = Display.getDefault();
- // return display;
- // }
-
- // public void resizeWindow(Rectangle downRect, Point oldPoint,
- // Point newPoint, int cursorStyle) {
- // Rectangle newRect = new Rectangle(downRect.x, downRect.y,
- // downRect.width, downRect.height);
- //
- // if (oldPoint == null || newPoint == null)
- // return;
- //
- // switch (cursorStyle) {
- // case SWT.CURSOR_SIZEN:
- // newRect.y -= (oldPoint.y - newPoint.y);
- // newRect.height += (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZENW:
- // newRect.x -= (oldPoint.x - newPoint.x);
- // newRect.y -= (oldPoint.y - newPoint.y);
- // newRect.width += (oldPoint.x - newPoint.x);
- // newRect.height += (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZENE:
- // newRect.y -= (oldPoint.y - newPoint.y);
- // newRect.width -= (oldPoint.x - newPoint.x);
- // newRect.height += (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZES:
- // newRect.height -= (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZESW:
- // newRect.x -= (oldPoint.x - newPoint.x);
- // newRect.width += (oldPoint.x - newPoint.x);
- // newRect.height -= (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZESE:
- // newRect.width -= oldPoint.x - newPoint.x;
- // newRect.height -= (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZEW:
- // newRect.x -= (oldPoint.x - newPoint.x);
- // newRect.width += (oldPoint.x - newPoint.x);
- // break;
- // case SWT.CURSOR_SIZEE:
- // newRect.width -= (oldPoint.x - newPoint.x);
- // break;
- // default:
- // return;
- // }
- //
- // if (newRect.height < 400 || newRect.width < 600)
- // return;
- // windowHeight = newRect.height;
- // windowWidth = newRect.width;
- // shell.setBounds(newRect);
- // }
-
- // private Listener trimListener = new Listener() {
- // int cursorStyle;
- // Point downPoint = null;
- // boolean isPatternInit = false;
- // Pattern topP = null;
- // Pattern leftP = null;
- // Pattern grayP = null;
- // Pattern darkGrayP = null;
- // Pattern blackP = null;
- // Rectangle downRect = null;
- // Display display = null;
- //
- // boolean isMouseDown = false;
- //
- // @Override
- // public void handleEvent(Event e) {
- // int x = e.x;
- // int y = e.y;
- //
- // // Sets start location.
- // if (SWT.MouseDown == e.type && 1 == e.button) {
- // isMouseDown = true;
- // if (null == display) {public void resizeWindow(Rectangle downRect, Point
- // oldPoint,
- // Point newPoint, int cursorStyle) {
- // Rectangle newRect = new Rectangle(downRect.x, downRect.y,
- // downRect.width, downRect.height);
- //
- // if (oldPoint == null || newPoint == null)
- // return;
- //
- // switch (cursorStyle) {
- // case SWT.CURSOR_SIZEN:
- // newRect.y -= (oldPoint.y - newPoint.y);
- // newRect.height += (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZENW:
- // newRect.x -= (oldPoint.x - newPoint.x);
- // newRect.y -= (oldPoint.y - newPoint.y);
- // newRect.width += (oldPoint.x - newPoint.x);
- // newRect.height += (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZENE:
- // newRect.y -= (oldPoint.y - newPoint.y);
- // newRect.width -= (oldPoint.x - newPoint.x);
- // newRect.height += (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZES:
- // newRect.height -= (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZESW:
- // newRect.x -= (oldPoint.x - newPoint.x);
- // newRect.width += (oldPoint.x - newPoint.x);
- // newRect.height -= (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZESE:
- // newRect.width -= oldPoint.x - newPoint.x;
- // newRect.height -= (oldPoint.y - newPoint.y);
- // break;
- // case SWT.CURSOR_SIZEW:
- // newRect.x -= (oldPoint.x - newPoint.x);
- // newRect.width += (oldPoint.x - newPoint.x);
- // break;
- // case SWT.CURSOR_SIZEE:
- // newRect.width -= (oldPoint.x - newPoint.x);
- // break;
- // default:
- // return;
- // }
- //
- // if (newRect.height < 400 || newRect.width < 600)
- // return;
- // windowHeight = newRect.height;
- // windowWidth = newRect.width;
- // shell.setBounds(newRect);
- // }
- // display = getDisplay();
- // }
- // downPoint = display.getCursorLocation();
- // downRect = shell.getBounds();
- // }
- //
- // // Sets mouse moving state.
- // if (SWT.MouseUp == e.type) {
- // if (null == display) {
- // display = getDisplay();
- // }
- // Point p = display.getCursorLocation();
- // resizeWindow(downRect, downPoint, p, cursorStyle);
- // isMouseDown = false;
- // }
- //
- // if (SWT.MouseMove == e.type) {
- // if (false == isMouseDown) {
- // cursorStyle = setCursorStyle(cursorStyle, windowWidth,
- // windowHeight, x, y);
- // } else {
- // if (null == display) {
- // display = getDisplay();
- // }
- // Point p = display.getCursorLocation();
- // resizeWindow(downRect, downPoint, p, cursorStyle);
- // }
- // }
- // if (SWT.MouseEnter == e.type) {
- // }
- // if (SWT.MouseExit == e.type) {
- // cursorStyle = setCursor(cursorStyle, SWT.CURSOR_ARROW);
- // }
- //
- // if (SWT.MouseHover == e.type) {
- // if (true == isMouseDown) {
- // if (null == display) {
- // display = getDisplay();
- // }
- // Point p = display.getCursorLocation();
- // resizeWindow(downRect, downPoint, p, cursorStyle);
- // }
- // }
- // // Draws trim image.
- // if (SWT.Paint == e.type) {
- // // Draws top trim.
- // if (false == isPatternInit) {
- // topP = new Pattern(shell.getDisplay(), windowTopFrameImage);
- //
- // leftP = new Pattern(shell.getDisplay(),
- // windowLeftFrameImage);
- //
- // grayP = new Pattern(shell.getDisplay(),
- // windowRightFrameGrayPart);
- //
- // darkGrayP = new Pattern(shell.getDisplay(),
- // windowRightFrameDartGrayPart);
- //
- // blackP = new Pattern(shell.getDisplay(),
- // windowRightFrameBlackPart);
- //
- // isPatternInit = true;
- // }
- // e.gc.setBackgroundPattern(topP);
- // e.gc.fillRectangle(
- // DesignConstants.WINDOW_FRAME_LEFT_MARGIN,
- // 0,
- // windowWidth
- // - (DesignConstants.WINDOW_FRAME_LEFT_MARGIN +
- // DesignConstants.WINDOW_FRAME_RIGHT_MARGIN),
- // DesignConstants.WINDOW_FRAME_TOP_MARGIN);
- //
- // // Draws left trim.
- // e.gc.setBackgroundPattern(leftP);
- // e.gc.fillRectangle(
- // 0,
- // DesignConstants.WINDOW_FRAME_TOP_MARGIN
- // + DesignConstants.TITLEBAR_HEIGHT,
- // DesignConstants.WINDOW_FRAME_LEFT_MARGIN,
- // windowHeight
- // - (DesignConstants.WINDOW_FRAME_TOP_MARGIN
- // + DesignConstants.TITLEBAR_HEIGHT +
- // DesignConstants.WINDOW_FRAME_BOTTOM_MARGIN));
- // // pattern.dispose();
- //
- // // Draws right trim.
- // e.gc.setBackgroundPattern(grayP);
- // e.gc.fillRectangle(
- // windowWidth - DesignConstants.WINDOW_FRAME_RIGHT_MARGIN,
- // DesignConstants.WINDOW_FRAME_TOP_MARGIN
- // + DesignConstants.TITLEBAR_HEIGHT,
- // DesignConstants.WINDOW_FRAME_PART_SIZE,
- // windowHeight
- // - (DesignConstants.TITLEBAR_HEIGHT
- // + DesignConstants.WINDOW_FRAME_TOP_MARGIN +
- // DesignConstants.WINDOW_FRAME_BOTTOM_MARGIN));
- //
- // e.gc.setBackgroundPattern(darkGrayP);
- // e.gc.fillRectangle(
- // windowWidth - DesignConstants.WINDOW_FRAME_RIGHT_MARGIN
- // + DesignConstants.WINDOW_FRAME_PART_SIZE,
- // DesignConstants.WINDOW_FRAME_TOP_MARGIN
- // + DesignConstants.TITLEBAR_HEIGHT,
- // DesignConstants.WINDOW_FRAME_PART_SIZE * 2,
- // windowHeight
- // - (DesignConstants.TITLEBAR_HEIGHT
- // + DesignConstants.WINDOW_FRAME_TOP_MARGIN +
- // DesignConstants.WINDOW_FRAME_BOTTOM_MARGIN));
- //
- // e.gc.setBackgroundPattern(grayP);
- // e.gc.fillRectangle(
- // windowWidth - DesignConstants.WINDOW_FRAME_PART_SIZE
- // * 2,
- // DesignConstants.WINDOW_FRAME_TOP_MARGIN
- // + DesignConstants.TITLEBAR_HEIGHT,
- // DesignConstants.WINDOW_FRAME_PART_SIZE,
- // windowHeight
- // - (DesignConstants.TITLEBAR_HEIGHT
- // + DesignConstants.WINDOW_FRAME_TOP_MARGIN +
- // DesignConstants.WINDOW_FRAME_BOTTOM_MARGIN));
- //
- // e.gc.setBackgroundPattern(blackP);
- // e.gc.fillRectangle(
- // windowWidth - DesignConstants.WINDOW_FRAME_PART_SIZE,
- // DesignConstants.WINDOW_FRAME_TOP_MARGIN
- // + DesignConstants.TITLEBAR_HEIGHT,
- // DesignConstants.WINDOW_FRAME_PART_SIZE,
- // windowHeight
- // - (DesignConstants.TITLEBAR_HEIGHT
- // + DesignConstants.WINDOW_FRAME_TOP_MARGIN +
- // DesignConstants.WINDOW_FRAME_BOTTOM_MARGIN));
- //
- // // Draws bottom trim.
- // e.gc.setBackgroundPattern(grayP);
- // e.gc.fillRectangle(OFFSET_FIVE, windowHeight - OFFSET_FIVE,
- // windowWidth - OFFSET_TEN, OFFSET_ONE);
- //
- // e.gc.setBackgroundPattern(darkGrayP);
- // e.gc.fillRectangle(OFFSET_FIVE, windowHeight - OFFSET_FOUR,
- // windowWidth - OFFSET_TEN, OFFSET_TWO);
- //
- // e.gc.setBackgroundPattern(grayP);
- // e.gc.fillRectangle(OFFSET_FIVE, windowHeight - OFFSET_TWO,
- // windowWidth - OFFSET_TEN, OFFSET_ONE);
- //
- // e.gc.setBackgroundPattern(blackP);
- // e.gc.fillRectangle(OFFSET_FIVE, windowHeight - OFFSET_ONE,
- // windowWidth - OFFSET_TEN, OFFSET_ONE);
- //
- // // pattern.dispose();
- //
- // // Draws corner trim.
- // e.gc.drawImage(topLeftImage, START, START);
- // e.gc.drawImage(topLeftNormalImage2, START, OFFSET_FIVE);
- // e.gc.drawImage(topRightImage, windowWidth - OFFSET_FIVE, START);
- // e.gc.drawImage(topRightNormalImage2, windowWidth - OFFSET_FIVE,
- // OFFSET_FIVE);
- // e.gc.drawImage(bottomLeftImage, START, windowHeight
- // - OFFSET_FIVE);
- // e.gc.drawImage(bottomRightImage, windowWidth - OFFSET_FIVE,
- // windowHeight - OFFSET_FIVE);
- //
- // // Sets region.
- // setShellRegion();
- // }
- // }
- // };
-
private CoolbarArea(IWorkbenchWindowConfigurer configurer, Shell sh) {
shell = sh;
final FormLayout layout = new FormLayout();
baseComposite.setLayout(layout);
- // Creates title bar.
- // titlebarComposite = new Composite(baseComposite, SWT.NONE);
- // titlebarComposite.setLayout(layout);
- // titlebarComposite.addPaintListener(new PaintListener() {
- // @Override
- // public void paintControl(PaintEvent e) {
- // // Draws titlebar background.
- // Pattern pattern = new Pattern(shell.getDisplay(), topImage2);
- // e.gc.setBackgroundPattern(pattern);
- // e.gc.fillRectangle(START, START,
- // titlebarComposite.getBounds().width,
- // titlebarComposite.getBounds().height);
- // pattern.dispose();
- // }
- // });
- //
- // createTitlebar(titlebarComposite);
-
final FormLayout formLayout = new FormLayout();
formLayout.marginWidth = 0;
// Sets layout data.
Control page = configurer.createPageComposite(baseComposite);
- // FormData data = new FormData();
- // data.top = new FormAttachment(START, 0);
- // data.left = new FormAttachment(START, 0);
- // data.right = new FormAttachment(END, -0);
- // data.height = DesignConstants.TITLEBAR_HEIGHT;
- // titlebarComposite.setLayoutData(data);
-
FormData data = new FormData();
data.top = new FormAttachment(0, 0);
data.left = new FormAttachment(0, 0);
data.top = new FormAttachment(toolbarComposite, 0, SWT.BOTTOM);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
- // data.bottom = new FormAttachment(toolbarComposite, 25, SWT.BOTTOM);
lineComposite.setLayoutData(data);
data = new FormData();
// Adds listeners.
shell.addShellListener(shellListener);
- // addTitlebarAndShellListeners();
}
- // private void addTitlebarListeners() {
- // minButton.addClickListener(new DACustomButtonClickEventListener() {
- //
- // @Override
- // public void handleClickEvent(DACustomButton button) {
- // shell.setMinimized(true);
- // }
- // });
-
- // maxButton.addClickListener(new DACustomButtonClickEventListener() {
- //
- // @Override
- // public void handleClickEvent(DACustomButton button) {
- // handleMaximization();
- // }
- //
- // });
-
- // closeButton.addClickListener(new DACustomButtonClickEventListener() {
- //
- // @Override
- // public void handleClickEvent(DACustomButton button) {
- // PlatformUI.getWorkbench().close();
- // }
- // });
- // }
-
public void setRepalyButtonEnable(boolean enabled) {
Project p = AnalyzerManager.getProject();
if (null == p || !enabled) {
if (state.equals(RecordStateSourceProvider.RECORD_READY)) {
AnalyzerUtil
.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
- button.setImage(DACustomButton.STATE_HOVER, stopHoverImage);
- // button.setHoverImage(stopHoverImage);
+ button.setImage(DACustomButton.STATE_HOVER, ImageResources.STOP_HOVER);
setStartToolbarState(true);
- // timerClock.start();
setToolbarEnablement(false);
ResourceCommunicator.changePage(0);
} else {
AnalyzerUtil
.setRecordState(RecordStateSourceProvider.RECORD_READY);
- // button.setHoverImage(startHoverImage);
- button.setImage(DACustomButton.STATE_HOVER, startHoverImage);
+ button.setImage(DACustomButton.STATE_HOVER, ImageResources.START_HOVER);
setStartToolbarState(false);
- // timerClock.stop();
setToolbarEnablement(true);
StateManager.getInstance().StopProcessStart(
"stop button pressed");
if (AnalyzerUtil.executeCommand(ReplayTraceHandler.ID) != ReplayTraceHandler.FAILED) {
AnalyzerUtil
.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
- // startButton.setNormalImage(stopImage);
startButton.setImage(DACustomButton.STATE_NORMAL,
- stopImage);
+ ImageResources.STOP);
startButton.setToolTipText(AnalyzerLabels.STOP_TRACE);
setStartToolbarState(true);
timerClock.start();
public void handleClickEvent(DACustomButton button) {
DACustomToggleButton toggle = (DACustomToggleButton) button;
- // sourceViewToggleState = !sourceViewToggleState;
- // viewSourceButton.setToggled(sourceViewToggleState);
-
AnalyzerManager.getCurrentPage().setSourceView(
toggle.isToggled());
// }
}
});
-
- // tutorialButton.addListener(SWT.MouseDown, new Listener() {
- // @Override
- // public void handleEvent(Event event) {
- // TutorialDialog dialog = new TutorialDialog(shell);
- // dialog.open();
- //
- // Shell tip = new Shell(shell, SWT.TOOL);
- // tip.setBounds(100, 100, 100, 100);
- // tip.setVisible(true);
- // }
- // });
-
}
- // private void addTitlebarAndShellListeners() {
- // titlebarComposite.addListener(SWT.MouseDoubleClick, titlebarListener);
- // titleLabel.addListener(SWT.MouseDoubleClick, titlebarListener);
- // shell.addListener(SWT.Paint, trimListener);
- // addTitlebarAndShellMouseListeners();
- // }
-
- // private void addTitlebarAndShellMouseListeners() {
- // titlebarComposite.addListener(SWT.MouseDown, titlebarListener);
- // titlebarComposite.addListener(SWT.MouseMove, titlebarListener);
- // titleLabel.addListener(SWT.MouseDown, titlebarListener);
- // titleLabel.addListener(SWT.MouseMove, titlebarListener);
- // shell.addListener(SWT.MouseDown, trimListener);
- // shell.addListener(SWT.MouseMove, trimListener);
- // shell.addListener(SWT.MouseUp, trimListener);
- // shell.addListener(SWT.MouseHover, trimListener);
- // shell.addListener(SWT.MouseEnter, trimListener);
- // shell.addListener(SWT.MouseExit, trimListener);
- //
- // }
-
- // TODO Remove or modify.
- // private void createCategoryMenu() {
- // // Creates menu.
- // categoryMenu = new Menu(shell, SWT.POP_UP);
- //
- // // Creates menu items.
- // realtimeMenuItem = new MenuItem(categoryMenu, SWT.PUSH);
- // realtimeMenuItem.setText(AnalyzerLabels.REALTIME);
- // batteryMenuItem = new MenuItem(categoryMenu, SWT.PUSH);
- // batteryMenuItem.setText(AnalyzerLabels.BATTERY);
- //
- // // Adds menu item listeners.
- // realtimeMenuItem.addListener(SWT.Selection, new Listener() {
- // @Override
- // public void handleEvent(Event event) {
- // categoryLabel.setText(AnalyzerLabels.REALTIME);
- // categoryLabel.setToolTipText(AnalyzerLabels.REALTIME);
- // categoryButton.setToolTipText(AnalyzerLabels.REALTIME);
- //
- // setCoolbarLayout(CATEGORY_REALTIME);
- //
- // AnalyzerUtil.executeCommand(RealtimePerspectiveHandler.ID);
- // }
- // });
- //
- // batteryMenuItem.addListener(SWT.Selection, new Listener() {
- // @Override
- // public void handleEvent(Event event) {
- // categoryLabel.setText(AnalyzerLabels.BATTERY);
- // categoryLabel.setToolTipText(AnalyzerLabels.BATTERY);
- // categoryButton.setToolTipText(AnalyzerLabels.BATTERY);
- //
- // setCoolbarLayout(CATEGORY_BATTERY);
- //
- // AnalyzerUtil.executeCommand(BatteryPerspectiveHandler.ID);
- // }
- // });
- // }
-
- // private void createTitlebar(Composite parent) {
- // // Creates icon label.
- // Label iconLabel = new Label(parent, SWT.NONE);
- // iconLabel.setImage(iconImage);
- //
- // // Set layout
- // FormData data = new FormData();
- // data.top = new FormAttachment(0, 2);
- // data.left = new FormAttachment(0, 5);
- // iconLabel.setLayoutData(data);
- //
- // // Creates title label.
- // titleLabel = new Label(parent, SWT.TRANSPARENT);
- // titleLabel.setBackground(titlebarColor);
- // titleLabel.setForeground(titlebarTextColor);
- // titleLabel.setFont(titlebarTextFont);
- // titleLabel.setText(AnalyzerLabels.DYNAMIC_ANALYZER);
- // // set layout
- // data = new FormData();
- // data.top = new FormAttachment(0, 3);
- // data.left = new FormAttachment(iconLabel, 4);
- // titleLabel.setLayoutData(data);
- //
- // // Creates button composite
- // // which contains category combo, min, max and exit buttons.
- // Composite buttonComposite = new Composite(parent, SWT.NONE);
- // buttonComposite.setLayout(new FormLayout());
- // buttonComposite.setBackground(titlebarColor);
- //
- // // Creates minimization button.
- // minButton = new DACustomButton(buttonComposite, minImage, minPushImage,
- // minHoverImage, null);
- // minButton.setToolTipText(AnalyzerLabels.MIN);
- //
- // // Creates maximization button.
- // maxButton = new DACustomButton(buttonComposite, maxImage, maxPushImage,
- // maxHoverImage, null);
- // maxButton.setToolTipText(AnalyzerLabels.MAX);
- //
- // // Creates exit button.
- // closeButton = new DACustomButton(buttonComposite, closeImage,
- // closePushImage, closeHoverImage, null);
- // closeButton.setToolTipText(AnalyzerLabels.CLOSE);
- //
- // data = new FormData();
- // data.top = new FormAttachment(0, 0);
- // data.right = new FormAttachment(100, 0);
- // data.bottom = new FormAttachment(100, -5);
- // buttonComposite.setLayoutData(data);
- //
- // data = new FormData();
- // data.top = new FormAttachment(0, 2);
- // data.height = 18;
- // data.width = 28;
- // minButton.setLayoutData(data);
- //
- // data = new FormData();
- // data.top = new FormAttachment(0, 2);
- // data.left = new FormAttachment(minButton, 0, SWT.RIGHT);
- // data.height = 18;
- // data.width = 27;
- // maxButton.setLayoutData(data);
- //
- // data = new FormData();
- // data.top = new FormAttachment(0, 2);
- // data.left = new FormAttachment(maxButton, 0, SWT.RIGHT);
- // data.height = 18;
- // data.width = 46;
- // closeButton.setLayoutData(data);
- //
- // // Adds title bar listeners.
- // addTitlebarListeners();
- // }
-
private void createToolbar(Composite parent) {
// Creates control composite
controlComposite.setLayout(new FormLayout());
// Creates start button.
- startButton = new DACustomButton(controlComposite, startImage,
- startPushImage, startHoverImage, startDisableImage);
+ startButton = new DACustomButton(controlComposite, ImageResources.START,
+ ImageResources.START_PUSH, ImageResources.START_HOVER, ImageResources.START_DISABLE);
startButton.setEnabled(false);
startButton.setToolTipText(AnalyzerLabels.START_TRACE);
// Creates TimerClock widget.
- // timerComposite = new Composite(controlComposite, SWT.NONE);
- // timerClock = new TimerClock(timerComposite);
timerClock = new TimerClock(controlComposite, SWT.NONE);
timerClock.setBgImage(ImageResources.TIMER);
timerClock.setFont(FontResources.TIMER);
// // Creates save trace button.
- saveTraceButton = new DACustomButton(controlComposite, saveImage,
- savePushImage, saveHoverImage, saveDisableImage);
+ saveTraceButton = new DACustomButton(controlComposite, ImageResources.SAVE,
+ ImageResources.SAVE_PUSH, ImageResources.SAVE_HOVER, ImageResources.SAVE_DISABLE);
saveTraceButton.setEnabled(false);
saveTraceButton.setToolTipText(AnalyzerLabels.SAVE_TRACE);
// // Creates open trace button.
- openTraceButton = new DACustomButton(controlComposite, openImage,
- openPushImage, openHoverImage, openDisableImage);
+ openTraceButton = new DACustomButton(controlComposite, ImageResources.OPEN,
+ ImageResources.OPEN_PUSH, ImageResources.OPEN_HOVER, ImageResources.OPEN_DISABLE);
openTraceButton.setToolTipText(AnalyzerLabels.OPEN_TRACE);
// Creates replay button.
- replayButton = new DACustomButton(controlComposite, replayImage,
- replayPushImage, replayHoverImage, replayDisableImage);
+ replayButton = new DACustomButton(controlComposite, ImageResources.REPLAY,
+ ImageResources.REPLAY_PUSH, ImageResources.REPLAY_HOVER, ImageResources.REPLAY_DISABLE);
replayButton.setToolTipText(AnalyzerLabels.REPLAY);
// Creates pickaxe composite.
sourceViewComposite.setLayout(new FormLayout());
// Creates about button.
- settingsButton = new DACustomButton(sourceViewComposite, settingsImage,
- settingsPushImage, settingsHoverImage, settingsDisableImage);
+ settingsButton = new DACustomButton(sourceViewComposite, ImageResources.SETTINGS,
+ ImageResources.SETTINGS_PUSH, ImageResources.SETTINGS_HOVER, ImageResources.SETTINGS_DISABLE);
settingsButton.setToolTipText(AnalyzerLabels.SETTING);
- aboutButton = new DACustomButton(sourceViewComposite, aboutImage,
- aboutPushImage, aboutHoverImage, aboutDisableImage);
+ aboutButton = new DACustomButton(sourceViewComposite, ImageResources.ABOUT,
+ ImageResources.ABOUT_PUSH, ImageResources.ABOUT_HOVER, ImageResources.ABOUT_DISABLE);
aboutButton.setToolTipText(AnalyzerLabels.ABOUT);
// Creates pickaxe button.
viewSourceButton = new DACustomToggleButton(sourceViewComposite,
- viewSourceImage, viewSourcePushImage, viewSourceHoverImage,
- viewSourceDisableImage, viewSourceToggleImage);
- // viewSourceButton.setImage(viewSourceImage);
+ ImageResources.VIEW_SOURCE, ImageResources.VIEW_SOURCE_PUSH, ImageResources.VIEW_SOURCE_HOVER,
+ ImageResources.VIEW_SOURCE_DISABLE, ImageResources.VIEW_SOURCE_TOGGLE);
viewSourceButton.setToolTipText(AnalyzerLabels.VIEW_SOURCE);
- // tutorialButton = new Label(pickaxeComposite, SWT.NONE);
- // tutorialButton.setForeground(whiteColor);
- // tutorialButton.setText("Tutorial");
-
FormData data = new FormData();
data.top = new FormAttachment(0, 4);
data.left = new FormAttachment(0, 345);
deviceCombo.setButtonRenderer(new ComboButtonRenderer());
Label bracketLabel = new Label(parent, SWT.CENTER | SWT.TRANSPARENT);
- bracketLabel.setImage(bracketImage);
+ bracketLabel.setImage(ImageResources.BRACKET);
// Creates application combo.
appCombo = new DACustomCombo(parent, SWT.NONE);
whiteLine.setBackground(ColorResources.WHITE);
whiteLine.setLayout(new FillLayout());
- // networkPage = new Button(pages,
- // tabNormalImage,tabPushImage,tabHoverImage,tabDisableImage);
- // networkPage.setForeground(ColorResources.WHITE);
- // networkPage.setText("Network");
- //
- // eflPage = new Button(pages,
- // tabNormalImage,tabPushImage,tabHoverImage,tabDisableImage);
- // eflPage.setForeground(ColorResources.WHITE);
- // eflPage.setText("EFL");
-
FormData data = new FormData();
data.left = new FormAttachment(0, 0);
data.width = PAGE_BUTTON_WIDTH;
data.bottom = new FormAttachment(100, 0);
data.height = 1;
whiteLine.setLayoutData(data);
-
- // data = new FormData();
- // data.left = new FormAttachment(pageTab.get(TAB_FILE), 0);
- // data.width = PAGE_BUTTON_WIDTH;
- // data.height = PAGE_BUTTON_HEIGHT;
- // networkPage.setLayoutData(data);
-
- // data = new FormData();
- // data.left = new FormAttachment(networkPage, 0);
- // data.width = PAGE_BUTTON_WIDTH;
- // data.height = PAGE_BUTTON_HEIGHT;
- // eflPage.setLayoutData(data);
}
// tab, set selection
// Removes listeners.
shell.removeShellListener(shellListener);
- // removeTitlebarAndShellListeners();
}
public long getTime() {
timerClock.setTime(time);
}
- // private Monitor findMaximizeTargetMonitor() {
- // int ret = -1;
- // int area = 0;
- //
- // Rectangle shellRect = shell.getBounds();
- // Rectangle monitorRect = null;
- // Rectangle intersectRect = null;
- //
- // Monitor[] monitors = PlatformUI.getWorkbench().getDisplay()
- // .getMonitors();
- //
- // for (int i = 0; i < monitors.length; i++) {
- // monitorRect = monitors[i].getBounds();
- // intersectRect = monitorRect.intersection(shellRect);
- // int interArea = intersectRect.width * intersectRect.height;
- // if (area < interArea) {
- // area = interArea;
- // ret = i;
- // }
- // }
- //
- // if (-1 != ret)
- // return monitors[ret];
- // else
- // return null;
- // }
-
- // private void handleMaximization() {
- // if (isMaximized) {
- // isMaximized = false;
- // windowWidth = oldSizeOfWindow.x;
- // windowHeight = oldSizeOfWindow.y;
- // // shell.setBounds(100,100,windowWidth,windowHeight);
- // shell.setLocation(oldLocationOfWindow);
- // shell.setSize(oldSizeOfWindow);
- //
- // // Sets trim corner image.
- // topLeftImage = topLeftNormalImage;
- // topRightImage = topRightNormalImage;
- // bottomLeftImage = bottomLeftNormalImage;
- // bottomRightImage = bottomRightNormalImage;
- //
- // setMaxButtonState(isMaximized);
- //
- // maxButton.setToolTipText(AnalyzerLabels.MAX);
- //
- // // Adds mouse listeners.
- // // addTitlebarAndShellMouseListeners();
- // } else {
- // isMaximized = true;
- // oldSizeOfWindow = shell.getSize();
- // oldLocationOfWindow = shell.getLocation();
- //
- // Monitor mon = findMaximizeTargetMonitor();
- // Rectangle clientRectangle = mon.getBounds();
- // Rectangle rectangle = mon.getClientArea();
- // if (rectangle.width < clientRectangle.width) {
- // windowWidth = rectangle.width - clientRectangle.x;
- // windowHeight = rectangle.height - clientRectangle.y;
- // shell.setSize(windowWidth, windowHeight);
- // shell.setLocation(rectangle.x + clientRectangle.x, rectangle.y
- // + clientRectangle.y);
- // } else {
- // windowWidth = clientRectangle.width;
- // windowHeight = clientRectangle.height;
- // shell.setSize(windowWidth, windowHeight);
- // shell.setLocation(clientRectangle.x, clientRectangle.y);
- // }
- //
- // // Sets max width and height.
- // // int midX = shell.getLocation().x + (oldSizeOfWindow.x / 2);
- // // Monitor[] monitors = PlatformUI.getWorkbench().getDisplay()
- // // .getMonitors();
- // // int monitorsLength = monitors.length;
- // //
- // //
- // // Rectangle clientRectangle = null;
- // // Rectangle rectangle = null;
- // // for (int i = 0; i < monitorsLength; i++) {
- // // rectangle = monitors[i].getBounds();
- // // clientRectangle = monitors[i].getClientArea();
- // // // for ubuntu getClientArea bug FIXME
- // // if(rectangle.width < clientRectangle.width){
- // // if (rectangle.x < midX && rectangle.x + rectangle.width > midX) {
- // // break;
- // // }
- // // }
- // // if (rectangle.x < midX && rectangle.x + rectangle.width > midX) {
- // // break;
- // // }
- // // }
- // // windowWidth = rectangle.width;
- // // windowHeight = rectangle.height;
- // // shell.setSize(windowWidth, windowHeight);
- // // shell.setLocation(rectangle.x, rectangle.y);
- //
- // // Sets trim corner image.
- // topLeftImage = topLeftMaxImage;
- // topRightImage = topRightMaxImage;
- // bottomLeftImage = bottomLeftMaxImage;
- // bottomRightImage = bottomRightMaxImage;
- //
- // setMaxButtonState(isMaximized);
- //
- // maxButton.setToolTipText(AnalyzerLabels.RESTORE);
- //
- // // Removes mouse listeners.
- // // removeTitlebarAndShellMouseListeners();
- // }
- // }
-
private void initAppCombo() {
String device = deviceCombo.getText();
if (device.isEmpty()) {
return;
}
- // appCombo.removeAll();
appCombo.initCombo();
int size = apps.size();
for (int i = 0; i < size; i++) {
}
public void initToolbarEnablement() {
- // deviceCombo.removeAll();
- // deviceCombo.add(AnalyzerConstants.EMPTY);
deviceCombo.initCombo();
- // appCombo.removeAll();
appCombo.initCombo();
startButton.setEnabled(false);
replayButton.setEnabled(false);
saveTraceButton.setEnabled(false);
}
- // private void removeTitlebarAndShellListeners() {
- // titlebarComposite
- // .removeListener(SWT.MouseDoubleClick, titlebarListener);
- // titleLabel.removeListener(SWT.MouseDoubleClick, titlebarListener);
- // shell.removeListener(SWT.Paint, trimListener);
- // removeTitlebarAndShellMouseListeners();
- // }
-
- // private void removeTitlebarAndShellMouseListeners() {
- // titlebarComposite.removeListener(SWT.MouseDown, titlebarListener);
- // titlebarComposite.removeListener(SWT.MouseMove, titlebarListener);
- // titleLabel.removeListener(SWT.MouseDown, titlebarListener);
- // titleLabel.removeListener(SWT.MouseMove, titlebarListener);
- // shell.removeListener(SWT.MouseDown, trimListener);
- // shell.removeListener(SWT.MouseMove, trimListener);
- // shell.removeListener(SWT.MouseUp, trimListener);
- // shell.removeListener(SWT.MouseHover, trimListener);
- // shell.removeListener(SWT.MouseExit, trimListener);
- // }
-
public void setDeviceComboItems(List<String> items) {
- // deviceCombo.removeAll();
deviceCombo.initCombo();
if (items.isEmpty()) {
deviceCombo.add(AnalyzerConstants.EMPTY);
deviceCombo.select(0);
- // appCombo.removeAll();
- // appCombo.add(AnalyzerConstants.EMPTY);
- // appCombo.select(0);
appCombo.initCombo();
appCombo.setEnabled(false);
setRepalyButtonEnable(false);
}
public void setAppComboItems(List<String> items) {
- // appCombo.removeAll();
appCombo.initCombo();
if (null == items) {
- // appCombo.add(AnalyzerConstants.EMPTY);
- // appCombo.select(0);
return;
}
int itemsSize = items.size();
if (0 != itemsSize) {
- // appCombo.removeAll();
appCombo.initCombo();
for (int i = 0; i < itemsSize; i++) {
appCombo.add(items.get(i));
deviceCombo.setText(text);
}
- // TODO Remove or modify.
- // private void setCoolbarLayout(int categoryIndex) {
- // boolean visibility = true;
- // if (CATEGORY_REALTIME == categoryIndex) { // Realtime category
- // visibility = true;
- // } else if (CATEGORY_BATTERY == categoryIndex) { // Battery category
- // visibility = false;
- // }
- //
- // replayButton.setVisible(visibility);
- // sourceViewButton.setVisible(visibility);
- // }
-
- // private void setMaxButtonState(boolean isMaximized) {
- // if (isMaximized) {
- //
- // // maxButton.setImage(restoreImage);
- // maxButton.setImages(restoreImage, restorePushImage,
- // restoreHoverImage, null);
- // // maxButton.setNormalImage(restoreImage);
- // // maxButton.setPushImage(restorePushImage);
- // // maxButton.setHoverImage(restoreHoverImage);
- // } else {
- // // maxButton.setImage(maxImage);
- // maxButton.setImages(maxImage, maxPushImage, maxHoverImage, null);
- // // maxButton.setNormalImage(maxImage);
- // // maxButton.setPushImage(maxPushImage);
- // // maxButton.setHoverImage(maxHoverImage);
- // }
- // }
-
- // private void setShellRegion() {
- // Region shellRegion = new Region();
- //
- // // Adds total region.
- // shellRegion.add(new Rectangle(0, 0, windowWidth, windowHeight));
- //
- // if (!isMaximized) {
- // int offset = 2;
- // if (AnalyzerUtil.isWin()) {
- // offset = 2;
- // } else if (AnalyzerUtil.isLinux()) {
- // offset = 2;
- // }
- //
- // // Subtracts top left corner region.
- // for (int i = 0; i < offset; i++) {
- // shellRegion.subtract(0, i, offset - i, 1);
- // }
- // // Subtracts top right corner region.
- // for (int i = 0; i < offset; i++) {
- // shellRegion
- // .subtract(windowWidth - offset + i, i, offset - i, 1);
- // }
- // // Subtracts bottom left corner region.
- // for (int i = 0; i < offset; i++) {
- // shellRegion.subtract(0, windowHeight - i, offset - i, 1);
- // }
- // // Subtracts bottom right corner region.
- // for (int i = 0; i < offset; i++) {
- // shellRegion.subtract(windowWidth - offset + i,
- // windowHeight - i, offset - i, 1);
- // }
- // }
- //
- // shell.setRegion(shellRegion);
- // shellRegion.dispose();
- // }
-
- // public void setShellSize(int width, int height) {
- // this.windowWidth = width;
- // this.windowHeight = height;
- // }
-
- // public void setSourceViewButtonToggleState(boolean isToggled) {
- // if (!isToggled) {
- // sourceViewToggleState = false;
- // viewSourceButton.setImage(viewSourceImage);
- // } else if (isToggled) {
- // sourceViewToggleState = true;
- // viewSourceButton.setImage(viewSourceToggleImage);
- // }
- // }
public boolean getSourceViewToggleState() {
return viewSourceButton.isToggled();
private void setStartToolbarState(boolean isStarted) {
if (isStarted) {
- startButton.setImages(stopImage, stopPushImage, stopHoverImage,
- startDisableImage);
- // startButton.setNormalImage(stopImage);
- // startButton.setPushImage(stopPushImage);
- // startButton.setHoverImage(stopHoverImage);
+ startButton.setImages( ImageResources.STOP, ImageResources.STOP_PUSH, ImageResources.STOP_HOVER,
+ ImageResources.START_DISABLE);
} else {
- startButton.setImages(startImage, startPushImage, startHoverImage,
- startDisableImage);
- // startButton.setNormalImage(startImage);
- // startButton.setPushImage(startPushImage);
- // startButton.setHoverImage(startHoverImage);
+ startButton.setImages(ImageResources.START, ImageResources.START_PUSH, ImageResources.START_HOVER,
+ ImageResources.START_DISABLE);
}
}
appCombo.setEnabled(enabled);
saveTraceButton.setEnabled(enabled);
openTraceButton.setEnabled(enabled);
- // TODO Remove or modify.
- // categoryLabel.setEnabled(enabled);
- // categoryButton.setEnabled(enabled);
setRepalyButtonEnable(enabled);
}
- // TODO Remove or modify.
- // private void showCategoryMenu() {
- // Rectangle bounds = categoryLabel.getBounds();
- // Point point = categoryLabel.toDisplay(START, bounds.y + bounds.height
- // + OFFSET_FIVE);
- // categoryMenu.setLocation(point);
- // categoryMenu.setVisible(true);
- // }
-
public void startTimer() {
timerClock.start();
}
public void stopTrace() {
AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
- // startButton.setNormalImage(startImage);
- startButton.setImage(DACustomButton.STATE_NORMAL, startImage);
+ startButton.setImage(DACustomButton.STATE_NORMAL, ImageResources.START);
startButton.setToolTipText(AnalyzerLabels.START_TRACE);
setStartToolbarState(false);
setToolbarEnablement(true);
AnalyzerUtil
.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
- startButton.setImage(DACustomButton.STATE_HOVER, stopHoverImage);
+ startButton.setImage(DACustomButton.STATE_HOVER, ImageResources.STOP_HOVER);
setStartToolbarState(true);
setToolbarEnablement(false);