Browse Source

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

Edgardo Palza 7 years ago
parent
commit
40e5492980
2 changed files with 12 additions and 10 deletions
  1. 0 4
      src/ui/view/StatPanel2.java
  2. 12 6
      src/ui/view/StatisticGraphPanel.java

+ 0 - 4
src/ui/view/StatPanel2.java

@@ -584,10 +584,6 @@ public class StatPanel2 extends JSplitPane implements GraphListener {
 									&& graphNrTxtField.getText().length() > 0) {
 								tmp = new StatisticGraphPanel(controller.getModel(), controller,
 										graphNrTxtField.getText(), graphHashtable);
-								//tmp.setPreferredSize(new Dimension(280, 150));
-								//tmp.setMaximumSize(new Dimension(1000, 1000));
-								// tmp.setMinimumSize(new Dimension(100, 45));
-								tmp.setBorder(new LineBorder(new Color(0, 0, 0), 1));
 								graphPanel.add(tmp);
 								graphPanel.add(Box.createRigidArea(new Dimension(50, 50)));
 								graphPanel.revalidate();

+ 12 - 6
src/ui/view/StatisticGraphPanel.java

@@ -33,10 +33,13 @@ import java.io.IOException;
 import java.util.Hashtable;
 
 import javax.imageio.ImageIO;
+import javax.swing.BorderFactory;
 import javax.swing.BoxLayout;
 import javax.swing.GroupLayout.Alignment;
 
 import java.awt.GridLayout;
+import javax.swing.border.EmptyBorder;
+import java.awt.Component;
 
 public class StatisticGraphPanel extends JPanel {
 
@@ -70,6 +73,7 @@ public class StatisticGraphPanel extends JPanel {
 	 */
 	public StatisticGraphPanel(Model mod, Control cont, String name, Hashtable<String, StatisticGraphPanel> gHt) {
 		super();
+		setBorder(new EmptyBorder(0, 0, 0, 0));
 		this.model = mod;
 		this.controller = cont;
 		this.sGraph = new StatisticGraph(mod, cont);
@@ -79,11 +83,11 @@ public class StatisticGraphPanel extends JPanel {
 
 		// ******************** Component Propertys ***************//
 		// Graph
-		this.setPreferredSize(new Dimension(300, 200));
-		//sGraph.setPreferredSize(new Dimension(200, 200));
-		//sGraph.setMinimumSize(new Dimension(100, 150));
-		this.setMaximumSize(new Dimension(700, 200));
-		this.setMinimumSize(new Dimension(300, 200));
+		//this.setPreferredSize(new Dimension(300, 200));
+		sGraph.setPreferredSize(new Dimension(200, 200));
+		sGraph.setMinimumSize(new Dimension(100, 150));
+		//this.setMaximumSize(new Dimension(700, 200));
+		//this.setMinimumSize(new Dimension(300, 200));
 
 		// Graph Name
 		graphNameLabel = new JLabel(graphName);
@@ -119,6 +123,7 @@ public class StatisticGraphPanel extends JPanel {
 		// Maximum Label
 		maximumLabel.setVerticalAlignment(SwingConstants.TOP);
 		maximumLabel.setMinimumSize(new Dimension(30, 10));
+		legendPanel.setAlignmentY(Component.BOTTOM_ALIGNMENT);
 
 		// Legend Panel
 		legendPanel.setLayout(new GridLayout(0, 5, 0, 0));
@@ -237,7 +242,8 @@ public class StatisticGraphPanel extends JPanel {
 		} else {
 			b = new JLabel(property);
 		}
-		b.setBackground(set.getColor());
+		//b.setBackground(set.getColor());
+		b.setBorder(BorderFactory.createLineBorder(set.getColor()));
 		int color = Math.max(Math.max(set.getColor().getRed(), set.getColor().getGreen()), set.getColor().getBlue());
 		if (color <= 128) {
 			b.setForeground(Color.WHITE);