Changeset 6398 in josm for trunk


Ignore:
Timestamp:
2013-11-20T23:12:02+01:00 (11 years ago)
Author:
Don-vip
Message:

jump to location only in expert mode + javadoc

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r6394 r6398  
    88import java.awt.event.ActionEvent;
    99import java.awt.event.KeyEvent;
     10
    1011import javax.swing.Icon;
    11 
    1212import javax.swing.JLabel;
    1313import javax.swing.JOptionPane;
     
    1919import org.openstreetmap.josm.data.Bounds;
    2020import org.openstreetmap.josm.data.coor.LatLon;
     21import org.openstreetmap.josm.gui.MapFrame;
     22import org.openstreetmap.josm.gui.MapFrameListener;
    2123import org.openstreetmap.josm.gui.MapView;
    22 
     24import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2325import org.openstreetmap.josm.tools.GBC;
    2426import org.openstreetmap.josm.tools.OsmUrlToBounds;
    2527import org.openstreetmap.josm.tools.Shortcut;
    26 import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2728
    2829/**
     
    3637     */
    3738    public JumpToAction() {
    38         super(tr("Jump To Position"), (Icon) null, tr("Opens a dialog that allows to jump to a specific location"), Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")),
    39         KeyEvent.VK_J, Shortcut.CTRL), true, "action/jumpto", false);
     39        super(tr("Jump To Position"), (Icon) null, tr("Opens a dialog that allows to jump to a specific location"),
     40                Shortcut.registerShortcut("tools:jumpto", tr("Tool: {0}", tr("Jump To Position")),
     41                        KeyEvent.VK_J, Shortcut.CTRL), true, "action/jumpto", true);
    4042    }
    4143
     
    185187        showJumpToDialog();
    186188    }
     189
     190    @Override
     191    protected void updateEnabledState() {
     192        setEnabled(Main.isDisplayingMapView());
     193    }
     194
     195    @Override
     196    protected void installAdapters() {
     197        super.installAdapters();
     198        // make this action listen to mapframe change events
     199        Main.addMapFrameListener(new MapFrameListener() {
     200            @Override
     201            public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
     202                updateEnabledState();
     203            }
     204        });
     205    }
    187206}
  • trunk/src/org/openstreetmap/josm/gui/MainMenu.java

    r6394 r6398  
    212212
    213213    /* Tools menu */
     214    /** Tools -> Split Way */
    214215    public final JosmAction splitWay = new SplitWayAction();
     216    /** Tools -> Combine Way */
    215217    public final JosmAction combineWay = new CombineWayAction();
     218    /** Tools -> Reverse Ways */
    216219    public final JosmAction reverseWay = new ReverseWayAction();
     220    /** Tools -> Simplify Way */
    217221    public final JosmAction simplifyWay = new SimplifyWayAction();
     222    /** Tools -> Align Nodes in Circle */
    218223    public final JosmAction alignInCircle = new AlignInCircleAction();
     224    /** Tools -> Align Nodes in Line */
    219225    public final JosmAction alignInLine = new AlignInLineAction();
     226    /** Tools -> Distribute Nodes */
    220227    public final JosmAction distribute = new DistributeAction();
     228    /** Tools -> Orthogonalize Shape */
    221229    public final OrthogonalizeAction ortho = new OrthogonalizeAction();
    222     public final JosmAction orthoUndo = new Undo();  // action is not shown in the menu. Only triggered by shortcut
     230    /** Orthogonalize undo. Action is not shown in the menu. Only triggered by shortcut */
     231    public final JosmAction orthoUndo = new Undo();
     232    /** Tools -> Mirror */
    223233    public final JosmAction mirror = new MirrorAction();
     234    /** Tools -> Follow line */
    224235    public final JosmAction followLine = new FollowLineAction();
     236    /** Tools -> Add Node... */
    225237    public final AddNodeAction addnode = new AddNodeAction();
     238    /** Tools -> Move Node... */
    226239    public final MoveNodeAction movenode = new MoveNodeAction();
     240    /** Tools -> Create Circle */
    227241    public final JosmAction createCircle = new CreateCircleAction();
     242    /** Tools -> Merge Nodes */
    228243    public final JosmAction mergeNodes = new MergeNodesAction();
     244    /** Tools -> Join Node to Way */
    229245    public final JosmAction joinNodeWay = new JoinNodeWayAction();
     246    /** Tools -> Disconnect Node from Way */
    230247    public final JosmAction unJoinNodeWay = new UnJoinNodeWayAction();
     248    /** Tools -> Unglue Ways */
    231249    public final JosmAction unglueNodes = new UnGlueAction();
     250    /** Tools -> Join overlapping Areas */
    232251    public final JosmAction joinAreas = new JoinAreasAction();
     252    /** Tools -> Create multipolygon */
    233253    public final JosmAction createMultipolygon = new CreateMultipolygonAction();
    234254
     
    240260
    241261    /* Audio menu */
     262    /** Audio -> Play/Pause */
    242263    public final JosmAction audioPlayPause = new AudioPlayPauseAction();
     264    /** Audio -> Next marker */
    243265    public final JosmAction audioNext = new AudioNextAction();
     266    /** Audio -> Previous Marker */
    244267    public final JosmAction audioPrev = new AudioPrevAction();
     268    /** Audio -> Forward */
    245269    public final JosmAction audioFwd = new AudioFwdAction();
     270    /** Audio -> Back */
    246271    public final JosmAction audioBack = new AudioBackAction();
     272    /** Audio -> Faster */
    247273    public final JosmAction audioFaster = new AudioFasterAction();
     274    /** Audio -> Slower */
    248275    public final JosmAction audioSlower = new AudioSlowerAction();
    249276
     
    650677        viewMenu.add(dialogsToggle);
    651678
    652         viewMenu.addSeparator();
    653         add(viewMenu, jumpToAct);
     679        add(viewMenu, jumpToAct, true);
    654680        viewMenu.addSeparator();
    655681        add(viewMenu, info);
Note: See TracChangeset for help on using the changeset viewer.