[virtualcommons-svn] commit/irrigation: alllee: fixes issue 7
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-02-23 00:00:26
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/64a05a84e892/ changeset: 64a05a84e892 user: alllee date: 2012-02-23 01:00:18 summary: fixes issue 7 still need to tweak the graying out of the canal, the extent is off, and the bug with displaying the immediate downstream neighbor is still present affected #: 2 files diff -r fc7949ef0c9ece1321263b4036e2ad039e53d40a -r 64a05a84e892be11cc5cc56ea6e7e71ba4d6fc4d src/main/java/edu/asu/commons/irrigation/client/CanalPanel.java --- a/src/main/java/edu/asu/commons/irrigation/client/CanalPanel.java +++ b/src/main/java/edu/asu/commons/irrigation/client/CanalPanel.java @@ -98,21 +98,32 @@ Graphics2D graphics2D = (Graphics2D) graphics; graphics2D.setColor(Color.BLUE); graphics2D.fillRect(0, 0, reservoirHeight, reservoirWidth); - // draw gates + + // draws the canal leading up to the gates for (int i = 0; i < NUMBER_OF_GATES - 1; i++) { - graphics2D.setColor(Color.BLUE); - graphics2D.fillRect(gates[i].getX(), gates[i].getY(), - gates[i].getWidth(), gates[i].getHeight()); + ClientData clientData = sortedClientDataList.get(i); + if (clientDataModel.getClientData().isImmediateNeighbor(clientData)) { + graphics2D.setColor(Color.BLUE); + graphics2D.fillRect(gates[i].getX(), gates[i].getY(), + gates[i].getWidth(), gates[i].getHeight()); + } + else { + graphics2D.setColor(Color.GRAY); + graphics2D.fillRect(gates[i].getX(), gates[i].getY(), + gates[i].getWidth(), gates[i].getHeight()); + } } for (ClientData clientData : sortedClientDataList) { int priority = clientData.getPriority(); Gate gate = gates[priority]; - graphics2D.setColor(Color.BLUE); - graphics2D.fillRect(gate.getOpeningsX(), gate.getOpeningsY(), - gate.getOpeningsWidth(), gate.getOpeningsHeight()); - graphics2D.setColor(Gate.DEFAULT_COLOR); - graphics2D.drawLine(gate.getx1(), gate.gety1(), gate.getx2(), - gate.gety2()); + if (clientDataModel.getClientData().isImmediateNeighbor(clientData)) { + graphics2D.setColor(Color.BLUE); + graphics2D.fillRect(gate.getOpeningsX(), gate.getOpeningsY(), + gate.getOpeningsWidth(), gate.getOpeningsHeight()); + graphics2D.setColor(Gate.DEFAULT_COLOR); + graphics2D.drawLine(gate.getx1(), gate.gety1(), gate.getx2(), + gate.gety2()); + } } graphics2D.setColor(Color.BLUE); diff -r fc7949ef0c9ece1321263b4036e2ad039e53d40a -r 64a05a84e892be11cc5cc56ea6e7e71ba4d6fc4d src/main/java/edu/asu/commons/irrigation/client/Gate.java --- a/src/main/java/edu/asu/commons/irrigation/client/Gate.java +++ b/src/main/java/edu/asu/commons/irrigation/client/Gate.java @@ -9,7 +9,7 @@ */ public class Gate { - public final static Color DEFAULT_COLOR = Color.black; + public final static Color DEFAULT_COLOR = Color.WHITE; private boolean open = false; Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |