checkpoint
authoradam <adam@megacz.com>
Thu, 19 Apr 2007 04:22:56 +0000 (05:22 +0100)
committeradam <adam@megacz.com>
Thu, 19 Apr 2007 04:22:56 +0000 (05:22 +0100)
src/edu/berkeley/slipway/gui/GuiCell.java
src/edu/berkeley/slipway/gui/GuiGate.java

index ebd3044..02795be 100644 (file)
@@ -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) {
index d3cab26..00bc43b 100644 (file)
@@ -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