CONTEXT_MENU_T("9p_context_menu_t"),
TITLE_IMAGE("img_titlebar"),
- VMLIST_TITLE_IMAGE("img_title_yourvmlist"),
+ VMLIST_TITLE_IMAGE("img_title_emulatorlist"),
TEMPLATE_LIST_TITLE_IMAGE("img_title_templates"),
BASEIMAGE_LIST_TITLE_IMAGE("img_title_baseimages"),
CREATE_VIEW_TITLE_IMAGE("img_title_creatnewdevice"),
CHECKBOX_CHECKED_HOVER("btn_checkbox_checked_hover"),
CHECKBOX_CHECKED_DISABLE("btn_checkbox_checked_disable"),
- // radio buttonr
+ // radio button
RADIO_BUTTON_OFF("btn_radio_off_nml"),
RADIO_BUTTON_ON("btn_radio_on_nml"),
RADIO_BUTTON_OFF_DISABLE("btn_radio_off_disable"),
- RADIO_BUTTON_ON_DISABLE("btn_radio_on_disable");
+ RADIO_BUTTON_ON_DISABLE("btn_radio_on_disable"),
+ // navigation button
+ BTN_NAV_NORMAL("btn_nav_normal"),
+ BTN_NAV_HOVER("btn_nav_hover"),
+ BTN_NAV_PUSH("btn_nav_push");
String name;
Image image;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
-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.renewal.resources.FontResources;
import org.tizen.emulator.manager.renewal.resources.ImageResources;
import org.tizen.emulator.manager.ui.dialog.AboutDialog;
-import org.tizen.emulator.manager.ui.renewal.widgets.Hyperlink;
import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton;
public abstract class AbstractTableViewer {
private static ImageButton infoButton;
private List<ImageButton> buttonMenuList = new ArrayList<ImageButton>();
- private List<Hyperlink> linkMenuList = new ArrayList<Hyperlink>();
+ private List<ImageButton> linkMenuList = new ArrayList<ImageButton>();
public AbstractTableViewer(Shell shell, String key) {
this.key = key;
}
}
- public void addLinkMenu(Hyperlink menu) {
+ public void addLinkMenu(ImageButton menu) {
linkMenuList.add(menu);
}
}
public void settingTopLayout() {
- if (!linkMenuList.isEmpty()) {
- for (int i = 0; i < linkMenuList.size(); i++){
- FormData data = new FormData();
- if (i == 0) {
- data.top = new FormAttachment (0, 5);
- } else {
- data.top = new FormAttachment(linkMenuList.get(i - 1), 5);
- }
- data.right = new FormAttachment(100, -8);
- Hyperlink menu = linkMenuList.get(i);
- menu.setLayoutData(data);
- menu.setCursor(Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND));
- menu.setForeground(ColorResources.LINK_MENU_FONT.getColor());
- menu.setFont(FontResources.TABLE_VIEWER_LINK_MENU.getFont());
- }
- }
-
if (!buttonMenuList.isEmpty()) {
for (int i = 0; i < buttonMenuList.size(); i++) {
FormData data = new FormData();
- data.bottom = new FormAttachment(100, -7);
+ data.top = new FormAttachment(0, 10);
if (i == 0) {
data.right = new FormAttachment(100, -8);
} else {
- data.right = new FormAttachment(buttonMenuList.get(i-1), -11);
+ data.right = new FormAttachment(buttonMenuList.get(i-1), -10);
}
data.width = BUTTON_MENU_WIDTH;
data.height = BUTTON_MENU_HEIGHT;
}
}
+
+ if (!linkMenuList.isEmpty()) {
+ for (int i = 0; i < linkMenuList.size(); i++){
+ FormData data = new FormData();
+ data.bottom = new FormAttachment (100, -10);
+ if (i == 0) {
+ data.right = new FormAttachment(100, -8);
+ } else {
+ data.right = new FormAttachment(linkMenuList.get(i - 1), -5);
+ }
+ data.width = 96;
+ data.height = 22;
+ ImageButton menu = linkMenuList.get(i);
+ menu.setLayoutData(data);
+ menu.setImages(ImageResources.BTN_NAV_NORMAL.getImage(), ImageResources.BTN_NAV_HOVER.getImage(),
+ ImageResources.BTN_NAV_PUSH.getImage(), ImageResources.BTN_NAV_NORMAL.getImage());
+ menu.setForeground(ColorResources.LINK_MENU_FONT.getColor());
+ menu.setFont(FontResources.TABLE_VIEWER_LINK_MENU.getFont());
+ }
+ }
}
public void showTableViewer() {
import org.tizen.emulator.manager.ui.renewal.dialog.DeleteMessageBox;
import org.tizen.emulator.manager.ui.renewal.dialog.MessageBox;
import org.tizen.emulator.manager.ui.renewal.dialoghandler.BaseImageDialogHandler;
-import org.tizen.emulator.manager.ui.renewal.widgets.Hyperlink;
import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton;
import org.tizen.emulator.manager.ui.table.Table;
import org.tizen.emulator.manager.ui.table.TableColumn;
private static final int BUTTON_WIDTH = 32;
private static final int BUTTON_HEIGHT = 26;
- private Hyperlink templateList;
+ private ImageButton templateList;
private ImageButton refreshButton;
private Composite comp;
@Override
void setLinkerMenu() {
- templateList = new Hyperlink(getTopComp(), SWT.None);
+ templateList = new ImageButton(getTopComp(), SWT.PUSH);
templateList.setText("Templates");
templateList.addListener(SWT.Selection, new Listener() {
@Override
import org.tizen.emulator.manager.ui.renewal.item.modify.comp.PropertyValue;
import org.tizen.emulator.manager.ui.renewal.item.modify.vm.AdvancedSkinItem;
import org.tizen.emulator.manager.ui.renewal.item.modify.vm.CameraItem;
-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.ImageButton;
import org.tizen.emulator.manager.ui.renewal.widgets.NinePatchResourceInfo;
import org.tizen.emulator.manager.vms.Creator;
// top menu
private ImageButton backVMListBtn;
- private GrayButton confirmBtn;
+ private HighLightButton confirmBtn;
// sash form menu
private Label profileLabel;
}
});
- confirmBtn = new GrayButton(comp, SWT.PUSH);
+ confirmBtn = new HighLightButton(comp, SWT.PUSH);
confirmBtn.setText("Confirm");
confirmBtn.setFont(FontResources.DEFAULT_BOLD_FONT_9.getFont());
confirmBtn.addListener(SWT.Selection, new Listener(){
import org.tizen.emulator.manager.ui.renewal.MainDialog;
import org.tizen.emulator.manager.ui.renewal.dialog.MessageBox;
import org.tizen.emulator.manager.ui.renewal.dialoghandler.DeviceTemplateDialogHandler;
-import org.tizen.emulator.manager.ui.renewal.widgets.Hyperlink;
import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton;
import org.tizen.emulator.manager.ui.table.Table;
import org.tizen.emulator.manager.ui.table.TableColumn;
private static final int BUTTON_WIDTH = 32;
private static final int BUTTON_HEIGHT = 26;
- private Hyperlink baseImageList;
+ private ImageButton baseImageList;
private ImageButton refreshButton;
private Composite comp;
@Override
void setLinkerMenu() {
- baseImageList = new Hyperlink(getTopComp(), SWT.None);
+ baseImageList = new ImageButton(getTopComp(), SWT.PUSH);
baseImageList.setText("Base Images");
baseImageList.addListener(SWT.Selection, new Listener() {
@Override
import org.tizen.emulator.manager.renewal.resources.ImageResources;
import org.tizen.emulator.manager.ui.renewal.MainDialog;
import org.tizen.emulator.manager.ui.renewal.widgets.CreateVMCombo;
-import org.tizen.emulator.manager.ui.renewal.widgets.Hyperlink;
import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton;
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
private static final int BUTTON_WIDTH = 32;
private static final int BUTTON_HEIGHT = 26;
- private Hyperlink templateList;
- private Hyperlink baseImageList;
+ private ImageButton templateList;
+ private ImageButton baseImageList;
private ImageButton refreshButton;
private CreateVMCombo createVMCombo;
@Override
void setLinkerMenu() {
// add linker
- templateList = new Hyperlink(getTopComp(), SWT.None);
+ templateList = new ImageButton(getTopComp(), SWT.PUSH);
templateList.setText("Templates");
templateList.addListener(SWT.Selection, new Listener() {
@Override
});
- baseImageList = new Hyperlink(getTopComp(), SWT.None);
+ baseImageList = new ImageButton(getTopComp(), SWT.PUSH);
baseImageList.setText("Base Images");
baseImageList.addListener(SWT.Selection, new Listener() {
@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 <sangho1206.park@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.SWT;
-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.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.tizen.emulator.manager.renewal.resources.ColorResources;
-
-public class Hyperlink extends Canvas {
- private String text = "";
- private boolean underlined = true;
- private Color focusBoxColor;
-
- public Hyperlink(Composite parent, int style) {
- super(parent, checkStyle(style));
- this.addPaintListener(paintListener);
- this.addMouseListener(mouseListener);
- this.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
- // TODO
- this.setBackground(ColorResources.BLACK.getColor());
- focusBoxColor = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
- }
-
- private static int checkStyle(int style) {
- return style | SWT.NO_BACKGROUND;
- }
-
- public String getText() {
- checkWidget();
- return text;
- }
-
- public void setText(String text) {
- checkWidget();
- if (text == null) {
- SWT.error(SWT.ERROR_NULL_ARGUMENT);
- }
- this.text = text;
- }
-
- public boolean isUnderlined() {
- checkWidget();
- return underlined;
- }
-
- public void setUnderlined(boolean underlined) {
- checkWidget();
- this.underlined = underlined;
- }
-
- @Override
- public Point computeSize(int wHint, int hHint, boolean changes) {
- checkWidget();
-
- if (wHint != SWT.DEFAULT && wHint < 0) {
- wHint = 0;
- }
-
- if (hHint != SWT.DEFAULT && hHint < 0) {
- hHint = 0;
- }
-
- Point size = new Point(0, 0);
- Point textSize = getTextSize();
- size.x = Math.max(wHint, textSize.x + 2);
- if (underlined) {
- textSize.y += 1;
- }
- size.y = Math.max(hHint, textSize.y);
-
- return size;
- }
-
- private Point getTextSize() {
- Point size = new Point(0, 0);
- GC gc = new GC(this);
- if (text != null && text.length() > 0) {
- Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
- size.x += p.x;
- size.y = Math.max(size.y, p.y);
- } else {
- size.y = Math.max(size.y, gc.getFontMetrics().getHeight());
- }
-
- gc.dispose();
- return size;
- }
-
- private PaintListener paintListener = new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Point extent = getTextSize();
-
- GC gc = e.gc;
-
- if ((getStyle() & SWT.NO_BACKGROUND) != 0) {
- Rectangle rect = ((Hyperlink)e.widget).getClientArea();
- gc.setBackground(getBackground());
- gc.fillRectangle(rect);
- }
-
- gc.setForeground(focusBoxColor);
- if (isMouseDown) {
- gc.setLineStyle(SWT.LINE_DOT);
- gc.drawRectangle(0, 0, extent.x, extent.y - 2);
- }
-
- gc.setForeground(getForeground());
- gc.drawText(text, 0, 0, true);
-
- if (underlined) {
- gc.setLineStyle(SWT.LINE_SOLID);
- gc.drawLine(0, extent.y - 2, extent.x, extent.y - 2);
- }
- }
- };
-
- private boolean isMouseDown = false;
- private MouseListener mouseListener = new MouseListener() {
-
- @Override
- public void mouseDoubleClick(MouseEvent e) {
- isMouseDown = false;
- }
-
- @Override
- public void mouseDown(MouseEvent e) {
- isMouseDown = true;
- redraw();
- }
-
- @Override
- public void mouseUp(MouseEvent e) {
- if (isMouseDown) {
- isMouseDown = false;
- Event event = new Event();
- event.widget = e.widget;
- event.type = SWT.Selection;
- e.widget.notifyListeners(SWT.Selection, event);
- }
- }
- };
-}
WStateImageMap images = new WStateImageMap();
WSTATE state = WSTATE.NORMAL;
- private final boolean isSelected = false;
+// private final boolean isSelected = false;
public ImageRadioButton(Composite parent) {
super(parent, SWT.DOUBLE_BUFFERED | SWT.RADIO);
this.profile = profile;
}
-
+ public String getProfile() {
+ return profile;
+ }
}