Changeset 7563 in josm for trunk/src


Ignore:
Timestamp:
2014-09-19T18:29:23+02:00 (5 years ago)
Author:
bastiK
Message:

see #10529 - remove "very old" multipolygon style (area tags on both inner and outer ways)
(actually, this was never supported for MapCSS styles)

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java

    r7448 r7563  
    347347                    if (s.active) {
    348348                        txtMappaint.append(tr("\n\n> applying {0} style \"{1}\"\n", getSort(s), s.getDisplayString()));
    349                         s.apply(mc, osm, scale, null, false);
     349                        s.apply(mc, osm, scale, false);
    350350                        txtMappaint.append(tr("\nRange:{0}", mc.range));
    351351                        for (Entry<String, Cascade> e : mc.getLayers()) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r7486 r7563  
    168168    private Pair<StyleList, Range> getImpl(OsmPrimitive osm, double scale, NavigatableComponent nc) {
    169169        if (osm instanceof Node)
    170             return generateStyles(osm, scale, null, false);
     170            return generateStyles(osm, scale, false);
    171171        else if (osm instanceof Way)
    172172        {
    173             Pair<StyleList, Range> p = generateStyles(osm, scale, null, false);
     173            Pair<StyleList, Range> p = generateStyles(osm, scale, false);
    174174
    175175            boolean isOuterWayOfSomeMP = false;
     
    252252
    253253                if (multipolygon.getInnerWays().contains(osm)) {
    254                     Iterator<Way> it = multipolygon.getOuterWays().iterator();
    255                     p = generateStyles(osm, scale, it.hasNext() ? it.next() : null, false);
     254                    p = generateStyles(osm, scale, false);
    256255                    boolean hasIndependentElemStyle = false;
    257256                    for (ElemStyle s : p.a) {
     
    282281        else if (osm instanceof Relation)
    283282        {
    284             Pair<StyleList, Range> p = generateStyles(osm, scale, null, true);
     283            Pair<StyleList, Range> p = generateStyles(osm, scale, true);
    285284            if (drawMultipolygon && ((Relation)osm).isMultipolygon()) {
    286285                if (!Utils.exists(p.a, AreaElemStyle.class)) {
     
    288287                    Multipolygon multipolygon = MultipolygonCache.getInstance().get(nc, (Relation) osm);
    289288                    for (Way w : multipolygon.getOuterWays()) {
    290                         Pair<StyleList, Range> wayStyles = generateStyles(w, scale, null, false);
     289                        Pair<StyleList, Range> wayStyles = generateStyles(w, scale, false);
    291290                        p.b = Range.cut(p.b, wayStyles.b);
    292291                        ElemStyle area = Utils.find(wayStyles.a, AreaElemStyle.class);
     
    319318     * @return the generated styles and the valid range as a pair
    320319     */
    321     public Pair<StyleList, Range> generateStyles(OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed) {
     320    public Pair<StyleList, Range> generateStyles(OsmPrimitive osm, double scale, boolean pretendWayIsClosed) {
    322321
    323322        List<ElemStyle> sl = new ArrayList<>();
     
    327326        for (StyleSource s : styleSources) {
    328327            if (s.active) {
    329                 s.apply(mc, osm, scale, multipolyOuterWay, pretendWayIsClosed);
     328                s.apply(mc, osm, scale, pretendWayIsClosed);
    330329            }
    331330        }
     
    402401        for (StyleSource s : styleSources) {
    403402            if (s.active) {
    404                 s.apply(mc, r, 1, null, false);
     403                s.apply(mc, r, 1, false);
    405404            }
    406405        }
     
    451450            if (MapPaintStyles.getStyles() == null)
    452451                return null;
    453             for (ElemStyle s : MapPaintStyles.getStyles().generateStyles(p, 1.0, null, pretendWayIsClosed).a) {
     452            for (ElemStyle s : MapPaintStyles.getStyles().generateStyles(p, 1.0, pretendWayIsClosed).a) {
    454453                if (s instanceof AreaElemStyle)
    455454                    return (AreaElemStyle) s;
     
    484483            if (MapPaintStyles.getStyles() == null)
    485484                return false;
    486             StyleList styles = MapPaintStyles.getStyles().generateStyles(p, 1.0, null, false).a;
     485            StyleList styles = MapPaintStyles.getStyles().generateStyles(p, 1.0, false).a;
    487486            if (styles.isEmpty()) {
    488487                return false;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r7448 r7563  
    146146            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
    147147            try {
    148                 styleList = getStyles().generateStyles(virtualNode, 0.5, null, false).a;
     148                styleList = getStyles().generateStyles(virtualNode, 0.5, false).a;
    149149            } finally {
    150150                MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java

    r7450 r7563  
    7777     * outer ways of a multipolygon.
    7878     */
    79     public abstract void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed);
     79    public abstract void apply(MultiCascade mc, OsmPrimitive osm, double scale, boolean pretendWayIsClosed);
    8080
    8181    /**
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r7509 r7563  
    428428
    429429    @Override
    430     public void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed) {
     430    public void apply(MultiCascade mc, OsmPrimitive osm, double scale, boolean pretendWayIsClosed) {
    431431        Environment env = new Environment(osm, mc, null, this);
    432432        MapCSSRuleIndex matchingRuleIndex;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r7248 r7563  
    301301
    302302    @Override
    303     public void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed) {
     303    public void apply(MultiCascade mc, OsmPrimitive osm, double scale, boolean pretendWayIsClosed) {
    304304        Cascade def = mc.getOrCreateCascade("default");
    305305        boolean useMinMaxScale = Main.pref.getBoolean("mappaint.zoomLevelDisplay", false);
     
    367367                }
    368368            }
    369             if (multipolyOuterWay != null) {
    370                 WayPrototypesRecord p2 = new WayPrototypesRecord();
    371                 get(multipolyOuterWay, true, p2, (useMinMaxScale ? scale : null), mc);
    372                 if (Objects.equals(p.area, p2.area)) {
    373                     p.area = null;
    374                 }
    375             }
    376369            if (p.area != null) {
    377370                def.putOrClear(FILL_COLOR, p.area.color);
Note: See TracChangeset for help on using the changeset viewer.