[Title] emulator-manager : delete da button and combo
authorjihye <jihye1128.kim@samsung.com>
Mon, 3 Jun 2013 07:59:36 +0000 (16:59 +0900)
committerjihye <jihye1128.kim@samsung.com>
Mon, 3 Jun 2013 07:59:36 +0000 (16:59 +0900)
[Desc.]  delete da button and combo (change to image button and image combo)
         add tree view to list view
[Issue]  N/A

Change-Id: I7aabfd27b5ea66c618158e617ef195a80bf0264b
Signed-off-by: jihye <jihye1128.kim@samsung.com>
96 files changed:
package/changelog
package/pkginfo.manifest
resource/res/emulator_list_image_hover.gif
resource/res/emulator_list_image_new_ani.gif
resource/res/emulator_list_image_nml.gif
src/org/tizen/emulator/manager/EmulatorManager.java
src/org/tizen/emulator/manager/console/ActionList.java
src/org/tizen/emulator/manager/da/widgets/button/DACustomButton.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonAttribute.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonClickEventListener.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonDefaultRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/button/toggle/DACustomToggleButton.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/button/toggle/DACustomToggleButtonRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/DACustomCombo.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboDefaultRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboPopupDefaultRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboPopupRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboSelectionListener.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/TitleComboPopupRenderer.java [deleted file]
src/org/tizen/emulator/manager/da/widgets/combo/TitleComboRenderer.java [deleted file]
src/org/tizen/emulator/manager/logging/EMLogger.java
src/org/tizen/emulator/manager/platform/CustomBaseImage.java
src/org/tizen/emulator/manager/platform/CustomPlatform.java
src/org/tizen/emulator/manager/platform/Platform.java
src/org/tizen/emulator/manager/platform/SkinList.java
src/org/tizen/emulator/manager/platform/TotalPlatform.java [new file with mode: 0644]
src/org/tizen/emulator/manager/resources/ColorResources.java
src/org/tizen/emulator/manager/resources/DATheme.java [deleted file]
src/org/tizen/emulator/manager/resources/DAThemeWhite.java [deleted file]
src/org/tizen/emulator/manager/resources/FilePathResouces.java [moved from src/org/tizen/emulator/manager/resources/FilePath.java with 97% similarity]
src/org/tizen/emulator/manager/resources/FontResources.java
src/org/tizen/emulator/manager/resources/ImageResources.java
src/org/tizen/emulator/manager/resources/PatchImageResources.java
src/org/tizen/emulator/manager/tool/About.java
src/org/tizen/emulator/manager/tool/CheckSDCard.java
src/org/tizen/emulator/manager/tool/CheckVirtualization.java
src/org/tizen/emulator/manager/tool/SelectTemplate.java
src/org/tizen/emulator/manager/ui/MainDialog.java
src/org/tizen/emulator/manager/ui/MenuHandling.java
src/org/tizen/emulator/manager/ui/StatusBar.java
src/org/tizen/emulator/manager/ui/VMButtonFactory.java [deleted file]
src/org/tizen/emulator/manager/ui/VMsDetailView.java
src/org/tizen/emulator/manager/ui/VMsListView.java
src/org/tizen/emulator/manager/ui/VMsMainView.java
src/org/tizen/emulator/manager/ui/detail/DetailViewItem.java
src/org/tizen/emulator/manager/ui/detail/DetailViewItemChangeListener.java
src/org/tizen/emulator/manager/ui/detail/DetailViewPage.java
src/org/tizen/emulator/manager/ui/detail/EMComboButtonRenderer.java [deleted file]
src/org/tizen/emulator/manager/ui/detail/PEmptyViewPage.java
src/org/tizen/emulator/manager/ui/detail/PInfoViewPage.java
src/org/tizen/emulator/manager/ui/detail/PModifyViewPage.java
src/org/tizen/emulator/manager/ui/detail/TDisplayItem.java
src/org/tizen/emulator/manager/ui/detail/TFileShareItem.java
src/org/tizen/emulator/manager/ui/detail/THWSupportItem.java
src/org/tizen/emulator/manager/ui/detail/TNameTextItem.java
src/org/tizen/emulator/manager/ui/detail/TRAMItem.java
src/org/tizen/emulator/manager/ui/detail/TTouchPointItem.java
src/org/tizen/emulator/manager/ui/dialog/AboutDialog.java
src/org/tizen/emulator/manager/ui/dialog/MessageDialog.java
src/org/tizen/emulator/manager/ui/list/AbstractListView.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/list/ColumnContentHelper.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/list/ColumnSortListner.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/list/ExtendTreeListView.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/list/ItemListVew.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/list/RowItem.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/list/TreeListView.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/list/VMButtonFactory.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/tabfolder/PlatformTabButton.java [deleted file]
src/org/tizen/emulator/manager/ui/tabfolder/PlatformTabFolder.java
src/org/tizen/emulator/manager/ui/tabfolder/PlatformTabItem.java
src/org/tizen/emulator/manager/ui/widgets/CustomScrollBar.java
src/org/tizen/emulator/manager/ui/widgets/CustomScrolledComposite.java
src/org/tizen/emulator/manager/ui/widgets/ImageButton.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/widgets/ImageCombo.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/widgets/ImageComboPopup.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/widgets/ImageLabel.java
src/org/tizen/emulator/manager/ui/widgets/ImageLabelAttribute.java [deleted file]
src/org/tizen/emulator/manager/ui/widgets/ImageLabelDefaultRenderer.java [deleted file]
src/org/tizen/emulator/manager/ui/widgets/ImageLabelRenderer.java [deleted file]
src/org/tizen/emulator/manager/ui/widgets/ModifyViewCombo.java [deleted file]
src/org/tizen/emulator/manager/ui/widgets/ModifyViewComboRenderer.java [deleted file]
src/org/tizen/emulator/manager/ui/widgets/ScrollbarScrolledListener.java
src/org/tizen/emulator/manager/ui/widgets/VMButton.java
src/org/tizen/emulator/manager/ui/widgets/VMButtonAttribute.java [deleted file]
src/org/tizen/emulator/manager/ui/widgets/VMButtonClickEventListener.java [deleted file]
src/org/tizen/emulator/manager/ui/widgets/WSTATE.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/widgets/WidgetHelper.java [new file with mode: 0644]
src/org/tizen/emulator/manager/vms/Creator.java
src/org/tizen/emulator/manager/vms/EmulatorVMList.java
src/org/tizen/emulator/manager/vms/Launcher.java
src/org/tizen/emulator/manager/vms/MonitoringEmulator.java
src/org/tizen/emulator/manager/vms/QemuImgProc.java
src/org/tizen/emulator/manager/vms/SKIN_TYPE.java
src/org/tizen/emulator/manager/vms/VMWorker.java

index 3bff524..ab2b939 100644 (file)
@@ -1,3 +1,9 @@
+* 2.1.8
+- add scroll bar on detail view
+- add tree view on list view
+- delete da button (change to image button)
+== jihye kim <jihye1128.kim@samsung.com> 2013-06-03
+
 * 2.1.7
 - apply feedback
 - change launch button, modify button
index d3c8016..9bfb548 100644 (file)
@@ -1,5 +1,5 @@
 Source: emulator-manager
-Version: 2.1.7
+Version: 2.1.8
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
 
 Package: emulator-manager
index a4cb87b..acbe6be 100755 (executable)
Binary files a/resource/res/emulator_list_image_hover.gif and b/resource/res/emulator_list_image_hover.gif differ
index 565af86..2118f0d 100755 (executable)
Binary files a/resource/res/emulator_list_image_new_ani.gif and b/resource/res/emulator_list_image_new_ani.gif differ
index 1f71913..a708518 100755 (executable)
Binary files a/resource/res/emulator_list_image_nml.gif and b/resource/res/emulator_list_image_nml.gif differ
index 4b3fafa..4a276a5 100755 (executable)
@@ -47,7 +47,8 @@ import org.tizen.emulator.manager.logging.EMLogger;
 import org.tizen.emulator.manager.platform.BaseImage;
 import org.tizen.emulator.manager.platform.CustomPlatform;
 import org.tizen.emulator.manager.platform.Platform;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.platform.TotalPlatform;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.CheckSDCard;
 import org.tizen.emulator.manager.tool.CheckVirtualization;
@@ -228,7 +229,7 @@ public class EmulatorManager {
 
                checkConsoleMode(args);
 
-               randomAccessFile = new RandomAccessFile(new File(FilePath.getInstance().getBinPath()
+               randomAccessFile = new RandomAccessFile(new File(FilePathResouces.getInstance().getBinPath()
                                                + File.separator + "." +System.getProperty("user.name"))+ ".lock",
                                                "rw");
                if (isConsoleMode) {
@@ -318,15 +319,20 @@ public class EmulatorManager {
        }
 
        private static CustomPlatform custom = new CustomPlatform();
+       private static TotalPlatform total = new TotalPlatform();
        
        public static CustomPlatform getCustomPlatform() {
                return custom;
        }
 
+       public static TotalPlatform getTotalPlatform() {
+               return total;
+       }
+
        static void makePlatformList() {
                platformList = new ArrayList<Platform>();
 
-               File platforms = new File(FilePath.getInstance().getPlatformsPath());
+               File platforms = new File(FilePathResouces.getInstance().getPlatformsPath());
                if (platforms.isDirectory() && platforms.exists()) {
                        for (File platform : platforms.listFiles()) {
                                if (platform.isDirectory()) {
@@ -366,6 +372,8 @@ public class EmulatorManager {
                                }
                        }
                }
+
+               total.settingVMProperty();
        }
 
        public enum ManagerModeType {
index 6f96aff..312b395 100644 (file)
@@ -39,7 +39,7 @@ import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.logging.EMLogger;
 import org.tizen.emulator.manager.platform.Skin;
 import org.tizen.emulator.manager.platform.SkinList;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.tool.SelectTemplate;
 import org.tizen.emulator.manager.tool.SelectWorkspace;
 import org.tizen.emulator.manager.vms.RAM_SIZE;
@@ -260,10 +260,10 @@ class Workspace extends Action {
                                                                "       Get workspace : workspace -g");
 
                commandList.add(new Command("s", Actions.OP_SET,
-                               "Set path of workspace.", FilePath.getInstance().getTizenVmsPath(),
+                               "Set path of workspace.", FilePathResouces.getInstance().getTizenVmsPath(),
                                false, true));
                commandList.add(new Command("g", Actions.OP_GET,
-                               "Get current workspace path.", FilePath.getInstance().getTizenVmsPath(),
+                               "Get current workspace path.", FilePathResouces.getInstance().getTizenVmsPath(),
                                false, false));
        }
 
@@ -288,7 +288,7 @@ class Workspace extends Action {
 
                if (isGet) {
                        System.out.println("Current Workspace : ");
-                       System.out.println(FilePath.getInstance().getTizenWorkspacePath());
+                       System.out.println(FilePathResouces.getInstance().getTizenWorkspacePath());
                } else {
                        File f = null;
                        try {
@@ -497,7 +497,7 @@ class Launch extends Action {
 
                commandList.add(new Command("p", Actions.OP_PATH,
                                "Setting path of emulator program.",
-                               FilePath.getInstance().getBinPath(), false, true));
+                               FilePathResouces.getInstance().getBinPath(), false, true));
 
                commandList.add(new Command("t", Actions.OP_TEST,
                                "Print parameters of emulator without executing emulator.",
@@ -606,7 +606,7 @@ class CreateBaseImage extends Action {
                                "Name of VM to create base target image.","", true, true));
                commandList.add(new Command("p", Actions.OP_PATH,
                                "Setting Location to generate base target image.",
-                               FilePath.getInstance().getTizenWorkspacePath(), false, true));
+                               FilePathResouces.getInstance().getTizenWorkspacePath(), false, true));
        }
 
        @Override
diff --git a/src/org/tizen/emulator/manager/da/widgets/button/DACustomButton.java b/src/org/tizen/emulator/manager/da/widgets/button/DACustomButton.java
deleted file mode 100644 (file)
index 1baf80d..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.button;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-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.eclipse.swt.widgets.Listener;
-import org.tizen.emulator.manager.resources.ColorResources;
-
-public class DACustomButton extends Canvas {
-
-       public static final int MAX_SIZE = 100;
-
-       public static final int STATE_NORMAL = 0;
-       public static final int STATE_PUSH = 1;
-       public static final int STATE_HOVER = 2;
-       public static final int STATE_DISABLE = 3;
-
-       public static final int TYPE_IMAGE = 0;
-       public static final int TYPE_COLOR = 1;
-       public static final int TYPE_GRADATION = 2;
-
-       protected int state = STATE_NORMAL;
-       protected DACustomButtonAttribute attr;
-       protected DACustomButtonRenderer buttonRenderer = null;
-
-       public void addListeners() {
-               this.addListener(SWT.MouseEnter, buttonMouseListener);
-               this.addListener(SWT.MouseExit, buttonMouseListener);
-               this.addListener(SWT.MouseDown, buttonMouseListener);
-               this.addListener(SWT.MouseUp, buttonMouseListener);
-       }
-
-       public DACustomButton(Composite parent, int style) {
-               super(parent, style);
-
-               this.setForeground(ColorResources.WHITE.getColor());
-               this.addPaintListener(buttonPaintListener);
-               addListeners();
-               buttonRenderer = new DACustomButtonDefaultRenderer();
-               attr = new DACustomButtonAttribute();
-               setDefaultColors();
-       }
-
-       public DACustomButton(Composite parent, int style, String titleText) {
-               this(parent, style);
-               attr.setText(titleText);
-       }
-
-       public DACustomButton(Composite parent, Image normal, Image mouseDown,
-                       Image hover, Image disable) {
-               this(parent, SWT.TRANSPARENT);
-               setImages(normal, mouseDown, hover, disable);
-               attr.setDrawType(TYPE_IMAGE);
-       }
-
-       public DACustomButton(Composite parent, Color normalStart, Color normalEnd,
-                       Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
-                       Color disableStart, Color disableEnd) {
-               this(parent, SWT.NONE);
-               attr.setColor(0, normalStart);
-               attr.setColor(1, normalEnd);
-               attr.setColor(2, pushStart);
-               attr.setColor(3, pushEnd);
-               attr.setColor(4, hoverStart);
-               attr.setColor(5, hoverEnd);
-               attr.setColor(6, disableStart);
-               attr.setColor(7, disableEnd);
-               attr.setDrawType(TYPE_GRADATION);
-       }
-
-       protected void changeButtonState(int s) {
-               if (s == STATE_DISABLE) {
-                       super.setEnabled(false);
-               } else {
-                       super.setEnabled(true);
-               }
-
-               state = s;
-               this.redraw();
-       }
-
-       protected Listener buttonMouseListener = new Listener() {
-
-               @Override
-               public void handleEvent(Event event) {
-                       if (state == STATE_DISABLE) {
-                               return;
-                       }
-
-                       if (event.type == SWT.MouseEnter) {
-                               changeButtonState(STATE_HOVER);
-                       }
-
-                       if (event.type == SWT.MouseExit) {
-                               changeButtonState(STATE_NORMAL);
-                       }
-
-                       if (event.type == SWT.MouseDown) {
-                               changeButtonState(STATE_PUSH);
-                       }
-
-                       if (event.type == SWT.MouseUp) { // FIXME
-                               changeButtonState(STATE_HOVER);
-                       }
-               }
-       };
-
-       private void setDefaultColors() {
-               attr.setColor(STATE_DISABLE,
-                               new Color(Display.getCurrent(), 48, 48, 48));
-               attr.setColor(STATE_PUSH, new Color(Display.getCurrent(), 29, 109, 140));
-               attr.setColor(STATE_HOVER, new Color(Display.getCurrent(), 0, 134, 185));
-               attr.setColor(STATE_NORMAL, new Color(Display.getCurrent(), 67, 67, 67));
-       }
-
-       private PaintListener buttonPaintListener = new PaintListener() {
-
-               @Override
-               public void paintControl(PaintEvent e) {
-                       buttonRenderer.draw(e.gc, (Canvas) e.widget, state, attr);
-               }
-       };
-
-       public void setTitle(String newTitle) {
-               attr.setText(newTitle);
-       }
-
-       public void setText(String newTitle) {
-               attr.setText(newTitle);
-       }
-
-       public void setButtonImage(Image img) {
-               attr.setButtonImage(img);
-       }
-
-       public void setRenderer(DACustomButtonRenderer newRenderer) {
-               buttonRenderer = newRenderer;
-       }
-/*
-       public boolean isEnabled() {
-               return (state != STATE_DISABLE ? true : false);
-       }
-*/
-       public void setEnabled(boolean enabled) {
-               if (enabled) {
-                       super.setEnabled(true);
-                       changeButtonState(STATE_NORMAL);
-               } else {
-                       changeButtonState(STATE_DISABLE);
-               }
-       }
-
-       public void setImage(int state, Image image) {
-               attr.setImage(state, image);
-       }
-
-       public Image getImage(int state) {
-               return attr.getImage(state);
-       }
-
-       public void setColor(int state, Color color) {
-               attr.setColor(state, color);
-       }
-
-       public void setFont(Font font) {
-               attr.setFont(font);
-       }
-
-       public void setFontPoint(Point p) {
-               attr.setFontPoint(p);
-       }
-
-       public void setColors(Color normal, Color push, Color hover, Color disable) {
-               attr.setColor(STATE_NORMAL, normal);
-               attr.setColor(STATE_PUSH, push);
-               attr.setColor(STATE_HOVER, hover);
-               attr.setColor(STATE_DISABLE, disable);
-               attr.setDrawType(TYPE_COLOR);
-       }
-
-       public void setImages(Image normal, Image push, Image hover, Image disable) {
-               attr.setImage(STATE_NORMAL, normal);
-               attr.setImage(STATE_PUSH, push);
-               attr.setImage(STATE_HOVER, hover);
-               attr.setImage(STATE_DISABLE, disable);
-               attr.setDrawType(TYPE_IMAGE);
-       }
-
-       public void setOutlineColors(Color normal, Color push, Color hover,
-                       Color disable) {
-               attr.setOutlineColor(STATE_NORMAL, normal);
-               attr.setOutlineColor(STATE_PUSH, push);
-               attr.setOutlineColor(STATE_HOVER, hover);
-               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);
-       }
-
-       public int getState() {
-               return state;
-       }
-
-       public void setGradation(Color normalStart, Color normalEnd,
-                       Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
-                       Color disableStart, Color disableEnd) {
-               attr.setColor(0, normalStart);
-               attr.setColor(1, normalEnd);
-               attr.setColor(2, pushStart);
-               attr.setColor(3, pushEnd);
-               attr.setColor(4, hoverStart);
-               attr.setColor(5, hoverEnd);
-               attr.setColor(6, disableStart);
-               attr.setColor(7, disableEnd);
-               attr.setDrawType(TYPE_GRADATION);
-       }
-
-       public void setGradationColor(int state, Color start, Color end) {
-               attr.setColor(state * 2, start);
-               attr.setColor(state * 2 + 1, end);
-       }
-
-       public void setFontColors(Color normal, Color push, Color hover,
-                       Color disable) {
-               attr.setFontColor(STATE_NORMAL, normal);
-               attr.setFontColor(STATE_PUSH, push);
-               attr.setFontColor(STATE_HOVER, hover);
-               attr.setFontColor(STATE_DISABLE, disable);
-       }
-
-       public void setFontColor(int state, Color color) {
-               attr.setFontColor(state, color);
-       }
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonAttribute.java b/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonAttribute.java
deleted file mode 100644 (file)
index 30eb0e2..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.button;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-
-public class DACustomButtonAttribute {
-       private final int MAX_SIZE = 12;
-       private String text;
-       private Image buttonImage = null;
-       private Font font;
-       private Point fontPoint;
-       private int drawType = DACustomButton.TYPE_COLOR;
-
-       private List<Image> images = new ArrayList<Image>();
-       private List<Color> colors = new ArrayList<Color>();
-       private List<Color> fontColors = new ArrayList<Color>();
-       private List<Color> outlineColors = new ArrayList<Color>();
-       private List<Color> outlineInColors = new ArrayList<Color>();
-       private boolean enabled;
-
-       public DACustomButtonAttribute() {
-               enabled = true;
-
-               // init array list
-               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/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonClickEventListener.java b/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonClickEventListener.java
deleted file mode 100644 (file)
index 962166f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*\r
- *  Dynamic Analyzer\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: \r
- * Jooyoul Lee <jy.exe.lee@samsung.com>\r
- * Juyoung Kim <j0.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * \r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- * \r
- */\r
-\r
-package org.tizen.emulator.manager.da.widgets.button;\r
-\r
-import org.eclipse.swt.graphics.Rectangle;\r
-import org.eclipse.swt.widgets.Event;\r
-import org.eclipse.swt.widgets.Listener;\r
-\r
-public abstract class DACustomButtonClickEventListener implements Listener {\r
-\r
-       @Override\r
-       public void handleEvent(Event event) {\r
-               DACustomButton button = (DACustomButton) event.widget;\r
-               if (null != button && button.getState() != DACustomButton.STATE_DISABLE) {\r
-                       Rectangle rectangle = button.getBounds();\r
-                       int x = event.x;\r
-                       int y = event.y;\r
-\r
-                       if (x < 0 || x > rectangle.width || y < 0 || y > rectangle.height) {\r
-                               return;\r
-                       }\r
-               } else {\r
-                       return;\r
-               }\r
-\r
-               handleClickEvent(button);\r
-       }\r
-\r
-       public abstract void handleClickEvent(DACustomButton button);\r
-}\r
diff --git a/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonDefaultRenderer.java b/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonDefaultRenderer.java
deleted file mode 100644 (file)
index 40581b9..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.button;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-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.emulator.manager.resources.ColorResources;
-
-public class DACustomButtonDefaultRenderer extends DACustomButtonRenderer {
-
-       @Override
-       public void draw(GC gc, Canvas canvas, int state,
-                       DACustomButtonAttribute attr) {
-               Rectangle rect = canvas.getClientArea();
-
-               if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
-                       Image image = attr.getImage(state);
-                       if (null == image) {
-                               return;
-                       }
-
-                       gc.drawImage(image, rect.x, rect.y);
-                       drawButtonText(gc, rect, attr, state);
-               } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
-                               || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
-                       drawButton(gc, rect, state, attr);
-               }
-               drawButtonImage(gc, rect, attr);
-       }
-
-       public int computeFontSize(Rectangle rect) {
-               if (rect.height > 20)
-                       return 10;
-               else
-                       return 8;
-       }
-
-       public void drawButton(GC gc, Rectangle rect, int state,
-                       DACustomButtonAttribute 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.getColor());
-               }
-               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);
-       }
-
-       protected void drawButtonImage(GC gc, Rectangle rect,
-                       DACustomButtonAttribute attr) {
-               if (attr != null && attr.getButtonImage() != null) {
-                       Image img = attr.getButtonImage();
-                       Rectangle imgRect = img.getBounds();
-                       int width = rect.width - imgRect.width;
-                       int height = rect.height - imgRect.height;
-                       int x = 0, y = 0;
-                       if (width > 0) {
-                               x = width / 2;
-                       }
-
-                       if (height > 0) {
-                               y = height / 2;
-                       }
-                       gc.drawImage(img, x, y);
-               }
-       }
-
-       protected void drawButtonText(GC gc, Rectangle rect,
-                       DACustomButtonAttribute attr, int state) {
-               String text = null;
-               Font font = null;
-               Point p = null;
-               if (null != (text = attr.getText())) {
-                       if (null == (font = attr.getFont())) {
-                               font = new Font(Display.getCurrent(), "Arial",
-                                               computeFontSize(rect), SWT.BOLD);
-                               attr.setFont(font);
-                       }
-                       gc.setFont(font);
-
-                       int x = 0, y = 0;
-                       int offset = 0;
-                       if (null == (p = attr.getFontPoint())) {
-                               p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-                               x = (rect.width - p.x) / 2;
-                               y = (rect.height - p.y) / 2;
-                               x = (x < 0) ? 0 : x;
-                               // rect size < text length -> insert offset
-                               // offset = ((x - rect.x) < 4) ? 4 : 0;
-                               offset = 0;
-                       } else {
-                               x = p.x;
-                               y = p.y;
-                       }
-
-                       if (null != attr.getFontColor(state)) {
-                               gc.setForeground(attr.getFontColor(state));
-                       } else {
-                               gc.setForeground(ColorResources.BLACK.getColor());
-                       }
-
-                       if (state == DACustomButton.STATE_PUSH) {
-                               x += 1;
-                               y += 1;
-                       }
-                       gc.drawString(text, x + offset, y, true);
-               }
-       }
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonRenderer.java b/src/org/tizen/emulator/manager/da/widgets/button/DACustomButtonRenderer.java
deleted file mode 100644 (file)
index e7ce757..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.button;
-
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Canvas;
-
-public abstract class DACustomButtonRenderer {
-       public abstract void draw(GC gc, Canvas canvas, int state,
-                       DACustomButtonAttribute attr);
-
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/button/toggle/DACustomToggleButton.java b/src/org/tizen/emulator/manager/da/widgets/button/toggle/DACustomToggleButton.java
deleted file mode 100644 (file)
index fa948e4..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*\r
- *  Dynamic Analyzer\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: \r
- * Jooyoul Lee <jy.exe.lee@samsung.com>\r
- * Juyoung Kim <j0.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * \r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- * \r
- */\r
-\r
-package org.tizen.emulator.manager.da.widgets.button.toggle;\r
-\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.graphics.Color;\r
-import org.eclipse.swt.graphics.Image;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Event;\r
-import org.eclipse.swt.widgets.Listener;\r
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;\r
-import org.tizen.emulator.manager.resources.ColorResources;\r
-\r
-public class DACustomToggleButton extends DACustomButton {\r
-\r
-       public static final int STATE_TOGGLE = 4;\r
-       public static final int STATE_TOGGLE_HOVER = 5;\r
-       public static final int STATE_TOGGLE_PUSH = 6;\r
-       private boolean toggle = false;\r
-       private boolean toggleByButton = false;\r
-\r
-       public DACustomToggleButton(Composite parent, Image normal, Image push,\r
-                       Image hover, Image disable, Image toggle, Image toggleHover) {\r
-               super(parent, normal, push, hover, disable);\r
-               buttonRenderer = new DACustomToggleButtonRenderer();\r
-\r
-               attr.setImage(STATE_TOGGLE, toggle);\r
-               attr.setImage(STATE_TOGGLE_HOVER, toggleHover);\r
-               addListeners();\r
-       }\r
-\r
-       public DACustomToggleButton(Composite parent, Image normal, Image push,\r
-                       Image hover, Image disable, Image toggle, Image toggleHover,\r
-                       Image togglePush) {\r
-               this(parent, normal, push, hover, disable, toggle, toggleHover);\r
-               buttonRenderer = new DACustomToggleButtonRenderer();\r
-\r
-               attr.setImage(STATE_TOGGLE_PUSH, togglePush);\r
-       }\r
-\r
-       public DACustomToggleButton(Composite parent, int style) {\r
-               super(parent, style);\r
-               buttonRenderer = new DACustomToggleButtonRenderer();\r
-               attr.setColor(STATE_TOGGLE, ColorResources.BLUE.getColor());\r
-               attr.setColor(STATE_TOGGLE_HOVER, ColorResources.WHITE.getColor());\r
-               addListeners();\r
-       }\r
-\r
-       public DACustomToggleButton(Composite parent, Color normalStart,\r
-                       Color normalEnd, Color pushStart, Color pushEnd, Color hoverStart,\r
-                       Color hoverEnd, Color disableStart, Color disableEnd,\r
-                       Color toggleStart, Color toggleEnd, Color toggleHoverStart,\r
-                       Color toggleHoverEnd) {\r
-               this(parent, SWT.NONE);\r
-               attr.setColor(0, normalStart);\r
-               attr.setColor(1, normalEnd);\r
-               attr.setColor(2, pushStart);\r
-               attr.setColor(3, pushEnd);\r
-               attr.setColor(4, hoverStart);\r
-               attr.setColor(5, hoverEnd);\r
-               attr.setColor(6, disableStart);\r
-               attr.setColor(7, disableEnd);\r
-               attr.setColor(8, toggleStart);\r
-               attr.setColor(9, toggleEnd);\r
-               attr.setColor(10, toggleHoverStart);\r
-               attr.setColor(11, toggleHoverEnd);\r
-               attr.setDrawType(TYPE_GRADATION);\r
-       }\r
-\r
-       public void setToggled(boolean toggled) {\r
-               toggle = toggled;\r
-               if (toggled) {\r
-                       changeButtonState(STATE_TOGGLE);\r
-               } else {\r
-                       changeButtonState(STATE_NORMAL);\r
-               }\r
-       }\r
-\r
-       public void setToggled2(boolean toggled) {\r
-               if (!toggleByButton) {\r
-                       toggle = toggled;\r
-                       if (toggled) {\r
-                               changeButtonState(STATE_TOGGLE);\r
-                       } else {\r
-                               changeButtonState(STATE_NORMAL);\r
-                       }\r
-               }\r
-       }\r
-\r
-       public boolean isToggled() {\r
-               return toggle;\r
-       }\r
-\r
-       @Override\r
-       public void addListeners() {\r
-               if (null != toggleButtonMouseListener) {\r
-                       this.addListener(SWT.MouseEnter, toggleButtonMouseListener);\r
-                       this.addListener(SWT.MouseExit, toggleButtonMouseListener);\r
-                       this.addListener(SWT.MouseDown, toggleButtonMouseListener);\r
-                       this.addListener(SWT.MouseUp, toggleButtonMouseListener);\r
-               }\r
-       }\r
-\r
-       private Listener toggleButtonMouseListener = new Listener() {\r
-\r
-               @Override\r
-               public void handleEvent(Event event) {\r
-                       if (state == STATE_DISABLE) {\r
-                               return;\r
-                       }\r
-\r
-                       if (event.type == SWT.MouseEnter) {\r
-                               if (toggle) {\r
-                                       changeButtonState(STATE_TOGGLE_HOVER);\r
-                               } else {\r
-                                       changeButtonState(STATE_HOVER);\r
-                               }\r
-                       }\r
-\r
-                       if (event.type == SWT.MouseExit) {\r
-                               if (toggle) {\r
-                                       changeButtonState(STATE_TOGGLE);\r
-                               } else {\r
-                                       changeButtonState(STATE_NORMAL);\r
-                               }\r
-                       }\r
-\r
-                       if (event.type == SWT.MouseDown) {\r
-                               if (toggle) {\r
-                                       if (null != attr.getImage(STATE_TOGGLE_PUSH)) {\r
-                                               changeButtonState(STATE_TOGGLE_PUSH);\r
-                                       } else {\r
-                                               changeButtonState(STATE_PUSH);\r
-                                       }\r
-                               } else {\r
-                                       changeButtonState(STATE_PUSH);\r
-                               }\r
-                       }\r
-\r
-                       if (event.type == SWT.MouseUp) { // FIXME\r
-                               toggle = !toggle;\r
-                               toggleByButton = !toggleByButton;\r
-                               if (toggle) {\r
-                                       changeButtonState(STATE_TOGGLE_HOVER);\r
-                               } else {\r
-                                       changeButtonState(STATE_HOVER);\r
-                               }\r
-                       }\r
-               }\r
-       };\r
-}\r
diff --git a/src/org/tizen/emulator/manager/da/widgets/button/toggle/DACustomToggleButtonRenderer.java b/src/org/tizen/emulator/manager/da/widgets/button/toggle/DACustomToggleButtonRenderer.java
deleted file mode 100644 (file)
index 61392cc..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.button.toggle;
-
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonAttribute;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonDefaultRenderer;
-
-public class DACustomToggleButtonRenderer extends DACustomButtonDefaultRenderer {
-
-       @Override
-       public void draw(GC gc, Canvas canvas, int state,
-                       DACustomButtonAttribute attr) {
-               Rectangle rect = canvas.getClientArea();
-               if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
-                       Image image = attr.getImage(state);
-                       if (null == image) {
-                               return;
-                       }
-
-                       gc.drawImage(image, rect.x, rect.y);
-                       drawButtonText(gc, rect, attr, state);
-               } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
-                               || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
-                       drawButton(gc, rect, state, attr);
-               }
-       }
-
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/DACustomCombo.java b/src/org/tizen/emulator/manager/da/widgets/combo/DACustomCombo.java
deleted file mode 100644 (file)
index 332e476..0000000
+++ /dev/null
@@ -1,763 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.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.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonRenderer;
-import org.tizen.emulator.manager.resources.ColorResources;
-
-public class DACustomCombo extends Canvas {
-       public static final int MAX_SIZE = 10;
-       public static final int STATE_NORMAL = 0;
-       public static final int STATE_HOVER = 1;
-       public static final int STATE_PUSH = 2;
-       public static final int STATE_DISABLE = 3;
-
-       private static final int pageSize = 5;
-
-       Composite parent;
-       protected Canvas combo = null;
-       private Canvas popup = null;
-       private int itemHeight = 0;
-       private DACustomButton upArrowButton = null;
-       private DACustomButton downArrowButton = null;
-       private int itemIndex = 0;
-       private boolean dirty = false;
-
-       private List<String> items;
-       private List<Rectangle> rects = null;
-
-       private List<Image> images = null;
-       protected Image buttonUp = null;
-       private Image buttonDown = null;
-       private boolean enabled = true;
-       private Shell childShell = null;
-       private int selection = 0;
-       private String text = ""; //$NON-NLS-1$
-       private boolean imgCombo = false;
-       protected int state = STATE_NORMAL; // 0 normal 1 hover 2 push 3 disable
-       protected DACustomComboRenderer comboRenderer = new DACustomComboDefaultRenderer();;
-       private DACustomComboPopupRenderer popupRenderer = new DACustomComboPopupDefaultRenderer();
-       private DACustomButtonRenderer buttonRenderer = null;
-
-       private List<Color> arrowColors = null;
-       private List<Image> arrowImages = null;
-
-       public DACustomCombo(Composite parent, int style) {
-               super(parent, style);
-               combo = this;
-
-               this.parent = parent;
-               addPaintListener(comboPaintListener);
-               setForeground(ColorResources.WHITE.getColor());
-               addListeners();
-               initCombo();
-       }
-
-       public void addListeners() {
-               addListener(SWT.MouseEnter, comboMouseListener);
-               addListener(SWT.MouseHover, comboMouseListener);
-               addListener(SWT.MouseExit, comboMouseListener);
-               addListener(SWT.MouseDown, comboMouseListener);
-               addListener(SWT.MouseMove, comboMouseListener);
-               addListener(SWT.MouseUp, comboMouseListener);
-       }
-
-       public String getText() {
-               if (getItems().size() > 0) {
-                       return getItems().get(itemIndex + selection);
-               }
-               return null;
-       }
-
-       public List<String> getItems() {
-               if (null == items) {
-                       items = new ArrayList<String>();
-               }
-               return items;
-       }
-
-       private List<Rectangle> getRects() {
-               if (null == rects) {
-                       rects = new ArrayList<Rectangle>();
-               }
-               return rects;
-       }
-
-       private void changeComboState(int s) {
-               state = s;
-               redraw();
-       }
-
-       private Listener popupSelectionListener = new DACustomComboSelectionListener() {
-
-               @Override
-               public void selectionEvent(DACustomCombo combo) {
-                       //System.out.println("default selection" + combo.getText());
-               }
-       };
-
-       public void addSelectionListener(DACustomComboSelectionListener listener) {
-               popupSelectionListener = listener;
-       }
-
-       private Listener comboMouseListener = new Listener() {
-               @Override
-               public void handleEvent(Event event) {
-                       if (enabled) {
-                               if (event.type == SWT.MouseEnter) {
-                                       changeComboState(STATE_HOVER);
-                               }
-
-                               if (event.type == SWT.MouseHover) {
-                                       if (!isOutOfBounds(event.x, event.y)) {
-                                               if (0 != (event.stateMask & SWT.BUTTON1)) {
-                                                       changeComboState(STATE_PUSH);
-                                               } else if (0 == (event.stateMask & SWT.BUTTON1)) {
-                                                       changeComboState(STATE_HOVER);
-                                               }
-                                       }
-                               }
-
-                               if (event.type == SWT.MouseDown) {
-                                       changeComboState(STATE_PUSH);
-                               }
-
-                               if (event.type == SWT.MouseUp) {
-                                       changeComboState(STATE_HOVER);
-                                       if (childShell == null || childShell.isDisposed()) {
-                                               openChildShell();
-                                       } else {
-                                               childShell.close();
-                                               childShell = null;
-                                       }
-                               }
-
-                               if (event.type == SWT.MouseMove) {
-                                       if (isOutOfBounds(event.x, event.y)) {
-                                               changeComboState(STATE_NORMAL);
-                                       } else if (isOutOfBounds(event.x, event.y)) {
-                                               if (0 != (event.stateMask & SWT.BUTTON1)) {
-                                                       changeComboState(STATE_PUSH);
-                                               } else if (0 == (event.stateMask & SWT.BUTTON1)) {
-                                                       changeComboState(STATE_HOVER);
-                                               }
-                                       }
-                               }
-
-                               if (event.type == SWT.MouseExit) {
-                                       changeComboState(STATE_NORMAL);
-                               }
-                       }
-               }
-       };
-
-       protected boolean isOutOfBounds(int x, int y) {
-               Rectangle rectangle = combo.getBounds();
-
-               if (x < 0 || x > rectangle.width || y < 0 || y > rectangle.height) {
-                       return true;
-               }
-
-               return false;
-       }
-
-       private int getShellWidth() {
-               if (getItems().isEmpty()) {
-                       return 0;
-               }
-               int max = 0;
-               int size = items.size();
-               GC gc = new GC(parent.getDisplay(), SWT.NONE);
-               for (int i = 0; i < size; i++) {
-                       Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
-                       if (p.x > max) {
-                               max = p.x;
-                       }
-               }
-               max += 10;
-               gc.dispose();
-               return max;
-       }
-
-       public int getItemHeight() {
-               return itemHeight;
-       }
-
-       public void setItemHeight(int height) {
-               itemHeight = height;
-       }
-
-       private void openChildShell() {
-               childShell = new Shell(parent.getShell(), SWT.ON_TOP);
-               childShell.setLayout(new FormLayout());
-
-               Point p = combo.toDisplay(0, 0);
-               Rectangle rect = combo.getBounds();
-               int size = getItems().size();
-
-               int boundSize = (size > MAX_SIZE) ? MAX_SIZE : (size > 0) ? size : 1;
-
-               int textSize = getShellWidth() + 4;
-               int shellWidth = (textSize > rect.width) ? textSize : rect.width;
-               int height = 0;
-
-               if (getItemHeight() == 0) {
-                       height = rect.height;
-               } else {
-                       height = getItemHeight();
-               }
-               int shellHeight = height * boundSize + 5;
-
-               childShell.setSize(shellWidth, shellHeight);
-               childShell.setLocation(p.x, p.y + rect.height);
-               // childShell.setBackground(ColorResources.BLUE);
-               setSelect(text);
-
-               popup = new Canvas(childShell, SWT.DOUBLE_BUFFERED);
-               popup.setData(this);
-               popup.setBackground(ColorResources.WHITE.getColor());
-               popup.addPaintListener(popupPaintListener);
-               popup.addListener(SWT.MouseUp, popupMouseEventListener);
-               popup.addListener(SWT.MouseMove, popupMouseEventListener);
-               popup.addListener(SWT.FocusOut, popupMouseEventListener);
-               popup.addListener(SWT.MouseUp, popupSelectionListener);
-               popup.addListener(SWT.MouseWheel, popupMouseEventListener);
-
-               if (size > MAX_SIZE) {
-                       upArrowButton = makeButton();
-                       if (buttonUp == null) {
-                               upArrowButton.setText("UP");
-                       } else {
-                               upArrowButton.setButtonImage(buttonUp);
-                       }
-                       FormData data = new FormData();
-                       data.top = new FormAttachment(0, 0);
-                       data.left = new FormAttachment(0, 0);
-                       data.right = new FormAttachment(100, 0);
-                       data.height = height;
-                       upArrowButton.setLayoutData(data);
-                       upArrowButton.addMouseListener(upArrowListener);
-                       upArrowButton.addListener(SWT.MouseExit, upButtonMouseExitListener);
-                       shellHeight += height;
-                       if (itemIndex > 0) {
-                               upArrowButton.setEnabled(true);
-                       } else {
-                               upArrowButton.setEnabled(false);
-                       }
-
-                       data = new FormData();
-                       data.top = new FormAttachment(upArrowButton, 0);
-                       data.left = new FormAttachment(0, 0);
-                       data.right = new FormAttachment(100, 0);
-                       data.height = height * boundSize + 5 - 2;
-                       popup.setLayoutData(data);
-
-                       // downArrowButton = new DACustomButton(childShell, SWT.NONE);
-                       downArrowButton = makeButton();
-                       //                      downArrowButton.setText("down"); //$NON-NLS-1$
-                       if (null == buttonDown) {
-                               downArrowButton.setText("DOWN");
-                       } else {
-                               downArrowButton.setButtonImage(buttonDown);
-                       }
-                       data = new FormData();
-                       data.top = new FormAttachment(popup, 0);
-                       data.left = new FormAttachment(0, 0);
-                       data.right = new FormAttachment(100, 0);
-                       data.height = height;
-                       downArrowButton.setLayoutData(data);
-                       downArrowButton.addMouseListener(downArrowListener);
-                       downArrowButton.addListener(SWT.MouseExit,
-                                       downButtonMouseExitListener);
-                       shellHeight += height;
-                       if (itemIndex + MAX_SIZE < size - 1) {
-                               downArrowButton.setEnabled(true);
-                       } else {
-                               downArrowButton.setEnabled(false);
-                       }
-
-                       childShell.setSize(shellWidth, shellHeight);
-               } else {
-                       FormData data = new FormData();
-                       data.top = new FormAttachment(0, 0);
-                       data.left = new FormAttachment(0, 0);
-                       data.right = new FormAttachment(100, 0);
-                       data.height = shellHeight - 2;
-                       popup.setLayoutData(data);
-               }
-
-               size = (size > MAX_SIZE) ? MAX_SIZE : size;
-               getRects().clear();
-               for (int i = 0; i < size; i++) {
-                       Rectangle r = new Rectangle(2, 2 + i * height, shellWidth - 2,
-                                       height);
-                       getRects().add(r);
-               }
-               childShell.open();
-       }
-
-       private MouseListener upArrowListener = new MouseListener() {
-
-               @Override
-               public void mouseUp(MouseEvent event) {
-                       if (!upArrowButton.isEnabled()) {
-                               return;
-                       }
-
-                       if (null != upArrowButton) {
-                               Rectangle rectangle = upArrowButton.getBounds();
-                               int x = event.x;
-                               int y = event.y;
-
-                               if (x < 0 || x > rectangle.width || y < 0
-                                               || y > rectangle.height) {
-                                       return;
-                               }
-                       }
-
-                       int size = getItems().size();
-                       if (itemIndex - pageSize < 0) {
-                               itemIndex = 0;
-                               upArrowButton.setEnabled(false);
-                       } else {
-                               itemIndex -= pageSize;
-                       }
-
-                       if (itemIndex + pageSize < size - 1) {
-                               downArrowButton.setEnabled(true);
-                       }
-                       popup.redraw();
-               }
-
-               @Override
-               public void mouseDown(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-
-               }
-
-               @Override
-               public void mouseDoubleClick(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-
-               }
-       };
-
-       private MouseListener downArrowListener = new MouseListener() {
-
-               @Override
-               public void mouseUp(MouseEvent event) {
-
-                       if (!downArrowButton.isEnabled()) {
-                               return;
-                       }
-
-                       if (null != downArrowButton) {
-                               Rectangle rectangle = downArrowButton.getBounds();
-                               int x = event.x;
-                               int y = event.y;
-
-                               if (x < 0 || x > rectangle.width || y < 0
-                                               || y > rectangle.height) {
-                                       return;
-                               }
-                       }
-
-                       int size = getItems().size();
-                       if (itemIndex + pageSize + MAX_SIZE >= size - 1) {
-                               itemIndex = size - MAX_SIZE;
-                               downArrowButton.setEnabled(false);
-                       } else {
-                               itemIndex += pageSize;
-                       }
-
-                       // if (itemIndex - pageSize > 0) {
-                       if (itemIndex > 0) {
-                               upArrowButton.setEnabled(true);
-                       }
-                       popup.redraw();
-               }
-
-               @Override
-               public void mouseDown(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-
-               }
-
-               @Override
-               public void mouseDoubleClick(MouseEvent arg0) {
-                       // TODO Auto-generated method stub
-               }
-       };
-
-       private PaintListener popupPaintListener = new PaintListener() {
-
-               @Override
-               public void paintControl(PaintEvent e) {
-                       List<String> items = getItems();
-                       List<String> input = new ArrayList<String>();
-                       int size = (items.size() > MAX_SIZE) ? MAX_SIZE : items.size();
-                       for (int i = 0; i < size; i++) {
-                               input.add(items.get(itemIndex + i));
-                       }
-                       popupRenderer
-                                       .draw(e.gc, popup, state, getRects(), selection, input);
-               }
-       };
-
-       public void setText(String text) {
-               if (!setSelect(text)) {
-                       this.text = text;
-                       redraw();
-               }
-       }
-
-       private boolean setSelect(String text) {
-               if (getItems().isEmpty()) {
-                       return false;
-               }
-
-               int index = items.indexOf(text);
-               if (index < 0) {
-                       return false;
-               }
-               int size = items.size();
-               if (size < MAX_SIZE) {
-                       selection = index;
-                       select(selection);
-               } else if (index + MAX_SIZE >= size) {
-                       int lower = size - index;
-                       selection = MAX_SIZE - lower;
-                       itemIndex = size - MAX_SIZE;
-                       select(selection);
-               } else {
-                       selection = index - itemIndex;
-                       select(selection);
-               }
-               return true;
-       }
-
-       public void upEvent() {
-               if (getItems().size() > 0) {
-                       setText(getItems().get(itemIndex + selection));
-               } else {
-                       setText(""); //$NON-NLS-1$
-               }
-               if (childShell != null) {
-                       childShell.close();
-               }
-               childShell = null;
-       }
-
-       private Listener popupMouseEventListener = new Listener() {
-
-               @Override
-               public void handleEvent(Event event) {
-                       if (event.type == SWT.MouseMove) {
-                               List<Rectangle> rs = getRects();
-                               int size = rs.size();
-                               for (int i = 0; i < size; i++) {
-                                       if (rs.get(i).contains(event.x, event.y)) {
-                                               selection = i;
-                                               popup.redraw();
-                                               break;
-                                       }
-                               }
-                       }
-
-                       if (event.type == SWT.FocusOut) {
-                               childShell.close();
-                               childShell = null;
-                       }
-
-                       if (event.type == SWT.MouseWheel) {
-                               int size = getItems().size();
-                               if (null != downArrowButton && null != upArrowButton) {
-                                       if (event.count < 0) {
-                                               if (itemIndex - event.count + MAX_SIZE >= size - 1) {
-                                                       itemIndex = size - MAX_SIZE;
-                                                       downArrowButton.setEnabled(false);
-                                               } else {
-                                                       itemIndex -= event.count;
-                                               }
-
-                                               // if (itemIndex - pageSize > 0) {
-                                               if (itemIndex > 0) {
-                                                       upArrowButton.setEnabled(true);
-                                               }
-                                       } else {
-
-                                               if (itemIndex - event.count < 0) {
-                                                       itemIndex = 0;
-                                                       upArrowButton.setEnabled(false);
-                                               } else {
-                                                       itemIndex -= event.count;
-                                               }
-
-                                               if (itemIndex + event.count < size - 1) {
-                                                       downArrowButton.setEnabled(true);
-                                               }
-                                       }
-                                       popup.redraw();
-                               }
-                       }
-               }
-       };
-
-       public void setEnabled(boolean enabled) {
-               this.enabled = enabled;
-               if (enabled) {
-                       changeComboState(STATE_NORMAL);
-                       if (isImageCombo()) {
-                               setBackgroundImage(images.get(STATE_NORMAL));
-                       }
-               } else {
-                       changeComboState(STATE_DISABLE);
-                       if (isImageCombo()) {
-                               setBackgroundImage(images.get(STATE_DISABLE));
-                       }
-               }
-       }
-
-       private PaintListener comboPaintListener = new PaintListener() {
-
-               @Override
-               public void paintControl(PaintEvent e) {
-                       if (!isImageCombo()) {
-                               comboRenderer.draw(e.gc, combo, text, state);
-                       } else {
-                               comboRenderer.drawImage(e.gc, combo, images.get(state), text,
-                                               state);
-                       }
-               }
-       };
-
-       public void setComboRender(DACustomComboRenderer newRenderer) {
-               comboRenderer = newRenderer;
-       }
-
-       public void setComboPopupRender(DACustomComboPopupRenderer newRenderer) {
-               popupRenderer = newRenderer;
-       }
-
-       // public void removeAll() {
-       // getItems().clear();
-       // }
-
-       public void add(String item) {
-               if (dirty) {
-                       getItems().add(item);
-               } else {
-                       getItems().set(0, item);
-                       dirty = true;
-               }
-       }
-
-       public void add(String item, int index) {
-               getItems().add(index, item);
-       }
-
-       public void select(int index) {
-               selection = index;
-               this.text = items.get(itemIndex + selection);
-               redraw();
-       }
-
-       public String getItem(int index) {
-               if (getItems().size() > 0) {
-                       return getItems().get(index);
-               }
-               return ""; //$NON-NLS-1$
-       }
-
-       public void setImages(Image normal, Image hover, Image push, Image disable) {
-               if (null == normal || null == hover || null == push || null == disable) {
-                       return;
-               }
-               List<Image> imgs = getImages();
-
-               imgs.add(normal);
-               imgs.add(hover);
-               imgs.add(push);
-               imgs.add(disable);
-               setImageCombo(true);
-       }
-
-       protected List<Image> getImages() {
-               if (null == images) {
-                       images = new ArrayList<Image>();
-               }
-               return images;
-       }
-
-       private void setImageCombo(boolean b) {
-               this.imgCombo = b;
-       }
-
-       public boolean isImageCombo() {
-               return imgCombo;
-       }
-
-       private Listener upButtonMouseExitListener = new Listener() {
-
-               @Override
-               public void handleEvent(Event event) {
-               }
-       };
-
-       private Listener downButtonMouseExitListener = new Listener() {
-
-               @Override
-               public void handleEvent(Event event) {
-
-               }
-       };
-
-       public boolean isDirty() {
-               return dirty;
-       }
-
-       public void initCombo() {
-               getItems().clear();
-               itemIndex = 0;
-               selection = 0;
-               items.add("");
-               dirty = false;
-       }
-
-       public void setComboButtonColor(Color normal, Color push, Color hover,
-                       Color disable) {
-               arrowColors = new ArrayList<Color>();
-               arrowColors.add(normal);
-               arrowColors.add(push);
-               arrowColors.add(hover);
-               arrowColors.add(disable);
-       }
-
-       public void setComboButtonImage(Image normal, Image push, Image hover,
-                       Image disable) {
-               arrowImages = new ArrayList<Image>();
-               arrowImages.add(normal);
-               arrowImages.add(push);
-               arrowImages.add(hover);
-               arrowImages.add(disable);
-       }
-
-       public void setComboButtonGradation(Color normalStart, Color normalEnd,
-                       Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
-                       Color disableStart, Color disableEnd) {
-               arrowColors = new ArrayList<Color>();
-               arrowColors.add(normalStart);
-               arrowColors.add(normalEnd);
-               arrowColors.add(pushStart);
-               arrowColors.add(pushEnd);
-               arrowColors.add(hoverStart);
-               arrowColors.add(hoverEnd);
-               arrowColors.add(disableStart);
-               arrowColors.add(disableEnd);
-       }
-
-       private DACustomButton makeButton() {
-               DACustomButton button = null;
-               if (arrowImages != null) {
-                       button = new DACustomButton(childShell,
-                                       arrowImages.get(STATE_NORMAL), arrowImages.get(STATE_PUSH),
-                                       arrowImages.get(STATE_HOVER),
-                                       arrowImages.get(STATE_DISABLE));
-               } else if (arrowColors != null) {
-                       if (arrowColors.size() > 4) {
-                               // gradation
-                               button = new DACustomButton(childShell,
-                                               arrowColors.get(STATE_NORMAL),
-                                               arrowColors.get(STATE_NORMAL + 1),
-                                               arrowColors.get(STATE_PUSH * 2),
-                                               arrowColors.get(STATE_PUSH * 2 + 1),
-                                               arrowColors.get(STATE_HOVER * 2),
-                                               arrowColors.get(STATE_HOVER * 2 + 1),
-                                               arrowColors.get(STATE_DISABLE * 2),
-                                               arrowColors.get(STATE_DISABLE * 2 + 1));
-                       } else {
-                               button = new DACustomButton(childShell, SWT.NONE);
-                               button.setColors(arrowColors.get(STATE_NORMAL),
-                                               arrowColors.get(STATE_PUSH),
-                                               arrowColors.get(STATE_HOVER),
-                                               arrowColors.get(STATE_DISABLE));
-                       }
-               } else {
-                       button = new DACustomButton(childShell, SWT.NONE);
-               }
-               if (null != buttonRenderer) {
-                       button.setRenderer(buttonRenderer);
-               }
-               return button;
-       }
-
-       public void setButtonRenderer(DACustomButtonRenderer renderer) {
-               buttonRenderer = renderer;
-       }
-
-       public void setButtonImages(Image up, Image down) {
-               buttonUp = up;
-               buttonDown = down;
-       }
-
-       public int getItemIndex(String text) {
-               return getItems().indexOf(text);
-       }
-
-       public int getImageIndex() {
-               return selection;
-       }
-
-       public boolean isChildShellOpened() {
-               if (childShell == null || childShell.isDisposed()) {
-                       return false;
-               }
-               return true;
-       }
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboDefaultRenderer.java b/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboDefaultRenderer.java
deleted file mode 100644 (file)
index bdfd032..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import org.eclipse.swt.SWT;
-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.tizen.emulator.manager.resources.ColorResources;
-
-
-public class DACustomComboDefaultRenderer extends DACustomComboRenderer {
-
-       @Override
-       public void draw(GC gc, Canvas canvas, String text, int state) {
-               Rectangle rect = canvas.getClientArea();
-               if (state == DACustomCombo.STATE_NORMAL) {
-                       gc.setBackground(ColorResources.WINDOW_BG_COLOR.getColor());
-               } else if (state == DACustomCombo.STATE_HOVER) {
-                       gc.setBackground(ColorResources.ITEM_BLUE_DARK.getColor());
-               } else if (state == DACustomCombo.STATE_PUSH) {
-                       gc.setBackground(ColorResources.BLUE.getColor());
-               } else if (state == DACustomCombo.STATE_DISABLE) {
-                       gc.setBackground(ColorResources.GRAY1.getColor());
-               }
-               gc.fillRectangle(rect);
-               gc.drawRectangle(rect.x, rect.y, rect.width - 20, rect.height - 1);
-
-               if (null == text) {
-                       text = ""; //$NON-NLS-1$
-               }
-               Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-               gc.drawString(text, 5, (rect.height - p.y)/2, true);
-               gc.fillRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
-               gc.drawRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
-       }
-
-       @Override
-       public void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       String text, int state) {
-
-       }
-
-       @Override
-       public void drawImage(GC gc, Canvas canvas, Image image, String text,
-                       int state) {
-
-       }
-
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboPopupDefaultRenderer.java b/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboPopupDefaultRenderer.java
deleted file mode 100644 (file)
index 882bc99..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-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.tizen.emulator.manager.resources.ColorResources;
-
-
-public class DACustomComboPopupDefaultRenderer extends DACustomComboPopupRenderer {
-
-       @Override
-       public void draw(GC gc, Canvas canvas, int state, List<Rectangle> rects,
-                       int selection, List<String> items) {
-               int size = rects.size();
-               for (int i = 0; i < size; i++) {
-                       Rectangle r = rects.get(i);
-                       gc.setBackground(ColorResources.WINDOW_BG_COLOR.getColor());
-                       if (selection == i) {
-                               gc.setBackground(ColorResources.RED.getColor());
-                               gc.fillRectangle(r);
-                               gc.setBackground(ColorResources.WINDOW_BG_COLOR.getColor());
-                       }
-                       gc.setForeground(ColorResources.WHITE.getColor());
-                       gc.drawRectangle(r.x, r.y, r.width - 1, r.height - 1);
-                       Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
-                       gc.drawString(items.get(i), 5, (r.height - p.y) / 2 + i * r.height,
-                                       true);
-               }
-       }
-
-       @Override
-       public void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       int state, List<Rectangle> rects, int selection, List<String> items) {
-               // TODO Auto-generated method stub
-
-       }
-
-       @Override
-       public void drawImage(GC gc, Canvas canvas, Image image, int state,
-                       List<Rectangle> rects, int selection, List<String> items) {
-               // TODO Auto-generated method stub
-
-       }
-
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboPopupRenderer.java b/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboPopupRenderer.java
deleted file mode 100644 (file)
index 2556fad..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-
-public abstract class DACustomComboPopupRenderer {
-       public abstract void draw(GC gc, Canvas canvas, int state,
-                       List<Rectangle> rects, int selection, List<String> items);
-
-       public abstract void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       int state, List<Rectangle> rects, int selection, List<String> items);
-
-       public abstract void drawImage(GC gc, Canvas canvas, Image image,
-                       int state, List<Rectangle> rects, int selection, List<String> items);
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboRenderer.java b/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboRenderer.java
deleted file mode 100644 (file)
index e0366ad..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
-  * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Canvas;
-
-public abstract class DACustomComboRenderer {
-       public abstract void draw(GC gc, Canvas canvas, String text, int state);
-       public abstract void drawPattern(GC gc, Canvas canvas, Image patternImage, String text,  int state);
-       public abstract void drawImage(GC gc, Canvas canvas, Image image, String text,  int state);
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboSelectionListener.java b/src/org/tizen/emulator/manager/da/widgets/combo/DACustomComboSelectionListener.java
deleted file mode 100644 (file)
index 0b70388..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-public abstract class DACustomComboSelectionListener implements Listener {
-
-       @Override
-       public void handleEvent(Event event) {
-               Canvas popup = (Canvas) event.widget;
-               DACustomCombo combo = (DACustomCombo) popup.getData();
-               if (null != combo) {
-                       selectionEvent(combo);
-                       combo.upEvent();
-               }
-       }
-
-       public abstract void selectionEvent(DACustomCombo combo);
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/TitleComboPopupRenderer.java b/src/org/tizen/emulator/manager/da/widgets/combo/TitleComboPopupRenderer.java
deleted file mode 100644 (file)
index dd6a9b7..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import java.util.List;
-
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.tizen.emulator.manager.resources.ColorResources;
-import org.tizen.emulator.manager.resources.FontResources;
-
-
-public class TitleComboPopupRenderer extends DACustomComboPopupRenderer {
-
-       @Override
-       public void draw(GC gc, Canvas canvas, int state, List<Rectangle> rects,
-                       int selection, List<String> items) {
-               int size = rects.size();
-               for (int i = 0; i < size; i++) {
-                       Rectangle r = rects.get(i);
-                       if (selection == i) {
-                               gc.setBackground(ColorResources.DEVICE_APPLICATION_ITEM_SELECT_INNER.getColor());
-                               gc.fillRectangle(r);
-
-                               gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_SELECT_TOP.getColor());
-                               gc.drawLine(r.x, r.y, r.x + r.width, r.y);
-                               gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_SELECT_BOTTOM.getColor());
-                               gc.drawLine(r.x, r.y + r.height - 1, r.x + r.width, r.y
-                                               + r.height - 1);
-                       } else {
-                               gc.setBackground(ColorResources.DEVICE_APPLICATION_ITEM_NORMAL_INNER.getColor());
-                               gc.fillRectangle(r);
-                               gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_NORMAL_TOP.getColor());
-                               gc.drawLine(r.x, r.y, r.x + r.width, r.y);
-                               gc.setForeground(ColorResources.DEVICE_APPLICATION_ITEM_NORMAL_BOTTOM.getColor());
-                               gc.drawLine(r.x, r.y + r.height - 1, r.x + r.width, r.y
-                                               + r.height - 1);
-                       }
-                       gc.setForeground(ColorResources.DEVICE_APPLICATION_DROPDOWN_TEXT.getColor());
-                       gc.setFont(FontResources.DROPDOWN.getFont());
-                       // Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
-                       // gc.drawString(items.get(i), 5, (r.height - p.y) / 2 + i *
-                       // r.height,
-                       // true);
-                       gc.drawString(items.get(i), 5, 6 + i * r.height, true);
-
-                       Rectangle rect = canvas.getClientArea();
-                       gc.setForeground(ColorResources.DEVICE_APPLICATION_POPUP_OUTER_1.getColor());
-                       gc.drawRectangle(rect);
-                       gc.setForeground(ColorResources.DEVICE_APPLICATION_POPUP_OUTER_2.getColor());
-                       gc.drawRectangle(rect.x + 1, rect.y + 1, rect.width - 2,
-                                       rect.height - 2);
-               }
-       }
-
-       @Override
-       public void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       int state, List<Rectangle> rects, int selection, List<String> items) {
-               // TODO Auto-generated method stub
-
-       }
-
-       @Override
-       public void drawImage(GC gc, Canvas canvas, Image image, int state,
-                       List<Rectangle> rects, int selection, List<String> items) {
-               // TODO Auto-generated method stub
-
-       }
-
-}
diff --git a/src/org/tizen/emulator/manager/da/widgets/combo/TitleComboRenderer.java b/src/org/tizen/emulator/manager/da/widgets/combo/TitleComboRenderer.java
deleted file mode 100644 (file)
index c3943cd..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.da.widgets.combo;
-
-import org.eclipse.swt.SWT;
-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.tizen.emulator.manager.resources.ColorResources;
-import org.tizen.emulator.manager.resources.FontResources;
-
-public class TitleComboRenderer extends DACustomComboRenderer {
-
-       @Override
-       public void draw(GC gc, Canvas canvas, String text, int state) {
-               Rectangle rect = canvas.getClientArea();
-               setColors(state, gc);
-               gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, true);
-               gc.setForeground(ColorResources.BLACK.getColor());
-               gc.drawRectangle(rect.x, rect.y, rect.width - 20, rect.height - 1);
-
-               if (null == text) {
-                       text = "";
-               }
-               gc.setFont(FontResources.COMBO.getFont());
-               Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-               gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE.getColor());
-               gc.drawString(text, 5, (rect.height - p.y) / 2, true);
-
-               setColors(state, gc);
-               gc.fillGradientRectangle(rect.x + rect.width - 20, rect.y, 19,
-                               rect.height - 1, true);
-               gc.setForeground(ColorResources.BLACK.getColor());
-               gc.drawRectangle(rect.x + rect.width - 20, rect.y, 19, rect.height - 1);
-       }
-
-       @Override
-       public void drawPattern(GC gc, Canvas canvas, Image patternImage,
-                       String text, int state) {
-
-       }
-
-       @Override
-       public void drawImage(GC gc, Canvas canvas, Image image, String text,
-                       int state) {
-               Rectangle rect = canvas.getClientArea();
-               gc.drawImage(image, rect.x, rect.y);
-               Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-               gc.setFont(FontResources.COMBO.getFont());
-               gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE.getColor());
-               gc.drawString(text, 5, (rect.height - p.y) / 2, true);
-               Rectangle clipping = new Rectangle(rect.x + rect.width - 19, rect.y,
-                               19, rect.height);
-               gc.setClipping(clipping);
-               gc.drawImage(image, rect.x, rect.y);
-       }
-
-       private void setColors(int state, GC gc) {
-               if (state == DACustomCombo.STATE_NORMAL) {
-                       gc.setForeground(ColorResources.GRAY2.getColor());
-                       gc.setBackground(ColorResources.WINDOW_BG_COLOR.getColor());
-               } else if (state == DACustomCombo.STATE_HOVER) {
-                       gc.setForeground(ColorResources.GRAY2.getColor());
-                       gc.setBackground(ColorResources.ITEM_BLUE_DARK.getColor());
-               } else if (state == DACustomCombo.STATE_PUSH) {
-                       gc.setForeground(ColorResources.GRAY2.getColor());
-                       gc.setBackground(ColorResources.BLUE.getColor());
-               } else if (state == DACustomCombo.STATE_DISABLE) {
-                       gc.setForeground(ColorResources.GRAY2.getColor());
-                       gc.setBackground(ColorResources.GRAY1.getColor());
-               }
-       }
-
-}
index 180fe53..48282c7 100644 (file)
@@ -40,7 +40,7 @@ import java.util.logging.Level;
 import java.util.logging.LogRecord;
 import java.util.logging.Logger;
 
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 
 public class EMLogger {
        private static EMLogger instance;
@@ -84,7 +84,7 @@ public class EMLogger {
                File logFolder;
                Handler logFileHandler;
                try {
-                       logFolder = new File(FilePath.getInstance().getTizenVmsPath());
+                       logFolder = new File(FilePathResouces.getInstance().getTizenVmsPath());
                        if (!logFolder.exists()) {
                                logFolder.mkdirs();
                        }
index f553377..9091f67 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.platform;
 
 import java.io.IOException;
index 97a0405..dd5230a 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.platform;
 
 import java.io.IOException;
index 573be5d..d49bda7 100644 (file)
@@ -34,7 +34,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 
 public class Platform {
        protected String platformName = null;
@@ -51,14 +51,13 @@ public class Platform {
        //private ArrayList<VMsProperty> templateList = new ArrayList<VMsProperty>();
 
        protected ArrayList<BaseImage> imageList = new ArrayList<BaseImage>();
-
        protected Platform() {
                
        }
 
        public Platform(String name) {
                this.platformName = name;
-               this.platformPath = FilePath.getInstance().getPlatformsPath()
+               this.platformPath = FilePathResouces.getInstance().getPlatformsPath()
                                + File.separator + platformName;
                //this.version = name;
 
@@ -79,8 +78,8 @@ public class Platform {
                        return;
                }
 
-               File defaultImages = new File(platformPath + FilePath.getInstance().getDefaultImagePath());
-               File addonsImages  = new File(platformPath + FilePath.getInstance().getAddonsImagePath());
+               File defaultImages = new File(platformPath + FilePathResouces.getInstance().getDefaultImagePath());
+               File addonsImages  = new File(platformPath + FilePathResouces.getInstance().getAddonsImagePath());
 
                //boolean isDuplicate = false;
                if(defaultImages.exists() && defaultImages.isDirectory()) {
index 59f9589..9f12f09 100644 (file)
@@ -35,7 +35,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.vms.RESOLUTION;
 import org.tizen.emulator.manager.vms.SKIN_TYPE;
 
@@ -54,7 +54,7 @@ public class SkinList {
 
        private SkinList() {
                try {
-                       makeSkinList(new File(FilePath.getInstance().getSkinPath()));
+                       makeSkinList(new File(FilePathResouces.getInstance().getSkinPath()));
                        //defaultSkin = skinsList.get(0);
                } catch (IOException e) {
                        EMLogger.getLogger().warning(e.getMessage());
diff --git a/src/org/tizen/emulator/manager/platform/TotalPlatform.java b/src/org/tizen/emulator/manager/platform/TotalPlatform.java
new file mode 100644 (file)
index 0000000..4314a0d
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.platform;
+
+import java.io.IOException;
+
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.vms.VMProperty;
+
+public class TotalPlatform extends Platform {
+       private CustomBaseImage image = null;
+       public TotalPlatform() {
+               this.platformName = "all";
+               this.platformPath = "";
+               try {
+                       image = new CustomBaseImage(this, "allImage", "x86");
+               } catch (IOException e) {
+                       //TODO
+               }
+       }
+
+       public void settingVMProperty() {
+               if (image == null) {
+                       return;
+               }
+               image.getVmsList().clear();
+               for (Platform p : EmulatorManager.getPlatformList()) {
+                       for (BaseImage base : p.getImageList()) {
+                               for (VMProperty prop : base.getVmsList()) {
+                                       image.addVMsProperty(prop);
+                               }
+                       }
+               }
+
+               for (BaseImage base : EmulatorManager.getCustomPlatform().getImageList()) {
+                       for (VMProperty prop : base.getVmsList()) {
+                               image.addVMsProperty(prop);
+                       }
+               }
+               this.getImageList().add(image);
+       }
+}
index 44c79e4..1b4b5c5 100644 (file)
 /*\r
- *  Dynamic Analyzer\r
+ * Emulator Manager\r
  *\r
- * Copyright(c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.\r
  *\r
- * Contact: \r
- * Jooyoul Lee <jy.exe.lee@samsung.com>\r
- * Juyoung Kim <j0.kim@samsung.com>\r
+ * Contact:\r
+ * JiHye Kim <jihye1128.kim@samsung.com>\r
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>\r
+ * SeokYeon Hwang <syeon.hwang@samsung.com>\r
  *\r
- * Licensed under the Apache License, Version 2.0(the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
  *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
  *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * \r
  * Contributors:\r
  * - S-Core Co., Ltd\r
- * \r
+ *\r
  */\r
 \r
 package org.tizen.emulator.manager.resources;\r
 \r
 import org.eclipse.swt.graphics.Color;\r
 import org.eclipse.swt.graphics.RGB;\r
+import org.eclipse.swt.widgets.Display;\r
 \r
 public enum ColorResources {\r
-       WHITE("white", null),\r
-       BLACK("black", null),\r
-       BLUE("blue", null),\r
-       RED("red", null),\r
-       YELLOW("yellow", null),\r
-       PURPLE("purple", null),\r
-\r
-       GREEN("green", null),\r
-       BROWN("brown", null),\r
-       NAVY("navy", null),\r
-       DARKVIOLET("darkviolet", null),\r
-       MAROON("maroon", null),\r
-       TEAL("teal", null),\r
-       INDIGO("indigo", null),\r
-       DARKGOLDENROD("darkgoldenrod", null),\r
-       CHOCOLATE("chocolate", null),\r
-       MAGNETA("magneta", null),\r
-\r
-       GOLDENROD("goldenrod", null),\r
-       TURQUOISE("turquoise", null),\r
-       VIOLET("violet", null),\r
-       SLATEBLUE("slateblue", null),\r
-       ORANGE("orange", null),\r
-       YELLOWGREEN("yellowgreen", null),\r
-       SKYBLUE("skyblue", null),\r
-       ORCHID("orchid", null),\r
-       SANDYBROWN("sandybrown", null),\r
-       MEDIUMPURPLE("mediumpurple", null),\r
-       GRAY1("gray1", null),\r
-       GRAY2("gray2", null),\r
-       GRAY3("gray3", null),\r
-\r
-       // shell window background color\r
-       WINDOW_BG_COLOR("window_bg_color", null),\r
-\r
-       DIALOG_BG_UPPER("dialg_bg_upper", null),\r
-       DIALOG_BG_LOWER("dialg_bg_lower", null),\r
-       DIALOG_SUNKEN_1("dialg_sunken_1", null),\r
-       DIALOG_SUNKEN_2("dialg_sunken_2", null),\r
-\r
-       EDIT_CHART_DIALOG_UPPER("edit_chart_dialog_upper", null),\r
-       EDIT_CHART_DIALOG_LOWER("edit_chart_dialog_lower", null),\r
-\r
-       VIEW_BORDER("view_border", null),\r
-       VIEW_BG_COLOR("view_bg_color", null),\r
-       VIEW_TITLE_FONT_COLOR("view_title_font_color", null),\r
-\r
-       /** title bar colors **/\r
-       TITLEBAR_TEXT_COLOR("titlebar_text_color", null),\r
-       TITLEBAR_BG_COLOR("titlebar_bg", null),\r
-       TITLEBAR_START_COLOR("titlebar_start_color", null),\r
-       TITLEBAR_END_COLOR("titlebar_end_color", null),\r
-       TITLEBAR_BOTTOM_STROKE_1("titlebar_bottom_stroke_1", null),\r
-       TITLEBAR_BOTTOM_STROKE_2("titlebar_bottom_stroke_2", null),\r
-\r
-       /** Coolbar bg color **/\r
-       COOLBAR_BG_COLOR("coolbar_bg_color", null),\r
-       DEFAULT_FONT_COLOR("default_font_color", null),\r
-\r
-       /** device and application combo specific colors start **/\r
-       DEVICE_APPLICATION_ENABLE("device_application_enable_font", null),\r
-       DEVICE_APPLICATION_DISABLE("device_application_disable", null),\r
-       DEVICE_APPLICATION_POPUP_OUTER_1("device_application_popup_outer_1", null),\r
-       DEVICE_APPLICATION_POPUP_OUTER_2("device_application_popup_outer_2", null),\r
-       DEVICE_APPLICATION_DROPDOWN_TEXT("device_application_enable_font", null),\r
-       DEVICE_APPLICATION_ITEM_NORMAL_TOP("device_application_item_normal_top", null),\r
-       DEVICE_APPLICATION_ITEM_NORMAL_INNER("device_application_item_normal_inner", null),\r
-       DEVICE_APPLICATION_ITEM_NORMAL_BOTTOM("device_application_item_normal_bottom", null),\r
-       DEVICE_APPLICATION_ITEM_SELECT_TOP("device_application_item_select_top", new RGB(76, 76, 77)),\r
-       DEVICE_APPLICATION_ITEM_SELECT_INNER("device_application_item_select_inner", null),\r
-       DEVICE_APPLICATION_ITEM_SELECT_BOTTOM("device_application_item_select_bottom", null),\r
-\r
-       /*** combo button color ***/\r
-       DEVICE_APPLICATION_BUTTON_NORMAL_START("device_application_button_normal_start", null),\r
-       DEVICE_APPLICATION_BUTTON_NORMAL_END("device_application_button_normal_end", null),\r
-       DEVICE_APPLICATION_BUTTON_PUSH_START("device_application_button_push_start", null),\r
-       DEVICE_APPLICATION_BUTTON_PUSH_END("device_application_button_push_end", null),\r
-       DEVICE_APPLICATION_BUTTON_HOVER_START("device_application_button_hover_start", null),\r
-       DEVICE_APPLICATION_BUTTON_HOVER_END("device_application_button_hover_end", null),\r
-       DEVICE_APPLICATION_BUTTON_DISABLE_START("device_application_button_disable_start", null),\r
-       DEVICE_APPLICATION_BUTTON_DISABLE_END("device_application_button_disable_end", null),\r
-       DEVICE_APPLICATION_BUTTON_OUTLINE("device_application_button_outline", null),\r
-\r
-       /*** common button colors ***/\r
-       BUTTON_NORMAL_FONT_COLOR("button_normal_font_color", null),\r
-       BUTTON_PUSH_FONT_COLOR("button_push_font_color", null),\r
-       BUTTON_HOVER_FONT_COLOR("button_hover_font_color", null),\r
-       BUTTON_DISABLE_FONT_COLOR("button_disable_font_color", null),\r
-\r
-       /** normal view layout colors start **/\r
-       NORMAL_VIEW_LAYOUT_OUTER("normal_view_layout_outer", null),\r
-       NORMAL_VIEW_LAYOUT_MIDDLE("normal_view_layout_middle", null),\r
-       NORMAL_VIEW_LAYOUT_INNER("normal_view_layout_inner", null),\r
-       /** normal view layout colors end **/\r
-\r
-       /** tab widget colors start **/\r
-       TAB_SELECTED_FONT_COLOR("tab_selected_font_color", null),\r
-       TAB_NORMAL_FONT_COLOR("tab_normal_font_color", null),\r
-       TAB_HOVER_FONT_COLOR("tab_hover_font_color", null),\r
-       TAB_PUSH_FONT_COLOR("tab_push_font_color", null),\r
-\r
-       TAB_BG_COLOR("tab_bg_color", null),\r
-       TAB_CONTENTS_BG_COLOR("tab_contents_bg_color", null),\r
-       /** tab widget colors end **/\r
-\r
-       /** list view colors start **/\r
-       LIST_BG_COLOR("list_bg_color", null),\r
-       VM_BUTTON_FONT_COLOR("vm_button_font_color", null),\r
-       /** list view colors end **/\r
-\r
-       /** detail view colors start **/\r
-       DETAIL_VIEW_PAGE_COLOR("detail_view_page_color", null),\r
-       DETAIL_TOP_FONT_COLOR("detail_top_font_color", null),\r
-       DETAIL_TITILE_FONT_COLOR("detail_title_font_color", null),\r
-       DETAIL_ENABLE_FONT_COLOR("detail_enable_font_color", null),\r
-       DETAIL_DISABLE_FONT_COLOR("detail_disable_font_color", null),\r
-       DETAIL_CATEGORY_FONT_COLOR("detail_category_font_color", null),\r
-       DETAIL_TOP_COLOR("detail_top_color", null),\r
-       DETAIL_MIDDLE_COLOR("detail_middle_color", null),\r
-       DETAIL_INPUT_BOX_COLOR("detail_input_box_color", null),\r
-       /** detail view colors end **/\r
-\r
-       TOOLTIP("tooltip", null),\r
+       WHITE("white", new RGB(255, 255, 255)),\r
+       BLACK("black", new RGB(0, 0, 0)),\r
+       BLUE("blue", new RGB(0, 102, 134)),\r
+       RED("red", new RGB(255, 0, 0)),\r
+       YELLOW("yellow", new RGB(255, 210, 10)),\r
+       PURPLE("purple", new RGB(139, 42, 118)),\r
+\r
+       GREEN("green", new RGB(68, 98, 12)),\r
+       BROWN("brown", new RGB(138, 83, 0)),\r
+       NAVY("navy", new RGB(57, 66, 161)),\r
+       DARKVIOLET("darkviolet", new RGB(105, 2, 126)),\r
+       MAROON("maroon", new RGB(126, 41, 2)),\r
+       TEAL("teal", new RGB(27, 110, 92)),\r
+       INDIGO("indigo", new RGB(80, 26, 146)),\r
+       DARKGOLDENROD("darkgoldenrod", new RGB(212, 150, 57)),\r
+       CHOCOLATE("chocolate", new RGB(151, 124, 39)),\r
+       MAGNETA("magneta", new RGB(155, 20, 184)),\r
+\r
+       GOLDENROD("goldenrod", new RGB(212, 150, 57)),\r
+       TURQUOISE("turquoise", new RGB(72, 194, 168)),\r
+       ORANGE("orange", new RGB(236, 107, 47)),\r
+       YELLOWGREEN("yellowgreen", new RGB(129, 172, 50)),\r
+       SKYBLUE("skyblue", new RGB(72, 185, 221)),\r
+       ORCHID("orchid", new RGB(175, 49, 200)),\r
+       SANDYBROWN("sandybrown", new RGB(201, 168, 58)),\r
+       MEDIUMPURPLE("mediumpurple", new RGB(160, 108, 224)),\r
+\r
+       WINDOW_BG_COLOR("window_bg_color", new RGB(160, 160, 160)),\r
+\r
+       /** tab widget colors **/\r
+       TAB_SELECTED_FONT_COLOR("tab_selected_font_color", new RGB(48, 48, 48)),\r
+       TAB_NORMAL_FONT_COLOR("tab_normal_font_color", new RGB(205, 205, 205)),\r
+       TAB_HOVER_FONT_COLOR("tab_hover_font_color", new RGB(205, 205, 205)),\r
+       TAB_PUSH_FONT_COLOR("tab_push_font_color", new RGB(205, 205, 205)),\r
+       TAB_BG_COLOR("tab_bg_color",  new RGB(55, 55, 55)),\r
+       TAB_CONTENTS_BG_COLOR("tab_contents_bg_color", new RGB(209, 209, 209)),\r
+\r
+       /** list view colors **/\r
+       LIST_BG_COLOR("list_bg_color", new RGB(226, 226, 226)),\r
+       VM_BUTTON_FONT_COLOR("vm_button_font_color", new RGB(240, 240, 240)),\r
+\r
+       /** detail view colors **/\r
+       DETAIL_VIEW_PAGE_COLOR("detail_view_page_color", new RGB(209, 209, 209)),\r
+       DETAIL_TOP_FONT_COLOR("detail_top_font_color", new RGB(255, 255, 255)),\r
+       DETAIL_TITILE_FONT_COLOR("detail_title_font_color",  new RGB(0, 0, 0)),\r
+       DETAIL_ENABLE_FONT_COLOR("detail_enable_font_color", new RGB(38, 38, 38)),\r
+       DETAIL_DISABLE_FONT_COLOR("detail_disable_font_color", new RGB(153, 153, 153)),\r
+       DETAIL_CATEGORY_FONT_COLOR("detail_category_font_color", new RGB(255, 255, 255)),\r
+       DETAIL_TOP_COLOR("detail_top_color", new RGB(0x7F, 0x7F, 0x7F)),\r
+       DETAIL_MIDDLE_COLOR("detail_middle_color", new RGB(0xB6, 0xB6, 0xB6)),\r
+       DETAIL_INPUT_BOX_COLOR("detail_input_box_color", new RGB(229, 229, 229)),\r
+\r
+       /** image button **/\r
+       BUTTON_BG_COLOR("button_bg_color", new RGB(226, 226, 226)),\r
+       BUTTON_ENABLE_FONT_COLOR("button_enable_font_color", new RGB(20, 20, 20)),\r
+       BUTTON_DISABLE_FONT_COLOR("button_disable_font_color", new RGB(155, 155, 155)),\r
+\r
+       /** combo widget colors **/\r
+       COMBO_BG_COLOR("combo_bg_color", new RGB(226, 226, 226)),\r
+       COMOB_ENABLE_FONT_COLOR("combo_enable_font_color", new RGB(30, 30, 30)),\r
+       COMBO_DISABLE_FONT_COLOR("combo_disable_font_color", new RGB(155, 155, 155)),\r
+       COMBO_ITEM_SELECT_COLOR("combo_item_select", new RGB(50, 185, 231)),\r
+       COMBO_ITEM_NORMAL_COLOR("combo_item_normal", new RGB(230, 230, 230)),\r
+       COMBO_ITEM_SEPERATE_TOP_COLOR("combo_item_seperate_top", new RGB(255, 255, 255)),\r
+       COMBO_ITEM_SEPERATE_BOTTOM_COLOR("combo_item_seperate_bottom", new RGB(189, 189, 189)),\r
+       COMBO_ITEM_FONT_COLOR("combo_item_font", new RGB(30, 30, 30)),\r
+       COMBO_POPUP_OUTER_1_COLOR("combo_popup_outer1", new RGB(120, 120, 120)),\r
+       COMBO_POPUP_OUTER_2_COLOR("combo_popup_outer2", new RGB(50, 185, 231)),\r
+\r
+       TOOLTIP("tooltip", new RGB(255, 255, 225)),\r
 \r
        /** status bar **/\r
-       STATUS_BAR_COLOR("status_bar_color", null),\r
-       STATUS_BAR_FONT_COLOR("status_bar_font_color", null),\r
-\r
-       ITEM_BLUE_RIGHT("item_blue_right", null),\r
-       ITEM_BLUE_DARK("item_blue_dark", null);\r
+       STATUS_BAR_COLOR("status_bar_color", new RGB(174, 174, 174)),\r
+       STATUS_BAR_FONT_COLOR("status_bar_font_color", new RGB(0, 0, 0));\r
 \r
        String name;\r
        Color color;\r
@@ -173,14 +121,22 @@ public enum ColorResources {
        public Color getColor() {\r
                if (this.color == null) {\r
                        if (rgb != null) {\r
-                               this.color = DAThemeWhite.getInstance().getColor(name, rgb);\r
+                               this.color = createColor(rgb);\r
                        } else {\r
-                               this.color = DAThemeWhite.getInstance().getColor(name);\r
+                               this.color = createColor(new RGB(255, 255, 255));\r
                        }\r
                }\r
                return color;\r
        }\r
 \r
+       private Color createColor(RGB rgb) {\r
+               Display display = Display.getCurrent();\r
+               if (display == null) {\r
+                       throw new IllegalStateException();\r
+               }\r
+        return new Color(display, rgb);\r
+    }\r
+\r
        @Override\r
        public String toString() {\r
                return name;\r
diff --git a/src/org/tizen/emulator/manager/resources/DATheme.java b/src/org/tizen/emulator/manager/resources/DATheme.java
deleted file mode 100644 (file)
index 4d15cc7..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.resources;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-class ColorRegistry {
-       private Map<String,Color> stringToColor = new HashMap<String, Color>(7);
-       private Map<String, RGB> stringToRGB = new HashMap<String, RGB>(7);
-       private Display display = null;
-       private final boolean cleanOnDisplayDisposal = true;
-
-       public ColorRegistry() {
-               this.display = Display.getCurrent();
-       }
-
-       private Color createColor(RGB rgb) {
-        if (this.display == null) {
-            Display display = Display.getCurrent();
-            if (display == null) {
-                throw new IllegalStateException();
-            }
-            this.display = display;
-            if (cleanOnDisplayDisposal) {
-                hookDisplayDispose();
-            }
-        }
-        return new Color(display, rgb);
-    }
-
-       private void disposeColors(Iterator<Color> iterator) {
-               while (iterator.hasNext()) {
-                   Color next = iterator.next();
-                   next.dispose();
-               }
-       }
-
-       public Color get(String symbolicName) {
-
-        assert symbolicName == null;
-
-        Color result = stringToColor.get(symbolicName);
-        if (result != null) {
-            return (Color) result;
-        }
-
-        Color color = null;
-
-        RGB rgb = stringToRGB.get(symbolicName);
-        if (rgb == null) {
-            return null;
-        }
-
-        color = createColor(rgb);
-
-        stringToColor.put(symbolicName, color);
-
-        return color;
-    }
-
-        public boolean hasValueFor(String colorKey) {
-                return stringToRGB.containsKey(colorKey);
-        }
-
-        private void hookDisplayDispose() {
-                display.disposeExec(displayRunnable);
-        }
-
-        public void put(String symbolicName, RGB colorData) {
-
-               assert symbolicName == null;
-               assert colorData == null;
-               
-               RGB existing = (RGB) stringToRGB.get(symbolicName);
-               if (colorData.equals(existing)) {
-                   return;
-               }
-
-               stringToRGB.put(symbolicName, colorData);
-       }
-
-        protected Runnable displayRunnable = new Runnable() {
-                public void run() {
-                        clearCaches();
-           }
-       };
-
-        protected void clearCaches() {
-               disposeColors(stringToColor.values().iterator());
-               stringToColor.clear();
-               display = null;
-       }
-}
-
-public abstract class DATheme {
-       protected String name = "black";//$NON-NLS-1$
-       protected static ColorRegistry colorRegistry = new ColorRegistry();
-
-       public DATheme() {
-               setColor("white", new RGB(255, 255, 255)); //$NON-NLS-1$
-               setColor("black", new RGB(0, 0, 0)); //$NON-NLS-1$
-               setColor("blue", new RGB(0, 0, 255)); //$NON-NLS-1$
-               setColor("red", new RGB(255, 0, 0)); //$NON-NLS-1$
-               setColor("purple", new RGB(226, 101, 225)); //$NON-NLS-1$
-       }
-
-       public abstract Color getColor(String colorName, RGB rgb);
-
-       public abstract Color getColor(String colorName);
-
-       public abstract void setColor(String colorName, RGB rgb);
-
-       public String getThemePath() {
-               return "theme" + File.separator + name + File.separator;//$NON-NLS-1$
-       }
-
-       public String getImagePath() {
-               String path = getThemePath() + "img" + File.separator;//$NON-NLS-1$
-               return path;
-       }
-}
diff --git a/src/org/tizen/emulator/manager/resources/DAThemeWhite.java b/src/org/tizen/emulator/manager/resources/DAThemeWhite.java
deleted file mode 100644 (file)
index 005752e..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.emulator.manager.resources;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-
-public class DAThemeWhite extends DATheme {
-       private static DAThemeWhite instance;
-
-       public static DAThemeWhite getInstance() {
-               if (instance == null) {
-                       instance = new DAThemeWhite();
-               }
-               return instance;
-       }
-
-       DAThemeWhite() {
-               super();
-               name = "white";
-
-               // defaule
-               setColor("blue", new RGB(0, 102, 134));
-               setColor("green", new RGB(68, 98, 12));
-               setColor("yellow", new RGB(255, 210, 10));
-               setColor("purple", new RGB(139, 42, 118));
-               setColor("brown", new RGB(138, 83, 0));
-               setColor("navy", new RGB(57, 66, 161));
-               setColor("darkviolet", new RGB(105, 2, 126));
-               setColor("maroon", new RGB(126, 41, 2));
-               setColor("teal", new RGB(27, 110, 92));
-               setColor("indigo", new RGB(80, 26, 146));
-               setColor("goldenrod", new RGB(212, 150, 57));
-               setColor("turquoise", new RGB(72, 194, 168));
-               setColor("violet", new RGB(226, 109, 201));
-               setColor("slateblue", new RGB(122, 132, 238));
-               setColor("orange", new RGB(236, 107, 47));
-               setColor("yellowgreen", new RGB(129, 172, 50));
-               setColor("skyblue", new RGB(72, 185, 221));
-               setColor("orchid", new RGB(175, 49, 200));
-               setColor("sandybrown", new RGB(201, 168, 58));
-               setColor("mediumpurple", new RGB(160, 108, 224));
-               setColor("chocolate", new RGB(151, 124, 39));
-               setColor("magneta", new RGB(155, 20, 184));
-               setColor("GRAY1", new RGB(177, 177, 177)); //$NON-NLS-1$
-               setColor("GRAY2", new RGB(153, 153, 153)); //$NON-NLS-1$
-               setColor("GRAY3", new RGB(216, 216, 216)); //$NON-NLS-1$
-
-               // shell window background color
-               setColor("window_bg_color", new RGB(160, 160, 160)); //$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$
-               getColor("view_title_font_color", new RGB(0, 0, 0));
-
-               setColor("coolbar_bg_color", new RGB(228, 228, 228)); //$NON-NLS-1$
-               setColor("default_font_color", new RGB(0, 0, 0));//$NON-NLS-1$
-
-               /** title bar colors **/
-               setColor("titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$
-               setColor("titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$
-               setColor("titlebar_start_color", new RGB(240, 240, 240)); //$NON-NLS-1$
-               setColor("titlebar_end_color", new RGB(165, 165, 165)); //$NON-NLS-1$
-               setColor("titlebar_bottom_stroke_1", new RGB(115, 115, 115));
-               setColor("titlebar_bottom_stroke_2", new RGB(160, 160, 160));
-
-               /** device and application combo specific colors start **/
-               setColor("device_application_enable_font", new RGB(0, 0, 0)); //$NON-NLS-1$
-               setColor("device_application_disable_font", new RGB(160, 160, 160)); //$NON-NLS-1$
-               setColor("device_application_popup_outer_1", new RGB(120, 120, 120)); //$NON-NLS-1$
-               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_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$
-               /** 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_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_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_font_color", new RGB(0, 0, 0));
-               setColor("button_push_font_color", new RGB(91, 91, 91));
-               setColor("button_hover_font_color", new RGB(91, 91, 91));
-               setColor("button_disable_font_color", new RGB(140, 140, 140));
-
-               /** normal view layout colors start **/
-               setColor("normal_view_layout_outer", new RGB(160, 160, 160)); //$NON-NLS-1$
-               setColor("normal_view_layout_middle", new RGB(74, 74, 74)); //$NON-NLS-1$
-               setColor("normal_view_layout_inner", new RGB(66, 66, 68)); //$NON-NLS-1$
-               /** normal view layout colors end **/
-
-               /** tab widget colors **/
-               setColor("tab_selected_font_color", new RGB(48, 48, 48));
-               setColor("tab_normal_font_color", new RGB(205, 205, 205));
-               setColor("tab_hover_font_color", new RGB(205, 205, 205));
-               setColor("tab_push_font_color", new RGB(205, 205, 205));
-
-               setColor("tab_bg_color", new RGB(55, 55, 55));
-               setColor("tab_contents_bg_color", new RGB(209, 209, 209));
-
-               /** list view colors **/
-               setColor("list_bg_color", new RGB(226, 226, 226));
-               setColor("vm_button_font_color", new RGB(240, 240, 240));
-               /**********************/
-
-               /** detail view colors **/
-               setColor("detail_view_page_color", new RGB(209, 209, 209)); //tab_contents_bg_color
-               setColor("detail_top_font_color", new RGB(255, 255, 255));
-               setColor("detail_title_font_color", new RGB(0, 0, 0));
-               setColor("detail_enable_font_color", new RGB(38, 38, 38));
-               setColor("detail_disable_font_color", new RGB(153, 153, 153));
-               setColor("detail_category_font_color", new RGB(255, 255, 255));
-               setColor("detail_top_color", new RGB(0x7F, 0x7F, 0x7F));
-               setColor("detail_middle_color", new RGB(0xB6, 0xB6, 0xB6));
-               setColor("detail_input_box_color", new RGB(229, 229, 229));
-               /************************/
-               setColor("tooltip", new RGB(255, 255, 225)); //$NON-NLS-1$
-
-               /** status bar **/
-               setColor("status_bar_color", new RGB(174, 174, 174));
-               setColor("status_bar_font_color", new RGB(0, 0, 0));
-               
-               setColor("item_blue_right", new RGB(131, 196, 218));
-               setColor("item_blue_dark", new RGB(38, 104, 138));
-       }
-
-       public Color getColor(String colorName, RGB rgb) {
-               if (!colorRegistry.hasValueFor(colorName)) {
-                       colorRegistry.put(colorName, rgb);
-               }
-               return colorRegistry.get(colorName);
-       }
-
-       public void setColor(String colorName, RGB rgb) {
-               colorRegistry.put(colorName, rgb);
-       }
-
-       @Override
-       public Color getColor(String colorName) {
-               return colorRegistry.get(colorName);
-       }
-
-}
@@ -40,7 +40,7 @@ import java.net.URISyntaxException;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.vms.EmulatorVMList;
 
-public class FilePath {
+public class FilePathResouces {
        private final static String bin_suffix  = File.separator + "tools" + File.separator + "emulator" + File.separator + "bin";
 
        private final static String platform_suffix  = File.separator + "platforms";
@@ -261,18 +261,18 @@ public class FilePath {
 
        }
 
-       static FilePath instance = null;
+       static FilePathResouces instance = null;
 
        static {
-               synchronized(FilePath.class) {
-                       instance = new FilePath();
+               synchronized(FilePathResouces.class) {
+                       instance = new FilePathResouces();
                }
        }
 
-       private FilePath() {
+       private FilePathResouces() {
        }
 
-       public static FilePath getInstance() {
+       public static FilePathResouces getInstance() {
                return instance;
        }
 
index 8cde158..bcf30a9 100644 (file)
  * - S-Core Co., Ltd\r
  * \r
  */\r
-package org.tizen.emulator.manager.resources;\r
 \r
-import java.util.HashMap;\r
-import java.util.Map;\r
+package org.tizen.emulator.manager.resources;\r
 \r
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.graphics.Font;\r
@@ -71,6 +69,14 @@ public enum FontResources {
        // * Status bar\r
        STATUS_BAR_FONT("status_bar_font", resizeDefaultFont(9)),\r
 \r
+       // * Radio button\r
+       RADIO_BUTTON_FONT("radio_button_font", resizeDefaultFont(8)),\r
+\r
+       // * Tree view\r
+       TREE_CREATE_FONT("tree_creaet_font", setDefaultFontStyleAndSize(SWT.BOLD, 9)),\r
+       TREE_HEADER_FONT("tree_header_font", resizeDefaultFont(9)),\r
+       TREE_ITEM_FONT("tree_item_font", resizeDefaultFont(8)),\r
+\r
        // * not support\r
        TOOLTIP("tooltip", resizeDefaultFont(9));\r
 \r
@@ -88,7 +94,7 @@ public enum FontResources {
 \r
        public Font getFont(String fontName, FontData[] fontData) {\r
                if (this.font == null) {\r
-                       this.font = FontRegistry.getFont(name, data);\r
+                       this.font = new Font(Display.getCurrent(), fontData);\r
                }\r
                return font;\r
        }\r
@@ -142,28 +148,9 @@ public enum FontResources {
                } else {\r
                        return Display.getCurrent().getSystemFont();\r
                }\r
-               return FontRegistry.getFont(\r
-                               "ex_font", new FontData[] { new FontData(fontName, 9, SWT.NORMAL) });\r
-       }\r
-}\r
-\r
-class FontRegistry {\r
-       private static Map<String, FontData[]> stringToFontData = null;\r
-       static {\r
-               if (stringToFontData == null) {\r
-                       stringToFontData = new HashMap<String, FontData[]>(7);\r
-               }\r
-       }\r
-\r
-       public static Font getFont(String fontName, FontData[] fontData) {\r
-               if (stringToFontData == null) {\r
-                       stringToFontData = new HashMap<String, FontData[]>(7);\r
-               }\r
-               if (!stringToFontData.containsKey(fontName)) {\r
-                       stringToFontData.put(fontName, fontData);\r
+               if (defaultFont == null) {\r
+                       defaultFont = new Font(Display.getCurrent(), new FontData[] { new FontData(fontName, 9, SWT.NORMAL) });\r
                }\r
-\r
-               return new Font(Display.getCurrent(), fontData);\r
+               return defaultFont;\r
        }\r
-\r
-}\r
+}
\ No newline at end of file
index 52fa650..c8a4e97 100644 (file)
@@ -149,7 +149,7 @@ public enum ImageResources {
        
        BUTTON_HOVER_LEFT("button_hover_left"),
        BUTTON_HOVER_MIDDLE("button_hover_middle"),
-       BUTTON_HOVEr_RIGHT("button_hover_right");
+       BUTTON_HOVER_RIGHT("button_hover_right");
 
        String name;
        Image image;
index 021a4fd..ee866f7 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.resources;
 
 import org.eclipse.swt.graphics.GC;
@@ -28,7 +57,7 @@ public class PatchImageResources {
        public static Image getHoverButton(int width) {
                Image left = ImageResources.BUTTON_HOVER_LEFT.getImage();
                Image middle = ImageResources.BUTTON_HOVER_MIDDLE.getImage();
-               Image right = ImageResources.BUTTON_HOVEr_RIGHT.getImage();
+               Image right = ImageResources.BUTTON_HOVER_RIGHT.getImage();
 
                int height = left.getImageData().height;
                Image image = new Image(Display.getCurrent(), width, height);
index 411f620..dbc4c06 100644 (file)
@@ -39,7 +39,7 @@ import java.util.Properties;
 import java.util.logging.Level;
 
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.vms.EmulatorVMList;
 
@@ -94,7 +94,7 @@ public class About {
                // getting version
                BufferedReader about = null;
                try {
-                       about = new BufferedReader(new FileReader(new File(FilePath.getInstance().getEtcPath()
+                       about = new BufferedReader(new FileReader(new File(FilePathResouces.getInstance().getEtcPath()
                                        + File.separator + "version")));
                        if (about != null) {
                                ver = about.readLine();
index 06571a0..57fd48d 100644 (file)
@@ -38,7 +38,7 @@ import java.nio.channels.FileChannel;
 import java.util.logging.Level;
 
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 
 public class CheckSDCard {
@@ -46,7 +46,7 @@ public class CheckSDCard {
        }
 
        public static void CheckSwapDir() {
-               File dir = new File(FilePath.getInstance().getSwapPath());
+               File dir = new File(FilePathResouces.getInstance().getSwapPath());
 
                if (!dir.exists()) {
                        dir.mkdir();
@@ -54,10 +54,10 @@ public class CheckSDCard {
 
                File dest = null;
                File src = null;
-               dest = new File(FilePath.getInstance().getSwapPath()
+               dest = new File(FilePathResouces.getInstance().getSwapPath()
                                        + File.separator + StringResources.SWAP_IMAGE);
                if (!dest.exists()) {
-                       src = new File(FilePath.getInstance().getbaseSwapPath()
+                       src = new File(FilePathResouces.getInstance().getbaseSwapPath()
                                        + File.separator + StringResources.SWAP_IMAGE);
                        if (!src.exists()) {
                                EMLogger.getLogger().log(Level.WARNING,
@@ -116,7 +116,7 @@ public class CheckSDCard {
        }
 
        public static void CheckSDCardDir() {
-               File dir = new File(FilePath.getInstance().getTizenWorkspacePath()
+               File dir = new File(FilePathResouces.getInstance().getTizenWorkspacePath()
                                                + File.separator + StringResources.SD_CARD_DIR);
                
                if (!dir.exists()) {
@@ -126,11 +126,11 @@ public class CheckSDCard {
                File dest = null;
                File src = null;
                for (String s : StringResources.SD_CARD) {
-                       dest = new File(FilePath.getInstance().getTizenWorkspacePath()
+                       dest = new File(FilePathResouces.getInstance().getTizenWorkspacePath()
                                                + File.separator + StringResources.SD_CARD_DIR
                                                + File.separator + s);
                        if (!dest.exists()) {
-                               src = new File(FilePath.getInstance().getSDCardPath()
+                               src = new File(FilePathResouces.getInstance().getSDCardPath()
                                                + File.separator +s);
                                if (!src.exists()) {
                                        EMLogger.getLogger().log(Level.WARNING,
index acf97e4..cfb7336 100644 (file)
@@ -42,7 +42,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 
 public class CheckVirtualization {
@@ -140,10 +140,10 @@ public class CheckVirtualization {
                                int exitValue = 1;
 
                                List<String> cmd = new ArrayList<String>();
-                               cmd.add(FilePath.getInstance().getBinPath() + File.separator + 
+                               cmd.add(FilePathResouces.getInstance().getBinPath() + File.separator + 
                                                (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1 ? "check-hax.exe" : "check-hax"));
                                ProcessBuilder pb = new ProcessBuilder(cmd);
-                               pb.directory(new File(FilePath.getInstance().getBinPath()));
+                               pb.directory(new File(FilePathResouces.getInstance().getBinPath()));
 
                                try {
                                        Process process = null;
@@ -186,10 +186,10 @@ public class CheckVirtualization {
                        int exitValue = 1;
 
                        List<String> cmd = new ArrayList<String>();
-                       cmd.add(FilePath.getInstance().getBinPath() + File.separator +
+                       cmd.add(FilePathResouces.getInstance().getBinPath() + File.separator +
                                        (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1 ? "check-gl.exe" : "check-gl"));
                        ProcessBuilder pb = new ProcessBuilder(cmd);
-                       pb.directory(new File(FilePath.getInstance().getBinPath()));
+                       pb.directory(new File(FilePathResouces.getInstance().getBinPath()));
 
                        try {
                                Process process = null;
index 2b4b79f..32e708b 100644 (file)
@@ -40,7 +40,7 @@ import javax.xml.bind.Unmarshaller;
 import javax.xml.transform.stream.StreamSource;
 
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
 
@@ -60,7 +60,7 @@ public class SelectTemplate {
 
        private SelectTemplate() {
                // Common Template Path
-               File dir = new File(FilePath.getInstance().getTemplatePath());
+               File dir = new File(FilePathResouces.getInstance().getTemplatePath());
                if (dir.exists()) {
                        templateList = new ArrayList<VMProperty>();
                        for (File config : dir.listFiles(new FileFilter() {
index f3bcef2..89baed6 100644 (file)
@@ -35,6 +35,8 @@ import java.util.ArrayList;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ControlEvent;
 import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FillLayout;
@@ -47,8 +49,6 @@ import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
 import org.tizen.emulator.manager.platform.Platform;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.ImageResources;
@@ -56,14 +56,15 @@ import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.dialog.AboutDialog;
 import org.tizen.emulator.manager.ui.tabfolder.PlatformTabFolder;
 import org.tizen.emulator.manager.ui.tabfolder.PlatformTabItem;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 
 public class MainDialog {
        private static final String ICON_FILE_NAME = "res/em.ico";
 
        public static final int DEFALUT_WIDTH  = 840;
        public static final int DEFAULT_HEIGHT = 482;
-       public static final int MIN_HEIGHT      = 480;
-       public static final int MIN_WIDTH       = 500;
+       public static final int MIN_HEIGHT      = 380;
+       public static final int MIN_WIDTH       = 620;
        public static int WIDTH  = DEFALUT_WIDTH;
        public static int HEIGHT = DEFAULT_HEIGHT;
 
@@ -120,8 +121,8 @@ public class MainDialog {
 
        private ArrayList<PlatformTabItem> platformItems = new ArrayList<PlatformTabItem>(10);
        private static PlatformTabFolder tabFolder = null;
-       private DACustomButton resetButton = null;
-       private DACustomButton infoButton  = null;
+       private ImageButton resetButton = null;
+       private ImageButton infoButton  = null;
        private static StatusBar statusBar = null;
        private static int STATUS_BAR_HEIGHT = 20;
        private static int OFFSET = 2;
@@ -181,17 +182,22 @@ public class MainDialog {
                // add custom tab
                platformItems.add(new PlatformTabItem(EmulatorManager.getCustomPlatform(),
                                tabFolder, SWT.CENTER));
+               // add all tab (tree view)
+               platformItems.add(new PlatformTabItem(EmulatorManager.getTotalPlatform(),
+                               tabFolder, SWT.CENTER));
 
-               resetButton = new DACustomButton(tabFolder.getTabComposite(),
-                               ImageResources.RESET_ICON_NOMAL.getImage(),
-                               ImageResources.RESET_ICON_PUSH.getImage(),
+               resetButton = new ImageButton(tabFolder.getTabComposite(), SWT.PUSH);
+               resetButton.setImages(ImageResources.RESET_ICON_NOMAL.getImage(),
                                ImageResources.RESET_ICON_HOVER.getImage(),
+                               ImageResources.RESET_ICON_PUSH.getImage(),
+                               null, null,
                                ImageResources.RESET_ICON_NOMAL.getImage());
 
-               infoButton = new DACustomButton(tabFolder.getTabComposite(),
-                               ImageResources.INFO_ICON_NOMAL.getImage(),
-                               ImageResources.INFO_ICON_PUSH.getImage(),
+               infoButton = new ImageButton(tabFolder.getTabComposite(), SWT.PUSH);
+               infoButton.setImages(ImageResources.INFO_ICON_NOMAL.getImage(),
                                ImageResources.INFO_ICON_HOVER.getImage(),
+                               ImageResources.INFO_ICON_PUSH.getImage(),
+                               null, null,
                                ImageResources.INFO_ICON_NOMAL.getImage());
 
                tabFolder.addTabRightButton(resetButton);
@@ -237,20 +243,32 @@ public class MainDialog {
 
        private void decorateRightSideToolItems() {
                infoButton.setToolTipText("About Emulator Manager");
-               infoButton.addClickListener(new DACustomButtonClickEventListener() {
+               infoButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                AboutDialog.open();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
 
                resetButton.setToolTipText("Refresh list of VM");
-               resetButton.addClickListener(new DACustomButtonClickEventListener() {
+               resetButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                // reload vm list
                                refreshVMPropertyList(false);
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
        }
 }
index d6cef31..3f85af5 100644 (file)
@@ -35,7 +35,7 @@ import java.util.ArrayList;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Shell;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.dialog.CloneDialog;
 import org.tizen.emulator.manager.ui.dialog.MessageDialog;
@@ -82,7 +82,7 @@ public class MenuHandling {
                }
 
                if(property.getWorker().isRunningNow()) {
-                       msg.openInfoDialog("Not allowed to delete active VMs."
+                       msg.openWarningDialog("Not allowed to delete active VMs."
                                                + StringResources.NEW_LINE
                                                + "[" + property.getName() + "] is running now...");
                        return false;
@@ -91,7 +91,7 @@ public class MenuHandling {
                try {
                        property.getWorker().deleteVM();
                } catch (VMWorkerException e) {
-                       msg.openInfoDialog(" Delete [" + property.getName() + "] failed..."
+                       msg.openWarningDialog(" Delete [" + property.getName() + "] failed..."
                                        + e.getMessage());
                        return false;
                }
@@ -114,7 +114,7 @@ public class MenuHandling {
                fd.setFilterExtensions(filter);
                fd.setFilterNames(filterName);
                fd.setFileName("emulimg-" + property.getName());
-               fd.setFilterPath(FilePath.getInstance().getTizenWorkspacePath());
+               fd.setFilterPath(FilePathResouces.getInstance().getTizenWorkspacePath());
 
                String path = null;
                path = fd.open();
index 42a6957..b8702ef 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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;
 
 import org.eclipse.swt.SWT;
diff --git a/src/org/tizen/emulator/manager/ui/VMButtonFactory.java b/src/org/tizen/emulator/manager/ui/VMButtonFactory.java
deleted file mode 100644 (file)
index 153521a..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.tizen.emulator.manager.ui;
-
-import java.util.ArrayList;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.resources.ImageResources;
-import org.tizen.emulator.manager.ui.widgets.VMButton;
-import org.tizen.emulator.manager.ui.widgets.VMButtonAttribute;
-import org.tizen.emulator.manager.ui.widgets.VMButtonClickEventListener;
-
-class VMCreateButton extends VMButton {
-       public VMCreateButton(Composite parent, int style) {
-               super(parent, style);
-               // delete launchButton
-               launchButton.dispose();
-               launchButton = null;
-               // set Image
-               setImages(ImageResources.ADD_NEW_NOMAL.getImage(),
-                               ImageResources.ADD_NEW_PUSH.getImage(),
-                               ImageResources.ADD_NEW_HOVER.getImage(),
-                               ImageResources.VM_IMAGE_CREATE.getImage());
-       }
-
-       @Override
-       public void setSelected(boolean selected) {
-               ((VMButtonAttribute)attr).setSelected(selected);
-               if (selected) {
-                       setEnabled(false);
-                       VMsMainView.getInstance().drawCreateVM(false);
-               } else {
-                       setEnabled(true);
-               }
-       }
-}
-
-public class VMButtonFactory {
-       private static ArrayList<VMButton> buttons = new ArrayList<VMButton> ();
-       private static int selectedIndex = 0;
-
-       public static VMButton getButton(Composite parent) {
-               VMButton b = new VMButton(parent, SWT.NONE);
-               b.addClickListener(new VMButtonClickEventListener() {
-                       @Override
-                       public void handleClickEvent(DACustomButton button) {
-                               VMButtonFactory.clickVMButton(button);
-                       }
-               });
-               buttons.add(b);
-               return b;
-       }
-
-       public static VMButton getCreateButton(Composite parent) {
-               VMCreateButton b = new VMCreateButton(parent, SWT.NONE);
-               buttons.add(b);
-               return b;
-       }
-
-       public static ArrayList<VMButton> getButtonList() {
-               return buttons;
-       }
-
-       public static void clear() {
-               for(VMButton b : buttons) {
-                       b.dispose();
-               }
-               buttons.clear();
-               selectedIndex = 0;
-       }
-
-       public static void clickVMButton(DACustomButton button) {
-               VMButton b = null;
-               for(int i = 0; i < buttons.size(); i++) {
-                       b = buttons.get(i);
-                       if (button == b) {
-                               b.setSelected(true);
-                               b.redraw();
-                               selectedIndex = i;
-                       } else {
-                               b.setSelected(false);
-                               b.redraw();
-                       }
-               }
-       }
-
-       public static void clickVMButton(int index) {
-               clickVMButton(buttons.get(index));
-       }
-
-       public static int getSelectedButtonIndex() {
-               return selectedIndex;
-       }
-
-       public static VMButton getSelectedButton() {
-               return buttons.isEmpty()
-                               ? null
-                               : buttons.get(selectedIndex);
-       }
-}
index fba9a38..d4b1401 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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;
 
 import org.eclipse.swt.SWT;
@@ -46,6 +75,13 @@ public class VMsDetailView {
        private DetailViewPage modifyView = null;
 
        private final StackLayout stackLayout = new StackLayout();
+
+       private boolean isModifyMode = false;
+
+       public boolean isModifyMode() {
+               return isModifyMode;
+       }
+
        public void init(int width, int height) {
                mainView = new Composite(parent, SWT.NONE);
                mainView.setLayout(stackLayout);
@@ -67,27 +103,36 @@ public class VMsDetailView {
        }
 
        public void drawEmptyVM() {
+               // for setting text
+               emptyView.drawPropertyView(null, false);
                stackLayout.topControl = emptyView.getComposite();
-               mainView.layout();
+               //mainView.layout();
        }
 
        public void drawDetailVM(VMProperty property) {
+               if (isModifyMode) {
+                       isModifyMode = false;
+                       detailView.reset();
+               }
+
                detailView.drawPropertyView(property.getPropertyValue(), false);
-               //detailView.setDetailViewOrigin(modifyView.getDetailViewOrigin().x,
-               //              modifyView.getDetailViewOrigin().y);
                stackLayout.topControl = detailView.getComposite();
                mainView.layout();
        }
 
        public void drawModifyVM(VMProperty property) {
+               isModifyMode = true;
+               modifyView.reset();
+
                modifyView.drawPropertyView(property.getPropertyValue(), false);
-               //modifyView.setDetailViewOrigin(detailView.getDetailViewOrigin().x,
-               //              detailView.getDetailViewOrigin().y);
                stackLayout.topControl = modifyView.getComposite();
                mainView.layout();
        }
 
        public void drawCreateVM(VMPropertyValue value) {
+               isModifyMode = true;
+               modifyView.reset();
+
                stackLayout.topControl = modifyView.getComposite();
                mainView.layout();
                modifyView.drawPropertyView(value, true);
@@ -100,10 +145,23 @@ public class VMsDetailView {
                mainView.dispose();
        }
 
-       public void redraw() {
+       public void reset() {
                emptyView.reset();
                detailView.reset();
                modifyView.reset();
                stackLayout.topControl.redraw();
        }
+
+       public void setFocus(boolean setFocus) {
+               if (isModifyMode) {
+                       modifyView.setFocus(setFocus);
+               }
+       }
+
+       public void drawEmptyDetailVM() {
+               // for all tree view
+               ((PEmptyViewPage)emptyView).drawEmptyDetailVM();
+               stackLayout.topControl = emptyView.getComposite();
+               //mainView.layout();
+       }
 }
index da9c32d..b11dce9 100644 (file)
@@ -1,51 +1,83 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.emulator.manager.da.widgets.combo.DACustomCombo;
-import org.tizen.emulator.manager.da.widgets.combo.DACustomComboSelectionListener;
-import org.tizen.emulator.manager.da.widgets.combo.TitleComboPopupRenderer;
-import org.tizen.emulator.manager.da.widgets.combo.TitleComboRenderer;
 import org.tizen.emulator.manager.platform.BaseImage;
 import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.platform.TotalPlatform;
 import org.tizen.emulator.manager.resources.ColorResources;
-import org.tizen.emulator.manager.resources.ImageResources;
-import org.tizen.emulator.manager.ui.widgets.VMButton;
+import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.ui.list.AbstractListView;
+import org.tizen.emulator.manager.ui.list.ExtendTreeListView;
+import org.tizen.emulator.manager.ui.list.ItemListVew;
+import org.tizen.emulator.manager.ui.list.TreeListView;
+import org.tizen.emulator.manager.ui.widgets.ImageCombo;
 
-enum VIEW_STATE {
-       EMPTY, DETAIL;
-}
 public class VMsListView {
        private Composite parent        = null;
+       private Composite mainView = null;
        private Composite listView      = null;
+       AbstractListView imageListView = null;
+       AbstractListView treeListView = null;
+       AbstractListView extendTreeListView = null;
+
        private int WIDTH  = 510;
        private int HEIGHT = 430;
-       // TODO
-       private int LIST_WIDTH  = WIDTH - 10;
-       private int LIST_HEIGHT = HEIGHT - 55;
 
-       // for resize
-       private VIEW_STATE state;
+       private final StackLayout stackLayout = new StackLayout();
+       private AbstractListView TopListView = null;;
 
        public VMsListView(Composite parent) {
                this.parent = parent;
+               imageListView = new ItemListVew();
+               treeListView = new TreeListView();
+               extendTreeListView = new ExtendTreeListView();
+               TopListView = imageListView;
        }
 
        public void setSize(int width, int height) {
-               this.WIDTH      = width;
-               this.HEIGHT = height;
-               this.LIST_WIDTH  = WIDTH  - 10;
-               this.LIST_HEIGHT = HEIGHT - 55;
+               WIDTH  = width;
+               HEIGHT = height;
+               imageListView.setSize(width, height);
+               treeListView.setSize(width, height);
+               extendTreeListView.setSize(width, height);
        }
 
        public Point getSize() {
@@ -53,355 +85,213 @@ public class VMsListView {
        }
 
        public Composite getComposite() {
-               if (listView == null) {
+               if (mainView == null) {
                        init();
                }
-               return listView;
+               return mainView;
        }
 
-       private DACustomCombo imageCombo        = null;
-       private ScrolledComposite scrolledList  = null;
-       private Composite vmList = null;
+       private ImageCombo imageCombo   = null;
+       private Button itemButton = null;
+       private Button treeButton = null;
 
        public void init(int width, int height) {
-               listView = new Composite(parent, SWT.NONE);
-               listView.setLayout(new FormLayout());
-               listView.setSize(width, height);
+               mainView = new Composite(parent, SWT.NONE);
+               mainView.setLayout(new FormLayout());
+               mainView.setSize(width, height);
+
+               makeComboButton();
+               makeRadioButton();
+
+               listView = new Composite(mainView, SWT.NONE);
+               listView.setLayout(stackLayout);
                //
+               mainView.setBackground(ColorResources.TAB_CONTENTS_BG_COLOR.getColor());
                listView.setBackground(ColorResources.TAB_CONTENTS_BG_COLOR.getColor());
                //
-               makeComboButton();
-               makeVMList();
-       }
-
-       public void init() {
-               init(WIDTH, HEIGHT);
-       }
 
-       private static int COMBO_WIDTH  = 145;
-       private static int COMBO_HEIGHT = 24;
-       private void makeComboButton() {
-               imageCombo = new DACustomCombo(listView, SWT.NONE);
-               imageCombo.setImages(ImageResources.COMBO_NORMAL.getImage(),
-                               ImageResources.COMBO_HOVER.getImage(),
-                               ImageResources.COMBO_PUSH.getImage(),
-                               ImageResources.COMBO_DISABLE.getImage());
-               imageCombo.setEnabled(true);
-
-               imageCombo.setItemHeight(COMBO_HEIGHT);
-               imageCombo.setComboRender(new TitleComboRenderer());
-               imageCombo.setComboPopupRender(new TitleComboPopupRenderer());
                FormData data = new FormData();
                data.left       = new FormAttachment(0, 10);
                data.top        = new FormAttachment(0, 10);
                data.width      = COMBO_WIDTH;
                data.height     = COMBO_HEIGHT;
                imageCombo.setLayoutData(data);
-               imageCombo.select(0);
-
-               imageCombo.addSelectionListener(new DACustomComboSelectionListener() {
-                       @Override
-                       public void selectionEvent(DACustomCombo combo) {
-                               int index = combo.getImageIndex();
-                               VMsMainView.getInstance().drawVMList(index);
-                       }
-               });
-       }
 
-       private Text dumyText = null;
-       private void makeVMList() {
-               scrolledList = new ScrolledComposite(listView, SWT.V_SCROLL |  SWT.BORDER);
-               scrolledList.setBackground(ColorResources.LIST_BG_COLOR.getColor());
-
-               vmList = new Composite(scrolledList, SWT.NONE);
-               vmList.setBackground(ColorResources.LIST_BG_COLOR.getColor());
-               vmList.setLayout(new FormLayout());
-
-               scrolledList.setContent(vmList);
-               scrolledList.setExpandHorizontal(true);
+               data = new FormData();
+               data.top = new FormAttachment(0, 10);
+               data.right = new FormAttachment(100, -10);
+               treeButton.setLayoutData(data);
 
-               // for key event
-               dumyText = new Text(listView, SWT.NONE);
-               dumyText.setText("");
+               data = new FormData();
+               data.top = new FormAttachment(0, 10);
+               data.right = new FormAttachment(treeButton, -10);
+               itemButton.setLayoutData(data);
 
-               FormData data = new FormData();
+               data = new FormData();
                data.left       = new FormAttachment(0, 10);
-               data.top        = new FormAttachment(0, 40);
+               data.top        = new FormAttachment(imageCombo, 5);
                data.right      = new FormAttachment(100, 0);
-               data.bottom = new FormAttachment(100, -10);
-               scrolledList.setLayoutData(data);
+               data.bottom  = new FormAttachment(100, -10);
+               listView.setLayoutData(data);
 
-               data = new FormData();
-               data.left       = new FormAttachment(0, -100);
-               data.top        = new FormAttachment(0, 0);
-               data.width  = 0;
-               data.height = 0;
-               dumyText.setLayoutData(data);
-               dumyText.addKeyListener(new KeyAdapter() {
-                       public void keyPressed(KeyEvent event) {
-                               controlKeyEvent(event);
-                       }
-               });
+               imageListView.init(listView, width, height);
+           treeListView.init(listView, width, height);
+           extendTreeListView.init(listView, width, height);
+               stackLayout.topControl = TopListView.getComposite();
        }
 
-       public void drawPlatform(Platform platform, int imageIndex) {
-               imageCombo.setEnabled(true);
-               imageCombo.initCombo();
-               for (BaseImage image : platform.getImageList()) {
-                       imageCombo.add(image.getName());
-               }
-
-               imageCombo.select(imageIndex);
-               VMsMainView.getInstance().drawVMList(imageIndex);
+       public void init() {
+               init(WIDTH, HEIGHT);
        }
 
-       private int W_GAP               = 10;
-       private int H_GAP               = 12;
-       private int BUTTON_WIDTH        = 106 + 4;
-       private int BUTTON_HEIGHT       = 146 + 4;
+       boolean isTreeViewSelect = false;
+       private void makeRadioButton() {
+               itemButton = new Button(mainView, SWT.RADIO);
+               // TODO
+               itemButton.setText("item");
+               itemButton.setBackground(ColorResources.TAB_CONTENTS_BG_COLOR.getColor());
+               itemButton.setFont(FontResources.RADIO_BUTTON_FONT.getFont());
+               itemButton.addSelectionListener(new SelectionListener() {
 
-       private int W_COUNT     = 0;
-       private int H_COUNT     = 0;
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if (itemButton.getSelection() && isTreeViewSelect) {
+                                       selectRadioButton(false);
+                                       VMsMainView.getInstance().drawVMList(VMsMainView.getInstance().getCurrentImage());
+                               }
+                       }
 
-       private DACustomButton createButton = null; // for empty list
-       private VMButton addNewButton = null;
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                       }
+               });
 
+               treeButton = new Button(mainView, SWT.RADIO);
+               treeButton.setText("tree");
+               treeButton.setBackground(ColorResources.TAB_CONTENTS_BG_COLOR.getColor());
+               treeButton.setFont(FontResources.RADIO_BUTTON_FONT.getFont());
+               treeButton.addSelectionListener(new SelectionListener() {
 
-       private int CREATE_BUTTON_WIDTH  = 190;
-       private int CREATE_BUTTON_HEIGHT = 190;
-       public void drawEmptyVMList() {
-               if (createButton != null) {
-                       createButton.dispose();
-                       createButton = null;
-               }
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if (treeButton.getSelection() && !isTreeViewSelect) {
+                                       selectRadioButton(true);
+                                       VMsMainView.getInstance().drawVMList(VMsMainView.getInstance().getCurrentImage());
+                               }
+                       }
 
-               // clear
-               VMButtonFactory.clear();
-
-               state = VIEW_STATE.EMPTY;
-
-               int leftOffset = (LIST_WIDTH - CREATE_BUTTON_WIDTH) / 2;
-               int topOffset = (LIST_HEIGHT - CREATE_BUTTON_HEIGHT) / 2;
-           FormData data = new FormData();
-               data.left       = new FormAttachment(0, leftOffset);
-               data.top        = new FormAttachment(0, topOffset);
-               data.width      = CREATE_BUTTON_WIDTH;
-               data.height = CREATE_BUTTON_HEIGHT;
-               createButton = new DACustomButton(vmList,
-                               ImageResources.CREATE_NEW_NOMAL.getImage(),
-                               ImageResources.CREATE_NEW_PUSH.getImage(),
-                               ImageResources.CREATE_NEW_HOVER.getImage(),
-                               ImageResources.CREATE_NEW_NOMAL.getImage());
-               createButton.setLayoutData(data);
-
-               createButton.addClickListener(new DACustomButtonClickEventListener(){
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
-                               VMsMainView.getInstance().drawCreateVM(true);
+                       public void widgetDefaultSelected(SelectionEvent e) {
                        }
                });
-
-               vmList.setSize(LIST_WIDTH, LIST_HEIGHT);
-               vmList.layout(true, true);
-               scrolledList.layout(true, true);
        }
 
-       public void drawVMList(BaseImage base, int select, boolean isCreate) {
-               if (createButton != null) {
-                       createButton.dispose();
-                       createButton = null;
+       private void selectRadioButton(boolean isTreeView) {
+               isTreeViewSelect = isTreeView;
+               if (isTreeView) {
+                       treeButton.setSelection(true);
+                       itemButton.setSelection(false);
+                       if (VMsMainView.getInstance().getPlatform() instanceof TotalPlatform) {
+                               TopListView = extendTreeListView;
+                       } else {
+                               TopListView = treeListView;
+                       }
+               } else {
+                       itemButton.setSelection(true);
+                       treeButton.setSelection(false);
+                       TopListView = imageListView;
                }
+               stackLayout.topControl = TopListView.getComposite();
+       }
 
-               if (select == -1) {
-                       select = 0;
-               }
+       private static int COMBO_WIDTH  = 145;
+       private static int COMBO_HEIGHT = 24;
+       private void makeComboButton() {
+               imageCombo = new ImageCombo(mainView, SWT.NONE);
+               imageCombo.setEnabled(true);
+               imageCombo.setItemHeight(COMBO_HEIGHT);
+               imageCombo.select(0);
 
-               state = VIEW_STATE.DETAIL;
+               imageCombo.addSelectionListener(new SelectionListener() {
 
-               VMButtonFactory.clear();
-               if (base.getVmsList().size() != 0) {
-                       VMButton button = null;
-                       for (int i = 0; i < base.getVmsList().size(); i++) {
-                               button = VMButtonFactory.getButton(vmList);
-                               button.setProperty(base.getVmsList().get(i));
-                               if (i == select) {
-                                       VMButtonFactory.clickVMButton(button);
-                               }
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               int index = imageCombo.getSelectionIndex();
+                               VMsMainView.getInstance().setCurrentProperty(null);
+                               VMsMainView.getInstance().drawVMList(index);
                        }
-               }
 
-               // add create button
-               addNewButton = VMButtonFactory.getCreateButton(vmList);
-               if (isCreate) {
-                       addNewButton.setEnabled(false);
-               } else {
-                       addNewButton.setEnabled(true);
-               }
-               addNewButton.addClickListener(new DACustomButtonClickEventListener(){
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
-                               clickCreateButton();
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               int index = imageCombo.getSelectionIndex();
+                               VMsMainView.getInstance().setCurrentProperty(null);
+                               VMsMainView.getInstance().drawVMList(index);
                        }
+                       
                });
-
-               arrayVMList();
        }
 
-       private void arrayVMList() {
-               W_COUNT = LIST_WIDTH / (BUTTON_WIDTH + W_GAP);
-
-               int wIndex = 0;
-               int hIndex = 0;
-               int size = VMButtonFactory.getButtonList().size();
-               if (size != 0) {
-                       H_COUNT = size / W_COUNT;
-                       if (size % W_COUNT != 0) {
-                               H_COUNT++;
+       public void drawPlatform(Platform platform, int imageIndex, boolean isRefresh) {
+               if (platform instanceof TotalPlatform) {
+                       if (!isRefresh) {
+                               selectRadioButton(true);
+                               itemButton.setEnabled(false);
                        }
-
-                       if (((BUTTON_HEIGHT + H_GAP) * H_COUNT) > LIST_HEIGHT) {
-                               vmList.setSize(LIST_WIDTH, ((BUTTON_HEIGHT + H_GAP) * H_COUNT) + H_GAP);
-                       } else {
-                               vmList.setSize(LIST_WIDTH, LIST_HEIGHT);
+                       imageCombo.removeAll();
+                       imageCombo.setEnabled(false);
+                       imageCombo.layout();
+               } else {
+                       if (!isRefresh) {
+                               selectRadioButton(false);
+                               itemButton.setEnabled(true);
                        }
 
-                       FormData data = null;
-                       for (VMButton button : VMButtonFactory.getButtonList()) {
-                               data = new FormData();
-                               data.left       = new FormAttachment(0, W_GAP + (BUTTON_WIDTH + W_GAP) * wIndex);
-                               data.top        = new FormAttachment(0, H_GAP + (BUTTON_HEIGHT + H_GAP) * hIndex);
-                               data.width      = BUTTON_WIDTH;
-                               data.height = BUTTON_HEIGHT;
-
-                               button.setLayoutData(data);
-
-                               button.redraw();
-                               ++wIndex;
-                               if (wIndex == W_COUNT) {
-                                       wIndex = 0;
-                                       hIndex++;
+                       if (!platform.getImageList().isEmpty()) {
+                               imageCombo.removeAll();
+                               imageCombo.setEnabled(true);
+                               for (BaseImage image : platform.getImageList()) {
+                                       imageCombo.add(image.getName());
                                }
+                               imageCombo.select(imageIndex);
+                       } else {
+                               // TODO
+                               return;
                        }
                }
 
-               vmList.layout(true, true);
-               scrolledList.layout(true, true);
-
-               scrolledList.showControl(VMButtonFactory.getSelectedButton());
+               TopListView.drawPlatform(platform, imageIndex);
        }
 
-       private void clickCreateButton() {
-               VMButtonFactory.clickVMButton(addNewButton);
-               VMsMainView.getInstance().drawCreateVM(true);
+       public void drawVMList(BaseImage base, int select, boolean isCreate) {
+               TopListView.drawVMList(base, select, isCreate);
+               mainView.layout(true, true);
        }
 
-       public void controlKeyEvent(KeyEvent event) {
-               if (createButton != null) {
-                       switch(event.keyCode) {
-                       case SWT.CR:
-                       case SWT.KEYPAD_CR:
-                               clickCreateButton();
-                               break;
-                               default:
-                                       break;
-                       }
-               } else {
-                       switch (event.keyCode) {
-                       case SWT.CR:
-                       case SWT.KEYPAD_CR:
-                               if (VMButtonFactory.getSelectedButton() instanceof VMCreateButton) {
-                                       clickCreateButton();
-                               } else {
-                                       VMButtonFactory.getSelectedButton().clickLaunchButton();
-                               }
-                               break;
-                       case SWT.ARROW_UP:
-                               int size = VMButtonFactory.getButtonList().size();
-                               int index = VMButtonFactory.getSelectedButtonIndex() - W_COUNT;
-                               if (index >= 0) {
-                                       VMButtonFactory.clickVMButton(index);
-                               }
-                               break;
-                       case SWT.ARROW_DOWN:
-                               size    = VMButtonFactory.getButtonList().size();
-                               index   = VMButtonFactory.getSelectedButtonIndex() + W_COUNT;
-                               if (index < size) {
-                                       VMButtonFactory.clickVMButton(index);
-                               } else {
-                                       VMButtonFactory.clickVMButton(VMButtonFactory.getButtonList().size() - 1);
-                               }
-                               break;
-                       case SWT.ARROW_LEFT:
-                               size    = VMButtonFactory.getButtonList().size();
-                               index   = VMButtonFactory.getSelectedButtonIndex() - 1;
-                               if (index >= 0) {
-                                       VMButtonFactory.clickVMButton(index);
-                               }
-                               break;
-                       case SWT.ARROW_RIGHT:
-                               size    = VMButtonFactory.getButtonList().size();
-                               index   = VMButtonFactory.getSelectedButtonIndex() + 1;
-                               if (index < size) {
-                                       VMButtonFactory.clickVMButton(index);
-                               }
-                               break;
-                       case SWT.DEL:
-                               if (!(VMButtonFactory.getSelectedButton() instanceof VMCreateButton)) {
-                                       VMsMainView.getInstance().deleteEmulator();
-                                       return;
-                               }
-                               break;
-                       case SWT.ESC:
-                               if (VMsMainView.getInstance().isCreateMode()) {
-                                       VMsMainView.getInstance().drawCancelCreaetVM();
-                               } else {
-                                       VMsMainView.getInstance().drawDetailVM();
-                               }
-                       }
-
-                       if (VMButtonFactory.getSelectedButton() != null) {
-                               scrolledList.showControl(VMButtonFactory.getSelectedButton());
-                       }
-               }
+       public void drawEmptyVMList() {
+               TopListView.drawEmptyVMList();
+               mainView.layout(true, true);
        }
 
        public void cancelModify(int index) {
-               if (addNewButton != null && !addNewButton.isDisposed()) {
-                       addNewButton.setEnabled(true);
-               }
-               if (index >= 0) {
-                       VMButtonFactory.clickVMButton(index);
-               }
                MainDialog.getStatusBar().reset();
-               dumyText.setFocus();
+               TopListView.cancelModify(index);
+               mainView.layout(true, true);
        }
 
        public void draw() {
-               vmList.layout(true, true);
-               scrolledList.layout(true, true);
+               TopListView.draw();
+               mainView.layout(true, true);
        }
 
        public void redraw() {
-
-               switch(state) {
-               case EMPTY:
-                       drawEmptyVMList();
-                       break;
-               case DETAIL:
-                       arrayVMList();
-                       break;
-               default:
-                       break;
-               }
-
+               TopListView.redraw();
+               mainView.layout(true, true);
        }
 
        public void close() {
                imageCombo.dispose();
-               VMButtonFactory.clear();
-
-               vmList.dispose();
-               scrolledList.dispose();
+               imageListView.close();
+               treeListView.close();
                listView.dispose();
        }
 }
index ef5a6b1..72ee088 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ControlEvent;
@@ -53,11 +82,9 @@ public class VMsMainView {
                mainView.setBackground(ColorResources.TAB_CONTENTS_BG_COLOR.getColor());
 
                mainView.addControlListener(new ControlListener() {
-
                        @Override
                        public void controlMoved(ControlEvent e) {
                        }
-
                        @Override
                        public void controlResized(ControlEvent e) {
                                Composite c = (Composite)e.widget;
@@ -69,7 +96,6 @@ public class VMsMainView {
                                detailView.setSize(width, rect.height);
 
                                listView.redraw();
-                               detailView.redraw();
                        }
                });
 
@@ -113,34 +139,35 @@ public class VMsMainView {
 
        public void setSetFocus(boolean setFocus) {
                this.setFocus = setFocus;
+               detailView.setFocus(setFocus);
+       }
+
+       public boolean isModifyMode() {
+               return detailView.isModifyMode();
        }
 
        private Platform currentPlatform        = null;
        private BaseImage currentImage          = null;
        private VMProperty currentProperty      = null;
 
-       public void setPlatform(Platform platform, int index) {
+       public void setPlatform(Platform platform, int index, boolean isRefresh) {
                if (platform == null) {
                        // TODO
                        return;
                }
 
                this.currentPlatform = platform;
-               if (platform.getImageList().isEmpty()) {
-                       // TODO
-               } else {
-                       listView.drawPlatform(platform, index);
-               }
+               listView.drawPlatform(platform, index, isRefresh);
        }
 
        public void setPlatform(Platform platform) {
-               setPlatform(platform, 0);
+               setPlatform(platform, 0, false);
        }
 
        public void resetPlatform() {
-               detailView.redraw();
+               detailView.reset();
                setPlatform(currentPlatform,
-                               currentPlatform.getImageList().indexOf(currentImage));
+                               currentPlatform.getImageList().indexOf(currentImage), true);
        }
 
        public void clearPlatform() {
@@ -153,7 +180,7 @@ public class VMsMainView {
                return currentPlatform;
        }
 
-       void setCurrentImage(BaseImage image) {
+       public void setCurrentImage(BaseImage image) {
                this.currentImage = image;
        }
 
@@ -165,11 +192,12 @@ public class VMsMainView {
                return currentProperty;
        }
 
-       void setCurrentProperty(VMProperty currentProperty) {
+       public void setCurrentProperty(VMProperty currentProperty) {
                this.currentProperty = currentProperty;
        }
 
        public void drawVMList(BaseImage image) {
+               isCreateMode = false;
                currentImage = image;
                if (image.getVmsList().isEmpty()) {
                        drawEmptyVMList();
@@ -193,11 +221,16 @@ public class VMsMainView {
                detailView.drawEmptyVM();
        }
 
+       public void drawEmptyDetailVM() {
+               isCreateMode = false;
+               //listView.cancelModify(-1);
+               detailView.drawEmptyDetailVM();
+       }
+
        public void drawDetailVM(VMProperty property, int index) {
                assert property == null;
-
-               currentProperty = property;
                isCreateMode = false;
+               currentProperty = property;
                listView.cancelModify(index);
                detailView.drawDetailVM(property);
        }
@@ -230,24 +263,32 @@ public class VMsMainView {
                }
 
                isCreateMode = false;
-               setSetFocus(true);
                detailView.drawModifyVM(property);
+               setSetFocus(true);
        }
 
        public void drawModifyVM() {
                drawModifyVM(currentProperty);
        }
 
-       public void drawCreateVM(boolean setfocus) {
-               isCreateMode = true;
-               setSetFocus(setfocus);
-
+       public void drawCreateVM(boolean setFocus) {
                if (currentImage.getVmsList().isEmpty()) {
                        listView.drawVMList(currentImage, -1, true);
                }
-
                BaseImage image = (currentPlatform.getName().equals("custom"))
                                                        ? null : currentImage;
+
+               drawCreateVM(image, setFocus);
+       }
+
+       public void drawCreateVM(BaseImage image, boolean setFocus) {
+               if (isCreateMode) {
+                       setSetFocus(setFocus);
+                       return;
+               }
+               isCreateMode = true;
+
+               setSetFocus(setFocus);
                detailView.drawCreateVM(
                                new VMPropertyValue(image, SelectTemplate.getInstance().getDefaultTemplate()));
        }
@@ -259,9 +300,13 @@ public class VMsMainView {
                        listView.cancelModify(-1);
                        drawEmptyVMList();
                } else {
-                       int i = currentImage.getVmsList().indexOf(currentProperty);
-                       listView.cancelModify(i);
-                       detailView.drawDetailVM(currentProperty);
+                       if (currentProperty != null) {
+                               int i = currentImage.getVmsList().indexOf(currentProperty);
+                               listView.cancelModify(i);
+                               detailView.drawDetailVM(currentProperty);
+                       } else {
+                               listView.cancelModify(-1);
+                       }
                }
        }
 
index d36dfaa..4d9d84d 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import java.util.ArrayList;
@@ -7,6 +36,8 @@ 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.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
@@ -15,12 +46,10 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.emulator.manager.da.widgets.button.toggle.DACustomToggleButton;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
 class DetailItemList {
@@ -57,7 +86,7 @@ public abstract class DetailViewItem {
        private boolean isCreateMode;
        protected boolean isMinMode = false;
 
-       protected DACustomToggleButton arrowButton;
+       protected ImageButton arrowButton;
        protected int count;
 
        protected DetailViewItem item;
@@ -169,13 +198,13 @@ public abstract class DetailViewItem {
        private static int ARROW_BUTTON_HEIGHT = 7;
        protected void initTitle(boolean supportMinMode) {
                if (supportMinMode && count > 1) {
-                       arrowButton = new DACustomToggleButton(compList.get(0),
-                                       ImageResources.ARROW_DOWN.getImage(),
+                       arrowButton = new ImageButton(compList.get(0), SWT.TOGGLE);
+                       arrowButton.setImages(ImageResources.ARROW_DOWN.getImage(),
                                        ImageResources.ARROW_DOWN.getImage(),
                                        ImageResources.ARROW_DOWN.getImage(),
-                                       null,
                                        ImageResources.ARROW_UP.getImage(),
-                                       ImageResources.ARROW_UP.getImage());
+                                       ImageResources.ARROW_UP.getImage(),
+                                       ImageResources.ARROW_DOWN.getImage());
 
                        FormData data = new FormData();
                        data.left = new FormAttachment(0, 5);
@@ -183,11 +212,17 @@ public abstract class DetailViewItem {
                        data.height = ARROW_BUTTON_WIDTH;
                        data.width  = ARROW_BUTTON_HEIGHT;
                        arrowButton.setLayoutData(data);
-                       arrowButton.addClickListener(new DACustomButtonClickEventListener() {
+                       arrowButton.addSelectionListener(new SelectionListener() {
                                @Override
-                               public void handleClickEvent(DACustomButton button) {
+                               public void widgetSelected(SelectionEvent e) {
                                        changeArrowState();
                                }
+
+                               @Override
+                               public void widgetDefaultSelected(SelectionEvent e) {
+                                       // TODO Auto-generated method stub
+                                       
+                               }
                        });
                }
 
@@ -214,7 +249,7 @@ public abstract class DetailViewItem {
                        @Override
                        public void mouseDoubleClick(MouseEvent e) {
                                if (arrowButton != null) {
-                               arrowButton.setToggled(arrowButton.isToggled() ? false : true);
+                               arrowButton.setSelection(arrowButton.isSelection() ? false : true);
                                changeArrowState();
                                }
                        }
@@ -234,7 +269,7 @@ public abstract class DetailViewItem {
        }
 
        protected void changeArrowState() {
-               if (arrowButton.isToggled()) {
+               if (arrowButton.isSelection()) {
                        /*
                        FormData data = new FormData();
                        data.left = new FormAttachment(0, 0);
index 89670c0..1894edb 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 // TODO: need new name
index 8511c6d..960c10e 100644 (file)
@@ -1,21 +1,49 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.ui.VMsDetailView;
 import org.tizen.emulator.manager.ui.widgets.CustomScrolledComposite;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
 public abstract class DetailViewPage {
@@ -99,7 +127,7 @@ public abstract class DetailViewPage {
                return view;
        }
 
-       protected DACustomButton topButton = null;
+       protected ImageButton topButton = null;
        private static int TOP_BUTTON_WIDTH  = 21;
        private static int TOP_BUTTON_HEIGHT = 21;
        protected void makeListTop() {
@@ -158,22 +186,14 @@ public abstract class DetailViewPage {
                scrolledList.setSize(data.width, data.height);
                scrolledList.setLayoutData(data);
                itemList.setSize(image3.getImageData().width, image3.getImageData().height);
-               //scrolledList.layout();
        }
 
        public void resize(int height) {
                settingItemList();
        }
 
-       public Point getDetailViewOrigin() {
-               return scrolledList.getOrigin();
-       }
-
-       public void setDetailViewOrigin(int x, int y) {
-               scrolledList.setOrigin(x, y);
-       }
-
        protected abstract void drawInitView();
        public abstract void reset();
+       public abstract void setFocus(boolean setFocus);
        public abstract void drawPropertyView(VMPropertyValue propertyValue, boolean isCreate);
 }
diff --git a/src/org/tizen/emulator/manager/ui/detail/EMComboButtonRenderer.java b/src/org/tizen/emulator/manager/ui/detail/EMComboButtonRenderer.java
deleted file mode 100644 (file)
index 8bea1d6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.tizen.emulator.manager.ui.detail;
-
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonAttribute;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonDefaultRenderer;
-
-public class EMComboButtonRenderer extends DACustomButtonDefaultRenderer {
-
-       protected void drawButtonImage(GC gc, Rectangle rect,
-                       DACustomButtonAttribute attr) {
-               if (attr != null && attr.getButtonImage() != null) {
-                       Image img = attr.getButtonImage();
-                       Rectangle imgRect = img.getBounds();
-                       int width = rect.width - imgRect.width;
-                       int height = rect.height - imgRect.height;
-                       int x = 0, y = 0;
-                       if (width > 0) {
-                               x = width / 2;
-                       }
-
-                       if (height > 0) {
-                               y = height / 2;
-                       }
-                       gc.drawImage(img, x, y);
-               }
-       }
-}
index 69c4d03..9c0b8f7 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import org.eclipse.swt.SWT;
@@ -11,7 +40,7 @@ import org.tizen.emulator.manager.vms.VMPropertyValue;
 
 public class PEmptyViewPage extends DetailViewPage {
        public static String NO_ITEM = "No items selected";
-
+       private Label title;
        public PEmptyViewPage(VMsDetailView parent, int style) {
                super(parent, style);
        }
@@ -19,7 +48,7 @@ public class PEmptyViewPage extends DetailViewPage {
        @Override
        protected void drawInitView() {
                // write message
-               Label title = new Label(itemList, SWT.NONE);
+               title = new Label(itemList, SWT.NONE);
                title.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
                title.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
                title.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
@@ -33,9 +62,13 @@ public class PEmptyViewPage extends DetailViewPage {
                title.setLayoutData(data);
        }
 
+       public void drawEmptyDetailVM() {
+               title.setText("");
+       }
+
        @Override
        public void drawPropertyView(VMPropertyValue propertyValue, boolean isCreate) {
-               // empty function
+               title.setText(NO_ITEM);
        }
 
        @Override
@@ -47,4 +80,9 @@ public class PEmptyViewPage extends DetailViewPage {
        public void reset() {
                // TODO Auto-generated method stub
        }
+
+       @Override
+       public void setFocus(boolean setFocus) {
+               // TODO Auto-generated method stub
+       }
 }
index 0b8dce2..269c15c 100644 (file)
@@ -1,17 +1,48 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import java.util.ArrayList;
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.VMsDetailView;
 import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
 public class PInfoViewPage extends DetailViewPage {
@@ -20,19 +51,25 @@ public class PInfoViewPage extends DetailViewPage {
                super(parent, style);
        }
 
-       private DACustomButton modifyButton;
+       private ImageButton modifyButton;
        @Override
        protected void drawInitView() {
-               modifyButton = new DACustomButton(itemListTop,
-                               ImageResources.MODIFY_BUTTON_NOMAL.getImage(),
-                               ImageResources.MODIFY_BUTTON_PUSH.getImage(),
+               modifyButton = new ImageButton(itemListTop, SWT.PUSH);
+               modifyButton.setImages(ImageResources.MODIFY_BUTTON_NOMAL.getImage(),
                                ImageResources.MODIFY_BUTTON_HOVER.getImage(),
-                               null);
-               modifyButton.addClickListener(new DACustomButtonClickEventListener() {
+                               ImageResources.MODIFY_BUTTON_PUSH.getImage(),
+                               null, null, null);
+               modifyButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                VMsMainView.getInstance().drawModifyVM();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
 
                modifyButton.setToolTipText("modify property of vm");
@@ -57,9 +94,9 @@ public class PInfoViewPage extends DetailViewPage {
                itemList.layout(true, true);
        }
 
-       private DACustomButton exportButton;
-       private DACustomButton deleteButton;
-       private DACustomButton resetButton;
+       private ImageButton exportButton;
+       private ImageButton deleteButton;
+       private ImageButton resetButton;
        private static int BUTTON_WIDTH = 92;
        private static int BUTTON_HEIGHT = 36;
        private static Image BUTTON_IMAGE = null;
@@ -67,34 +104,22 @@ public class PInfoViewPage extends DetailViewPage {
                if (BUTTON_IMAGE == null) {
                        BUTTON_IMAGE = PatchImageResources.getNomalButton(BUTTON_WIDTH);
                }
-               exportButton = new DACustomButton(buttonComp,
-                               BUTTON_IMAGE,
-                               BUTTON_IMAGE,
-                               BUTTON_IMAGE,
-                               null);
+               exportButton = new ImageButton(buttonComp, SWT.PUSH);
                exportButton.setText(StringResources.EXPORT_IMAGE);
                exportButton.setEnabled(true);
 
-               deleteButton = new DACustomButton(buttonComp,
-                               BUTTON_IMAGE,
-                               BUTTON_IMAGE,
-                               BUTTON_IMAGE,
-                               null);
+               deleteButton = new ImageButton(buttonComp, SWT.PUSH);
                deleteButton.setText(StringResources.DELETE);
                deleteButton.setEnabled(true);
                
-               resetButton = new DACustomButton(buttonComp,
-                               BUTTON_IMAGE,
-                               BUTTON_IMAGE,
-                               BUTTON_IMAGE,
-                               null);
+               resetButton = new ImageButton(buttonComp, SWT.PUSH);
                resetButton.setText(StringResources.RESET);
                resetButton.setEnabled(true);
 
                FormData data = new FormData();
                data.left = new FormAttachment(0, 0);
                data.top = new FormAttachment(0, 0);
-               data.width = 92;
+               data.width = BUTTON_WIDTH;
                data.height = BUTTON_HEIGHT;
                exportButton.setLayoutData(data);
 
@@ -116,25 +141,45 @@ public class PInfoViewPage extends DetailViewPage {
        }
 
        private void addButtonListener() {
-               exportButton.addClickListener(new DACustomButtonClickEventListener() {
+               exportButton.addSelectionListener(new SelectionListener() {
+
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                VMsMainView.getInstance().createBaseImage();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+                       
                });
 
-               deleteButton.addClickListener(new DACustomButtonClickEventListener() {
+               deleteButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                VMsMainView.getInstance().deleteEmulator();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
 
-               resetButton.addClickListener(new DACustomButtonClickEventListener() {
+               resetButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                VMsMainView.getInstance().resetEmulator();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
        }
 
@@ -143,7 +188,6 @@ public class PInfoViewPage extends DetailViewPage {
                assert propertyValue == null;
 
                for (DetailViewItem item : list) {
-                       item.settingStatus(false);
                        item.settingDetailItem(propertyValue);
                }
        }
@@ -181,11 +225,15 @@ public class PInfoViewPage extends DetailViewPage {
 
        @Override
        public void reset() {
-               /*
                scrolledList.setOrigin(0, 0);
                for (int i = 0; i < list.size(); i++) {
                        list.get(i).settingStatus(true);
                }
-               */
+       }
+
+       @Override
+       public void setFocus(boolean setFocus) {
+               // TODO Auto-generated method stub
+               
        }
 }
index 9d75d78..b756396 100644 (file)
@@ -1,14 +1,43 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import java.util.ArrayList;
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.resources.StringResources;
@@ -16,6 +45,7 @@ import org.tizen.emulator.manager.ui.MainDialog;
 import org.tizen.emulator.manager.ui.VMsDetailView;
 import org.tizen.emulator.manager.ui.VMsMainView;
 import org.tizen.emulator.manager.ui.dialog.MessageDialog;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
@@ -26,21 +56,28 @@ public class PModifyViewPage extends DetailViewPage
                super(parent, style);
        }
 
-       private DACustomButton cancelButton;
+       private ImageButton cancelButton;
        private boolean isCreateMode = false;
 
        @Override
        protected void drawInitView() {
-               cancelButton = new DACustomButton(itemListTop,
-                               ImageResources.CANCEL_BUTTON_NOMAL.getImage(),
-                               ImageResources.CANCEL_BUTTON_PUSH.getImage(),
+               cancelButton = new ImageButton(itemListTop, SWT.PUSH);
+               cancelButton.setImages(ImageResources.CANCEL_BUTTON_NOMAL.getImage(),
                                ImageResources.CANCEL_BUTTON_HOVER.getImage(),
-                               null);
-               cancelButton.addClickListener(new DACustomButtonClickEventListener() {
+                               ImageResources.CANCEL_BUTTON_PUSH.getImage(),
+                               null, null, null);
+
+               cancelButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                cancelModify();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
 
                cancelButton.setToolTipText("cancel modification of vm");
@@ -49,6 +86,7 @@ public class PModifyViewPage extends DetailViewPage
 
                makeModifyView();
                makeButton();
+
        }
 
        protected void cancelModify() {
@@ -79,21 +117,15 @@ public class PModifyViewPage extends DetailViewPage
        private static int CONFIRM_BUTTON_WIDTH  = 303;
        private static int CONFIRM_BUTTON_HEIGHT = 36;
        private static Image CONFIRM_BUTTON_IMAGE = null;
-       private DACustomButton confirmButton;
+       private ImageButton confirmButton;
 
        private void makeButton() {
                if (CONFIRM_BUTTON_IMAGE == null) {
                        CONFIRM_BUTTON_IMAGE = PatchImageResources.getNomalButton(CONFIRM_BUTTON_WIDTH);
                }
-               confirmButton = new DACustomButton(buttonComp,
-                               CONFIRM_BUTTON_IMAGE,
-                               CONFIRM_BUTTON_IMAGE,
-                               CONFIRM_BUTTON_IMAGE,
-                               CONFIRM_BUTTON_IMAGE);
+               confirmButton = new ImageButton(buttonComp, SWT.PUSH);
                confirmButton.setText(StringResources.CONFIRM);
                confirmButton.setEnabled(false);
-               confirmButton.setFontColor(DACustomButton.STATE_DISABLE,
-                                               ColorResources.BUTTON_DISABLE_FONT_COLOR.getColor());
 
                FormData data = new FormData();
                data.left       = new FormAttachment(0, 0);
@@ -102,11 +134,17 @@ public class PModifyViewPage extends DetailViewPage
                data.width      = CONFIRM_BUTTON_WIDTH;
                confirmButton.setLayoutData(data);
 
-               confirmButton.addClickListener(new DACustomButtonClickEventListener() {
+               confirmButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                modifyVMProperty();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
        }
 
@@ -143,10 +181,6 @@ public class PModifyViewPage extends DetailViewPage
        public void drawPropertyView(VMPropertyValue propertyValue, boolean isCreate) {
                assert propertyValue == null;
 
-               if (isCreate) {
-                       scrolledList.setOrigin(0, 0);
-               }
-
                confirmButton.setEnabled(false);
                buttonComp.layout(true, true);
 
@@ -155,7 +189,6 @@ public class PModifyViewPage extends DetailViewPage
                newValue = oldValue.clone();
                for (DetailViewItem item : list) {
                        item.setCreateMode(isCreate);
-                       item.settingStatus(false);
                        item.settingModifyItem(propertyValue);
                }
        }
@@ -203,6 +236,16 @@ public class PModifyViewPage extends DetailViewPage
 
        @Override
        public void reset() {
-               // TODO Auto-generated method stub
+               scrolledList.setOrigin(0, 0);
+               for (int i = 0; i < list.size(); i++) {
+                       list.get(i).settingStatus(true);
+               }
+       }
+
+       @Override
+       public void setFocus(boolean setFocus) {
+               for (int i = 0; i < list.size(); i++) {
+                       list.get(i).settingStatus(false);
+               }
        }
 }
index ed577bd..30b50af 100644 (file)
@@ -1,10 +1,43 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import java.util.ArrayList;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
@@ -12,18 +45,15 @@ import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Spinner;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
-import org.tizen.emulator.manager.da.widgets.combo.DACustomCombo;
-import org.tizen.emulator.manager.da.widgets.combo.DACustomComboSelectionListener;
-import org.tizen.emulator.manager.da.widgets.combo.TitleComboPopupRenderer;
 import org.tizen.emulator.manager.platform.Skin;
 import org.tizen.emulator.manager.platform.SkinList;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.ui.widgets.ImageCombo;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
-import org.tizen.emulator.manager.ui.widgets.ModifyViewCombo;
-import org.tizen.emulator.manager.ui.widgets.ModifyViewComboRenderer;
+import org.tizen.emulator.manager.ui.widgets.WSTATE;
 import org.tizen.emulator.manager.vms.RESOLUTION;
 import org.tizen.emulator.manager.vms.SKIN_TYPE;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
@@ -74,9 +104,9 @@ public class TDisplayItem extends DetailViewItem {
 
                reCategory = new ImageLabel(compList.get(0), SWT.NONE);
                reCategory.setText("Resolution");
-               reCategory.setImage(ImageLabel.STATE_ENABLE, CATEGORY_IMAGE);
+               reCategory.setEnableImage(CATEGORY_IMAGE);
                reCategory.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               reCategory.setForeground(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
+               reCategory.setEnableFontColor(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
                FormData data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
                data.top        = new FormAttachment(0, INPUTBOX_TOP_GAP + 1);
@@ -86,9 +116,9 @@ public class TDisplayItem extends DetailViewItem {
 
                dpiCategory = new ImageLabel(compList.get(1), SWT.NONE);
                dpiCategory.setText("Density");
-               dpiCategory.setImage(ImageLabel.STATE_ENABLE, CATEGORY_IMAGE);
+               dpiCategory.setEnableImage(CATEGORY_IMAGE);
                dpiCategory.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               dpiCategory.setForeground(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
+               dpiCategory.setEnableFontColor(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
                data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
                data.top        = new FormAttachment(0, INPUTBOX_TOP_GAP + 1);
@@ -98,9 +128,9 @@ public class TDisplayItem extends DetailViewItem {
                
                skinCategory = new ImageLabel(compList.get(2), SWT.NONE);
                skinCategory.setText("Skin");
-               skinCategory.setImage(ImageLabel.STATE_ENABLE, CATEGORY_IMAGE);
+               skinCategory.setEnableImage(CATEGORY_IMAGE);
                skinCategory.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               skinCategory.setForeground(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
+               skinCategory.setEnableFontColor(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
 
                data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
@@ -119,7 +149,7 @@ public class TDisplayItem extends DetailViewItem {
                }
 
                resolution = new ImageLabel(compList.get(0), SWT.NONE);
-               resolution.setImage(ImageLabel.STATE_ENABLE, INPUTBOX_OFF_IMAGE);
+               resolution.setEnableImage(INPUTBOX_OFF_IMAGE);
 
                FormData data = new FormData();
                data.left       = new FormAttachment(reCategory, 4);
@@ -129,7 +159,7 @@ public class TDisplayItem extends DetailViewItem {
                resolution.setLayoutData(data);
 
                dpi = new ImageLabel(compList.get(1), SWT.NONE);
-               dpi.setImage(ImageLabel.STATE_ENABLE, INPUTBOX_OFF_IMAGE);
+               dpi.setEnableImage(INPUTBOX_OFF_IMAGE);
 
                data = new FormData();
                data.left       = new FormAttachment(dpiCategory, 4);
@@ -139,7 +169,7 @@ public class TDisplayItem extends DetailViewItem {
                dpi.setLayoutData(data);
 
                skin = new ImageLabel(compList.get(2), SWT.NONE);
-               skin.setImage(ImageLabel.STATE_ENABLE, INPUTBOX_OFF_IMAGE);
+               skin.setEnableImage(INPUTBOX_OFF_IMAGE);
 
                data = new FormData();
                data.left       = new FormAttachment(skinCategory, 4);
@@ -149,9 +179,9 @@ public class TDisplayItem extends DetailViewItem {
                skin.setLayoutData(data);
        }
 
-       private DACustomCombo reCombo   = null;
+       private ImageCombo reCombo      = null;
        private Spinner dpiSpinner              = null;
-       private DACustomCombo skinCombo = null;
+       private ImageCombo skinCombo = null;
        @Override
        public void drawModify() {
                drawCategory();
@@ -160,19 +190,14 @@ public class TDisplayItem extends DetailViewItem {
                        INPUTBOX_ON_IMAGE = PatchImageResources.getInputBoxON(INPUTBOX_WIDTH);
                }
 
-               reCombo = new ModifyViewCombo(compList.get(0), SWT.NONE);
-               reCombo.setImages(INPUTBOX_ON_IMAGE,
-                                               INPUTBOX_ON_IMAGE, 
-                                               INPUTBOX_ON_IMAGE, 
-                                               INPUTBOX_ON_IMAGE);
-               reCombo.setButtonImages(ImageResources.ARROW_DROPDOWN.getImage(), null);
-               reCombo.setEnabled(true);
+               reCombo = new ImageCombo(compList.get(0), SWT.NONE);
+               reCombo.setImage(WSTATE.NORMAL, INPUTBOX_ON_IMAGE);
+               reCombo.setImage(WSTATE.PUSH, INPUTBOX_ON_IMAGE);
+               reCombo.setImage(WSTATE.HOVER, INPUTBOX_ON_IMAGE);
 
-               // TODO
-               reCombo.setComboRender(new ModifyViewComboRenderer());
-               reCombo.setComboPopupRender(new TitleComboPopupRenderer());
+               reCombo.setArrowButtonImage(ImageResources.ARROW_DROPDOWN.getImage());
+               reCombo.setEnabled(true);
                reCombo.setItemHeight(INPUTBOX_ON_IMAGE.getImageData().height);
-               //
 
                FormData data = new FormData();
                data.left       = new FormAttachment(reCategory, 4);
@@ -182,7 +207,7 @@ public class TDisplayItem extends DetailViewItem {
                reCombo.setLayoutData(data);
 
                dpi = new ImageLabel(compList.get(1), SWT.NONE);
-               dpi.setImage(ImageLabel.STATE_ENABLE, INPUTBOX_ON_IMAGE);
+               dpi.setEnableImage(INPUTBOX_ON_IMAGE);
 
                data = new FormData();
                data.left       = new FormAttachment(dpiCategory, 4);
@@ -209,18 +234,14 @@ public class TDisplayItem extends DetailViewItem {
                dpiSpinner.setLayoutData(data);
 
 
-               skinCombo = new ModifyViewCombo(compList.get(2), SWT.NONE);
-               skinCombo.setImages(INPUTBOX_ON_IMAGE,
-                                               INPUTBOX_ON_IMAGE, 
-                                               INPUTBOX_ON_IMAGE, 
-                                               INPUTBOX_ON_IMAGE);
-               skinCombo.setButtonImages(ImageResources.ARROW_DROPDOWN.getImage(), null);
-               skinCombo.setEnabled(true);
+               skinCombo = new ImageCombo(compList.get(2), SWT.NONE);
+               skinCombo.setImage(WSTATE.NORMAL, INPUTBOX_ON_IMAGE);
+               skinCombo.setImage(WSTATE.PUSH, INPUTBOX_ON_IMAGE);
+               skinCombo.setImage(WSTATE.HOVER, INPUTBOX_ON_IMAGE);
 
-               skinCombo.setComboRender(new ModifyViewComboRenderer());
-               skinCombo.setComboPopupRender(new TitleComboPopupRenderer());
+               skinCombo.setArrowButtonImage(ImageResources.ARROW_DROPDOWN.getImage());
+               skinCombo.setEnabled(true);
                skinCombo.setItemHeight(INPUTBOX_ON_IMAGE.getImageData().height);
-               //
 
                data = new FormData();
                data.left       = new FormAttachment(skinCategory, 4);
@@ -233,11 +254,12 @@ public class TDisplayItem extends DetailViewItem {
        }
 
        private void addWidgetListener() {
-               reCombo.addSelectionListener(new DACustomComboSelectionListener() {
+               reCombo.addSelectionListener(new SelectionListener() {
+
                        @Override
-                       public void selectionEvent(DACustomCombo combo) {
-                               String re = combo.getText();
-                               reCombo.setToolTipText(combo.getText());
+                       public void widgetSelected(SelectionEvent e) {
+                               String re = reCombo.getText();
+                               reCombo.setToolTipText(reCombo.getText());
 
                                RESOLUTION d = DisplayResolution.getInstance().findResolution(re);
                                if (d != null) {
@@ -249,6 +271,12 @@ public class TDisplayItem extends DetailViewItem {
                                        getListener().ChangeValue(getThis());
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
 
                dpiSpinner.addModifyListener(new ModifyListener() {
@@ -261,11 +289,29 @@ public class TDisplayItem extends DetailViewItem {
                        }
                });
 
-               skinCombo.addSelectionListener(new DACustomComboSelectionListener() {
+               dpiSpinner.addKeyListener(new KeyAdapter() {
+                       public void keyPressed(KeyEvent event) {
+                       switch (event.keyCode) {
+                       case SWT.CR:
+                       case SWT.KEYPAD_CR:
+                               ///TODO
+                               getListener().ChangeState(State.CREATE);
+                         break;
+                       case SWT.ESC:
+                                getListener().ChangeState(State.CANCEL);
+                       break;
+                       default:
+                               // TODO
+                               break;
+                       }
+                     }
+               });
+
+               skinCombo.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void selectionEvent(DACustomCombo combo) {
-                               String name = combo.getText();
-                               skinCombo.setToolTipText(combo.getText());
+                       public void widgetSelected(SelectionEvent e) {
+                               String name = skinCombo.getText();
+                               skinCombo.setToolTipText(skinCombo.getText());
 
                                newSkin = SkinList.getInstance().findSkinUseName(name);
                                if (newSkin == null && name.equals(oldSkin)) {
@@ -276,6 +322,12 @@ public class TDisplayItem extends DetailViewItem {
                                        getListener().ChangeValue(getThis());
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
        }
 
@@ -328,7 +380,7 @@ public class TDisplayItem extends DetailViewItem {
 
                //RESOLUTION
                DisplayResolution.getInstance().initialize(oldResolution);
-               reCombo.initCombo();
+               reCombo.removeAll();
 
                String r = null;
                int f = -1;
@@ -349,6 +401,9 @@ public class TDisplayItem extends DetailViewItem {
 
                // DPI
                dpiSpinner.setSelection(value.dpi);
+               if (!isCreateMode()) {
+                       dpiSpinner.setFocus();
+               }
 
                // SKIN
                settingSkinList(value.resolution);
@@ -357,7 +412,7 @@ public class TDisplayItem extends DetailViewItem {
        }
 
        private void settingSkinList(RESOLUTION re) {
-               skinCombo.initCombo();
+               skinCombo.removeAll();
 
                int find = -1;
                ArrayList<Skin> skinList = null;
@@ -422,14 +477,17 @@ public class TDisplayItem extends DetailViewItem {
        public void settingStatus(boolean isRefresh) {
                if (isRefresh) {
                        if (isMinMode) {
-                               arrowButton.setToggled(false);
+                               arrowButton.setSelection(false);
                                changeArrowState();
                        }
                } else {
                        if (isShareMinMode != isMinMode) {
-                               arrowButton.setToggled(isShareMinMode);
+                               arrowButton.setSelection(isShareMinMode);
                                changeArrowState();
                        }
                }
+               if (!isCreateMode() && dpiSpinner != null) {
+                       dpiSpinner.setFocus();
+               }
        }
 }
index fd24931..5ff9675 100644 (file)
@@ -1,22 +1,51 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import java.io.File;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.DirectoryDialog;
 import org.eclipse.swt.widgets.Label;
 import org.tizen.emulator.manager.EmulatorManager;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.emulator.manager.da.widgets.button.toggle.DACustomToggleButton;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.MainDialog;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
@@ -57,19 +86,15 @@ public class TFileShareItem extends DetailViewItem {
        @Override
        public void drawDetail() {
                supportLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               supportLabel.setImage(ImageLabel.STATE_ENABLE,
-                                               PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
+               supportLabel.setEnableImage(PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
 
                dirCategory = new ImageLabel(compList.get(1), SWT.NONE);
                dirCategory.setText("Directory");
-               dirCategory.setImage(ImageLabel.STATE_ENABLE,
-                                               PatchImageResources.getCategoryBox(DIR_CATEGORY_WIDTH));
-               dirCategory.setFontColor(ImageLabel.STATE_ENABLE,
-                                               ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
+               dirCategory.setEnableImage(PatchImageResources.getCategoryBox(DIR_CATEGORY_WIDTH));
+               dirCategory.setEnableFontColor(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
 
                directoryLabel = new ImageLabel(compList.get(1), SWT.NONE);
-               directoryLabel.setImage(ImageLabel.STATE_ENABLE,
-                                               PatchImageResources.getInputBoxOff(DIR_INPUTBOX_OFF_WIDTH));
+               directoryLabel.setEnableImage(PatchImageResources.getInputBoxOff(DIR_INPUTBOX_OFF_WIDTH));
 
                FormData data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
@@ -96,8 +121,8 @@ public class TFileShareItem extends DetailViewItem {
        }
 
        private Label stateLabel;
-       private DACustomToggleButton selectSupport;
-       private DACustomButton selectDirButton;
+       private ImageButton selectSupport;
+       private ImageButton selectDirButton;
 
        private static String toolTipforMac = "Please refer to file sharing section in SDK documentation.";
        @Override
@@ -137,18 +162,19 @@ public class TFileShareItem extends DetailViewItem {
        }
 
        private void makeModifyWidget() {
-               selectSupport = new DACustomToggleButton(compList.get(0),
-                               ImageResources.TOGGLE_ON_NOMAL.getImage(),
-                               ImageResources.TOGGLE_OFF_PUSH.getImage(),
+               selectSupport = new ImageButton(compList.get(0), SWT.TOGGLE);
+               selectSupport.setImages(ImageResources.TOGGLE_ON_NOMAL.getImage(),
                                ImageResources.TOGGLE_ON_HOVER.getImage(),
-                               null,
+                               ImageResources.TOGGLE_ON_PUSH.getImage(),
                                ImageResources.TOGGLE_OFF_NOMAL.getImage(),
-                               ImageResources.TOGGLE_OFF_HOVER.getImage());
+                               ImageResources.TOGGLE_OFF_HOVER.getImage(),
+                               ImageResources.TOGGLE_OFF_PUSH.getImage()); //disable
+
+               selectSupport.addSelectionListener(new SelectionListener() {
 
-               selectSupport.addClickListener(new DACustomButtonClickEventListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
-                               if (selectSupport.isToggled()) { // NOT SUPPORT
+                       public void widgetSelected(SelectionEvent e) {
+                               if (selectSupport.isSelection()) { // NOT SUPPORT
                                        newSupport = false;
                                        stateLabel.setText(StringResources.NOT_SUPPORTED);
                                        directoryLabel.setText("");
@@ -163,6 +189,13 @@ public class TFileShareItem extends DetailViewItem {
                                        getListener().ChangeValue(getThis());
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+                       
                });
 
                stateLabel = new Label(compList.get(0), SWT.NONE);
@@ -171,19 +204,21 @@ public class TFileShareItem extends DetailViewItem {
                stateLabel.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
 
                directoryLabel = new ImageLabel(compList.get(1), SWT.NONE);
-               directoryLabel.setImage(ImageLabel.STATE_DISABLE,
-                               PatchImageResources.getInputBoxON(DIR_INPUTBOX_ON_WIDTH));
+               directoryLabel.setEnableImage(PatchImageResources.getInputBoxON(DIR_INPUTBOX_ON_WIDTH));
                directoryLabel.setEnabled(false);
 
-               selectDirButton = new DACustomButton(compList.get(1),
+               selectDirButton = new ImageButton(compList.get(1), SWT.PUSH);
+               selectDirButton.setImages(
                                ImageResources.BUTTON_FILE_NOMAL.getImage(),
-                               ImageResources.BUTTON_FILE_PUSH.getImage(),
                                ImageResources.BUTTON_FILE_HOVER.getImage(),
+                               ImageResources.BUTTON_FILE_PUSH.getImage(),
+                               ImageResources.BUTTON_FILE_NOMAL.getImage(),
+                               ImageResources.BUTTON_FILE_NOMAL.getImage(),
                                ImageResources.BUTTON_FILE_DISABLE.getImage());
 
-               selectDirButton.addClickListener(new DACustomButtonClickEventListener() {
+               selectDirButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                if(sharedFD == null) {
                                        sharedFD = new DirectoryDialog(
                                                        MainDialog.getShell(), SWT.OPEN);
@@ -204,6 +239,12 @@ public class TFileShareItem extends DetailViewItem {
                                        }
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
        }
 
@@ -234,13 +275,13 @@ public class TFileShareItem extends DetailViewItem {
                        directoryLabel.setToolTipText(toolTipforMac);
                } else {
                        if (oldSupport) {
-                               selectSupport.setToggled(false);
+                               selectSupport.setSelection(false);
                                stateLabel.setText(StringResources.SUPPORTED);
                                directoryLabel.setText(oldPathName);
                                directoryLabel.setToolTipText(newPath);
                                selectDirButton.setEnabled(true);
                        } else {
-                               selectSupport.setToggled(true);
+                               selectSupport.setSelection(true);
                                stateLabel.setText(StringResources.NOT_SUPPORTED);
                                directoryLabel.setText(oldPathName);
                                selectDirButton.setEnabled(false);
@@ -288,12 +329,12 @@ public class TFileShareItem extends DetailViewItem {
        public void settingStatus(boolean isRefresh) {
                if (isRefresh) {
                        if (isMinMode) {
-                               arrowButton.setToggled(false);
+                               arrowButton.setSelection(false);
                                changeArrowState();
                        }
                } else {
                        if (isShareMinMode != isMinMode) {
-                               arrowButton.setToggled(isShareMinMode);
+                               arrowButton.setSelection(isShareMinMode);
                                changeArrowState();
                        }
                }
index d18358b..34d6e61 100644 (file)
@@ -1,18 +1,47 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.Label;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.emulator.manager.da.widgets.button.toggle.DACustomToggleButton;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.CheckVirtualization;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
@@ -52,17 +81,13 @@ public class THWSupportItem extends DetailViewItem {
                          + StringResources.NEW_LINE + "Try upgrade graphic card driver.";
        private void makeCategory() {
                virtualCategory = new ImageLabel(compList.get(0), SWT.NONE);
-               virtualCategory.setImage(ImageLabel.STATE_ENABLE,
-                               PatchImageResources.getCategoryBox(CATEGORY_WIDTH));
-               virtualCategory.setFontColor(ImageLabel.STATE_ENABLE,
-                               ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
+               virtualCategory.setEnableImage(PatchImageResources.getCategoryBox(CATEGORY_WIDTH));
+               virtualCategory.setEnableFontColor(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
                virtualCategory.setText("CPU VT");
 
                GPUCategory = new ImageLabel(compList.get(1), SWT.NONE);
-               GPUCategory.setImage(ImageLabel.STATE_ENABLE,
-                               PatchImageResources.getCategoryBox(CATEGORY_WIDTH));
-               GPUCategory.setFontColor(ImageLabel.STATE_ENABLE,
-                               ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
+               GPUCategory.setEnableImage(PatchImageResources.getCategoryBox(CATEGORY_WIDTH));
+               GPUCategory.setEnableFontColor(ColorResources.DETAIL_CATEGORY_FONT_COLOR.getColor());
                GPUCategory.setText("GPU");
                GPUCategory.setToolTipText(GPUToolTipText);
 
@@ -86,12 +111,10 @@ public class THWSupportItem extends DetailViewItem {
                makeCategory();
 
                virtualLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               virtualLabel.setImage(ImageLabel.STATE_ENABLE,
-                               PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
+               virtualLabel.setEnableImage(PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
 
                GPULabel = new ImageLabel(compList.get(1), SWT.NONE);
-               GPULabel.setImage(ImageLabel.STATE_ENABLE,
-                               PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
+               GPULabel.setEnableImage(PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
                GPULabel.setToolTipText(GPUToolTipText);
 
                FormData data = new FormData();
@@ -109,8 +132,8 @@ public class THWSupportItem extends DetailViewItem {
                GPULabel.setLayoutData(data);
        }
 
-       private DACustomToggleButton virtualButton;
-       private DACustomToggleButton GPUButton;
+       private ImageButton virtualButton;
+       private ImageButton GPUButton;
        private Label virtualState;
        private Label GPUState;
        @Override
@@ -146,18 +169,18 @@ public class THWSupportItem extends DetailViewItem {
        }
 
        private void makeModifyWidget() {
-               virtualButton = new DACustomToggleButton(compList.get(0),
-                               ImageResources.TOGGLE_ON_NOMAL.getImage(),
-                               ImageResources.TOGGLE_OFF_PUSH.getImage(),
+               virtualButton = new ImageButton(compList.get(0), SWT.TOGGLE);
+               virtualButton.setImages(ImageResources.TOGGLE_ON_NOMAL.getImage(),
                                ImageResources.TOGGLE_ON_HOVER.getImage(),
-                               ImageResources.TOGGLE_OFF_PUSH.getImage(),
+                               ImageResources.TOGGLE_ON_PUSH.getImage(),
                                ImageResources.TOGGLE_OFF_NOMAL.getImage(),
-                               ImageResources.TOGGLE_OFF_HOVER.getImage());
+                               ImageResources.TOGGLE_OFF_HOVER.getImage(),
+                               ImageResources.TOGGLE_OFF_PUSH.getImage()); //disable
 
-               virtualButton.addClickListener(new DACustomButtonClickEventListener() {
+               virtualButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
-                               if (virtualButton.isToggled()) { // NOT SUPPORT
+                       public void widgetSelected(SelectionEvent e) {
+                               if (virtualButton.isSelection()) { // NOT SUPPORT
                                        newHWSupport = false;
                                        virtualState.setText(StringResources.NOT_SUPPORTED);
                                } else { // SUPPORT
@@ -168,6 +191,12 @@ public class THWSupportItem extends DetailViewItem {
                                        getListener().ChangeValue(getThis());
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
 
                virtualState = new Label(compList.get(0), SWT.NONE);
@@ -175,18 +204,18 @@ public class THWSupportItem extends DetailViewItem {
                virtualState.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
                virtualState.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
 
-               GPUButton = new DACustomToggleButton(compList.get(1),
-                               ImageResources.TOGGLE_ON_NOMAL.getImage(),
-                               ImageResources.TOGGLE_OFF_PUSH.getImage(),
+               GPUButton = new ImageButton(compList.get(1), SWT.TOGGLE);
+               GPUButton.setImages(ImageResources.TOGGLE_ON_NOMAL.getImage(),
                                ImageResources.TOGGLE_ON_HOVER.getImage(),
-                               ImageResources.TOGGLE_OFF_PUSH.getImage(),
+                               ImageResources.TOGGLE_ON_PUSH.getImage(),
                                ImageResources.TOGGLE_OFF_NOMAL.getImage(),
-                               ImageResources.TOGGLE_OFF_HOVER.getImage());
+                               ImageResources.TOGGLE_OFF_HOVER.getImage(),
+                               ImageResources.TOGGLE_OFF_PUSH.getImage()); //disable
 
-               GPUButton.addClickListener(new DACustomButtonClickEventListener() {
+               GPUButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
-                               if (GPUButton.isToggled()) { // NOT SUPPORT
+                       public void widgetSelected(SelectionEvent e) {
+                               if (GPUButton.isSelection()) { // NOT SUPPORT
                                        newGPUSupport = false;
                                        GPUState.setText(StringResources.NOT_SUPPORTED);
                                } else { // SUPPORT
@@ -198,6 +227,12 @@ public class THWSupportItem extends DetailViewItem {
                                        getListener().ChangeValue(getThis());
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
 
                GPUButton.setToolTipText(GPUToolTipText);
@@ -256,10 +291,10 @@ public class THWSupportItem extends DetailViewItem {
                        virtualState.setToolTipText(CPUDisableToolTipText);
                } else {
                        if (oldHWSupport) {
-                               virtualButton.setToggled(false);
+                               virtualButton.setSelection(false);
                                virtualState.setText(StringResources.SUPPORTED);
                        } else {
-                               virtualButton.setToggled(true);
+                               virtualButton.setSelection(true);
                                virtualState.setText(StringResources.NOT_SUPPORTED);
                        }
                        virtualState.setToolTipText("");
@@ -272,10 +307,10 @@ public class THWSupportItem extends DetailViewItem {
                } else {
                        if (oldGPUSupport /*&& !isArm
                                        && CheckVirtualization.getInstance().isSupportGPU()*/) {
-                               GPUButton.setToggled(false);
+                               GPUButton.setSelection(false);
                                GPUState.setText(StringResources.SUPPORTED);
                        } else {
-                               GPUButton.setToggled(true);
+                               GPUButton.setSelection(true);
                                GPUState.setText(StringResources.NOT_SUPPORTED);
                        }
                        GPUState.setToolTipText(GPUToolTipText);
@@ -330,12 +365,12 @@ public class THWSupportItem extends DetailViewItem {
        public void settingStatus(boolean isRefresh) {
                if (isRefresh) {
                        if (isMinMode) {
-                               arrowButton.setToggled(false);
+                               arrowButton.setSelection(false);
                                changeArrowState();
                        }
                } else {
                        if (isShareMinMode != isMinMode) {
-                               arrowButton.setToggled(isShareMinMode);
+                               arrowButton.setSelection(isShareMinMode);
                                changeArrowState();
                        }
                }
index 95c57dd..a17eabe 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import java.io.File;
@@ -9,6 +38,8 @@ import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 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.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
@@ -18,8 +49,6 @@ import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
@@ -28,6 +57,7 @@ import org.tizen.emulator.manager.ui.MainDialog;
 import org.tizen.emulator.manager.ui.MenuHandling;
 import org.tizen.emulator.manager.ui.VMsMainView;
 import org.tizen.emulator.manager.ui.dialog.MessageDialog;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
 import org.tizen.emulator.manager.vms.EmulatorVMList;
 import org.tizen.emulator.manager.vms.HelperClass;
@@ -106,8 +136,8 @@ public class TNameTextItem extends DetailViewItem {
                }
 
                nameLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               nameLabel.setImage(ImageLabel.STATE_ENABLE, INPUTBOX_OFF_IMAGE);
-               nameLabel.setImage(ImageLabel.STATE_DISABLE, INPUTBOX_OFF_IMAGE);
+               nameLabel.setEnableImage(INPUTBOX_OFF_IMAGE);
+               nameLabel.setDisableImage(INPUTBOX_OFF_IMAGE);
 
                FormData data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
@@ -117,8 +147,8 @@ public class TNameTextItem extends DetailViewItem {
                nameLabel.setLayoutData(data);
 
                baseImageLabel = new ImageLabel(compList.get(1), SWT.NONE);
-               baseImageLabel.setImage(ImageLabel.STATE_ENABLE, INPUTBOX_OFF_IMAGE);
-               baseImageLabel.setImage(ImageLabel.STATE_DISABLE, INPUTBOX_OFF_IMAGE);
+               baseImageLabel.setEnableImage(INPUTBOX_OFF_IMAGE);
+               baseImageLabel.setDisableImage(INPUTBOX_OFF_IMAGE);
 
                data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
@@ -131,7 +161,7 @@ public class TNameTextItem extends DetailViewItem {
        }
 
        private Text nameText;
-       private DACustomButton selectImageButton;
+       private ImageButton selectImageButton;
        @Override
        public void drawModify() {
                if (INPUTBOX_ON_IMAGE == null) {
@@ -169,8 +199,8 @@ public class TNameTextItem extends DetailViewItem {
 
        private void makeModifyNameLabel() {
                nameLabel = new ImageLabel(compList.get(0), SWT.NONE);
-               nameLabel.setImage(ImageLabel.STATE_ENABLE, INPUTBOX_ON_IMAGE);
-               nameLabel.setImage(ImageLabel.STATE_DISABLE, INPUTBOX_ON_IMAGE);
+               nameLabel.setEnableImage(INPUTBOX_ON_IMAGE);
+               nameLabel.setDisableImage(INPUTBOX_ON_IMAGE);
                nameLabel.setLayout(new FormLayout());
 
                nameText = new Text(nameLabel, SWT.NONE);
@@ -201,15 +231,14 @@ public class TNameTextItem extends DetailViewItem {
                        switch (event.keyCode) {
                        case SWT.CR:
                        case SWT.KEYPAD_CR:
-                               //TODO
-                         //System.out.println("Enter");
-                         getListener().ChangeState(State.CREATE);
+                               ///TODO
+                               getListener().ChangeState(State.CREATE);
                          break;
                        case SWT.ESC:
                                 getListener().ChangeState(State.CANCEL);
                        break;
-                       case SWT.TAB:
-                               System.out.println("tab");
+                       default:
+                               // TODO
                                break;
                        }
                      }
@@ -234,17 +263,21 @@ public class TNameTextItem extends DetailViewItem {
 
        private void makeModifyBaseImage() {
                baseImageLabel = new ImageLabel(compList.get(1), SWT.NONE);
-               baseImageLabel.setImage(ImageLabel.STATE_ENABLE, IMAGE_INPUTBOX_IMAGE);
-               baseImageLabel.setImage(ImageLabel.STATE_DISABLE, IMAGE_INPUTBOX_IMAGE);
+               baseImageLabel.setEnableImage(IMAGE_INPUTBOX_IMAGE);
+               baseImageLabel.setDisableImage(IMAGE_INPUTBOX_IMAGE);
 
-               selectImageButton = new DACustomButton(compList.get(1),
+               selectImageButton = new ImageButton(compList.get(1), SWT.PUSH);
+               selectImageButton.setImages(
                                ImageResources.BUTTON_FILE_NOMAL.getImage(),
-                               ImageResources.BUTTON_FILE_PUSH.getImage(),
                                ImageResources.BUTTON_FILE_HOVER.getImage(),
+                               ImageResources.BUTTON_FILE_PUSH.getImage(),
+                               ImageResources.BUTTON_FILE_NOMAL.getImage(),
+                               ImageResources.BUTTON_FILE_NOMAL.getImage(),
                                ImageResources.BUTTON_FILE_DISABLE.getImage());
-               selectImageButton.addClickListener(new DACustomButtonClickEventListener() {
+
+               selectImageButton.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                if (baseImageFD == null) {
                                        baseImageFD = new FileDialog(MainDialog.getShell(), SWT.OPEN);
                                        baseImageFD.setText(String.format("Select existing Base Image"));
@@ -286,6 +319,12 @@ public class TNameTextItem extends DetailViewItem {
                                        //false gl accelertaion
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
        }
 
@@ -366,6 +405,8 @@ public class TNameTextItem extends DetailViewItem {
 
        @Override
        public void settingStatus(boolean isRefresh) {
-               // TODO Auto-generated method stub
+               if (isCreateMode() && VMsMainView.getInstance().isSetFocus()) {
+                       setFocus();
+               }
        }
 }
index 229b1f0..365dbfa 100644 (file)
@@ -1,20 +1,48 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.widgets.Label;
-import org.tizen.emulator.manager.da.widgets.combo.DACustomCombo;
-import org.tizen.emulator.manager.da.widgets.combo.DACustomComboSelectionListener;
-import org.tizen.emulator.manager.da.widgets.combo.TitleComboPopupRenderer;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.PatchImageResources;
+import org.tizen.emulator.manager.ui.widgets.ImageCombo;
 import org.tizen.emulator.manager.ui.widgets.ImageLabel;
-import org.tizen.emulator.manager.ui.widgets.ModifyViewCombo;
-import org.tizen.emulator.manager.ui.widgets.ModifyViewComboRenderer;
+import org.tizen.emulator.manager.ui.widgets.WSTATE;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
 public class TRAMItem extends DetailViewItem {
@@ -33,7 +61,7 @@ public class TRAMItem extends DetailViewItem {
        }
 
        private ImageLabel ramSize;
-       private DACustomCombo ramSizeCombo;
+       private ImageCombo ramSizeCombo;
        private Label stateLabel;
 
        private static int INPUTBOX_WIDTH = 175;
@@ -41,8 +69,7 @@ public class TRAMItem extends DetailViewItem {
        @Override
        public void drawDetail() {
                ramSize = new ImageLabel(compList.get(0), SWT.NONE);
-               ramSize.setImage(ImageLabel.STATE_ENABLE,
-                               PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
+               ramSize.setEnableImage(PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
 
                FormData data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
@@ -58,18 +85,15 @@ public class TRAMItem extends DetailViewItem {
                        INPUTBOX_ON_IMAGE = PatchImageResources.getInputBoxON(INPUTBOX_WIDTH - 40);
                }
 
-               ramSizeCombo = new ModifyViewCombo(compList.get(0), SWT.NONE);
-               ramSizeCombo.setImages(INPUTBOX_ON_IMAGE,
-                                               INPUTBOX_ON_IMAGE,
-                                               INPUTBOX_ON_IMAGE,
-                                               INPUTBOX_ON_IMAGE);
+               ramSizeCombo = new ImageCombo(compList.get(0), SWT.NONE);
+               ramSizeCombo.setImage(WSTATE.NORMAL, INPUTBOX_ON_IMAGE);
+               ramSizeCombo.setImage(WSTATE.PUSH, INPUTBOX_ON_IMAGE);
+               ramSizeCombo.setImage(WSTATE.HOVER, INPUTBOX_ON_IMAGE);
 
-               ramSizeCombo.setButtonImages(ImageResources.ARROW_DROPDOWN.getImage(), null);
+               ramSizeCombo.setArrowButtonImage(ImageResources.ARROW_DROPDOWN.getImage());
                ramSizeCombo.setEnabled(true);
-
-               ramSizeCombo.setComboRender(new ModifyViewComboRenderer());
-               ramSizeCombo.setComboPopupRender(new TitleComboPopupRenderer());
                ramSizeCombo.setItemHeight(INPUTBOX_ON_IMAGE.getImageData().height);
+
                //
 
                stateLabel = new Label(compList.get(0), SWT.NONE);
@@ -95,16 +119,22 @@ public class TRAMItem extends DetailViewItem {
                        ramSizeCombo.add(s);
                }
 
-               ramSizeCombo.addSelectionListener(new DACustomComboSelectionListener() {
+               ramSizeCombo.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void selectionEvent(DACustomCombo combo) {
-                               String size = combo.getText();
+                       public void widgetSelected(SelectionEvent e) {
+                               String size = ramSizeCombo.getText();
                                newSize =  Integer.valueOf(size);
 
                                if (!isCreateMode()) {
                                        getListener().ChangeValue(getThis());
                                }
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
                });
        }
 
index b93c3e0..0a12c14 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.detail;
 
 import org.eclipse.swt.SWT;
@@ -25,8 +54,7 @@ public class TTouchPointItem extends DetailViewItem {
        @Override
        public void drawDetail() {
                touchPoint = new ImageLabel(compList.get(0), SWT.NONE);
-               touchPoint.setImage(ImageLabel.STATE_ENABLE,
-                               PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
+               touchPoint.setEnableImage(PatchImageResources.getInputBoxOff(INPUTBOX_WIDTH));
 
                FormData data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
@@ -40,8 +68,7 @@ public class TTouchPointItem extends DetailViewItem {
        @Override
        public void drawModify() {
                touchPoint = new ImageLabel(compList.get(0), SWT.NONE);
-               touchPoint.setImage(ImageLabel.STATE_DISABLE,
-                               PatchImageResources.getInputBoxON(INPUTBOX_WIDTH));
+               touchPoint.setDisableImage(PatchImageResources.getInputBoxON(INPUTBOX_WIDTH));
 
                FormData data = new FormData();
                data.left       = new FormAttachment(0, INPUTBOX_OFFSET);
index 314a33a..aa9237e 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.dialog;
 
 import org.eclipse.swt.SWT;
index 15d503c..738e23e 100644 (file)
@@ -60,7 +60,7 @@ public class MessageDialog
        }
 
        public int openInfoDialog(final String message) {
-               return openInfoDialog("Info", message);
+               return openInfoDialog("Emulator Manager", message);
        }
 
        public int openInfoDialog(final String title, final String message) {
@@ -68,7 +68,7 @@ public class MessageDialog
        }
 
        public int openWarningDialog(final String message) {
-               return openWarningDialog("Warning", message);
+               return openWarningDialog("Emulator Manager", message);
        }
 
        public int openWarningDialog(final String title, final String message) {
@@ -76,11 +76,11 @@ public class MessageDialog
        }
 
        public int openSelectionDialog(final String message) {
-               return openSelectionDialog("Warning", message);
+               return openSelectionDialog("Emulator Manager", message);
        }
 
        public int openSelectionDialog(final String title, final String message) {
-               return openMessageDialog(title, message,  SWT.ICON_WARNING, SWT.OK | SWT.CANCEL);
+               return openMessageDialog(title, message,  SWT.ICON_QUESTION, SWT.OK | SWT.CANCEL);
        }
 
        int msgResponse = 0;
diff --git a/src/org/tizen/emulator/manager/ui/list/AbstractListView.java b/src/org/tizen/emulator/manager/ui/list/AbstractListView.java
new file mode 100644 (file)
index 0000000..ef292b0
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.list;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.platform.BaseImage;
+import org.tizen.emulator.manager.platform.Platform;
+
+public abstract class AbstractListView {
+       protected Composite listView;
+
+       public abstract void init(Composite parent, int width, int height);
+       public abstract void drawPlatform(Platform platform, int imageIndex);
+       public abstract void drawVMList(BaseImage base, int select, boolean isCreate);
+       public abstract void drawEmptyVMList();
+       public abstract void cancelModify(int index);
+       public abstract void draw();
+       public abstract void redraw();
+       public abstract void close();
+       public abstract void setSize(int width, int height);
+       public abstract Point getSize();
+       public Composite getComposite() {
+               return listView;
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/list/ColumnContentHelper.java b/src/org/tizen/emulator/manager/ui/list/ColumnContentHelper.java
new file mode 100644 (file)
index 0000000..b0916fb
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * MunKyu Im <munkyu.im@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@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.list;
+
+import org.tizen.emulator.manager.vms.VMProperty;
+import org.tizen.emulator.manager.vms.xml.DeviceType;
+import org.tizen.emulator.manager.vms.xml.DisplayType;
+
+public abstract class ColumnContentHelper {
+       static final int numberOfColumns = 4;
+       static final String[] columnTitles = new String[] { "Name", "CPU", "Resolution", "Density", "RAM size", };
+       static final ColumnContentHelper[] helpers = new ColumnContentHelper[] {
+               new NameContentHelper(0),
+               new ArchitectureHelper(1),
+               new ResolutionContentHelper(2),
+               new DensityContentHelper(3),
+               new RAMSizeContentHelper(4),
+       };
+               
+       int index;
+       
+       protected ColumnContentHelper(int index) {
+               this.index = index;
+       }
+       
+       public String getTitle() {
+               return columnTitles[index];
+       }
+       
+       public int getIndex() {
+               return index;
+       }
+
+       public abstract String getContent(VMProperty property);
+
+       public static int getContentCount() {
+               return numberOfColumns;
+       }
+       
+       public static ColumnContentHelper[] getContentHelpers() {
+               return helpers;
+       }
+
+}
+
+class NameContentHelper extends ColumnContentHelper {
+       public NameContentHelper(int index) {
+               super(index);
+       }
+       
+       @Override
+       public String getContent(VMProperty property) {
+               return property.getName();
+       }
+}
+
+class ArchitectureHelper extends ColumnContentHelper {
+       public ArchitectureHelper(int index) {
+               super(index);
+       }
+       
+       @Override
+       public String getContent(VMProperty property) {
+               return property.getArch().name();
+       }
+}
+
+class ResolutionContentHelper extends ColumnContentHelper {
+       public ResolutionContentHelper(int index) {
+               super(index);
+       }
+       
+       @Override
+       public String getContent(VMProperty property) {
+               DisplayType displayType = property.getConfiguration().getDevice().getDisplay();
+               
+               return displayType.getResolution().getWidth()
+                               + " x " + displayType.getResolution().getHeight();
+       }
+}
+
+class DensityContentHelper extends ColumnContentHelper {
+       public DensityContentHelper(int index) {
+               super(index);
+       }
+
+       @Override
+       public String getContent(VMProperty property) {
+               DisplayType displayType = property.getConfiguration().getDevice().getDisplay();
+               return displayType.getDensity().getValue() + "";
+       }
+}
+
+class RAMSizeContentHelper extends ColumnContentHelper {
+       public RAMSizeContentHelper(int index) {
+               super(index);
+       }
+
+       @Override
+       public String getContent(VMProperty property) {
+               DeviceType deviceType = property.getConfiguration().getDevice();
+               return deviceType.getRAM().getSize().getValue() + "";
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/list/ColumnSortListner.java b/src/org/tizen/emulator/manager/ui/list/ColumnSortListner.java
new file mode 100644 (file)
index 0000000..913e011
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * MunKyu Im <munkyu.im@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@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.list;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+
+public class ColumnSortListner implements SelectionListener {
+       @Override
+       public void widgetSelected(SelectionEvent event) {
+               TreeColumn column = (TreeColumn)event.widget;
+               Tree tree = column.getParent();
+
+               tree.setSortColumn(column);
+               if(tree.getSortDirection() == SWT.NONE) {
+                       tree.setSortDirection(SWT.UP);
+               } else if(tree.getSortDirection() == SWT.UP) {
+                       tree.setSortDirection(SWT.DOWN);
+               } else if(tree.getSortDirection() == SWT.DOWN) {
+                       tree.setSortDirection(SWT.UP);
+               }
+               for(TreeItem item : tree.getItems()) {
+                       if(!(item.getData() instanceof Container)) {// double checking...
+                               continue;
+                       }
+
+                       int count = item.getItemCount();
+
+                       for(int i = 0; i < count - 1; ++i) {
+                               TreeItem subItem0 = item.getItem(i);
+                               if(subItem0.getData() instanceof TreeMarker) {
+                                       continue;
+                               }
+
+                               for(int j = i + 1; j < count; ++j) {
+                                       TreeItem subItem1 = item.getItem(j);
+
+                                       if(subItem1.getData() instanceof TreeMarker) {
+                                               continue;
+                                       }
+
+                                       if(tree.getSortDirection() == SWT.UP) {
+                                               if(subItem0.getText().compareTo(subItem1.getText()) > 0) {
+                                                       PropertyContent content0 = (PropertyContent)subItem0.getData();
+                                                       PropertyContent content1 = (PropertyContent)subItem1.getData();
+
+                                                       RowItem rowItem = new PropertyContent(content1.getProperty(), subItem0);
+                                                       subItem0.setData(rowItem);
+                                                       rowItem = new PropertyContent(content0.getProperty(), subItem1);
+                                                       subItem1.setData(rowItem);
+                                               }
+                                       }
+                                       else if(tree.getSortDirection() == SWT.DOWN) {
+                                               if(subItem0.getText().compareTo(subItem1.getText()) < 0) {
+                                                       PropertyContent content0 = (PropertyContent)subItem0.getData();
+                                                       PropertyContent content1 = (PropertyContent)subItem1.getData();
+
+                                                       RowItem rowItem = new PropertyContent(content1.getProperty(), subItem0);
+                                                       subItem0.setData(rowItem);
+                                                       rowItem = new PropertyContent(content0.getProperty(), subItem1);
+                                                       subItem1.setData(rowItem);
+                                               }                                                                               
+                                       }
+                               }
+                       }
+                       tree.redraw();
+               }
+       }
+       
+       @Override
+       public void widgetDefaultSelected(SelectionEvent event) {
+               // TODO Auto-generated method stub
+       }
+
+}
diff --git a/src/org/tizen/emulator/manager/ui/list/ExtendTreeListView.java b/src/org/tizen/emulator/manager/ui/list/ExtendTreeListView.java
new file mode 100644 (file)
index 0000000..67f8134
--- /dev/null
@@ -0,0 +1,349 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.list;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.platform.BaseImage;
+import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.resources.ColorResources;
+import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.vms.VMProperty;
+import org.tizen.emulator.manager.vms.VMProperty.FSImageType;
+
+public class ExtendTreeListView extends AbstractListView {
+       protected Tree vmsTree;
+       private int width;
+       private int height;
+       private ArrayList<TreeItem> createItems = new ArrayList<TreeItem>();
+       private ArrayList<TreeItem> typeItems   = new ArrayList<TreeItem>();
+       private Map<String, TreeItem> itemsMap  = new HashMap<String, TreeItem>();
+
+       @Override
+       public void init(Composite parent, int width, int height) {
+               setSize(width, height);
+               listView = new Composite(parent, SWT.NONE);
+               listView.setLayout(new FillLayout());
+
+               vmsTree = new Tree(listView, SWT.BORDER | SWT.SINGLE);
+               vmsTree.setHeaderVisible(true);
+               vmsTree.setLinesVisible(true);
+
+               vmsTree.setBackground(ColorResources.WHITE.getColor());
+               // TODO
+               vmsTree.setFont(FontResources.TREE_HEADER_FONT.getFont());
+
+               for(ColumnContentHelper helper : ColumnContentHelper.getContentHelpers()) {
+                       TreeColumn treeColumn = new TreeColumn(vmsTree, SWT.NONE);
+                       treeColumn.setText(helper.getTitle());
+                       /*
+                       if("Name".equalsIgnoreCase(treeColumn.getText())) {
+                               treeColumn.addSelectionListener(new ColumnSortListner());
+                       }
+                       */
+               }
+               settingListener();
+       }
+
+       private TreeItem currentItem = null;
+       private TreeItem oldItem = null;
+       private void settingListener() {
+               vmsTree.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if (vmsTree.getSelectionCount() == 1) {
+                                       oldItem = currentItem;
+                                       currentItem = vmsTree.getSelection()[0];
+                                       Object data = currentItem.getData();
+
+                                       if(!(data instanceof RowItem)) {
+                                               return;
+                                       }
+                                       
+                                       // TODO : select template using platform
+                                       if (data instanceof CreateMarker) {
+                                               VMsMainView.getInstance().drawCreateVM(
+                                                               ((CreateMarker)data).getBaseImage(),
+                                                               false);
+                                       } else if(data instanceof TreeMarker) {
+                                               VMsMainView.getInstance().drawEmptyDetailVM();
+                                               VMsMainView.getInstance().setCurrentProperty(null);
+                                       } else {
+                                               PropertyContent content = (PropertyContent)data;
+                                               VMsMainView.getInstance().drawDetailVM(content.property, -1);
+                                       }
+                               }
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               /*
+                               if (vmsTree.getSelectionCount() == 0) {
+                                       
+                               } else {
+                                       Object data = vmsTree.getSelection()[0].getData();
+
+                                       if(!(data instanceof TreeMarker)) {
+                                               return;
+                                       }
+
+                                       VMProperty property = ((PropertyContent)vmsTree.getSelection()[0].getData()).property;
+                                       VMsMainView.getInstance().launchEmulator(property);
+                               }
+                               */
+                       }
+               });
+
+               vmsTree.addKeyListener(new KeyListener() {
+                       @Override
+                       public void keyReleased(KeyEvent e) {}
+                       @Override
+                       public void keyPressed(KeyEvent e) {
+                               if (vmsTree.getSelectionCount() == 0) {
+                                       return;
+                               }
+                               Object data = vmsTree.getSelection()[0].getData();
+                               switch (e.keyCode) {
+                               case SWT.CR:
+                               case SWT.KEYPAD_CR:
+                                       if(data instanceof CreateMarker) {
+                                               VMsMainView.getInstance().drawCreateVM(
+                                                               ((CreateMarker)data).getBaseImage(),
+                                                               true);
+                                               return;
+                                       } else if (data instanceof PropertyContent) {
+                                               if (!VMsMainView.getInstance().isModifyMode()) {
+                                                       VMProperty property = ((PropertyContent)data).property;
+                                                       VMsMainView.getInstance().launchEmulator(property);
+                                               }
+                                       }
+                                       break;
+                               case SWT.DEL:
+                                       if(data instanceof PropertyContent) {
+                                               VMsMainView.getInstance().deleteEmulator();
+                                       }
+                                       break;
+                               case SWT.ESC:
+                                       if (data instanceof CreateMarker) {
+                                               VMsMainView.getInstance().drawCancelCreaetVM();
+                                       } else if (data instanceof TreeMarker) {
+                                               // TODO
+                                       } else {
+                                               VMsMainView.getInstance().drawDetailVM();
+                                       }
+                               default:
+                                       break;
+                               }
+                       }
+               });
+       }
+
+       @Override
+       public void drawVMList(BaseImage baseImage, int select, boolean isCreate) {
+               if (select < 0) {
+                       return;
+               }
+               currentItem = null;
+               vmsTree.removeAll();
+               createItems.clear();
+               typeItems.clear();
+               itemsMap.clear();
+
+               RowItem rowItem = null;
+               TreeItem createItem = null;
+               TreeItem propertyItem = null;
+
+               // add standard image
+               for (Platform p : EmulatorManager.getPlatformList()) {
+                       String standardVersion = p.getName();
+                       if (!standardVersion.isEmpty()) {
+                               TreeItem tempItem = new TreeItem(vmsTree, SWT.NONE);
+                               rowItem = new StandardVMsMarker(standardVersion, tempItem);
+                               tempItem.setData(rowItem);
+                               itemsMap.put(p.getName(), tempItem);
+                               typeItems.add(tempItem);
+
+                               for (BaseImage b : p.getImageList()) {
+                                       TreeItem t = new TreeItem(tempItem, SWT.NONE);
+                                       rowItem = new StandardVMsMarker(b.getName(), t);
+                                       t.setData(rowItem);
+                                       itemsMap.put(p.getName()+b.getName(), t);
+                                       typeItems.add(t);
+
+                                       createItem = new TreeItem(t, SWT.NONE);
+                                       rowItem = new CreateMarker(createItem, b);
+                                       createItem.setData(rowItem);
+                                       createItems.add(createItem);
+                               }
+                       }
+               }
+               //
+
+               // add custom image
+               TreeItem customItem = new TreeItem(vmsTree, SWT.NONE);
+               rowItem = new CustomVMsMarker(customItem);
+               customItem.setData(rowItem);
+
+               createItem = new TreeItem(customItem, SWT.NONE);
+               rowItem = new CreateMarker(createItem, null);
+               createItem.setData(rowItem);
+               createItems.add(createItem);
+
+               // add VM
+               ArrayList<VMProperty> properties = VMsMainView.getInstance().getCurrentImage().getVmsList();
+               VMProperty prop;
+               for(int i = 0; i < properties.size(); ++i) {
+                       // temporarily hard coded now...
+                       //if(properties[i].getArch() == Architecture.ARM)
+                       //      continue;
+                       prop = properties.get(i);
+                       if(FSImageType.standard == prop.getImageType()) {
+                               String version = prop.getConfiguration().getBaseInformation().getDiskImage().getVersion();
+                               String base = prop.getConfiguration().getBaseInformation().getDiskImage().getBase();
+                               propertyItem = itemsMap.get(version+base);
+                               if(propertyItem == null) {
+                                       propertyItem = itemsMap.get(version);
+                                       if (propertyItem == null) {
+                                               propertyItem = new TreeItem(vmsTree, SWT.NONE);
+                                               rowItem = new StandardVMsMarker(version, propertyItem);
+                                               propertyItem.setData(rowItem);
+                                               itemsMap.put(version, propertyItem);
+                                               typeItems.add(propertyItem);
+                                       }
+                                       propertyItem = new TreeItem(propertyItem, SWT.NONE);
+                                       rowItem = new StandardVMsMarker(base, propertyItem);
+                                       propertyItem.setData(rowItem);
+
+                                       itemsMap.put(version+base, propertyItem);
+                                       typeItems.add(propertyItem);
+                               }
+                               propertyItem = new TreeItem(propertyItem, SWT.NONE);
+                       }
+                       else {
+                               propertyItem = new TreeItem(customItem, SWT.NONE);
+                       }
+
+                       rowItem = new PropertyContent(prop, propertyItem);
+                       propertyItem.setData(rowItem);
+                       if (i == select) {
+                               currentItem = propertyItem;
+                       }
+               }
+
+               for (TreeItem item : createItems) {
+                       item.setExpanded(true);
+               }
+               customItem.setExpanded(true);
+               for(TreeItem item : typeItems) {
+                       item.setExpanded(true);
+               }
+
+               packAll();
+               packAll();  // FIXME: Need second pack avoid column becomes too narrow... why ???
+               setSelectProperty();
+       }
+
+       protected void packAll() {
+               for(TreeColumn column : vmsTree.getColumns()) {
+                       column.pack();
+               }
+               vmsTree.pack();
+       }
+
+       @Override
+       public void drawEmptyVMList() {
+               drawVMList(null, 0, false);
+       }
+
+       @Override
+       public void drawPlatform(Platform platform, int imageIndex) {
+               VMsMainView.getInstance().drawVMList(imageIndex);
+       }
+
+       @Override
+       public void cancelModify(int index) {
+               if (currentItem.getData() instanceof CreateMarker) {
+                       currentItem = oldItem;
+               }
+
+               setSelectProperty();
+       }
+
+       @Override
+       public void draw() {
+               vmsTree.layout(true, true);
+       }
+
+       @Override
+       public void redraw() {
+               vmsTree.redraw();
+       }
+
+       @Override
+       public void close() {
+               vmsTree.removeAll();
+               vmsTree.dispose();
+       }
+
+       @Override
+       public void setSize(int width, int height) {
+               this.width = width;
+               this.height = height;
+       }
+
+       @Override
+       public Point getSize() {
+               return new Point(width, height);
+       }
+
+       public void setSelectProperty() {
+               vmsTree.forceFocus();
+               if (currentItem != null) {
+                       vmsTree.setSelection(currentItem);
+               } else {
+                       vmsTree.setSelection(vmsTree.getItem(0));
+               }
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/list/ItemListVew.java b/src/org/tizen/emulator/manager/ui/list/ItemListVew.java
new file mode 100644 (file)
index 0000000..3bb0a37
--- /dev/null
@@ -0,0 +1,401 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.list;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.emulator.manager.platform.BaseImage;
+import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.resources.ColorResources;
+import org.tizen.emulator.manager.resources.ImageResources;
+import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
+import org.tizen.emulator.manager.ui.widgets.VMButton;
+
+enum VIEW_STATE {
+       NONE, EMPTY, DETAIL;
+}
+
+public class ItemListVew extends AbstractListView {
+       private int LIST_WIDTH  = 500;
+       private int LIST_HEIGHT = 375;
+       // for resize
+       private VIEW_STATE state = VIEW_STATE.NONE;
+
+       private ScrolledComposite scrolledList  = null;
+       private Composite vmList = null;
+
+       private ImageButton createButton = null; // for empty list
+       private VMButton addNewButton = null;
+
+       private int W_GAP = 10;
+       private int H_GAP = 12;
+       private int BUTTON_WIDTH        = 106 + 4;
+       private int BUTTON_HEIGHT       = 146 + 4;
+
+       private int W_COUNT = 0;
+       private int H_COUNT     = 0;
+
+       private int CREATE_BUTTON_WIDTH  = 190;
+       private int CREATE_BUTTON_HEIGHT = 190;
+
+       @Override
+       public void init(Composite parent, int width, int height) {
+               listView = new Composite(parent, SWT.NONE);
+               listView.setLayout(new FormLayout());
+               listView.setBackground(ColorResources.TAB_CONTENTS_BG_COLOR.getColor());
+
+               this.setSize(width, height);
+
+               makeVMList();
+       }
+
+       private Text dumyText = null;
+       private void makeVMList() {
+               scrolledList = new ScrolledComposite(listView, SWT.V_SCROLL |  SWT.BORDER);
+               scrolledList.setBackground(ColorResources.LIST_BG_COLOR.getColor());
+
+               vmList = new Composite(scrolledList, SWT.NONE);
+               vmList.setBackground(ColorResources.LIST_BG_COLOR.getColor());
+               vmList.setLayout(new FormLayout());
+
+               scrolledList.setContent(vmList);
+               scrolledList.setExpandHorizontal(true);
+
+               // for key event
+               dumyText = new Text(listView, SWT.NONE);
+               dumyText.setText("");
+
+               FormData data = new FormData();
+               data.left       = new FormAttachment(0, 0);
+               data.top        = new FormAttachment(0, 0);
+               data.right      = new FormAttachment(100, 0);
+               data.bottom = new FormAttachment(100, 0);
+               scrolledList.setLayoutData(data);
+
+               data = new FormData();
+               data.left       = new FormAttachment(0, -100);
+               data.top        = new FormAttachment(0, 0);
+               data.width  = 0;
+               data.height = 0;
+               dumyText.setLayoutData(data);
+               dumyText.addKeyListener(new KeyAdapter() {
+                       public void keyPressed(KeyEvent event) {
+                               controlKeyEvent(event);
+                       }
+               });
+       }
+
+       @Override
+       public void drawPlatform(Platform platform, int imageIndex) {
+               VMsMainView.getInstance().drawVMList(imageIndex);
+       }
+
+       @Override
+       public void drawVMList(BaseImage base, int select, boolean isCreate) {
+               if (createButton != null) {
+                       createButton.dispose();
+                       createButton = null;
+               }
+
+               if (select == -1) {
+                       select = 0;
+               }
+
+               state = VIEW_STATE.DETAIL;
+
+               VMButtonFactory.clear();
+               if (base.getVmsList().size() != 0) {
+                       VMButton button = null;
+                       for (int i = 0; i < base.getVmsList().size(); i++) {
+                               button = VMButtonFactory.getButton(vmList);
+                               button.setProperty(base.getVmsList().get(i));
+                               if (i == select) {
+                                       VMButtonFactory.clickVMButton(button);
+                               }
+                       }
+               }
+
+               // add create button
+               addNewButton = VMButtonFactory.getCreateButton(vmList);
+               if (isCreate) {
+                       addNewButton.setEnabled(false);
+               } else {
+                       addNewButton.setEnabled(true);
+               }
+               addNewButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               clickCreateButton();
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+               });
+
+               arrayVMList();
+               dumyText.setFocus();
+       }
+
+       @Override
+       public void drawEmptyVMList() {
+               if (createButton != null) {
+                       createButton.dispose();
+                       createButton = null;
+               }
+
+               // clear
+               VMButtonFactory.clear();
+
+               state = VIEW_STATE.EMPTY;
+
+               int leftOffset = (LIST_WIDTH - CREATE_BUTTON_WIDTH) / 2;
+               int topOffset = (LIST_HEIGHT - CREATE_BUTTON_HEIGHT) / 2;
+           FormData data = new FormData();
+               data.left       = new FormAttachment(0, leftOffset);
+               data.top        = new FormAttachment(0, topOffset);
+               data.width      = CREATE_BUTTON_WIDTH;
+               data.height = CREATE_BUTTON_HEIGHT;
+               createButton = new ImageButton(vmList, SWT.PUSH);
+               createButton.setImages(ImageResources.CREATE_NEW_NOMAL.getImage(),
+                               ImageResources.CREATE_NEW_HOVER.getImage(),
+                               ImageResources.CREATE_NEW_PUSH.getImage(),
+                               null, null,
+                               ImageResources.CREATE_NEW_NOMAL.getImage());
+               createButton.setLayoutData(data);
+
+               createButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               VMsMainView.getInstance().drawCreateVM(true);
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+               });
+
+               vmList.setSize(LIST_WIDTH, LIST_HEIGHT);
+               vmList.layout(true, true);
+               //scrolledList.layout(true, true);
+       }
+
+       @Override
+       public void cancelModify(int index) {
+               if (addNewButton != null && !addNewButton.isDisposed()) {
+                       addNewButton.setEnabled(true);
+               }
+
+               if (index >= 0) {
+                       VMButtonFactory.clickVMButton(index);
+               }
+
+               dumyText.setFocus();
+       }
+
+       @Override
+       public void draw() {
+               vmList.layout(true, true);
+               scrolledList.layout(true, true);
+       }
+
+       @Override
+       public void redraw() {
+               switch(state) {
+               case EMPTY:
+                       drawEmptyVMList();
+                       break;
+               case DETAIL:
+                       arrayVMList();
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       @Override
+       public void close() {
+               VMButtonFactory.clear();
+
+               vmList.dispose();
+               scrolledList.dispose();
+               listView.dispose();
+       }
+
+       @Override
+       public void setSize(int width, int height) {
+               this.LIST_WIDTH  = width  - 10;
+               this.LIST_HEIGHT = height - 55;
+               if (listView != null) {
+                       listView.setSize(LIST_WIDTH, LIST_HEIGHT);
+               }
+       }
+
+       @Override
+       public Point getSize() {
+               return new Point(LIST_WIDTH, LIST_HEIGHT);
+       }
+
+       private void arrayVMList() {
+               W_COUNT = LIST_WIDTH / (BUTTON_WIDTH + W_GAP);
+
+               int wIndex = 0;
+               int hIndex = 0;
+               int size = VMButtonFactory.getButtonList().size();
+               if (size != 0) {
+                       H_COUNT = size / W_COUNT;
+                       if (size % W_COUNT != 0) {
+                               H_COUNT++;
+                       }
+
+                       if (((BUTTON_HEIGHT + H_GAP) * H_COUNT) > LIST_HEIGHT) {
+                               vmList.setSize(LIST_WIDTH, ((BUTTON_HEIGHT + H_GAP) * H_COUNT) + H_GAP);
+                       } else {
+                               vmList.setSize(LIST_WIDTH, LIST_HEIGHT);
+                       }
+
+                       FormData data = null;
+                       for (VMButton button : VMButtonFactory.getButtonList()) {
+                               data = new FormData();
+                               data.left       = new FormAttachment(0, W_GAP + (BUTTON_WIDTH + W_GAP) * wIndex);
+                               data.top        = new FormAttachment(0, H_GAP + (BUTTON_HEIGHT + H_GAP) * hIndex);
+                               data.width      = BUTTON_WIDTH;
+                               data.height = BUTTON_HEIGHT;
+
+                               button.setLayoutData(data);
+
+                               button.redraw();
+                               ++wIndex;
+                               if (wIndex == W_COUNT) {
+                                       wIndex = 0;
+                                       hIndex++;
+                               }
+                       }
+               }
+
+               vmList.layout(true, true);
+               scrolledList.layout(true, true);
+
+               scrolledList.showControl(VMButtonFactory.getSelectedButton());
+       }
+
+       private void clickCreateButton() {
+               VMButtonFactory.clickVMButton(addNewButton);
+               VMsMainView.getInstance().drawCreateVM(true);
+       }
+
+       public void controlKeyEvent(KeyEvent event) {
+               if (createButton != null) {
+                       switch(event.keyCode) {
+                       case SWT.CR:
+                       case SWT.KEYPAD_CR:
+                               clickCreateButton();
+                               break;
+                       default:
+                               break;
+                       }
+               } else {
+                       switch (event.keyCode) {
+                       case SWT.CR:
+                       case SWT.KEYPAD_CR:
+                               if (VMButtonFactory.getSelectedButton() instanceof VMCreateButton) {
+                                       clickCreateButton();
+                               } else {
+                                       if (!VMsMainView.getInstance().isModifyMode()) {
+                                               VMButtonFactory.getSelectedButton().clickLaunchButton();
+                                       }
+                               }
+                               break;
+                       case SWT.ARROW_UP:
+                               int size = VMButtonFactory.getButtonList().size();
+                               int index = VMButtonFactory.getSelectedButtonIndex() - W_COUNT;
+                               if (index >= 0) {
+                                       VMButtonFactory.clickVMButton(index);
+                               }
+                               break;
+                       case SWT.ARROW_DOWN:
+                               size    = VMButtonFactory.getButtonList().size();
+                               index   = VMButtonFactory.getSelectedButtonIndex() + W_COUNT;
+                               if (index < size) {
+                                       VMButtonFactory.clickVMButton(index);
+                               } else {
+                                       VMButtonFactory.clickVMButton(VMButtonFactory.getButtonList().size() - 1);
+                               }
+                               break;
+                       case SWT.ARROW_LEFT:
+                               size    = VMButtonFactory.getButtonList().size();
+                               index   = VMButtonFactory.getSelectedButtonIndex() - 1;
+                               if (index >= 0) {
+                                       VMButtonFactory.clickVMButton(index);
+                               }
+                               break;
+                       case SWT.ARROW_RIGHT:
+                               size    = VMButtonFactory.getButtonList().size();
+                               index   = VMButtonFactory.getSelectedButtonIndex() + 1;
+                               if (index < size) {
+                                       VMButtonFactory.clickVMButton(index);
+                               }
+                               break;
+                       case SWT.DEL:
+                               if (!(VMButtonFactory.getSelectedButton() instanceof VMCreateButton)) {
+                                       VMsMainView.getInstance().deleteEmulator();
+                                       return;
+                               }
+                               break;
+                       case SWT.ESC:
+                               if (VMsMainView.getInstance().isCreateMode()) {
+                                       VMsMainView.getInstance().drawCancelCreaetVM();
+                               } else {
+                                       VMsMainView.getInstance().drawDetailVM();
+                               }
+                       }
+
+                       if (VMButtonFactory.getSelectedButton() != null) {
+                               scrolledList.showControl(VMButtonFactory.getSelectedButton());
+                       }
+               }
+       }
+
+}
diff --git a/src/org/tizen/emulator/manager/ui/list/RowItem.java b/src/org/tizen/emulator/manager/ui/list/RowItem.java
new file mode 100644 (file)
index 0000000..79b8844
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * MunKyu Im <munkyu.im@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@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.list;
+
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.widgets.TreeItem;
+import org.tizen.emulator.manager.platform.BaseImage;
+import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.vms.VMProperty;
+
+public interface RowItem {}
+
+interface TreeMarker extends RowItem {}
+
+interface TreeContent extends RowItem {}
+
+
+class PropertyContent implements TreeContent {
+       VMProperty property;
+       TreeItem item;
+
+       public PropertyContent(VMProperty property, TreeItem item) {
+               this.property = property;
+               this.item = item;
+
+               // TODO
+               item.setFont(FontResources.TREE_ITEM_FONT.getFont());
+               for(ColumnContentHelper helper : ColumnContentHelper.getContentHelpers()) {
+                       item.setText(helper.getIndex(), helper.getContent(property));
+               }
+       }
+       
+       public VMProperty getProperty() {
+               return property;
+       }
+
+       public TreeItem getItem() {
+               return item;
+       }
+}
+
+class CreateMarker implements TreeMarker {
+       private BaseImage image = null;
+       TreeItem item;
+       public CreateMarker(TreeItem item, BaseImage image) {
+               item.setText("<< Create new... >>");
+
+               // TODO
+               Font font = FontResources.TREE_CREATE_FONT.getFont();
+               item.setFont(font);
+
+               this.image =image;
+               this.item = item;
+       }
+       
+       public BaseImage getBaseImage() {
+               return image;
+       }
+
+       public TreeItem getItem() {
+               return item;
+       }
+}
+
+abstract class Container {
+       private TreeItem item;
+       public Container(String text, TreeItem item) {
+               this.item = item;
+               item.setText(text);
+       }
+       public TreeItem getItem() {
+               return item;
+       }
+}
+
+class StandardVMsMarker extends Container implements TreeMarker {
+       public StandardVMsMarker(String version, TreeItem item) {
+               super(version, item);
+       }
+}
+
+class CustomVMsMarker extends Container implements TreeMarker {
+       public CustomVMsMarker(TreeItem item) {
+               super("Custom", item);
+       }
+}
\ No newline at end of file
diff --git a/src/org/tizen/emulator/manager/ui/list/TreeListView.java b/src/org/tizen/emulator/manager/ui/list/TreeListView.java
new file mode 100644 (file)
index 0000000..69f0864
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.list;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.tizen.emulator.manager.platform.BaseImage;
+import org.tizen.emulator.manager.platform.Platform;
+import org.tizen.emulator.manager.resources.ColorResources;
+import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.vms.VMProperty;
+
+public class TreeListView extends AbstractListView {
+       protected Tree vmsTree;
+       private int width;
+       private int height;
+
+       @Override
+       public void init(Composite parent, int width, int height) {
+               setSize(width, height);
+               listView = new Composite(parent, SWT.NONE);
+               listView.setLayout(new FillLayout());
+
+               vmsTree = new Tree(listView, SWT.BORDER | SWT.SINGLE);
+               vmsTree.setHeaderVisible(true);
+               vmsTree.setLinesVisible(true);
+
+               vmsTree.setBackground(ColorResources.WHITE.getColor());
+               // TODO
+               vmsTree.setFont(FontResources.TREE_HEADER_FONT.getFont());
+
+               for(ColumnContentHelper helper : ColumnContentHelper.getContentHelpers()) {
+                       TreeColumn treeColumn = new TreeColumn(vmsTree, SWT.NONE);
+                       treeColumn.setText(helper.getTitle());
+                       /*
+                       if("Name".equalsIgnoreCase(treeColumn.getText())) {
+                               treeColumn.addSelectionListener(new ColumnSortListner());
+                       }
+                       */
+               }
+               settingListener();
+       }
+
+       protected PropertyContent currentProp = null;
+
+       private void settingListener() {
+               vmsTree.addFocusListener(new FocusListener() {
+
+                       @Override
+                       public void focusGained(FocusEvent e) {
+                               System.out.println("gain focus");
+                       }
+
+                       @Override
+                       public void focusLost(FocusEvent e) {
+                               // TODO Auto-generated method stub
+                               System.out.println("lost focus");
+                       }
+                       
+               });
+               vmsTree.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               if (vmsTree.getSelectionCount() == 1) {
+                                       Object data = vmsTree.getSelection()[0].getData();
+
+                                       if(!(data instanceof RowItem)) {
+                                               return;
+                                       }
+
+                                       // TODO : select template using platform
+                                       if (data instanceof CreateMarker) {
+                                               VMsMainView.getInstance().drawCreateVM(false);
+                                               //setSelectProperty();
+                                               vmsTree.setSelection(((CreateMarker) data).getItem());
+                                               return;
+                                       } else if(data instanceof TreeMarker) {
+                                               VMsMainView.getInstance().drawEmptyDetailVM();
+                                               return;
+                                       }
+
+                                       PropertyContent content = (PropertyContent)data;
+                                       currentProp = content;
+                                       VMsMainView.getInstance().drawDetailVM(content.property, -1);
+                               }
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               /*
+                               if (vmsTree.getSelectionCount() == 0) {
+                                       
+                               } else {
+                                       Object data = vmsTree.getSelection()[0].getData();
+
+                                       if(!(data instanceof TreeMarker)) {
+                                               return;
+                                       }
+
+                                       VMProperty property = ((PropertyContent)vmsTree.getSelection()[0].getData()).property;
+                                       VMsMainView.getInstance().launchEmulator(property);
+                               }
+                               */
+                       }
+               });
+
+               vmsTree.addKeyListener(new KeyListener() {
+                       @Override
+                       public void keyReleased(KeyEvent e) {}
+                       @Override
+                       public void keyPressed(KeyEvent e) {
+                               if (vmsTree.getSelectionCount() == 0) {
+                                       return;
+                               }
+                               Object data = vmsTree.getSelection()[0].getData();
+                               switch (e.keyCode) {
+                               case SWT.CR:
+                               case SWT.KEYPAD_CR:
+                                       if(data instanceof CreateMarker) {
+                                               VMsMainView.getInstance().drawCreateVM(true);
+                                               return;
+                                       } else if (data instanceof PropertyContent) {
+                                               if (!VMsMainView.getInstance().isModifyMode()) {
+                                                       VMProperty property = ((PropertyContent)data).property;
+                                                       VMsMainView.getInstance().launchEmulator(property);
+                                               }
+                                       }
+                                       break;
+                               case SWT.DEL:
+                                       if(data instanceof PropertyContent) {
+                                               VMsMainView.getInstance().deleteEmulator();
+                                       }
+                                       break;
+                               case SWT.ESC:
+                                       if (data instanceof CreateMarker) {
+                                               VMsMainView.getInstance().drawCancelCreaetVM();
+                                       } else {
+                                               VMsMainView.getInstance().drawDetailVM();
+                                       }
+                               default:
+                                       break;
+                               }
+                       }
+               });
+       }
+
+       protected void packAll() {
+               for(TreeColumn column : vmsTree.getColumns()) {
+                       column.pack();
+               }
+               vmsTree.pack();
+       }
+
+       @Override
+       public void drawPlatform(Platform platform, int imageIndex) {
+               VMsMainView.getInstance().drawVMList(imageIndex);
+       }
+
+       //private ArrayList<TreeItem> createItems = new ArrayList<TreeItem>();
+       //private ArrayList<TreeItem> typeItems = new ArrayList<TreeItem>();
+       //private Map<String, TreeItem> itemsMap = new HashMap<String, TreeItem>();
+       @Override
+       public void drawVMList(BaseImage base, int select, boolean isCreate) {
+               if (select >= 0) {
+                       vmsTree.removeAll();
+                       currentProp = null;
+       
+                       RowItem rowItem = null;
+                       TreeItem createItem = null;
+                       TreeItem propertyItem = null;
+       
+                       createItem = new TreeItem(vmsTree, SWT.NONE);
+                       rowItem           = new CreateMarker(createItem, base);
+                       createItem.setData(rowItem);
+       
+                       VMProperty prop = null;
+                       for(int i = 0; i < base.getVmsList().size(); i++) {
+                               prop = base.getVmsList().get(i);
+                               propertyItem = new TreeItem(vmsTree, SWT.NONE);
+                               rowItem = new PropertyContent(prop, propertyItem);
+                               propertyItem.setData(rowItem);
+                               if (i == select) {
+                                       currentProp = (PropertyContent)rowItem;
+                                       VMsMainView.getInstance().drawDetailVM(currentProp.property, -1);
+                               }
+                       }
+                       packAll();
+                       packAll();  // FIXME: Need second pack avoid column becomes too narrow... why ???
+                       setSelectProperty();
+               }
+       }
+
+       @Override
+       public void drawEmptyVMList() {
+               drawVMList(VMsMainView.getInstance().getCurrentImage(), 0, false);
+       }
+
+       @Override
+       public void cancelModify(int index) {
+               if (index >= 0) {
+                       currentProp = (PropertyContent)vmsTree.getItem(index + 1).getData(); // for create item
+                       setSelectProperty();
+               }
+               //packAll();
+       }
+
+       @Override
+       public void draw() {
+               vmsTree.layout(true, true);
+       }
+
+       @Override
+       public void redraw() {
+               //TODO
+               vmsTree.redraw();
+       }
+
+       @Override
+       public void close() {
+               vmsTree.removeAll();
+               vmsTree.dispose();
+       }
+
+       @Override
+       public void setSize(int width, int height) {
+               this.width = width;
+               this.height = height;
+       }
+
+       @Override
+       public Point getSize() {
+               return new Point(width, height);
+       }
+
+       public void setSelectProperty() {
+               vmsTree.forceFocus();
+               if (currentProp != null) {
+                       vmsTree.setSelection(currentProp.getItem());
+               }
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/list/VMButtonFactory.java b/src/org/tizen/emulator/manager/ui/list/VMButtonFactory.java
new file mode 100644 (file)
index 0000000..b44a868
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.list;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.tizen.emulator.manager.resources.ImageResources;
+import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.ui.widgets.VMButton;
+
+class VMCreateButton extends VMButton {
+       public VMCreateButton(Composite parent, int style) {
+               super(parent, style);
+               // delete launchButton
+               launchButton.dispose();
+               launchButton = null;
+               // set Image
+               setImages(ImageResources.ADD_NEW_NOMAL.getImage(),
+                               ImageResources.ADD_NEW_HOVER.getImage(),
+                               ImageResources.ADD_NEW_PUSH.getImage(),
+                               ImageResources.ADD_NEW_NOMAL.getImage(), //selected
+                               ImageResources.ADD_NEW_HOVER.getImage(),
+                               ImageResources.VM_IMAGE_CREATE.getImage()); //selected_hover
+       }
+
+       @Override
+       public void setSelection(boolean selected) {
+               super.setSelection(selected);
+               if (selected) {
+                       setEnabled(false);
+                       VMsMainView.getInstance().drawCreateVM(false);
+               } else {
+                       setEnabled(true);
+               }
+       }
+}
+
+public class VMButtonFactory {
+       private static ArrayList<VMButton> buttons = new ArrayList<VMButton> ();
+       private static int selectedIndex = 0;
+
+       public static VMButton getButton(Composite parent) {
+               VMButton b = new VMButton(parent, SWT.NONE);
+               b.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               VMButtonFactory.clickVMButton((VMButton)e.widget);
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+               });
+               buttons.add(b);
+               return b;
+       }
+
+       public static VMButton getCreateButton(Composite parent) {
+               VMCreateButton b = new VMCreateButton(parent, SWT.NONE);
+               buttons.add(b);
+               return b;
+       }
+
+       public static ArrayList<VMButton> getButtonList() {
+               return buttons;
+       }
+
+       public static void clear() {
+               for(VMButton b : buttons) {
+                       b.dispose();
+               }
+               buttons.clear();
+               selectedIndex = 0;
+       }
+
+       public static void clickVMButton(VMButton button) {
+               VMButton b = null;
+               for(int i = 0; i < buttons.size(); i++) {
+                       b = buttons.get(i);
+                       if (button == b) {
+                               b.setSelection(true);
+                               selectedIndex = i;
+                       } else {
+                               b.setSelection(false);
+                               b.redraw();
+                       }
+               }
+       }
+
+       public static void clickVMButton(int index) {
+               clickVMButton(buttons.get(index));
+       }
+
+       public static int getSelectedButtonIndex() {
+               return selectedIndex;
+       }
+
+       public static VMButton getSelectedButton() {
+               return buttons.isEmpty()
+                               ? null
+                               : buttons.get(selectedIndex);
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/tabfolder/PlatformTabButton.java b/src/org/tizen/emulator/manager/ui/tabfolder/PlatformTabButton.java
deleted file mode 100644 (file)
index 4a3373f..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-package org.tizen.emulator.manager.ui.tabfolder;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonAttribute;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonDefaultRenderer;
-import org.tizen.emulator.manager.resources.ColorResources;
-import org.tizen.emulator.manager.resources.FontResources;
-import org.tizen.emulator.manager.resources.PatchImageResources;
-
-public class PlatformTabButton extends DACustomButton {
-       private boolean isSelected = false;
-
-       public void setSelected(boolean isSelected) {
-               this.isSelected = isSelected;
-               ((PlatformTabButtonAttribute)attr).setSelected(isSelected);
-       }
-
-       public PlatformTabButton(Composite parent, int style) {
-               super(parent, style);
-               // change Listener
-               buttonMouseListener = buttonMouseListener2;
-               attr = new PlatformTabButtonAttribute();
-               this.addListeners();
-
-               this.setRenderer(new PlatformTabButtonRenderer());
-
-               // set Font
-               this.setFont(FontResources.TAB_BUTTON_FONT.getFont());
-
-               this.setFontColors(ColorResources.TAB_NORMAL_FONT_COLOR.getColor(),
-                               ColorResources.TAB_SELECTED_FONT_COLOR.getColor(),
-                               ColorResources.TAB_HOVER_FONT_COLOR.getColor(),
-                               ColorResources.TAB_NORMAL_FONT_COLOR.getColor());
-
-               // set image
-               this.setImages(PatchImageResources.getUnselectedTabFolder(120, 29),
-                               PatchImageResources.getSelectTabFolder(120, 29),
-                               PatchImageResources.getUnselectedTabFolderHover(120, 29),
-                               PatchImageResources.getUnselectedTabFolder(120, 29));
-       }
-
-       public PlatformTabButton(Composite parent, int style, String text) {
-               this(parent, style);
-               attr.setText(text);
-       }
-
-       private Listener buttonMouseListener2 = new Listener() {
-               @Override
-               public void handleEvent(Event event) {
-                       if (state == STATE_DISABLE) {
-                               return;
-                       }
-
-                       if (isSelected) {
-                               //changeButtonState(STATE_PUSH);
-                               //state = STATE_PUSH;
-                       } else {
-                               switch(event.type) {
-                               case SWT.MouseEnter:
-                                       changeButtonState(STATE_HOVER);
-                                       break;
-                               case SWT.MouseExit:
-                                       changeButtonState(STATE_NORMAL);
-                                       break;
-                               case SWT.MouseDown:
-                                       changeButtonState(STATE_HOVER);
-                                       break;
-                               case SWT.MouseUp: // FIXME
-                                       changeButtonState(STATE_HOVER);
-                                       break;
-                               default:
-                                       changeButtonState(STATE_NORMAL);
-                                       break;
-                               }
-                       }
-               }
-       };
-}
-
-class PlatformTabButtonRenderer extends DACustomButtonDefaultRenderer {
-       @Override
-       public void draw(GC gc, Canvas canvas, int state,
-                                       DACustomButtonAttribute attr) {
-               Rectangle rect = canvas.getClientArea();
-
-               if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
-                       PlatformTabButtonAttribute tabAttr = (PlatformTabButtonAttribute)attr;
-                       Image image = null;
-                       if (tabAttr.isSelected()) {
-                               // STATE_SELECT -> STATE_PUSH
-                               image = tabAttr.getImage(DACustomButton.STATE_PUSH);
-                               gc.drawImage(image, rect.x, rect.y);
-                               drawButtonText(gc, rect, tabAttr, DACustomButton.STATE_PUSH);
-                       } else {
-                               image = attr.getImage(state);
-                               gc.drawImage(image, rect.x, rect.y);
-                               drawButtonText(gc, rect, attr, state);
-                       }
-                       if (null == image) {
-                               return;
-                       }
-               } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
-                               || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
-                       drawButton(gc, rect, state, attr);
-               }
-
-               drawButtonImage(gc, rect, attr);
-       }
-}
-
-class PlatformTabButtonAttribute extends DACustomButtonAttribute {
-       private boolean selected;
-       public PlatformTabButtonAttribute() {
-               this.selected = false;
-       }
-       public boolean isSelected() {
-               return selected;
-       }
-       public void setSelected(boolean selected) {
-               this.selected = selected;
-       }
-}
\ No newline at end of file
index c3c1e03..c33f01b 100644 (file)
@@ -1,17 +1,50 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.tabfolder;
 
 import java.util.ArrayList;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
 import org.tizen.emulator.manager.resources.ColorResources;
+import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.resources.PatchImageResources;
 import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.ui.widgets.ImageButton;
+import org.tizen.emulator.manager.ui.widgets.WSTATE;
 
 public class PlatformTabFolder {
        private static final int TAB_WIDTH      = 120;
@@ -21,11 +54,11 @@ public class PlatformTabFolder {
 
        private ArrayList<PlatformTabItem> items
                                                = new ArrayList<PlatformTabItem>(5);
-       private ArrayList<PlatformTabButton> buttons
-                                               = new ArrayList<PlatformTabButton>(5);
+       private ArrayList<ImageButton> buttons
+                                               = new ArrayList<ImageButton>(5);
 
-       private ArrayList<DACustomButton> rightButtons
-                                               = new ArrayList<DACustomButton>(5);
+       private ArrayList<ImageButton> rightButtons
+                                               = new ArrayList<ImageButton>(5);
 
        private Composite mainComposite = null;
        private Composite tabComposite = null;
@@ -88,7 +121,7 @@ public class PlatformTabFolder {
                if(!items.isEmpty()) {
                        // clear
                        if (!buttons.isEmpty()) {
-                               for (PlatformTabButton b : buttons) {
+                               for (ImageButton b : buttons) {
                                        b.dispose();
                                }
                                buttons.clear();
@@ -122,8 +155,19 @@ public class PlatformTabFolder {
                items.get(getSelectionIndex()).redraw();
        }
 
-       private PlatformTabButton makeTabButton(PlatformTabItem item) {
-               PlatformTabButton tabButton = new PlatformTabButton(tabComposite, SWT.NONE);
+       private ImageButton makeTabButton(PlatformTabItem item) {
+               ImageButton tabButton = new ImageButton(tabComposite, SWT.NONE);
+               tabButton.setImages(PatchImageResources.getUnselectedTabFolder(120, 29),
+                               PatchImageResources.getUnselectedTabFolderHover(120, 29),
+                               PatchImageResources.getSelectTabFolder(120, 29),
+                               PatchImageResources.getSelectTabFolder(120, 29),
+                               PatchImageResources.getSelectTabFolder(120, 29),
+                               PatchImageResources.getUnselectedTabFolder(120, 29));
+               tabButton.setFont(FontResources.TAB_BUTTON_FONT.getFont());
+               tabButton.setFontColor(WSTATE.NORMAL, ColorResources.TAB_NORMAL_FONT_COLOR.getColor());
+               tabButton.setFontColor(WSTATE.SELECTED, ColorResources.TAB_SELECTED_FONT_COLOR.getColor());
+               tabButton.setFontColor(WSTATE.HOVER, ColorResources.TAB_HOVER_FONT_COLOR.getColor());
+               tabButton.setFontColor(WSTATE.PUSH, ColorResources.TAB_SELECTED_FONT_COLOR.getColor());
                tabButton.setText(item.getText());
                tabButton.setEnabled(true);
 
@@ -139,29 +183,35 @@ public class PlatformTabFolder {
                data.height = TAB_HEIGHT;
                tabButton.setLayoutData(data);
 
-               tabButton.addClickListener(new DACustomButtonClickEventListener() {
+               tabButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               selectionItem((ImageButton)e.widget);
+                       }
+
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
-                               selectionItem((PlatformTabButton)button);
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
                        }
                });
 
                return tabButton;
        }
 
-       private void selectionItem(PlatformTabButton button) {
-               PlatformTabButton b = null;
+       private void selectionItem(ImageButton button) {
+               ImageButton b = null;
                for (int i = 0; i < buttons.size(); i++) {
                        b = buttons.get(i);
                        if (button == b) {
                                this.setSelection(i);
-                               b.setSelected(true);
+                               b.setSelection(true);
                                b.redraw();
                                // draw main view using selected platform
                                items.get(i).draw();
                                contentsComposite.layout(true, true);
                        } else {
-                               b.setSelected(false);
+                               b.setSelection(false);
                                b.redraw();
                        }
                }
@@ -209,19 +259,19 @@ public class PlatformTabFolder {
                return items.remove(index);
        }
 
-       public void addTabRightButton(DACustomButton button) {
+       public void addTabRightButton(ImageButton button) {
                rightButtons.add(button);
        }
 
-       public void addTabRightButton(int index, DACustomButton button) {
+       public void addTabRightButton(int index, ImageButton button) {
                rightButtons.add(index, button);
        }
 
-       public void removeTabRightButton(DACustomButton button) {
+       public void removeTabRightButton(ImageButton button) {
                rightButtons.remove(button);
        }
 
-       public DACustomButton removeTabRightButton(int index) {
+       public ImageButton removeTabRightButton(int index) {
                return rightButtons.remove(index);
        }
 }
index 0c77e39..e084c4c 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.tabfolder;
 
 import org.tizen.emulator.manager.platform.Platform;
@@ -6,9 +35,6 @@ import org.tizen.emulator.manager.ui.VMsMainView;
 public class PlatformTabItem {
        private Platform platform;
 
-       /**
-        *  모든 platform tab item 들이 공유
-        */
        private static VMsMainView view;
 
        private String text;
index 28461e9..d940410 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
 
 import java.util.HashSet;
@@ -382,7 +411,7 @@ public class CustomScrollBar extends Canvas implements PaintListener, MouseWheel
 
         if (screenSizeY != size.y) {
                // draw background
-            this.setBackgroundImage(PatchImageResources.getScrollbarBackground(SCROLLBAR_WIDTH, size.y));
+            this.setBackgroundImage(PatchImageResources.getScrollbarBackground(SCROLLBAR_WIDTH + 2, size.y));
         }
 
         if (data.max > 0 && data.thumb > 0 && data.thumb <= data.max) {
@@ -394,9 +423,9 @@ public class CustomScrollBar extends Canvas implements PaintListener, MouseWheel
             screenThumb = (screenSizeY - (((data.max - data.thumb) * screenSizeY) / data.max));
            // screenThumb = screenSizeY - (data.max- data.thumb);
             // draw thumb
-            Rectangle thumb = new Rectangle(0, 0, SCROLLBAR_WIDTH, 35);
-            thumb.y = screenScrollTop;
-            thumb.height = screenThumb;
+            Rectangle thumb = new Rectangle(1, screenScrollTop, SCROLLBAR_WIDTH, screenThumb);
+            //thumb.y = screenScrollTop;
+            //thumb.height = screenThumb;
             g.setBackground(thumbColor);
             g.setFillRule(SWT.FILL_WINDING);
             g.fillRoundRectangle(thumb.x, thumb.y, thumb.width, thumb.height, 6, 6);
index fe188e7..0b49da3 100644 (file)
@@ -1,72 +1,59 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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:
- *     IBM Corporation - initial API and implementation
- *******************************************************************************/
+ * - S-Core Co., Ltd
+ *
+ */
+
 package org.tizen.emulator.manager.ui.widgets;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseWheelListener;
+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.widgets.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.resources.ColorResources;
-/**
- * A ScrolledComposite provides scrollbars and will scroll its content when the user
- * uses the scrollbars.
- *
- * <dl>
- * <dt><b>Styles:</b><dd>H_SCROLL, V_SCROLL
- * </dl>
- *
- * @see <a href="http://www.eclipse.org/swt/snippets/#scrolledcomposite">ScrolledComposite snippets</a>
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- */
+
 public class CustomScrolledComposite extends Composite {
-       Control content;
-       Listener contentListener;
-       Listener filter;
+       private Control content;
+       private Listener resizeListener;
+       private DisposeListener disposeListener;
 
-       boolean alwaysShowScroll = false;
-       boolean showFocusedControl = false;
-       CustomScrollBar verticalBar;
-       Composite scrollComposite = null;
+       private CustomScrollBar verticalBar;
 
-       /**
-        * Constructs a new instance of this class given its parent
-        * and a style value describing its behavior and appearance.
-        * <p>
-        * The style value is either one of the style constants defined in
-        * class <code>SWT</code> which is applicable to instances of this
-        * class, or must be built by <em>bitwise OR</em>'ing together 
-        * (that is, using the <code>int</code> "|" operator) two or more
-        * of those <code>SWT</code> style constants. The class description
-        * lists the style constants that are applicable to the class.
-        * Style bits are also inherited from superclasses.
-        * </p>
-        *
-        * @param parent a widget which will be the parent of the new instance (cannot be null)
-        * @param style the style of widget to construct
-        *
-        * @exception IllegalArgumentException <ul>
-        *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
-        * </ul>
-        * @exception SWTException <ul>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
-        * </ul>
-        *
-        * @see SWT#H_SCROLL
-        * @see SWT#V_SCROLL
-        * @see #getStyle()
-        */     
        public CustomScrolledComposite(Composite parent, int style) {
                super(parent, SWT.DOUBLE_BUFFERED);
                super.setLayout(new FormLayout());
@@ -86,42 +73,40 @@ public class CustomScrolledComposite extends Composite {
                data.top                = new FormAttachment(0, 2);
                data.bottom     = new FormAttachment(100, -2);
                data.right      = new FormAttachment(100, -2);
-               data.width      = 5;
+               data.width      = 7;
                verticalBar.setLayoutData(data);
                verticalBar.setBackground(ColorResources.DETAIL_MIDDLE_COLOR.getColor());
 
-               contentListener = new Listener() {
-                       public void handleEvent(Event e) {
-                               if (e.type != SWT.Resize) return;
-                               settingScrollLayout(e);
-                       }
-               };
-
-               filter = new Listener() {
+               resizeListener = new Listener() {
+                       @Override
                        public void handleEvent(Event event) {
-                               if (event.widget instanceof Control) {
-                                       Control control = (Control) event.widget;
-                                       if (contains(control)) showControl(control);
-                               }
+                               if (event.type != SWT.Resize) return;
+                               settingScrollLayout(event);
                        }
                };
 
-               addDisposeListener(new DisposeListener() {
+               disposeListener = new DisposeListener() {
+
+                       @Override
                        public void widgetDisposed(DisposeEvent e) {
-                               getDisplay().removeFilter(SWT.FocusIn, filter);
+                               verticalBar.dispose();
                        }
-               });
+                       
+               };
 
-               this.addListener(SWT.Resize, contentListener);
+               this.addListener(SWT.Resize, resizeListener);
+               this.addDisposeListener(disposeListener);
 
-               this.addMouseWheelListener(new MouseWheelListener() {
-                       @Override
-                       public void mouseScrolled(MouseEvent e) {
-                               if (verticalBar != null && verticalBar.isVisible()) {
-                                       verticalBar.mouseScrolled(e);
+               if (!EmulatorManager.isWin()) {
+                       this.addMouseWheelListener(new MouseWheelListener() {
+                               @Override
+                               public void mouseScrolled(MouseEvent e) {
+                                       if (verticalBar != null && verticalBar.isVisible()) {
+                                               verticalBar.mouseScrolled(e);
+                                       }
                                }
-                       }
-               });
+                       });
+               }
 
        }
 
@@ -130,21 +115,17 @@ public class CustomScrolledComposite extends Composite {
                        return;
                }
 
-               layout(true, true);
+               //layout(true, true);
                if (needVScroll(content.getBounds(), false)) {
                        verticalBar.setVisible(true);
                        verticalBar.setScrollSize(content.getBounds().height, 
                                        Math.min(content.getBounds().height, getClientArea().height), true);
                } else {
                        verticalBar.setVisible(false);
+                       verticalBar.setScrollPos(0);
                }
        }
 
-       static int checkStyle (int style) {
-               int mask =  SWT.V_SCROLL | SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; //SWT.H_SCROLL
-               return style & mask;
-       }
-
        boolean contains(Control control) {
                if (control == null || control.isDisposed()) {
                        return false;
@@ -159,48 +140,10 @@ public class CustomScrolledComposite extends Composite {
                return false;
        }
 
-       /**
-        * Returns the Always Show Scrollbars flag.  True if the scrollbars are 
-        * always shown even if they are not required.  False if the scrollbars are only 
-        * visible when some part of the composite needs to be scrolled to be seen.
-        * The H_SCROLL and V_SCROLL style bits are also required to enable scrollbars in the 
-        * horizontal and vertical directions.
-        * 
-        * @return the Always Show Scrollbars flag value
-        */
-       public boolean getAlwaysShowScrollBars() {
-               //checkWidget();
-               return alwaysShowScroll;
-       }
-
-       /**
-        * Get the content that is being scrolled.
-        * 
-        * @return the control displayed in the content area
-        */
        public Control getContent() {
-               //checkWidget();
                return content;
        }
 
-       /**
-        * Returns <code>true</code> if the receiver automatically scrolls to a focused child control 
-        * to make it visible. Otherwise, returns <code>false</code>.
-        * 
-        * @return a boolean indicating whether focused child controls are automatically scrolled into the viewport
-        *
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        * </ul>
-        * 
-        * @since 3.4
-        */
-       public boolean getShowFocusedControl() {
-               checkWidget();
-               return showFocusedControl;
-       }
-
        public CustomScrollBar getVScrollBar() {
                return verticalBar;
        }
@@ -214,12 +157,6 @@ public class CustomScrolledComposite extends Composite {
                int border = getBorderWidth();
                hostRect.height -= 2*border;
 
-               /*
-               if (hVisible && verticalBar != null) {
-                       hostRect.height -= verticalBar.getSize().y;
-               }
-               */
-
                if (contentRect.height > hostRect.height) {
                        return true;
                }
@@ -227,21 +164,6 @@ public class CustomScrolledComposite extends Composite {
                return false;
        }
 
-       /**
-        * Return the point in the content that currently appears in the top left 
-        * corner of the scrolled composite.
-        * 
-        * @return the point in the content that currently appears in the top left 
-        * corner of the scrolled composite.  If no content has been set, this returns
-        * (0, 0).
-        * 
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        * </ul>
-        * 
-        * @since 2.0
-        */
        public Point getOrigin() {
                checkWidget();
                if (content == null) {
@@ -251,44 +173,10 @@ public class CustomScrolledComposite extends Composite {
                return new Point(-location.x, -location.y);
        }
 
-       /**
-        * Scrolls the content so that the specified point in the content is in the top 
-        * left corner.  If no content has been set, nothing will occur.  
-        * 
-        * Negative values will be ignored.  Values greater than the maximum scroll 
-        * distance will result in scrolling to the end of the scrollbar.
-        *
-        * @param origin the point on the content to appear in the top left corner 
-        * 
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        *    <li>ERROR_INVALID_ARGUMENT - value of origin is outside of content
-        * </ul>
-        * @since 2.0
-        */
        public void setOrigin(Point origin) {
                setOrigin(origin.x, origin.y);
        }
 
-       /**
-        * Scrolls the content so that the specified point in the content is in the top 
-        * left corner.  If no content has been set, nothing will occur.  
-        * 
-        * Negative values will be ignored.  Values greater than the maximum scroll 
-        * distance will result in scrolling to the end of the scrollbar.
-        *
-        * @param x the x coordinate of the content to appear in the top left corner 
-        * 
-        * @param y the y coordinate of the content to appear in the top left corner 
-        * 
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        * </ul>
-        * 
-        * @since 2.0
-        */
        public void setOrigin(int x, int y) {
                checkWidget();
                if (content == null) return;
@@ -302,45 +190,10 @@ public class CustomScrolledComposite extends Composite {
                content.setLocation(x, y);
        }
 
-       /**
-        * Set the Always Show Scrollbars flag.  True if the scrollbars are 
-        * always shown even if they are not required.  False if the scrollbars are only 
-        * visible when some part of the composite needs to be scrolled to be seen.
-        * The H_SCROLL and V_SCROLL style bits are also required to enable scrollbars in the 
-        * horizontal and vertical directions.
-        * 
-        * @param show true to show the scrollbars even when not required, false to show scrollbars only when required
-        * 
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        * </ul>
-        */
-       public void setAlwaysShowScrollBars(boolean show) {
-               checkWidget();
-               if (show == alwaysShowScroll) {
-                       return;
-               }
-               alwaysShowScroll = show;
-               if (verticalBar != null && alwaysShowScroll) {
-                       verticalBar.setVisible(true);
-               }
-       }
-
-       /**
-        * Set the content that will be scrolled.
-        * 
-        * @param content the control to be displayed in the content area
-        * 
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        * </ul>
-        */
        public void setContent(Composite content) {
                checkWidget();
                if (this.content != null && !this.content.isDisposed()) {
-                       this.content.removeListener(SWT.Resize, contentListener);
+                       this.content.removeListener(SWT.Resize, resizeListener);
                        this.content.setBounds(new Rectangle(-200, -200, 0, 0));        
                }
                
@@ -360,88 +213,8 @@ public class CustomScrolledComposite extends Composite {
                        content.setLayoutData(data);
                        content.setLocation(0, 0);
                        layout(false);
-                       this.content.addListener(SWT.Resize, contentListener);
-               } else {
-                       if (verticalBar != null) verticalBar.setVisible(alwaysShowScroll);
-               }
-       }
-
-       /**
-        * Configure the receiver to automatically scroll to a focused child control
-        * to make it visible.
-        * 
-        * If show is <code>false</code>, show a focused control is off.  
-        * By default, show a focused control is off.
-        * 
-        * @param show <code>true</code> to show a focused control.
-        * 
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        * </ul>
-        * 
-        * @since 3.4
-        */
-       public void setShowFocusedControl(boolean show) {
-               checkWidget();
-               if (showFocusedControl == show) {
-                       return;
-               }
-               Display display = getDisplay();
-               display.removeFilter(SWT.FocusIn, filter);
-               showFocusedControl = show;
-               if (!showFocusedControl) {
-                       return;
-               }
-               display.addFilter(SWT.FocusIn, filter);
-               Control control = display.getFocusControl();
-               if (contains(control)) {
-                       showControl(control);
-               }
-       }
-
-       /**
-        * Scrolls the content of the receiver so that the control is visible.
-        *
-        * @param control the control to be shown
-        *
-        * @exception IllegalArgumentException <ul>
-        *    <li>ERROR_NULL_ARGUMENT - if the control is null</li>
-        *    <li>ERROR_INVALID_ARGUMENT - if the control has been disposed</li>
-        * </ul>
-        * @exception SWTException <ul>
-        *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
-        *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
-        * </ul>
-        *
-        * @since 3.4
-        */
-       public void showControl(Control control) {
-               checkWidget ();
-               if (control == null) {
-                       SWT.error(SWT.ERROR_NULL_ARGUMENT);
-               }
-               if (control.isDisposed ()) {
-                       SWT.error(SWT.ERROR_INVALID_ARGUMENT);
-               }
-               if (!contains(control)) {
-                       SWT.error(SWT.ERROR_INVALID_ARGUMENT);
-               }
-
-               Rectangle itemRect = getDisplay().map(control.getParent(), this, control.getBounds());
-               Rectangle area = getClientArea();
-               Point origin = getOrigin();
-               if (itemRect.x < 0) {
-                       origin.x = Math.max(0, origin.x + itemRect.x);
-               } else {
-                       if (area.width < itemRect.x + itemRect.width) origin.x = Math.max(0, origin.x + itemRect.x + Math.min(itemRect.width, area.width) - area.width);
-               }
-               if (itemRect.y < 0) {
-                       origin.y = Math.max(0, origin.y + itemRect.y);
-               } else {
-                       if (area.height < itemRect.y + itemRect.height) origin.y = Math.max(0, origin.y + itemRect.y + Math.min(itemRect.height, area.height) - area.height);
+                       this.content.addListener(SWT.Resize, resizeListener);
                }
-               setOrigin(origin);
        }
 
        void vScroll() {
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ImageButton.java b/src/org/tizen/emulator/manager/ui/widgets/ImageButton.java
new file mode 100644 (file)
index 0000000..4150d05
--- /dev/null
@@ -0,0 +1,413 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+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.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.TypedListener;
+import org.tizen.emulator.manager.resources.ColorResources;
+import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.resources.PatchImageResources;
+
+public class ImageButton extends Canvas {
+       private Composite parent;
+       private int style = 0;
+
+       protected WSTATE state = WSTATE.NORMAL;
+       // index of list is WSTATE
+       protected ArrayList<Image> images = null;
+       protected ArrayList<Color> colors = null;
+       protected ArrayList<Color> fontColors = null;
+       protected ArrayList<Font> fonts = null;
+
+       private String text = "";
+       private boolean selected = false;
+       private boolean defaultPush = true;
+
+       private int RADIO_IMAGE_SIZE = 21;
+       public ImageButton(Composite parent, int style) {
+               super(parent, SWT.DOUBLE_BUFFERED | style);
+               this.parent = parent;
+               if (style == SWT.NONE) {
+                       style = SWT.PUSH;
+               }
+               this.style = style;
+
+               initButton();
+               addListeners();
+               
+
+               this.setFont(FontResources.BUTTON_FONT.getFont());
+       }
+
+       protected void initButton() {
+               images = new ArrayList<Image>();
+               colors = new ArrayList<Color>();
+               fontColors = new ArrayList<Color>();
+               fonts = new ArrayList<Font>();
+
+               for (WSTATE s : WSTATE.values()) {
+                       colors.add(s.getId(), ColorResources.BUTTON_BG_COLOR.getColor());
+                       fontColors.add(s.getId(), ColorResources.BUTTON_ENABLE_FONT_COLOR.getColor());
+                       fonts.add(s.getId(), FontResources.BUTTON_FONT.getFont());
+                       images.add(s.getId(), null);
+               }
+
+               fontColors.set(WSTATE.DISABLE.getId(),
+                               ColorResources.BUTTON_DISABLE_FONT_COLOR.getColor());
+       }
+
+       private void addListeners() {
+               addPaintListener(paintListener);
+               addListener(SWT.MouseDown, mouseListener);
+               addListener(SWT.MouseUp, mouseListener);
+               addListener(SWT.MouseEnter, mouseListener);
+               addListener(SWT.MouseExit, mouseListener);
+               addDisposeListener(disposeListener);
+       }
+
+       public void setPainListener(PaintListener listener) {
+               removePaintListener(paintListener);
+               this.paintListener = listener;
+               addPaintListener(paintListener);
+       }
+
+       private boolean checkStyle(int style, int bit) {
+               if ((style & bit) == 0) {
+                       return false;
+               }
+               return true;
+       }
+
+       public void setFont(WSTATE state, Font font) {
+               fonts.set(state.getId(), font);
+       }
+
+       public void setFontColor(WSTATE state, Color color) {
+               fontColors.set(state.getId(), color);
+       }
+
+       public void setImage(WSTATE state, Image image) {
+               images.set(state.getId(), image);
+       }
+
+       public void setBackgroundColor(WSTATE state, Color color) {
+               colors.set(state.getId(), color);
+       }
+
+       public void setText(String text) {
+               this.text = text;
+               this.redraw();
+       }
+
+       public String getText() {
+               return text;
+       }
+
+       public Image getImage() {
+               return images.get(WSTATE.NORMAL.getId());
+       }
+
+       public Image getImage(WSTATE state) {
+               return images.get(state.getId());
+       }
+
+       private Image nomalImage = null;
+       private Image hoverImage = null;
+       private Image pushImage = null;;
+       public void drawPushImage(GC gc, WSTATE state, int width, int height) {
+               Image image = null;
+               switch(state) {
+               case HOVER:
+                       if (hoverImage == null) {
+                               hoverImage = PatchImageResources.getHoverButton(width);
+                       }
+                       image = hoverImage;
+                       break;
+               case PUSH:
+                       if (pushImage == null) {
+                               pushImage = PatchImageResources.getNomalButton(width);
+                       }
+                       image = pushImage;
+                       break;
+               default:
+                       if (nomalImage == null) {
+                               nomalImage = PatchImageResources.getNomalButton(width);
+                       }
+                       image = nomalImage;
+                       break;
+               }
+
+               Rectangle rect = image.getBounds();
+               gc.drawImage(image, rect.x, rect.y);
+       }
+
+       public void setImages(Image normal, Image hover, Image pushed,
+                       Image selected, Image selected_hover, Image disable) {
+               images.set(WSTATE.NORMAL.getId(), normal);
+               images.set(WSTATE.HOVER.getId(), hover);
+               images.set(WSTATE.PUSH.getId(), pushed);
+               images.set(WSTATE.SELECTED.getId(), selected);
+               images.set(WSTATE.SELECTED_HOVER.getId(), selected_hover);
+               images.set(WSTATE.DISABLE.getId(), disable);
+
+               if (checkStyle(style, SWT.PUSH)) {
+                       defaultPush = false;
+               }
+               redraw();
+       }
+
+       public void setForeground(Color normal, Color hover, Color selected,
+                       Color pushed, Color disable, Color selected_hover) {
+               fontColors.set(WSTATE.NORMAL.getId(), normal);
+               fontColors.set(WSTATE.HOVER.getId(), hover);
+               fontColors.set(WSTATE.SELECTED.getId(), selected);
+               fontColors.set(WSTATE.PUSH.getId(), pushed);
+               fontColors.set(WSTATE.DISABLE.getId(), disable);
+               fontColors.set(WSTATE.SELECTED_HOVER.getId(), selected_hover);
+
+               redraw();
+       }
+
+       @Override
+       public Point computeSize(int wHint, int hHint, boolean changed) {
+               int width = 0, height = 0;
+
+               if (checkStyle(style, SWT.RADIO) 
+                               && images.get(WSTATE.NORMAL.getId()) != null) {
+                       Rectangle bounds = images.get(WSTATE.NORMAL.getId()).getBounds();
+                       width = bounds.width + 14;
+                       height = bounds.height;
+               }
+
+               if (text != null) {
+                       GC gc = new GC(this);
+                       Point extent = gc.stringExtent(text);
+                       gc.dispose();
+                       width += extent.x;
+                       height = Math.max(height, extent.y);
+               }
+
+               if (wHint != SWT.DEFAULT)
+                       width = wHint;
+
+               if (hHint != SWT.DEFAULT)
+                       height = hHint;
+
+               if (checkStyle(style, SWT.PUSH) && defaultPush) {
+                       if (width < 13) {
+                               width = 13;
+                       }
+                       if (height < 22) {
+                               height = 22;
+                       }
+               }
+
+               return new Point(width, height);
+       }
+
+       private DisposeListener disposeListener = new DisposeListener() {
+
+               @Override
+               public void widgetDisposed(DisposeEvent arg0) {
+                       int i = 0;
+                       for (WSTATE s : WSTATE.values()) {
+                               i = s.getId();
+                               WidgetHelper.tryDispose(images.get(i), colors.get(i), fontColors.get(i), fonts.get(i));
+                       }
+                       WidgetHelper.tryDispose(nomalImage, hoverImage, pushImage);
+               }
+       };
+
+       private PaintListener paintListener = new PaintListener() {
+
+               @Override
+               public void paintControl(PaintEvent e) {
+                       Rectangle rect = ((Canvas) e.widget).getClientArea();
+                       Image img = images.get(state.getId());
+
+                       if (colors.get(state.getId()) != null) {
+                               e.gc.setBackground(colors.get(state.getId()));
+                               e.gc.fillRectangle(rect);
+                       }
+
+                       int x = rect.x;
+                       int y = rect.y;
+
+                       if (checkStyle(style, SWT.RADIO)) {
+                               y = rect.y + (rect.height - RADIO_IMAGE_SIZE) / 2;
+                       } else if (defaultPush && checkStyle(style, SWT.PUSH)) {
+                               drawPushImage(e.gc, state, rect.width, rect.height);
+                               defaultPush = true;
+                       } else if (img == null) {
+                               return;
+                       }
+
+                       if (null != img) {
+                               e.gc.drawImage(img, x, y);
+                       }
+
+                       if (checkStyle(style, SWT.RADIO)) {
+                               x += RADIO_IMAGE_SIZE + 6;
+                       } else {
+                               Point extent = e.gc.stringExtent(text);
+                               x += rect.x + ((rect.width - extent.x) / 2);
+                       }
+                       int fontHeight = e.gc.getFontMetrics().getHeight();
+                       y = rect.y + (rect.height - fontHeight) / 2 - 1;
+
+                       if (fontColors.get(state.getId()) != null) {
+                               e.gc.setForeground(fontColors.get(state.getId()));
+                       }
+
+                       if (text != null) {
+                               e.gc.drawText(text, x, y, true);
+                       }
+               }
+       };
+
+       public void addSelectionListener(SelectionListener listener) {
+               addListener(SWT.Selection, new TypedListener(listener));
+               addListener(SWT.DefaultSelection, new TypedListener(listener));
+       }
+
+       public void removeSelectionListener(SelectionListener listener) {
+               removeListener(SWT.Selection, listener);
+               removeListener(SWT.DefaultSelection, listener);
+       }
+
+       protected Listener mouseListener = new Listener() {
+
+               @Override
+               public void handleEvent(Event event) {
+                       if (event.type == SWT.MouseDown) {
+                               ImageButton btn = (ImageButton) event.widget;
+                               btn.setFocus();
+                               if (state == WSTATE.NORMAL) {
+                                       state = WSTATE.PUSH;
+                                       redraw();
+                               }
+                       } else if (event.type == SWT.MouseUp) {
+                               ImageButton button = (ImageButton) event.widget;
+                               Rectangle rect = button.getClientArea();
+
+                               if (rect.contains(event.x, event.y)) {
+                                       if (checkStyle(style, SWT.RADIO)) {
+                                               selectRadio();
+                                       } else if (checkStyle(style, SWT.PUSH)) {
+                                               if (state == WSTATE.PUSH) {
+                                                       state = WSTATE.HOVER;
+                                                       redraw();
+                                               }
+
+                                       } else if (checkStyle(style, SWT.TOGGLE)) {
+                                               if (isSelection()) {
+                                                       setSelection(false);
+                                               } else {
+                                                       setSelection(true);
+                                               }
+                                               redraw();
+                                       }
+                                       notifyListeners(SWT.Selection, new Event());
+                                       notifyListeners(SWT.DefaultSelection, new Event());
+                               }
+                       } else if (event.type == SWT.MouseEnter) {
+                               if ((state != WSTATE.HOVER) && (state != WSTATE.SELECTED_HOVER)) {
+                                       if (selected) {
+                                               state = WSTATE.SELECTED_HOVER;
+                                       } else {
+                                               state = WSTATE.HOVER;
+                                       }
+                                       redraw();
+                               }
+                       } else if (event.type == SWT.MouseExit) {
+                               if (state == WSTATE.HOVER || state == WSTATE.SELECTED_HOVER
+                                               || state == WSTATE.PUSH) {
+                                       if (selected) {
+                                               state = WSTATE.SELECTED;
+                                       } else {
+                                               state = WSTATE.NORMAL;
+                                       }
+                                       redraw();
+                               }
+                       }
+               }
+       };
+
+       public void setSelection(boolean selected) {
+               if (selected) {
+                       state = WSTATE.SELECTED;
+                       this.selected = true;
+               } else {
+                       state = WSTATE.NORMAL;
+                       this.selected = false;
+               }
+               redraw();
+       }
+
+       public boolean isSelection() {
+               return selected;
+       }
+
+       public void selectRadio() {
+               Control[] children = parent.getChildren();
+               for (int i = 0; i < children.length; i++) {
+                       Control child = children[i];
+                       if (child instanceof ImageButton && child != this) {
+                               ((ImageButton) child).setSelection(false);
+                       }
+               }
+               setSelection(true);
+       }
+
+       @Override
+       public void setEnabled(boolean enable) {
+               super.setEnabled(enable);
+               state = (enable ? WSTATE.NORMAL : WSTATE.DISABLE);
+               redraw();
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ImageCombo.java b/src/org/tizen/emulator/manager/ui/widgets/ImageCombo.java
new file mode 100644 (file)
index 0000000..70247d8
--- /dev/null
@@ -0,0 +1,387 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.emulator.manager.resources.ColorResources;
+import org.tizen.emulator.manager.resources.FontResources;
+import org.tizen.emulator.manager.resources.ImageResources;
+
+public class ImageCombo extends Canvas {
+       private Composite parent;
+
+       private WSTATE state = WSTATE.NORMAL;
+       // index of list is WSTATE
+       private ArrayList<Image> images = null;
+       private ArrayList<Color> colors = null;
+       private ArrayList<Color> fontColors = null;
+       private ArrayList<Font> fonts = null;
+
+       private ArrayList<String> items;
+       private int selectedIndex = 0;
+       private String selectedText = "";
+       private int itemHeight = 0;
+
+       private ImageComboPopup popup = null;
+
+       private Image arrowButtonImage = null;
+
+       public ImageCombo(Composite parent, int style) {
+               super(parent, style);
+               this.parent = parent;
+               popup = new ImageComboPopup(this);
+
+               initCombo();
+               addListeners();
+       }
+
+       private void initCombo() {
+               items = new ArrayList<String>();
+
+               images = new ArrayList<Image>();
+               colors = new ArrayList<Color>();
+               fontColors = new ArrayList<Color>();
+               fonts = new ArrayList<Font>();
+
+               for (WSTATE s : WSTATE.values()) {
+                       images.add(s.getId(), ImageResources.COMBO_NORMAL.getImage());
+                       colors.add(s.getId(), ColorResources.COMBO_BG_COLOR.getColor());
+                       fontColors.add(s.getId(), ColorResources.COMOB_ENABLE_FONT_COLOR.getColor());
+                       fonts.add(s.getId(), FontResources.COMBO_BUTTON_FONT.getFont());
+               }
+
+               images.set(WSTATE.DISABLE.getId(),
+                               ImageResources.COMBO_DISABLE.getImage());
+               images.set(WSTATE.HOVER.getId(),
+                               ImageResources.COMBO_HOVER.getImage());
+               images.set(WSTATE.PUSH.getId(),
+                               ImageResources.COMBO_PUSH.getImage());
+
+               fontColors.add(WSTATE.DISABLE.getId(),
+                               ColorResources.COMBO_DISABLE_FONT_COLOR.getColor());
+       }
+
+       public void addListeners() {
+               addPaintListener(comboPaintListener);
+               addDisposeListener(disposeListener);
+
+               addListener(SWT.MouseEnter, comboMouseListener);
+               addListener(SWT.MouseHover, comboMouseListener);
+               addListener(SWT.MouseExit, comboMouseListener);
+               addListener(SWT.MouseDown, comboMouseListener);
+               addListener(SWT.MouseMove, comboMouseListener);
+               addListener(SWT.MouseUp, comboMouseListener);
+       }
+
+       public void addSelectionListener(SelectionListener listener) {
+               popup.addSelectionListener(listener);
+       }
+
+       public void removeSelectionListener(SelectionListener listener) {
+               popup.removeSelectionListener(listener);
+       }
+
+       public void add(String string) {
+               add(string, items.size());
+       }
+
+       public void add(String string, int index) {
+               assert string == null;
+               if (index < 0 || index > items.size()) {
+                       // TODO
+                       return;
+               }
+               items.add(index, string);
+       }
+
+       public String getItem (int index) {
+               if (index < 0 || index >= items.size()) {
+                       // TODO
+                       return null;
+               }
+
+               return items.get(index);
+       }
+
+       public int getItemCount() {
+               return items.size();
+       }
+
+       public String[] getItems() {
+               String[] ar = new String[items.size()];
+               for (int i = 0; i < items.size(); i++) {
+                       ar[i] = items.get(i);
+               }
+               return ar;
+       }
+
+       public ArrayList<String> getItemArray() {
+               return items;
+       }
+
+       public int getSelectionIndex() {
+               return selectedIndex;
+       }
+
+       public String getText() {
+               return selectedText;
+       }
+
+       public int getItemHeight() {
+               return itemHeight;
+       }
+
+       public void removeAll() {
+               if (items != null) {
+                       items.clear();
+               }
+               selectedIndex = -1;
+               selectedText = "";
+               if (!popup.isDispose()) {
+                       popup.dispose();
+               }
+       }
+
+       // for ImageComboPopup
+       void setIndex(int index) {
+               if (index < 0 || index >= items.size()) {
+                       return;
+               }
+               selectedIndex = index;
+       }
+
+       public void select(int index) {
+               if (index < 0 || index >= items.size()) {
+                       return;
+               }
+
+               selectedIndex = index;
+               selectedText = items.get(index);
+
+               // TODO
+               redraw();
+       }
+
+       public void setText(String string) {
+               assert string == null;
+               setText(items.indexOf(string), string);
+       }
+
+       public void setText(int index, String string) {
+               assert string == null;
+               if (index < 0 || index >= items.size()) {
+                       // TODO
+                       return;
+               }
+
+               items.set(index, string);
+
+               redraw();
+       }
+
+       public void setItemHeight(int itemHeight) {
+               this.itemHeight = itemHeight;
+       }
+
+       public void setFont(WSTATE state, Font font) {
+               fonts.set(state.getId(), font);
+       }
+
+       public void setFontColor(WSTATE state, Color color) {
+               fontColors.set(state.getId(), color);
+       }
+
+       public void setImage(WSTATE state, Image image) {
+               images.set(state.getId(), image);
+       }
+
+       public void setBackgroundColor(WSTATE state, Color color) {
+               colors.set(state.getId(), color);
+       }
+
+       public void setArrowButtonImage (Image image) {
+               this.arrowButtonImage = image;
+       }
+
+       @Override
+       public void setEnabled(boolean enabled) {
+               super.setEnabled(enabled);
+               if (!enabled) {
+                       state = WSTATE.DISABLE;
+               } else {
+                       state = WSTATE.NORMAL;
+               }
+               redraw();
+       }
+
+       private Listener comboMouseListener = new Listener() {
+               @Override
+               public void handleEvent(Event event) {
+                       if (isEnabled()) {
+                               switch (event.type) {
+                               case SWT.MouseEnter:
+                                       changeComboState(WSTATE.HOVER);
+                                       break;
+                               case SWT.MouseHover:
+                               {
+                                       if (!isOutOfBounds(event.x, event.y)) {
+                                               if ((event.stateMask & SWT.BUTTON1) != 0) {
+                                                       changeComboState(WSTATE.PUSH);
+                                               } else {
+                                                       changeComboState(WSTATE.HOVER);
+                                               }
+                                       }
+                               }
+                                       break;
+                               case SWT.MouseDown:
+                                       changeComboState(WSTATE.PUSH);
+                                       break;
+                               case SWT.MouseUp:
+                                       changeComboState(WSTATE.HOVER);
+                                       if (popup.isDispose()) {
+                                               popup.open();
+                                       } else {
+                                               popup.dispose();
+                                       }
+                                       break;
+                               case SWT.MouseMove:
+                               {
+                                       if (isOutOfBounds(event.x, event.y)) {
+                                               changeComboState(WSTATE.NORMAL);
+                                       } else {
+                                               if ((event.stateMask & SWT.BUTTON1) != 0) {
+                                                       changeComboState(WSTATE.PUSH);
+                                               } else {
+                                                       changeComboState(WSTATE.HOVER);
+                                               }
+                                       }
+                               }
+                                       break;
+                               case SWT.MouseExit:
+                                       changeComboState(WSTATE.NORMAL);
+                                       break;
+                               default:
+                                       break;
+                               }
+                       }
+               }
+       };
+
+       protected boolean isOutOfBounds(int x, int y) {
+               Rectangle rect = this.getBounds();
+
+               if (x < 0 || x > rect.width || y < 0 || y > rect.height) {
+                       return true;
+               } else {
+                       return false;
+               }
+       }
+
+       // for ImageComboPopup
+       Shell getParentShell() {
+               if (parent == null) {
+                       return null;
+               } else {
+                       return parent.getShell();
+               }
+       }
+
+       private void changeComboState(WSTATE s) {
+               state = s;
+               redraw();
+       }
+
+       private static int ARROW_OFFSET = 4;
+       private static int LEFT_OFFSET = 5;
+       private PaintListener comboPaintListener = new PaintListener() {
+               @Override
+               public void paintControl(PaintEvent e) {
+                       Rectangle rect = ((Canvas) e.widget).getClientArea();
+
+                       Image img = images.get(state.getId());
+                       e.gc.setBackground(colors.get(state.getId()));
+
+                       int x = rect.x;
+                       int y = rect.y;
+                       if (img != null) {
+                               e.gc.drawImage(img, x, y);
+                       }
+
+                       if (arrowButtonImage != null) {
+                               int w = arrowButtonImage.getImageData().width;
+                               int h = arrowButtonImage.getImageData().height;
+                               x += rect.width - w - ARROW_OFFSET;
+                               y += (rect.height - h) / 2;
+                               e.gc.drawImage(arrowButtonImage, x, y);
+                               Rectangle clipping = new Rectangle(rect.x, rect.y,
+                                               rect.width - w - ARROW_OFFSET - 2, rect.height);
+                               e.gc.setClipping(clipping);
+                       }
+
+                       e.gc.setForeground(fontColors.get(state.getId()));
+                       e.gc.setFont(fonts.get(state.getId()));
+
+                       x = rect.x + LEFT_OFFSET;
+                       int fontHeight = e.gc.getFontMetrics().getHeight();
+                       y = rect.y + (rect.height - fontHeight) / 2;
+
+                       if (selectedText != null) {
+                               e.gc.drawText(selectedText, x, y, true);
+                       }
+               }
+       };
+
+       private DisposeListener disposeListener = new DisposeListener() {
+               @Override
+               public void widgetDisposed(DisposeEvent arg0) {
+                       int i = 0;
+                       for (WSTATE s : WSTATE.values()) {
+                               i = s.getId();
+                               WidgetHelper.tryDispose(images.get(i), colors.get(i), fontColors.get(i), fonts.get(i));
+                       }
+               }
+       };
+}
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ImageComboPopup.java b/src/org/tizen/emulator/manager/ui/widgets/ImageComboPopup.java
new file mode 100644 (file)
index 0000000..9e2cb20
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+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.GC;
+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.widgets.Canvas;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.emulator.manager.resources.ColorResources;
+import org.tizen.emulator.manager.resources.FontResources;
+
+class ImageComboPopup {
+       private Shell popupShell = null;
+       private Canvas popupCanvas = null;
+       private List<Rectangle> itemRects;
+       ImageCombo parent = null;
+       public ImageComboPopup(ImageCombo parent) {
+               this.parent = parent;
+               initPopup();
+       }
+
+       private void initPopup() {
+               itemRects = new ArrayList<Rectangle>();
+       }
+
+       private int getShellWidth() {
+               ArrayList<String> items = parent.getItemArray();
+               if (items.isEmpty()) {
+                       return 0;
+               }
+
+               int maxWidth = 0;
+               int size = items.size();
+               GC gc = new GC(parent.getDisplay(), SWT.NONE);
+               for (int i = 0; i < size; i++) {
+                       Point p = gc.textExtent(items.get(i), SWT.DRAW_MNEMONIC);
+                       if (p.x > maxWidth) {
+                               maxWidth = p.x;
+                       }
+               }
+
+               maxWidth += 10;
+               gc.dispose();
+
+               return maxWidth;
+       }
+
+       public void open() {
+               popupShell = new Shell(parent.getParentShell(), SWT.ON_TOP);
+               popupShell.setLayout(new FormLayout());
+
+               Point p = parent.toDisplay(0, 0);
+               Rectangle rect = parent.getBounds();
+               ArrayList<String>items = parent.getItemArray();
+
+               int textWidth = getShellWidth() + 4;
+               int shellWidth = (textWidth > rect.width) ? textWidth : rect.width;
+               int height = 0;
+
+               if (parent.getItemHeight() == 0) {
+                       height = rect.height;
+               } else {
+                       height = parent.getItemHeight();
+               }
+
+               int shellHeight = height * items.size() + 5;
+
+               popupShell.setSize(shellWidth, shellHeight);
+               popupShell.setLocation(p.x, p.y + rect.height);
+
+               popupCanvas = new Canvas(popupShell, SWT.DOUBLE_BUFFERED);
+               popupCanvas.setData(this);
+               popupCanvas.setBackground(ColorResources.WHITE.getColor());
+               popupCanvas.addPaintListener(paintListener);
+               popupCanvas.addDisposeListener(disposeListener);
+       
+               popupCanvas.addListener(SWT.MouseUp, popupMouseEventListener);
+               popupCanvas.addListener(SWT.MouseMove, popupMouseEventListener);
+               popupCanvas.addListener(SWT.FocusOut, popupMouseEventListener);
+               popupCanvas.addListener(SWT.MouseUp, popupSelectionListener);
+
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 0);
+               data.left = new FormAttachment(0, 0);
+               data.right = new FormAttachment(100, 0);
+               data.height = shellHeight - 2;
+               popupCanvas.setLayoutData(data);
+
+               itemRects.clear();
+               Rectangle re;
+               for (int i = 0; i < items.size(); i++) {
+                       re = new Rectangle(2, 2 + i * height, shellWidth - 2, height);
+                       itemRects.add(re);
+               }
+
+               popupShell.open();
+       }
+
+       private Listener popupMouseEventListener = new Listener() {
+               @Override
+               public void handleEvent(Event event) {
+                       switch(event.type) {
+                       case SWT.MouseMove:
+                               Rectangle rect;
+                               for (int i = 0; i < itemRects.size(); i++) {
+                                       rect = itemRects.get(i);
+                                       if (rect.contains(event.x, event.y)) {
+                                               parent.setIndex(i);
+                                               popupCanvas.redraw();
+                                               break;
+                                       }
+                               }
+                               break;
+                       case SWT.FocusOut:
+                               dispose();
+                               break;
+                       case SWT.MouseUp:
+                               parent.select(parent.getSelectionIndex());
+                               parent.redraw();
+                               dispose();
+                               break;
+                       default:
+                                       break;
+                       }
+                       
+               }
+       };
+
+       private Listener popupSelectionListener = new Listener() {
+               @Override
+               public void handleEvent(Event event) {
+                       if (event.type == SWT.MouseUp) {
+                               for (SelectionListener listener : SelectionListenerList) {
+                                       listener.widgetSelected(new SelectionEvent(event));
+                               }
+                       }
+               }
+       };
+
+       private ArrayList<SelectionListener> SelectionListenerList
+               = new ArrayList<SelectionListener>();
+
+       public void addSelectionListener(SelectionListener listener) {
+               SelectionListenerList.add(listener);
+       }
+
+       public void removeSelectionListener(SelectionListener listener) {
+               SelectionListenerList.remove(listener);
+       }
+
+       public boolean isDispose() {
+               if (popupShell == null || popupShell.isDisposed()) {
+                       return true;
+               } else {
+                       return false;
+               }
+       }
+
+       public void dispose() {
+               popupShell.close();
+               popupShell = null;
+       }
+
+       private PaintListener paintListener = new PaintListener() {
+
+               @Override
+               public void paintControl(PaintEvent e) {
+                       ArrayList<String> items = parent.getItemArray();
+
+                       GC gc = e.gc;
+                       Rectangle rect = null;
+                       int selectedIndex = parent.getSelectionIndex();
+                       int size = itemRects.size();
+                       int totalHeight = 0;
+                       for (int i = 0; i < size; i++) {
+                               rect = itemRects.get(i);
+                               if (selectedIndex == i) {
+                                       gc.setBackground(ColorResources.COMBO_ITEM_SELECT_COLOR.getColor());
+                               } else {
+                                       gc.setBackground(ColorResources.COMBO_ITEM_NORMAL_COLOR.getColor());
+                               }
+                               gc.fillRectangle(rect);
+
+                               if (i != 0) {
+                                       gc.setForeground(ColorResources.COMBO_ITEM_SEPERATE_TOP_COLOR.getColor());
+                                       gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+                               }
+                               if (i != size - 1) {
+                                       gc.setForeground(ColorResources.COMBO_ITEM_SEPERATE_BOTTOM_COLOR.getColor());
+                                       gc.drawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width,
+                                                       rect.y + rect.height - 1);
+                               }
+
+                               gc.setForeground(ColorResources.COMBO_ITEM_FONT_COLOR.getColor());
+                               gc.setFont(FontResources.COMBO_BUTTON_FONT.getFont());
+
+                               int fontHeight = e.gc.getFontMetrics().getHeight();
+                               gc.drawText(items.get(i), 5, (rect.height - fontHeight) / 2 + totalHeight + 2, true);
+                               totalHeight += rect.height;
+                       }
+
+                       Rectangle clientRect= popupShell.getClientArea();
+                       gc.setForeground(ColorResources.COMBO_POPUP_OUTER_1_COLOR.getColor());
+                       gc.drawRectangle(clientRect);
+                       gc.setForeground(ColorResources.COMBO_POPUP_OUTER_2_COLOR.getColor());
+                       gc.drawRectangle(clientRect.x + 1,
+                                               clientRect.y + 1,
+                                               clientRect.width - 2,
+                                               clientRect.height - 2);
+               }
+       };
+
+       private DisposeListener disposeListener = new DisposeListener() {
+               @Override
+               public void widgetDisposed(DisposeEvent arg0) {
+                       WidgetHelper.tryDispose(popupCanvas, popupShell);
+                       for (Rectangle rect : itemRects) {
+                               WidgetHelper.tryDispose(rect);
+                       }
+               }
+       };
+}
index 90ed755..4a2f8ec 100644 (file)
@@ -1,30 +1,63 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
 
+import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.Color;
 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.Composite;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 
 public class ImageLabel extends Canvas{
-       public static final int STATE_ENABLE = 0;
-       public static final int STATE_DISABLE = 1;
-
-       private ImageLabelRenderer renderer = new ImageLabelDefaultRenderer();
-       private ImageLabelAttribute attr = new ImageLabelAttribute();
-
+       private WSTATE state = WSTATE.NORMAL;
+       private Image enableImage;
+       private Image disableImage;
+       private Font font;
+       private Color enableFontColor;
+       private Color disableFontColor;
+       private Point fontPoint;
+       private String text;
        public ImageLabel(Composite parent, int style) {
                super(parent, style);
-               attr.setState(STATE_ENABLE);
 
-               attr.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               attr.setFontColor(STATE_ENABLE, ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
-               attr.setFontColor(STATE_DISABLE, ColorResources.DETAIL_DISABLE_FONT_COLOR.getColor());
+               setFont(FontResources.DETAIL_LABEL_FONT.getFont());
+               setEnableFontColor(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
+               setDisableFontColor(ColorResources.DETAIL_DISABLE_FONT_COLOR.getColor());
 
                this.addPaintListener(labelPaintListener);
        }
@@ -33,64 +66,106 @@ public class ImageLabel extends Canvas{
 
                @Override
                public void paintControl(PaintEvent e) {
-                       renderer.draw(e.gc, (Canvas) e.widget, attr);
+                       Image image = (state == WSTATE.NORMAL
+                                       ? enableImage : disableImage);
+                       if (image == null) {
+                               return;
+                       }
+
+                       Rectangle rect = ((Canvas)e.widget).getClientArea();
+                       GC gc = e.gc;
+                       gc.drawImage(image, rect.x, rect.y);
+                       drawText(gc, rect);
+               }
+
+               private void drawText(GC gc, Rectangle rect) {
+                       Point p = null;
+
+                       if (text != null) {
+                               if (font == null) {
+                                       font = FontResources.DETAIL_LABEL_FONT.getFont();
+                                       setFont(font);
+                               }
+                               gc.setFont(font);
+                               gc.setForeground((state == WSTATE.NORMAL ? enableFontColor : disableFontColor));
+
+                               int x = 0, y = 0;
+                               int offset = 0;
+                               if (fontPoint == null) {
+                                       p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+                                       x = (rect.width - p.x) / 2;
+                                       y = (rect.height - p.y) / 2;
+                                       x = (x < 0) ? 0 : x;
+                                       offset = 0;
+                               } else {
+                                       x = fontPoint.x;
+                                       y = fontPoint.y;
+                               }
+
+                               gc.drawText(text, x + offset , y, true);
+                       }
                }
        };
 
        public void setText(String text) {
-               attr.setText(text);
+               this.text = text;
                this.redraw();
        }
 
        public String getText() {
-               return attr.getText();
+               return text;
        }
 
-       public void setImage(int state, Image img) {
-               attr.setImage(state, img);
+       public void setEnableImage(Image img) {
+               enableImage = img;
+               if (disableImage == null) {
+                       disableImage = img;
+               }
                this.setSize(img.getImageData().width, img.getImageData().height);
        }
 
-       public Image getImage(int state) {
-               return attr.getImage(state);
+       public void setDisableImage(Image img) {
+               disableImage = img;
+               if (enableImage == null) {
+                       enableImage = img;
+               }
+               this.setSize(img.getImageData().width, img.getImageData().height);
        }
 
        public void setFont(Font font) {
-               attr.setFont(font);
+               this.font = font;
        }
 
        public void setFontPoint(Point p) {
-               attr.setFontPoint(p);
+               fontPoint = p;
        }
 
-       public void setForeground (Color color) {
-               this.setFontColor(STATE_ENABLE, color);
-               this.setFontColor(STATE_DISABLE, color);
-               super.setForeground(color);
+       public void setEnabled(boolean enabled) {
+               if (enabled) {
+                       state = WSTATE.NORMAL;
+               } else {
+                       state = WSTATE.DISABLE;
+               }
+               this.redraw();
        }
 
-       public void setFontColor(int state, Color color) {
-               attr.setFontColor(state, color);
+       public boolean isEnabled() {
+               return state == WSTATE.NORMAL ? true : false;
        }
 
-       public void setRenderer(ImageLabelRenderer newRenderer) {
-               renderer = newRenderer;
+       public Color getEnableFontColor() {
+               return enableFontColor;
        }
 
-       public void setEnabled(boolean enabled) {
-               if (enabled) {
-                       changeState(STATE_ENABLE);
-               } else {
-                       changeState(STATE_DISABLE);
-               }
+       public void setEnableFontColor(Color enableFontColor) {
+               this.enableFontColor = enableFontColor;
        }
 
-       public boolean isEnabled() {
-               return attr.getState() == STATE_ENABLE ? true : false;
+       public Color getDisableFontColor() {
+               return disableFontColor;
        }
 
-       protected void changeState(int s) {
-               attr.setState(s);
-               this.redraw();
+       public void setDisableFontColor(Color disableFontColor) {
+               this.disableFontColor = disableFontColor;
        }
 }
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ImageLabelAttribute.java b/src/org/tizen/emulator/manager/ui/widgets/ImageLabelAttribute.java
deleted file mode 100644 (file)
index be9bc4c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.tizen.emulator.manager.ui.widgets;
-
-import java.util.ArrayList;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-
-public class ImageLabelAttribute {
-       private ArrayList<Color> fontColors = new ArrayList<Color>(5);
-       private ArrayList<Image> images = new ArrayList<Image>(5);
-       private int state;
-       private Font font;
-       private Point fontPoint;
-       private String text;
-
-       public ImageLabelAttribute() {
-               images.add(ImageLabel.STATE_ENABLE, null);
-               images.add(ImageLabel.STATE_DISABLE, null);
-
-               fontColors.add(ImageLabel.STATE_ENABLE, null);
-               fontColors.add(ImageLabel.STATE_DISABLE, null);
-       }
-
-       public void setImage(int state, Image image) {
-               images.add(state, image);
-       }
-
-       public Image getImage(int state) {
-               return images.get(state);
-       }
-
-       public void setFontColor(int state, Color color) {
-               fontColors.add(state, color);
-       }
-
-       public Color getFontColor(int state) {
-               return fontColors.get(state);
-       }
-
-       public Point getFontPoint() {
-               return fontPoint;
-       }
-
-       public void setFontPoint(Point fontPoint) {
-               this.fontPoint = fontPoint;
-       }
-
-       public String getText() {
-               return text;
-       }
-
-       public void setText(String text) {
-               this.text = text;
-       }
-
-       public int getState() {
-               return state;
-       }
-
-       public void setState(int state) {
-               this.state = state;
-       }
-
-       public Font getFont() {
-               return font;
-       }
-
-       public void setFont(Font font) {
-               this.font = font;
-       }
-}
\ No newline at end of file
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ImageLabelDefaultRenderer.java b/src/org/tizen/emulator/manager/ui/widgets/ImageLabelDefaultRenderer.java
deleted file mode 100644 (file)
index 0383619..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.tizen.emulator.manager.ui.widgets;
-
-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;
-
-public class ImageLabelDefaultRenderer extends ImageLabelRenderer{
-
-       @Override
-       public void draw(GC gc, Canvas canvas, ImageLabelAttribute attr) {              
-               Image image = attr.getImage(attr.getState());
-               if (null == image) {
-                       return;
-               }
-
-               Rectangle rect = canvas.getClientArea();
-               gc.drawImage(image, rect.x, rect.y);
-               drawText(gc, rect, attr);
-       }
-
-       public int computeFontSize(Rectangle rect) {
-               if (rect.height > 20)
-                       return 10;
-               else
-                       return 8;
-       }
-
-       protected void drawText(GC gc, Rectangle rect, ImageLabelAttribute attr) {
-               String text = attr.getText();
-               Font font = null;
-               Point p = null;
-
-               if (null != text) {
-                       if (null == (font = attr.getFont())) {
-                               font = new Font(Display.getCurrent(), "Arial",
-                                               computeFontSize(rect), SWT.BOLD);
-                               attr.setFont(font);
-                       }
-                       gc.setFont(font);
-                       gc.setForeground(attr.getFontColor(attr.getState()));
-
-                       int x = 0, y = 0;
-                       int offset = 0;
-                       if (null == (p = attr.getFontPoint())) {
-                               p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-                               x = (rect.width - p.x) / 2;
-                               y = (rect.height - p.y) / 2;
-                               x = (x < 0) ? 0 : x;
-                               offset = 0;
-                       } else {
-                               x = p.x;
-                               y = p.y;
-                       }
-
-                       gc.drawText(text, x + offset , y, true);
-               }
-       }
-
-}
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ImageLabelRenderer.java b/src/org/tizen/emulator/manager/ui/widgets/ImageLabelRenderer.java
deleted file mode 100644 (file)
index 02caf08..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.tizen.emulator.manager.ui.widgets;
-
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Canvas;
-
-public abstract class ImageLabelRenderer {
-       public abstract void draw(GC gc, Canvas canvas, ImageLabelAttribute attr);
-}
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ModifyViewCombo.java b/src/org/tizen/emulator/manager/ui/widgets/ModifyViewCombo.java
deleted file mode 100644 (file)
index cc2a8ed..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.tizen.emulator.manager.ui.widgets;
-
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.emulator.manager.da.widgets.combo.DACustomCombo;
-
-public class ModifyViewCombo extends DACustomCombo {
-
-       public ModifyViewCombo(Composite parent, int style) {
-               super(parent, style);
-               addPaintListener(comboPaintListener);
-       }
-
-       private PaintListener comboPaintListener = new PaintListener() {
-
-               @Override
-               public void paintControl(PaintEvent e) {
-                       if (!isImageCombo()) {
-                               comboRenderer.draw(e.gc, combo, getText(), state);
-                       } else {
-                               comboRenderer.drawImage(e.gc, combo,
-                                               buttonUp != null ? buttonUp : getImages().get(state), getText(),
-                                               state);
-                       }
-               }
-       };
-       
-}
diff --git a/src/org/tizen/emulator/manager/ui/widgets/ModifyViewComboRenderer.java b/src/org/tizen/emulator/manager/ui/widgets/ModifyViewComboRenderer.java
deleted file mode 100644 (file)
index b920028..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.tizen.emulator.manager.ui.widgets;
-
-import org.eclipse.swt.SWT;
-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.tizen.emulator.manager.da.widgets.combo.TitleComboRenderer;
-import org.tizen.emulator.manager.resources.ColorResources;
-import org.tizen.emulator.manager.resources.FontResources;
-
-public class ModifyViewComboRenderer extends TitleComboRenderer {
-       @Override
-       public void drawImage(GC gc, Canvas canvas, Image image, String text,
-                       int state) {
-               Rectangle rect = canvas.getClientArea();
-               gc.drawImage(canvas.getBackgroundImage(), rect.x, rect.y);
-               Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
-               gc.setFont(FontResources.DETAIL_LABEL_FONT.getFont());
-               gc.setForeground(ColorResources.DETAIL_ENABLE_FONT_COLOR.getColor());
-               gc.drawString(text, 5, (rect.height - p.y) / 2 + 2, true);
-               Rectangle clipping = new Rectangle(rect.x + rect.width - 19, rect.y,
-                               19, rect.height);
-               gc.setClipping(clipping);
-               gc.drawImage(canvas.getBackgroundImage(), rect.x, rect.y);
-               // image is drop down image
-               gc.drawImage(image, rect.x + rect.width - 12,
-                               rect.y + 7 /*(rect.height - image.getImageData().height)/2*/);
-       }
-}
index 829dbef..465c72a 100644 (file)
@@ -1,31 +1,32 @@
 /*
- * UI Builder
+ * Emulator Manager
  *
- * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
- * Changyeon Lee <changyeon.lee@samsung.com>
- * Gyeongmin Ju <gyeongmin.ju@samsung.com>
- * Hoon Kang <h245.kang@samsung.com>
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * 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.
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * 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.
  *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * 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.widgets;
 
 public interface ScrollbarScrolledListener {
index d311982..8f63c9c 100644 (file)
@@ -1,6 +1,43 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
 
+import java.util.ArrayList;
+
 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.Color;
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
@@ -10,23 +47,19 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Canvas;
 import org.eclipse.swt.widgets.Composite;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonAttribute;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonDefaultRenderer;
 import org.tizen.emulator.manager.logging.EMLogger;
 import org.tizen.emulator.manager.resources.ColorResources;
 import org.tizen.emulator.manager.resources.FontResources;
 import org.tizen.emulator.manager.resources.ImageResources;
-import org.tizen.emulator.manager.ui.VMButtonFactory;
 import org.tizen.emulator.manager.ui.VMsMainView;
+import org.tizen.emulator.manager.ui.list.VMButtonFactory;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
 
-public class VMButton extends DACustomButton {
+public class VMButton extends ImageButton {
        private VMButton button = null;
        private VMProperty property = null;
-       protected DACustomButton launchButton = null;
+       protected ImageButton launchButton = null;
 
        static int W_OFFSET = 2;
        static int H_OFFSET = 3;
@@ -37,38 +70,43 @@ public class VMButton extends DACustomButton {
                super(parent, style);
                button = this;
 
-               this.attr = new VMButtonAttribute();
-               this.setRenderer(new VMButtonRenderer());
-
-               // set font
-               this.setFontColors(ColorResources.VM_BUTTON_FONT_COLOR.getColor(),
-                               ColorResources.VM_BUTTON_FONT_COLOR.getColor(),
-                               ColorResources.VM_BUTTON_FONT_COLOR.getColor(),
-                               ColorResources.VM_BUTTON_FONT_COLOR.getColor());
-               this.setFont(FontResources.VM_BUTTON_FONT.getFont());
-
-               // set image
-               this.setImages(ImageResources.VM_IMAGE_NOMAL.getImage(),
-                               ImageResources.VM_IMAGE_NOMAL.getImage(),
-                               ImageResources.VM_IMAGE_HOVER.getImage(),
-                               null);
-
-               this.setBackground(ColorResources.LIST_BG_COLOR.getColor());
                this.setLayout(new FormLayout());
+               this.setPainListener(VMButtonPaintListener);
 
                settingLaunchButton();
        }
 
+       @Override
+       protected void initButton() {
+               images = new ArrayList<Image>();
+               colors = new ArrayList<Color>();
+               fontColors = new ArrayList<Color>();
+               fonts = new ArrayList<Font>();
+
+               for (WSTATE s : WSTATE.values()) {
+                       colors.add(s.getId(), ColorResources.LIST_BG_COLOR.getColor());
+                       fontColors.add(s.getId(), ColorResources.VM_BUTTON_FONT_COLOR.getColor());
+                       fonts.add(s.getId(), FontResources.VM_BUTTON_FONT.getFont());
+                       images.add(s.getId(), ImageResources.VM_IMAGE_NOMAL.getImage());
+               }
+
+               images.set(WSTATE.HOVER.getId(), ImageResources.VM_IMAGE_HOVER.getImage());
+               images.set(WSTATE.SELECTED_HOVER.getId(), ImageResources.VM_IMAGE_HOVER.getImage());
+               fontColors.set(WSTATE.SELECTED.getId(), ColorResources.BLUE.getColor());
+       }
+
        private void settingLaunchButton() {
-               // TODO
                Image image = ImageResources.BUTTON_LAUNCH_NOMAL.getImage();
                LAUNCH_BUTTON_WIDTH  = image.getImageData().width;
                LAUNCH_BUTTON_HEIGHT = image.getImageData().height;
-               launchButton = new DACustomButton(this,
-                               image,
-                               ImageResources.BUTTON_LAUNCH_PUSH.getImage(),
+               launchButton = new ImageButton(this, SWT.PUSH);
+
+               launchButton.setImages(image,
                                ImageResources.BUTTON_LAUNCH_HOVER.getImage(),
-                               image);
+                               ImageResources.BUTTON_LAUNCH_PUSH.getImage(),
+                               ImageResources.BUTTON_LAUNCH_PUSH.getImage(),
+                               image, image);
+
                FormData data = new FormData();
                data.top        = new FormAttachment(0, 119 + H_OFFSET);
                data.left       = new FormAttachment(0, 10 + W_OFFSET);
@@ -77,12 +115,20 @@ public class VMButton extends DACustomButton {
 
                launchButton.setLayoutData(data);
                launchButton.setToolTipText("Launch emulator");
-               launchButton.addClickListener(new DACustomButtonClickEventListener() {
+               launchButton.addSelectionListener(new SelectionListener() {
+
                        @Override
-                       public void handleClickEvent(DACustomButton button) {
+                       public void widgetSelected(SelectionEvent e) {
                                VMButtonFactory.clickVMButton(getThis());
                                clickLaunchButton();
                        }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+                       
                });
        }
 
@@ -104,81 +150,73 @@ public class VMButton extends DACustomButton {
                return button;
        }
 
-       public void setSelected(boolean selected) {
-               ((VMButtonAttribute)attr).setSelected(selected);
+       @Override
+       public void setSelection(boolean selected) {
+               super.setSelection(selected);
                if (selected && property != null) {
                        VMsMainView.getInstance().drawDetailVM(property, -1);
                }
        }
 
        public void setProperty(VMProperty property) {
-               ((VMButtonAttribute)attr).setProperty(property);
                this.property = property;
        }
-}
 
-class VMButtonRenderer extends DACustomButtonDefaultRenderer {
-       @Override
-       public void draw(GC gc, Canvas canvas, int state,
-                                       DACustomButtonAttribute attr) {
-               Rectangle rect = canvas.getClientArea();
+       public VMProperty getProperty() {
+               return property;
+       }
 
-               if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
-                       Image image = null;
-                       image = attr.getImage(state);
+       private PaintListener VMButtonPaintListener = new PaintListener() {
 
-                       if (null == image) {
+               @Override
+               public void paintControl(PaintEvent e) {
+                       Image image = images.get(state.getId());
+                       if (image == null) {
                                return;
                        }
 
-                       VMButtonAttribute vmAttr = (VMButtonAttribute)attr;
+                       Rectangle rect = ((Canvas) e.widget).getClientArea();
+                       GC gc = e.gc;
 
+                       gc.setBackground(colors.get(state.getId()));
+                       gc.fillRectangle(rect);
                        gc.drawImage(image, rect.x + VMButton.W_OFFSET, rect.y + VMButton.H_OFFSET);
-                       if (vmAttr.isSelected()) {
+                       if (isSelection()) {
                                gc.drawImage(ImageResources.VM_IMAGE_SELECTED.getImage(), rect.x, rect.y);
                        }
-                       drawButtonText(gc, rect, attr, state);
-               } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
-                               || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
-                       drawButton(gc, rect, state, attr);
+                       drawButtonText(gc, rect);
                }
-               drawButtonImage(gc, rect, attr);
-       }
 
-       private static int X_POINT = 40 + VMButton.W_OFFSET;
-       private static int Y_POINT = 27 + VMButton.H_OFFSET;
-       private static int Y_GAP = 23;
-       private static int RE_X_POINT = 16 + VMButton.W_OFFSET;
-       protected void drawButtonText(GC gc, Rectangle rect,
-                                                               DACustomButtonAttribute attr, int state) {
-               VMButtonAttribute vmAttr = (VMButtonAttribute)attr;
-               VMProperty property = vmAttr.getProperty();
-               if (property == null) {
-                       return;
-               }
-
-               int x = 0;
-               Point p         = null;
-               p = gc.textExtent(property.getName(), SWT.DRAW_MNEMONIC);
-               x = (rect.width - p.x) / 2;
+               private int X_POINT = 40 + VMButton.W_OFFSET;
+               private int Y_POINT = 27 + VMButton.H_OFFSET;
+               private int Y_GAP = 23;
+               private int RE_X_POINT = 16 + VMButton.W_OFFSET;
+               private void drawButtonText(GC gc, Rectangle rect) {
+                       VMProperty property = getProperty();
+                       if (property == null) {
+                               return;
+                       }
 
-               gc.setFont(FontResources.VM_BUTTON_TITLE_FONT.getFont());
-               gc.setForeground(attr.getFontColor(state));
+                       int x = 0;
+                       Point p         = null;
+                       p = gc.textExtent(property.getName(), SWT.DRAW_MNEMONIC);
+                       x = (rect.width - p.x) / 2;
 
-               if (vmAttr.isSelected()) {
-                       gc.setForeground(ColorResources.BLUE.getColor());
-               }
+                       // drawing Title
+                       gc.setFont(FontResources.VM_BUTTON_TITLE_FONT.getFont());
+                       gc.setForeground(fontColors.get(state.getId()));
+                       gc.drawString(property.getName(), x, 8, true);
 
-               gc.drawString(property.getName(), x, 8, true);
+                       // reset font coloer
+                       gc.setForeground(fontColors.get(WSTATE.NORMAL.getId()));
 
-               // reset font coloer
-               gc.setForeground(attr.getFontColor(state));
+                       VMPropertyValue value = property.getPropertyValue();
 
-               VMPropertyValue value = property.getPropertyValue();
-
-               gc.drawString(property.getArch().name(), X_POINT, Y_POINT, true);
-               gc.drawString(Integer.toString(value.ramSize), X_POINT, Y_POINT + Y_GAP * 2, true);
-               gc.drawString(Integer.toString(value.dpi), X_POINT, Y_POINT + Y_GAP, true);
-               gc.drawString(value.resolution.getStrValue(), RE_X_POINT, Y_POINT + Y_GAP * 3, true);
-       }
+                       gc.drawString(property.getArch().name(), X_POINT, Y_POINT, true);
+                       gc.drawString(Integer.toString(value.ramSize), X_POINT, Y_POINT + Y_GAP, true);
+                       gc.drawString(Integer.toString(value.dpi), X_POINT, Y_POINT + Y_GAP * 2, true);
+                       gc.drawString(value.resolution.getStrValue(), RE_X_POINT, Y_POINT + Y_GAP * 3, true);
+               }
+               
+       };
 }
\ No newline at end of file
diff --git a/src/org/tizen/emulator/manager/ui/widgets/VMButtonAttribute.java b/src/org/tizen/emulator/manager/ui/widgets/VMButtonAttribute.java
deleted file mode 100644 (file)
index d09c062..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.tizen.emulator.manager.ui.widgets;
-
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonAttribute;
-import org.tizen.emulator.manager.vms.VMProperty;
-
-public class VMButtonAttribute extends DACustomButtonAttribute{
-       private boolean selected = false;
-       private VMProperty property = null;
-
-       public boolean isSelected() {
-               return selected;
-       }
-       public void setSelected(boolean selected) {
-               this.selected = selected;
-       }
-       public VMProperty getProperty() {
-               return property;
-       }
-       public void setProperty(VMProperty property) {
-               this.property = property;
-       }
-}
diff --git a/src/org/tizen/emulator/manager/ui/widgets/VMButtonClickEventListener.java b/src/org/tizen/emulator/manager/ui/widgets/VMButtonClickEventListener.java
deleted file mode 100644 (file)
index 1f84828..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.tizen.emulator.manager.ui.widgets;
-
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Event;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButton;
-import org.tizen.emulator.manager.da.widgets.button.DACustomButtonClickEventListener;
-
-public abstract class VMButtonClickEventListener extends DACustomButtonClickEventListener{
-       @Override
-       public void handleEvent(Event event) {
-               DACustomButton button = (DACustomButton) event.widget;
-               if (null != button && button.getState() != DACustomButton.STATE_DISABLE) {
-                       Rectangle rectangle = button.getBounds();
-                       int x = event.x;
-                       int y = event.y;
-
-                       if (x < 0 || x > rectangle.width || y < 0 || y > rectangle.height) {
-                               return;
-                       } else {
-                               // -> open detail view
-                               // -> start emulator
-                               /*
-                               if ((x > 33 && x < 73) && (y > 118 && y < 133)) {
-                                       //new MessageDialog().openInfoDialog("TEST");
-                               } else {
-                                       
-                               }
-                               */
-                       }
-               } else {
-                       return;
-               }
-
-               handleClickEvent(button);
-       }
-}
\ No newline at end of file
diff --git a/src/org/tizen/emulator/manager/ui/widgets/WSTATE.java b/src/org/tizen/emulator/manager/ui/widgets/WSTATE.java
new file mode 100644 (file)
index 0000000..b78ff64
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
+
+public enum WSTATE {
+       NORMAL(0),
+       HOVER(1),
+       PUSH(2),
+       SELECTED(3),
+       SELECTED_HOVER(4),
+       DISABLE(5);
+
+       private int id;
+       WSTATE(int id) {
+               this.id = id;
+       }
+
+       public int getId() {
+               return id;
+       }
+
+}
diff --git a/src/org/tizen/emulator/manager/ui/widgets/WidgetHelper.java b/src/org/tizen/emulator/manager/ui/widgets/WidgetHelper.java
new file mode 100644 (file)
index 0000000..81e2fb9
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.widgets;
+
+import org.eclipse.swt.widgets.Widget;
+
+class WidgetHelper {
+       public static void tryDispose(final Object... Disposables) {
+               if (null == Disposables) {
+                       return;
+               }
+
+               for (Object obj : Disposables) {
+                       if (null == obj) {
+                               continue;
+                       }
+                       if (obj instanceof Widget) {
+                               ((Widget) obj).dispose();
+                       }
+               }
+       }
+}
index ba0ceb8..c336fd2 100644 (file)
@@ -36,7 +36,7 @@ import java.util.List;
 
 import org.tizen.emulator.manager.platform.Skin;
 import org.tizen.emulator.manager.platform.SkinList;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
 import org.tizen.emulator.manager.vms.xml.ObjectFactory;
@@ -52,7 +52,7 @@ public class Creator {
                this.property = EmulatorVMList.getInstance().getNewProperty(newVM.vmsName);
                this.newVM = newVM;
 
-               this.folder = new File(FilePath.getInstance().getVirtualTargetPath(newVM.vmsName));
+               this.folder = new File(FilePathResouces.getInstance().getVirtualTargetPath(newVM.vmsName));
        }
        
        public VMProperty createInternal() throws VMWorkerException {
@@ -73,7 +73,7 @@ public class Creator {
                        throw e;
                }
 
-               File log = new File(FilePath.getInstance().getVirtualTargetLogPath(newVM.vmsName));
+               File log = new File(FilePathResouces.getInstance().getVirtualTargetLogPath(newVM.vmsName));
                log.mkdir();
 
                settingProperty();
@@ -120,7 +120,7 @@ public class Creator {
 
                createInitialVMImageInternal(newVM.baseImagePath, customPath);
 
-               String swap_base_path   = FilePath.getInstance().getSwapPath() + File.separator + StringResources.SWAP_IMAGE;
+               String swap_base_path   = FilePathResouces.getInstance().getSwapPath() + File.separator + StringResources.SWAP_IMAGE;
                if (!new File(swap_base_path).exists()) {
                        return;
                }
@@ -130,7 +130,7 @@ public class Creator {
        }
 
        private void createSwapImageInternal(String basePath, String targetPath) throws VMCreatorException {
-               String exe_path         = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
+               String exe_path         = FilePathResouces.getInstance().getBinPath() + File.separator + "qemu-img";
 
                List<String> cmd = new ArrayList<String>();
                cmd.add(exe_path);
@@ -144,12 +144,12 @@ public class Creator {
                if (!new QemuImgProc(cmd).Running()) {
                        throw new VMCreatorException("Failed to create the VM because of failed qemu-img processing.\n"
                                        + "You can get more information in log file ("
-                                       + FilePath.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
+                                       + FilePathResouces.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
                }
        }
 
        private void checkCustomBaseImage(final String path) throws VMCreatorException {
-               String exe_path = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
+               String exe_path = FilePathResouces.getInstance().getBinPath() + File.separator + "qemu-img";
 
                List<String> cmd = new ArrayList<String>();
                cmd.add(exe_path);
@@ -163,7 +163,7 @@ public class Creator {
        }
 
        public void createInitialVMImageInternal(String baseImagePath, String targetImagePath) throws VMCreatorException {
-               String exe_path = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
+               String exe_path = FilePathResouces.getInstance().getBinPath() + File.separator + "qemu-img";
 
                List<String> cmd = new ArrayList<String>();
                cmd.add(exe_path);
@@ -177,7 +177,7 @@ public class Creator {
                if (!new QemuImgProc(cmd).Running()) {
                        throw new VMCreatorException("Failed to create the VM because of failed qemu-img processing.\n"
                                        + "You can get more information in log file ("
-                                       + FilePath.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
+                                       + FilePathResouces.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
                }
        }
 
index 3390216..d4d4afb 100644 (file)
@@ -46,7 +46,7 @@ import javax.xml.bind.Unmarshaller;
 import javax.xml.transform.stream.StreamSource;
 
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
 import org.tizen.emulator.manager.vms.xml.ObjectFactory;
@@ -96,7 +96,7 @@ public class EmulatorVMList {
        public void setVMsBaseDirectory(String baseVMsDir) {
                vmsBaseDirectoryName = baseVMsDir;
                vmsConfigDirectory = vmsBaseDirectoryName + File.separator + "vms";
-               FilePath.setVMSPath();
+               FilePathResouces.setVMSPath();
        }
 
        public String getTizenSdkDataPath() {
@@ -239,7 +239,7 @@ public class EmulatorVMList {
        }
 
        public VMProperty getNewProperty(String name) {
-               String configDirectoryName = FilePath.getInstance().getTizenVmsPath() + File.separator + name;
+               String configDirectoryName = FilePathResouces.getInstance().getTizenVmsPath() + File.separator + name;
                String configFilename = configDirectoryName + File.separator + StringResources.PROPERTY_XML_NAME;
 
                File configFile = new File(configFilename);
index 79b1575..0db087f 100644 (file)
@@ -41,7 +41,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.CheckVirtualization;
 import org.tizen.emulator.manager.tool.PortHelper;
@@ -133,7 +133,7 @@ public class Launcher {
                        logger.log(Level.INFO, String.format("MAC set as default = %s", macAddr));
                }
 
-               FilePath fio = FilePath.getInstance();
+               FilePathResouces fio = FilePathResouces.getInstance();
                if (path == null || path.isEmpty()) {
                        cmd.add(fio.getBinPath() + File.separator + binary);
                } else {
@@ -397,7 +397,7 @@ public class Launcher {
        }
 
        public Process launch(List<String> cmd) {
-               FilePath fio = FilePath.getInstance();
+               FilePathResouces fio = FilePathResouces.getInstance();
                ProcessBuilder pb = new ProcessBuilder(cmd);
                
                if (this.binPath == null || this.binPath.isEmpty()) {
index 991f683..0fe1771 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.vms;
 
 import java.io.BufferedReader;
index 5ae4924..9c13571 100644 (file)
@@ -37,7 +37,7 @@ import java.util.List;
 import java.util.logging.Level;
 
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 
 public class QemuImgProc {
        private List<String> cmd = null;
@@ -53,7 +53,7 @@ public class QemuImgProc {
 
                isError  = false;
                ProcessBuilder pb = new ProcessBuilder(cmd);
-               pb.directory(new File(FilePath.getInstance().getBinPath()));
+               pb.directory(new File(FilePathResouces.getInstance().getBinPath()));
                try {
                        Process process = pb.start();
                        if (process != null) {
@@ -116,7 +116,7 @@ public class QemuImgProc {
                                                                "Error while running 'qemu-img'. Exit value : " + process.exitValue());
                                                errorMsg = "Error while running 'qemu-img'. Exit value : " + process.exitValue() +
                                                                "\nYou can get more information in log file ("
-                                                               + FilePath.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)";
+                                                               + FilePathResouces.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)";
                                        }
                                } catch (InterruptedException e) {
                                        isError  = true;
@@ -141,7 +141,7 @@ public class QemuImgProc {
 
                isError  = false;
                ProcessBuilder pb = new ProcessBuilder(cmd);
-               pb.directory(new File(FilePath.getInstance().getBinPath()));
+               pb.directory(new File(FilePathResouces.getInstance().getBinPath()));
                try {
                        Process process = pb.start();
                        if (process != null) {
index 5bee1e6..0688b26 100644 (file)
@@ -1,3 +1,32 @@
+/*
+ * Emulator Manager
+ *
+ * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * JiHye Kim <jihye1128.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@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.vms;
 
 public enum SKIN_TYPE {
index 82534dc..910ac5c 100644 (file)
@@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.logging.EMLogger;
-import org.tizen.emulator.manager.resources.FilePath;
+import org.tizen.emulator.manager.resources.FilePathResouces;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.ui.MenuHandling;
 import org.tizen.emulator.manager.ui.dialog.MessageDialog;
@@ -91,7 +91,7 @@ public class VMWorker {
                                                                + "File does not exist :" + baseImage.getAbsolutePath());
                }
 
-               String exe_path = FilePath.getInstance().getBinPath() + File.separator + "qemu-img";
+               String exe_path = FilePathResouces.getInstance().getBinPath() + File.separator + "qemu-img";
 
                List<String> cmd = new ArrayList<String>();
                cmd.add(exe_path);
@@ -128,7 +128,7 @@ public class VMWorker {
                                        throw new VMWorkerException("Failed to create new base image becauese of failed qemu-img processing!"
                                                        + StringResources.NEW_LINE
                                                        + "You can get more information in log file ("
-                                                       + FilePath.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
+                                                       + FilePathResouces.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
                                }
                        }
                } else {
@@ -142,7 +142,7 @@ public class VMWorker {
                                        throw new VMWorkerException("Failed to create new base image becauese of failed qemu-img processing!"
                                                        + StringResources.NEW_LINE
                                                        + "You can get more information in log file ("
-                                                       + FilePath.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
+                                                       + FilePathResouces.getInstance().getTizenVmsPath() +  File.separator + "emulator-manager)");
                                }
                        }
                }
@@ -228,7 +228,7 @@ public class VMWorker {
                }
 
                if (property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage() != null) {
-                       String swapBasePath = FilePath.getInstance().getSwapPath() + File.separator + StringResources.SWAP_IMAGE;
+                       String swapBasePath = FilePathResouces.getInstance().getSwapPath() + File.separator + StringResources.SWAP_IMAGE;
                        String swapTargetPath = property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage().getValue();
                        if (!new File(swapBasePath).exists()) {
                                return;