Browse Source

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

Edgardo Palza 7 years ago
parent
commit
7d7cc33424

+ 1 - 0
src/ui/view/AboutUsPopUp.java

@@ -36,6 +36,7 @@ public class AboutUsPopUp extends JFrame {
 				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
 		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
 		setBounds(100, 100, 500, 800);
+		setLocationRelativeTo(this.getParent());
 		getContentPane().setLayout(new BorderLayout());
 		titel.setBounds(150, 30, 100, 20);
 		Font fontTitle = new Font("Titel", 2, 35);

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

@@ -42,20 +42,20 @@ public class AddElementPopUp extends JDialog {
 
 	/**
 	 * Launch the application.
-	 * 
+	 *
 	 * @param args
 	 *            standard
 	 */
-	public static void main(String[] args) {
-		try {
-
-			AddElementPopUp dialog = new AddElementPopUp();
-			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-			dialog.setVisible(true);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
+//	public static void main(String[] args) {
+//		try {
+//
+//			AddElementPopUp dialog = new AddElementPopUp();
+//			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+//			dialog.setVisible(true);
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//		}
+//	}
 
 	/**
 	 * Create the dialog.
@@ -66,6 +66,7 @@ public class AddElementPopUp extends JDialog {
 				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
 		setBounds(100, 100, 400, 190);
+		setLocationRelativeTo(this.getParent());
 		getContentPane().setLayout(new BorderLayout());
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);

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

@@ -21,17 +21,7 @@ import java.net.URLDecoder;
 import java.security.CodeSource;
 import java.util.ArrayList;
 
-import javax.swing.DefaultListModel;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.SwingConstants;
+import javax.swing.*;
 import javax.swing.border.EmptyBorder;
 import javax.swing.filechooser.FileNameExtensionFilter;
 
@@ -69,19 +59,19 @@ public class AddObjectPopUp extends JDialog {
 
 	/**
 	 * Launch the application.
-	 * 
+	 *
 	 * @param args
 	 *            standard
 	 */
-	public static void main(String[] args) {
-		try {
-			AddObjectPopUp dialog = new AddObjectPopUp(false, null, null);
-			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-			dialog.setVisible(true);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
+//	public static void main(String[] args) {
+//		try {
+//			AddObjectPopUp dialog = new AddObjectPopUp(false, null, null);
+//			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+//			dialog.setVisible(true);
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//		}
+//	}
 
 	/**
 	 * Create the dialog.
@@ -99,11 +89,12 @@ public class AddObjectPopUp extends JDialog {
 		this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
 				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
 		setBounds(100, 100, 450, 342);
+		setLocationRelativeTo(this.getParent());
 		getContentPane().setLayout(new BorderLayout());
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);
 		contentPanel.setLayout(null);
-		hElements = new ArrayList<HolonElement>();
+		hElements = new ArrayList<>();
 		this.setTitle(Languages.getLanguage()[58]);
 		{
 			JLabel lblName = new JLabel(Languages.getLanguage()[59]);

+ 1 - 0
src/ui/view/BackgroundPopUp.java

@@ -92,6 +92,7 @@ public class BackgroundPopUp extends JDialog {
 		this.setIconImage(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage()
 				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
 		setBounds(100, 100, 600, 340);
+		setLocationRelativeTo(this.getParent());
 
 		panelBrowse.setBorder(null);
 		panelImageRadio.setBorder(null);

+ 1 - 0
src/ui/view/CanvasResizePopUp.java

@@ -56,6 +56,7 @@ public class CanvasResizePopUp extends JDialog {
 				.getScaledInstance(30, 30, Image.SCALE_SMOOTH));
 		this.setTitle("Set the Size of the View");
 		setBounds(200, 100, 200, 100);
+		setLocationRelativeTo(this.getParent());
 
 		// MainPanel
 		tFieldWidht.setText("" + model.getCanvasX());

+ 1 - 0
src/ui/view/DisplayedInformationPopUp.java

@@ -41,6 +41,7 @@ public class DisplayedInformationPopUp extends JDialog {
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
 		this.setTitle("Edit Displayed Informations");
 		setBounds(100, 100, 400, 276);
+		setLocationRelativeTo(this.getParent());
 		getContentPane().setLayout(new BorderLayout());
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);

+ 11 - 10
src/ui/view/EditEdgesPopUp.java

@@ -45,16 +45,16 @@ public class EditEdgesPopUp extends JDialog {
 	 * @param args
 	 *            standard
 	 */
-	public static void main(String[] args) {
-		try {
-
-			EditEdgesPopUp dialog = new EditEdgesPopUp();
-			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-			dialog.setVisible(true);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
+//	public static void main(String[] args) {
+//		try {
+//
+//			EditEdgesPopUp dialog = new EditEdgesPopUp();
+//			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+//			dialog.setVisible(true);
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//		}
+//	}
 
 	/**
 	 * Constructor.
@@ -64,6 +64,7 @@ public class EditEdgesPopUp extends JDialog {
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
 		this.setTitle(Languages.getLanguage()[46]);
 		setBounds(100, 100, 600, 220);
+		setLocationRelativeTo(this.getParent());
 		getContentPane().setLayout(new BorderLayout());
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);

+ 2 - 9
src/ui/view/SearchPopUp.java

@@ -2,21 +2,13 @@ package ui.view;
 
 import java.awt.BorderLayout;
 
-import javax.swing.JDialog;
-import javax.swing.JPanel;
+import javax.swing.*;
 import javax.swing.border.EmptyBorder;
 
 import classes.AbstractCpsObject;
 
-import javax.swing.JLabel;
-
 import java.awt.Font;
 
-import javax.swing.ButtonGroup;
-import javax.swing.JTextField;
-import javax.swing.JRadioButton;
-import javax.swing.JButton;
-
 import ui.controller.Control;
 import java.awt.event.ActionListener;
 import java.util.ArrayList;
@@ -55,6 +47,7 @@ public class SearchPopUp extends JDialog {
 		setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
 		this.setTitle(Languages.getLanguage()[35]);
 		setBounds(100, 100, 250, 360);
+		setLocationRelativeTo(this.getParent());
 		getContentPane().setLayout(new BorderLayout());
 		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
 		getContentPane().add(contentPanel, BorderLayout.CENTER);