01: import java.awt.*; 02: import java.awt.geom.*; 03: 04: /** 05: An inivisible node that is used in the toolbar to draw an 06: edge. 07: */ 08: public class PointNode implements Node 09: { 10: /** 11: Constructs a point node with coordinates (0, 0) 12: */ 13: public PointNode() 14: { 15: point = new Point2D.Double(); 16: } 17: 18: public void draw(Graphics2D g2) 19: { 20: } 21: 22: public void translate(double dx, double dy) 23: { 24: point.setLocation(point.getX() + dx, 25: point.getY() + dy); 26: } 27: 28: public boolean contains(Point2D p) 29: { 30: return false; 31: } 32: 33: public Rectangle2D getBounds() 34: { 35: return new Rectangle2D.Double(point.getX(), 36: point.getY(), 0, 0); 37: } 38: 39: public Point2D getConnectionPoint(Point2D other) 40: { 41: return point; 42: } 43: 44: public Object clone() 45: { 46: try 47: { 48: return super.clone(); 49: } 50: catch (CloneNotSupportedException exception) 51: { 52: return null; 53: } 54: } 55: 56: private Point2D point; 57: }