diff --git a/src/main/java/pikelake/environment/Movement2DWithinShapeObserver.java b/src/main/java/pikelake/environment/Movement2DWithinShapeObserver.java index b523f04210324fa01d03988a7bbce039c4677c75..ceda3bc5481b0eabde7d0979088526741d284bfc 100644 --- a/src/main/java/pikelake/environment/Movement2DWithinShapeObserver.java +++ b/src/main/java/pikelake/environment/Movement2DWithinShapeObserver.java @@ -64,6 +64,7 @@ public class Movement2DWithinShapeObserver extends ObserverListener implements C private Color shapeColor; @Description (name="HSI color",tooltip="HSI color") private Color hsiColor; + private double hsiMaxValueThreshold=0.5; @Description (name="Text color",tooltip="Text color") private Color textColor; @@ -94,7 +95,6 @@ public class Movement2DWithinShapeObserver extends ObserverListener implements C public Movement2DWithinShapeObserver(int margin,Color bgColor,Color shapeColor) { this.margin = margin; this.bgColor = bgColor; - this.shapeColor = shapeColor; } public String getTitle() { @@ -257,7 +257,8 @@ public class Movement2DWithinShapeObserver extends ObserverListener implements C xHSI2 = (int) (xHSI * (widthMax / grid.getGridWidth())); yHSI2 = (int) (yHSI * (heightMax / grid.getGridHeight())); - g2d.fillRect((int) xHSI2, (int) yHSI2, 3, 3); + g.setColor(new Color(0.43f, (float) (Math.min(1,grid.getCell(cptCell).getHabitatQuality()/hsiMaxValueThreshold)), 0.13f)); + g2d.fillRect((int) xHSI2, (int) yHSI2, 3, 3); xx[cptCell] = xHSI2; yy[cptCell] = yHSI2;