Changeset 27290 in osm for applications/editors


Ignore:
Timestamp:
2011-12-21T15:35:00+01:00 (13 years ago)
Author:
larry0ua
Message:

PicLayer - fix of #7171

Location:
applications/editors/josm/plugins/piclayer
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/piclayer/build.xml

    r27231 r27290  
    2222-->
    2323<project name="PicLayer" default="dist" basedir=".">
    24     <property name="commit.message" value="PicLayer - changed marker icon to make it more visible; #5451; #7124 - first stage"/>
    25     <property name="plugin.main.version" value="4549"/>
     24    <property name="commit.message" value="PicLayer - fix of #7171"/>
     25    <property name="plugin.main.version" value="4669"/>
    2626    <!--
    2727      ************************************************
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java

    r27191 r27290  
    5959public class PicLayerPlugin extends Plugin implements LayerChangeListener {
    6060
    61     public static List<PicToggleButton> buttonList = null;
     61    public static List<IconToggleButton> buttonList = null;
    6262
    6363    // Plugin menu
     
    104104            // Create plugin buttons and add them to the toolbar
    105105
    106             buttonList = new ArrayList<PicToggleButton>(7);
    107             buttonList.add(new PicToggleButton(movePictureAction, tr("Move Picture"), "piclayer.actionvisibility.move", true));
    108             buttonList.add(new PicToggleButton(movePointAction, tr("Move Point"), "piclayer.actionvisibility.movepoint", true));
    109             buttonList.add(new PicToggleButton(transformPointAction, tr("Transform Point"), "piclayer.actionvisibility.transformpoint", true));
    110             buttonList.add(new PicToggleButton(rotatePictureAction, tr("Rotate"), "piclayer.actionvisibility.rotate", false));
    111             buttonList.add(new PicToggleButton(scaleXYPictureAction, tr("Scale"), "piclayer.actionvisibility.scale", false));
    112             buttonList.add(new PicToggleButton(scaleXPictureAction, tr("Scale X"), "piclayer.actionvisibility.scalex", false));
    113             buttonList.add(new PicToggleButton(scaleYPictureAction, tr("Scale Y"), "piclayer.actionvisibility.scaley", false));
    114             buttonList.add(new PicToggleButton(shearPictureAction, tr("Shear"), "piclayer.actionvisibility.shear", false));
     106            buttonList = new ArrayList<IconToggleButton>(7);
     107            buttonList.add(new IconToggleButton(movePictureAction));
     108            buttonList.add(new IconToggleButton(movePointAction));
     109            buttonList.add(new IconToggleButton(transformPointAction));
     110            buttonList.add(new IconToggleButton(rotatePictureAction));
     111            buttonList.add(new IconToggleButton(scaleXYPictureAction));
     112            buttonList.add(new IconToggleButton(scaleXPictureAction));
     113            buttonList.add(new IconToggleButton(scaleYPictureAction));
     114            buttonList.add(new IconToggleButton(shearPictureAction));
    115115
    116116            for(IconToggleButton btn : buttonList) {
     
    128128        boolean newPic = newLayer instanceof PicLayerAbstract;
    129129        // actually that should be not enough - JOSM should hide all buttons that are disabled for current layer!
    130         if (oldPic && !newPic || oldLayer == null && !newPic) { // leave picture layer - hide all controls
    131             for (PicToggleButton btn : buttonList) {
    132                 btn.writeVisible();
    133                 btn.setVisible(false);
    134             }
    135             if (oldLayer != null)
    136                 ((PicLayerAbstract)oldLayer).setDrawPoints(false);
     130        if (oldPic) { // leave picture layer            if (oldLayer != null)
     131            ((PicLayerAbstract)oldLayer).setDrawPoints(false);
    137132        }
    138         if (!oldPic && newPic) { // enter picture layer - reset visibility of controls
    139             for (PicToggleButton btn : buttonList)
    140                 btn.readVisible();
     133        if (newPic) {
     134                ((PicLayerAbstract)newLayer).setDrawPoints(true);
    141135        }
    142136    }
Note: See TracChangeset for help on using the changeset viewer.