BLUE(0, 0, 255),
GREEN(0, 255, 0),
- // nine patch button
+ // 9p button disable
+ BTN_DISABLE(208, 208, 208),
+
+ // 9p gray button
GRAY_BTN_NORMAL(149, 159, 164),
GRAY_BTN_HOVER(149, 159, 164),
GRAY_BTN_PUSH(100, 110, 144),
- GRAY_BTN_DISABLE(184, 184, 184),
+
+ // 9p highlight button
+ HIGHLIGHT_BTN_NORMAL(4, 146, 212),
+ HIGHLIGHT_BTN_HOVER(4, 146, 212),
+ HIGHLIGHT_BTN_PUSH(1, 109, 159),
BLUE_BTN(147, 188, 208),
BACK_BTN_NORMAL_L("3p_back_btn_nml_l"),
BACK_BTN_NORMAL_R("3p_back_btn_nml_r"),
+ // 9p button disable
+ BTN_DISABLE_B("9p_btn_disable_b"),
+ BTN_DISABLE_L("9p_btn_disable_l"),
+ BTN_DISABLE_LB("9p_btn_disable_lb"),
+ BTN_DISABLE_LT("9p_btn_disable_lt"),
+ BTN_DISABLE_R("9p_btn_disable_r"),
+ BTN_DISABLE_RB("9p_btn_disable_rb"),
+ BTN_DISABLE_RT("9p_btn_disable_rt"),
+ BTN_DISABLE_T("9p_btn_disable_t"),
+
// gray 9 patch button
- GRAY_BTN_DISABLE_B("9p_btn_disable_b"),
- GRAY_BTN_DISABLE_L("9p_btn_disable_l"),
- GRAY_BTN_DISABLE_LB("9p_btn_disable_lb"),
- GRAY_BTN_DISABLE_LT("9p_btn_disable_lt"),
- GRAY_BTN_DISABLE_R("9p_btn_disable_r"),
- GRAY_BTN_DISABLE_RB("9p_btn_disable_rb"),
- GRAY_BTN_DISABLE_RT("9p_btn_disable_rt"),
- GRAY_BTN_DISABLE_T("9p_btn_disable_t"),
GRAY_BTN_HOVER_B("9p_btn_hover_b"),
GRAY_BTN_HOVER_L("9p_btn_hover_l"),
GRAY_BTN_HOVER_LB("9p_btn_hover_lb"),
GRAY_BTN_PUSH_RT("9p_btn_push_rt"),
GRAY_BTN_PUSH_T("9p_btn_push_t"),
+ // highlight 9p button
+ HIGHLIGHT_BTN_HOVER_B("9p_highlight_btn_hover_b"),
+ HIGHLIGHT_BTN_HOVER_L("9p_highlight_btn_hover_l"),
+ HIGHLIGHT_BTN_HOVER_LB("9p_highlight_btn_hover_lb"),
+ HIGHLIGHT_BTN_HOVER_LT("9p_highlight_btn_hover_lt"),
+ HIGHLIGHT_BTN_HOVER_R("9p_highlight_btn_hover_r"),
+ HIGHLIGHT_BTN_HOVER_RB("9p_highlight_btn_hover_rb"),
+ HIGHLIGHT_BTN_HOVER_RT("9p_highlight_btn_hover_rt"),
+ HIGHLIGHT_BTN_HOVER_T("9p_highlight_btn_hover_t"),
+ HIGHLIGHT_BTN_NORMAL_B("9p_highlight_btn_normal_b"),
+ HIGHLIGHT_BTN_NORMAL_L ("9p_highlight_btn_normal_l"),
+ HIGHLIGHT_BTN_NORMAL_LB("9p_highlight_btn_normal_lb"),
+ HIGHLIGHT_BTN_NORMAL_LT("9p_highlight_btn_normal_lt"),
+ HIGHLIGHT_BTN_NORMAL_R("9p_highlight_btn_normal_r"),
+ HIGHLIGHT_BTN_NORMAL_RB("9p_highlight_btn_normal_rb"),
+ HIGHLIGHT_BTN_NORMAL_RT("9p_highlight_btn_normal_rt"),
+ HIGHLIGHT_BTN_NORMAL_T("9p_highlight_btn_normal_t"),
+ HIGHLIGHT_BTN_PUSH_B("9p_highlight_btn_push_b"),
+ HIGHLIGHT_BTN_PUSH_L("9p_highlight_btn_push_l"),
+ HIGHLIGHT_BTN_PUSH_LB("9p_highlight_btn_push_lb"),
+ HIGHLIGHT_BTN_PUSH_LT("9p_highlight_btn_push_lt"),
+ HIGHLIGHT_BTN_PUSH_R("9p_highlight_btn_push_r"),
+ HIGHLIGHT_BTN_PUSH_RB("9p_highlight_btn_push_rb"),
+ HIGHLIGHT_BTN_PUSH_RT("9p_highlight_btn_push_rt"),
+ HIGHLIGHT_BTN_PUSH_T("9p_highlight_btn_push_t"),
+
// blue 9 patch button
BLUE_BTN_HOVER_B("9p_blue_btn_hover_b"),
BLUE_BTN_HOVER_L("9p_blue_btn_hover_l"),
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.tizen.emulator.manager.renewal.resources.ColorResources;
-import org.tizen.emulator.manager.ui.renewal.widgets.GrayButton;
+import org.tizen.emulator.manager.ui.renewal.widgets.NinePatchButton;
public class Dialog {
private Composite bodyComp;
private int returnValue = SWT.CANCEL;
- private GrayButton okButton;
+ private NinePatchButton okButton;
protected static final int BORDER_WIDTH = 1;
- public void setOkButton(GrayButton okButton) {
+ public void setOkButton(NinePatchButton okButton) {
this.okButton = okButton;
}
import org.eclipse.swt.widgets.Listener;
import org.tizen.emulator.manager.renewal.resources.ColorResources;
import org.tizen.emulator.manager.ui.renewal.widgets.GrayButton;
+import org.tizen.emulator.manager.ui.renewal.widgets.HighLightButton;
+import org.tizen.emulator.manager.ui.renewal.widgets.NinePatchButton;
public class DialogButtons {
data.verticalAlignment = SWT.CENTER;
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
- makeButton(OK, SWT.OK, data, buttonComp, dialog);
+ HighLightButton button = new HighLightButton(buttonComp, SWT.PUSH);
+ settingButton(button, OK, SWT.OK, data, dialog);
}
private static void makeConfirmCancelButton(Dialog dialog, Composite buttonComp) {
data.verticalAlignment = SWT.CENTER;
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
- GrayButton okButton = makeButton(CONFIRM, SWT.OK, data, buttonComp, dialog);
+ HighLightButton okButton = new HighLightButton(buttonComp, SWT.PUSH);
+ settingButton(okButton, CONFIRM, SWT.OK, data, dialog);
dialog.setOkButton(okButton);
// Cancel button
data = new GridData(BUTTON_WIDTH, BUTTON_HEIGHT);
data.horizontalAlignment = SWT.RIGHT;
data.verticalAlignment = GridData.CENTER;
- makeButton(CANCEL, SWT.CANCEL, data, buttonComp, dialog);
+ GrayButton cancelButton = new GrayButton(buttonComp, SWT.PUSH);
+ settingButton(cancelButton, CANCEL, SWT.CANCEL, data, dialog);
}
- private static GrayButton makeButton(final String text, final int type, GridData data, Composite buttonComp, final Dialog dialog) {
- GrayButton button = new GrayButton(buttonComp, SWT.PUSH);
+ private static void settingButton(NinePatchButton button, final String text,
+ final int type, GridData data, final Dialog dialog) {
+// GrayButton button = new GrayButton(buttonComp, SWT.PUSH);
button.setText(text);
button.setLayoutData(data);
}
}
});
- return button;
}
}
ImageResources.GRAY_BTN_PUSH_LB,
ImageResources.GRAY_BTN_PUSH_L);
- ninePatchResourceMap.setImages(WSTATE.DISABLE_ON, ColorResources.GRAY_BTN_DISABLE,
+ ninePatchResourceMap.setImages(WSTATE.DISABLE_ON, ColorResources.BTN_DISABLE,
ColorResources.BLACK,
- ImageResources.GRAY_BTN_DISABLE_LT,
- ImageResources.GRAY_BTN_DISABLE_T,
- ImageResources.GRAY_BTN_DISABLE_RT,
- ImageResources.GRAY_BTN_DISABLE_R,
- ImageResources.GRAY_BTN_DISABLE_RB,
- ImageResources.GRAY_BTN_DISABLE_B,
- ImageResources.GRAY_BTN_DISABLE_LB,
- ImageResources.GRAY_BTN_DISABLE_L);
+ ImageResources.BTN_DISABLE_LT,
+ ImageResources.BTN_DISABLE_T,
+ ImageResources.BTN_DISABLE_RT,
+ ImageResources.BTN_DISABLE_R,
+ ImageResources.BTN_DISABLE_RB,
+ ImageResources.BTN_DISABLE_B,
+ ImageResources.BTN_DISABLE_LB,
+ ImageResources.BTN_DISABLE_L);
}
@Override
--- /dev/null
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye424.kim@samsung.com>
+ * Minkee Lee <minkee.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho.p@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.emulator.manager.ui.renewal.widgets;
+
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.renewal.resources.ColorResources;
+import org.tizen.emulator.manager.renewal.resources.FontResources;
+import org.tizen.emulator.manager.renewal.resources.ImageResources;
+
+public class HighLightButton extends NinePatchButton {
+
+ private static NinePatchResourceMap ninePatchResourceMap;
+
+ public HighLightButton(Composite parent, int style) {
+ super(parent, style);
+ initFont();
+ initNinePatchResourceMap();
+ }
+
+ protected void initFont() {
+ setButtonFont(FontResources.GRAY_BTN_FONT.getFont());
+ setButtonFontColor(ColorResources.GRAY_BTN_FONT.getColor());
+ }
+
+ private static void initNinePatchResourceMap() {
+ ninePatchResourceMap = new NinePatchResourceMap();
+ ninePatchResourceMap.setImages(WSTATE.NORMAL, ColorResources.HIGHLIGHT_BTN_NORMAL,
+ ColorResources.BLACK,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_LT,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_T,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_RT,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_R,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_RB,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_B,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_LB,
+ ImageResources.HIGHLIGHT_BTN_NORMAL_L);
+
+ ninePatchResourceMap.setImages(WSTATE.HOVER, ColorResources.HIGHLIGHT_BTN_HOVER,
+ ColorResources.BLACK,
+ ImageResources.HIGHLIGHT_BTN_HOVER_LT,
+ ImageResources.HIGHLIGHT_BTN_HOVER_T,
+ ImageResources.HIGHLIGHT_BTN_HOVER_RT,
+ ImageResources.HIGHLIGHT_BTN_HOVER_R,
+ ImageResources.HIGHLIGHT_BTN_HOVER_RB,
+ ImageResources.HIGHLIGHT_BTN_HOVER_B,
+ ImageResources.HIGHLIGHT_BTN_HOVER_LB,
+ ImageResources.HIGHLIGHT_BTN_HOVER_L);
+
+ ninePatchResourceMap.setImages(WSTATE.PUSH, ColorResources.HIGHLIGHT_BTN_PUSH,
+ ColorResources.BLACK,
+ ImageResources.HIGHLIGHT_BTN_PUSH_LT,
+ ImageResources.HIGHLIGHT_BTN_PUSH_T,
+ ImageResources.HIGHLIGHT_BTN_PUSH_RT,
+ ImageResources.HIGHLIGHT_BTN_PUSH_R,
+ ImageResources.HIGHLIGHT_BTN_PUSH_RB,
+ ImageResources.HIGHLIGHT_BTN_PUSH_B,
+ ImageResources.HIGHLIGHT_BTN_PUSH_LB,
+ ImageResources.HIGHLIGHT_BTN_PUSH_L);
+
+ ninePatchResourceMap.setImages(WSTATE.DISABLE_ON, ColorResources.BTN_DISABLE,
+ ColorResources.BLACK,
+ ImageResources.BTN_DISABLE_LT,
+ ImageResources.BTN_DISABLE_T,
+ ImageResources.BTN_DISABLE_RT,
+ ImageResources.BTN_DISABLE_R,
+ ImageResources.BTN_DISABLE_RB,
+ ImageResources.BTN_DISABLE_B,
+ ImageResources.BTN_DISABLE_LB,
+ ImageResources.BTN_DISABLE_L);
+ }
+
+ @Override
+ public NinePatchResourceMap getNinePatchResourceMap() {
+ return ninePatchResourceMap;
+ }
+
+}
\ No newline at end of file