Changeset 9278 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2016-01-03T15:50:53+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r9243 r9278 59 59 import org.openstreetmap.josm.data.osm.visitor.paint.relations.MultipolygonCache; 60 60 import org.openstreetmap.josm.gui.NavigatableComponent; 61 import org.openstreetmap.josm.gui.mappaint.AreaElemStyle;62 import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle;63 import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.HorizontalTextAlignment;64 import org.openstreetmap.josm.gui.mappaint.BoxTextElemStyle.VerticalTextAlignment;65 import org.openstreetmap.josm.gui.mappaint.ElemStyle;66 61 import org.openstreetmap.josm.gui.mappaint.ElemStyles; 67 import org.openstreetmap.josm.gui.mappaint.MapImage;68 62 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 69 import org.openstreetmap.josm.gui.mappaint.NodeElemStyle;70 import org.openstreetmap.josm.gui.mappaint.NodeElemStyle.Symbol;71 import org.openstreetmap.josm.gui.mappaint.RepeatImageElemStyle.LineImageAlignment;72 63 import org.openstreetmap.josm.gui.mappaint.StyleCache.StyleList; 73 import org.openstreetmap.josm.gui.mappaint.TextElement;74 64 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 75 65 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector; 66 import org.openstreetmap.josm.gui.mappaint.styleelement.AreaElement; 67 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement; 68 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.HorizontalTextAlignment; 69 import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement.VerticalTextAlignment; 70 import org.openstreetmap.josm.gui.mappaint.styleelement.MapImage; 71 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement; 72 import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement.Symbol; 73 import org.openstreetmap.josm.gui.mappaint.styleelement.RepeatImageElement.LineImageAlignment; 74 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; 75 import org.openstreetmap.josm.gui.mappaint.styleelement.TextLabel; 76 76 import org.openstreetmap.josm.tools.CompositeList; 77 77 import org.openstreetmap.josm.tools.Geometry; … … 190 190 191 191 private static class StyleRecord implements Comparable<StyleRecord> { 192 private final ElemStylestyle;192 private final StyleElement style; 193 193 private final OsmPrimitive osm; 194 194 private final int flags; 195 195 196 StyleRecord( ElemStylestyle, OsmPrimitive osm, int flags) {196 StyleRecord(StyleElement style, OsmPrimitive osm, int flags) { 197 197 this.style = style; 198 198 this.osm = osm; … … 223 223 224 224 // simple node on top of icons and shapes 225 if (this.style == NodeElem Style.SIMPLE_NODE_ELEMSTYLE && other.style != NodeElemStyle.SIMPLE_NODE_ELEMSTYLE)225 if (this.style == NodeElement.SIMPLE_NODE_ELEMSTYLE && other.style != NodeElement.SIMPLE_NODE_ELEMSTYLE) 226 226 return 1; 227 if (this.style != NodeElem Style.SIMPLE_NODE_ELEMSTYLE && other.style == NodeElemStyle.SIMPLE_NODE_ELEMSTYLE)227 if (this.style != NodeElement.SIMPLE_NODE_ELEMSTYLE && other.style == NodeElement.SIMPLE_NODE_ELEMSTYLE) 228 228 return -1; 229 229 … … 418 418 * @param text text style to use 419 419 */ 420 private void displayText(GlyphVector gv, String s, int x, int y, boolean disabled, Text Elementtext) {420 private void displayText(GlyphVector gv, String s, int x, int y, boolean disabled, TextLabel text) { 421 421 if (gv == null && s.isEmpty()) return; 422 422 if (isInactiveMode || disabled) { … … 472 472 */ 473 473 protected void drawArea(OsmPrimitive osm, Path2D.Double path, Color color, 474 MapImage fillImage, Float extent, Path2D.Double pfClip, boolean disabled, Text Elementtext) {474 MapImage fillImage, Float extent, Path2D.Double pfClip, boolean disabled, TextLabel text) { 475 475 476 476 Shape area = path.createTransformedShape(nc.getAffineTransform()); … … 525 525 } 526 526 527 private void drawAreaText(OsmPrimitive osm, Text Elementtext, Shape area) {527 private void drawAreaText(OsmPrimitive osm, TextLabel text, Shape area) { 528 528 if (text != null && isShowNames()) { 529 529 // abort if we can't compose the label to be rendered … … 612 612 * @param text The text to write on the area. 613 613 */ 614 public void drawArea(Relation r, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled, Text Elementtext) {614 public void drawArea(Relation r, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled, TextLabel text) { 615 615 Multipolygon multipolygon = MultipolygonCache.getInstance().get(nc, r); 616 616 if (!r.isDisabled() && !multipolygon.getOuterWays().isEmpty()) { … … 648 648 * @param text The text to write on the area. 649 649 */ 650 public void drawArea(Way w, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled, Text Elementtext) {650 public void drawArea(Way w, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled, TextLabel text) { 651 651 Path2D.Double pfClip = null; 652 652 if (extent != null) { … … 678 678 } 679 679 680 public void drawBoxText(Node n, BoxTextElem Stylebs) {680 public void drawBoxText(Node n, BoxTextElement bs) { 681 681 if (!isShowNames() || bs == null) 682 682 return; 683 683 684 684 Point p = nc.getPoint(n); 685 Text Elementtext = bs.text;685 TextLabel text = bs.text; 686 686 String s = text.labelCompositionStrategy.compose(n); 687 687 if (s == null) return; … … 1204 1204 * @param text The text definition (font/.../text content) to draw. 1205 1205 */ 1206 public void drawTextOnPath(Way way, Text Elementtext) {1206 public void drawTextOnPath(Way way, TextLabel text) { 1207 1207 if (way == null || text == null) 1208 1208 return; … … 1826 1826 public void add(Node osm, int flags) { 1827 1827 StyleList sl = styles.get(osm, circum, nc); 1828 for ( ElemStyles : sl) {1828 for (StyleElement s : sl) { 1829 1829 output.add(new StyleRecord(s, osm, flags)); 1830 1830 } … … 1833 1833 public void add(Relation osm, int flags) { 1834 1834 StyleList sl = styles.get(osm, circum, nc); 1835 for ( ElemStyles : sl) {1836 if (drawMultipolygon && drawArea && s instanceof AreaElem Style&& (flags & FLAG_DISABLED) == 0) {1835 for (StyleElement s : sl) { 1836 if (drawMultipolygon && drawArea && s instanceof AreaElement && (flags & FLAG_DISABLED) == 0) { 1837 1837 output.add(new StyleRecord(s, osm, flags)); 1838 } else if (drawRestriction && s instanceof NodeElem Style) {1838 } else if (drawRestriction && s instanceof NodeElement) { 1839 1839 output.add(new StyleRecord(s, osm, flags)); 1840 1840 } … … 1844 1844 public void add(Way osm, int flags) { 1845 1845 StyleList sl = styles.get(osm, circum, nc); 1846 for ( ElemStyles : sl) {1847 if (!(drawArea && (flags & FLAG_DISABLED) == 0) && s instanceof AreaElem Style) {1846 for (StyleElement s : sl) { 1847 if (!(drawArea && (flags & FLAG_DISABLED) == 0) && s instanceof AreaElement) { 1848 1848 continue; 1849 1849 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r9087 r9278 31 31 import org.openstreetmap.josm.data.validation.TestError; 32 32 import org.openstreetmap.josm.gui.DefaultNameFormatter; 33 import org.openstreetmap.josm.gui.mappaint. AreaElemStyle;33 import org.openstreetmap.josm.gui.mappaint.styleelement.AreaElement; 34 34 import org.openstreetmap.josm.gui.mappaint.ElemStyles; 35 35 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; … … 182 182 183 183 if (styles != null && !"boundary".equals(r.get("type"))) { 184 AreaElem Stylearea = ElemStyles.getAreaElemStyle(r, false);184 AreaElement area = ElemStyles.getAreaElemStyle(r, false); 185 185 boolean areaStyle = area != null; 186 186 // If area style was not found for relation then use style of ways … … 206 206 if (area != null) { 207 207 for (Way wInner : polygon.getInnerWays()) { 208 AreaElem StyleareaInner = ElemStyles.getAreaElemStyle(wInner, false);208 AreaElement areaInner = ElemStyles.getAreaElemStyle(wInner, false); 209 209 210 210 if (areaInner != null && area.equals(areaInner)) { … … 218 218 } 219 219 for (Way wOuter : polygon.getOuterWays()) { 220 AreaElem StyleareaOuter = ElemStyles.getAreaElemStyle(wOuter, false);220 AreaElement areaOuter = ElemStyles.getAreaElemStyle(wOuter, false); 221 221 if (areaOuter != null) { 222 222 List<OsmPrimitive> l = new ArrayList<>();
Note:
See TracChangeset
for help on using the changeset viewer.