Class MainMenu
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JMenuBar
-
- org.openstreetmap.josm.gui.MainMenu
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.MenuElement
public class MainMenu extends javax.swing.JMenuBar
This is the JOSM main menu bar. It is overwritten to initialize itself and provide all menu entries as member variables (sort of collect them).It also provides possibilities to attach new menu entries (used by plugins).
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
MainMenu.EditLayerMenuEnabler
static class
MainMenu.WINDOW_MENU_GROUP
The possible item groups of the Windows menu.-
Nested classes/interfaces inherited from class javax.swing.JMenuBar
javax.swing.JMenuBar.AccessibleJMenuBar
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description AboutAction
about
Help / AboutAddNodeAction
addNode
Tools / Add Node...AlignInCircleAction
alignInCircle
Tools / Align Nodes in CircleAlignInLineAction
alignInLine
Tools / Align Nodes in LineJosmAction
audioBack
Audio / BackJosmAction
audioFaster
Audio / FasterJosmAction
audioFwd
Audio / Forwardjavax.swing.JMenu
audioMenu
audioMenu contains all audio-related actions.JosmAction
audioNext
Audio / Next markerJosmAction
audioPlayPause
Audio / Play/PauseJosmAction
audioPrev
Audio / Previous MarkerJosmAction
audioSlower
Audio / Slowerjava.util.Map<AutoScaleAction.AutoScaleMode,AutoScaleAction>
autoScaleActions
View / "Zoom to"...ChangesetManagerToggleAction
changesetManager
Windows / Changeset ManagerCloseChangesetAction
closeChangesetAction
File / Close open changesets...CombineWayAction
combineWay
Tools / Combine WayCopyAction
copy
Edit / CopyJosmAction
copyCoordinates
Edit / Copy CoordinatesCopyUrlAction
copyUrl
Edit / Copy URLsCreateCircleAction
createCircle
Tools / Create CircleCreateMultipolygonAction
createMultipolygon
Tools / Create multipolygonjavax.swing.JMenu
dataMenu
dataMenu contains plugin actions that are related to certain tagging schemes (addressing opening hours), importing external data and using external web APIsprivate static int
defaultMenuPos
DeleteAction
delete
Edit / DeleteDeleteLayerAction
deleteLayerAction
File / Delete LayerDialogsToggleAction
dialogsToggleAction
Toggle visibility of dialogs panelDistributeAction
distribute
Tools / Distribute NodesDownloadAction
download
File / Download from OSM...DownloadAlongWayAction
downloadAlongWay
Tools / Download along wayDownloadOsmInViewAction
downloadInView
File / Download in current viewDownloadNotesInViewAction
downloadNotesInView
File / Download notes in current viewDownloadPrimitiveAction
downloadPrimitive
File / Download object...DownloadReferrersAction
downloadReferrers
File / Download parent ways/relations...DrawBoundariesOfDownloadedDataAction
drawBoundariesOfDownloadedDataAction
View / Hatch area outside downloadDuplicateAction
duplicate
Edit / Duplicatejavax.swing.JMenu
editMenu
editMenu contains editing actionsExitAction
exit
File / Exitjavax.swing.JMenu
fileMenu
fileMenu contains I/O actionsFollowLineAction
followLine
Tools / Follow lineFullscreenToggleAction
fullscreenToggleAction
Toggle the full-screen modejavax.swing.JMenu
gpsMenu
gpsMenu contains all plugin actions that are related to using GPS data, including opening, uploading and real-time trackingGpxExportAction
gpxExport
File / Export to GPX...HelpAction
help
Help / Helpjavax.swing.JMenu
helpMenu
helpMenu contains JOSM general actions (Help, About, etc.)HistoryInfoAction
historyinfo
View / HistoryHistoryInfoWebAction
historyinfoweb
View / History (web)ImageryMenu
imageryMenu
imageryMenu contains all imagery-related actionsjavax.swing.JMenu
imagerySubMenu
submenu in Imagery menu that contains plugin-managed additional imagery layersInfoAction
info
View / Advanced infoInfoWebAction
infoweb
View / Advanced info (web)InvertSelectionAction
invertSelection
Selection / Invert SelectionJoinAreasAction
joinAreas
Tools / Join overlapping AreasJoinNodeWayAction
joinNodeWay
Tools / Join Node to WayJumpToAction
jumpToAct
View / Jump to positionstatic javax.swing.event.MenuListener
menuSeparatorHandler
this menu listener hides unnecessary JSeparators in a menu list but does not remove them.MergeLayerAction
merge
Edit / Merge layerMergeNodesAction
mergeNodes
Tools / Merge NodesMergeSelectionAction
mergeSelected
Edit / Merge selectionMirrorAction
mirror
Tools / Mirrorjavax.swing.JMenu
modeMenu
modeMenu contains map modesjavax.swing.JMenu
moreToolsMenu
moreToolsMenu contains geometry-related actions from all the pluginsJosmAction
moveDownAction
Move the selection downJosmAction
moveLeftAction
Move the selection leftMoveNodeAction
moveNode
Tools / Move Node...JoinNodeWayAction
moveNodeOntoWay
Tools / Join Way to NodeJosmAction
moveRightAction
Move the selection rightJosmAction
moveUpAction
Move the selection upNewAction
newAction
File / New LayerSelectNonBranchingWaySequencesAction
nonBranchingWaySequences
Selection / Non-branching way sequencesOpenFileAction
openFile
File / Open...OpenLocationAction
openLocation
File / Open Location...OrthogonalizeAction
ortho
Tools / Orthogonalize ShapeOrthogonalizeAction.Undo
orthoUndo
Orthogonalize undo.PasteAction
paste
Edit / Pasteprivate PasteAtSourcePositionAction
pasteAtSource
Edit / Paste at sourcePasteTagsAction
pasteTags
Edit / Paste TagsPreferencesAction
preferences
Edit / PreferencesTaggingPresetSearchAction
presetSearchAction
Search tagging presetsTaggingPresetSearchPrimitiveDialog.Action
presetSearchPrimitiveAction
Search objects by their tagging presetjavax.swing.JMenu
presetsMenu
presetsMenu contains presets actions (search, presets tree)JosmAction
purge
Edit / Purge...RecentlyOpenedFilesMenu
recentlyOpened
File / Open Recent >RedoAction
redo
Edit / RedoReorderImageryLayersAction
reorderImageryLayersAction
Reorder imagery layersReportBugAction
reportbug
Help / Report bugRestartAction
restart
File / RestartReverseWayAction
reverseWay
Tools / Reverse WaysSaveAction
save
File / SaveSaveAsAction
saveAs
File / Save As...SearchAction
search
Edit / Search...SearchNotesDownloadAction
searchNotes
File / Search Notes...SelectAllAction
selectAll
Selection / Select Alljavax.swing.JMenu
selectionMenu
selectionMenu contains all actions related to selecting different objectsSessionSaveAction
sessionSave
File / Session > Save SessionSessionSaveAsAction
sessionSaveAs
File / Session > Save Session As...SelectSharedChildObjectsAction
sharedChildObjects
Selection / Shared Child ObjectsSimplifyWayAction
simplifyWay
Tools / Simplify WaySplitWayAction
splitWay
Tools / Split WayShowStatusReportAction
statusreport
Help / Show Status ReportTiledRenderToggleAction
tiledRenderToggleAction
View / Tiled Renderingjavax.swing.JMenu
toolsMenu
toolsMenu contains different geometry manipulation actions from JOSM core (most used) The plugins should use other menusUndoAction
undo
Edit / Undo...UnGlueAction
unglueNodes
Tools / Unglue WaysUnJoinNodeWayAction
unJoinNodeWay
Tools / Disconnect Node from WayUnselectAllAction
unselectAll
Selection / Unselect AllJosmAction
update
File / Update dataJosmAction
updateModified
File / Update modifiedCreateMultipolygonAction
updateMultipolygon
Tools / Update multipolygonJosmAction
updateSelection
File / Update selectionJosmAction
upload
File / Upload dataJosmAction
uploadSelection
File / Upload selectionjavax.swing.JMenu
viewMenu
viewMenu contains display actions (zoom, map styles, etc.)WindowMenu
windowMenu
the window menu is split into several groups.WireframeToggleAction
wireFrameToggleAction
View / Wireframe View-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description MainMenu()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.JMenuItem
add(javax.swing.JMenu menu, JosmAction action)
Add a JosmAction at the end of a menu.static javax.swing.JMenuItem
add(javax.swing.JMenu menu, JosmAction action, boolean isExpert)
Add a JosmAction at the end of a menu.static javax.swing.JMenuItem
add(javax.swing.JMenu menu, JosmAction action, boolean isExpert, java.lang.Integer index)
Add a JosmAction at the end of a menu.static <E extends java.lang.Enum<E>>
javax.swing.JMenuItemadd(javax.swing.JMenu menu, JosmAction action, java.lang.Enum<E> group)
Add a JosmAction to a menu.static javax.swing.JMenuItem
addAfter(javax.swing.JMenu menu, JosmAction actionToBeInserted, boolean isExpert, JosmAction existingMenuEntryAction)
Add the JosmActionactionToBeInserted
directly belowexistingMenuEntryAction
.javax.swing.JMenu
addMenu(java.lang.String name, java.lang.String translatedName, int mnemonicKey, int position, java.lang.String relativeHelpTopic)
Creates a menu and adds it on the given position to the main menu.<T extends javax.swing.JMenu>
TaddMenu(T menu, java.lang.String name, int mnemonicKey, int position, java.lang.String relativeHelpTopic)
Adds the given menu on the given position to the main menu.static <E extends java.lang.Enum<E>>
javax.swing.JCheckBoxMenuItemaddWithCheckbox(javax.swing.JMenu menu, JosmAction action, int i, boolean isEntryExpert)
Add a JosmAction to a menu and automatically prints accelerator if available.static <E extends java.lang.Enum<E>>
javax.swing.JCheckBoxMenuItemaddWithCheckbox(javax.swing.JMenu menu, JosmAction action, java.lang.Enum<E> group)
Add a JosmAction to a menu and automatically prints accelerator if available.static <E extends java.lang.Enum<E>>
javax.swing.JCheckBoxMenuItemaddWithCheckbox(javax.swing.JMenu menu, JosmAction action, java.lang.Enum<E> group, boolean isEntryExpert, boolean isGroupSeparatorExpert)
Add a JosmAction to a menu and automatically prints accelerator if available.java.util.Optional<javax.swing.JCheckBoxMenuItem>
findMapModeMenuItem(MapMode mode)
Returns theJCheckBoxMenuItem
for the givenMapMode
.java.util.List<javax.swing.JMenuItem>
findMenuItems(java.lang.String textToFind, boolean skipPresets)
Search main menu for items withtextToFind
in title.private static void
findMenuItems(javax.swing.JMenu menu, java.lang.String textToFind, java.util.List<javax.swing.JMenuItem> result)
Recursive walker for menu items.int
getDefaultMenuPos()
Returns the default position of new top-level menus.private static int
getInsertionIndexForGroup(javax.swing.JMenu menu, int group, boolean isGroupSeparatorExpert)
Finds the correct insertion index for a given group and adds separators if necessaryvoid
initialize()
Initialize the main menu.protected void
showAudioMenu(boolean showMenu)
-
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, getUIClassID, isBorderPainted, isSelected, menuSelectionChanged, paintBorder, paramString, processKeyBinding, processKeyEvent, processMouseEvent, removeNotify, setBorderPainted, setHelpMenu, setMargin, setSelected, setSelectionModel, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
openFile
public final OpenFileAction openFile
File / Open...
-
recentlyOpened
public final RecentlyOpenedFilesMenu recentlyOpened
File / Open Recent >
-
openLocation
public final OpenLocationAction openLocation
File / Open Location...
-
deleteLayerAction
public final DeleteLayerAction deleteLayerAction
File / Delete Layer
-
save
public final SaveAction save
File / Save
-
saveAs
public final SaveAsAction saveAs
File / Save As...
-
sessionSave
public final SessionSaveAction sessionSave
File / Session > Save Session
-
sessionSaveAs
public final SessionSaveAsAction sessionSaveAs
File / Session > Save Session As...
-
gpxExport
public final GpxExportAction gpxExport
File / Export to GPX...
-
download
public final DownloadAction download
File / Download from OSM...
-
downloadInView
public final DownloadOsmInViewAction downloadInView
File / Download in current view
-
downloadPrimitive
public final DownloadPrimitiveAction downloadPrimitive
File / Download object...
-
downloadNotesInView
public final DownloadNotesInViewAction downloadNotesInView
File / Download notes in current view
-
searchNotes
public final SearchNotesDownloadAction searchNotes
File / Search Notes...
-
downloadReferrers
public final DownloadReferrersAction downloadReferrers
File / Download parent ways/relations...
-
closeChangesetAction
public final CloseChangesetAction closeChangesetAction
File / Close open changesets...
-
update
public final JosmAction update
File / Update data
-
updateSelection
public final JosmAction updateSelection
File / Update selection
-
updateModified
public final JosmAction updateModified
File / Update modified
-
upload
public final JosmAction upload
File / Upload data
-
uploadSelection
public final JosmAction uploadSelection
File / Upload selection
-
restart
public final RestartAction restart
File / Restart
-
exit
public final ExitAction exit
File / Exit
-
undo
public final UndoAction undo
Edit / Undo...
-
redo
public final RedoAction redo
Edit / Redo
-
copy
public final CopyAction copy
Edit / Copy
-
copyUrl
public final CopyUrlAction copyUrl
Edit / Copy URLs
-
copyCoordinates
public final JosmAction copyCoordinates
Edit / Copy Coordinates
-
paste
public final PasteAction paste
Edit / Paste
-
pasteAtSource
private final PasteAtSourcePositionAction pasteAtSource
Edit / Paste at source
-
pasteTags
public final PasteTagsAction pasteTags
Edit / Paste Tags
-
duplicate
public final DuplicateAction duplicate
Edit / Duplicate
-
delete
public final DeleteAction delete
Edit / Delete
-
purge
public final JosmAction purge
Edit / Purge...
-
merge
public final MergeLayerAction merge
Edit / Merge layer
-
mergeSelected
public final MergeSelectionAction mergeSelected
Edit / Merge selection
-
search
public final SearchAction search
Edit / Search...
-
preferences
public final PreferencesAction preferences
Edit / Preferences
-
wireFrameToggleAction
public final WireframeToggleAction wireFrameToggleAction
View / Wireframe View
-
tiledRenderToggleAction
public final TiledRenderToggleAction tiledRenderToggleAction
View / Tiled Rendering
-
drawBoundariesOfDownloadedDataAction
public final DrawBoundariesOfDownloadedDataAction drawBoundariesOfDownloadedDataAction
View / Hatch area outside download
-
info
public final InfoAction info
View / Advanced info
-
infoweb
public final InfoWebAction infoweb
View / Advanced info (web)
-
historyinfo
public final HistoryInfoAction historyinfo
View / History
-
historyinfoweb
public final HistoryInfoWebAction historyinfoweb
View / History (web)
-
autoScaleActions
public final java.util.Map<AutoScaleAction.AutoScaleMode,AutoScaleAction> autoScaleActions
View / "Zoom to"... actions
-
jumpToAct
public final JumpToAction jumpToAct
View / Jump to position
-
splitWay
public final SplitWayAction splitWay
Tools / Split Way
-
combineWay
public final CombineWayAction combineWay
Tools / Combine Way
-
reverseWay
public final ReverseWayAction reverseWay
Tools / Reverse Ways
-
simplifyWay
public final SimplifyWayAction simplifyWay
Tools / Simplify Way
-
alignInCircle
public final AlignInCircleAction alignInCircle
Tools / Align Nodes in Circle
-
alignInLine
public final AlignInLineAction alignInLine
Tools / Align Nodes in Line
-
distribute
public final DistributeAction distribute
Tools / Distribute Nodes
-
ortho
public final OrthogonalizeAction ortho
Tools / Orthogonalize Shape
-
orthoUndo
public final OrthogonalizeAction.Undo orthoUndo
Orthogonalize undo. Action is not shown in the menu. Only triggered by shortcut
-
mirror
public final MirrorAction mirror
Tools / Mirror
-
followLine
public final FollowLineAction followLine
Tools / Follow line
-
addNode
public final AddNodeAction addNode
Tools / Add Node...
-
moveNode
public final MoveNodeAction moveNode
Tools / Move Node...
-
createCircle
public final CreateCircleAction createCircle
Tools / Create Circle
-
mergeNodes
public final MergeNodesAction mergeNodes
Tools / Merge Nodes
-
joinNodeWay
public final JoinNodeWayAction joinNodeWay
Tools / Join Node to Way
-
moveNodeOntoWay
public final JoinNodeWayAction moveNodeOntoWay
Tools / Join Way to Node
-
unJoinNodeWay
public final UnJoinNodeWayAction unJoinNodeWay
Tools / Disconnect Node from Way
-
unglueNodes
public final UnGlueAction unglueNodes
Tools / Unglue Ways
-
joinAreas
public final JoinAreasAction joinAreas
Tools / Join overlapping Areas
-
createMultipolygon
public final CreateMultipolygonAction createMultipolygon
Tools / Create multipolygon
-
updateMultipolygon
public final CreateMultipolygonAction updateMultipolygon
Tools / Update multipolygon
-
downloadAlongWay
public final DownloadAlongWayAction downloadAlongWay
Tools / Download along way
-
selectAll
public final SelectAllAction selectAll
Selection / Select All
-
unselectAll
public final UnselectAllAction unselectAll
Selection / Unselect All
-
invertSelection
public final InvertSelectionAction invertSelection
Selection / Invert Selection
-
nonBranchingWaySequences
public final SelectNonBranchingWaySequencesAction nonBranchingWaySequences
Selection / Non-branching way sequences
-
sharedChildObjects
public final SelectSharedChildObjectsAction sharedChildObjects
Selection / Shared Child Objects
-
audioPlayPause
public final JosmAction audioPlayPause
Audio / Play/Pause
-
audioNext
public final JosmAction audioNext
Audio / Next marker
-
audioPrev
public final JosmAction audioPrev
Audio / Previous Marker
-
audioFwd
public final JosmAction audioFwd
Audio / Forward
-
audioBack
public final JosmAction audioBack
Audio / Back
-
audioFaster
public final JosmAction audioFaster
Audio / Faster
-
audioSlower
public final JosmAction audioSlower
Audio / Slower
-
changesetManager
public final ChangesetManagerToggleAction changesetManager
Windows / Changeset Manager
-
help
public final HelpAction help
Help / Help
-
about
public final AboutAction about
Help / About
-
statusreport
public final ShowStatusReportAction statusreport
Help / Show Status Report
-
reportbug
public final ReportBugAction reportbug
Help / Report bug
-
fileMenu
public final javax.swing.JMenu fileMenu
fileMenu contains I/O actions
-
editMenu
public final javax.swing.JMenu editMenu
editMenu contains editing actions
-
viewMenu
public final javax.swing.JMenu viewMenu
viewMenu contains display actions (zoom, map styles, etc.)
-
modeMenu
public final javax.swing.JMenu modeMenu
modeMenu contains map modes
-
toolsMenu
public final javax.swing.JMenu toolsMenu
toolsMenu contains different geometry manipulation actions from JOSM core (most used) The plugins should use other menus
-
moreToolsMenu
public final javax.swing.JMenu moreToolsMenu
moreToolsMenu contains geometry-related actions from all the plugins- Since:
- 6082 (moved from Utilsplugin2)
-
dataMenu
public final javax.swing.JMenu dataMenu
dataMenu contains plugin actions that are related to certain tagging schemes (addressing opening hours), importing external data and using external web APIs- Since:
- 6082
-
selectionMenu
public final javax.swing.JMenu selectionMenu
selectionMenu contains all actions related to selecting different objects- Since:
- 6082 (moved from Utilsplugin2)
-
presetsMenu
public final javax.swing.JMenu presetsMenu
presetsMenu contains presets actions (search, presets tree)
-
imagerySubMenu
public final javax.swing.JMenu imagerySubMenu
submenu in Imagery menu that contains plugin-managed additional imagery layers- Since:
- 6097
-
imageryMenu
public final ImageryMenu imageryMenu
imageryMenu contains all imagery-related actions
-
gpsMenu
public final javax.swing.JMenu gpsMenu
gpsMenu contains all plugin actions that are related to using GPS data, including opening, uploading and real-time tracking- Since:
- 6082
-
windowMenu
public final WindowMenu windowMenu
the window menu is split into several groups. The first is for windows that can be opened from this menu any time, e.g. the changeset editor. The second group is for toggle dialogs and the third group is for currently open windows that cannot be toggled, e.g. relation editors. It's recommended to use WINDOW_MENU_GROUP to determine the group integer.
-
audioMenu
public javax.swing.JMenu audioMenu
audioMenu contains all audio-related actions. Be careful, this menu is not guaranteed to be displayed at all
-
helpMenu
public final javax.swing.JMenu helpMenu
helpMenu contains JOSM general actions (Help, About, etc.)
-
defaultMenuPos
private static final int defaultMenuPos
- See Also:
- Constant Field Values
-
moveUpAction
public final JosmAction moveUpAction
Move the selection up
-
moveDownAction
public final JosmAction moveDownAction
Move the selection down
-
moveLeftAction
public final JosmAction moveLeftAction
Move the selection left
-
moveRightAction
public final JosmAction moveRightAction
Move the selection right
-
reorderImageryLayersAction
public final ReorderImageryLayersAction reorderImageryLayersAction
Reorder imagery layers
-
presetSearchAction
public final TaggingPresetSearchAction presetSearchAction
Search tagging presets
-
presetSearchPrimitiveAction
public final TaggingPresetSearchPrimitiveDialog.Action presetSearchPrimitiveAction
Search objects by their tagging preset
-
dialogsToggleAction
public final DialogsToggleAction dialogsToggleAction
Toggle visibility of dialogs panel
-
fullscreenToggleAction
public FullscreenToggleAction fullscreenToggleAction
Toggle the full-screen mode
-
menuSeparatorHandler
public static final javax.swing.event.MenuListener menuSeparatorHandler
this menu listener hides unnecessary JSeparators in a menu list but does not remove them. If at a later time the separators are required, they will be made visible again. Intended usage is make menus not look broken if separators are used to group the menu and some of these groups are empty.
-
-
Constructor Detail
-
MainMenu
public MainMenu()
-
-
Method Detail
-
getDefaultMenuPos
public int getDefaultMenuPos()
Returns the default position of new top-level menus.- Returns:
- the default position of new top-level menus
- Since:
- 6088
-
add
public static javax.swing.JMenuItem add(javax.swing.JMenu menu, JosmAction action)
Add a JosmAction at the end of a menu.This method handles all the shortcut handling. It also makes sure that actions that are handled by the OS are not duplicated on the menu.
- Parameters:
menu
- the menu to add the action toaction
- the action that should get a menu item- Returns:
- the created menu item
-
add
public static javax.swing.JMenuItem add(javax.swing.JMenu menu, JosmAction action, boolean isExpert)
Add a JosmAction at the end of a menu.This method handles all the shortcut handling. It also makes sure that actions that are handled by the OS are not duplicated on the menu.
- Parameters:
menu
- the menu to add the action toaction
- the action that should get a menu itemisExpert
- whether the entry should only be visible if the expert mode is activated- Returns:
- the created menu item
-
add
public static javax.swing.JMenuItem add(javax.swing.JMenu menu, JosmAction action, boolean isExpert, java.lang.Integer index)
Add a JosmAction at the end of a menu.This method handles all the shortcut handling. It also makes sure that actions that are handled by the OS are not duplicated on the menu.
- Parameters:
menu
- the menu to add the action toaction
- the action that should get a menu itemisExpert
- whether the entry should only be visible if the expert mode is activatedindex
- an integer specifying the position at which to add the action- Returns:
- the created menu item
-
addAfter
public static javax.swing.JMenuItem addAfter(javax.swing.JMenu menu, JosmAction actionToBeInserted, boolean isExpert, JosmAction existingMenuEntryAction)
Add the JosmActionactionToBeInserted
directly belowexistingMenuEntryAction
.This method handles all the shortcut handling. It also makes sure that actions that are handled by the OS are not duplicated on the menu.
- Parameters:
menu
- the menu to add the action toactionToBeInserted
- the action that should get a menu item directly belowexistingMenuEntryAction
isExpert
- whether the entry should only be visible if the expert mode is activatedexistingMenuEntryAction
- an action already added to the menumenu
, the actionactionToBeInserted
is added directly below- Returns:
- the created menu item
-
add
public static <E extends java.lang.Enum<E>> javax.swing.JMenuItem add(javax.swing.JMenu menu, JosmAction action, java.lang.Enum<E> group)
Add a JosmAction to a menu.This method handles all the shortcut handling. It also makes sure that actions that are handled by the OS are not duplicated on the menu.
- Type Parameters:
E
- group item enum type- Parameters:
menu
- to add the action toaction
- the action that should get a menu itemgroup
- the item should be added to. Groups are split by a separator. null will add the item to the end.- Returns:
- The created menu item
-
addWithCheckbox
public static <E extends java.lang.Enum<E>> javax.swing.JCheckBoxMenuItem addWithCheckbox(javax.swing.JMenu menu, JosmAction action, java.lang.Enum<E> group)
Add a JosmAction to a menu and automatically prints accelerator if available. Also adds a checkbox that may be toggled.- Type Parameters:
E
- group enum item type- Parameters:
menu
- to add the action toaction
- the action that should get a menu itemgroup
- the item should be added to. Groups are split by a separator. Use one of the enums that are defined for some of the menus to tell in which group the item should go.- Returns:
- The created menu item
-
addWithCheckbox
public static <E extends java.lang.Enum<E>> javax.swing.JCheckBoxMenuItem addWithCheckbox(javax.swing.JMenu menu, JosmAction action, java.lang.Enum<E> group, boolean isEntryExpert, boolean isGroupSeparatorExpert)
Add a JosmAction to a menu and automatically prints accelerator if available. Also adds a checkbox that may be toggled.- Type Parameters:
E
- group enum item type- Parameters:
menu
- to add the action toaction
- the action that should get a menu itemgroup
- the item should be added to. Groups are split by a separator. Use one of the enums that are defined for some of the menus to tell in which group the item should go. null will add the item to the end.isEntryExpert
- whether the entry should only be visible if the expert mode is activatedisGroupSeparatorExpert
- whether the group separator should only be visible if the expert mode is activated- Returns:
- The created menu item
- Since:
- 15633
-
addWithCheckbox
public static <E extends java.lang.Enum<E>> javax.swing.JCheckBoxMenuItem addWithCheckbox(javax.swing.JMenu menu, JosmAction action, int i, boolean isEntryExpert)
Add a JosmAction to a menu and automatically prints accelerator if available. Also adds a checkbox that may be toggled.- Type Parameters:
E
- group enum item type- Parameters:
menu
- to add the action toaction
- the action that should get a menu itemi
- the item position in the menu. -1 will add the item to the end.isEntryExpert
- whether the entry should only be visible if the expert mode is activated- Returns:
- The created menu item
- Since:
- 15655
-
getInsertionIndexForGroup
private static int getInsertionIndexForGroup(javax.swing.JMenu menu, int group, boolean isGroupSeparatorExpert)
Finds the correct insertion index for a given group and adds separators if necessary- Parameters:
menu
- menugroup
- group numberisGroupSeparatorExpert
- whether the added separators should only be visible if the expert mode is activated- Returns:
- correct insertion index
-
addMenu
public javax.swing.JMenu addMenu(java.lang.String name, java.lang.String translatedName, int mnemonicKey, int position, java.lang.String relativeHelpTopic)
Creates a menu and adds it on the given position to the main menu.- Parameters:
name
- the untranslated name (used as identifier for shortcut registration)translatedName
- the translated menu name (useI18n.trc("menu", name)
to allow better internationalizationmnemonicKey
- the mnemonic key to registerposition
- the position in the main menurelativeHelpTopic
- the relative help topic- Returns:
- the newly created menu
-
addMenu
public <T extends javax.swing.JMenu> T addMenu(T menu, java.lang.String name, int mnemonicKey, int position, java.lang.String relativeHelpTopic)
Adds the given menu on the given position to the main menu.- Type Parameters:
T
- menu type- Parameters:
menu
- the menu to addname
- the untranslated name (used as identifier for shortcut registration)mnemonicKey
- the mnemonic key to registerposition
- the position in the main menurelativeHelpTopic
- the relative help topic- Returns:
- the given menu}
-
initialize
public void initialize()
Initialize the main menu.- Since:
- 10340
-
findMenuItems
public java.util.List<javax.swing.JMenuItem> findMenuItems(java.lang.String textToFind, boolean skipPresets)
Search main menu for items withtextToFind
in title.- Parameters:
textToFind
- The text to findskipPresets
- whether to skip thepresetsMenu
in the search- Returns:
- not null list of found menu items.
-
findMapModeMenuItem
public java.util.Optional<javax.swing.JCheckBoxMenuItem> findMapModeMenuItem(MapMode mode)
Returns theJCheckBoxMenuItem
for the givenMapMode
.- Parameters:
mode
- map mode- Returns:
- the
JCheckBoxMenuItem
for the givenMapMode
- Since:
- 15438
-
findMenuItems
private static void findMenuItems(javax.swing.JMenu menu, java.lang.String textToFind, java.util.List<javax.swing.JMenuItem> result)
Recursive walker for menu items. Only menu items with action are selected. If menu item containstextToFind
it's appended to result.- Parameters:
menu
- menu in which search will be performedtextToFind
- The text to findresult
- resulting list of menu items
-
showAudioMenu
protected void showAudioMenu(boolean showMenu)
-
-