- Timestamp:
- 2018-08-29T01:25:32+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r13987 r14193 72 72 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.HorizontalTextAlignment; 73 73 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.VerticalTextAlignment; 74 import org.openstreetmap.josm.gui.mappaint.styleelement.DefaultStyles; 74 75 import org.openstreetmap.josm.gui.mappaint.styleelement.MapImage; 75 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement;76 76 import org.openstreetmap.josm.gui.mappaint.styleelement.RepeatImageElement.LineImageAlignment; 77 77 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; … … 140 140 order <<= 1; 141 141 // simple node on top of icons and shapes 142 if ( NodeElement.SIMPLE_NODE_ELEMSTYLE.equals(this.style)) {142 if (DefaultStyles.SIMPLE_NODE_ELEMSTYLE.equals(this.style)) { 143 143 order |= 1; 144 144 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r13917 r14193 28 28 import org.openstreetmap.josm.gui.mappaint.styleelement.AreaIconElement; 29 29 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement; 30 import org.openstreetmap.josm.gui.mappaint.styleelement.DefaultStyles; 30 31 import org.openstreetmap.josm.gui.mappaint.styleelement.LineElement; 31 32 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement; … … 161 162 if (p.a.isEmpty()) { 162 163 if (TextLabel.AUTO_LABEL_COMPOSITION_STRATEGY.compose(osm) != null) { 163 p.a = NodeElement.DEFAULT_NODE_STYLELIST_TEXT;164 p.a = DefaultStyles.DEFAULT_NODE_STYLELIST_TEXT; 164 165 } else { 165 p.a = NodeElement.DEFAULT_NODE_STYLELIST;166 p.a = DefaultStyles.DEFAULT_NODE_STYLELIST; 166 167 } 167 168 } else { … … 178 179 } 179 180 if (!hasNonModifier) { 180 p.a = new StyleElementList(p.a, NodeElement.SIMPLE_NODE_ELEMSTYLE);181 p.a = new StyleElementList(p.a, DefaultStyles.SIMPLE_NODE_ELEMSTYLE); 181 182 if (!hasText && TextLabel.AUTO_LABEL_COMPOSITION_STRATEGY.compose(osm) != null) { 182 p.a = new StyleElementList(p.a, BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE);183 p.a = new StyleElementList(p.a, DefaultStyles.SIMPLE_NODE_TEXT_ELEMSTYLE); 183 184 } 184 185 } … … 404 405 addIfNotNull(sl, BoxTextElement.create(env, nodeStyle.getBoxProvider())); 405 406 } else { 406 addIfNotNull(sl, BoxTextElement.create(env, NodeElement.SIMPLE_NODE_ELEMSTYLE_BOXPROVIDER));407 addIfNotNull(sl, BoxTextElement.create(env, DefaultStyles.SIMPLE_NODE_ELEMSTYLE_BOXPROVIDER)); 407 408 } 408 409 } else if (osm instanceof IRelation) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java
r13919 r14193 9 9 import org.openstreetmap.josm.data.osm.INode; 10 10 import org.openstreetmap.josm.data.osm.IPrimitive; 11 import org.openstreetmap.josm.data.osm.Node;12 11 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 13 12 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; … … 16 15 import org.openstreetmap.josm.gui.mappaint.Environment; 17 16 import org.openstreetmap.josm.gui.mappaint.Keyword; 18 import org.openstreetmap.josm.gui.mappaint.MultiCascade;19 17 import org.openstreetmap.josm.tools.CheckParameterUtil; 20 18 … … 146 144 return Objects.equals(box, that.box); 147 145 } 148 }149 150 /**151 * The default style a simple node should use for it's text152 */153 public static final BoxTextElement SIMPLE_NODE_TEXT_ELEMSTYLE;154 static {155 MultiCascade mc = new MultiCascade();156 Cascade c = mc.getOrCreateCascade("default");157 c.put(TEXT, Keyword.AUTO);158 Node n = new Node();159 n.put("name", "dummy");160 SIMPLE_NODE_TEXT_ELEMSTYLE = create(new Environment(n, mc, "default", null), NodeElement.SIMPLE_NODE_ELEMSTYLE.getBoxProvider());161 if (SIMPLE_NODE_TEXT_ELEMSTYLE == null) throw new AssertionError();162 146 } 163 147 -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
r13919 r14193 20 20 import org.openstreetmap.josm.gui.mappaint.Keyword; 21 21 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 22 import org.openstreetmap.josm.gui.mappaint.MultiCascade;23 import org.openstreetmap.josm.gui.mappaint.StyleElementList;24 22 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.BoxProvider; 25 23 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.SimpleBoxProvider; … … 49 47 private static final String[] ICON_KEYS = {ICON_IMAGE, ICON_WIDTH, ICON_HEIGHT, ICON_OPACITY, ICON_OFFSET_X, ICON_OFFSET_Y}; 50 48 51 /**52 * The style used for simple nodes53 */54 public static final NodeElement SIMPLE_NODE_ELEMSTYLE;55 /**56 * A box provider that provides the size of a simple node57 */58 public static final BoxProvider SIMPLE_NODE_ELEMSTYLE_BOXPROVIDER;59 static {60 MultiCascade mc = new MultiCascade();61 mc.getOrCreateCascade("default");62 SIMPLE_NODE_ELEMSTYLE = create(new Environment(null, mc, "default", null), 4.1f, true);63 if (SIMPLE_NODE_ELEMSTYLE == null) throw new AssertionError();64 SIMPLE_NODE_ELEMSTYLE_BOXPROVIDER = SIMPLE_NODE_ELEMSTYLE.getBoxProvider();65 }66 67 /**68 * The default styles that are used for nodes.69 * @see #SIMPLE_NODE_ELEMSTYLE70 */71 public static final StyleElementList DEFAULT_NODE_STYLELIST = new StyleElementList(NodeElement.SIMPLE_NODE_ELEMSTYLE);72 /**73 * The default styles that are used for nodes with text.74 */75 public static final StyleElementList DEFAULT_NODE_STYLELIST_TEXT = new StyleElementList(NodeElement.SIMPLE_NODE_ELEMSTYLE,76 BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE);77 78 49 protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) { 79 50 super(c, defaultMajorZindex); … … 92 63 } 93 64 94 privatestatic NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) {65 static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) { 95 66 MapImage mapImage = createIcon(env); 96 67 Symbol symbol = null;
Note:
See TracChangeset
for help on using the changeset viewer.