Ludwig Tietze před 7 roky
rodič
revize
b8b00127f4

+ 3 - 2
src/ui/view/AboutUsPopUp.java

@@ -52,8 +52,9 @@ public class AboutUsPopUp extends JFrame {
         contentPanel2.setLayout(new BoxLayout(contentPanel2, BoxLayout.Y_AXIS));
         contentPanel3.setLayout(new BoxLayout(contentPanel3, BoxLayout.Y_AXIS));
 
-        this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
-                .getScaledInstance(30, 30, Image.SCALE_SMOOTH));
+        //this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
+        //        .getScaledInstance(30, 30, Image.SCALE_SMOOTH));//TODO: and here...
+        this.setIconImage(Util.loadImage(this,"/Images/Dummy_House.png",30,30, Image.SCALE_SMOOTH));
         setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         setBounds(100, 100, 500, 800);
         setLocationRelativeTo(parentFrame);

+ 4 - 2
src/ui/view/AbstractCanvas.java

@@ -160,7 +160,8 @@ public abstract class AbstractCanvas extends JPanel {
         // node image
         if (cps instanceof CpsNode && (cps == tempCps || model.getSelectedCpsObject() == cps
                 || model.getSelectedCpsObjects().contains(cps) || tempSelected.contains(cps))) {
-            img = new ImageIcon(this.getClass().getResource("/Images/node_selected.png")).getImage();
+            //img = new ImageIcon(this.getClass().getResource("/Images/node_selected.png")).getImage();//TODO: YOU AND YOUR GOD DAMN GETRESOURCE
+        	img = Util.loadImage(this, "/Images/node_selected.png");
         } else {
             if (cps instanceof HolonSwitch) {
                 if (((HolonSwitch) cps).getActiveAt()[model.getCurIteration()]) {
@@ -203,7 +204,8 @@ public abstract class AbstractCanvas extends JPanel {
             if (checkPath.exists()) {
                 img = new ImageIcon(cps.getImage()).getImage();
             } else {
-                img = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage();
+                //img = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage();//TODO: again
+            	img = Util.loadImage(this, cps.getImage());
             }
         }
     }

+ 3 - 2
src/ui/view/AddElementPopUp.java

@@ -50,8 +50,9 @@ public class AddElementPopUp extends JDialog {
 	 */
 	AddElementPopUp(JFrame parentFrame) {
 		super((java.awt.Frame) null, true);
-		this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
-				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
+		//this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
+		//		.getScaledInstance(30, 30, Image.SCALE_SMOOTH));//TODO: and here
+		this.setIconImage(Util.loadImage(this,"/Images/Dummy_House.png",30,30, Image.SCALE_SMOOTH));
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
 		setBounds(100, 100, 400, 190);
 		setLocationRelativeTo(parentFrame);

+ 5 - 3
src/ui/view/AddObjectPopUp.java

@@ -71,8 +71,9 @@ public class AddObjectPopUp extends JDialog {
     AddObjectPopUp(boolean edit, AbstractCpsObject obj, String cat, JFrame parentFrame) {
         toEdit = obj;
 		editState = edit;
-		this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
-				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
+		//this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
+		//		.getScaledInstance(30, 30, Image.SCALE_SMOOTH));//TODO: and here...
+		this.setIconImage(Util.loadImage(this, "/Images/Dummy_House.png",30,30, Image.SCALE_SMOOTH));
 		setBounds(100, 100, 450, 342);
         setLocationRelativeTo(parentFrame);
         getContentPane().setLayout(new BorderLayout());
@@ -150,7 +151,8 @@ public class AddObjectPopUp extends JDialog {
 				if (checkPath.exists()) {
 					selectedFile = new File(obj.getImage());
 				} else {
-					selectedFile = new File(this.getClass().getResource(obj.getImage()).getFile());
+					//selectedFile = new File(this.getClass().getResource(obj.getImage()).getFile());//TODO: I might work around this find a more direct way.
+					selectedFile = Util.loadFile(this,obj.getImage());
 				}
 				filePath = selectedFile.getAbsolutePath();
 				sourcePath.setText(filePath);

+ 3 - 2
src/ui/view/BackgroundPopUp.java

@@ -64,8 +64,9 @@ public class BackgroundPopUp extends JDialog {
 			imageWidth.setText("" + icon.getIconWidth());
 			imageHeight.setText("" + icon.getIconHeight());
 		}
-		this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
-				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
+		//this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
+		//		.getScaledInstance(30, 30, Image.SCALE_SMOOTH));//TODO: here again...
+		this.setIconImage(Util.loadImage(this,"/Images/Dummy_House.png",30,30, Image.SCALE_SMOOTH));
 		setBounds(100, 100, 600, 340);
         setLocationRelativeTo(parentFrame);
 

+ 3 - 2
src/ui/view/CanvasResizePopUp.java

@@ -38,8 +38,9 @@ public class CanvasResizePopUp extends JDialog {
 		this.canvas = canvas;
 
 		// properties and stuff
-		this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
-				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
+		//this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
+		//		.getScaledInstance(30, 30, Image.SCALE_SMOOTH));//TODO: and again...
+		this.setIconImage(Util.loadImage(this,"/Images/Dummy_House.png",30,30, Image.SCALE_SMOOTH));
 		this.setTitle("Set the Size of the View");
 		setBounds(200, 100, 200, 100);
         setLocationRelativeTo(parentFrame);

+ 17 - 13
src/ui/view/GUI.java

@@ -560,9 +560,10 @@ public class GUI implements CategoryListener {
 
         frmCyberPhysical.setJMenuBar(menuBar);
 
-        frmCyberPhysical.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
-                .getScaledInstance(30, 30, Image.SCALE_SMOOTH));
-
+       // frmCyberPhysical.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
+       //         .getScaledInstance(30, 30, Image.SCALE_SMOOTH));//TODO: Fix here
+        frmCyberPhysical.setIconImage(Util.loadImage(this,"/Images/Dummy_House.png",30,30,Image.SCALE_SMOOTH));
+        		
         menuBar.add(mnNewMenu);
 
         mnNewMenu.add(mntmNew);
@@ -1247,13 +1248,14 @@ public class GUI implements CategoryListener {
                         for (AbstractCpsObject cps : cat.getObjects()) {
                             if (value.toString().compareTo(cps.getObjName()) == 0) {
                                 File checkPath = new File(cps.getImage());
-                                if (checkPath.exists()) {
-                                    imgR = new ImageIcon(cps.getImage()).getImage().getScaledInstance(50, 50,
-                                            java.awt.Image.SCALE_SMOOTH);
-                                } else {
-                                    imgR = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage()
-                                            .getScaledInstance(50, 50, java.awt.Image.SCALE_SMOOTH);
-                                }
+                                //if (checkPath.exists()) {
+                                //    imgR = (cps.getImage()).getImage().getScaledInstance(50, 50,
+                                //            java.awt.Image.SCALE_SMOOTH);//TODO: fix here
+                                //} else {
+                                    //imgR = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage()
+                                    //        .getScaledInstance(50, 50, java.awt.Image.SCALE_SMOOTH);//TODO: fix here
+                                	imgR = Util.loadImage(this,cps.getImage(),50,50,java.awt.Image.SCALE_SMOOTH);
+                                //}//TODO: Apparently this was a semi-fix by someone else?
                                 if (imgR != null) {
                                     label.setIcon(new ImageIcon(imgR));
                                 }
@@ -1270,7 +1272,8 @@ public class GUI implements CategoryListener {
                 if (label.getText().length() == 0) {
                     label.setText(value.toString());
                     if (value.toString().compareTo("Categories") != 0) {
-                        label.setIcon(new ImageIcon(this.getClass().getResource("/Images/folder.png")));
+                        //label.setIcon(new ImageIcon(this.getClass().getResource("/Images/folder.png")));//TODO: fix here
+                    	label.setIcon(new ImageIcon(Util.loadImage(this, "/Images/folder.png")));
                     }
                 }
 
@@ -1394,8 +1397,9 @@ public class GUI implements CategoryListener {
                                         img = new ImageIcon(cps.getImage()).getImage().getScaledInstance(32, 32,
                                                 java.awt.Image.SCALE_SMOOTH);
                                     } else {
-                                        img = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage()
-                                                .getScaledInstance(32, 32, java.awt.Image.SCALE_SMOOTH);
+                                        //img = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage()
+                                        //        .getScaledInstance(32, 32, java.awt.Image.SCALE_SMOOTH);//TODO: help me
+                                    	img = Util.loadImage(this,cps.getImage(),32,32, Image.SCALE_SMOOTH);
                                     }
                                     tempCps = cps;
                                     dragging = true;

+ 236 - 236
src/ui/view/Languages.java

@@ -1,236 +1,236 @@
-package ui.view;
-
-public class Languages {
-
-	static int languageVar = 0;
-
-	static String[] arrayEN = {
-			// ToolBar (0-16)
-			"File", "New", "Open", "Save", "Edit", "Undo", "Redo", "Find/Replace", "Edit showed Information", "Options",
-			"Reset Categories", "View", "View Size", "Help", "About Us", "Edit Edges", "Language",
-			// Tables (17-24)
-			"Object", "Nr.", "Device", "Energy", "Quantity", "Activated", "Field", "Information",
-			// Graph (25-26)
-			"None ", "Reset",
-			// Warning PopUps (27-30)
-			"Warning", "Do you want to save your current data?", "Do you really want to delete the Category ",
-			"Please select a Category or an Object in order to delete something.",
-			// Edit Edges Pop Up (31-34)
-			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel",
-			// Search/Replace Pop Up (35-45)
-			"Search for Objects", "Find", "Replace", "Direction", "Forward", "Backward", "Scope", "All", "Single",
-			"Replace All", "Close",
-			// Edit Edges Pop Up (46-55)
-			"Edit Capacities of Edges", "Maximum Capacity:", "Change for all existing Edges only",
-			"Change for new created Edges only", "Change for all existing and new created Edges", "Cancel",
-			"Please select one of the options",
-			"Please enter a number greater or equal 0 in the Field for Maximum Capacity", "Edit Edge Capacities",
-			"(enter \"infinite\" for infinite Capacity)",
-			// Add PopUp Tree (56-63)
-			"Please enter a Name for Category ", "Please select a Category first before adding ", "Add Object Menu",
-			"Name:", "Browse Image", "Add Element", "Delete Element", "Cancel",
-			// Add PopUp Element (64-71)
-			"Add Element to Object", "Element Name:", "Provided Energy:", "Amount:",
-			"Please enter numbers in the Fields amount and Energy", "No name", "Name already given", "Cancel",
-			// Info for PropertyTable (72-82)
-			"Name", "Total Energy", "Manual", "Active", " is connected to", " with ID: ", "Edge: ", " to ",
-			"Current flow", "Max. Capacity", "Status",
-			// Info SimulationMenu (83-87)
-			"Simulate", "Simulation Speed:", "Algorithm:", "non selected", "success",
-			// Exit Pop Up (88)
-			"Are you sure you want to exit?",
-			// Simulation ToolTip (89-93)
-			"Play", "Reset", "Forward", "Backward", "Time Slider",
-			// Image Size Slider (94)
-			"Image Size",
-			// Menu - right click on HolonObjt (95-102)
-			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack"};
-
-	static String[] arrayES = {
-			// ToolBar (0-16)
-			"Archivo", "Nuevo", "Abrir", "Guardar", "Editar", "Deshacer", "Rehacer", "Buscar/Reemplazar",
-			"Editar Información a mostrar", "Opciones", "Resetear Categorias", "Vista", "Tamaño de Vista", "Ayuda",
-			"Sobre Nosotros", "Editar Conexiones", "Idiomas",
-			// Tables (17-24)
-			"Objeto", "Nr.", "Equipo", "Enegia", "Cantidad", "Activo", "Campo", "Información",
-			// Graph (25-26)
-			"Vacio ", "Resetear",
-			// Warning PopUps(27-30)
-			"Atención", "Desea guardar su progreso?", "Esta seguro que quiere eliminar la categoría ",
-			"Por favor, seleccione una categoria o un objecto para poder proceder a eliminarlo.",
-			// Edit Edges Pop Up (31-34)
-			"Editar información a mostrar", "Mostrar energia total de los objetos",
-			"Mostrar propiedades de las conexiones", "Cancelar",
-			// Search/Replace Pop Up (35-45)
-			"Buscar Objetos", "Buscar", "Reemplazar", "Dirección", "Adelante", "Atrás", "Alcance", "Todo", "Uno",
-			"Reemplazar Todo", "Cerrar",
-			// Edit Edges Pop Up (46-55)
-			"Editar Capacidad de las Conexiones", "Capacidad Max.:", "Cambiar para todas las conexiones existentes",
-			"Cambiar solo para conexiones nuevas", "Cambiar para todas las conexiones existentes y nuevas", "Cancelar",
-			"Por favor, elija una de las opciones",
-			"Por favor, ingrese un valor mayor o igual a 0 en el campo de Capacidad Max.",
-			"Editar capacidad de las conexiones", "(ingresar \"infinite\" para capacidad infinita)",
-			// Add PopUp Tree (56-63)
-			"Por favor, ingrese el nombre de la categoria ", "Por favor, elija una categoria antes de agregar ",
-			"Menu para Agregar un Objeto", "Nombre:", "Buscar Imagen", "Agregar Elemento", "Eliminar Elemento",
-			"Cancelar",
-			// Add PopUp Element (64-71)
-			"Agregar Elemento al Objecto", "Nombre del El.:", "Energía:", "Cantidad:",
-			"Por favor, ingrese valores en los campos de cantidad y energía", "Sin nombre", "Nombre en uso", "Cancelar",
-			// Info for PropertyTable (72-82)
-			"Nombre", "Energia Total", "Manual", "Activo", " esta conectado a ", " con ID: ", "Canto: ", " a ",
-			"Corriente actual", "Capacidad Max.", "Estado",
-			// Info SimulationMenu (83-87)
-			"Simular", "Velocidad de Simulación:", "Algoritmo:", "nada seleccionado", "exito",
-			// Exit Pop Up (88)
-			"Esta seguro que quiere cerrar el programa?",
-			// Simulation ToolTip (89-93)
-			"Iniciar", "Resetear", "Adelante", "Atrás", "Linea de Tiempo",
-			// Image Size Slider (94)
-			"Tamaño de la Imagen",
-			// Menu - right click on HolonObjt (95-102)
-			"Cortar", "Copiar", "Pegar", "Eliminar", "Agrupar", "Desagrupar", "Rastrear", "Dejar de rastrear", };
-
-	static String[] arrayDE = {
-			// ToolBar (0-16)
-			"Datei", "Neu", "Öffnen", "Speichern", "Bearbeiten", "Rückgängig", "Wiederherstellen", "Suchen/Ersetzen",
-			"Gezeigte Informationen Ersetzen", "Optionen", "Kategorien Zurücksetzen", "Ansicht", "Ansichtsgröße",
-			"Hilfe", "Über Uns", "Kanten Bearbeiten", "Sprache",
-			// Tables (17-24)
-			"Objekt", "Nr.", "Geräte", "Energie", "Quantität", "Aktiviert", "Feld", "Information",
-			// Graph (25-26)
-			"Nichts ", "Zurücksetzen",
-			// Warning PopUps(27-30)
-			"Warnung", "Möchten Sie ihre aktuellen Daten speichern?", "Möchten Sie wirklich die Kategorie löschen ",
-			"Bitte wählen Sie eine Kategorie oder ein Objekt um etwas löschen zu können.",
-			// Edit Edges Pop Up (31-34)
-			"Gezeigte Informationen Ersetzen", "Gesamtenergie von Objekten zeigen", "Verbindungseigenschaften zeigen",
-			"Abbrechen",
-			// Search/Replace Pop Up (35-45)
-			"Objekte suchen", "Suchen", "Ersetzen", "Richtung", "Vorwärts", "Rückwerts", "Scope", "Alle", "Einzeln",
-			"Alle Ersetzen", "Schließen",
-			// Edit Edges Pop Up (46-55)
-			"Kapazitäten von Kanten bearbeiten", "Max. Kapazität:", "Nur für alle existierenden Kanten ändern",
-			"Nur für neu erstellte Kanten ändern", "Für alle existierenden und neuen Kanten ändern", "Abbrechen",
-			"Bitte wählen Sie eine der Optionen",
-			"Bitte geben Sie eine Zahl größer-gleich 0 im Feld für Maximale Kapazität ein",
-			"Kapazitäten von Kanten bearbeiten", "(geben Sie \"infinite\" für unbeschränkte Kapazitäten ein)",
-			// Add PopUp Tree (56-63)
-			"Bitte geben Sie einen Namen für die Kategorie ein ", "Bitte wählen Sie eine Kategorie vor dem hinzufügen ",
-			"Objekt Hinzufügen Menü", "Name:", "Bilder durchsuchen", "Element hinzufügen", "Element löschen",
-			"Abbrechen",
-			// Add PopUp Element (64-71)
-			"Element zu Objekt hinzufügen", "Element Name:", "Bereitgestellte Energie:", "Menge:",
-			"Bitte geben Sie Nummern in den Feldern für Menge und Energie ein", "Kein Name", "Name bereits vergeben",
-			"Abbrechen",
-			// Info for PropertyTable (72-82)
-			"Name", "Gesamte Energie", "Manuell", "Aktive", " ist verbunden mit", " mit ID: ", "Kante: ", " nach ",
-			"aktueller Fluss", "Max. Kapazität", "Status",
-			// Info SimulationMenu (83-87)
-			"Simulieren", "Simulationsgeschwindigkeit:", "Algorithmus:", "nichts ausgewählt", "Erfolg",
-			// Exit Pop Up (88)
-			"Sind Sie sich sicher, dass Sie das Programm beenden wollen?",
-			// Simulation ToolTip (89-93)
-			"Abspielen", "Zurücksetzen", "Vorwärts", "Rückwärts", "Zeitschieber",
-			// Image Size Slider (94)
-			"Bildgröße",
-			// Menu - right click on HolonObjt (95-102)
-			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack", "Categories" };
-
-	static String[] arrayCZ = {
-			// ToolBar (0-16)
-			"File", "New", "Open", "Save", "Edit", "Undo", "Redo", "Find/Replace", "Edit showed Information", "Options",
-			"Reset Categories", "View", "View Size", "Help", "About Us", "Edit Edges", "Language",
-			// Tables (17-24)
-			"Object", "Nr.", "Device", "Energy", "Quantity", "Activated", "Field", "Information",
-			// Graph (25-26)
-			"None ", "Reset",
-			// Warning PopUps(27-30)
-			"Warning", "Do you want to save your current data?", "Do you really want to delete the Category ",
-			"Please select a Category or an Object in order to delete something.",
-			// Edit Edges Pop Up (31-34)
-			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel",
-			// Search/Replace Pop Up (35-45)
-			"Search for Objects", "Find", "Replace", "Direction", "Forward", "Backward", "Scope", "All", "Single",
-			"Replace All", "Close",
-			// Edit Edges Pop Up (46-55)
-			"Edit Capacities of Edges", "Maximum Capacity:", "Change for all existing Edges only",
-			"Change for new created Edges only", "Change for all existing and new created Edges", "Cancel",
-			"Please select one of the options",
-			"Please enter a number greater or equal 0 in the Field for Maximum Capacity", "Edit Edge Capacities",
-			"(enter \"infinite\" for infinite Capacity)",
-			// Add PopUp Tree (56-63)
-			"Please enter a Name for Category ", "Please select a Category first before adding ", "Add Object Menu",
-			"Name:", "Browse Image", "Add Element", "Delete Element", "Cancel",
-			// Add PopUp Element (64-71)
-			"Add Element to Object", "Element Name:", "Provided Energy:", "Amount:",
-			"Please enter numbers in the Fields amount and providedEnergy", "No name", "Name already given", "Cancel",
-			// Info for PropertyTable (72-82)
-			"Name", "Total Energy", "Manual", "Active", " is connected to", " with ID: ", "Edge: ", " to ",
-			"Current flow", "Max. Capacity", "Status",
-			// Info SimulationMenu (83-87)
-			"Simulate", "Simulation Speed:", "Algorithm:", "choose folder", "success",
-			// Exit Pop Up (88)
-			"Are you sure you want to exit?",
-			// Simulation ToolTip (89-93)
-			"Play", "Reset", "Forward", "Backward", "Time Slider",
-			// Image Size Slider (94)
-			"Image Size",
-			// Menu - right click on HolonObjt (95-102)
-			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack", "Categories" };
-
-	static String[] arrayZH = {
-			// ToolBar (0-16)
-			"文档", "新", "打开", "保存", "编辑", "撤销", "重做", "查找/替换", "编辑显示的信息", "选项", "复位类别", "视图", "视图尺寸", "帮助", "关于我们",
-			"编辑边缘", "语言",
-			// Tables (17-24)
-			"对象", "No.", "能源", "电能", "数量", "激活", "字段", "信息",
-			// Graph (25-26)
-			"无", "重置",
-			// Warning PopUps(27-30)
-			"警告", "需要储存现在的数据吗?", "真的想删除类别吗?", "请选择一个类别或对象以便删除。",
-			// Edit Edges Pop Up (31-34)
-			"编辑显示的信息", "显示这个对象的总能源", "显示这个对象的总能源", "取消",
-			// Search/Replace Pop Up (35-45)
-			"搜索对象", "寻找", "重置", "方向", "前进", "后退", "范围", "全选", "单一", "重置全部", "关闭",
-			// Edit Edges Pop Up (46-55)
-			"编辑边缘容量", "最大容量:", "更改现有全部编辑", "更改更新内容部分编辑", "更改现有全部以及更新内容部分编辑", "取消", "请选择一个选项", "请输入一个数字大于或等于在字段为最大容量",
-			"编辑边缘容量", "(进入 \"无限\" 无限产能)",
-			// Add PopUp Tree (56-63)
-			"请输入类别名称 ", "请在添加之前选定一个类别 ", "添加对象菜单", "名称:", "浏览图片", "添加元素", "删除元素", "取消",
-			// Add PopUp Element (64-71)
-			"添加元素至对象", "元素名称:", "提供能源:", "数量:", "请在字段中输入数量以及假设能源数字", "无名", "已给出的名称", "取消",
-			// Info for PropertyTable (72-82)
-			"名称", "总能量", "手册", "主动", " 链接至", " 通过ID: ", "边缘: ", " 至 ", "电流流", "最大容量", "状态",
-			// Info SimulationMenu (83-87)
-			"模拟", "仿真速度:", "计算程序:", "选择“文件夹", "成功",
-			// Exit Pop Up (88)
-			"您确定想要退出?",
-			// Simulation ToolTip (89-93)
-			"播放", "复位", "前进", "后退", "时间滑块",
-			// Image Size Slider (94)
-			"图片尺寸",
-			// Menu - right click on HolonObjt (95-102)
-			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack", "Categories" };
-
-	public static String[] getLanguage() {
-		switch (languageVar) {
-		case 0:
-			return arrayEN;
-		case 1:
-			return arrayES;
-		case 2:
-			return arrayDE;
-		case 3:
-			return arrayCZ;
-		case 4:
-			return arrayZH;
-		default:
-			return arrayEN;
-		}
-	}
-
-	public static void setLanguage(int i) {
-		languageVar = i;
-	}
-}
+package ui.view;
+
+public class Languages {
+
+	static int languageVar = 0;
+
+	static String[] arrayEN = {
+			// ToolBar (0-16)
+			"File", "New", "Open", "Save", "Edit", "Undo", "Redo", "Find/Replace", "Edit showed Information", "Options",
+			"Reset Categories", "View", "View Size", "Help", "About Us", "Edit Edges", "Language",
+			// Tables (17-24)
+			"Object", "Nr.", "Device", "Energy", "Quantity", "Activated", "Field", "Information",
+			// Graph (25-26)
+			"None ", "Reset",
+			// Warning PopUps (27-30)
+			"Warning", "Do you want to save your current data?", "Do you really want to delete the Category ",
+			"Please select a Category or an Object in order to delete something.",
+			// Edit Edges Pop Up (31-34)
+			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel",
+			// Search/Replace Pop Up (35-45)
+			"Search for Objects", "Find", "Replace", "Direction", "Forward", "Backward", "Scope", "All", "Single",
+			"Replace All", "Close",
+			// Edit Edges Pop Up (46-55)
+			"Edit Capacities of Edges", "Maximum Capacity:", "Change for all existing Edges only",
+			"Change for new created Edges only", "Change for all existing and new created Edges", "Cancel",
+			"Please select one of the options",
+			"Please enter a number greater or equal 0 in the Field for Maximum Capacity", "Edit Edge Capacities",
+			"(enter \"infinite\" for infinite Capacity)",
+			// Add PopUp Tree (56-63)
+			"Please enter a Name for Category ", "Please select a Category first before adding ", "Add Object Menu",
+			"Name:", "Browse Image", "Add Element", "Delete Element", "Cancel",
+			// Add PopUp Element (64-71)
+			"Add Element to Object", "Element Name:", "Provided Energy:", "Amount:",
+			"Please enter numbers in the Fields amount and Energy", "No name", "Name already given", "Cancel",
+			// Info for PropertyTable (72-82)
+			"Name", "Total Energy", "Manual", "Active", " is connected to", " with ID: ", "Edge: ", " to ",
+			"Current flow", "Max. Capacity", "Status",
+			// Info SimulationMenu (83-87)
+			"Simulate", "Simulation Speed:", "Algorithm:", "non selected", "success",
+			// Exit Pop Up (88)
+			"Are you sure you want to exit?",
+			// Simulation ToolTip (89-93)
+			"Play", "Reset", "Forward", "Backward", "Time Slider",
+			// Image Size Slider (94)
+			"Image Size",
+			// Menu - right click on HolonObjt (95-102)
+			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack"};
+
+	static String[] arrayES = {
+			// ToolBar (0-16)
+			"Archivo", "Nuevo", "Abrir", "Guardar", "Editar", "Deshacer", "Rehacer", "Buscar/Reemplazar",
+			"Editar Información a mostrar", "Opciones", "Resetear Categorias", "Vista", "Tamaño de Vista", "Ayuda",
+			"Sobre Nosotros", "Editar Conexiones", "Idiomas",
+			// Tables (17-24)
+			"Objeto", "Nr.", "Equipo", "Enegia", "Cantidad", "Activo", "Campo", "Información",
+			// Graph (25-26)
+			"Vacio ", "Resetear",
+			// Warning PopUps(27-30)
+			"Atención", "Desea guardar su progreso?", "Esta seguro que quiere eliminar la categoría ",
+			"Por favor, seleccione una categoria o un objecto para poder proceder a eliminarlo.",
+			// Edit Edges Pop Up (31-34)
+			"Editar información a mostrar", "Mostrar energia total de los objetos",
+			"Mostrar propiedades de las conexiones", "Cancelar",
+			// Search/Replace Pop Up (35-45)
+			"Buscar Objetos", "Buscar", "Reemplazar", "Dirección", "Adelante", "Atrás", "Alcance", "Todo", "Uno",
+			"Reemplazar Todo", "Cerrar",
+			// Edit Edges Pop Up (46-55)
+			"Editar Capacidad de las Conexiones", "Capacidad Max.:", "Cambiar para todas las conexiones existentes",
+			"Cambiar solo para conexiones nuevas", "Cambiar para todas las conexiones existentes y nuevas", "Cancelar",
+			"Por favor, elija una de las opciones",
+			"Por favor, ingrese un valor mayor o igual a 0 en el campo de Capacidad Max.",
+			"Editar capacidad de las conexiones", "(ingresar \"infinite\" para capacidad infinita)",
+			// Add PopUp Tree (56-63)
+			"Por favor, ingrese el nombre de la categoria ", "Por favor, elija una categoria antes de agregar ",
+			"Menu para Agregar un Objeto", "Nombre:", "Buscar Imagen", "Agregar Elemento", "Eliminar Elemento",
+			"Cancelar",
+			// Add PopUp Element (64-71)
+			"Agregar Elemento al Objecto", "Nombre del El.:", "Energía:", "Cantidad:",
+			"Por favor, ingrese valores en los campos de cantidad y energía", "Sin nombre", "Nombre en uso", "Cancelar",
+			// Info for PropertyTable (72-82)
+			"Nombre", "Energia Total", "Manual", "Activo", " esta conectado a ", " con ID: ", "Canto: ", " a ",
+			"Corriente actual", "Capacidad Max.", "Estado",
+			// Info SimulationMenu (83-87)
+			"Simular", "Velocidad de Simulación:", "Algoritmo:", "nada seleccionado", "exito",
+			// Exit Pop Up (88)
+			"Esta seguro que quiere cerrar el programa?",
+			// Simulation ToolTip (89-93)
+			"Iniciar", "Resetear", "Adelante", "Atrás", "Linea de Tiempo",
+			// Image Size Slider (94)
+			"Tamaño de la Imagen",
+			// Menu - right click on HolonObjt (95-102)
+			"Cortar", "Copiar", "Pegar", "Eliminar", "Agrupar", "Desagrupar", "Rastrear", "Dejar de rastrear", };
+
+	static String[] arrayDE = {
+			// ToolBar (0-16)
+			"Datei", "Neu", "Öffnen", "Speichern", "Bearbeiten", "Rückgängig", "Wiederherstellen", "Suchen/Ersetzen",
+			"Gezeigte Informationen Ersetzen", "Optionen", "Kategorien Zurücksetzen", "Ansicht", "Ansichtsgröße",
+			"Hilfe", "Über Uns", "Kanten Bearbeiten", "Sprache",
+			// Tables (17-24)
+			"Objekt", "Nr.", "Geräte", "Energie", "Quantität", "Aktiviert", "Feld", "Information",
+			// Graph (25-26)
+			"Nichts ", "Zurücksetzen",
+			// Warning PopUps(27-30)
+			"Warnung", "Möchten Sie ihre aktuellen Daten speichern?", "Möchten Sie wirklich die Kategorie löschen ",
+			"Bitte wählen Sie eine Kategorie oder ein Objekt um etwas löschen zu können.",
+			// Edit Edges Pop Up (31-34)
+			"Gezeigte Informationen Ersetzen", "Gesamtenergie von Objekten zeigen", "Verbindungseigenschaften zeigen",
+			"Abbrechen",
+			// Search/Replace Pop Up (35-45)
+			"Objekte suchen", "Suchen", "Ersetzen", "Richtung", "Vorwärts", "Rückwerts", "Scope", "Alle", "Einzeln",
+			"Alle Ersetzen", "Schließen",
+			// Edit Edges Pop Up (46-55)
+			"Kapazitäten von Kanten bearbeiten", "Max. Kapazität:", "Nur für alle existierenden Kanten ändern",
+			"Nur für neu erstellte Kanten ändern", "Für alle existierenden und neuen Kanten ändern", "Abbrechen",
+			"Bitte wählen Sie eine der Optionen",
+			"Bitte geben Sie eine Zahl größer-gleich 0 im Feld für Maximale Kapazität ein",
+			"Kapazitäten von Kanten bearbeiten", "(geben Sie \"infinite\" für unbeschränkte Kapazitäten ein)",
+			// Add PopUp Tree (56-63)
+			"Bitte geben Sie einen Namen für die Kategorie ein ", "Bitte wählen Sie eine Kategorie vor dem hinzufügen ",
+			"Objekt Hinzufügen Menü", "Name:", "Bilder durchsuchen", "Element hinzufügen", "Element löschen",
+			"Abbrechen",
+			// Add PopUp Element (64-71)
+			"Element zu Objekt hinzufügen", "Element Name:", "Bereitgestellte Energie:", "Menge:",
+			"Bitte geben Sie Nummern in den Feldern für Menge und Energie ein", "Kein Name", "Name bereits vergeben",
+			"Abbrechen",
+			// Info for PropertyTable (72-82)
+			"Name", "Gesamte Energie", "Manuell", "Aktive", " ist verbunden mit", " mit ID: ", "Kante: ", " nach ",
+			"aktueller Fluss", "Max. Kapazität", "Status",
+			// Info SimulationMenu (83-87)
+			"Simulieren", "Simulationsgeschwindigkeit:", "Algorithmus:", "nichts ausgewählt", "Erfolg",
+			// Exit Pop Up (88)
+			"Sind Sie sich sicher, dass Sie das Programm beenden wollen?",
+			// Simulation ToolTip (89-93)
+			"Abspielen", "Zurücksetzen", "Vorwärts", "Rückwärts", "Zeitschieber",
+			// Image Size Slider (94)
+			"Bildgröße",
+			// Menu - right click on HolonObjt (95-102)
+			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack", "Categories" };
+
+	static String[] arrayCZ = {
+			// ToolBar (0-16)
+			"File", "New", "Open", "Save", "Edit", "Undo", "Redo", "Find/Replace", "Edit showed Information", "Options",
+			"Reset Categories", "View", "View Size", "Help", "About Us", "Edit Edges", "Language",
+			// Tables (17-24)
+			"Object", "Nr.", "Device", "Energy", "Quantity", "Activated", "Field", "Information",
+			// Graph (25-26)
+			"None ", "Reset",
+			// Warning PopUps(27-30)
+			"Warning", "Do you want to save your current data?", "Do you really want to delete the Category ",
+			"Please select a Category or an Object in order to delete something.",
+			// Edit Edges Pop Up (31-34)
+			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel",
+			// Search/Replace Pop Up (35-45)
+			"Search for Objects", "Find", "Replace", "Direction", "Forward", "Backward", "Scope", "All", "Single",
+			"Replace All", "Close",
+			// Edit Edges Pop Up (46-55)
+			"Edit Capacities of Edges", "Maximum Capacity:", "Change for all existing Edges only",
+			"Change for new created Edges only", "Change for all existing and new created Edges", "Cancel",
+			"Please select one of the options",
+			"Please enter a number greater or equal 0 in the Field for Maximum Capacity", "Edit Edge Capacities",
+			"(enter \"infinite\" for infinite Capacity)",
+			// Add PopUp Tree (56-63)
+			"Please enter a Name for Category ", "Please select a Category first before adding ", "Add Object Menu",
+			"Name:", "Browse Image", "Add Element", "Delete Element", "Cancel",
+			// Add PopUp Element (64-71)
+			"Add Element to Object", "Element Name:", "Provided Energy:", "Amount:",
+			"Please enter numbers in the Fields amount and providedEnergy", "No name", "Name already given", "Cancel",
+			// Info for PropertyTable (72-82)
+			"Name", "Total Energy", "Manual", "Active", " is connected to", " with ID: ", "Edge: ", " to ",
+			"Current flow", "Max. Capacity", "Status",
+			// Info SimulationMenu (83-87)
+			"Simulate", "Simulation Speed:", "Algorithm:", "choose folder", "success",
+			// Exit Pop Up (88)
+			"Are you sure you want to exit?",
+			// Simulation ToolTip (89-93)
+			"Play", "Reset", "Forward", "Backward", "Time Slider",
+			// Image Size Slider (94)
+			"Image Size",
+			// Menu - right click on HolonObjt (95-102)
+			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack", "Categories" };
+
+	static String[] arrayZH = {
+			// ToolBar (0-16)
+			"文档", "新", "打开", "保存", "编辑", "撤销", "重做", "查找/替换", "编辑显示的信息", "选项", "复位类别", "视图", "视图尺寸", "帮助", "关于我们",
+			"编辑边缘", "语言",
+			// Tables (17-24)
+			"对象", "No.", "能源", "电能", "数量", "激活", "字段", "信息",
+			// Graph (25-26)
+			"无", "重置",
+			// Warning PopUps(27-30)
+			"警告", "需要储存现在的数据吗?", "真的想删除类别吗?", "请选择一个类别或对象以便删除。",
+			// Edit Edges Pop Up (31-34)
+			"编辑显示的信息", "显示这个对象的总能源", "显示这个对象的总能源", "取消",
+			// Search/Replace Pop Up (35-45)
+			"搜索对象", "寻找", "重置", "方向", "前进", "后退", "范围", "全选", "单一", "重置全部", "关闭",
+			// Edit Edges Pop Up (46-55)
+			"编辑边缘容量", "最大容量:", "更改现有全部编辑", "更改更新内容部分编辑", "更改现有全部以及更新内容部分编辑", "取消", "请选择一个选项", "请输入一个数字大于或等于在字段为最大容量",
+			"编辑边缘容量", "(进入 \"无限\" 无限产能)",
+			// Add PopUp Tree (56-63)
+			"请输入类别名称 ", "请在添加之前选定一个类别 ", "添加对象菜单", "名称:", "浏览图片", "添加元素", "删除元素", "取消",
+			// Add PopUp Element (64-71)
+			"添加元素至对象", "元素名称:", "提供能源:", "数量:", "请在字段中输入数量以及假设能源数字", "无名", "已给出的名称", "取消",
+			// Info for PropertyTable (72-82)
+			"名称", "总能量", "手册", "主动", " 链接至", " 通过ID: ", "边缘: ", " 至 ", "电流流", "最大容量", "状态",
+			// Info SimulationMenu (83-87)
+			"模拟", "仿真速度:", "计算程序:", "选择“文件夹", "成功",
+			// Exit Pop Up (88)
+			"您确定想要退出?",
+			// Simulation ToolTip (89-93)
+			"播放", "复位", "前进", "后退", "时间滑块",
+			// Image Size Slider (94)
+			"图片尺寸",
+			// Menu - right click on HolonObjt (95-102)
+			"Cut", "Copy", "Paste", "Delete", "Group", "Ungroup", "Track", "Untrack", "Categories" };
+
+	public static String[] getLanguage() {
+		switch (languageVar) {
+		case 0:
+			return arrayEN;
+		case 1:
+			return arrayES;
+		case 2:
+			return arrayDE;
+		case 3:
+			return arrayCZ;
+		case 4:
+			return arrayZH;
+		default:
+			return arrayEN;
+		}
+	}
+
+	public static void setLanguage(int i) {
+		languageVar = i;
+	}
+}

+ 18 - 12
src/ui/view/TimePanel.java

@@ -138,8 +138,9 @@ public class TimePanel extends JPanel {
 		playBtn.setContentAreaFilled(false);
 		playBtn.setBorderPainted(false);
 		playBtn.setBorder(null);
-		playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/play.png")).getImage()
-				.getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
+		//playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/play.png")).getImage()
+		//		.getScaledInstance(30, 30, Image.SCALE_SMOOTH)));//TODO:Fix here
+		playBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/play.png",30,30, Image.SCALE_SMOOTH)));
 		playBtn.addActionListener(new ActionListener() {
 			@Override
 			public void actionPerformed(ActionEvent e) {
@@ -150,12 +151,14 @@ public class TimePanel extends JPanel {
 					}
 					timer.start();
 					timer.setDelay(model.getTimerSpeed());
-					playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/pause.png"))
-							.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
+					//playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/pause.png"))
+					//		.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));//TODO: Soon...
+					playBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/pause.png",30,30,Image.SCALE_SMOOTH)));
 				} else {
 					timer.stop();
-					playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/play.png"))
-							.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
+					//playBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/play.png"))
+					//		.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));//TODO: this is the exact same as above. why
+					playBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/pause.png",30,30,Image.SCALE_SMOOTH)));
 				}
 			}
 		});
@@ -163,8 +166,9 @@ public class TimePanel extends JPanel {
 
 		timeResetBtn.setContentAreaFilled(false);
 		timeResetBtn.setBorder(null);
-		timeResetBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/reset.png"))
-				.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
+		//timeResetBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/reset.png"))
+		//		.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));//TODO: fix here
+		timeResetBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/reset.png", 30, 30, Image.SCALE_SMOOTH)));
 		timeResetBtn.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent ae) {
 				timeSlider.setValue(timeSlider.getMinimum());
@@ -180,8 +184,9 @@ public class TimePanel extends JPanel {
 
 		timeForwardBtn.setContentAreaFilled(false);
 		timeForwardBtn.setBorder(null);
-		timeForwardBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/forward.png"))
-				.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
+		//timeForwardBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/forward.png"))
+		//		.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));//TODO: fix here
+		timeForwardBtn.setIcon(new ImageIcon(Util.loadImage(this,"/Button_Images/forward.png",30,30,Image.SCALE_SMOOTH)));//TODO: fix here
 		timeForwardBtn.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent ae) {
 				if (!model.getIsSimRunning()) {
@@ -194,8 +199,9 @@ public class TimePanel extends JPanel {
 		timeBackwardBtn.setToolTipText(Languages.getLanguage()[92]);
 
 		timeBackwardBtn.setBorder(null);
-		timeBackwardBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/backward.png"))
-				.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));
+		//timeBackwardBtn.setIcon(new ImageIcon(new ImageIcon(this.getClass().getResource("/Button_Images/backward.png"))
+		//		.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)));//TODO: fix here
+		timeBackwardBtn.setIcon(new ImageIcon(Util.loadImage(this, "/Button_Images/backward.png", 30,30, Image.SCALE_SMOOTH)));
 		timeBackwardBtn.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent ae) {
 				timeSlider.setValue(timeSlider.getValue() - 1);

+ 4 - 2
src/ui/view/UpperNodeCanvas.java

@@ -464,7 +464,8 @@ public class UpperNodeCanvas extends AbstractCanvas implements MouseListener, Mo
             // node image
             if (cps instanceof CpsNode && (cps == tempCps || model.getSelectedCpsObject() == cps
                     || model.getSelectedCpsObjects().contains(cps) || tempSelected.contains(cps))) {
-                img = new ImageIcon(this.getClass().getResource("/Images/node_selected.png")).getImage();
+                //img = new ImageIcon(this.getClass().getResource("/Images/node_selected.png")).getImage();//TODO: ONE MORE
+            	img = Util.loadImage(this,"/Images/node_selected.png");
             } else {
                 if (cps instanceof HolonSwitch) {
                     if (((HolonSwitch) cps).getActiveAt()[model.getCurIteration()]) {
@@ -492,7 +493,8 @@ public class UpperNodeCanvas extends AbstractCanvas implements MouseListener, Mo
                 if (checkPath.exists()) {
                     img = new ImageIcon(cps.getImage()).getImage();
                 } else {
-                    img = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage();
+                    //img = new ImageIcon(this.getClass().getResource(cps.getImage())).getImage();//TODO: and I'm done
+                	img = Util.loadImage(this,cps.getImage());
                 }
             }
             g2.drawImage(img, (upperNode.getLeftBorder() >> 1) - 25,