Browse Source

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

dominik.rieder 7 years ago
parent
commit
6e9bc34a21
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/ui/view/MyCanvas.java

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

@@ -182,10 +182,15 @@ class MyCanvas extends JPanel implements MouseListener, MouseMotionListener {
 					g2.fillRect((int) selectRect.getX(), (int) selectRect.getY(), (int) selectRect.getWidth(),
 							(int) selectRect.getHeight());
 				} else if (cps instanceof HolonObject) {
-					g2.setColor(Color.GRAY);
+					if (((HolonObject) cps).getSupplied()) {
+						g2.setColor(Color.GREEN);
+					} else {
+						g2.setColor(Color.GRAY);
+					}
 					g2.fillRect(cps.getPosition().x - (controller.getScale() / 20),
-							cps.getPosition().y - (controller.getScale() / 20), (int) selectRect.getWidth(),
-							(int) selectRect.getHeight());
+							cps.getPosition().y - (controller.getScale() / 20), 
+							controller.getScale() + ((controller.getScale() / 20) * 2),
+							controller.getScale() + ((controller.getScale() / 20) * 2));
 				}
 				File checkPath = new File(cps.getImage());
 				if (checkPath.exists()) {