Changeset 5390 in josm


Ignore:
Timestamp:
Aug 4, 2012 1:17:04 PM (10 months ago)
Author:
bastiK
Message:

use individual imagery icons in layer list

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

Legend:

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

    r4172 r5390  
    9292        removeAll(); 
    9393 
    94         // for each configured WMSInfo, add a menu entry. 
     94        // for each configured ImageryInfo, add a menu entry. 
    9595        for (final ImageryInfo u : ImageryLayerInfo.instance.getLayers()) { 
    9696            add(new AddImageryLayerAction(u)); 
  • trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java

    r5186 r5390  
    4242 
    4343public abstract class ImageryLayer extends Layer { 
    44     protected static final Icon icon = ImageProvider.get("imagery_small"); 
    4544 
    4645    public static final IntegerProperty PROP_FADE_AMOUNT = new IntegerProperty("imagery.fade_amount", 0); 
     
    6261    protected final ImageryInfo info; 
    6362 
     63    protected Icon icon; 
     64 
    6465    protected double dx = 0.0; 
    6566    protected double dy = 0.0; 
     
    7980        super(info.getName()); 
    8081        this.info = info; 
     82        if (info.getIcon() != null) { 
     83            icon = new ImageProvider(info.getIcon()).setOptional(true). 
     84                    setMaxHeight(ICON_SIZE).setMaxWidth(ICON_SIZE).get(); 
     85            if (icon == null) { 
     86                icon = ImageProvider.get("imagery_small"); 
     87            } 
     88        } 
    8189        this.sharpenLevel = PROP_SHARPEN_LEVEL.get(); 
    8290        if (OffsetServer.PROP_SERVER_ENABLED.get()) { 
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r5266 r5390  
    8383    static public final String NAME_PROP = Layer.class.getName() + ".name"; 
    8484 
     85    static public final int ICON_SIZE = 16; 
     86 
    8587    /** keeps track of property change listeners */ 
    8688    protected PropertyChangeSupport propertyChangeSupport; 
Note: See TracChangeset for help on using the changeset viewer.