Ignore:
Timestamp:
2017-04-12T00:46:52+02:00 (7 years ago)
Author:
donvip
Message:

update JOSM + fix #josm13693 + fix #josm13863

Location:
applications/editors/josm/plugins/cadastre-fr
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r32680 r33226  
    44    <property name="commit.message" value="Changed constructor for Plugin"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="10580"/>
     6    <property name="plugin.main.version" value="11713"/>
    77   
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java

    r32950 r33226  
    5656import org.openstreetmap.josm.data.osm.Way;
    5757import org.openstreetmap.josm.data.osm.WaySegment;
    58 import org.openstreetmap.josm.gui.MapFrame;
    5958import org.openstreetmap.josm.gui.MapView;
    6059import org.openstreetmap.josm.tools.GBC;
     
    9190    private boolean ctrl;
    9291
    93     public Address(MapFrame mapFrame) {
     92    /**
     93     * Constructs a new {@code Address} map mode.
     94     */
     95    public Address() {
    9496        super(tr("Add address"), "buildings",
    9597                tr("Helping tool for tag address"),
     
    9799                Shortcut.registerShortcut("mapmode:cadastre-fr-buildings", tr("Mode: {0}", tr("CadastreFR - Buildings")), KeyEvent.VK_E, Shortcut.DIRECT),
    98100                // CHECKSTYLE.ON: LineLength
    99                 mapFrame, getCursor());
     101                getCursor());
    100102    }
    101103
     
    114116            Main.map.mapView.removeMouseListener(this);
    115117        }
    116 //        dialog.setVisible(false);
    117118        // kill the window completely to fix an issue on some linux distro and full screen mode.
    118119        if (dialog != null) {
     
    510511            @Override
    511512            public void windowClosing(WindowEvent arg) {
    512                 exitMode();
     513                if (Boolean.TRUE.equals(getValue("active"))) {
     514                    exitMode();
     515                }
    513516                Main.map.selectMapMode((MapMode) Main.map.getDefaultButtonAction());
    514517            }
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r33047 r33226  
    376376            if (oldFrame == null && newFrame != null) {
    377377                setEnabledAll(true);
    378                 Main.map.addMapMode(new IconToggleButton(new WMSAdjustAction(Main.map)));
    379                 Main.map.addMapMode(new IconToggleButton(new Address(Main.map)));
     378                Main.map.addMapMode(new IconToggleButton(new WMSAdjustAction()));
     379                Main.map.addMapMode(new IconToggleButton(new Address()));
    380380            } else if (oldFrame != null && newFrame == null) {
    381381                setEnabledAll(false);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSAdjustAction.java

    r32556 r33226  
    1818import org.openstreetmap.josm.actions.mapmode.MapMode;
    1919import org.openstreetmap.josm.data.coor.EastNorth;
    20 import org.openstreetmap.josm.gui.MapFrame;
    2120import org.openstreetmap.josm.gui.MapView;
    2221import org.openstreetmap.josm.tools.ImageProvider;
     
    3433    private static EastNorth[] croppedRaster = new EastNorth[5];;
    3534
    36     public WMSAdjustAction(MapFrame mapFrame) {
     35    /**
     36     * Constructs a new {@code WMSAdjustAction} map mode.
     37     */
     38    public WMSAdjustAction() {
    3739        super(tr("Adjust WMS"), "adjustxywms",
    38                         tr("Adjust the position of the WMS layer (saved for raster images only)"), mapFrame,
     40                        tr("Adjust the position of the WMS layer (saved for raster images only)"),
    3941                        ImageProvider.getCursor("normal", "move"));
    4042    }
     
    5052                modifiedLayer.adjustModeEnabled = true;
    5153            } else {
    52 //                JOptionPane.showMessageDialog(Main.parent,tr("This mode works only if active layer is\n"
    53 //                        +"a cadastre layer"));
    54                 exitMode();
     54                // This mode works only if active layer is a cadastre layer
     55                if (Boolean.TRUE.equals(getValue("active"))) {
     56                    exitMode();
     57                }
    5558                Main.map.selectMapMode((MapMode) Main.map.getDefaultButtonAction());
    5659            }
Note: See TracChangeset for help on using the changeset viewer.