import java.awt.geom.*;
import java.awt.event.*;
import java.awt.color.*;
+import static com.atmel.fpslic.FpslicConstants.*;
public class GuiGate {
int rotation = 1;
R gateArea;
R r;
+ boolean disabled = false;
public void draw(G g, int color) {
+ if (disabled) return;
g.pushTransform();
g.g.translate(gateArea.cx(), gateArea.cy());
g.g.rotate((2 * Math.PI * rotation)/4);
r.miny() + r.height()/2).transform(at);
}
+ public void rotation(int dir) {
+ switch (dir) {
+ case NORTH: rotation = 2; break;
+ case SOUTH: rotation = 0; break;
+ case WEST: rotation = 3; break;
+ case EAST: rotation = 1; break;
+ default: rotation = 0;
+ }
+ }
+
+ public void route(G g, P p, R ring, int input, int color) {
+ if (disabled) return;
+ g.color(color);
+ g.route(p, ring, getInput(input));
+ g.line(getInput(input), getInputDest(input));
+ }
+
}
\ No newline at end of file