Changeset 11368 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2016-12-08T01:47:27+01:00 (7 years ago)
Author:
Don-vip
Message:

see #14043 - review use of short type

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r11294 r11368  
    5757     * and on upload the object will be send to the server.
    5858     */
    59     protected static final short FLAG_MODIFIED = 1 << 0;
     59    protected static final short FLAG_MODIFIED = 0x0001;
    6060
    6161    /**
     
    6363     * as deleted on the server.
    6464     */
    65     protected static final short FLAG_VISIBLE = 1 << 1;
     65    protected static final short FLAG_VISIBLE = 0x0010;
    6666
    6767    /**
     
    7272     * objects still referring to it.
    7373     */
    74     protected static final short FLAG_DELETED = 1 << 2;
     74    protected static final short FLAG_DELETED = 0x0100;
    7575
    7676    /**
     
    7979     * fetched from the server.
    8080     */
    81     protected static final short FLAG_INCOMPLETE = 1 << 3;
     81    protected static final short FLAG_INCOMPLETE = 0x1000;
    8282
    8383    /**
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r11294 r11368  
    248248     *--------*/
    249249    public StyleCache mappaintStyle;
    250     public int mappaintCacheIdx;
     250    private short mappaintCacheIdx;
    251251
    252252    /* This should not be called from outside. Fixing the UI to add relevant
     
    256256        mappaintStyle = null;
    257257    }
     258
     259    /**
     260     * Returns mappaint cache index.
     261     * @return mappaint cache index
     262     */
     263    public final short getMappaintCacheIdx() {
     264        return mappaintCacheIdx;
     265    }
     266
     267    /**
     268     * Sets the mappaint cache index.
     269     * @param mappaintCacheIdx mappaint cache index
     270     */
     271    public final void setMappaintCacheIdx(short mappaintCacheIdx) {
     272        this.mappaintCacheIdx = mappaintCacheIdx;
     273    }
     274
    258275    /* end of mappaint data */
    259276
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r11137 r11368  
    5252 * The results are cached with respect to the current scale.
    5353 *
    54  * Use {@link #setStyleSources(Collection)} to select the StyleSources that are
    55  * applied.
     54 * Use {@link #setStyleSources(Collection)} to select the StyleSources that are applied.
    5655 */
    5756public class ElemStyles implements PreferenceChangedListener {
     
    5958    private boolean drawMultipolygon;
    6059
    61     private int cacheIdx = 1;
    62 
    63     private boolean defaultNodes, defaultLines;
    64     private int defaultNodesIdx, defaultLinesIdx;
     60    private short cacheIdx = 1;
     61
     62    private boolean defaultNodes;
     63    private boolean defaultLines;
     64
     65    private short defaultNodesIdx;
     66    private short defaultLinesIdx;
    6567
    6668    private final Map<String, String> preferenceCache = new HashMap<>();
     
    112114     */
    113115    public Pair<StyleElementList, Range> getStyleCacheWithRange(OsmPrimitive osm, double scale, NavigatableComponent nc) {
    114         if (osm.mappaintStyle == null || osm.mappaintCacheIdx != cacheIdx || scale <= 0) {
     116        if (osm.mappaintStyle == null || osm.getMappaintCacheIdx() != cacheIdx || scale <= 0) {
    115117            osm.mappaintStyle = StyleCache.EMPTY_STYLECACHE;
    116118        } else {
     
    170172                    + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ')', e);
    171173        }
    172         osm.mappaintCacheIdx = cacheIdx;
     174        osm.setMappaintCacheIdx(cacheIdx);
    173175        return p;
    174176    }
Note: See TracChangeset for help on using the changeset viewer.