107108109110111112113114115116117
_shape = new BasicFigure(path, Color.red); layer.add(_shape); Polyline2D poly = new Polyline2D.Double(); poly.moveTo(240, 120); poly.lineTo(280, 140); poly.lineTo(240, 160); poly.lineTo(280, 180); poly.lineTo(240, 200); poly.lineTo(280, 220); poly.lineTo(240, 240);
108109110111112113114115116117118
layer.add(_shape); Polyline2D poly = new Polyline2D.Double(); poly.moveTo(240, 120); poly.lineTo(280, 140); poly.lineTo(240, 160); poly.lineTo(280, 180); poly.lineTo(240, 200); poly.lineTo(280, 220); poly.lineTo(240, 240); _line = new BasicFigure(poly);
109110111112113114115116117118119
Polyline2D poly = new Polyline2D.Double(); poly.moveTo(240, 120); poly.lineTo(280, 140); poly.lineTo(240, 160); poly.lineTo(280, 180); poly.lineTo(240, 200); poly.lineTo(280, 220); poly.lineTo(240, 240); _line = new BasicFigure(poly); layer.add(_line);
110111112113114115116117118119120
Polyline2D poly = new Polyline2D.Double(); poly.moveTo(240, 120); poly.lineTo(280, 140); poly.lineTo(240, 160); poly.lineTo(280, 180); poly.lineTo(240, 200); poly.lineTo(280, 220); poly.lineTo(240, 240); _line = new BasicFigure(poly); layer.add(_line); }
111112113114115116117118119120121
poly.moveTo(240, 120); poly.lineTo(280, 140); poly.lineTo(240, 160); poly.lineTo(280, 180); poly.lineTo(240, 200); poly.lineTo(280, 220); poly.lineTo(240, 240); _line = new BasicFigure(poly); layer.add(_line); }
112113114115116117118119120121122
poly.lineTo(280, 140); poly.lineTo(240, 160); poly.lineTo(280, 180); poly.lineTo(240, 200); poly.lineTo(280, 220); poly.lineTo(240, 240); _line = new BasicFigure(poly); layer.add(_line); } /** Create the interaction on the figures. We make a different
141142143144145146147148149150151
} else { Polyline2D poly = new Polyline2D.Double(); poly.moveTo(coords[0], coords[1]); for (int i = 2; i < coords.length; i += 2) { poly.lineTo(coords[i], coords[i + 1]); } s = poly; }
203204205206207208209210211212213
301302303304305306307308309310311
} else { throw new RuntimeException("unknown dir"); } Polyline2D route = _route(point, dir, tail, tailDir); route.lineTo(head.getX(), head.getY()); //System.out.println("route = " + route); return route; }
152153154155156157158159160161162
*/ public void createPolyline() { FigureLayer layer = graphicsPane.getForegroundLayer(); Polyline2D path = new Polyline2D.Double(); path.moveTo(240, 120); path.lineTo(280, 140); path.lineTo(240, 160); path.lineTo(280, 180); path.lineTo(240, 200); path.lineTo(280, 220); path.lineTo(240, 240);