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

Last change on this file since 3803 was 3803, checked in by bastiK, 13 years ago

Don't merge all mappaitn style rules into one StyleSet, but keep them as separate StyleSources. This allows switching styles on and off at runtime.

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