import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.widgets.Shell;
import org.tizen.dynamicanalyzer.FontResources;
import org.tizen.dynamicanalyzer.ImageResources;
import org.tizen.dynamicanalyzer.constants.TimelineConstants;
-import org.tizen.dynamicanalyzer.listeners.DAButtonClickEventListener;
import org.tizen.dynamicanalyzer.nl.TimelineChartLables;
-import org.tizen.dynamicanalyzer.ui.widgets.button.DAButton;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
-
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
public class TimelineTick {
private Composite timeAndMenuComp;
private TimeTickComposite timeTickComp;
private Canvas rangeCanvas;
private Scale rangeScale;
- private DAButton addItems;
- private DAButton minimizeItems;
+ private DACustomButton addItems;
+ private DACustomButton minimizeItems;
private final int MARGIN_HORIZONTAL = 3;
protected int downLeftMarginP;
}
- private DAButtonClickEventListener addItemListButtonListener = new DAButtonClickEventListener(addItems) {
+ private DACustomButtonClickEventListener addItemListButtonListener = new DACustomButtonClickEventListener() {
+
@Override
- public void handleClickEvent(Event event) {
+ public void handleClickEvent(DACustomButton button) {
Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
- TimelineEditItemsDialog dialog = new TimelineEditItemsDialog(shell, SWT.None);
+ TimelineEditItemsDialog dialog = new TimelineEditItemsDialog(shell,
+ SWT.None);
dialog.open();
}
};
- private DAButtonClickEventListener minItemListButtonListener = new DAButtonClickEventListener(minimizeItems) {
+ private DACustomButtonClickEventListener minItemListButtonListener = new DACustomButtonClickEventListener() {
+
@Override
- public void handleClickEvent(Event event) {
- TimelineComposite timelineComposite = AnalyzerUtil.getTimelineComposite();
+ public void handleClickEvent(DACustomButton button) {
+ TimelineComposite timelineComposite = AnalyzerUtil
+ .getTimelineComposite();
if (null != timelineComposite) {
TimelineItemSettingProvider.setItemSettingMinimizeAll();
timelineComposite.resizeItemArea();
gLayout.verticalSpacing = 0;
addItemComp.setLayout(gLayout);
- addItems = new DAButton(addItemComp, ImageResources.ADD_ITEMS_NORMAL, ImageResources.ADD_ITEMS_PUSH, ImageResources.ADD_ITEMS_HOVER, null);
+ addItems = new DACustomButton(addItemComp, ImageResources.ADD_ITEMS_NORMAL,
+ ImageResources.ADD_ITEMS_PUSH, ImageResources.ADD_ITEMS_HOVER,
+ null);
addItems.setTitle(TimelineChartLables.TIMELINE_TICK_ADD);
addItems.setFontPoint(new Point(45, 3));
addItems.setFont(FontResources.ADDITEM_BUTTON_FONT);
addItems.addClickListener(addItemListButtonListener);
// addItems.addMouseListener(addItemListListener);
- DAButton minimizeItems = new DAButton(addItemComp, ImageResources.TIMLINE_SIZE_MIN_NORMAL, ImageResources.TIMLINE_SIZE_MIN_PUSH,
+ minimizeItems = new DACustomButton(addItemComp,
+ ImageResources.TIMLINE_SIZE_MIN_NORMAL,
+ ImageResources.TIMLINE_SIZE_MIN_PUSH,
ImageResources.TIMLINE_SIZE_MIN_HOVER, null);
GridData gDataMinBtn = new GridData();
gDataMinBtn.widthHint = TimelineConstants.TIMELINE_ITEM_MINIMIZE_WIDTH;
private void setRangeRect(Double startTime) {
/* Calculate start X */
Rectangle canvasRect = rangeCanvas.getBounds();
- int baseLineWidth = canvasRect.width - MARGIN_HORIZONTAL - MARGIN_HORIZONTAL;
+ int baseLineWidth = canvasRect.width - MARGIN_HORIZONTAL
+ - MARGIN_HORIZONTAL;
Double pixPerSec = (baseLineWidth / chartRunningSec);
Double rectStartXD = pixPerSec * startTime + MARGIN_HORIZONTAL;
Double rangeScaleRatio = rangeScaleSec / chartRunningSec;
Double rangeScaleWidthD = baseLineWidth * rangeScaleRatio;
- Rectangle rect = new Rectangle(rectStartXD.intValue(), 0, rangeScaleWidthD.intValue(), canvasRect.height);
+ Rectangle rect = new Rectangle(rectStartXD.intValue(), 0,
+ rangeScaleWidthD.intValue(), canvasRect.height);
rangeRectInfo.rangeRect = null;
rangeRectInfo.rangeRect = rect;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.ui.widgets.button.DAButton;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
public class AboutDialog extends Window {
private Shell parent = null;
private DAWindow shell = null;
- private DAButton licenseButton = null;
- private DAButton okButton = null;
+ private DACustomButton licenseButton = null;
+ private DACustomButton okButton = null;
// (open,close)button image
private final Image buttonImage = ImageResources.DIALOG_NORMAL;
this.parent = parent;
}
- private DAButtonClickEventListener okButtonListener = new DAButtonClickEventListener(
- okButton) {
- @Override
- public void handleClickEvent(Event event) {
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
shell.dispose();
}
};
- private DAButtonClickEventListener licenseButtonListener = new DAButtonClickEventListener(
- licenseButton) {
+ private DACustomButtonClickEventListener licenseButtonListener = new DACustomButtonClickEventListener() {
+
@Override
- public void handleClickEvent(Event event) {
+ public void handleClickEvent(DACustomButton button) {
Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
LicenseDialog dialog = new LicenseDialog(shell, SWT.NONE); // FIXME
dialog.open();
compData.bottom = new FormAttachment(100, 0);
buttonComp.setLayoutData(compData);
- okButton = new DAButton(buttonComp, buttonImage, buttonPushImage,
+ okButton = new DACustomButton(buttonComp, buttonImage, buttonPushImage,
buttonHoverImage, null);
okButton.addClickListener(okButtonListener);
okButton.setText(AnalyzerLabels.ABOUT_DIALOG_OK); //$NON-NLS-1$
okData.height = 34;
okButton.setLayoutData(okData);
- licenseButton = new DAButton(buttonComp, buttonImage, buttonPushImage,
- buttonHoverImage, null);
+ licenseButton = new DACustomButton(buttonComp, buttonImage,
+ buttonPushImage, buttonHoverImage, null);
licenseButton.addClickListener(licenseButtonListener);
licenseButton.setText(AnalyzerLabels.ABOUT_DIALOG_LICENSE); //$NON-NLS-1$
licenseButton.setFont(FontResources.DIALOG_BUTTON_FONT);
import org.eclipse.swt.layout.FormData;\r
import org.eclipse.swt.layout.FormLayout;\r
import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Event;\r
import org.eclipse.swt.widgets.Label;\r
import org.eclipse.swt.widgets.Shell;\r
import org.tizen.dynamicanalyzer.ColorResources;\r
import org.tizen.dynamicanalyzer.ConfigureManager;\r
import org.tizen.dynamicanalyzer.FontResources;\r
import org.tizen.dynamicanalyzer.ImageResources;\r
-import org.tizen.dynamicanalyzer.listeners.DAButtonClickEventListener;\r
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;\r
-import org.tizen.dynamicanalyzer.ui.widgets.button.DAButton;\r
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;\r
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;\r
\r
public class ConfigurationDialog/* extends Window */{\r
private Shell parent = null;\r
private DAWindow window = null;\r
- private DAButton okButton = null;\r
- private DAButton cancelButton = null;\r
+ private DACustomButton okButton = null;\r
+ private DACustomButton cancelButton = null;\r
// private DAButton applyButton = null;\r
// private ConfigureData configData = null;\r
\r
// private String sProcessSize;\r
// private String sTempProcessSize;\r
\r
- private DAButton internalOn = null;\r
- private DAButton internalOff = null;\r
- private DAButton rangeOn = null;\r
- private DAButton rangeOff = null;\r
- private DAButton snapshotOn = null;\r
- private DAButton snapshotOff = null;\r
+ private DACustomButton internalOn = null;\r
+ private DACustomButton internalOff = null;\r
+ private DACustomButton rangeOn = null;\r
+ private DACustomButton rangeOff = null;\r
+ private DACustomButton snapshotOn = null;\r
+ private DACustomButton snapshotOff = null;\r
\r
private ConfigureManager mConfig;\r
\r
mConfig = ConfigureManager.getInstance();\r
}\r
\r
- private DAButtonClickEventListener okButtonListener = new DAButtonClickEventListener(\r
- okButton) {\r
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {\r
+\r
@Override\r
- public void handleClickEvent(Event event) {\r
+ public void handleClickEvent(DACustomButton button) {\r
doApply();\r
window.dispose();\r
}\r
};\r
- private DAButtonClickEventListener cancelButtonListener = new DAButtonClickEventListener(\r
- cancelButton) {\r
- @Override\r
- public void handleClickEvent(Event event) {\r
+ private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {\r
\r
+ @Override\r
+ public void handleClickEvent(DACustomButton button) {\r
window.dispose();\r
}\r
};\r
- private DAButtonClickEventListener internalOnListener = new DAButtonClickEventListener(\r
- internalOn) {\r
+ private DACustomButtonClickEventListener internalOnListener = new DACustomButtonClickEventListener() {\r
+\r
@Override\r
- public void handleClickEvent(Event event) {\r
+ public void handleClickEvent(DACustomButton button) {\r
if (null != internalOn)\r
internalOn.setEnabled(false);\r
if (null != internalOff)\r
bInternalCall = true;\r
}\r
};\r
- private DAButtonClickEventListener internalOffListener = new DAButtonClickEventListener(\r
- internalOff) {\r
+ private DACustomButtonClickEventListener internalOffListener = new DACustomButtonClickEventListener() {\r
+\r
@Override\r
- public void handleClickEvent(Event event) {\r
+ public void handleClickEvent(DACustomButton button) {\r
if (null != internalOff)\r
internalOff.setEnabled(false);\r
if (null != internalOn)\r
bInternalCall = false;\r
}\r
};\r
- private DAButtonClickEventListener rangeOnListener = new DAButtonClickEventListener(\r
- rangeOn) {\r
+ private DACustomButtonClickEventListener rangeOnListener = new DACustomButtonClickEventListener() {\r
+\r
@Override\r
- public void handleClickEvent(Event event) {\r
+ public void handleClickEvent(DACustomButton button) {\r
if (null != rangeOn)\r
rangeOn.setEnabled(false);\r
if (null != rangeOff)\r
bRangeAutoSelect = true;\r
}\r
};\r
- private DAButtonClickEventListener rangeOffListener = new DAButtonClickEventListener(\r
- rangeOff) {\r
+ private DACustomButtonClickEventListener rangeOffListener = new DACustomButtonClickEventListener() {\r
+\r
@Override\r
- public void handleClickEvent(Event event) {\r
+ public void handleClickEvent(DACustomButton button) {\r
if (null != rangeOff)\r
rangeOff.setEnabled(false);\r
if (null != rangeOn)\r
bRangeAutoSelect = false;\r
}\r
};\r
- private DAButtonClickEventListener snapshotOnListener = new DAButtonClickEventListener(\r
- snapshotOn) {\r
+ private DACustomButtonClickEventListener snapshotOnListener = new DACustomButtonClickEventListener() {\r
+\r
@Override\r
- public void handleClickEvent(Event event) {\r
+ public void handleClickEvent(DACustomButton button) {\r
if (null != snapshotOn)\r
snapshotOn.setEnabled(false);\r
if (null != snapshotOff)\r
bSnapshot = true;\r
}\r
};\r
- private DAButtonClickEventListener snapshotOffListener = new DAButtonClickEventListener(\r
- snapshotOff) {\r
+ private DACustomButtonClickEventListener snapshotOffListener = new DACustomButtonClickEventListener() {\r
+\r
@Override\r
- public void handleClickEvent(Event event) {\r
+ public void handleClickEvent(DACustomButton button) {\r
if (null != snapshotOff)\r
snapshotOff.setEnabled(false);\r
if (null != snapshotOn)\r
compData.bottom = new FormAttachment(100, 0);\r
buttonComp.setLayoutData(compData);\r
\r
- cancelButton = new DAButton(buttonComp, buttonImage, buttonPushImage,\r
- buttonHoverImage, null);\r
+ cancelButton = new DACustomButton(buttonComp, buttonImage,\r
+ buttonPushImage, buttonHoverImage, null);\r
cancelButton.addClickListener(cancelButtonListener);\r
cancelButton.setText("CANCEL"); //$NON-NLS-1$\r
cancelButton.setFont(FontResources.DIALOG_BUTTON_FONT);\r
buttonData.height = 31;\r
cancelButton.setLayoutData(buttonData);\r
\r
- okButton = new DAButton(buttonComp, buttonImage, buttonPushImage,\r
+ okButton = new DACustomButton(buttonComp, buttonImage, buttonPushImage,\r
buttonHoverImage, null);\r
okButton.addClickListener(okButtonListener);\r
okButton.setText("OK"); //$NON-NLS-1$\r
compData.height = 45;\r
internalCallComp.setLayoutData(compData);\r
\r
- internalOn = new DAButton(internalCallComp, onImage, onPushImage,\r
+ internalOn = new DACustomButton(internalCallComp, onImage, onPushImage,\r
onHoverImage, onDisableImage);\r
- internalOff = new DAButton(internalCallComp, offImage, offPushImage,\r
- offHoverImage, offDisableImage);\r
- internalOn.getControl().setBackground(\r
- ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
- internalOff.getControl().setBackground(\r
- ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
+ internalOff = new DACustomButton(internalCallComp, offImage,\r
+ offPushImage, offHoverImage, offDisableImage);\r
+ internalOn.setBackground(ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
+ internalOff.setBackground(ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
\r
internalOn.addClickListener(internalOnListener);\r
internalOff.addClickListener(internalOffListener);\r
compData.height = 45;\r
rangeAutoSelectComp.setLayoutData(compData);\r
\r
- rangeOn = new DAButton(rangeAutoSelectComp, onImage, onPushImage,\r
+ rangeOn = new DACustomButton(rangeAutoSelectComp, onImage, onPushImage,\r
onHoverImage, onDisableImage);\r
- rangeOff = new DAButton(rangeAutoSelectComp, offImage, offPushImage,\r
- offHoverImage, offDisableImage);\r
- rangeOn.getControl().setBackground(\r
- ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
- rangeOff.getControl().setBackground(\r
- ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
+ rangeOff = new DACustomButton(rangeAutoSelectComp, offImage,\r
+ offPushImage, offHoverImage, offDisableImage);\r
+ rangeOn.setBackground(ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
+ rangeOff.setBackground(ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
\r
rangeOn.addClickListener(rangeOnListener);\r
rangeOff.addClickListener(rangeOffListener);\r
compData.height = 45;\r
snapshotComp.setLayoutData(compData);\r
\r
- snapshotOn = new DAButton(snapshotComp, onImage, onPushImage,\r
+ snapshotOn = new DACustomButton(snapshotComp, onImage, onPushImage,\r
onHoverImage, onDisableImage);\r
- snapshotOff = new DAButton(snapshotComp, offImage, offPushImage,\r
+ snapshotOff = new DACustomButton(snapshotComp, offImage, offPushImage,\r
offHoverImage, offDisableImage);\r
- snapshotOn.getControl().setBackground(\r
- ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
- snapshotOff.getControl().setBackground(\r
- ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
+ snapshotOn.setBackground(ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
+ snapshotOff.setBackground(ColorResources.NORMAL_VIEW_LAYOUT_INNER);\r
\r
snapshotOn.addClickListener(snapshotOnListener);\r
snapshotOff.addClickListener(snapshotOffListener);\r
import org.eclipse.swt.widgets.Listener;\r
import org.eclipse.swt.widgets.Monitor;\r
import org.eclipse.swt.widgets.Shell;\r
-import org.tizen.dynamicanalyzer.listeners.DAButtonClickEventListener;\r
import org.tizen.dynamicanalyzer.listeners.DAContextMenuListener;\r
-import org.tizen.dynamicanalyzer.ui.widgets.button.DAButton;\r
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;\r
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;\r
\r
public class DAContextMenu {\r
\r
public static final int DEFAULT_HEIGHT = 30;\r
private static Shell menuShell = null;\r
private Composite menuComp;\r
- private List<DAButton> menu = null;\r
+ private List<DACustomButton> menu = null;\r
private int menuWidth = DEFAULT_WIDTH;\r
private int menuHeight = DEFAULT_HEIGHT;\r
\r
createMenuSell();\r
\r
if (null == menu) {\r
- menu = new ArrayList<DAButton>();\r
+ menu = new ArrayList<DACustomButton>();\r
}\r
\r
- DAButton button = new DAButton(menuComp, SWT.NONE);\r
+ DACustomButton button = new DACustomButton(menuComp, SWT.NONE);\r
menu.add(button);\r
button.setText(title);\r
- button.addClickListener(new DAButtonClickEventListener(button) {\r
+ button.addClickListener(new DACustomButtonClickEventListener() {\r
\r
@Override\r
- public void handleClickEvent(Event event) {\r
- // TODO Auto-generated method stub\r
+ public void handleClickEvent(DACustomButton button) {\r
dispose();\r
- listener.handleClickEvent(event);\r
+ // FIXME: implement contex box\r
+ // listener.handleClickEvent(button);\r
}\r
});\r
button.addListener(SWT.MouseExit, contextMenuListener);\r
import org.tizen.dynamicanalyzer.FontResources;
import org.tizen.dynamicanalyzer.ImageResources;
import org.tizen.dynamicanalyzer.constants.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.listeners.DAButtonClickEventListener;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.ui.widgets.button.DAButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
public class LicenseDialog extends Window {
private Shell parent = null;
private DAWindow shell = null;
- private DAButton okButton = null;
+ private DACustomButton okButton = null;
// (ok)button image
private final Image buttonImage = ImageResources.DIALOG_NORMAL;
this.parent = parent;
}
- private DAButtonClickEventListener okButtonListener = new DAButtonClickEventListener(
- okButton) {
- @Override
- public void handleClickEvent(Event event) {
+ private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
+ @Override
+ public void handleClickEvent(DACustomButton button) {
shell.dispose();
}
};
compData.bottom = new FormAttachment(100, 0);
buttonComp.setLayoutData(compData);
- okButton = new DAButton(buttonComp, buttonImage, buttonPushImage,
+ okButton = new DACustomButton(buttonComp, buttonImage, buttonPushImage,
buttonHoverImage, null);
okButton.addClickListener(okButtonListener);
okButton.setText("OK"); //$NON-NLS-1$