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


Ignore:
Timestamp:
2018-05-23T02:59:51+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #16308, see #16047 - remove blank png icon. With jdk-11-ea+14 JOSM fails to load it (ImageProvider returns null). JDK bugs:

File:
1 edited

Legend:

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

    r13608 r13821  
    1313import java.awt.event.KeyEvent;
    1414import java.awt.event.MouseEvent;
     15import java.awt.image.BufferedImage;
    1516import java.beans.PropertyChangeEvent;
    1617import java.beans.PropertyChangeListener;
     
    8081import org.openstreetmap.josm.spi.preferences.Config;
    8182import org.openstreetmap.josm.tools.ImageProvider;
     83import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
    8284import org.openstreetmap.josm.tools.InputMapUtils;
    8385import org.openstreetmap.josm.tools.Shortcut;
     
    392394    }
    393395
     396    static ImageIcon createBlankIcon() {
     397        return new ImageIcon(new BufferedImage(
     398                ImageSizes.LAYER.getAdjustedWidth(), ImageSizes.LAYER.getAdjustedHeight(), BufferedImage.TYPE_INT_ARGB));
     399    }
     400
    394401    private static class ActiveLayerCheckBox extends JCheckBox {
    395402        ActiveLayerCheckBox() {
    396403            setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    397             ImageIcon blank = ImageProvider.get("dialogs/layerlist", "blank");
     404            ImageIcon blank = createBlankIcon();
    398405            ImageIcon active = ImageProvider.get("dialogs/layerlist", "active");
    399406            setIcon(blank);
     
    446453        NativeScaleLayerCheckBox() {
    447454            setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    448             ImageIcon blank = ImageProvider.get("dialogs/layerlist", "blank");
     455            ImageIcon blank = createBlankIcon();
    449456            ImageIcon active = ImageProvider.get("dialogs/layerlist", "scale");
    450457            setIcon(blank);
     
    456463        OffsetLayerCheckBox() {
    457464            setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    458             ImageIcon blank = ImageProvider.get("dialogs/layerlist", "blank");
     465            ImageIcon blank = createBlankIcon();
    459466            ImageIcon withOffset = ImageProvider.get("dialogs/layerlist", "offset");
    460467            setIcon(blank);
Note: See TracChangeset for help on using the changeset viewer.