public static Color EXPLORER_CELL_BG = getColor("explorer_cell_bg_color"); //$NON-NLS-1$\r
public static Color EXPLORER_CELL_LINE = getColor("explorer_cell_line_color"); //$NON-NLS-1$\r
\r
+ // setting\r
+ public static Color SETTING_STROKE = getColor("setting_stroke"); //$NON-NLS-1$\r
+ public static Color SETTING_SUNKEN_LINE_1 = getColor("setting_sunken_line_1"); //$NON-NLS-1$\r
+ public static Color SETTING_SUNKEN_LINE_2 = getColor("setting_sunken_line_2"); //$NON-NLS-1$\r
+ public static Color SETTING_TITLE_BACKGROUND = getColor("setting_title_background"); //$NON-NLS-1$\r
+ \r
+ public static Color SETTING_BUTTON_NORMAL_COLOR = getColor("setting_button_normal_color"); //$NON-NLS-1$\r
+ public static Color SETTING_BUTTON_HOVER_COLOR = getColor("setting_button_hover_color"); //$NON-NLS-1$\r
+ public static Color SETTING_BUTTON_PUSH_COLOR = getColor("setting_button_push_color"); //$NON-NLS-1$\r
+ public static Color SETTING_BUTTON_DISABLE_COLOR = getColor("setting_button_disable_color"); //$NON-NLS-1$\r
+ public static Color SETTING_BUTTON_TOGGLE_NORMAL_COLOR = getColor("setting_button_toggle_normal_color"); //$NON-NLS-1$\r
+ public static Color SETTING_BUTTON_TOGGLE_HOVER_COLOR = getColor("setting_button_toggle_hover_color"); //$NON-NLS-1$\r
+ public static Color SETTING_BUTTON_TOGGLE_PUSH_COLOR = getColor("setting_button_toggle_push_color"); //$NON-NLS-1$\r
+\r
+ public static Color SETTING_COLOR = getColor("setting_font_color");//$NON-NLS-1$\r
+ \r
+ /** setting table colors start **/\r
+ public static Color SETTING_TABLE_HEADER_BG = getColor("setting_table_header_bg"); //$NON-NLS-1$\r
+// public static Color SETTING_TABLE_LINE = getColor("setting_table_line"); //$NON-NLS-1$\r
+// public static Color SETTING_TABLE_CONTENTS_NORMAL = getColor("setting_table_contents_normal"); //$NON-NLS-1$\r
+// public static Color SETTING_TABLE_CONTENTS_HOVER = getColor("setting_table_contents_hover"); //$NON-NLS-1$\r
+ public static Color SETTING_TABLE_CONTENTS_SELECTED_START = getColor("setting_table_contents_selected_start"); //$NON-NLS-1$\r
+ public static Color SETTING_TABLE_CONTENTS_SELECTED_END = getColor("setting_table_contents_selected_end"); //$NON-NLS-1$\r
+ public static Color SETTING_TABLE_CONTENTS_SELECTED_FONT_COLOR = getColor("setting_table_contents_selected_font_color"); //$NON-NLS-1$\r
+ public static Color SETTING_TABLE_HEADER_FONT_COLOR = getColor("setting_table_title_font_color"); //$NON-NLS-1$\r
+ public static Color SETTING_TABLE_CONTENTS_FONT_COLOR = getColor("setting_table_contents_font_color"); //$NON-NLS-1$\r
+// public static Color SETTING_TABLE_CONTENTS_FAILED_BACGOUND_COLOR = getColor("setting_table_contents_failed_bacgound_color"); //$NON-NLS-1$\r
+// public static Color SETTING_TABLE_CONTENTS_FAILED_FONT_COLOR = getColor("setting_table_contents_failed_font_color"); //$NON-NLS-1$\r
+ /** setting table colors end **/\r
+\r
+ \r
// public static void initColors() {\r
// WINDOW_BG_COLOR = getColor("window_bg_color"); //$NON-NLS-1$\r
//\r
public static final Font TIMELINE_BALLOON_FONT = getFont(\r
"time_balloon", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
\r
+ // setting\r
+ public static final Font SETTING_BUTTON_FONT = getFont(\r
+ "setting_button_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ \r
+ public static final Font SETTING_TITLE_FONT = getFont(\r
+ "setting_title_font", resizeDefaultFont(9, 3));//$NON-NLS-1$\r
+ \r
+ public static final Font SETTING_DESCRIPTION_FONT = getFont(\r
+ "setting_description_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
+ // mac 11\r
+ \r
private static Font getFont(String fontName, FontData[] fontData) {\r
if (!fontRegistry.hasValueFor(fontName)) {\r
fontRegistry.put(fontName, fontData);\r
public static final Image SCREEN_SHOT_HOVER = getPngImage("toolbar_screen_shot_hover"); //$NON-NLS-1$\r
public static final Image SCREEN_SHOT_DISABLE = getPngImage("toolbar_screen_shot_disable"); //$NON-NLS-1$\r
\r
+ /* setting */\r
+ public static final Image TARGET_MOBILE_2_3 = getPngImage("feature_target_tv"); //$NON-NLS-1$\r
+ public static final Image TARGET_TV = getPngImage("feature_target_mobile"); //$NON-NLS-1$\r
+ \r
+ public static final Image TEMPLATE_BOTTLENECK_ANALYSIS = getPngImage("feature_template_bottleneck"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_MEMORY_LEAK = getPngImage("feature_template_memoryleaks"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_PROCESS_ACTIVITY = getPngImage("feature_template_processactivity"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_FILE_ANALYSIS = getPngImage("feature_template_file"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_THREAD_ACTIVITY_ANALYSIS = getPngImage("feature_template_threadactivity"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_WAIT_STATUS_ANALYSIS = getPngImage("feature_template_waitstatus"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_NETWORK_ANALYSIS = getPngImage("feature_template_network"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_OPEN_GL_ANALYSIS = getPngImage("feature_template_opengl"); //$NON-NLS-1$\r
+ public static final Image TEMPLATE_ENERGY = getPngImage("feature_template_energy"); //$NON-NLS-1$\r
+\r
+ \r
private static Image getImage(String pluginId, String folderName,\r
String imageName, String extension) {\r
if (null == imageRegistry.get(imageName)\r
setColor("explorer_select_end_color", new RGB(109, 219, 255)); //$NON-NLS-1$
setColor("explorer_cell_bg_color", new RGB(250, 250, 250)); //$NON-NLS-1$
setColor("explorer_cell_line_color", new RGB(186, 186, 186)); //$NON-NLS-1$
+
+
+ /*** setting ***/
+ setColor("setting_stroke", new RGB(186, 186, 186)); //$NON-NLS-1$
+ setColor("setting_sunken_line_1", new RGB(160, 160, 160)); //$NON-NLS-1$
+ setColor("setting_sunken_line_2", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("setting_title_background", new RGB(235, 252, 254)); //$NON-NLS-1$
+
+ setColor("setting_button_normal_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("setting_button_hover_color", new RGB(197, 231, 235)); //$NON-NLS-1$
+ setColor("setting_button_push_color", new RGB(197, 231, 235)); //$NON-NLS-1$
+ setColor("setting_button_disable_color", new RGB(255, 255, 255)); //$NON-NLS-1$
+ setColor("setting_button_toggle_normal_color", new RGB(117, 223, 235)); //$NON-NLS-1$
+ setColor("setting_button_toggle_hover_color", new RGB(197, 231, 235)); //$NON-NLS-1$
+ setColor("setting_button_toggle_push_color", new RGB(197, 231, 235)); //$NON-NLS-1$
+
+ setColor("setting_font_color", new RGB(80, 80, 80)); //$NON-NLS-1$
+
+ /** setting table colors start **/
+ setColor("setting_table_header_bg", new RGB(235, 252, 254)); //$NON-NLS-1$
+// setColor("setting_table_line", new RGB(186, 186, 186)); //$NON-NLS-1$
+// setColor("setting_table_contents_normal", new RGB(255, 255, 255)); //$NON-NLS-1$
+// setColor("setting_table_contents_hover", new RGB(236, 235, 248)); //$NON-NLS-1$
+ setColor("setting_table_contents_selected_start", new RGB(117, 223, 235)); //$NON-NLS-1$
+ setColor("setting_table_contents_selected_end", new RGB(117, 223, 235)); //$NON-NLS-1$
+ setColor("setting_table_contents_selected_font_color", new RGB(80, 80, 80)); //$NON-NLS-1$
+ setColor("setting_table_title_font_color", new RGB(0, 0, 0)); //$NON-NLS-1$
+ setColor("setting_table_contents_font_color", new RGB(80, 80, 80)); //$NON-NLS-1$
+// setColor("setting_table_contents_failed_bacgound_color", new RGB(244, 199, 197)); //$NON-NLS-1$
+// setColor("setting_table_contents_failed_font_color", new RGB(212, 75, 69)); //$NON-NLS-1$
+ /** setting table colors end **/
}
public Color getColor(String colorName, RGB rgb) {
}
/**
+ * Gets the text of button <br>
+ *
+ * @return the text on the button
+ */
+ public String getText() {
+ return attr.getText();
+ }
+
+ /**
* Sets the icon of Icon button <br>
* image button means background is image. <br>
* icon button means image draws on text field or front of text
package org.tizen.dynamicanalyzer.widgets.button.toggle;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
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.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonAttribute;
+import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
public class DACustomToggleButtonRenderer extends DACustomButtonRenderer {
@Override
}
}
+
+ protected void drawButtonText(GC gc, Rectangle rect,
+ DACustomButtonAttribute attr, int state) {
+ String text = null;
+ Font font = null;
+ Point p = null;
+
+ Rectangle textRect = new Rectangle(rect.x, rect.y, rect.width,
+ rect.height);
+ if (null != attr.getIcon()) {
+ Rectangle iconRect = attr.getIcon().getBounds();
+ textRect.x = textRect.x + iconRect.width;
+ textRect.width = textRect.width - iconRect.width;
+ }
+
+ if (null != (text = attr.getText())) {
+ // set Font
+ if (null == (font = attr.getFont())) {
+ font = new Font(Display.getCurrent(), "Arial", //$NON-NLS-1$
+ computeFontSize(textRect), SWT.NONE);
+ attr.setFont(font);
+ }
+ gc.setFont(font);
+
+ // set Font Point
+ int x = 0, y = 0;
+ int offset = 0;
+ if (null == (p = attr.getFontPoint())) {
+ p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ if (attr.getAlign() == SWT.CENTER) {
+ x = (textRect.width - p.x) / 2 + textRect.x;
+ x = (x < 0) ? 0 : x;
+ offset = -2;
+ } else {
+ x = textRect.x;
+ offset = 2;
+ }
+ y = (textRect.height - p.y) / 2;
+ } else {
+ x = p.x;
+ y = p.y;
+
+ if (x < 0) {
+ p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ if (attr.getAlign() == SWT.CENTER) {
+ x = (textRect.width - p.x) / 2 + textRect.x;
+ x = (x < 0) ? 0 : x;
+ offset = -2;
+ } else {
+ x = textRect.x;
+ offset = 2;
+ }
+ }
+
+ if (y < 0) {
+ p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ y = p.y;
+ }
+ }
+
+ // set Font Color
+ if (null != attr.getFontColor(state)) {
+ gc.setForeground(attr.getFontColor(state));
+ } else {
+ gc.setForeground(ColorResources.BLACK);
+ }
+
+ if (state == DACustomButton.STATE_PUSH) {
+ x += 1;
+ y += 1;
+ }
+
+ // draw string
+ gc.drawString(text, x + offset, y, true);
+ }
+ }
}