Ignore:
Timestamp:
2017-03-13T17:04:29+01:00 (7 years ago)
Author:
michael2402
Message:

Do not include text label in area style - use a separate class and start merging code for on-line and in-area drawing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r11608 r11722  
    2626import org.openstreetmap.josm.gui.mappaint.styleelement.BoxTextElement;
    2727import org.openstreetmap.josm.gui.mappaint.styleelement.LineElement;
    28 import org.openstreetmap.josm.gui.mappaint.styleelement.LineTextElement;
    2928import org.openstreetmap.josm.gui.mappaint.styleelement.NodeElement;
    3029import org.openstreetmap.josm.gui.mappaint.styleelement.RepeatImageElement;
    3130import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement;
     31import org.openstreetmap.josm.gui.mappaint.styleelement.TextElement;
    3232import org.openstreetmap.josm.gui.mappaint.styleelement.TextLabel;
    3333import org.openstreetmap.josm.gui.util.GuiHelper;
     
    366366            env.layer = e.getKey();
    367367            if (osm instanceof Way) {
    368                 addIfNotNull(sl, AreaElement.create(env));
     368                AreaElement areaStyle = AreaElement.create(env);
     369                addIfNotNull(sl, areaStyle);
    369370                addIfNotNull(sl, RepeatImageElement.create(env));
    370371                addIfNotNull(sl, LineElement.createLine(env));
     
    372373                addIfNotNull(sl, LineElement.createRightCasing(env));
    373374                addIfNotNull(sl, LineElement.createCasing(env));
    374                 addIfNotNull(sl, LineTextElement.create(env));
     375                addIfNotNull(sl, TextElement.create(env));
     376                if (areaStyle != null) {
     377                    //TODO: Warn about this, or even remove it completely
     378                    addIfNotNull(sl, TextElement.createForContent(env));
     379                }
    375380            } else if (osm instanceof Node) {
    376381                NodeElement nodeStyle = NodeElement.create(env);
     
    383388            } else if (osm instanceof Relation) {
    384389                if (((Relation) osm).isMultipolygon()) {
    385                     addIfNotNull(sl, AreaElement.create(env));
     390                    AreaElement areaStyle = AreaElement.create(env);
     391                    addIfNotNull(sl, areaStyle);
    386392                    addIfNotNull(sl, RepeatImageElement.create(env));
    387393                    addIfNotNull(sl, LineElement.createLine(env));
    388394                    addIfNotNull(sl, LineElement.createCasing(env));
    389                     addIfNotNull(sl, LineTextElement.create(env));
     395                    addIfNotNull(sl, TextElement.create(env));
     396                    if (areaStyle != null) {
     397                        //TODO: Warn about this, or even remove it completely
     398                        addIfNotNull(sl, TextElement.createForContent(env));
     399                    }
    390400                } else if (osm.hasTag("type", "restriction")) {
    391401                    addIfNotNull(sl, NodeElement.create(env));
Note: See TracChangeset for help on using the changeset viewer.