Changeset 27288 in osm for applications


Ignore:
Timestamp:
2011-12-20T21:40:05+01:00 (13 years ago)
Author:
stoecker
Message:

update to new JOSM feature, see #josm6953

Location:
applications/editors/josm/plugins/routing
Files:
3 deleted
5 edited

Legend:

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

    r27269 r27288  
    2727<project name="routing" default="dist" basedir=".">
    2828    <property name="commit.message" value="fixed NPE at startup"/>
    29     <property name="plugin.main.version" value="4666"/>
     29    <property name="plugin.main.version" value="4669"/>
    3030    <!-- Define some properties -->
    3131    <property name="josm" location="../../core/dist/josm-custom.jar"/>
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java

    r27269 r27288  
    195195            removeRouteNodeButton = new IconToggleButton(removeRouteNodeAction);
    196196            moveRouteNodeButton = new IconToggleButton(moveRouteNodeAction);
     197            addRouteNodeButton.setAutoHideDisabledButton(true);
     198            removeRouteNodeButton.setAutoHideDisabledButton(true);
     199            moveRouteNodeButton.setAutoHideDisabledButton(true);
    197200            newFrame.addMapMode(addRouteNodeButton);
    198201            newFrame.addMapMode(removeRouteNodeButton);
    199202            newFrame.addMapMode(moveRouteNodeButton);
    200 //            newFrame.toolGroup.add(addRouteNodeButton);
    201 //            newFrame.toolGroup.add(removeRouteNodeButton);
    202 //            newFrame.toolGroup.add(moveRouteNodeButton);
    203             // Hide them by default
    204             addRouteNodeButton.setVisible(false);
    205             removeRouteNodeButton.setVisible(false);
    206             moveRouteNodeButton.setVisible(false);
    207203            // Enable menu
    208204            menu.enableStartItem();
     
    216212     */
    217213    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    218                 if (addRouteNodeButton==null) return;
    219214                if (newLayer instanceof RoutingLayer) {                 /*   show Routing toolbar and dialog window  */
    220                         addRouteNodeButton.setVisible(true);
    221                     removeRouteNodeButton.setVisible(true);
    222                     moveRouteNodeButton.setVisible(true);
    223215                    menu.enableRestOfItems();                   
    224216                    routingDialog.showDialog();
    225217                    routingDialog.refresh();
    226218                }else{                                                                                  /*   hide Routing toolbar and dialog window  */
    227                         addRouteNodeButton.setVisible(false);
    228                     removeRouteNodeButton.setVisible(false);
    229                     moveRouteNodeButton.setVisible(false);
    230219                    menu.disableRestOfItems();
    231220                    routingDialog.hideDialog();
     
    240229        // Add button(s) to the tool bar when the routing layer is added
    241230        if (newLayer instanceof RoutingLayer) {
    242             addRouteNodeButton.setVisible(true);
    243             removeRouteNodeButton.setVisible(true);
    244             moveRouteNodeButton.setVisible(true);
    245231            menu.enableRestOfItems();
    246232            // Set layer on top and select layer, also refresh toggleDialog to reflect selection
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java

    r15707 r27288  
    3838import org.openstreetmap.josm.gui.MapFrame;
    3939import org.openstreetmap.josm.tools.ImageProvider;
     40
     41import org.openstreetmap.josm.gui.layer.Layer;
    4042
    4143import com.innovant.josm.plugin.routing.RoutingLayer;
     
    105107        Main.map.repaint();
    106108    }
    107 
     109    @Override public boolean layerIsSupported(Layer l) {
     110        return l instanceof RoutingLayer;
     111    }
    108112}
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java

    r16294 r27288  
    4040import org.openstreetmap.josm.gui.MapFrame;
    4141import org.openstreetmap.josm.tools.ImageProvider;
     42
     43import org.openstreetmap.josm.gui.layer.Layer;
    4244
    4345import com.innovant.josm.plugin.routing.RoutingLayer;
     
    154156        }
    155157    }
     158    @Override public boolean layerIsSupported(Layer l) {
     159        return l instanceof RoutingLayer;
     160    }
     161
    156162}
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java

    r16294 r27288  
    3939import org.openstreetmap.josm.gui.MapFrame;
    4040import org.openstreetmap.josm.tools.ImageProvider;
     41import org.openstreetmap.josm.gui.layer.Layer;
    4142
    4243import com.innovant.josm.plugin.routing.RoutingLayer;
     
    122123    }
    123124
     125    @Override public boolean layerIsSupported(Layer l) {
     126        return l instanceof RoutingLayer;
     127    }
     128
    124129}
Note: See TracChangeset for help on using the changeset viewer.