1 | /* License: GPL. Copyright 2007 by Immanuel Scholz and others */
|
---|
2 | package org.openstreetmap.josm.data.osm.visitor.paint;
|
---|
3 |
|
---|
4 | import java.awt.BasicStroke;
|
---|
5 | import java.awt.Color;
|
---|
6 | import java.awt.Graphics2D;
|
---|
7 | import java.awt.Point;
|
---|
8 | import java.awt.Polygon;
|
---|
9 | import java.awt.Rectangle;
|
---|
10 | import java.awt.RenderingHints;
|
---|
11 | import java.awt.Stroke;
|
---|
12 | import java.awt.geom.GeneralPath;
|
---|
13 | import java.util.ArrayList;
|
---|
14 | import java.util.Arrays;
|
---|
15 | import java.util.Iterator;
|
---|
16 | import java.util.List;
|
---|
17 |
|
---|
18 | import org.openstreetmap.josm.Main;
|
---|
19 | import org.openstreetmap.josm.data.Bounds;
|
---|
20 | import org.openstreetmap.josm.data.osm.BBox;
|
---|
21 | import org.openstreetmap.josm.data.osm.Changeset;
|
---|
22 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
23 | import org.openstreetmap.josm.data.osm.Node;
|
---|
24 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
25 | import org.openstreetmap.josm.data.osm.Relation;
|
---|
26 | import org.openstreetmap.josm.data.osm.RelationMember;
|
---|
27 | import org.openstreetmap.josm.data.osm.Way;
|
---|
28 | import org.openstreetmap.josm.data.osm.WaySegment;
|
---|
29 | import org.openstreetmap.josm.data.osm.visitor.Visitor;
|
---|
30 | import org.openstreetmap.josm.gui.NavigatableComponent;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * A map renderer that paints a simple scheme of every primitive it visits to a
|
---|
34 | * previous set graphic environment.
|
---|
35 | */
|
---|
36 | public class WireframeMapRenderer extends AbstractMapRenderer implements Visitor {
|
---|
37 |
|
---|
38 | /** Color Preference for ways not matching any other group */
|
---|
39 | protected Color dfltWayColor;
|
---|
40 | /** Color Preference for relations */
|
---|
41 | protected Color relationColor;
|
---|
42 | /** Color Preference for untagged ways */
|
---|
43 | protected Color untaggedWayColor;
|
---|
44 | /** Color Preference for tagged nodes */
|
---|
45 | protected Color taggedColor;
|
---|
46 | /** Color Preference for multiply connected nodes */
|
---|
47 | protected Color connectionColor;
|
---|
48 | /** Color Preference for tagged and multiply connected nodes */
|
---|
49 | protected Color taggedConnectionColor;
|
---|
50 | /** Preference: should directional arrows be displayed */
|
---|
51 | protected boolean showDirectionArrow;
|
---|
52 | /** Preference: should arrows for oneways be displayed */
|
---|
53 | protected boolean showOnewayArrow;
|
---|
54 | /** Preference: should only the last arrow of a way be displayed */
|
---|
55 | protected boolean showHeadArrowOnly;
|
---|
56 | /** Preference: should the segement numbers of ways be displayed */
|
---|
57 | protected boolean showOrderNumber;
|
---|
58 | /** Preference: should selected nodes be filled */
|
---|
59 | protected boolean fillSelectedNode;
|
---|
60 | /** Preference: should unselected nodes be filled */
|
---|
61 | protected boolean fillUnselectedNode;
|
---|
62 | /** Preference: should tagged nodes be filled */
|
---|
63 | protected boolean fillTaggedNode;
|
---|
64 | /** Preference: should multiply connected nodes be filled */
|
---|
65 | protected boolean fillConnectionNode;
|
---|
66 | /** Preference: size of selected nodes */
|
---|
67 | protected int selectedNodeSize;
|
---|
68 | /** Preference: size of unselected nodes */
|
---|
69 | protected int unselectedNodeSize;
|
---|
70 | /** Preference: size of multiply connected nodes */
|
---|
71 | protected int connectionNodeSize;
|
---|
72 | /** Preference: size of tagged nodes */
|
---|
73 | protected int taggedNodeSize;
|
---|
74 |
|
---|
75 | /** Color cache to draw subsequent segments of same color as one <code>Path</code>. */
|
---|
76 | protected Color currentColor = null;
|
---|
77 | /** Path store to draw subsequent segments of same color as one <code>Path</code>. */
|
---|
78 | protected GeneralPath currentPath = new GeneralPath();
|
---|
79 | /**
|
---|
80 | * <code>DataSet</code> passed to the @{link render} function to overcome the argument
|
---|
81 | * limitations of @{link Visitor} interface. Only valid until end of rendering call.
|
---|
82 | */
|
---|
83 | private DataSet ds;
|
---|
84 |
|
---|
85 | /** Helper variable for {@link #drawSegment} */
|
---|
86 | private static final double PHI = Math.toRadians(20);
|
---|
87 | /** Helper variable for {@link #drawSegment} */
|
---|
88 | private static final double cosPHI = Math.cos(PHI);
|
---|
89 | /** Helper variable for {@link #drawSegment} */
|
---|
90 | private static final double sinPHI = Math.sin(PHI);
|
---|
91 |
|
---|
92 | /** Helper variable for {@link #visit(Relation)} */
|
---|
93 | private Stroke relatedWayStroke = new BasicStroke(
|
---|
94 | 4, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_BEVEL);
|
---|
95 |
|
---|
96 | /**
|
---|
97 | * Creates an wireframe render
|
---|
98 | *
|
---|
99 | * @param g the graphics context. Must not be null.
|
---|
100 | * @param nc the map viewport. Must not be null.
|
---|
101 | * @param isInactiveMode if true, the paint visitor shall render OSM objects such that they
|
---|
102 | * look inactive. Example: rendering of data in an inactive layer using light gray as color only.
|
---|
103 | * @throws IllegalArgumentException thrown if {@code g} is null
|
---|
104 | * @throws IllegalArgumentException thrown if {@code nc} is null
|
---|
105 | */
|
---|
106 | public WireframeMapRenderer(Graphics2D g, NavigatableComponent nc, boolean isInactiveMode) {
|
---|
107 | super(g, nc, isInactiveMode);
|
---|
108 | }
|
---|
109 |
|
---|
110 | @Override
|
---|
111 | public void getColors() {
|
---|
112 | super.getColors();
|
---|
113 | dfltWayColor = PaintColors.DEFAULT_WAY.get();
|
---|
114 | relationColor = PaintColors.RELATION.get();
|
---|
115 | untaggedWayColor = PaintColors.UNTAGGED_WAY.get();
|
---|
116 | highlightColor = PaintColors.HIGHLIGHT_WIREFRAME.get();
|
---|
117 | taggedColor = PaintColors.TAGGED.get();
|
---|
118 | connectionColor = PaintColors.CONNECTION.get();
|
---|
119 |
|
---|
120 | if (taggedColor != nodeColor) {
|
---|
121 | taggedConnectionColor = taggedColor;
|
---|
122 | } else {
|
---|
123 | taggedConnectionColor = connectionColor;
|
---|
124 | }
|
---|
125 | }
|
---|
126 |
|
---|
127 | @Override
|
---|
128 | protected void getSettings(boolean virtual) {
|
---|
129 | super.getSettings(virtual);
|
---|
130 | MapPaintSettings settings = MapPaintSettings.INSTANCE;
|
---|
131 | showDirectionArrow = settings.isShowDirectionArrow();
|
---|
132 | showOnewayArrow = settings.isShowOnewayArrow();
|
---|
133 | showHeadArrowOnly = settings.isShowHeadArrowOnly();
|
---|
134 | showOrderNumber = settings.isShowOrderNumber();
|
---|
135 | selectedNodeSize = settings.getSelectedNodeSize();
|
---|
136 | unselectedNodeSize = settings.getUnselectedNodeSize();
|
---|
137 | connectionNodeSize = settings.getConnectionNodeSize();
|
---|
138 | taggedNodeSize = settings.getTaggedNodeSize();
|
---|
139 | fillSelectedNode = settings.isFillSelectedNode();
|
---|
140 | fillUnselectedNode = settings.isFillUnselectedNode();
|
---|
141 | fillConnectionNode = settings.isFillConnectionNode();
|
---|
142 | fillTaggedNode = settings.isFillTaggedNode();
|
---|
143 |
|
---|
144 | g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
---|
145 | Main.pref.getBoolean("mappaint.wireframe.use-antialiasing", false) ?
|
---|
146 | RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF);
|
---|
147 | }
|
---|
148 |
|
---|
149 | /**
|
---|
150 | * Renders the dataset for display.
|
---|
151 | *
|
---|
152 | * @param data <code>DataSet</code> to display
|
---|
153 | * @param virtual <code>true</code> if virtual nodes are used
|
---|
154 | * @param bounds display boundaries
|
---|
155 | */
|
---|
156 | public void render(DataSet data, boolean virtual, Bounds bounds) {
|
---|
157 | BBox bbox = new BBox(bounds);
|
---|
158 | this.ds = data;
|
---|
159 | getSettings(virtual);
|
---|
160 |
|
---|
161 | for (final Relation rel : data.searchRelations(bbox)) {
|
---|
162 | if (rel.isDrawable() && !ds.isSelected(rel) && !rel.isDisabledAndHidden()) {
|
---|
163 | rel.visit(this);
|
---|
164 | }
|
---|
165 | }
|
---|
166 |
|
---|
167 | // draw tagged ways first, then untagged ways, then highlighted ways
|
---|
168 | List<Way> highlightedWays = new ArrayList<Way>();
|
---|
169 | List<Way> untaggedWays = new ArrayList<Way>();
|
---|
170 |
|
---|
171 | for (final Way way : data.searchWays(bbox)){
|
---|
172 | if (way.isDrawable() && !ds.isSelected(way) && !way.isDisabledAndHidden()) {
|
---|
173 | if (way.isHighlighted()) {
|
---|
174 | highlightedWays.add(way);
|
---|
175 | } else if (!way.isTagged()) {
|
---|
176 | untaggedWays.add(way);
|
---|
177 | } else {
|
---|
178 | way.visit(this);
|
---|
179 | }
|
---|
180 | }
|
---|
181 | }
|
---|
182 | displaySegments();
|
---|
183 |
|
---|
184 | // Display highlighted ways after the other ones (fix #8276)
|
---|
185 | for (List<Way> specialWays : Arrays.asList(new List[]{untaggedWays, highlightedWays})) {
|
---|
186 | for (final Way way : specialWays){
|
---|
187 | way.visit(this);
|
---|
188 | }
|
---|
189 | specialWays.clear();
|
---|
190 | displaySegments();
|
---|
191 | }
|
---|
192 |
|
---|
193 | for (final OsmPrimitive osm : data.getSelected()) {
|
---|
194 | if (osm.isDrawable()) {
|
---|
195 | osm.visit(this);
|
---|
196 | }
|
---|
197 | }
|
---|
198 | displaySegments();
|
---|
199 |
|
---|
200 | for (final OsmPrimitive osm: data.searchNodes(bbox)) {
|
---|
201 | if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden())
|
---|
202 | {
|
---|
203 | osm.visit(this);
|
---|
204 | }
|
---|
205 | }
|
---|
206 | drawVirtualNodes(data, bbox);
|
---|
207 |
|
---|
208 | // draw highlighted way segments over the already drawn ways. Otherwise each
|
---|
209 | // way would have to be checked if it contains a way segment to highlight when
|
---|
210 | // in most of the cases there won't be more than one segment. Since the wireframe
|
---|
211 | // renderer does not feature any transparency there should be no visual difference.
|
---|
212 | for (final WaySegment wseg : data.getHighlightedWaySegments()) {
|
---|
213 | drawSegment(nc.getPoint(wseg.getFirstNode()), nc.getPoint(wseg.getSecondNode()), highlightColor, false);
|
---|
214 | }
|
---|
215 | displaySegments();
|
---|
216 | }
|
---|
217 |
|
---|
218 | /**
|
---|
219 | * Helper function to calculate maximum of 4 values.
|
---|
220 | *
|
---|
221 | * @param a First value
|
---|
222 | * @param b Second value
|
---|
223 | * @param c Third value
|
---|
224 | * @param d Fourth value
|
---|
225 | */
|
---|
226 | private static final int max(int a, int b, int c, int d) {
|
---|
227 | return Math.max(Math.max(a, b), Math.max(c, d));
|
---|
228 | }
|
---|
229 |
|
---|
230 | /**
|
---|
231 | * Draw a small rectangle.
|
---|
232 | * White if selected (as always) or red otherwise.
|
---|
233 | *
|
---|
234 | * @param n The node to draw.
|
---|
235 | */
|
---|
236 | @Override
|
---|
237 | public void visit(Node n) {
|
---|
238 | if (n.isIncomplete()) return;
|
---|
239 |
|
---|
240 | if (n.isHighlighted()) {
|
---|
241 | drawNode(n, highlightColor, selectedNodeSize, fillSelectedNode);
|
---|
242 | } else {
|
---|
243 | Color color;
|
---|
244 |
|
---|
245 | if (isInactiveMode || n.isDisabled()) {
|
---|
246 | color = inactiveColor;
|
---|
247 | } else if (ds.isSelected(n)) {
|
---|
248 | color = selectedColor;
|
---|
249 | } else if (n.isConnectionNode()) {
|
---|
250 | if (isNodeTagged(n)) {
|
---|
251 | color = taggedConnectionColor;
|
---|
252 | } else {
|
---|
253 | color = connectionColor;
|
---|
254 | }
|
---|
255 | } else {
|
---|
256 | if (isNodeTagged(n)) {
|
---|
257 | color = taggedColor;
|
---|
258 | } else {
|
---|
259 | color = nodeColor;
|
---|
260 | }
|
---|
261 | }
|
---|
262 |
|
---|
263 | final int size = max((ds.isSelected(n) ? selectedNodeSize : 0),
|
---|
264 | (isNodeTagged(n) ? taggedNodeSize : 0),
|
---|
265 | (n.isConnectionNode() ? connectionNodeSize : 0),
|
---|
266 | unselectedNodeSize);
|
---|
267 |
|
---|
268 | final boolean fill = (ds.isSelected(n) && fillSelectedNode) ||
|
---|
269 | (isNodeTagged(n) && fillTaggedNode) ||
|
---|
270 | (n.isConnectionNode() && fillConnectionNode) ||
|
---|
271 | fillUnselectedNode;
|
---|
272 |
|
---|
273 | drawNode(n, color, size, fill);
|
---|
274 | }
|
---|
275 | }
|
---|
276 |
|
---|
277 | private boolean isNodeTagged(Node n) {
|
---|
278 | return n.isTagged() || n.isAnnotated();
|
---|
279 | }
|
---|
280 |
|
---|
281 | /**
|
---|
282 | * Draw a line for all way segments.
|
---|
283 | * @param w The way to draw.
|
---|
284 | */
|
---|
285 | @Override
|
---|
286 | public void visit(Way w) {
|
---|
287 | if (w.isIncomplete() || w.getNodesCount() < 2)
|
---|
288 | return;
|
---|
289 |
|
---|
290 | /* show direction arrows, if draw.segment.relevant_directions_only is not set, the way is tagged with a direction key
|
---|
291 | (even if the tag is negated as in oneway=false) or the way is selected */
|
---|
292 |
|
---|
293 | boolean showThisDirectionArrow = ds.isSelected(w) || showDirectionArrow;
|
---|
294 | /* head only takes over control if the option is true,
|
---|
295 | the direction should be shown at all and not only because it's selected */
|
---|
296 | boolean showOnlyHeadArrowOnly = showThisDirectionArrow && !ds.isSelected(w) && showHeadArrowOnly;
|
---|
297 | Color wayColor;
|
---|
298 |
|
---|
299 | if (isInactiveMode || w.isDisabled()) {
|
---|
300 | wayColor = inactiveColor;
|
---|
301 | } else if(w.isHighlighted()) {
|
---|
302 | wayColor = highlightColor;
|
---|
303 | } else if(ds.isSelected(w)) {
|
---|
304 | wayColor = selectedColor;
|
---|
305 | } else if (!w.isTagged()) {
|
---|
306 | wayColor = untaggedWayColor;
|
---|
307 | } else {
|
---|
308 | wayColor = dfltWayColor;
|
---|
309 | }
|
---|
310 |
|
---|
311 | Iterator<Node> it = w.getNodes().iterator();
|
---|
312 | if (it.hasNext()) {
|
---|
313 | Point lastP = nc.getPoint(it.next());
|
---|
314 | for (int orderNumber = 1; it.hasNext(); orderNumber++) {
|
---|
315 | Point p = nc.getPoint(it.next());
|
---|
316 | drawSegment(lastP, p, wayColor,
|
---|
317 | showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow);
|
---|
318 | if (showOrderNumber && !isInactiveMode) {
|
---|
319 | drawOrderNumber(lastP, p, orderNumber, g.getColor());
|
---|
320 | }
|
---|
321 | lastP = p;
|
---|
322 | }
|
---|
323 | }
|
---|
324 | }
|
---|
325 |
|
---|
326 | /**
|
---|
327 | * Draw objects used in relations.
|
---|
328 | * @param r The relation to draw.
|
---|
329 | */
|
---|
330 | @Override
|
---|
331 | public void visit(Relation r) {
|
---|
332 | if (r.isIncomplete()) return;
|
---|
333 |
|
---|
334 | Color col;
|
---|
335 | if (isInactiveMode || r.isDisabled()) {
|
---|
336 | col = inactiveColor;
|
---|
337 | } else if (ds.isSelected(r)) {
|
---|
338 | col = selectedColor;
|
---|
339 | } else {
|
---|
340 | col = relationColor;
|
---|
341 | }
|
---|
342 | g.setColor(col);
|
---|
343 |
|
---|
344 | for (RelationMember m : r.getMembers()) {
|
---|
345 | if (m.getMember().isIncomplete() || !m.getMember().isDrawable()) {
|
---|
346 | continue;
|
---|
347 | }
|
---|
348 |
|
---|
349 | if (m.isNode()) {
|
---|
350 | Point p = nc.getPoint(m.getNode());
|
---|
351 | if (p.x < 0 || p.y < 0
|
---|
352 | || p.x > nc.getWidth() || p.y > nc.getHeight()) {
|
---|
353 | continue;
|
---|
354 | }
|
---|
355 |
|
---|
356 | g.drawOval(p.x-3, p.y-3, 6, 6);
|
---|
357 | } else if (m.isWay()) {
|
---|
358 | GeneralPath path = new GeneralPath();
|
---|
359 |
|
---|
360 | boolean first = true;
|
---|
361 | for (Node n : m.getWay().getNodes()) {
|
---|
362 | if (!n.isDrawable()) {
|
---|
363 | continue;
|
---|
364 | }
|
---|
365 | Point p = nc.getPoint(n);
|
---|
366 | if (first) {
|
---|
367 | path.moveTo(p.x, p.y);
|
---|
368 | first = false;
|
---|
369 | } else {
|
---|
370 | path.lineTo(p.x, p.y);
|
---|
371 | }
|
---|
372 | }
|
---|
373 |
|
---|
374 | g.draw(relatedWayStroke.createStrokedShape(path));
|
---|
375 | }
|
---|
376 | }
|
---|
377 | }
|
---|
378 |
|
---|
379 | /**
|
---|
380 | * Visitor for changesets not used in this class
|
---|
381 | * @param cs The changeset for inspection.
|
---|
382 | */
|
---|
383 | @Override
|
---|
384 | public void visit(Changeset cs) {/* ignore */}
|
---|
385 |
|
---|
386 | @Override
|
---|
387 | public void drawNode(Node n, Color color, int size, boolean fill) {
|
---|
388 | if (size > 1) {
|
---|
389 | int radius = size / 2;
|
---|
390 | Point p = nc.getPoint(n);
|
---|
391 | if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth())
|
---|
392 | || (p.y > nc.getHeight()))
|
---|
393 | return;
|
---|
394 | g.setColor(color);
|
---|
395 | if (fill) {
|
---|
396 | g.fillRect(p.x - radius, p.y - radius, size, size);
|
---|
397 | g.drawRect(p.x - radius, p.y - radius, size, size);
|
---|
398 | } else {
|
---|
399 | g.drawRect(p.x - radius, p.y - radius, size, size);
|
---|
400 | }
|
---|
401 | }
|
---|
402 | }
|
---|
403 |
|
---|
404 | /**
|
---|
405 | * Draw a line with the given color.
|
---|
406 | *
|
---|
407 | * @param path The path to append this segment.
|
---|
408 | * @param p1 First point of the way segment.
|
---|
409 | * @param p2 Second point of the way segment.
|
---|
410 | * @param showDirection <code>true</code> if segment direction should be indicated
|
---|
411 | */
|
---|
412 | protected void drawSegment(GeneralPath path, Point p1, Point p2, boolean showDirection) {
|
---|
413 | Rectangle bounds = g.getClipBounds();
|
---|
414 | bounds.grow(100, 100); // avoid arrow heads at the border
|
---|
415 | LineClip clip = new LineClip(p1, p2, bounds);
|
---|
416 | if (clip.execute()) {
|
---|
417 | p1 = clip.getP1();
|
---|
418 | p2 = clip.getP2();
|
---|
419 | path.moveTo(p1.x, p1.y);
|
---|
420 | path.lineTo(p2.x, p2.y);
|
---|
421 |
|
---|
422 | if (showDirection) {
|
---|
423 | final double l = 10. / p1.distance(p2);
|
---|
424 |
|
---|
425 | final double sx = l * (p1.x - p2.x);
|
---|
426 | final double sy = l * (p1.y - p2.y);
|
---|
427 |
|
---|
428 | path.lineTo (p2.x + (int) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (int) Math.round(sinPHI * sx + cosPHI * sy));
|
---|
429 | path.moveTo (p2.x + (int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(- sinPHI * sx + cosPHI * sy));
|
---|
430 | path.lineTo(p2.x, p2.y);
|
---|
431 | }
|
---|
432 | }
|
---|
433 | }
|
---|
434 |
|
---|
435 | /**
|
---|
436 | * Draw a line with the given color.
|
---|
437 | *
|
---|
438 | * @param p1 First point of the way segment.
|
---|
439 | * @param p2 Second point of the way segment.
|
---|
440 | * @param col The color to use for drawing line.
|
---|
441 | * @param showDirection <code>true</code> if segment direction should be indicated.
|
---|
442 | */
|
---|
443 | protected void drawSegment(Point p1, Point p2, Color col, boolean showDirection) {
|
---|
444 | if (col != currentColor) {
|
---|
445 | displaySegments(col);
|
---|
446 | }
|
---|
447 | drawSegment(currentPath, p1, p2, showDirection);
|
---|
448 | }
|
---|
449 |
|
---|
450 | /**
|
---|
451 | * Checks if a polygon is visible in display.
|
---|
452 | *
|
---|
453 | * @param polygon The polygon to check.
|
---|
454 | * @return <code>true</code> if polygon is visible.
|
---|
455 | */
|
---|
456 | protected boolean isPolygonVisible(Polygon polygon) {
|
---|
457 | Rectangle bounds = polygon.getBounds();
|
---|
458 | if (bounds.width == 0 && bounds.height == 0) return false;
|
---|
459 | if (bounds.x > nc.getWidth()) return false;
|
---|
460 | if (bounds.y > nc.getHeight()) return false;
|
---|
461 | if (bounds.x + bounds.width < 0) return false;
|
---|
462 | if (bounds.y + bounds.height < 0) return false;
|
---|
463 | return true;
|
---|
464 | }
|
---|
465 |
|
---|
466 | /**
|
---|
467 | * Finally display all segments in currect path.
|
---|
468 | */
|
---|
469 | protected void displaySegments() {
|
---|
470 | displaySegments(null);
|
---|
471 | }
|
---|
472 |
|
---|
473 | /**
|
---|
474 | * Finally display all segments in currect path.
|
---|
475 | *
|
---|
476 | * @param newColor This color is set after the path is drawn.
|
---|
477 | */
|
---|
478 | protected void displaySegments(Color newColor) {
|
---|
479 | if (currentPath != null) {
|
---|
480 | g.setColor(currentColor);
|
---|
481 | g.draw(currentPath);
|
---|
482 | currentPath = new GeneralPath();
|
---|
483 | currentColor = newColor;
|
---|
484 | }
|
---|
485 | }
|
---|
486 | }
|
---|