1 package edu.berkeley.slipway.gui;
3 import static com.atmel.fpslic.FpslicConstants.*;
4 import static com.atmel.fpslic.FpslicUtil.*;
5 import edu.berkeley.slipway.*;
7 import java.awt.geom.*;
8 import java.awt.event.*;
9 import java.awt.color.*;
10 import org.ibex.util.*;
15 /** a point, since Java2D's Point2D class sucks rocks */
18 public final double x;
19 public final double y;
21 public P(double x, double y) { this.x = x; this.y = y; }
22 public P(Point2D p) { this(p.getX(), p.getY()); }
23 public double getX() { return x; }
24 public double getY() { return y; }
26 public P transform(AffineTransform a) {
27 Point2D me = new Point2D.Double(x, y);
28 return new P(a.transform(me, me));
30 public P inverseTransform(AffineTransform a) {
32 Point2D me = new Point2D.Double(x, y);
33 return new P(a.inverseTransform(me, me));
34 } catch (Exception e) {
35 throw new RuntimeException(e);
39 public P translate(double dx, double dy) {
40 return new P(dx+x, dy+y);