[Title] First full icon set is introduced
authorsyeon.hwang <syeon.hwang@samsung.com>
Mon, 19 Mar 2012 07:27:43 +0000 (16:27 +0900)
committersyeon.hwang <syeon.hwang@samsung.com>
Mon, 19 Mar 2012 07:27:43 +0000 (16:27 +0900)
[Type]
[Module] Emulator/
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

15 files changed:
resource/res/cancel.png [new file with mode: 0644]
resource/res/confirm.png [new file with mode: 0644]
resource/res/create.png [new file with mode: 0644]
resource/res/delete.png [new file with mode: 0644]
resource/res/details.png [new file with mode: 0644]
resource/res/folder.gif [deleted file]
resource/res/folder.png [new file with mode: 0644]
resource/res/launch.png [new file with mode: 0644]
resource/res/modify.png [new file with mode: 0644]
resource/res/refresh.png [new file with mode: 0644]
resource/res/reset.png [new file with mode: 0644]
src/org/tizen/emulator/manager/EmulatorManager.java
src/org/tizen/emulator/manager/ui/MainDialog.java
src/org/tizen/emulator/manager/ui/ResourceRegistry.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java

diff --git a/resource/res/cancel.png b/resource/res/cancel.png
new file mode 100644 (file)
index 0000000..aba1fb6
Binary files /dev/null and b/resource/res/cancel.png differ
diff --git a/resource/res/confirm.png b/resource/res/confirm.png
new file mode 100644 (file)
index 0000000..3df8afc
Binary files /dev/null and b/resource/res/confirm.png differ
diff --git a/resource/res/create.png b/resource/res/create.png
new file mode 100644 (file)
index 0000000..a92dc40
Binary files /dev/null and b/resource/res/create.png differ
diff --git a/resource/res/delete.png b/resource/res/delete.png
new file mode 100644 (file)
index 0000000..eb18912
Binary files /dev/null and b/resource/res/delete.png differ
diff --git a/resource/res/details.png b/resource/res/details.png
new file mode 100644 (file)
index 0000000..214d50e
Binary files /dev/null and b/resource/res/details.png differ
diff --git a/resource/res/folder.gif b/resource/res/folder.gif
deleted file mode 100755 (executable)
index ab20874..0000000
Binary files a/resource/res/folder.gif and /dev/null differ
diff --git a/resource/res/folder.png b/resource/res/folder.png
new file mode 100644 (file)
index 0000000..3a6ebd1
Binary files /dev/null and b/resource/res/folder.png differ
diff --git a/resource/res/launch.png b/resource/res/launch.png
new file mode 100644 (file)
index 0000000..83405f9
Binary files /dev/null and b/resource/res/launch.png differ
diff --git a/resource/res/modify.png b/resource/res/modify.png
new file mode 100644 (file)
index 0000000..70bb11c
Binary files /dev/null and b/resource/res/modify.png differ
diff --git a/resource/res/refresh.png b/resource/res/refresh.png
new file mode 100644 (file)
index 0000000..4349b63
Binary files /dev/null and b/resource/res/refresh.png differ
diff --git a/resource/res/reset.png b/resource/res/reset.png
new file mode 100644 (file)
index 0000000..f69fe0b
Binary files /dev/null and b/resource/res/reset.png differ
index dcf26e5..cb0c95c 100644 (file)
@@ -80,7 +80,9 @@ public class EmulatorManager {
                Launcher.launch(property);
        }
 
-       private void dispose(){
+       private void dispose() {
+               mainDialog.dispose();
+               
                if(icon != null)
                        icon.dispose();
        }
index b640102..995d1d6 100644 (file)
@@ -18,11 +18,12 @@ import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.tool.Launcher;
+import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
+import org.tizen.emulator.manager.ui.detail.DetailTableView;
 import org.tizen.emulator.manager.ui.vmstree.VMsTable;
 import org.tizen.emulator.manager.vms.EmulatorVMs;
 import org.tizen.emulator.manager.vms.VMsProperty;
 import org.tizen.emulator.manager.vms.VMsProperty.Architecture;
-import org.tizen.emulator.manager.ui.detail.DetailTableView;
 
 public class MainDialog {
        private static String Launch  = "Launch";
@@ -124,6 +125,7 @@ public class MainDialog {
 
                                Button refreshButton = new Button(buttonComposite, SWT.PUSH);
                                refreshButton.setText("Refresh");
+                               refreshButton.setImage(ResourceRegistry.getImage(ImageName.REFRESH));
                                refreshButton.addSelectionListener(new SelectionListener() {
                                        @Override
                                        public void widgetSelected(SelectionEvent e) {
@@ -135,6 +137,7 @@ public class MainDialog {
 
                                deleteButton = new Button(buttonComposite, SWT.PUSH);
                                deleteButton.setText("Delete");
+                               deleteButton.setImage(ResourceRegistry.getImage(ImageName.DELETE));
                                deleteButton.addSelectionListener(new SelectionListener() {
                                        @Override
                                        public void widgetSelected(SelectionEvent e) {
@@ -149,6 +152,7 @@ public class MainDialog {
 
                                resetButton = new Button(buttonComposite, SWT.PUSH);
                                resetButton.setText("Reset");
+                               resetButton.setImage(ResourceRegistry.getImage(ImageName.RESET));
                                //TODO
                                resetButton.setEnabled(false);
                        }
@@ -281,7 +285,9 @@ public class MainDialog {
                //resetButton.setEnabled(true);
 
                leftButton.setText(Launch);
+               leftButton.setImage(ResourceRegistry.getImage(ImageName.LAUNCH));
                rightButton.setText(Modify);
+               rightButton.setImage(ResourceRegistry.getImage(ImageName.MODIFY));
                leftButton.setEnabled(true);
                rightButton.setEnabled(true);
 
@@ -305,7 +311,10 @@ public class MainDialog {
                //resetButton.setEnabled(false);
 
                leftButton.setText(Confirm);
+               leftButton.setImage(ResourceRegistry.getImage(ImageName.CONFIRM));
+
                rightButton.setText(Cancel);
+               rightButton.setImage(ResourceRegistry.getImage(ImageName.CANCEL));
 
                detailView.openModifyView(property);
        }
@@ -316,7 +325,10 @@ public class MainDialog {
                //resetButton.setEnabled(false);
 
                leftButton.setText(Launch);
+               leftButton.setImage(ResourceRegistry.getImage(ImageName.LAUNCH));
                rightButton.setText(Create);
+               rightButton.setImage(ResourceRegistry.getImage(ImageName.CREATE));
+
                leftButton.setEnabled(false);
                rightButton.setEnabled(true);
 
@@ -330,7 +342,9 @@ public class MainDialog {
                //resetButton.setEnabled(false);
 
                leftButton.setText(Launch);
+               leftButton.setImage(ResourceRegistry.getImage(ImageName.LAUNCH));
                rightButton.setText(Create);
+               rightButton.setImage(ResourceRegistry.getImage(ImageName.CREATE));
 
                detailView.openCreateDetailView();
        }
@@ -341,8 +355,14 @@ public class MainDialog {
                //resetButton.setEnabled(false);
 
                leftButton.setText(Confirm);
+               leftButton.setImage(ResourceRegistry.getImage(ImageName.CONFIRM));
                rightButton.setText(Cancel);
+               rightButton.setImage(ResourceRegistry.getImage(ImageName.CANCEL));
 
                detailView.openCreateView(rightButton, leftButton);
        }
+
+       public void dispose() {
+               ResourceRegistry.dispose();
+       }
 }
diff --git a/src/org/tizen/emulator/manager/ui/ResourceRegistry.java b/src/org/tizen/emulator/manager/ui/ResourceRegistry.java
new file mode 100644 (file)
index 0000000..fdaf1f0
--- /dev/null
@@ -0,0 +1,58 @@
+package org.tizen.emulator.manager.ui;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.graphics.Image;
+import org.tizen.emulator.manager.EmulatorManager;
+
+public class ResourceRegistry {
+       public enum ImageName {
+               CANCEL("cancel"), CONFIRM("confirm"), CREATE("create"), DELETE("delete"), DETAILS("details"),
+               FOLDER("folder"), MODIFY("modify"), REFRESH("refresh"), RESET("reset"), LAUNCH("launch");
+               
+               String name;
+               
+               ImageName(String name) {
+                       this.name = name;
+               }
+               
+               @Override
+               public String toString() {
+                       return name;
+               }
+       }
+       
+       private static ResourceRegistry instance;
+       
+       Map<ImageName, Image> imagesMap = new HashMap<ImageName, Image>();
+
+       static {
+               synchronized(ResourceRegistry.class) {
+                       instance = new ResourceRegistry();
+                       
+                       ClassLoader loader = ResourceRegistry.class.getClassLoader();
+                       
+                       InputStream is = null;
+                       
+                       for(ImageName imageName : ImageName.values()) {
+                               is = loader.getResourceAsStream("res/" + imageName.toString() + ".png");
+                               if(is != null)
+                                       instance.imagesMap.put(imageName, new Image(EmulatorManager.getInstance().getDisplay(), is));
+                       }
+               }
+       }
+       
+       public static Image getImage(ImageName imageName) {
+               return instance.imagesMap.get(imageName);
+       }
+       
+       public static void dispose() {
+               for(Image image : instance.imagesMap.values()) {
+                       image.dispose();
+               }
+       }
+       
+       private ResourceRegistry() {}
+}
index 6f4d015..fef0dd1 100644 (file)
@@ -1,7 +1,6 @@
 package org.tizen.emulator.manager.ui.detail;
 
 import java.io.File;
-import java.io.InputStream;
 import java.util.ArrayList;
 
 import org.eclipse.swt.SWT;
@@ -21,7 +20,8 @@ import org.eclipse.swt.widgets.Spinner;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableItem;
 import org.eclipse.swt.widgets.Text;
-import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.ui.ResourceRegistry;
+import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
 import org.tizen.emulator.manager.vm.VMCreateHelper;
 import org.tizen.emulator.manager.vm.VMProcess;
 import org.tizen.emulator.manager.vm.VMPropertyValue;
@@ -67,10 +67,11 @@ public class VMPropertyView {
                this.widget     = new VMViewWidget();
                this.table              = table;
 
-               InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("res/folder.gif");
-               if(resourceAsStream != null)
-                       this.image  = new Image(EmulatorManager.getInstance().getDisplay(), resourceAsStream);
+//             InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("res/folder.png");
+//             if(resourceAsStream != null)
+//                     this.image  = new Image(EmulatorManager.getInstance().getDisplay(), resourceAsStream);
 
+               this.image = ResourceRegistry.getImage(ImageName.FOLDER);
                makeItemList();
        }