From ad07c9cbf30dd1fb196fef56b0b8c1963a10340c Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 19 Apr 2007 05:25:12 +0100 Subject: [PATCH] checkpoint --- src/edu/berkeley/slipway/gui/GuiCell.java | 20 ++++++-------------- src/edu/berkeley/slipway/gui/GuiGate.java | 3 ++- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/edu/berkeley/slipway/gui/GuiCell.java b/src/edu/berkeley/slipway/gui/GuiCell.java index 02795be..25e177a 100644 --- a/src/edu/berkeley/slipway/gui/GuiCell.java +++ b/src/edu/berkeley/slipway/gui/GuiCell.java @@ -70,29 +70,21 @@ public class GuiCell { R xring = gateArea.plus(-4, -4, 4, 4); R yring = gateArea.plus(-6, -6, 6, 6); + P xip = r.corner(fpslicCell.xi()); + P yip = r.corner(fpslicCell.yi()); if (xgate != null) { xgate.rotation(fpslicCell.yi()); xgate.gateArea = gateArea; xgate.r = xgater; + if (xip != null) xgate.route(g, xip, xring, 0, XGATE_COLOR); + if (yip != null) xgate.route(g, yip, yring, 1, YGATE_COLOR); } if (ygate != null) { ygate.rotation(fpslicCell.yi()); ygate.gateArea = gateArea; ygate.r = ygater; - } - - g.color(XGATE_COLOR); - P p = r.corner(fpslicCell.xi()); - if (p!=null) { - if (ygate != null) ygate.route(g, p, xring, 1); - if (xgate != null) xgate.route(g, p, xring, 0); - } - - p = r.corner(fpslicCell.yi()); - g.color(YGATE_COLOR); - if (p!=null) { - if (ygate != null) ygate.route(g, p, yring, 0); - if (xgate != null) xgate.route(g, p, yring, 1); + if (xip != null) ygate.route(g, xip, xring, 1, XGATE_COLOR); + if (yip != null) ygate.route(g, yip, yring, 0, YGATE_COLOR); } if (xgater != null) { diff --git a/src/edu/berkeley/slipway/gui/GuiGate.java b/src/edu/berkeley/slipway/gui/GuiGate.java index 00bc43b..8e08741 100644 --- a/src/edu/berkeley/slipway/gui/GuiGate.java +++ b/src/edu/berkeley/slipway/gui/GuiGate.java @@ -77,7 +77,8 @@ public class GuiGate { } } - public void route(G g, P p, R ring, int input) { + public void route(G g, P p, R ring, int input, int color) { + g.color(color); g.route(p, ring, getInput(input)); g.line(getInput(input), getInputDest(input)); } -- 1.7.10.4