Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java (revision 11673)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java (revision 11674)
@@ -949,4 +949,5 @@
* @param member {@code} true to render it as a relation member, {@code false} otherwise
* @param theta the angle of rotation in radians
+ * @since 11670
*/
public void drawAreaIcon(OsmPrimitive primitive, MapImage img, boolean disabled, boolean selected, boolean member, double theta) {
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java (revision 11673)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java (revision 11674)
@@ -62,4 +62,7 @@
private final MapImage iconImage;
+ /**
+ * The rotation of the {@link #iconImageAngle}
+ */
private final RotationAngle iconImageAngle;
@@ -175,10 +178,12 @@
Objects.equals(text, that.text) &&
Objects.equals(extent, that.extent) &&
- Objects.equals(extentThreshold, that.extentThreshold);
+ Objects.equals(extentThreshold, that.extentThreshold) &&
+ Objects.equals(iconImage, that.iconImage) &&
+ Objects.equals(iconImageAngle, that.iconImageAngle);
}
@Override
public int hashCode() {
- return Objects.hash(super.hashCode(), color, fillImage, text, extent, extentThreshold);
+ return Objects.hash(super.hashCode(), color, fillImage, text, extent, extentThreshold, iconImage, iconImageAngle);
}
@@ -186,5 +191,5 @@
public String toString() {
return "AreaElemStyle{" + super.toString() + "color=" + Utils.toString(color) +
- " fillImage=[" + fillImage + "]}";
+ " fillImage=[" + fillImage + "] iconImage=[" + iconImage + "] iconImageAngle=[" + iconImageAngle + "]}";
}
}
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java (revision 11673)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java (revision 11674)
@@ -33,5 +33,11 @@
*/
public class NodeElement extends StyleElement {
+ /**
+ * The image that is used to display this node. May be null
+ */
public final MapImage mapImage;
+ /**
+ * The angle that is used to rotate {@link #mapImage}. May be null
to indicate no rotation.
+ */
public final RotationAngle mapImageAngle;
/**
@@ -63,4 +69,9 @@
}
+ /**
+ * Creates a new node element for the given Environment
+ * @param env The environment
+ * @return The node element style or null
if the node should not be painted.
+ */
public static NodeElement create(Environment env) {
return create(env, 4f, false);
@@ -90,4 +101,5 @@
* @param env The environment
* @return The angle
+ * @since 11670
*/
public static RotationAngle createRotationAngle(Environment env) {
@@ -115,8 +127,20 @@
}
+ /**
+ * Create a map icon for the environment using the default keys.
+ * @param env The environment to read the icon form
+ * @return The icon or null
if no icon is defined
+ * @since 11670
+ */
public static MapImage createIcon(final Environment env) {
return createIcon(env, ICON_KEYS);
}
+ /**
+ * Create a map icon for the environment.
+ * @param env The environment to read the icon form
+ * @param keys The keys, indexed by the ICON_..._IDX constants.
+ * @return The icon or null
if no icon is defined
+ */
public static MapImage createIcon(final Environment env, final String ... keys) {
CheckParameterUtil.ensureParameterNotNull(env, "env");
@@ -168,4 +192,9 @@
}
+ /**
+ * Create a symbol for the environment
+ * @param env The environment to read the icon form
+ * @return The symbol.
+ */
private static Symbol createSymbol(Environment env) {
Cascade c = env.mc.getCascade(env.layer);
@@ -303,4 +332,8 @@
}
+ /**
+ * Gets the selection box for this element.
+ * @return The selection box as {@link BoxProvider} object.
+ */
public BoxProvider getBoxProvider() {
if (mapImage != null)