Commit c4249470 authored by patrick.lambert's avatar patrick.lambert
Browse files

fill only river and inshore basins when presence

parent cdf4e2f9
......@@ -77,7 +77,7 @@ public class RIOBasinNetworkObserverPresence extends ObserverListener implements
public void init(Pilot pilot) {
this.pilot = pilot;
if (this.colorScaleEnum == null) {
if (this.colorScaleEnum == null)
this.colorScaleEnum = ColorScaleEnum.RedsScale;
try {
......@@ -112,13 +112,12 @@ public class RIOBasinNetworkObserverPresence extends ObserverListener implements
}
}
}
// reader.close();
// scanner.close();
reader.close();
scanner.close();
} catch (Exception e) {
e.printStackTrace();
}
}
// the Jpanal that holds all the components to be displayed
display = new JPanel(new BorderLayout());
......@@ -138,7 +137,6 @@ public class RIOBasinNetworkObserverPresence extends ObserverListener implements
// load basin to a have access to the shape
bn = (RIOBasinNetworkWithContinent) pilot.getAquaticWorld().getEnvironment();
}
......@@ -265,8 +263,6 @@ public class RIOBasinNetworkObserverPresence extends ObserverListener implements
// AffineTransform af = new AffineTransform(scaling, 0., 0., -scaling, -minX * scaling, H + minY * scaling);
AffineTransform af = new AffineTransform(scaling, 0., 0., -scaling, -minX * scaling, maxY * scaling);
// System.out.println(af.toString());
Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(new BasicStroke(2)); // define the line
......@@ -315,17 +311,13 @@ public class RIOBasinNetworkObserverPresence extends ObserverListener implements
}
g2d.draw(displayShape);
if (basin instanceof RiverBasin | basin instanceof InshoreBasin) {
int presence = -1;
if (presences.get(period).get(basinName) != null)
presence = presences.get(period).get(basinName);
else
System.out.println(basinName + " is not present in the presence file");
/*
* if (presence == 1) { g.setColor(Color.RED); } else if (presence == 0) { g.setColor(Color.WHITE); }
* else g.setColor(Color.LIGHT_GRAY);
*/
if (presence > 0)
g.setColor(colorScaleEnum.getScale().getColor(presence));
else if (presence == 0)
......@@ -337,6 +329,7 @@ public class RIOBasinNetworkObserverPresence extends ObserverListener implements
}
}
}
}
public enum ColorScaleEnum {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment