Browse Source

Language almost ready

Edgardo Palza 7 years ago
parent
commit
2996415a14

+ 14 - 12
src/ui/view/AddElementPopUp.java

@@ -21,6 +21,7 @@ import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 import java.awt.event.ActionEvent;
+
 /**
  * popup for adding an Holon Element to a holon Object.
  * 
@@ -42,7 +43,8 @@ public class AddElementPopUp extends JDialog {
 	/**
 	 * Launch the application.
 	 * 
-	 * @param args standard
+	 * @param args
+	 *            standard
 	 */
 	public static void main(String[] args) {
 		try {
@@ -68,17 +70,17 @@ public class AddElementPopUp extends JDialog {
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);
 		contentPanel.setLayout(null);
-		this.setTitle("Add default Element to Object");
+		this.setTitle(Languages.getLanguage()[64]);
 
-		JLabel lblElementName = new JLabel("Element Name:");
+		JLabel lblElementName = new JLabel(Languages.getLanguage()[65]);
 		lblElementName.setBounds(10, 11, 100, 14);
 		contentPanel.add(lblElementName);
 
-		JLabel lblProvidedEnergy = new JLabel("Provided Energy:");
+		JLabel lblProvidedEnergy = new JLabel(Languages.getLanguage()[66]);
 		lblProvidedEnergy.setBounds(10, 49, 120, 14);
 		contentPanel.add(lblProvidedEnergy);
 
-		JLabel lblAmount = new JLabel("Amount:");
+		JLabel lblAmount = new JLabel(Languages.getLanguage()[67]);
 		lblAmount.setBounds(10, 84, 100, 14);
 		contentPanel.add(lblAmount);
 
@@ -136,22 +138,21 @@ public class AddElementPopUp extends JDialog {
 								float energy = Float.parseFloat(providedEnergy.getText().toString());
 								int elementAmount = Integer.parseInt(amount.getText().toString());
 								hl = new HolonElement(elementName.getText().toString(), elementAmount, energy);
-								
+
 								dispose();
 							} catch (NumberFormatException e) {
-								JOptionPane.showMessageDialog(new JFrame(),
-										"Please enter numbers in the Fields amount and providedEnergy");
+								JOptionPane.showMessageDialog(new JFrame(), Languages.getLanguage()[68]);
 							}
 						} else {
 							// JOptionPane.showMessageDialog(new JFrame(),
 							// "Please enter a Name");
 
 							if (elementName.getText().length() == 0) {
-								JLabel errorString = new JLabel("No name");
+								JLabel errorString = new JLabel(Languages.getLanguage()[69]);
 								errorString.setBounds(200, 8, 200, 20);
 								contentPanel.add(errorString);
 							} else if (repeated) {
-								JLabel errorString = new JLabel("Name already given");
+								JLabel errorString = new JLabel(Languages.getLanguage()[70]);
 								errorString.setBounds(240, 8, 100, 20);
 								contentPanel.add(errorString);
 							}
@@ -164,7 +165,7 @@ public class AddElementPopUp extends JDialog {
 				getRootPane().setDefaultButton(okButton);
 			}
 			{
-				JButton cancelButton = new JButton("Cancel");
+				JButton cancelButton = new JButton(Languages.getLanguage()[71]);
 				cancelButton.setActionCommand("Cancel");
 				buttonPane.add(cancelButton);
 				cancelButton.addActionListener(new ActionListener() {
@@ -180,7 +181,8 @@ public class AddElementPopUp extends JDialog {
 	/**
 	 * Sets the actual Cps.
 	 * 
-	 * @param cps actual Cps
+	 * @param cps
+	 *            actual Cps
 	 */
 	public void setActualCps(AbstractCpsObject cps) {
 		this.tempCps = cps;

+ 13 - 9
src/ui/view/AddObjectPopUp.java

@@ -103,9 +103,9 @@ public class AddObjectPopUp extends JDialog {
 		getContentPane().add(contentPanel, BorderLayout.CENTER);
 		contentPanel.setLayout(null);
 		hElements = new ArrayList<HolonElement>();
-		this.setTitle("Add Object Menu");
+		this.setTitle(Languages.getLanguage()[58]);
 		{
-			JLabel lblName = new JLabel("Name:");
+			JLabel lblName = new JLabel(Languages.getLanguage()[59]);
 			lblName.setHorizontalAlignment(SwingConstants.CENTER);
 			lblName.setBounds(28, 21, 76, 14);
 			contentPanel.add(lblName);
@@ -138,7 +138,7 @@ public class AddObjectPopUp extends JDialog {
 			objectName.setColumns(10);
 		}
 		{
-			JButton btnBrowseImage = new JButton("Browse Image");
+			JButton btnBrowseImage = new JButton(Languages.getLanguage()[60]);
 			btnBrowseImage.setBounds(10, 75, 134, 23);
 			contentPanel.add(btnBrowseImage);
 			btnBrowseImage.addMouseListener(new MouseAdapter() {
@@ -192,14 +192,16 @@ public class AddObjectPopUp extends JDialog {
 			sourcePath.setColumns(10);
 		}
 		{
-			JButton btnAddDefaultElement = new JButton("Add Element");
+			JButton btnAddDefaultElement = new JButton(Languages.getLanguage()[61]);
 			btnAddDefaultElement.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent arg0) {
 					addElement = new AddElementPopUp();
 					addElement.setActualCps(toEdit);
 					addElement.setVisible(true);
 					HolonElement hl = addElement.getElement();
-					hl.setSav(givenCategory);
+					if (hl != null) {
+						hl.setSav(givenCategory);
+					}
 					hl.setObj(objectName.getText());
 					addElement(hl);
 				}
@@ -231,7 +233,7 @@ public class AddObjectPopUp extends JDialog {
 			}
 		}
 		{
-			JButton btnNewButton = new JButton("Delete Element");
+			JButton btnNewButton = new JButton(Languages.getLanguage()[62]);
 			btnNewButton.addActionListener(new ActionListener() {
 				public void actionPerformed(ActionEvent e) {
 					int selectedIndex = list.getSelectedIndex();
@@ -294,7 +296,7 @@ public class AddObjectPopUp extends JDialog {
 				getRootPane().setDefaultButton(okButton);
 			}
 			{
-				JButton cancelButton = new JButton("Cancel");
+				JButton cancelButton = new JButton(Languages.getLanguage()[63]);
 				cancelButton.setActionCommand("Cancel");
 				buttonPane.add(cancelButton);
 				cancelButton.addActionListener(new ActionListener() {
@@ -419,7 +421,8 @@ public class AddObjectPopUp extends JDialog {
 	/**
 	 * Sets the Controller.
 	 * 
-	 * @param controller the controller
+	 * @param controller
+	 *            the controller
 	 */
 	public void setController(Control controller) {
 		this.controller = controller;
@@ -428,7 +431,8 @@ public class AddObjectPopUp extends JDialog {
 	/**
 	 * Set the Category.
 	 * 
-	 * @param cat the Category
+	 * @param cat
+	 *            the Category
 	 */
 	public void setCategory(String cat) {
 		givenCategory = cat;

+ 16 - 17
src/ui/view/EditEdgesPopUp.java

@@ -62,14 +62,14 @@ public class EditEdgesPopUp extends JDialog {
 	public EditEdgesPopUp() {
 		super((java.awt.Frame) null, true);
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
-		this.setTitle("Edit Capacities of Edges");
-		setBounds(100, 100, 438, 220);
+		this.setTitle(Languages.getLanguage()[46]);
+		setBounds(100, 100, 550, 220);
 		getContentPane().setLayout(new BorderLayout());
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);
 		contentPanel.setLayout(null);
 
-		JLabel lblMaximumCapacity = new JLabel("Maximum Capacity:");
+		JLabel lblMaximumCapacity = new JLabel(Languages.getLanguage()[47]);
 		lblMaximumCapacity.setFont(new Font("Tahoma", Font.PLAIN, 11));
 		lblMaximumCapacity.setBounds(10, 11, 98, 14);
 		contentPanel.add(lblMaximumCapacity);
@@ -79,19 +79,19 @@ public class EditEdgesPopUp extends JDialog {
 		contentPanel.add(capacityField);
 		capacityField.setColumns(10);
 
-		rdbtnChangeForAll = new JRadioButton("Change for all existing Edges only");
-		rdbtnChangeForAll.setBounds(10, 39, 265, 23);
+		rdbtnChangeForAll = new JRadioButton(Languages.getLanguage()[48]);
+		rdbtnChangeForAll.setBounds(10, 39, 330, 23);
 		contentPanel.add(rdbtnChangeForAll);
 
-		rdbtnChangeForNew = new JRadioButton("Change for new created Edges only");
-		rdbtnChangeForNew.setBounds(10, 65, 265, 23);
+		rdbtnChangeForNew = new JRadioButton(Languages.getLanguage()[49]);
+		rdbtnChangeForNew.setBounds(10, 65, 330, 23);
 		contentPanel.add(rdbtnChangeForNew);
 
-		rdbtnChangeForAll1 = new JRadioButton("Change for all existing and new created Edges");
-		rdbtnChangeForAll1.setBounds(10, 95, 296, 23);
+		rdbtnChangeForAll1 = new JRadioButton(Languages.getLanguage()[50]);
+		rdbtnChangeForAll1.setBounds(10, 95, 400, 23);
 		contentPanel.add(rdbtnChangeForAll1);
 
-		JButton btnCancel = new JButton("Cancel");
+		JButton btnCancel = new JButton(Languages.getLanguage()[51]);
 		btnCancel.setActionCommand("Cancel");
 		btnCancel.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent arg0) {
@@ -116,7 +116,7 @@ public class EditEdgesPopUp extends JDialog {
 						changeForExAndNew(capacity);
 						dispose();
 					} else {
-						JOptionPane.showMessageDialog(new JFrame(), "Please select one of the options");
+						JOptionPane.showMessageDialog(new JFrame(), Languages.getLanguage()[52]);
 					}
 				} else {
 					try {
@@ -134,25 +134,24 @@ public class EditEdgesPopUp extends JDialog {
 							changeForExAndNew(capacity);
 							dispose();
 						} else {
-							JOptionPane.showMessageDialog(new JFrame(), "Please select one of the options");
+							JOptionPane.showMessageDialog(new JFrame(), Languages.getLanguage()[52]);
 						}
 					} catch (NumberFormatException eex) {
-						JOptionPane.showMessageDialog(new JFrame(),
-								"Please enter a number greater or equal 0 in the Field for Maximum Capacity");
+						JOptionPane.showMessageDialog(new JFrame(), Languages.getLanguage()[53]);
 					}
 				}
 			}
 		});
 		btnOk1.setBounds(186, 147, 89, 23);
 		contentPanel.add(btnOk1);
-		this.setTitle("Edit Edge Capacities");
+		this.setTitle(Languages.getLanguage()[54]);
 		ButtonGroup bG = new ButtonGroup();
 		bG.add(rdbtnChangeForAll1);
 		bG.add(rdbtnChangeForNew);
 		bG.add(rdbtnChangeForAll);
 
-		lblenterinfiniteFor = new JLabel("(enter \"infinite\" for infinite Capacity)");
-		lblenterinfiniteFor.setBounds(237, 11, 175, 14);
+		lblenterinfiniteFor = new JLabel(Languages.getLanguage()[55]);
+		lblenterinfiniteFor.setBounds(237, 11, 280, 14);
 		contentPanel.add(lblenterinfiniteFor);
 	}
 

+ 30 - 21
src/ui/view/GUI.java

@@ -1098,7 +1098,7 @@ public class GUI<E> implements CategoryListener {
 					switch (selectedOption) {
 
 					case "Category":
-						String catName = JOptionPane.showInputDialog("Please enter a Name for Category ");
+						String catName = JOptionPane.showInputDialog(Languages.getLanguage()[56]);
 						if (catName.length() != 0) {
 							controller.addCategory(catName);
 						}
@@ -1106,7 +1106,7 @@ public class GUI<E> implements CategoryListener {
 					case "Object":
 						if (selectedNode == null) {
 							JOptionPane.showMessageDialog(new JFrame(),
-									"Please select a Category first before adding " + selectedOption + ".");
+									Languages.getLanguage()[57] + selectedOption + ".");
 						}
 						if (selectedNode.getLevel() == 1) {
 							AbstractCpsObject tmp = new HolonObject("");
@@ -1173,7 +1173,7 @@ public class GUI<E> implements CategoryListener {
 				// Write new data in the PropertyTable
 				if (temp != null) {
 					// Name of the CpsObject
-					Object[] tempName = { "Name", temp.getName() };
+					Object[] tempName = { Languages.getLanguage()[72], temp.getName() };
 					tableModelProperties.addRow(tempName);
 					// Id of the CpsObject
 					Object[] tempId = { "ID", temp.getID() };
@@ -1182,7 +1182,7 @@ public class GUI<E> implements CategoryListener {
 					// consumption) is calculated
 					if (temp instanceof HolonObject) {
 						refreshTableHolonElement();
-						Object[] tempEnergy = { "Total Energy", ((HolonObject) temp).getCurrentEnergy() };
+						Object[] tempEnergy = { Languages.getLanguage()[73], ((HolonObject) temp).getCurrentEnergy() };
 						tableModelProperties.addRow(tempEnergy);
 						tableModelProperties.setCellEditable(0, 1, true);
 						tableModelProperties.setCellEditable(2, 1, false);
@@ -1192,14 +1192,15 @@ public class GUI<E> implements CategoryListener {
 					else if (temp instanceof HolonSwitch) {
 						deleteRows(tableModelHolonElementSingle);
 						deleteRows(tableModelHolonElementMulti);
-						Object[] tempMode = { "Manual", ((HolonSwitch) temp).getManualMode() };
+						Object[] tempMode = { Languages.getLanguage()[74], ((HolonSwitch) temp).getManualMode() };
 						tableModelProperties.addRow(tempMode);
 						if (((HolonSwitch) temp).getManualMode()) {
-							Object[] tempActive = { "Active", ((HolonSwitch) temp).getActiveManual() };
+							Object[] tempActive = { Languages.getLanguage()[75],
+									((HolonSwitch) temp).getActiveManual() };
 							tableModelProperties.addRow(tempActive);
 							tableModelProperties.setCellEditable(3, 1, true);
 						} else {
-							Object[] tempActive = { "Active",
+							Object[] tempActive = { Languages.getLanguage()[75],
 									((HolonSwitch) temp).getActiveAt()[model.getCurIteration()] };
 							tableModelProperties.addRow(tempActive);
 							tableModelProperties.setCellEditable(3, 1, false);
@@ -1221,22 +1222,24 @@ public class GUI<E> implements CategoryListener {
 							if (first) {
 								first = false;
 								if (temp.getID() != temp2.getA().getID()) {
-									Object[] tempConnection = { temp.getName() + " is connected to",
-											temp2.getA().getName() + " with ID: " + temp2.getA().getID() };
+									Object[] tempConnection = { temp.getName() + Languages.getLanguage()[76],
+											temp2.getA().getName() + Languages.getLanguage()[77]
+													+ temp2.getA().getID() };
 									tableModelProperties.addRow(tempConnection);
 								} else {
-									Object[] tempConnection = { temp.getName() + " is connected to",
-											temp2.getB().getName() + " with ID: " + temp2.getB().getID() };
+									Object[] tempConnection = { temp.getName() + Languages.getLanguage()[76],
+											temp2.getB().getName() + Languages.getLanguage()[77]
+													+ temp2.getB().getID() };
 									tableModelProperties.addRow(tempConnection);
 								}
 							} else {
 								if (temp.getID() != temp2.getA().getID()) {
-									Object[] tempConnection = { "",
-											temp2.getA().getName() + " with ID: " + temp2.getA().getID() };
+									Object[] tempConnection = { "", temp2.getA().getName() + Languages.getLanguage()[77]
+											+ temp2.getA().getID() };
 									tableModelProperties.addRow(tempConnection);
 								} else {
-									Object[] tempConnection = { "",
-											temp2.getB().getName() + " with ID: " + temp2.getB().getID() };
+									Object[] tempConnection = { "", temp2.getB().getName() + Languages.getLanguage()[77]
+											+ temp2.getB().getID() };
 									tableModelProperties.addRow(tempConnection);
 								}
 							}
@@ -1245,17 +1248,18 @@ public class GUI<E> implements CategoryListener {
 				} // If the clicked Object is an edge
 				else if (model.getSelectedEdge() != null) {
 					// Name displayed
-					Object[] tempName = { "Name", "Edge: " + model.getSelectedEdge().getA().getName() + " to "
-							+ model.getSelectedEdge().getB().getName() };
+					Object[] tempName = { Languages.getLanguage()[72],
+							Languages.getLanguage()[78] + model.getSelectedEdge().getA().getName()
+									+ Languages.getLanguage()[79] + model.getSelectedEdge().getB().getName() };
 					tableModelProperties.addRow(tempName);
 					// Current Flow displayed
-					Object[] tempFlow = { "Current flow", model.getSelectedEdge().getFlow() };
+					Object[] tempFlow = { Languages.getLanguage()[80], model.getSelectedEdge().getFlow() };
 					tableModelProperties.addRow(tempFlow);
 					// Max Capacity displayed
-					Object[] tempCapacity = { "Max. Capacity", model.getSelectedEdge().getCapacity() };
+					Object[] tempCapacity = { Languages.getLanguage()[81], model.getSelectedEdge().getCapacity() };
 					tableModelProperties.addRow(tempCapacity);
 					// Status displayed
-					Object[] tempStatus = { "Status", model.getSelectedEdge().getState() };
+					Object[] tempStatus = { Languages.getLanguage()[82], model.getSelectedEdge().getState() };
 					tableModelProperties.addRow(tempStatus);
 					// For edges, the only possible editable cell is the max
 					// flow
@@ -1428,6 +1432,7 @@ public class GUI<E> implements CategoryListener {
 			public void actionPerformed(ActionEvent e) {
 				Languages.setLanguage(0);
 				refreshLanguages();
+				refreshTableProperties();
 			}
 		});
 		spanishBtn.addActionListener(new ActionListener() {
@@ -1436,6 +1441,7 @@ public class GUI<E> implements CategoryListener {
 			public void actionPerformed(ActionEvent e) {
 				Languages.setLanguage(1);
 				refreshLanguages();
+				refreshTableProperties();
 			}
 		});
 		germanBtn.addActionListener(new ActionListener() {
@@ -1444,6 +1450,7 @@ public class GUI<E> implements CategoryListener {
 			public void actionPerformed(ActionEvent e) {
 				Languages.setLanguage(2);
 				refreshLanguages();
+				refreshTableProperties();
 			}
 		});
 		czechBtn.addActionListener(new ActionListener() {
@@ -1452,6 +1459,7 @@ public class GUI<E> implements CategoryListener {
 			public void actionPerformed(ActionEvent e) {
 				Languages.setLanguage(3);
 				refreshLanguages();
+				refreshTableProperties();
 			}
 		});
 		chineseBtn.addActionListener(new ActionListener() {
@@ -1460,6 +1468,7 @@ public class GUI<E> implements CategoryListener {
 			public void actionPerformed(ActionEvent e) {
 				Languages.setLanguage(4);
 				refreshLanguages();
+				refreshTableProperties();
 			}
 		});
 
@@ -1855,7 +1864,7 @@ public class GUI<E> implements CategoryListener {
 			AbstractCpsObject tempCps = getActualCps();
 			if (tempCps != null && tempCps.getClass() == HolonObject.class) {
 				tableModelProperties.removeRow(2);
-				Object[] tempEnergy = { "Total Energy", ((HolonObject) tempCps).getCurrentEnergy() };
+				Object[] tempEnergy = { Languages.getLanguage()[73], ((HolonObject) tempCps).getCurrentEnergy() };
 				tableModelProperties.insertRow(2, tempEnergy);
 			}
 		}

+ 111 - 10
src/ui/view/Languages.java

@@ -15,8 +15,28 @@ public class Languages {
 			// 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
-			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel" };
+			// 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" };
 
 	static String[] arrayES = {
 			// ToolBar (0-16)
@@ -30,9 +50,30 @@ public class Languages {
 			// Warning PopUps(27-30)
 			"Atencion", "Desea guardar su progreso?", "Esta seguro que quiere eliminar la categoria ",
 			"Por favor seleccione una categoria o un objecto para poder proceder a eliminarlo.",
-			// Edit Edges Pop Up
+			// Edit Edges Pop Up (31-34)
 			"Editar informacion a mostrar", "Mostrar energia total de los objetos",
-			"Mostrar propiedades de las conexiones", "Cancelar" };
+			"Mostrar propiedades de las conexiones", "Cancelar",
+			// Search/Replace Pop Up (35-45)
+			"Buscar Objetos", "Buscar", "Reemplazar", "Direccion", "Adelante", "Atras", "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.:", "Energia:", "Cantidad:",
+			"Por favor ingrese valores en los campos de cantidad y energia", "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 Simulacion:", "Algoritmo:", "elija carpeta", "exito" };
 
 	static String[] arrayDE = {
 			// ToolBar (0-16)
@@ -46,8 +87,28 @@ public class Languages {
 			// 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
-			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel" };
+			// 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" };
 
 	static String[] arrayCZ = {
 			// ToolBar (0-16)
@@ -60,8 +121,28 @@ public class Languages {
 			// 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
-			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel" };
+			// 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" };
 
 	static String[] arrayZH = {
 			// ToolBar (0-16)
@@ -74,8 +155,28 @@ public class Languages {
 			// 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
-			"Edit Showed Informations", "Show Total Energy of Objects", "Show Connection Properties", "Cancel" };
+			// 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" };
 
 	public static String[] getLanguage() {
 		switch (languageVar) {

+ 40 - 30
src/ui/view/SearchPopUp.java

@@ -43,15 +43,18 @@ public class SearchPopUp extends JDialog {
 
 	/**
 	 * Constructor.
-	 * @param contr Controller
-	 * @param can Canvas
+	 * 
+	 * @param contr
+	 *            Controller
+	 * @param can
+	 *            Canvas
 	 */
 	SearchPopUp(Control contr, MyCanvas can) {
 		super((java.awt.Frame) null, true);
 		idx = -1;
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
-		this.setTitle("Search for Objects");
-		setBounds(100, 100, 238, 360);
+		this.setTitle(Languages.getLanguage()[35]);
+		setBounds(100, 100, 250, 360);
 		getContentPane().setLayout(new BorderLayout());
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);
@@ -60,62 +63,62 @@ public class SearchPopUp extends JDialog {
 		this.controller = contr;
 		this.canvas = can;
 
-		JLabel lblFind = new JLabel("Find:");
+		JLabel lblFind = new JLabel(Languages.getLanguage()[36] + ":");
 		lblFind.setFont(new Font("Tahoma", Font.PLAIN, 13));
 		lblFind.setBounds(10, 11, 46, 19);
 		contentPanel.add(lblFind);
 
-		JLabel lblReplace = new JLabel("Replace:");
+		JLabel lblReplace = new JLabel(Languages.getLanguage()[37] + ":");
 		lblReplace.setFont(new Font("Tahoma", Font.PLAIN, 13));
-		lblReplace.setBounds(10, 41, 56, 14);
+		lblReplace.setBounds(10, 41, 80, 14);
 		contentPanel.add(lblReplace);
 
 		// ReplaceTest
 		replaceTextField = new JTextField();
-		replaceTextField.setBounds(76, 39, 101, 20);
+		replaceTextField.setBounds(90, 39, 101, 20);
 		contentPanel.add(replaceTextField);
 		replaceTextField.setColumns(10);
 
 		// FindText
 		findTextField = new JTextField();
-		findTextField.setBounds(76, 11, 101, 20);
+		findTextField.setBounds(90, 11, 101, 20);
 		contentPanel.add(findTextField);
 		findTextField.setColumns(10);
 
-		JLabel lblNewLabel = new JLabel("Direction");
+		JLabel lblNewLabel = new JLabel(Languages.getLanguage()[38]);
 		lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 13));
 		lblNewLabel.setBounds(10, 90, 82, 14);
 		contentPanel.add(lblNewLabel);
 
-		rdbtnForward = new JRadioButton("Forward");
+		rdbtnForward = new JRadioButton(Languages.getLanguage()[39]);
 		rdbtnForward.setFont(new Font("Tahoma", Font.PLAIN, 13));
 		rdbtnForward.setBounds(10, 111, 109, 23);
 		contentPanel.add(rdbtnForward);
 		rdbtnForward.setSelected(true);
 
-		rdbtnBackward = new JRadioButton("Backward");
+		rdbtnBackward = new JRadioButton(Languages.getLanguage()[40]);
 		rdbtnBackward.setFont(new Font("Tahoma", Font.PLAIN, 13));
 		rdbtnBackward.setBounds(10, 137, 109, 23);
 		contentPanel.add(rdbtnBackward);
 
-		JLabel lblScope = new JLabel("Scope");
+		JLabel lblScope = new JLabel(Languages.getLanguage()[41]);
 		lblScope.setFont(new Font("Tahoma", Font.BOLD, 13));
-		lblScope.setBounds(122, 90, 46, 14);
+		lblScope.setBounds(122, 90, 60, 14);
 		contentPanel.add(lblScope);
 
-		rdbtnAll = new JRadioButton("All");
+		rdbtnAll = new JRadioButton(Languages.getLanguage()[42]);
 		rdbtnAll.setFont(new Font("Tahoma", Font.PLAIN, 13));
 		rdbtnAll.setBounds(121, 112, 109, 23);
 		contentPanel.add(rdbtnAll);
 		rdbtnAll.setSelected(true);
 
-		rdbtnSingle = new JRadioButton("Single");
+		rdbtnSingle = new JRadioButton(Languages.getLanguage()[43]);
 		rdbtnSingle.setFont(new Font("Tahoma", Font.PLAIN, 13));
 		rdbtnSingle.setBounds(121, 138, 109, 23);
 		contentPanel.add(rdbtnSingle);
 
 		// FindButton
-		JButton btnFind = new JButton("Find");
+		JButton btnFind = new JButton(Languages.getLanguage()[36]);
 		btnFind.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent e) {
 				if (rdbtnAll.isSelected()) {
@@ -149,11 +152,11 @@ public class SearchPopUp extends JDialog {
 			}
 		});
 		btnFind.setFont(new Font("Tahoma", Font.PLAIN, 13));
-		btnFind.setBounds(10, 186, 89, 23);
+		btnFind.setBounds(10, 186, 110, 23);
 		contentPanel.add(btnFind);
 
 		// ReplaceButton
-		JButton btnReplace = new JButton("Replace");
+		JButton btnReplace = new JButton(Languages.getLanguage()[37]);
 		btnReplace.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent e) {
 
@@ -164,11 +167,11 @@ public class SearchPopUp extends JDialog {
 			}
 		});
 		btnReplace.setFont(new Font("Tahoma", Font.PLAIN, 13));
-		btnReplace.setBounds(110, 187, 89, 23);
+		btnReplace.setBounds(110, 187, 110, 23);
 		contentPanel.add(btnReplace);
 
 		// ReplaceAllButton
-		JButton btnReplaceAll = new JButton("Replace All");
+		JButton btnReplaceAll = new JButton(Languages.getLanguage()[44]);
 		btnReplaceAll.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent e) {
 				canvas.tempCps = null;
@@ -189,18 +192,18 @@ public class SearchPopUp extends JDialog {
 			}
 		});
 		btnReplaceAll.setFont(new Font("Tahoma", Font.PLAIN, 11));
-		btnReplaceAll.setBounds(110, 218, 89, 23);
+		btnReplaceAll.setBounds(110, 218, 110, 23);
 		contentPanel.add(btnReplaceAll);
 
 		// CloseButton
-		JButton btnClose = new JButton("Close");
+		JButton btnClose = new JButton(Languages.getLanguage()[45]);
 		btnClose.addActionListener(new ActionListener() {
 			public void actionPerformed(ActionEvent arg0) {
 				dispose();
 			}
 		});
 		btnClose.setFont(new Font("Tahoma", Font.PLAIN, 13));
-		btnClose.setBounds(110, 287, 89, 23);
+		btnClose.setBounds(110, 287, 110, 23);
 		contentPanel.add(btnClose);
 
 		ButtonGroup directionbtns = new ButtonGroup();
@@ -215,7 +218,9 @@ public class SearchPopUp extends JDialog {
 
 	/**
 	 * add the searched Objects to the Selected Objects.
-	 * @param obj The Object
+	 * 
+	 * @param obj
+	 *            The Object
 	 */
 	public void selectObj(AbstractCpsObject obj) {
 		controller.getModel().getSelectedCpsObjects().add(obj);
@@ -224,8 +229,10 @@ public class SearchPopUp extends JDialog {
 	/**
 	 * Rename an Object.
 	 * 
-	 * @param obj the Object
- 	 * @param name the new name
+	 * @param obj
+	 *            the Object
+	 * @param name
+	 *            the new name
 	 */
 	public void renameObj(AbstractCpsObject obj, String name) {
 		obj.setName(name);
@@ -234,7 +241,8 @@ public class SearchPopUp extends JDialog {
 	/**
 	 * get the Object with the specific ID.
 	 * 
-	 * @param idx the ID
+	 * @param idx
+	 *            the ID
 	 * @return the Object with that ID
 	 */
 	public AbstractCpsObject getObj(int idx) {
@@ -244,7 +252,8 @@ public class SearchPopUp extends JDialog {
 	/**
 	 * Get the next Object ID.
 	 * 
-	 * @param idx the Index
+	 * @param idx
+	 *            the Index
 	 * @return the next Index
 	 */
 	public int getNext(int idx) {
@@ -264,7 +273,8 @@ public class SearchPopUp extends JDialog {
 	/**
 	 * Get the previous Index.
 	 * 
-	 * @param idx the Index
+	 * @param idx
+	 *            the Index
 	 * @return the previousIndex
 	 */
 	public int getPrev(int idx) {

+ 5 - 5
src/ui/view/SimulationMenu.java

@@ -66,11 +66,11 @@ public class SimulationMenu extends JMenuBar {
 	private static final long serialVersionUID = 1L;
 
 	private JPanel menuPanel = new JPanel();
-	private JRadioButton simButton = new JRadioButton("Simulate");
-	private JLabel simSpeedLabel = new JLabel("Simulation Speed:");
+	private JRadioButton simButton = new JRadioButton(Languages.getLanguage()[83]);
+	private JLabel simSpeedLabel = new JLabel(Languages.getLanguage()[84]);
 	private JTextField simSpeedText = new JTextField("1000");
 	private JComboBox algoCombo = new JComboBox<>();
-	private JButton algoFolderButton = new JButton("Algorithm:");
+	private JButton algoFolderButton = new JButton(Languages.getLanguage()[85]);
 	private HashMap<String, File> algosHash = new HashMap<>();
 
 	// root Directory
@@ -192,7 +192,7 @@ public class SimulationMenu extends JMenuBar {
 		gbcAlgoCombo.gridx = 4;
 		gbcAlgoCombo.gridy = 0;
 		menuPanel.add(algoCombo, gbcAlgoCombo);
-		algoCombo.addItem("choose folder");
+		algoCombo.addItem(Languages.getLanguage()[86]);
 
 		// Add Panel to SimulationMenu
 		this.add(menuPanel);
@@ -214,7 +214,7 @@ public class SimulationMenu extends JMenuBar {
 
 			Object t = cls.newInstance();
 
-			controller.addTextToConsole("success");
+			controller.addTextToConsole(Languages.getLanguage()[87]);
 
 			controller.setAlgorithm(t);