Changeset 5217 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
- Timestamp:
- 2012-05-06T21:23:18+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r5054 r5217 15 15 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 16 16 import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter; 17 import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.BoxProvider; 18 import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.SimpleBoxProvider; 17 19 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 18 20 import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList; 19 import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.BoxProvider;20 import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.SimpleBoxProvider;21 import org.openstreetmap.josm.tools.Pair;22 21 import org.openstreetmap.josm.tools.Utils; 23 22 … … 85 84 MultiCascade mc = new MultiCascade(); 86 85 Cascade c = mc.getOrCreateCascade("default"); 87 SIMPLE_NODE_ELEMSTYLE = create(new Environment(null, mc, "default", null), true);86 SIMPLE_NODE_ELEMSTYLE = create(new Environment(null, mc, "default", null), 4.1f, true); 88 87 if (SIMPLE_NODE_ELEMSTYLE == null) throw new AssertionError(); 89 88 } … … 92 91 public static final StyleList DEFAULT_NODE_STYLELIST_TEXT = new StyleList(NodeElemStyle.SIMPLE_NODE_ELEMSTYLE, BoxTextElemStyle.SIMPLE_NODE_TEXT_ELEMSTYLE); 93 92 94 protected NodeElemStyle(Cascade c, MapImage mapImage, Symbol symbol ) {95 super(c, 1000f);93 protected NodeElemStyle(Cascade c, MapImage mapImage, Symbol symbol, float default_major_z_index) { 94 super(c, default_major_z_index); 96 95 this.mapImage = mapImage; 97 96 this.symbol = symbol; … … 99 98 100 99 public static NodeElemStyle create(Environment env) { 101 return create(env, false);102 } 103 104 private static NodeElemStyle create(Environment env, boolean allowDefault) {100 return create(env, 4f, false); 101 } 102 103 private static NodeElemStyle create(Environment env, float default_major_z_index, boolean allowDefault) { 105 104 Cascade c = env.mc.getCascade(env.layer); 106 105 … … 116 115 if (!allowDefault && symbol == null && mapImage == null) return null; 117 116 118 return new NodeElemStyle(c, mapImage, symbol );117 return new NodeElemStyle(c, mapImage, symbol, default_major_z_index); 119 118 } 120 119 … … 302 301 303 302 public BoxProvider getBoxProvider() { 304 if (mapImage != null) {303 if (mapImage != null) 305 304 return mapImage.getBoxProvider(); 306 } else if (symbol != null) {305 else if (symbol != null) 307 306 return new SimpleBoxProvider(new Rectangle(-symbol.size/2, -symbol.size/2, symbol.size, symbol.size)); 308 }else {307 else { 309 308 // This is only executed once, so no performance concerns. 310 309 // However, it would be better, if the settings could be changed at runtime.
Note:
See TracChangeset
for help on using the changeset viewer.