From: adam Date: Thu, 19 Apr 2007 04:22:56 +0000 (+0100) Subject: checkpoint X-Git-Tag: mpar_demo_release~6 X-Git-Url: http://git.megacz.com/?p=slipway.git;a=commitdiff_plain;h=d90ce9d7b3afdcd6bb5591bc7e8ef34ff0afcabe checkpoint --- diff --git a/src/edu/berkeley/slipway/gui/GuiCell.java b/src/edu/berkeley/slipway/gui/GuiCell.java index ebd3044..02795be 100644 --- a/src/edu/berkeley/slipway/gui/GuiCell.java +++ b/src/edu/berkeley/slipway/gui/GuiCell.java @@ -84,27 +84,15 @@ public class GuiCell { g.color(XGATE_COLOR); P p = r.corner(fpslicCell.xi()); if (p!=null) { - if (ygate != null) { - g.route(p, xring, ygate.getInput(1)); - g.line(ygate.getInput(1), ygate.getInputDest(1)); - } - if (xgate != null) { - g.route(p, xring, xgate.getInput(0)); - g.line(xgate.getInput(0), xgate.getInputDest(0)); - } + 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) { - g.route(p, yring, ygate.getInput(0)); - g.line(ygate.getInput(0), ygate.getInputDest(0)); - } - if (xgate != null) { - g.route(p, yring, xgate.getInput(1)); - g.line(xgate.getInput(1), xgate.getInputDest(1)); - } + if (ygate != null) ygate.route(g, p, yring, 0); + if (xgate != null) xgate.route(g, p, yring, 1); } if (xgater != null) { diff --git a/src/edu/berkeley/slipway/gui/GuiGate.java b/src/edu/berkeley/slipway/gui/GuiGate.java index d3cab26..00bc43b 100644 --- a/src/edu/berkeley/slipway/gui/GuiGate.java +++ b/src/edu/berkeley/slipway/gui/GuiGate.java @@ -77,4 +77,9 @@ public class GuiGate { } } + public void route(G g, P p, R ring, int input) { + g.route(p, ring, getInput(input)); + g.line(getInput(input), getInputDest(input)); + } + } \ No newline at end of file