Ignore:
Timestamp:
2011-01-31T14:18:47+01:00 (14 years ago)
Author:
bastiK
Message:

mappaint restructuring aimed at mapcss support:

  • area- and line style of multipolygon outer & inner ways are no longer determined by MapPaintVisitor, but the information is calculated in advance and cached
  • cache is aware of zoom level
  • z_index property to allow more fancy styles in future

Performance: when the style cache is filled, painting is the same or ~5% faster. The first painting, which includes style generation, takes ~30% longer than before. (There is potential for optimization, though.) Memory usage unchanged.

File:
1 edited

Legend:

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

    r3827 r3836  
    22package org.openstreetmap.josm.gui.mappaint.xml;
    33
    4 import org.openstreetmap.josm.gui.mappaint.IconElemStyle;
    5 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    64import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
    7 import org.openstreetmap.josm.gui.mappaint.NodeElemStyle;
    8 import org.openstreetmap.josm.gui.mappaint.SimpleNodeElemStyle;
     5import org.openstreetmap.josm.gui.mappaint.Range;
    96
    107public class IconPrototype extends Prototype {
    118   
    129    public IconReference icon;
    13     public boolean annotate;
     10    public Boolean annotate;
    1411
    15     public IconPrototype (IconPrototype i, long maxScale, long minScale) {
    16         super(maxScale, minScale);
     12    public IconPrototype (IconPrototype i, Range range) {
     13        super(range);
    1714        this.icon = i.icon;
    1815        this.annotate = i.annotate;
     
    2421
    2522    public void init() {
     23        priority = 0;
     24        range = new Range();
    2625        icon = null;
    27         priority = 0;
    28         annotate = true;
    29     }
    30 
    31     public NodeElemStyle createStyle() {
    32         if (icon == null) {
    33             return SimpleNodeElemStyle.INSTANCE;
    34         } else {
    35             IconElemStyle i = new IconElemStyle(minScale, maxScale, MapPaintStyles.getIcon(icon));
    36             i.annotate = annotate;
    37             return i;
    38         }
     26        annotate = null;
    3927    }
    4028}
Note: See TracChangeset for help on using the changeset viewer.