Changeset 9278 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
- Timestamp:
- 2016-01-03T15:50:53+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement
- Files:
-
- 1 added
- 1 moved
-
. (added)
-
AreaElement.java (moved) (moved from trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java ) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
r9275 r9278 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm.gui.mappaint; 2 package org.openstreetmap.josm.gui.mappaint.styleelement; 3 3 4 4 import java.awt.Color; … … 12 12 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 13 13 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; 14 import org.openstreetmap.josm.gui.mappaint.Cascade; 15 import org.openstreetmap.josm.gui.mappaint.Environment; 16 import org.openstreetmap.josm.gui.mappaint.Keyword; 14 17 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 15 18 import org.openstreetmap.josm.tools.CheckParameterUtil; 16 19 import org.openstreetmap.josm.tools.Utils; 17 20 18 public class AreaElem StyleextendsElemStyle{21 public class AreaElement extends StyleElement { 19 22 20 23 /** … … 24 27 public Color color; 25 28 public MapImage fillImage; 26 public Text Elementtext;29 public TextLabel text; 27 30 public Float extent; 28 31 public Float extentThreshold; 29 32 30 protected AreaElem Style(Cascade c, Color color, MapImage fillImage, Float extent, Float extentThreshold, TextElementtext) {33 protected AreaElement(Cascade c, Color color, MapImage fillImage, Float extent, Float extentThreshold, TextLabel text) { 31 34 super(c, 1f); 32 35 CheckParameterUtil.ensureParameterNotNull(color); … … 38 41 } 39 42 40 public static AreaElem Stylecreate(final Environment env) {43 public static AreaElement create(final Environment env) { 41 44 final Cascade c = env.mc.getCascade(env.layer); 42 45 MapImage fillImage = null; … … 76 79 } 77 80 78 Text Elementtext = null;81 TextLabel text = null; 79 82 Keyword textPos = c.get(TEXT_POSITION, null, Keyword.class); 80 83 if (textPos == null || "center".equals(textPos.val)) { 81 text = Text Element.create(env, PaintColors.AREA_TEXT.get(), true);84 text = TextLabel.create(env, PaintColors.AREA_TEXT.get(), true); 82 85 } 83 86 … … 86 89 87 90 if (color != null) 88 return new AreaElem Style(c, color, fillImage, extent, extentThreshold, text);91 return new AreaElement(c, color, fillImage, extent, extentThreshold, text); 89 92 else 90 93 return null; … … 118 121 if (!super.equals(obj)) 119 122 return false; 120 AreaElem Styleother = (AreaElemStyle) obj;123 AreaElement other = (AreaElement) obj; 121 124 // we should get the same image object due to caching 122 125 if (!Objects.equals(fillImage, other.fillImage))
Note:
See TracChangeset
for help on using the changeset viewer.
