Browse Source

schöne Icons :D

Kevin Trometer 7 years ago
parent
commit
0a777f8173

BIN
bin/Images/Thumbs.db


BIN
bin/ui/view/GUI.class


BIN
bin/ui/view/MyCanvas.class


BIN
res/Images/Thumbs.db


+ 3 - 6
src/ui/view/GUI.java

@@ -155,13 +155,11 @@ public class GUI implements CategoryListener {
 		canvas.setBackground(Color.WHITE);
 		canvas.setPreferredSize(new Dimension(10000, 10000));
 		JScrollPane canvasSP = new JScrollPane(canvas);
-		canvasSP.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
-		canvasSP.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
-
-		tabbedPane.addTab("Modeling", null, canvasSP, null);
+		
+		tabbedPane.addTab("Modeling", new ImageIcon(new ImageIcon(this.getClass().getResource("/Images/home.png")).getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)), canvasSP, "Model a CPS");
 
 		
-		tabbedPane.addTab("Simulation", null, scrollPane_2, null);
+		tabbedPane.addTab("Simulation", new ImageIcon(new ImageIcon(this.getClass().getResource("/Images/Dummy_House.png")).getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH)), scrollPane_2, "Simulate the CPS");
 		dtrpnHereWillBe.setText("Here will be the Simulation");
 
 		scrollPane_2.setViewportView(dtrpnHereWillBe);
@@ -234,7 +232,6 @@ public class GUI implements CategoryListener {
 				try {
 					if (dragging) {
 						CpsObject h = null;
-						System.out.println(tempCps.getClass().toString());
 						if(tempCps.getClass() == HolonObject.class) {h = new HolonObject(tempCps);}
 						if(tempCps.getClass() == HolonSwitch.class) {h = new HolonSwitch(tempCps);}
 						if(tempCps.getClass() == HolonTransformer.class) {h = new HolonTransformer(tempCps);}

+ 2 - 8
src/ui/view/MyCanvas.java

@@ -90,13 +90,11 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
 	public void paintComponent(Graphics g) {
 		super.paintComponent(g);
 		g2 = (Graphics2D) g;
-		g2.setStroke(new BasicStroke(GlobalVariables.SCALE/15));
 		RenderingHints rh = new RenderingHints(
 	             RenderingHints.KEY_ANTIALIASING,
 	             RenderingHints.VALUE_ANTIALIAS_ON);
 	    g2.setRenderingHints(rh);
 	    
-		
 		//Selection
 		if(selectRect != null){
 			g2.setColor(Color.GREEN);
@@ -114,6 +112,7 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
 			}
 		}
 		
+		//Highlighted Edge
 		g2.setColor(Color.GREEN);		
 		for (CpsObject cps : model.getObjectsOnCanvas()) {
 			for (CpsObject con : cps.getConnectedTo()) {
@@ -184,12 +183,7 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
 			tempCps.setPos(e.getX() - GlobalVariables.SCALE_DIVIDED2, e.getY() - GlobalVariables.SCALE_DIVIDED2);
 			tempCps = null;
 		}
-		if(y+GlobalVariables.SCALE>this.getHeight()){
-			this.setPreferredSize(new Dimension(this.getWidth(), y+GlobalVariables.SCALE));
-		}
-		if(x+GlobalVariables.SCALE>this.getHeight()){
-			this.setPreferredSize(new Dimension(x+GlobalVariables.SCALE,this.getHeight() ));
-		}
+		
 		// Rechtsklick Liste
 		if (e.getButton() == e.BUTTON3) {
 			if (e.getButton() == e.BUTTON3 && tempCps != null) {