Ignore:
Timestamp:
2016-06-19T16:08:56+02:00 (8 years ago)
Author:
donvip
Message:

fix #josm12953 - Replace most uses of MapView.getActiveLayer and similar methods (patch by michael2402, modified) - gsoc-core

Location:
applications/editors/josm/plugins/piclayer
Files:
4 edited

Legend:

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

    r31926 r32329  
    33    <property name="commit.message" value="[josm/PicLayer] - #12045 add ability to localize dialog titles"/>
    44    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    5     <property name="plugin.main.version" value="7817"/>
     5    <property name="plugin.main.version" value="10279"/>
    66       
    77    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java

    r31729 r32329  
    158158                new SavePictureCalibrationAction((PicLayerAbstract) arg0).actionPerformed(null);
    159159        }
    160         // Why should I do all these checks now?
    161         boolean enable = Main.map != null && Main.map.mapView != null && Main.map.mapView.getAllLayers() != null && Main.map.mapView.getAllLayers().size() != 0;
     160        boolean enable = !Main.getLayerManager().getLayers().isEmpty();
    162161        newLayerFromFileAction.setEnabled(enable);
    163162        newLayerFromClipboardAction.setEnabled(enable);
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/GenericPicTransformAction.java

    r30356 r32329  
    5757    public void mousePressed(MouseEvent e) {
    5858        // Start action
    59         if ( Main.map.mapView.getActiveLayer() instanceof PicLayerAbstract ) {
    60             currentLayer = (PicLayerAbstract)Main.map.mapView.getActiveLayer();
     59        if ( Main.getLayerManager().getActiveLayer() instanceof PicLayerAbstract ) {
     60            currentLayer = (PicLayerAbstract)Main.getLayerManager().getActiveLayer();
    6161
    6262            if ( currentLayer != null && e.getButton() == MouseEvent.BUTTON1 ) {
     
    9999
    100100    protected void updateDrawPoints(boolean value) {
    101         Layer active = Main.map.mapView.getActiveLayer();
     101        Layer active = Main.getLayerManager().getActiveLayer();
    102102        if (active instanceof PicLayerAbstract) {
    103103            ((PicLayerAbstract)active).setDrawPoints(value);
  • applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/newlayer/NewLayerFromFileAction.java

    r31729 r32329  
    119119            // or at the bottom of the stack if there is no such layer yet
    120120            // The next layers we load will be placed one after the other after this first layer
    121             int newLayerPos = Main.map.mapView.getAllLayers().size();
    122             for(Layer l : Main.map.mapView.getLayersOfType(PicLayerAbstract.class)) {
     121            int newLayerPos = Main.getLayerManager().getLayers().size();
     122            for(Layer l : Main.getLayerManager().getLayersOfType(PicLayerAbstract.class)) {
    123123                int pos = Main.map.mapView.getLayerPos(l);
    124124                if (pos < newLayerPos) newLayerPos = pos;
Note: See TracChangeset for help on using the changeset viewer.