|
@@ -181,6 +181,7 @@ public abstract class AbstractCanvas extends JPanel {
|
|
* cpsObject which the supplyBar should be drawn for
|
|
* cpsObject which the supplyBar should be drawn for
|
|
*/
|
|
*/
|
|
protected void paintSupplyBar(Graphics g, AbstractCpsObject cps) {
|
|
protected void paintSupplyBar(Graphics g, AbstractCpsObject cps) {
|
|
|
|
+ g2.setColor(Color.black);
|
|
/**
|
|
/**
|
|
* draw and fill the supply Bar
|
|
* draw and fill the supply Bar
|
|
*/
|
|
*/
|
|
@@ -262,7 +263,7 @@ public abstract class AbstractCanvas extends JPanel {
|
|
/**
|
|
/**
|
|
* if object should be replaced -> move bar below the ReplacementIndicator
|
|
* if object should be replaced -> move bar below the ReplacementIndicator
|
|
*/
|
|
*/
|
|
- if(mayBeReplaced==cps) barY += 6;
|
|
|
|
|
|
+ if(mayBeReplaced==cps) barY += 3;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Width of the bar
|
|
* Width of the bar
|
|
@@ -316,7 +317,7 @@ public abstract class AbstractCanvas extends JPanel {
|
|
|| model.getSelectedCpsObjects().contains(cps) || tempSelected.contains(cps))) {
|
|
|| model.getSelectedCpsObjects().contains(cps) || tempSelected.contains(cps))) {
|
|
img = Util.loadImage(this, "/Images/node_selected.png");
|
|
img = Util.loadImage(this, "/Images/node_selected.png");
|
|
} else {
|
|
} else {
|
|
- if (cps instanceof HolonSwitch) {//TODO. What the hell are thes ecalls doing here?
|
|
|
|
|
|
+ if (cps instanceof HolonSwitch) {//TODO: What the hell are thes ecalls doing here?
|
|
if (((HolonSwitch) cps).getState(model.getCurIteration())) {
|
|
if (((HolonSwitch) cps).getState(model.getCurIteration())) {
|
|
((HolonSwitch) cps).setAutoState(true);
|
|
((HolonSwitch) cps).setAutoState(true);
|
|
} else {
|
|
} else {
|
|
@@ -326,11 +327,25 @@ public abstract class AbstractCanvas extends JPanel {
|
|
// Highlighting
|
|
// Highlighting
|
|
if ((cps == tempCps && model.getSelectedCpsObjects().size() == 0 && tempSelected.size() == 0)
|
|
if ((cps == tempCps && model.getSelectedCpsObjects().size() == 0 && tempSelected.size() == 0)
|
|
|| model.getSelectedCpsObjects().contains(cps) || tempSelected.contains(cps)) {
|
|
|| model.getSelectedCpsObjects().contains(cps) || tempSelected.contains(cps)) {
|
|
|
|
+ /**
|
|
|
|
+ * draw selected Blue Frame
|
|
|
|
+ */
|
|
g2.setColor(Color.BLUE);
|
|
g2.setColor(Color.BLUE);
|
|
g2.fillRect((int) (cps.getPosition().x - controller.getScaleDiv2() - scalediv20),
|
|
g2.fillRect((int) (cps.getPosition().x - controller.getScaleDiv2() - scalediv20),
|
|
(int) (cps.getPosition().y - controller.getScaleDiv2() - scalediv20),
|
|
(int) (cps.getPosition().y - controller.getScaleDiv2() - scalediv20),
|
|
(int) (controller.getScale() + (scalediv20 * 2)),
|
|
(int) (controller.getScale() + (scalediv20 * 2)),
|
|
(int) (controller.getScale() + (scalediv20 * 2)));
|
|
(int) (controller.getScale() + (scalediv20 * 2)));
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ if(cps instanceof HolonObject){
|
|
|
|
+ g2.setColor(((HolonObject)cps).getColor());
|
|
|
|
+ g2.fillRect((int) (cps.getPosition().x - controller.getScaleDiv2() - scalediv20+3),
|
|
|
|
+ (int) (cps.getPosition().y - controller.getScaleDiv2() - scalediv20+3),
|
|
|
|
+ (int) (controller.getScale() + (scalediv20 * 2)-6),
|
|
|
|
+ (int) (controller.getScale() + (scalediv20 * 2)-6));
|
|
|
|
+ }
|
|
|
|
+
|
|
if (showedInformation[1] && cps instanceof HolonObject) {
|
|
if (showedInformation[1] && cps instanceof HolonObject) {
|
|
g2.setColor(Color.BLACK);
|
|
g2.setColor(Color.BLACK);
|
|
float totalEnergy = ((HolonObject) cps).getCurrentEnergyAtTimeStep(model.getCurIteration());
|
|
float totalEnergy = ((HolonObject) cps).getCurrentEnergyAtTimeStep(model.getCurIteration());
|
|
@@ -625,11 +640,11 @@ public abstract class AbstractCanvas extends JPanel {
|
|
g2.setColor(Color.RED);
|
|
g2.setColor(Color.RED);
|
|
g2.fillRect(
|
|
g2.fillRect(
|
|
(int) (mayBeReplaced.getPosition().x
|
|
(int) (mayBeReplaced.getPosition().x
|
|
- - controller.getScaleDiv2() - (scalediv20 + 5)),
|
|
|
|
|
|
+ - controller.getScaleDiv2() - (scalediv20 + 3)),
|
|
(int) (mayBeReplaced.getPosition().y
|
|
(int) (mayBeReplaced.getPosition().y
|
|
- - controller.getScaleDiv2() - (scalediv20 + 5)),
|
|
|
|
- (int) (controller.getScale() + ((scalediv20 + 5) * 2)),
|
|
|
|
- (int) (controller.getScale() + ((scalediv20 + 5) * 2)));
|
|
|
|
|
|
+ - controller.getScaleDiv2() - (scalediv20 + 3)),
|
|
|
|
+ (int) (controller.getScale() + ((scalediv20 + 3) * 2)),
|
|
|
|
+ (int) (controller.getScale() + ((scalediv20 + 3) * 2)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|