source: josm/trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java@ 3824

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

Separate styles from style generation. This may seem a little over the top, but its just an intermediate state of development, should make sense later. Regarding performance: execution time is the same, memory use is similar, or a little less (due to intern pool for StyleCache). Tested, but can have still some bugs.

  • Property svn:eol-style set to native
File size: 1006 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.mappaint;
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
8abstract public class ElemStyle {
9 // zoom range to display the feature
10 public long minScale;
11 public long maxScale;
12
13 public ElemStyle(long minScale, long maxScale) {
14 this.minScale = minScale;
15 this.maxScale = maxScale;
16 }
17
18 @Override
19 public boolean equals(Object o) {
20 if (!(o instanceof ElemStyle))
21 return false;
22 ElemStyle s = (ElemStyle) o;
23 return minScale == s.minScale && maxScale == s.maxScale;
24 }
25
26 @Override
27 public int hashCode() {
28 return getClass().hashCode();
29 }
30
31 public abstract void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected, boolean member);
32}
Note: See TracBrowser for help on using the repository browser.