- Timestamp:
- 2017-03-21T15:45:26+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java
r9341 r11760 25 25 String ICON_ROTATION = "icon-rotation"; 26 26 String ICON_WIDTH = "icon-width"; 27 /** 28 * Position of icons on area. 29 */ 30 String ICON_POSITION = "icon-position"; 27 31 String LINECAP = "linecap"; 28 32 String LINEJOIN = "linejoin"; -
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaIconElement.java
r11748 r11760 9 9 import org.openstreetmap.josm.gui.mappaint.Cascade; 10 10 import org.openstreetmap.josm.gui.mappaint.Environment; 11 import org.openstreetmap.josm.gui.mappaint.Keyword; 11 12 import org.openstreetmap.josm.gui.mappaint.styleelement.placement.PartiallyInsideAreaStrategy; 12 13 import org.openstreetmap.josm.gui.mappaint.styleelement.placement.PositionForAreaStrategy; … … 32 33 * The position of the icon inside the area. 33 34 */ 34 private final PositionForAreaStrategy iconPosition = PartiallyInsideAreaStrategy.INSTANCE;35 private final PositionForAreaStrategy iconPosition; 35 36 36 protected AreaIconElement(Cascade c, MapImage iconImage, RotationAngle iconImageAngle ) {37 protected AreaIconElement(Cascade c, MapImage iconImage, RotationAngle iconImageAngle, PositionForAreaStrategy iconPosition) { 37 38 super(c, 4.8f); 38 39 this.iconImage = Objects.requireNonNull(iconImage, "iconImage"); 39 40 this.iconImageAngle = Objects.requireNonNull(iconImageAngle, "iconImageAngle"); 41 this.iconPosition = Objects.requireNonNull(iconPosition, "iconPosition"); 40 42 } 41 43 … … 59 61 if (iconImage != null) { 60 62 RotationAngle rotationAngle = NodeElement.createRotationAngle(env); 63 Keyword positionKeyword = c.get(AreaElement.ICON_POSITION, null, Keyword.class); 64 PositionForAreaStrategy position = PositionForAreaStrategy.forKeyword(positionKeyword, PartiallyInsideAreaStrategy.INSTANCE); 61 65 62 return new AreaIconElement(c, iconImage, rotationAngle );66 return new AreaIconElement(c, iconImage, rotationAngle, position); 63 67 } else { 64 68 return null;
Note:
See TracChangeset
for help on using the changeset viewer.