Browse Source

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/carlos.garcia/praktikum-holons.git

Kevin Trometer 7 years ago
parent
commit
e60c79db99

BIN
QS-Gruppe14-FinalVersion.pdf


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

@@ -223,7 +223,7 @@ public class GUI<E> implements CategoryListener {
 	private UnitGraph unitGraph;
 	private final JSplitPane splitPane3 = new JSplitPane();
 	private final JSlider sizeSlider = new JSlider();
-	private final JLabel lblImageSize = new JLabel("Image Size");
+	private final JLabel lblImageSize = new JLabel(Languages.getLanguage()[94]);
 	// Time Stuff
 	private TimePanel timePanel;
 	// Coord for all Cells with text
@@ -1953,6 +1953,17 @@ public class GUI<E> implements CategoryListener {
 		saveBeforeNew = tempArray[28];
 		eraseCategory = tempArray[29];
 		selectObjBeforeErase = tempArray[30];
+		// SimMenu
+		simMenu.simButton.setText(Languages.getLanguage()[83]);
+		simMenu.simSpeedLabel.setText(Languages.getLanguage()[84]);
+		simMenu.algoFolderButton.setText(Languages.getLanguage()[85]);
+		// TimePanel
+		timePanel.playBtn.setToolTipText(Languages.getLanguage()[89]);
+		timePanel.timeResetBtn.setToolTipText(Languages.getLanguage()[90]);
+		timePanel.timeForwardBtn.setToolTipText(Languages.getLanguage()[91]);
+		timePanel.timeBackwardBtn.setToolTipText(Languages.getLanguage()[92]);
+		timePanel.timeSlider.setToolTipText(Languages.getLanguage()[93]);
+		// Image Size Slider
+		lblImageSize.setText(Languages.getLanguage()[94]);
 	}
-
 }

+ 42 - 22
src/ui/view/Languages.java

@@ -37,47 +37,55 @@ public class Languages {
 			"Current flow", "Max. Capacity", "Status",
 			// Info SimulationMenu (83-87)
 			"Simulate", "Simulation Speed:", "Algorithm:", "non selected", "success",
-			// Extra (88)
-			"Are you sure you want to exit?" };
+			// 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" };
 
 	static String[] arrayES = {
 			// ToolBar (0-16)
 			"Archivo", "Nuevo", "Abrir", "Guardar", "Editar", "Deshacer", "Rehacer", "Buscar/Reemplazar",
-			"Editar Informacion a mostrar", "Opciones", "Resetear Categorias", "Vista", "Tamano de Vista", "Ayuda",
+			"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", "Informacion",
+			"Objeto", "Nr.", "Equipo", "Enegia", "Cantidad", "Activo", "Campo", "Información",
 			// Graph (25-26)
 			"Vacio ", "Resetear",
 			// 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.",
+			"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 informacion a mostrar", "Mostrar energia total de los objetos",
+			"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", "Direccion", "Adelante", "Atras", "Alcance", "Todo", "Uno",
+			"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.",
+			"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 ",
+			"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",
+			"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 Simulacion:", "Algoritmo:", "nada seleccionado", "exito",
-			// Extra (88)
-			"Esta seguro que quiere cerrar el programa?" };
+			"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" };
 
 	static String[] arrayDE = {
 			// ToolBar (0-16)
@@ -116,8 +124,12 @@ public class Languages {
 			"aktueller Fluss", "Max. Kapazität", "Status",
 			// Info SimulationMenu (83-87)
 			"Simulieren", "Simulationsgeschwindigkeit:", "Algorithmus:", "nichts ausgewählt", "Erfolg",
-			// Extra (88)
-			"Sind Sie sich sicher, dass Sie das Programm beenden wollen?" };
+			// 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" };
 
 	static String[] arrayCZ = {
 			// ToolBar (0-16)
@@ -152,8 +164,12 @@ public class Languages {
 			"Current flow", "Max. Capacity", "Status",
 			// Info SimulationMenu (83-87)
 			"Simulate", "Simulation Speed:", "Algorithm:", "choose folder", "success",
-			// Extra (88)
-			"Are you sure you want to exit?" };
+			// 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" };
 
 	static String[] arrayZH = {
 			// ToolBar (0-16)
@@ -188,8 +204,12 @@ public class Languages {
 			"Current flow", "Max. Capacity", "Status",
 			// Info SimulationMenu (83-87)
 			"Simulate", "Simulation Speed:", "Algorithm:", "choose folder", "success",
-			// Extra (88)
-			"Are you sure you want to exit?" };
+			// 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" };
 
 	public static String[] getLanguage() {
 		switch (languageVar) {

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

@@ -40,11 +40,11 @@ public class SimulationMenu extends JMenuBar {
 	private static final long serialVersionUID = 1L;
 
 	private JPanel menuPanel = new JPanel();
-	private JRadioButton simButton = new JRadioButton(Languages.getLanguage()[83]);
-	private JLabel simSpeedLabel = new JLabel(Languages.getLanguage()[84]);
+	JRadioButton simButton = new JRadioButton(Languages.getLanguage()[83]);
+	JLabel simSpeedLabel = new JLabel(Languages.getLanguage()[84]);
 	private JTextField simSpeedText = new JTextField("1000");
 	private JComboBox algoCombo = new JComboBox<>();
-	private JButton algoFolderButton = new JButton(Languages.getLanguage()[85]);
+	JButton algoFolderButton = new JButton(Languages.getLanguage()[85]);
 	private HashMap<String, File> algosHash = new HashMap<>();
 
 	// root Directory

+ 20 - 15
src/ui/view/TimePanel.java

@@ -22,9 +22,11 @@ import classes.SubNet;
 import ui.controller.Control;
 import ui.model.Model;
 import javax.swing.BoxLayout;
+
 /**
- * This Class represents a Panel where the User can start and stop the Simulation.
- * He Can also reset the Simulation and click through every Iteration.
+ * This Class represents a Panel where the User can start and stop the
+ * Simulation. He Can also reset the Simulation and click through every
+ * Iteration.
  * 
  * @author Gruppe14
  */
@@ -35,10 +37,10 @@ public class TimePanel extends JPanel {
 
 	JSlider timeSlider = new JSlider();
 	private final JPanel timeBtnPanel = new JPanel();
-	private final JButton playBtn = new JButton();
-	private final JButton timeResetBtn = new JButton();
-	private final JButton timeForwardBtn = new JButton();
-	private final JButton timeBackwardBtn = new JButton();
+	final JButton playBtn = new JButton();
+	final JButton timeResetBtn = new JButton();
+	final JButton timeForwardBtn = new JButton();
+	final JButton timeBackwardBtn = new JButton();
 	private Timer timer;
 	private boolean running = false;
 
@@ -46,8 +48,11 @@ public class TimePanel extends JPanel {
 
 	/**
 	 * Constructor.
-	 * @param mod the Model
-	 * @param cont the Controller
+	 * 
+	 * @param mod
+	 *            the Model
+	 * @param cont
+	 *            the Controller
 	 */
 	public TimePanel(Model mod, Control cont) {
 		super();
@@ -78,7 +83,7 @@ public class TimePanel extends JPanel {
 		timeSlider.setPaintLabels(true);
 		timeSlider.setMinorTickSpacing(1);
 		timeSlider.setMajorTickSpacing(5);
-		timeSlider.setToolTipText("Time Slider");
+		timeSlider.setToolTipText(Languages.getLanguage()[93]);
 		timeSlider.setMaximum(model.getIterations() - 1);
 		timeSlider.setValue(0);
 		timeSlider.setBackground(Color.WHITE);
@@ -95,7 +100,7 @@ public class TimePanel extends JPanel {
 		timeBtnPanel.setLayout(new BoxLayout(timeBtnPanel, BoxLayout.X_AXIS));
 
 		// Buttons
-		playBtn.setToolTipText("Play");
+		playBtn.setToolTipText(Languages.getLanguage()[89]);
 
 		playBtn.setBackground(Color.WHITE);
 		playBtn.setBorderPainted(false);
@@ -118,7 +123,7 @@ public class TimePanel extends JPanel {
 				}
 			}
 		});
-		timeResetBtn.setToolTipText("Reset");
+		timeResetBtn.setToolTipText(Languages.getLanguage()[90]);
 
 		timeResetBtn.setBorderPainted(false);
 		timeResetBtn.setBackground(Color.WHITE);
@@ -132,7 +137,7 @@ public class TimePanel extends JPanel {
 				controller.calculateStateForCurrentTimeStep();
 			}
 		});
-		timeForwardBtn.setToolTipText("Forward");
+		timeForwardBtn.setToolTipText(Languages.getLanguage()[91]);
 
 		timeForwardBtn.setBorderPainted(false);
 		timeForwardBtn.setContentAreaFilled(false);
@@ -145,7 +150,7 @@ public class TimePanel extends JPanel {
 				controller.setCurIteration(timeSlider.getValue());
 			}
 		});
-		timeBackwardBtn.setToolTipText("Backward");
+		timeBackwardBtn.setToolTipText(Languages.getLanguage()[92]);
 
 		timeBackwardBtn.setBackground(Color.WHITE);
 		timeBackwardBtn.setBorderPainted(false);
@@ -167,13 +172,13 @@ public class TimePanel extends JPanel {
 		this.add(timeBtnPanel, BorderLayout.WEST);
 		this.add(timeSlider);
 	}
-	
+
 	/**
 	 * Retunrs the TimeSlider.
 	 * 
 	 * @return the TimeSlider
 	 */
-	public JSlider getTimeSlider(){
+	public JSlider getTimeSlider() {
 		return timeSlider;
 	}
 }