- if (xgater != null) {
- /*
- if (fpslicCell.zi() != NONE) {
- g.color(LOCAL_WIRE_COLOR);
- int layer = fpslicCell.zi() - L0;
- P p2 = new P(r.minx()+2*(layer+1), r.miny()+2*(layer+1));
- R r2 = new R(r.minx()+2*(layer+1), r.miny()+2*(layer+1),
- r.maxx()-2*(layer+1), r.maxy()-2*(layer+1));
- g.route(p2, r2, xgate.getInput(3, xgater));
- }
- */
- if (fpslicCell.wi() != NONE) {
- g.color(LOCAL_WIRE_COLOR);
- int layer = fpslicCell.wi() - L0;
- P p2 = new P(r.minx()+2*(layer+1), r.miny()+2*(layer+1));
- R r2 = new R(r.minx()+2*(layer+1), r.miny()+2*(layer+1),
- r.maxx()-2*(layer+1), r.maxy()-2*(layer+1));
- g.route(p2, r2, xgate.getInput(2, xgater));
- g.line(xgate.getInput(2, xgater), xgate.getInputDest(2, xgater));
- }
- xgate.draw(g, xgater, XGATE_COLOR);
- }
- if (ygater != null) {
- /*
- if (fpslicCell.zi() != NONE) {
- g.color(LOCAL_WIRE_COLOR);
- int layer = fpslicCell.zi() - L0;
- P p2 = new P(r.minx()+2*(layer+1), r.miny()+2*(layer+1));
- R r2 = new R(r.minx()+2*(layer+1), r.miny()+2*(layer+1),
- r.maxx()-2*(layer+1), r.maxy()-2*(layer+1));
- g.route(p2, r2, ygate.getInput(3, ygater));
- }
- */
- if (fpslicCell.wi() != NONE) {
- g.color(LOCAL_WIRE_COLOR);
- int layer = fpslicCell.wi() - L0;
- P p2 = new P(r.minx()+2*(layer+1), r.miny()+2*(layer+1));
- R r2 = new R(r.minx()+2*(layer+1), r.miny()+2*(layer+1),
- r.maxx()-2*(layer+1), r.maxy()-2*(layer+1));
- g.route(p2, r2, ygate.getInput(2, ygater));
- g.line(ygate.getInput(2, ygater), ygate.getInputDest(2, ygater));
- }
- ygate.draw(g, ygater, YGATE_COLOR);
- }
+ private void drawWin(G g, R r) {
+ int layer = fpslicCell.wi() - L0;
+ P wip = r.corner(SW).translate(2*(layer+1), 2*(layer+1));
+ R wring = r.plus(2*(layer+1), 2*(layer+1), -2*(layer+1), -2*(layer+1));
+ ygate.route(g, wip, wring, 1, LOCAL_WIRE_COLOR);
+ xgate.route(g, wip, wring, 1, LOCAL_WIRE_COLOR);