source: josm/trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java@ 3128

Last change on this file since 3128 was 2675, checked in by jttt, 14 years ago

MapPaintVisitor - delegate drawing to styles, MapPaintVisitor should only select correct style and then let primitives draw in correct order. (not finished yet)

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1package org.openstreetmap.josm.gui.mappaint;
2import java.awt.Color;
3
4import org.openstreetmap.josm.data.osm.OsmPrimitive;
5import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
6import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter;
7
8public class AreaElemStyle extends ElemStyle
9{
10 public Color color;
11 public boolean closed;
12 private LineElemStyle line;
13
14 public AreaElemStyle (AreaElemStyle a, long maxScale, long minScale) {
15 this.color = a.color;
16 this.closed = a.closed;
17 this.priority = a.priority;
18 this.maxScale = maxScale;
19 this.minScale = minScale;
20 this.rules = a.rules;
21 this.line = new LineElemStyle();
22 this.line.color = a.color;
23 }
24
25 public AreaElemStyle(AreaElemStyle a, LineElemStyle l)
26 {
27 this.color = a.color;
28 this.closed = a.closed;
29 this.priority = a.priority;
30 this.maxScale = a.maxScale;
31 this.minScale = a.minScale;
32 this.rules = a.rules;
33 this.line = l;
34 this.code = a.code;
35 }
36
37 public AreaElemStyle() { init(); }
38
39 public void init()
40 {
41 color = null;
42 priority = 0;
43 }
44
45 public ElemStyle getLineStyle() {
46 return line;
47 }
48
49 @Override
50 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected) {
51 // TODO
52 /*Way way = (Way)primitive;
53 String name = painter.isShowNames() ? painter.getWayName(way) : null;
54 painter.drawArea(getPolygon(way), selected ? paintSettings.getSelectedColor() : color, name);
55 line.paintPrimitive(way, paintSettings, painter, selected);*/
56 }
57}
Note: See TracBrowser for help on using the repository browser.