Browse Source

small canvas fix

Kevin Trometer 8 years ago
parent
commit
446c7aca84
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/ui/view/MyCanvas.java

+ 5 - 0
src/ui/view/MyCanvas.java

@@ -267,6 +267,11 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 							cps.getPosition().y - (controller.getScale() / 20),
 							controller.getScale() + ((controller.getScale() / 20) * 2),
 							controller.getScale() + ((controller.getScale() / 20) * 2));
+					if(showedInformation[1]){
+						g2.setColor(Color.BLACK);
+						float totalEnergy = ((HolonObject) cps).getCurrentEnergyAtTimeStep(model.getCurIteration());
+						g2.drawString(Float.toString(totalEnergy), cps.getPosition().x, cps.getPosition().y - 10);
+					}
 				} else if (cps instanceof HolonObject) {
 					g2.setColor(((HolonObject) cps).getColor());