From 11950d5edae8af0a88d1b96e6cc41d369c5039e8 Mon Sep 17 00:00:00 2001 From: Lee Date: Thu, 26 Jul 2012 20:57:35 +0900 Subject: [PATCH] [Title] White theme fix [Type] [Module] DynamicAnalyzer [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- .../META-INF/MANIFEST.MF | 2 +- .../widgets/button/DACustomButton.java | 8 + .../widgets/button/DACustomWidgetAttribute.java | 233 +++-- .../{daialog/DADailog.java => dialog/DADilog.java} | 6 +- .../dynamic-analyzer/config/license | 2 +- .../org/tizen/dynamicanalyzer/AnalyzerManager.java | 1074 ++++++++++---------- .../org/tizen/dynamicanalyzer/ColorResources.java | 11 + .../src/org/tizen/dynamicanalyzer/PathManager.java | 6 +- .../org/tizen/dynamicanalyzer/StateManager.java | 3 +- .../tizen/dynamicanalyzer/theme/DAThemeBlack.java | 44 +- .../tizen/dynamicanalyzer/theme/DAThemeWhite.java | 48 +- .../timeline/TimelineEditItemsDialog.java | 72 +- .../dynamicanalyzer/timeline/TimelineTick.java | 1 + .../ui/renderers/DAButtonRenderer.java | 49 + .../dynamicanalyzer/ui/views/CoolbarArea.java | 1 - .../dynamicanalyzer/ui/widgets/AboutDialog.java | 18 + .../tizen/dynamicanalyzer/ui/widgets/DAButton.java | 6 + .../dynamicanalyzer/ui/widgets/LicenseDialog.java | 24 +- .../ui/widgets/OpenTraceDialog.java | 16 + .../ui/widgets/StopProgressDialog.java | 14 +- .../tizen/dynamicanalyzer/utils/AnalyzerUtil.java | 20 + 21 files changed, 924 insertions(+), 734 deletions(-) rename org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/{daialog/DADailog.java => dialog/DADilog.java} (96%) create mode 100644 org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/renderers/DAButtonRenderer.java diff --git a/org.tizen.dynamicanalyzer.widgets/META-INF/MANIFEST.MF b/org.tizen.dynamicanalyzer.widgets/META-INF/MANIFEST.MF index 99ed4dc..32ace28 100644 --- a/org.tizen.dynamicanalyzer.widgets/META-INF/MANIFEST.MF +++ b/org.tizen.dynamicanalyzer.widgets/META-INF/MANIFEST.MF @@ -12,7 +12,7 @@ Export-Package: org.tizen.dynamicanalyzer.widgets, org.tizen.dynamicanalyzer.widgets.button, org.tizen.dynamicanalyzer.widgets.button.toggle, org.tizen.dynamicanalyzer.widgets.combo, - org.tizen.dynamicanalyzer.widgets.daialog, + org.tizen.dynamicanalyzer.widgets.dialog, org.tizen.dynamicanalyzer.widgets.graph.bar, org.tizen.dynamicanalyzer.widgets.graph.circular, org.tizen.dynamicanalyzer.widgets.helper, diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java index 0fe0505..b7e8857 100644 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java @@ -207,6 +207,13 @@ public class DACustomButton extends Canvas { attr.setOutlineColor(STATE_DISABLE, disable); } + public void setOutlineInColors(Color normal, Color push, Color hover, Color disable) { + attr.setOutlineInColor(STATE_NORMAL, normal); + attr.setOutlineInColor(STATE_PUSH, push); + attr.setOutlineInColor(STATE_HOVER, hover); + attr.setOutlineInColor(STATE_DISABLE, disable); + } + public void addClickListener(DACustomButtonClickEventListener listener) { addListener(SWT.MouseUp, listener); } @@ -240,6 +247,7 @@ public class DACustomButton extends Canvas { attr.setFontColor(STATE_DISABLE, disable); } + public void setFontColor(int state, Color color) { attr.setFontColor(state, color); } diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomWidgetAttribute.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomWidgetAttribute.java index a30ab76..d4072e8 100644 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomWidgetAttribute.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomWidgetAttribute.java @@ -1,5 +1,3 @@ - - package org.tizen.dynamicanalyzer.widgets.button; import java.util.ArrayList; @@ -10,116 +8,125 @@ import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; - public class DACustomWidgetAttribute { - private final int MAX_SIZE = 10; - private String text; - private Image buttonImage = null; - private Font font; - private Point fontPoint; - private int drawType = DACustomButton.TYPE_COLOR; - - private List images = new ArrayList(); - private List colors = new ArrayList(); - private List fontColors = new ArrayList(); - private List outlineColors = new ArrayList(); - private boolean enabled; - - public DACustomWidgetAttribute() { - enabled = true; - - // init array - for (int i = 0; i < MAX_SIZE; i++) { - images.add(null); - colors.add(null); - fontColors.add(null); - outlineColors.add(null); - } - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public Image getButtonImage() { - return buttonImage; - } - - public void setButtonImage(Image img) { - buttonImage = img; - } - - public Font getFont() { - return font; - } - - public void setFont(Font font) { - this.font = font; - } - - public Point getFontPoint() { - return fontPoint; - } - - public void setFontPoint(Point fontPoint) { - this.fontPoint = fontPoint; - } - - public int getDrawType() { - return drawType; - } - - public void setDrawType(int type) { - drawType = type; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public Image getImage(int state) { - if (!images.isEmpty()) { - return images.get(state); - } - return null; - } - - public void setImage(int state, Image img) { - images.set(state, img); - } - - public Color getColor(int state) { - if (!colors.isEmpty()) { - return colors.get(state); - } - return null; - } - - public void setColor(int state, Color color) { - colors.set(state, color); - } - - public void setFontColor(int state, Color color) { - fontColors.set(state, color); - } - - public Color getFontColor(int state) { - return fontColors.get(state); - } - - public void setOutlineColor(int state, Color color) { - outlineColors.set(state, color); - } - - public Color getOutlineColor(int state) { - return outlineColors.get(state); - } + private final int MAX_SIZE = 10; + private String text; + private Image buttonImage = null; + private Font font; + private Point fontPoint; + private int drawType = DACustomButton.TYPE_COLOR; + + private List images = new ArrayList(); + private List colors = new ArrayList(); + private List fontColors = new ArrayList(); + private List outlineColors = new ArrayList(); + private List outlineInColors = new ArrayList(); + private boolean enabled; + + public DACustomWidgetAttribute() { + enabled = true; + + // init array + for (int i = 0; i < MAX_SIZE; i++) { + images.add(null); + colors.add(null); + fontColors.add(null); + outlineColors.add(null); + outlineInColors.add(null); + } + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public Image getButtonImage() { + return buttonImage; + } + + public void setButtonImage(Image img) { + buttonImage = img; + } + + public Font getFont() { + return font; + } + + public void setFont(Font font) { + this.font = font; + } + + public Point getFontPoint() { + return fontPoint; + } + + public void setFontPoint(Point fontPoint) { + this.fontPoint = fontPoint; + } + + public int getDrawType() { + return drawType; + } + + public void setDrawType(int type) { + drawType = type; + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public Image getImage(int state) { + if (!images.isEmpty()) { + return images.get(state); + } + return null; + } + + public void setImage(int state, Image img) { + images.set(state, img); + } + + public Color getColor(int state) { + if (!colors.isEmpty()) { + return colors.get(state); + } + return null; + } + + public void setColor(int state, Color color) { + colors.set(state, color); + } + + public void setFontColor(int state, Color color) { + fontColors.set(state, color); + } + + public Color getFontColor(int state) { + return fontColors.get(state); + } + + public void setOutlineColor(int state, Color color) { + outlineColors.set(state, color); + } + + public Color getOutlineColor(int state) { + return outlineColors.get(state); + } + + public void setOutlineInColor(int state, Color color) { + outlineInColors.set(state, color); + } + + public Color getOutlineInColor(int state) { + return outlineInColors.get(state); + } } diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/daialog/DADailog.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/dialog/DADilog.java similarity index 96% rename from org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/daialog/DADailog.java rename to org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/dialog/DADilog.java index f474e72..6817856 100644 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/daialog/DADailog.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/dialog/DADilog.java @@ -1,6 +1,6 @@ -package org.tizen.dynamicanalyzer.widgets.daialog; +package org.tizen.dynamicanalyzer.widgets.dialog; import org.eclipse.swt.SWT; import org.eclipse.swt.events.PaintEvent; @@ -18,7 +18,7 @@ import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonDefaultRenderer; import org.tizen.dynamicanalyzer.widgets.helper.ColorResources; -public class DADailog { +public class DADilog { private Canvas infoArea = null; private String info = null; @@ -28,7 +28,7 @@ public class DADailog { private Color fgColor = ColorResources.WHITE; private Shell shell = null; - public DADailog(Shell parent, int style) { + public DADilog(Shell parent, int style) { shell = new Shell(parent, style | SWT.APPLICATION_MODAL | SWT.TITLE); shell.setSize(446, 157); shell.setLayout(new FormLayout()); diff --git a/org.tizen.dynamicanalyzer.workbench/dynamic-analyzer/config/license b/org.tizen.dynamicanalyzer.workbench/dynamic-analyzer/config/license index 8a29803..d9048ce 100644 --- a/org.tizen.dynamicanalyzer.workbench/dynamic-analyzer/config/license +++ b/org.tizen.dynamicanalyzer.workbench/dynamic-analyzer/config/license @@ -1,5 +1,5 @@ - Tizen SDK + Tizen SDK Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software. diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java index 741a71a..4c769d8 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/AnalyzerManager.java @@ -17,7 +17,6 @@ * */ - package org.tizen.dynamicanalyzer; import java.io.File; @@ -54,544 +53,539 @@ import org.tizen.dynamicanalyzer.utils.ImageListSortComparator; import org.tizen.dynamicanalyzer.utils.LeakDetector; import org.tizen.dynamicanalyzer.utils.UpdateViewTimer; - public class AnalyzerManager { - private static DATheme theme = null; - private static Project project = null; - private static List baseLogCenters; - private static List logCenters; - private static String tempPath = null; - private static Thread openTraceInputThread = null; - private static Thread insertLogThread = null; - private static boolean isNew = false; - private static InsertLogQueue insertLogQueue = null; - private static HashMap imageSet = null; - private static List imageList = null; - private static int imageListSize = 0; - private static LeakDetector leakDetector = null; - private static FailedChecker failedChecker = null; - private static FailedChecker calledChecker = null; - - private static FunctionUsageProfiler functionUserProfiler = null; - private static Thread stopLogProcessThread = null; - private static Thread startStopThread = null; - private static boolean sampleThread = false; - - private static String startBinaryAddr = null; - private static String endBinaryAddr = null; - - private static String autoStartDeviceName = null; - private static String autoStartApplicationName = null; - - private static List projectList = null; - - public static List getProjectList() { - if (null == projectList) { - projectList = new ArrayList(); - } - return projectList; - } - - public static void removeFromProjectList(String path) { - int size = getProjectList().size(); - for (int i = 0; i < size; i++) { - if (projectList.get(i).equals(path)) { - projectList.remove(i); - break; - } - } - } - - public static DATheme getTheme() { - if (null == theme) { -// theme = DAThemeBlack.getInstance(); - theme = DAThemeWhite.getInstance(); - } - return theme; - } - - public static void setTheme(DATheme t) { - theme = t; - ColorResources.initColors(); - - // TODO: redraw all widgets! - // AnalyzerUtil.getWorkbenchWindow().getWorkbench() - // .getActiveWorkbenchWindow(); - } - - public static boolean hasSampleThread() { - return sampleThread; - } - - public static void setSampleThread(boolean b) { - sampleThread = b; - } - - public static boolean isBinStartEndSet() { - if ((null != startBinaryAddr && !startBinaryAddr.isEmpty()) - && (null != endBinaryAddr && !endBinaryAddr.isEmpty())) { - return true; - } - return false; - } - - public static void setBinaryStartEndAddr(String start, String end) { - startBinaryAddr = start; - endBinaryAddr = end; - } - - public static boolean isInBinaryRange(String addrStr) { - try { - long startAddr = Long.parseLong(startBinaryAddr); - long endAddr = Long.parseLong(endBinaryAddr); - long addr = Long.parseLong(addrStr); - if (addr > endAddr || addr < startAddr) { - return false; - } - return true; - - } catch (NumberFormatException e) { - e.printStackTrace(); - return false; - } - - } - - public static void clear() { - if (null != project) { - project = null; - } - - isNew = false; - insertLogQueue = null; - imageSet = null; - imageList = null; - imageListSize = 0; - - stopLogQueueObservingThread(); - stopInsertLogThread(); - - leakDetector = null; - failedChecker = null; - calledChecker = null; - functionUserProfiler = null; - StopLogProcessThread.count = 0; - stopLogProcessThread = null; - sampleThread = false; - UserFunctionManager.getInstance().clear(); - } - - public static List getImageList() { - if (null == imageList) { - imageList = new ArrayList(); - imageListSize = 0; - } - if (imageList.size() != getImageSet().size()) { - imageList.clear(); - Collection imageCol = getImageSet().values(); - imageList.addAll(imageCol); - Collections.sort(imageList, new ImageListSortComparator()); - imageListSize = imageList.size(); - } - return imageList; - } - - public static HashMap getImageSet() { - if (null == imageSet) { - imageSet = new HashMap(); - ImageInfo noImage = new ImageInfo(); - noImage.setSeq("-1"); //$NON-NLS-1$ - noImage.setTime("-1"); //$NON-NLS-1$ - imageSet.put(noImage.getSeq(), noImage); - } - return imageSet; - } - - public static String getImagePathByTime(String timeStr) { - imageList = getImageList(); - String path = null; - for (int i = 0; i < imageListSize; i++) { - long imgTime = Long.parseLong(imageList.get(i).getTime()); - long time = Long.parseLong(timeStr); - if (imgTime <= time) { - path = - AnalyzerManager.getProject().getSavePath() + File.separator - + AnalyzerConstants.IMAGE_FOLDER_NAME + File.separator - + imageList.get(i).getSeq() + AnalyzerConstants.EXTENSION_PNG_IMAGE; - } else { - break; - } - } - if (null != path) { - return path; - } else { - return AnalyzerConstants.DEFAULT_IMAGE_NAME; - } - } - - public static ImageInfo getImageInfoByTime(String timeStr) { - imageList = getImageList(); - for (int i = imageListSize - 1; i >= 0; i--) { - long imgTime = Long.parseLong(imageList.get(i).getTime()); - long time = Long.parseLong(timeStr); - if (imgTime <= time) { - return imageList.get(i); - } - } - return null; - } - - public static int getImageIndexByTime(String timeStr) { - imageList = getImageList(); - for (int i = imageListSize - 1; i >= 0; i--) { - long imgTime = Long.parseLong(imageList.get(i).getTime()); - long time = Long.parseLong(timeStr); - if (imgTime <= time) { - return i; - } - } - return -1; - } - - public static InsertLogQueue getInsertLogQueue() { - if (null == insertLogQueue) { - insertLogQueue = new InsertLogQueue(); - } - return insertLogQueue; - } - - public static void setNew(boolean n) { - isNew = n; - } - - public static boolean isNew() { - return isNew; - } - - public static void setTempPath(String path) { - tempPath = path; - } - - public static String getTempPath() { - return tempPath; - } - - public static void setProject(Project p) { - project = p; - getProjectList().add(p.getSavePath()); - } - - public static void setProjectNoRegist(Project p) { - project = p; - } - - public static Project getProject() { - return project; - } - - public static List getBaseLogCenters() { - if (null == baseLogCenters) { - baseLogCenters = getAvailableLogCenters(); - } - return baseLogCenters; - } - - public static List getInnerLogCenters() { - if (null == logCenters || logCenters.isEmpty()) { - if (null == logCenters) { - logCenters = new ArrayList(); - } - List baseLogcs = AnalyzerManager.getBaseLogCenters(); - if (null == baseLogcs || baseLogcs.isEmpty()) { - System.out.println("DynamicAnalyzer folder or logc file is missing! ");//$NON-NLS-1$ - return null; - } - int size = baseLogcs.size(); - for (int i = 0; i < size; i++) { - logCenters.add(copyLogCenter(baseLogcs.get(i))); - } - } - return logCenters; - } - - public static LogCenter copyLogCenter(BaseLogCenter from) { - LogCenter to = new LogCenter(); - to.setId(from.getId()); - to.setName(from.getName()); - to.setTotalColumnCount(from.getTotalColumnCount()); - to.setCustomColumn(from.isCustomColumn()); - - to.getColumnName().addAll(from.getColumnName()); - to.getType().addAll(from.getType()); - to.getColumnSizes().addAll(from.getColumnSize()); - to.getColumnOrder().addAll(from.getColumnOrder()); - to.getColumnVisibility().addAll(from.getColumnVisibility()); - to.getTableColumnName().addAll(from.getTableColumnName()); - return to; - } - - public static BaseLogCenter getBaseLogCenterById(int id) { - if (null != baseLogCenters) { - int size = baseLogCenters.size(); - for (int i = 0; i < size; i++) { - if (id == baseLogCenters.get(i).getId()) { - return baseLogCenters.get(i); - } - } - } - return null; - } - - - public static List getAvailableLogCenters() { - String path = - AnalyzerConstants.DYNAMIC_ANALYZER_INSTALL_PATH + File.separator - + AnalyzerConstants.XML_FOLDER_NAME; - File file = new File(path); - if (!file.exists()) { - return null; - } - - File fileList[] = - file.listFiles(new ExtensionFilter(AnalyzerConstants.EXTENSION_LOG_CENTER)); - int fileListLength = fileList.length; - if (1 > fileListLength) { - return null; - } - - List logcs = new ArrayList(); - BaseLogCenter logc = new BaseLogCenter(); - for (int i = 0; i < fileListLength; i++) { - logc = - (BaseLogCenter) XMLManager.unmarshal(new File(path + File.separator - + fileList[i].getName())); - if (null != logc) { - logcs.add(logc); - } - } - - return logcs; - } - - public static void startOpenTraceThread() { - if (null == openTraceInputThread || !openTraceInputThread.isAlive()) { - openTraceInputThread = - new Thread(null, new OpenTraceInputThread(), - AnalyzerConstants.OPEN_TRACE_THREAD); - openTraceInputThread.start(); - } - } - - public static void stopLogQueueObservingThread() { - if (null != openTraceInputThread && openTraceInputThread.isAlive()) { - openTraceInputThread.interrupt(); - } - } - - public static void startInsertLogThread() { - if (null == insertLogThread || !insertLogThread.isAlive()) { - insertLogThread = - new Thread(null, new InsertLogThread(), AnalyzerConstants.INSERT_LOG_THREAD); - insertLogThread.start(); - } - } - - public static void stopInsertLogThread() { - if (null != insertLogThread && insertLogThread.isAlive()) { - insertLogThread.interrupt(); - } - } - - public static LeakDetector getLeakDectector() { - if (leakDetector == null) { - leakDetector = new LeakDetector(); - } - return leakDetector; - } - - public static FailedChecker getFailedChecker() { - if (null == failedChecker) { - failedChecker = new FailedChecker(); - } - return failedChecker; - } - - public static FailedChecker getCalledFunctionChecker() { - if (null == calledChecker) { - calledChecker = new FailedChecker(); - } - return calledChecker; - } - - public static FunctionUsageProfiler getFunctionUserProfiler() { - if (null == functionUserProfiler) { - functionUserProfiler = new FunctionUsageProfiler(); - } - return functionUserProfiler; - } - - public static void recordStart() { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - CoolbarArea.getInstance().setStartToolbarEnablement(false); - } - }); - AnalyzerUtil.executeCommand(ClearHandler.ID); - Project project = new Project(); - project.init(); - setNew(true); - - if (!ResourceCommunicator.connect()) { - System.out.println("failed to connect the device.");//$NON-NLS-1$ - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - CoolbarArea.getInstance().setStartToolbarEnablement(true); - } - }); - return; - } - - DeviceCurrent.init(); - - UIRecorderTool.getInstance().startRecorder(); - leakDetector = new LeakDetector(); - - ResourceCommunicator.sendStartMessage(); - - CoolbarArea.getInstance().startTimer(); - - LogSpliter.startLogQueueObservingThread(); - - /* Timeline */ - UpdateViewTimer.start(); - } - - public static void recordStop() { - if (ResourceCommunicator.isRunning()) { - ResourceCommunicator.setCallStop(true); - ResourceCommunicator.sendMessage(AnalyzerConstants.MSG_STOP - + AnalyzerConstants.CMD_SPLIT + 0 + AnalyzerConstants.CMD_SPLIT); - } - } - - public static List getLogCenters() { - if (null != project) { - return project.getLogCenters(); - } - return getInnerLogCenters(); - } - - public void initLogCenters() { - if (null != logCenters) { - logCenters.clear(); - } else { - logCenters = new ArrayList(); - } - - logCenters.addAll(AnalyzerManager.getLogCenters()); - } - - public static LogCenter getLogCenterById(int id) { - List logcs = getLogCenters(); - if (null != logcs) { - int size = logcs.size(); - for (int i = 0; i < size; i++) { - if (id == logcs.get(i).getId()) { - return logcs.get(i); - } - } - } - return null; - } - - public static DAPageComposite getCurrentPage() { - BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID); - return bv.getTopComposite(); - } - - public static List getAllPage() { - BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID); - return bv.getMainView().getComposites(); - } - - public static LeakCheckList getLeakCheckList() { - String path = - AnalyzerConstants.DYNAMIC_ANALYZER_INSTALL_PATH + File.separator - + AnalyzerConstants.XML_FOLDER_NAME; - - File file = new File(path); - if (!file.exists()) { - return null; - } - - File fileList[] = - file.listFiles(new ExtensionFilter(AnalyzerConstants.EXTENSION_LEAK_CHECK)); - int fileListLength = fileList.length; - if (1 > fileListLength) { - return null; - } - - LeakCheckList output = new LeakCheckList(); - LeakCheckList leakCheckList = new LeakCheckList(); - for (int i = 0; i < fileListLength; i++) { - leakCheckList = - (LeakCheckList) XMLManager.unmarshal(new File(path + File.separator - + fileList[i].getName())); - output.getChecks().addAll(leakCheckList.getChecks()); - } - leakCheckList = null; - return output; - } - - public static void runStopLogProcessThread() { - if (StopLogProcessThread.count == 0) { - Display.getDefault().syncExec(new Runnable() { - @Override - public void run() { - StateManager.getInstance().StopProcessStart("unknown error(2)"); - } - }); - StopLogProcessThread.count++; - stopLogProcessThread = - new Thread(null, new StopLogProcessThread(), AnalyzerConstants.STOP_LOG_THREAD); - stopLogProcessThread.start(); - } - } - - public static void runStartStopThread() { - if (RecordStartStopThread.count == 0) { - RecordStartStopThread.count++; - startStopThread = - new Thread(null, new RecordStartStopThread(), - AnalyzerConstants.START_STOP_THREAD); - startStopThread.start(); - } - } - - public static boolean isOsp() { - int type = - Integer.parseInt(getProject().getAppInfo().get(AnalyzerConstants.APP_INFO_APP_TYPE)); - if (type == AnalyzerConstants.APP_TYPE_OSP) { - return true; - } - return false; - } - - public static void setAutoStartDeviceName(String device) { - autoStartDeviceName = device; - } - - public static String getAutoStartDeviceName() { - return autoStartDeviceName; - } - - public static void setAutoStartApplicationName(String app) { - autoStartApplicationName = app; - } - - public static String getAutoStartApplicationName() { - return autoStartApplicationName; - } + private static DATheme theme = null; + private static Project project = null; + private static List baseLogCenters; + private static List logCenters; + private static String tempPath = null; + private static Thread openTraceInputThread = null; + private static Thread insertLogThread = null; + private static boolean isNew = false; + private static InsertLogQueue insertLogQueue = null; + private static HashMap imageSet = null; + private static List imageList = null; + private static int imageListSize = 0; + private static LeakDetector leakDetector = null; + private static FailedChecker failedChecker = null; + private static FailedChecker calledChecker = null; + + private static FunctionUsageProfiler functionUserProfiler = null; + private static Thread stopLogProcessThread = null; + private static Thread startStopThread = null; + private static boolean sampleThread = false; + + private static String startBinaryAddr = null; + private static String endBinaryAddr = null; + + private static String autoStartDeviceName = null; + private static String autoStartApplicationName = null; + + private static List projectList = null; + + public static List getProjectList() { + if (null == projectList) { + projectList = new ArrayList(); + } + return projectList; + } + + public static void removeFromProjectList(String path) { + int size = getProjectList().size(); + for (int i = 0; i < size; i++) { + if (projectList.get(i).equals(path)) { + projectList.remove(i); + break; + } + } + } + + public static DATheme getTheme() { + if (null == theme) { + // theme = DAThemeBlack.getInstance(); + theme = DAThemeWhite.getInstance(); + } + return theme; + } + + public static void setTheme(DATheme t) { + theme = t; + ColorResources.initColors(); + + // TODO: redraw all widgets! + // AnalyzerUtil.getWorkbenchWindow().getWorkbench() + // .getActiveWorkbenchWindow(); + } + + public static boolean hasSampleThread() { + return sampleThread; + } + + public static void setSampleThread(boolean b) { + sampleThread = b; + } + + public static boolean isBinStartEndSet() { + if ((null != startBinaryAddr && !startBinaryAddr.isEmpty()) + && (null != endBinaryAddr && !endBinaryAddr.isEmpty())) { + return true; + } + return false; + } + + public static void setBinaryStartEndAddr(String start, String end) { + startBinaryAddr = start; + endBinaryAddr = end; + } + + public static boolean isInBinaryRange(String addrStr) { + try { + long startAddr = Long.parseLong(startBinaryAddr); + long endAddr = Long.parseLong(endBinaryAddr); + long addr = Long.parseLong(addrStr); + if (addr > endAddr || addr < startAddr) { + return false; + } + return true; + + } catch (NumberFormatException e) { + e.printStackTrace(); + return false; + } + + } + + public static void clear() { + if (null != project) { + project = null; + } + + isNew = false; + insertLogQueue = null; + imageSet = null; + imageList = null; + imageListSize = 0; + + stopLogQueueObservingThread(); + stopInsertLogThread(); + + leakDetector = null; + failedChecker = null; + calledChecker = null; + functionUserProfiler = null; + StopLogProcessThread.count = 0; + stopLogProcessThread = null; + sampleThread = false; + UserFunctionManager.getInstance().clear(); + } + + public static List getImageList() { + if (null == imageList) { + imageList = new ArrayList(); + imageListSize = 0; + } + if (imageList.size() != getImageSet().size()) { + imageList.clear(); + Collection imageCol = getImageSet().values(); + imageList.addAll(imageCol); + Collections.sort(imageList, new ImageListSortComparator()); + imageListSize = imageList.size(); + } + return imageList; + } + + public static HashMap getImageSet() { + if (null == imageSet) { + imageSet = new HashMap(); + ImageInfo noImage = new ImageInfo(); + noImage.setSeq("-1"); //$NON-NLS-1$ + noImage.setTime("-1"); //$NON-NLS-1$ + imageSet.put(noImage.getSeq(), noImage); + } + return imageSet; + } + + public static String getImagePathByTime(String timeStr) { + imageList = getImageList(); + String path = null; + for (int i = 0; i < imageListSize; i++) { + long imgTime = Long.parseLong(imageList.get(i).getTime()); + long time = Long.parseLong(timeStr); + if (imgTime <= time) { + path = AnalyzerManager.getProject().getSavePath() + + File.separator + AnalyzerConstants.IMAGE_FOLDER_NAME + + File.separator + imageList.get(i).getSeq() + + AnalyzerConstants.EXTENSION_PNG_IMAGE; + } else { + break; + } + } + if (null != path) { + return path; + } else { + return AnalyzerConstants.DEFAULT_IMAGE_NAME; + } + } + + public static ImageInfo getImageInfoByTime(String timeStr) { + imageList = getImageList(); + for (int i = imageListSize - 1; i >= 0; i--) { + long imgTime = Long.parseLong(imageList.get(i).getTime()); + long time = Long.parseLong(timeStr); + if (imgTime <= time) { + return imageList.get(i); + } + } + return null; + } + + public static int getImageIndexByTime(String timeStr) { + imageList = getImageList(); + for (int i = imageListSize - 1; i >= 0; i--) { + long imgTime = Long.parseLong(imageList.get(i).getTime()); + long time = Long.parseLong(timeStr); + if (imgTime <= time) { + return i; + } + } + return -1; + } + + public static InsertLogQueue getInsertLogQueue() { + if (null == insertLogQueue) { + insertLogQueue = new InsertLogQueue(); + } + return insertLogQueue; + } + + public static void setNew(boolean n) { + isNew = n; + } + + public static boolean isNew() { + return isNew; + } + + public static void setTempPath(String path) { + tempPath = path; + } + + public static String getTempPath() { + return tempPath; + } + + public static void setProject(Project p) { + project = p; + getProjectList().add(p.getSavePath()); + } + + public static void setProjectNoRegist(Project p) { + project = p; + } + + public static Project getProject() { + return project; + } + + public static List getBaseLogCenters() { + if (null == baseLogCenters) { + baseLogCenters = getAvailableLogCenters(); + } + return baseLogCenters; + } + + public static List getInnerLogCenters() { + if (null == logCenters || logCenters.isEmpty()) { + if (null == logCenters) { + logCenters = new ArrayList(); + } + List baseLogcs = AnalyzerManager.getBaseLogCenters(); + if (null == baseLogcs || baseLogcs.isEmpty()) { + System.out + .println("DynamicAnalyzer folder or logc file is missing! ");//$NON-NLS-1$ + return null; + } + int size = baseLogcs.size(); + for (int i = 0; i < size; i++) { + logCenters.add(copyLogCenter(baseLogcs.get(i))); + } + } + return logCenters; + } + + public static LogCenter copyLogCenter(BaseLogCenter from) { + LogCenter to = new LogCenter(); + to.setId(from.getId()); + to.setName(from.getName()); + to.setTotalColumnCount(from.getTotalColumnCount()); + to.setCustomColumn(from.isCustomColumn()); + + to.getColumnName().addAll(from.getColumnName()); + to.getType().addAll(from.getType()); + to.getColumnSizes().addAll(from.getColumnSize()); + to.getColumnOrder().addAll(from.getColumnOrder()); + to.getColumnVisibility().addAll(from.getColumnVisibility()); + to.getTableColumnName().addAll(from.getTableColumnName()); + return to; + } + + public static BaseLogCenter getBaseLogCenterById(int id) { + if (null != baseLogCenters) { + int size = baseLogCenters.size(); + for (int i = 0; i < size; i++) { + if (id == baseLogCenters.get(i).getId()) { + return baseLogCenters.get(i); + } + } + } + return null; + } + + public static List getAvailableLogCenters() { + String path = AnalyzerConstants.DYNAMIC_ANALYZER_INSTALL_PATH + + File.separator + AnalyzerConstants.XML_FOLDER_NAME; + File file = new File(path); + if (!file.exists()) { + return null; + } + + File fileList[] = file.listFiles(new ExtensionFilter( + AnalyzerConstants.EXTENSION_LOG_CENTER)); + int fileListLength = fileList.length; + if (1 > fileListLength) { + return null; + } + + List logcs = new ArrayList(); + BaseLogCenter logc = new BaseLogCenter(); + for (int i = 0; i < fileListLength; i++) { + logc = (BaseLogCenter) XMLManager.unmarshal(new File(path + + File.separator + fileList[i].getName())); + if (null != logc) { + logcs.add(logc); + } + } + + return logcs; + } + + public static void startOpenTraceThread() { + if (null == openTraceInputThread || !openTraceInputThread.isAlive()) { + openTraceInputThread = new Thread(null, new OpenTraceInputThread(), + AnalyzerConstants.OPEN_TRACE_THREAD); + openTraceInputThread.start(); + } + } + + public static void stopLogQueueObservingThread() { + if (null != openTraceInputThread && openTraceInputThread.isAlive()) { + openTraceInputThread.interrupt(); + } + } + + public static void startInsertLogThread() { + if (null == insertLogThread || !insertLogThread.isAlive()) { + insertLogThread = new Thread(null, new InsertLogThread(), + AnalyzerConstants.INSERT_LOG_THREAD); + insertLogThread.start(); + } + } + + public static void stopInsertLogThread() { + if (null != insertLogThread && insertLogThread.isAlive()) { + insertLogThread.interrupt(); + } + } + + public static LeakDetector getLeakDectector() { + if (leakDetector == null) { + leakDetector = new LeakDetector(); + } + return leakDetector; + } + + public static FailedChecker getFailedChecker() { + if (null == failedChecker) { + failedChecker = new FailedChecker(); + } + return failedChecker; + } + + public static FailedChecker getCalledFunctionChecker() { + if (null == calledChecker) { + calledChecker = new FailedChecker(); + } + return calledChecker; + } + + public static FunctionUsageProfiler getFunctionUserProfiler() { + if (null == functionUserProfiler) { + functionUserProfiler = new FunctionUsageProfiler(); + } + return functionUserProfiler; + } + + public static void recordStart() { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + CoolbarArea.getInstance().setStartToolbarEnablement(false); + } + }); + AnalyzerUtil.executeCommand(ClearHandler.ID); + Project project = new Project(); + project.init(); + setNew(true); + + if (!ResourceCommunicator.connect()) { + System.out.println("failed to connect the device.");//$NON-NLS-1$ + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + CoolbarArea.getInstance().setStartToolbarEnablement(true); + } + }); + return; + } + + DeviceCurrent.init(); + + UIRecorderTool.getInstance().startRecorder(); + leakDetector = new LeakDetector(); + + ResourceCommunicator.sendStartMessage(); + + CoolbarArea.getInstance().startTimer(); + + LogSpliter.startLogQueueObservingThread(); + + /* Timeline */ + UpdateViewTimer.start(); + } + + public static void recordStop() { + if (ResourceCommunicator.isRunning()) { + ResourceCommunicator.setCallStop(true); + ResourceCommunicator.sendMessage(AnalyzerConstants.MSG_STOP + + AnalyzerConstants.CMD_SPLIT + 0 + + AnalyzerConstants.CMD_SPLIT); + } + } + + public static List getLogCenters() { + if (null != project) { + return project.getLogCenters(); + } + return getInnerLogCenters(); + } + + public void initLogCenters() { + if (null != logCenters) { + logCenters.clear(); + } else { + logCenters = new ArrayList(); + } + + logCenters.addAll(AnalyzerManager.getLogCenters()); + } + + public static LogCenter getLogCenterById(int id) { + List logcs = getLogCenters(); + if (null != logcs) { + int size = logcs.size(); + for (int i = 0; i < size; i++) { + if (id == logcs.get(i).getId()) { + return logcs.get(i); + } + } + } + return null; + } + + public static DAPageComposite getCurrentPage() { + BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID); + return bv.getTopComposite(); + } + + public static List getAllPage() { + BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID); + return bv.getMainView().getComposites(); + } + + public static LeakCheckList getLeakCheckList() { + String path = AnalyzerConstants.DYNAMIC_ANALYZER_INSTALL_PATH + + File.separator + AnalyzerConstants.XML_FOLDER_NAME; + + File file = new File(path); + if (!file.exists()) { + return null; + } + + File fileList[] = file.listFiles(new ExtensionFilter( + AnalyzerConstants.EXTENSION_LEAK_CHECK)); + int fileListLength = fileList.length; + if (1 > fileListLength) { + return null; + } + + LeakCheckList output = new LeakCheckList(); + LeakCheckList leakCheckList = new LeakCheckList(); + for (int i = 0; i < fileListLength; i++) { + leakCheckList = (LeakCheckList) XMLManager.unmarshal(new File(path + + File.separator + fileList[i].getName())); + output.getChecks().addAll(leakCheckList.getChecks()); + } + leakCheckList = null; + return output; + } + + public static void runStopLogProcessThread() { + if (StopLogProcessThread.count == 0) { + Display.getDefault().syncExec(new Runnable() { + @Override + public void run() { + StateManager.getInstance().StopProcessStart( + "unknown error(2)"); + } + }); + StopLogProcessThread.count++; + stopLogProcessThread = new Thread(null, new StopLogProcessThread(), + AnalyzerConstants.STOP_LOG_THREAD); + stopLogProcessThread.start(); + } + } + + public static void runStartStopThread() { + if (RecordStartStopThread.count == 0) { + RecordStartStopThread.count++; + startStopThread = new Thread(null, new RecordStartStopThread(), + AnalyzerConstants.START_STOP_THREAD); + startStopThread.start(); + } + } + + public static boolean isOsp() { + int type = Integer.parseInt(getProject().getAppInfo().get( + AnalyzerConstants.APP_INFO_APP_TYPE)); + if (type == AnalyzerConstants.APP_TYPE_OSP) { + return true; + } + return false; + } + + public static void setAutoStartDeviceName(String device) { + autoStartDeviceName = device; + } + + public static String getAutoStartDeviceName() { + return autoStartDeviceName; + } + + public static void setAutoStartApplicationName(String app) { + autoStartApplicationName = app; + } + + public static String getAutoStartApplicationName() { + return autoStartApplicationName; + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ColorResources.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ColorResources.java index d50cf06..5158ecb 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ColorResources.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ColorResources.java @@ -34,10 +34,16 @@ public class ColorResources { public static Color DIALOG_BG_UPPER = getColor("dialg_bg_upper"); public static Color DIALOG_BG_LOWER = getColor("dialg_bg_lower"); + public static Color DIALOG_SUNKEN_1 = getColor("dialg_sunken_1"); + public static Color DIALOG_SUNKEN_2 = getColor("dialg_sunken_2"); + + public static Color EDIT_CHART_DIALOG_UPPER = getColor("edit_chart_dialog_upper"); + public static Color EDIT_CHART_DIALOG_LOWER = getColor("edit_chart_dialog_lower"); public static Color VIEW_BORDER = getColor("view_border"); //$NON-NLS-1$ public static Color VIEW_BG_COLOR = getColor("view_bg_color"); //$NON-NLS-1$ public static Color VIEW_TITLE_FONT_COLOR = getColor("view_title_font_color"); + /** title bar colors **/ public static Color TITLEBAR_TEXT_COLOR = getColor("titlebar_text_color"); //$NON-NLS-1$ public static Color TITLEBAR_BG_COLOR = getColor("titlebar_bg"); //$NON-NLS-1$ @@ -85,6 +91,11 @@ public class ColorResources { public static Color BUTTON_PUSH_COLOR_START = getColor("button_push_color_start"); //$NON-NLS-1$ public static Color BUTTON_PUSH_COLOR_END = getColor("button_push_color_end"); //$NON-NLS-1$ + public static Color BUTTON_OUTLINE_NORMAL_IN_COLOR = getColor("button_outline_normal_in_color"); //$NON-NLS-1$ + public static Color BUTTON_OUTLINE_PUSH_IN_COLOR = getColor("button_outline_push_in_color"); //$NON-NLS-1$ + public static Color BUTTON_OUTLINE_HOVER_IN_COLOR = getColor("button_outline_hover_in_color"); //$NON-NLS-1$ + public static Color BUTTON_OUTLINE_DISABLE_IN_COLOR = getColor("button_outline_disable_in_color"); //$NON-NLS-1$ + public static Color BUTTON_OUTLINE_NORMAL_COLOR = getColor("button_outline_normal_color"); //$NON-NLS-1$ public static Color BUTTON_OUTLINE_PUSH_COLOR = getColor("button_outline_push_color"); //$NON-NLS-1$ public static Color BUTTON_OUTLINE_HOVER_COLOR = getColor("button_outline_hover_color"); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/PathManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/PathManager.java index 1e09280..0803df9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/PathManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/PathManager.java @@ -15,7 +15,7 @@ import org.tizen.dynamicanalyzer.constants.AnalyzerConstants; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener; -import org.tizen.dynamicanalyzer.widgets.daialog.DADailog; +import org.tizen.dynamicanalyzer.widgets.dialog.DADilog; public class PathManager { @@ -150,8 +150,8 @@ public class PathManager { public static void pathCheck() { if (null == AnalyzerConstants.TIZEN_ROOT_PATH) { final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell(); - DADailog daDailog = new DADailog(shell, SWT.NONE); - DADailog dialog = daDailog; + DADilog daDailog = new DADilog(shell, SWT.NONE); + DADilog dialog = daDailog; dialog.setBgColor(ColorResources.VIEW_BG_COLOR); dialog.setIcon(ImageResources.DYNAIC_ANALYZER_ICON); dialog.setMessage("Please install the Tizen SDK"); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/StateManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/StateManager.java index 520f557..edb01fd 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/StateManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/StateManager.java @@ -27,8 +27,7 @@ public class StateManager { return; state = STOP_PROCESS_START; Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell(); - dialog = new StopProgressDialog(shell, SWT.NO_TRIM - | SWT.APPLICATION_MODAL); + dialog = new StopProgressDialog(shell, SWT.APPLICATION_MODAL); dialog.open(); if (null != dialog) dialog.setProcessMessage(EndMessage); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeBlack.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeBlack.java index f3fd434..438456e 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeBlack.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeBlack.java @@ -21,6 +21,10 @@ public class DAThemeBlack extends DATheme { setColor("window_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$ setColor("dialg_bg_upper", new RGB(51, 52, 53)); setColor("dialg_bg_lower", new RGB(0, 0, 0)); + setColor("dialg_sunken_1", new RGB(39, 39, 40)); + setColor("dialg_sunken_2", new RGB(39, 39, 40)); + setColor("edit_chart_dialog_upper", new RGB(0, 0, 0)); + setColor("edit_chart_dialog_lower", new RGB(39, 39, 40)); setColor("view_border", new RGB(74, 74, 74)); //$NON-NLS-1$ setColor("view_bg_color", new RGB(66, 66, 68)); //$NON-NLS-1$ @@ -67,9 +71,14 @@ public class DAThemeBlack extends DATheme { setColor("button_disable_color_start", new RGB(74, 74, 74)); setColor("button_disable_color_end", new RGB(50, 50, 50)); + setColor("button_outline_normal_in_color", new RGB(120, 120, 120)); + setColor("button_outline_push_in_color", new RGB(120, 120, 120)); + setColor("button_outline_hover_in_color", new RGB(120, 120, 120)); + setColor("button_outline_disable_in_color", new RGB(115, 115, 115)); + setColor("button_outline_normal_color", new RGB(160, 160, 160)); setColor("button_outline_push_color", new RGB(115, 115, 115)); - setColor("button_outline_hover_color", new RGB(115, 115, 115)); + setColor("button_outline_hover_color", new RGB(50, 185, 231)); setColor("button_outline_disable_color", new RGB(115, 115, 115)); setColor("button_normal_font_color", new RGB(255, 255, 255)); @@ -117,23 +126,19 @@ public class DAThemeBlack extends DATheme { setColor("open_trace_temp_contents_color", new RGB(255, 85, 57)); setColor("open_trace_table_outline_color", new RGB(123, 124, 124)); - setColor("open_trace_table_content_normal_color1", new RGB(78, 78, - 79)); - setColor("open_trace_table_content_hover_color1", - new RGB(72, 98, 108)); + setColor("open_trace_table_content_normal_color1", new RGB(78, 78, 79)); + setColor("open_trace_table_content_hover_color1", new RGB(72, 98, 108)); setColor("open_trace_table_content_selected_start_color1", new RGB(0, 146, 193)); - setColor("open_trace_table_content_selected_end_color1", new RGB(0, - 60, 79)); + setColor("open_trace_table_content_selected_end_color1", new RGB(0, 60, + 79)); - setColor("open_trace_table_content_normal_color2", new RGB(84, 85, - 86)); - setColor("open_trace_table_content_hover_color2", - new RGB(72, 98, 108)); + setColor("open_trace_table_content_normal_color2", new RGB(84, 85, 86)); + setColor("open_trace_table_content_hover_color2", new RGB(72, 98, 108)); setColor("open_trace_table_content_selected_start_color2", new RGB(0, 146, 193)); - setColor("open_trace_table_content_selected_end_color2", new RGB(0, - 60, 79)); + setColor("open_trace_table_content_selected_end_color2", new RGB(0, 60, + 79)); setColor("open_trace_button_composite_bg_color", new RGB(39, 39, 40)); @@ -215,12 +220,9 @@ public class DAThemeBlack extends DATheme { setColor("barGRAY3", new RGB(216, 216, 216)); //$NON-NLS-1$ /* Timeline */ - setColor("item blue right", //$NON-NLS-1$ - new RGB(131, 196, 218));//$NON-NLS-1$ - setColor("item blue dark", //$NON-NLS-1$ - new RGB(38, 104, 138));//$NON-NLS-1$ - setColor("item background", new RGB(50, //$NON-NLS-1$ - 50, 50));//$NON-NLS-1$ + setColor("item blue right", new RGB(131, 196, 218));//$NON-NLS-1$ + setColor("item blue dark", new RGB(38, 104, 138));//$NON-NLS-1$ + setColor("item background", new RGB(50, 50, 50));//$NON-NLS-1$ setColor("timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$ setColor("timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$ @@ -241,8 +243,8 @@ public class DAThemeBlack extends DATheme { setColor("cpu_bar_graph_bg_color", new RGB(43, 44, 45)); setColor("process_bar_graph_color", new RGB(114, 203, 8)); //$NON-NLS-1$ - setColor("process_bar_graph_center_color", new RGB(0, 0, 0)); //$NON-NLS-1$ - setColor("process_bar_graph_bg_color", new RGB(43, 44, 45)); //$NON-NLS-1$ + setColor("process_bar_graph_center_color", new RGB(43, 44, 45)); //$NON-NLS-1$ + setColor("process_bar_graph_bg_color", new RGB(79, 79, 81)); //$NON-NLS-1$ setColor("profiling_graph_color_start", new RGB(145, 190, 3)); //$NON-NLS-1$ setColor("profiling_graph_color_end", new RGB(114, 149, 1)); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeWhite.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeWhite.java index d8d93dc..b9a9dd6 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeWhite.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/theme/DAThemeWhite.java @@ -21,6 +21,10 @@ public class DAThemeWhite extends DATheme { setColor("window_bg_color", new RGB(230, 230, 230)); //$NON-NLS-1$ setColor("dialg_bg_upper", new RGB(206, 206, 206)); setColor("dialg_bg_lower", new RGB(240, 240, 240)); + setColor("dialg_sunken_1", new RGB(160, 160, 160)); + setColor("dialg_sunken_2", new RGB(255, 255, 255)); + setColor("edit_chart_dialog_upper", new RGB(255, 255, 255)); + setColor("edit_chart_dialog_lower", new RGB(240, 240, 240)); setColor("view_border", new RGB(206, 206, 206)); //$NON-NLS-1$ setColor("view_bg_color", new RGB(230, 230, 230)); //$NON-NLS-1$ @@ -40,36 +44,45 @@ public class DAThemeWhite extends DATheme { setColor("device_application_popup_outer_2", new RGB(50, 185, 231)); //$NON-NLS-1$ setColor("device_application_item_normal_top", new RGB(255, 255, 255)); //$NON-NLS-1$ setColor("device_application_item_normal_inner", new RGB(230, 230, 230)); //$NON-NLS-1$ - setColor("device_application_item_normal_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$ + setColor( + "device_application_item_normal_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$ setColor("device_application_item_select_top", new RGB(255, 255, 255)); //$NON-NLS-1$ setColor("device_application_item_select_inner", new RGB(50, 185, 231)); //$NON-NLS-1$ - setColor("device_application_item_select_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$ + setColor( + "device_application_item_select_bottom", new RGB(189, 189, 189)); //$NON-NLS-1$ /** device and application combo specific colors end **/ /*** combo button gradation ***/ - setColor("device_application_button_normal_start", new RGB(221, 221, 221)); //$NON-NLS-1$ + setColor( + "device_application_button_normal_start", new RGB(221, 221, 221)); //$NON-NLS-1$ setColor("device_application_button_normal_end", new RGB(157, 157, 157)); //$NON-NLS-1$ setColor("device_application_button_push_start", new RGB(24, 147, 189)); //$NON-NLS-1$ setColor("device_application_button_push_end", new RGB(24, 147, 189)); //$NON-NLS-1$ setColor("device_application_button_hover_start", new RGB(50, 185, 231)); //$NON-NLS-1$ setColor("device_application_button_hover_end", new RGB(50, 185, 231)); //$NON-NLS-1$ - setColor("device_application_button_disable_start", new RGB(157, 157, 157)); //$NON-NLS-1$ + setColor( + "device_application_button_disable_start", new RGB(157, 157, 157)); //$NON-NLS-1$ setColor("device_application_button_disable_end", new RGB(78, 79, 81)); //$NON-NLS-1$ setColor("device_application_button_outline", new RGB(31, 31, 31)); /*** common button colors ***/ - setColor("button_normal_color_start", new RGB(255, 255, 255)); - setColor("button_normal_color_end", new RGB(178, 178, 178)); + setColor("button_normal_color_start", new RGB(240, 240, 240)); + setColor("button_normal_color_end", new RGB(163, 163, 163)); setColor("button_push_color_start", new RGB(163, 163, 163)); - setColor("button_push_color_end", new RGB(206, 206, 206)); - setColor("button_hover_color_start", new RGB(61, 67, 72)); - setColor("button_hover_color_end", new RGB(65, 77, 85)); + setColor("button_push_color_end", new RGB(240, 240, 240)); + setColor("button_hover_color_start", new RGB(240, 240, 240)); + setColor("button_hover_color_end", new RGB(163, 163, 163)); setColor("button_disable_color_start", new RGB(206, 206, 206)); setColor("button_disable_color_end", new RGB(163, 163, 163)); - setColor("button_outline_normal_color", new RGB(160, 160, 160)); - setColor("button_outline_push_color", new RGB(10, 113, 178)); - setColor("button_outline_hover_color", new RGB(10, 113, 178)); + setColor("button_outline_normal_in_color", new RGB(120, 120, 120)); + setColor("button_outline_push_in_color", new RGB(120, 120, 120)); + setColor("button_outline_hover_in_color", new RGB(120, 120, 120)); + setColor("button_outline_disable_in_color", new RGB(115, 115, 115)); + + setColor("button_outline_normal_color", new RGB(203, 230, 230)); + setColor("button_outline_push_color", new RGB(203, 203, 203)); + setColor("button_outline_hover_color", new RGB(50, 185, 231)); setColor("button_outline_disable_color", new RGB(115, 115, 115)); setColor("button_normal_font_color", new RGB(0, 0, 0)); @@ -215,12 +228,9 @@ public class DAThemeWhite extends DATheme { setColor("barGRAY3", new RGB(216, 216, 216)); //$NON-NLS-1$ /* Timeline */ - setColor("item blue right", //$NON-NLS-1$ - new RGB(131, 196, 218));//$NON-NLS-1$ - setColor("item blue dark", //$NON-NLS-1$ - new RGB(38, 104, 138));//$NON-NLS-1$ - setColor("item background", new RGB(50, //$NON-NLS-1$ - 50, 50));//$NON-NLS-1$ + setColor("item blue right", new RGB(131, 196, 218));//$NON-NLS-1$ + setColor("item blue dark", new RGB(38, 104, 138));//$NON-NLS-1$ + setColor("item background", new RGB(50, 50, 50));//$NON-NLS-1$ setColor("timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$ setColor("timeline_bg", new RGB(50, 50, 50)); //$NON-NLS-1$ @@ -242,7 +252,7 @@ public class DAThemeWhite extends DATheme { setColor("process_bar_graph_color", new RGB(119, 163, 0)); //$NON-NLS-1$ setColor("process_bar_graph_center_color", new RGB(230, 230, 230)); //$NON-NLS-1$ - setColor("process_bar_graph_bg_color", new RGB(255, 255, 255)); //$NON-NLS-1$ + setColor("process_bar_graph_bg_color", new RGB(79, 79, 81)); //$NON-NLS-1$ setColor("profiling_graph_color_start", new RGB(145, 190, 3)); //$NON-NLS-1$ setColor("profiling_graph_color_end", new RGB(114, 149, 1)); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineEditItemsDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineEditItemsDialog.java index a214b93..520d737 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineEditItemsDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineEditItemsDialog.java @@ -18,11 +18,16 @@ import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -126,14 +131,22 @@ public class TimelineEditItemsDialog extends Dialog { shell.setFont(FontResources.EDIT_CHART_DLG_TITLE); shell.setBackground(ColorResources.WINDOW_BG_COLOR); shell.setSize(446, 450); + shell.setLayout(new FormLayout()); GridLayout editoeLayout = new GridLayout(); Composite editorContainer = new Composite(shell, SWT.NONE); + editorContainer.setLayout(editoeLayout); - editorContainer.setLayoutData(new GridData(GridData.FILL_BOTH)); - editorContainer.setBackground(ColorResources.WINDOW_BG_COLOR); - shell.setLayout(editoeLayout); - chartTableViewer = new TableViewer(editorContainer, SWT.MULTI| SWT.FULL_SELECTION | SWT.BORDER); + + FormData data = new FormData(); + data.top = new FormAttachment(0, 0); + data.bottom = new FormAttachment(100, -49); + data.left = new FormAttachment(0, 0); + data.right = new FormAttachment(100, 0); + editorContainer.setLayoutData(data); + editorContainer.setBackground(ColorResources.EDIT_CHART_DIALOG_UPPER); + chartTableViewer = new TableViewer(editorContainer, SWT.MULTI + | SWT.FULL_SELECTION | SWT.BORDER); GridData tableGridData = new GridData(GridData.FILL_BOTH); chartTableViewer.getTable().setLayoutData(tableGridData); chartTableViewer.getTable().setLinesVisible(true); @@ -377,31 +390,50 @@ public class TimelineEditItemsDialog extends Dialog { } }); - Composite buttonComp = new Composite(shell, SWT.PUSH); - GridLayout bcfLayout = new GridLayout(); - bcfLayout.numColumns = 2; - buttonComp.setLayout(bcfLayout); - GridData bcgd = new GridData(); - buttonComp.setLayoutData(bcgd); - buttonComp.setBackground(ColorResources.WINDOW_BG_COLOR); - bcgd.horizontalAlignment = GridData.CENTER; + Composite buttonComp = new Composite(shell, SWT.NONE); + buttonComp.setBackground(ColorResources.EDIT_CHART_DIALOG_LOWER); + buttonComp.setLayout(new FormLayout()); + data = new FormData(); + data.top = new FormAttachment(editorContainer, 0); + data.bottom = new FormAttachment(100, 0); + data.left = new FormAttachment(0, 0); + data.right = new FormAttachment(100, 0); + buttonComp.setLayoutData(data); DAButton okButton = new DAButton(buttonComp, SWT.PUSH); okButton.addClickListener(okButtonListener); okButton.setText("OK"); //$NON-NLS-1$ - GridData bgd = new GridData(); - bgd.widthHint = 100; - bgd.heightHint = 34; - okButton.setLayoutData(bgd); + data = new FormData(); + data.top = new FormAttachment(0, 8); + data.left = new FormAttachment(0, 119); + data.height = 34; + data.width = 100; + okButton.setLayoutData(data); DAButton cancelButton = new DAButton(buttonComp, SWT.PUSH); // cancelButton.addListener(SWT.Selection, cancelButtonListener); cancelButton.addClickListener(cancelButtonListener); cancelButton.setText("CANCEL"); //$NON-NLS-1$ - GridData cbgd = new GridData(); - cbgd.widthHint = 100; - cbgd.heightHint = 34; - cancelButton.setLayoutData(cbgd); + data = new FormData(); + data.top = new FormAttachment(0, 8); + data.left = new FormAttachment(okButton, 8); + data.height = 34; + data.width = 100; + cancelButton.setLayoutData(data); + + buttonComp.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + Composite comp = (Composite) e.widget; + Rectangle rect = comp.getClientArea(); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1); + e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2); + e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width, + rect.y + 1); + } + }); shell.open(); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineTick.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineTick.java index afc3036..d0228c9 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineTick.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineTick.java @@ -119,6 +119,7 @@ public class TimelineTick { gLayout.horizontalSpacing = 0; gLayout.verticalSpacing = 0; addItemComp.setLayout(gLayout); + addItemComp.setBackground(ColorResources.RED); addItems = new DACustomButton(addItemComp, ImageResources.ADD_ITEMS_NORMAL, ImageResources.ADD_ITEMS_PUSH, diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/renderers/DAButtonRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/renderers/DAButtonRenderer.java new file mode 100644 index 0000000..c46262d --- /dev/null +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/renderers/DAButtonRenderer.java @@ -0,0 +1,49 @@ +package org.tizen.dynamicanalyzer.ui.renderers; + +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Rectangle; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; +import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer; +import org.tizen.dynamicanalyzer.widgets.button.DACustomWidgetAttribute; +import org.tizen.dynamicanalyzer.widgets.helper.ColorResources; + +public class DAButtonRenderer extends DACustomButtonRenderer { + @Override + public void drawButton(GC gc, Rectangle rect, int state, + DACustomWidgetAttribute attr) { + if (attr.getDrawType() == DACustomButton.TYPE_COLOR) { + gc.setBackground(attr.getColor(state)); + gc.fillRectangle(rect); + } else { + int index = state * 2; + gc.setForeground(attr.getColor(index)); + gc.setBackground(attr.getColor(index + 1)); + gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, + true); + } + + Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1); + if (attr.getButtonImage() == null) { + drawButtonText(gc, r, attr, state); + } + Color c = gc.getForeground(); + if (null != attr.getOutlineColor(state)) { + gc.setForeground(attr.getOutlineColor(state)); + } else { + gc.setForeground(ColorResources.BLACK); + } + gc.drawRectangle(r); + + Rectangle ir = new Rectangle(r.x + 1, r.y + 1, r.width - 2, + r.height - 2); + if (null != attr.getOutlineInColor(state)) { + gc.setForeground(attr.getOutlineInColor(state)); + } else { + gc.setForeground(c); + return; + } + gc.drawRectangle(ir); + gc.setForeground(c); + } +} diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/CoolbarArea.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/CoolbarArea.java index 615f48c..00f3b12 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/CoolbarArea.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/views/CoolbarArea.java @@ -28,7 +28,6 @@ import org.tizen.dynamicanalyzer.FontResources; import org.tizen.dynamicanalyzer.ImageResources; import org.tizen.dynamicanalyzer.ResourceCommunicator; import org.tizen.dynamicanalyzer.StateManager; -import org.tizen.dynamicanalyzer.SymbolNameDemangler; import org.tizen.dynamicanalyzer.constants.AnalyzerConstants; import org.tizen.dynamicanalyzer.constants.DesignConstants; import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/AboutDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/AboutDialog.java index 0588e49..5fd56cd 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/AboutDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/AboutDialog.java @@ -1,7 +1,10 @@ package org.tizen.dynamicanalyzer.ui.widgets; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; @@ -120,6 +123,21 @@ public class AboutDialog { FormLayout compLayout = new FormLayout(); buttonComp.setLayout(compLayout); buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER); + + buttonComp.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + Composite comp = (Composite) e.widget; + Rectangle rect = comp.getClientArea(); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1); + e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2); + e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width, + rect.y + 1); + } + }); + FormData compData = new FormData(); compData.top = new FormAttachment(base, 0); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAButton.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAButton.java index 6559a64..0546923 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAButton.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAButton.java @@ -3,6 +3,7 @@ package org.tizen.dynamicanalyzer.ui.widgets; import org.eclipse.swt.widgets.Composite; import org.tizen.dynamicanalyzer.ColorResources; import org.tizen.dynamicanalyzer.FontResources; +import org.tizen.dynamicanalyzer.ui.renderers.DAButtonRenderer; import org.tizen.dynamicanalyzer.widgets.button.DACustomButton; public class DAButton extends DACustomButton { @@ -25,6 +26,11 @@ public class DAButton extends DACustomButton { ColorResources.BUTTON_OUTLINE_PUSH_COLOR, ColorResources.BUTTON_OUTLINE_HOVER_COLOR, ColorResources.BUTTON_OUTLINE_DISABLE_COLOR); + setOutlineInColors(ColorResources.BUTTON_OUTLINE_NORMAL_IN_COLOR, + ColorResources.BUTTON_OUTLINE_PUSH_IN_COLOR, + ColorResources.BUTTON_OUTLINE_HOVER_IN_COLOR, + ColorResources.BUTTON_OUTLINE_DISABLE_IN_COLOR); setFont(FontResources.DIALOG_BUTTON_FONT); + this.setRenderer(new DAButtonRenderer()); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/LicenseDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/LicenseDialog.java index 1494b6c..9da6a07 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/LicenseDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/LicenseDialog.java @@ -8,6 +8,9 @@ import java.io.IOException; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; @@ -79,6 +82,7 @@ public class LicenseDialog extends Window { FormLayout shellLayout = new FormLayout(); shell.setLayout(shellLayout); shell.setText(AnalyzerLabels.LICENSE); + shell.setBackground(ColorResources.DIALOG_BG_UPPER); Composite base = new Composite(shell.getShell(), SWT.NONE); base.setLayout(new FormLayout()); @@ -89,16 +93,16 @@ public class LicenseDialog extends Window { baseData.bottom = new FormAttachment(100, 0); base.setLayoutData(baseData); base.setVisible(true); - base.setBackground(ColorResources.DIALOG_BG_LOWER); + base.setBackground(ColorResources.DIALOG_BG_UPPER); // Contents - Text contents = new Text(base, SWT.MULTI | SWT.WRAP); + Text contents = new Text(base, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY); contents.setForeground(ColorResources.DEFAULT_FONT_COLOR); contents.setBackground(ColorResources.DIALOG_BG_UPPER); contents.setText(getLicenseString()); FormData labelData = new FormData(); - labelData.left = new FormAttachment(0, 10); + labelData.left = new FormAttachment(0, 20); labelData.right = new FormAttachment(100, -10); labelData.top = new FormAttachment(0, 10); labelData.bottom = new FormAttachment(100, -51); @@ -108,7 +112,19 @@ public class LicenseDialog extends Window { FormLayout compLayout = new FormLayout(); buttonComp.setLayout(compLayout); buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER); - + buttonComp.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + Composite comp = (Composite) e.widget; + Rectangle rect = comp.getClientArea(); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1); + e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2); + e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width, + rect.y + 1); + } + }); FormData compData = new FormData(); compData.top = new FormAttachment(contents, 0); compData.left = new FormAttachment(0, 0); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/OpenTraceDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/OpenTraceDialog.java index 1071d7a..f144ead 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/OpenTraceDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/OpenTraceDialog.java @@ -8,8 +8,11 @@ import org.eclipse.nebula.widgets.grid.Grid; import org.eclipse.nebula.widgets.grid.GridColumn; import org.eclipse.nebula.widgets.grid.GridItem; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; @@ -231,6 +234,19 @@ public class OpenTraceDialog extends Window { compData.bottom = new FormAttachment(100, 0); buttonComp.setLayoutData(compData); + buttonComp.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + Composite comp = (Composite) e.widget; + Rectangle rect = comp.getClientArea(); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1); + e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y); + e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2); + e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width, + rect.y + 1); + } + }); okButton = new DAButton(buttonComp, SWT.NONE); okButton.addClickListener(okButtonListener); okButton.setText("Open"); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/StopProgressDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/StopProgressDialog.java index 4054409..dab42da 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/StopProgressDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/StopProgressDialog.java @@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.Shell; import org.tizen.dynamicanalyzer.ColorResources; import org.tizen.dynamicanalyzer.FontResources; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; +import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; public class StopProgressDialog { private Shell parent = null; @@ -40,6 +41,7 @@ public class StopProgressDialog { shell = new Shell(parent, style); this.parent = parent; createContents(); + AnalyzerUtil.setCenter(shell); } public StopProgressDialog(Shell parent, int style, long excuteTime) { @@ -89,11 +91,11 @@ public class StopProgressDialog { setDefaultSize(parent.getBounds()); FormLayout dialogLayout = new FormLayout(); shell.setLayout(dialogLayout); - shell.setBackground(ColorResources.NORMAL_VIEW_LAYOUT_OUTER); + shell.setBackground(ColorResources.DIALOG_BG_UPPER); Composite base = new Composite(shell, SWT.NONE); base.setLayout(new FormLayout()); - base.setBackground(ColorResources.WINDOW_BG_COLOR); + base.setBackground(ColorResources.DIALOG_BG_UPPER); FormData baseData = new FormData(); baseData.top = new FormAttachment(0, 1); @@ -106,17 +108,17 @@ public class StopProgressDialog { // Process Message processMessage = new Label(base, SWT.NONE); processMessage.setText(message); - processMessage.setBackground(ColorResources.WINDOW_BG_COLOR); + processMessage.setBackground(ColorResources.DIALOG_BG_UPPER); processMessage.setAlignment(SWT.LEFT); - processMessage.setForeground(ColorResources.WHITE); + processMessage.setForeground(ColorResources.DEFAULT_FONT_COLOR); processMessage.setFont(FontResources.ABOUT_TEXT); // Process Infomation processInfo = new Label(base, SWT.NONE); processInfo.setText(infomation); - processInfo.setBackground(ColorResources.WINDOW_BG_COLOR); + processInfo.setBackground(ColorResources.DIALOG_BG_UPPER); processInfo.setAlignment(SWT.LEFT); - processInfo.setForeground(ColorResources.WHITE); + processInfo.setForeground(ColorResources.DEFAULT_FONT_COLOR); processInfo.setFont(FontResources.ABOUT_TEXT); // Process Bar diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java index 4be0214..19a1e24 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java @@ -20,9 +20,11 @@ import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; @@ -423,5 +425,23 @@ public class AnalyzerUtil { // Directory is empty so delete return file.delete(); } + + + // use : no title bar window + public static void setCenter(Shell shell) + { + Shell parent = shell.getParent().getShell(); + + Rectangle pRect = parent.getBounds(); + Rectangle pChild = shell.getBounds(); + + int deltaX = pRect.width - pChild.width; + int deltaY = pRect.height - pChild.height; + + int childX = pRect.x + deltaX / 2; + int childY = pRect.y + deltaY / 2; + + shell.setLocation(childX, childY); + } } -- 2.7.4