Class MainMenu
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,MenuElement
It also provides possibilities to attach new menu entries (used by plugins).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classstatic enumThe possible item groups of the Windows menu.Nested classes/interfaces inherited from class javax.swing.JMenuBar
JMenuBar.AccessibleJMenuBarNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AboutActionHelp / Aboutfinal AddNodeActionTools / Add Node...final AlignGridRotationActionView / Grid / Align rotation to selectionfinal AlignInCircleActionTools / Align Nodes in Circlefinal AlignInLineActionTools / Align Nodes in Linefinal JosmActionAudio / Backfinal JosmActionAudio / Fasterfinal JosmActionAudio / ForwardaudioMenu contains all audio-related actions.final JosmActionAudio / Next markerfinal JosmActionAudio / Play/Pausefinal JosmActionAudio / Previous Markerfinal JosmActionAudio / SlowerView / "Zoom to"...Windows / Changeset Managerfinal CloseChangesetActionFile / Close open changesets...final CombineWayActionTools / Combine Wayfinal CopyActionEdit / Copyfinal JosmActionEdit / Copy Coordinatesfinal CopyUrlActionEdit / Copy URLsfinal CreateCircleActionTools / Create Circlefinal CreateMultipolygonActionTools / Create multipolygonfinal JMenudataMenu contains plugin actions that are related to certain tagging schemes (addressing opening hours), importing external data and using external web APIsprivate static final intfinal DeleteActionEdit / Deletefinal DeleteLayerActionFile / Delete Layerfinal DialogsToggleActionToggle visibility of dialogs panelfinal DistributeActionTools / Distribute Nodesfinal DownloadActionFile / Download from OSM...final DownloadAlongWayActionTools / Download along wayfinal DownloadOsmInViewActionFile / Download in current viewFile / Download notes in current viewfinal DownloadPrimitiveActionFile / Download object...final DownloadReferrersActionFile / Download parent ways/relations...View / Hatch area outside downloadfinal DuplicateActionEdit / Duplicatefinal JMenueditMenu contains editing actionsfinal ExitActionFile / Exitfinal JMenufileMenu contains I/O actionsfinal FollowLineActionTools / Follow lineToggle the full-screen modefinal JMenugpsMenu contains all plugin actions that are related to using GPS data, including opening, uploading and real-time trackingfinal GpxExportActionFile / Export to GPX...final JMenuView / Grid submenu: the grid drawn over the map and its placementfinal HelpActionHelp / Helpfinal JMenuhelpMenu contains JOSM general actions (Help, About, etc.)final HistoryInfoActionView / Historyfinal HistoryInfoWebActionView / History (web)final ImageryMenuimageryMenu contains all imagery-related actionsfinal JMenusubmenu in Imagery menu that contains plugin-managed additional imagery layersfinal InfoActionView / Advanced infofinal InfoWebActionView / Advanced info (web)final InvertSelectionActionSelection / Invert Selectionfinal JoinAreasActionTools / Join overlapping Areasfinal JoinNodeWayActionTools / Join Node to Wayfinal JumpToActionView / Jump to positionstatic final MenuListenerthis menu listener hides unnecessary JSeparators in a menu list but does not remove them.final MergeLayerActionEdit / Merge layerfinal MergeNodesActionTools / Merge Nodesfinal MergeSelectionActionEdit / Merge selectionfinal MirrorActionTools / Mirrorfinal JMenumodeMenu contains map modesfinal JMenumoreToolsMenu contains geometry-related actions from all the pluginsfinal JosmActionMove the selection downfinal JosmActionMove the selection leftfinal MoveNodeActionTools / Move Node...final JoinNodeWayActionTools / Join Way to Nodefinal JosmActionMove the selection rightfinal JosmActionMove the selection upfinal NewActionFile / New Layerfinal NewLocalActionFile / New Local LayerSelection / Non-branching way sequencesfinal OpenFileActionFile / Open...final OpenLocationActionFile / Open Location...final OrthogonalizeActionTools / Orthogonalize Shapefinal OrthogonalizeAction.UndoOrthogonalize undo.final PasteActionEdit / Pasteprivate final PasteAtSourcePositionActionEdit / Paste at sourcefinal PasteTagsActionEdit / Paste Tagsfinal PreferencesActionEdit / PreferencesSearch tagging presetsSearch objects by their tagging presetfinal JMenupresetsMenu contains presets actions (search, presets tree)final JosmActionEdit / Purge...final RecentlyOpenedFilesMenuFile / Open Recent >final RedoActionEdit / RedoReorder imagery layersfinal ReportBugActionHelp / Report bugfinal RestartActionFile / Restartfinal ReverseWayActionTools / Reverse Waysfinal SaveActionFile / Savefinal SaveAsActionFile / Save As...final SearchActionEdit / Search...File / Search Notes...final SelectAllActionSelection / Select Allfinal JMenuselectionMenu contains all actions related to selecting different objectsfinal SessionSaveActionFile / Session > Save Sessionfinal SessionSaveAsActionFile / Session > Save Session As...final SetGridOriginActionView / Grid / Set origin to selectionSelection / Shared Child Objectsfinal ShowGridActionView / Grid / Showfinal SimplifyWayActionTools / Simplify Wayfinal SplitWayActionTools / Split Wayfinal ShowStatusReportActionHelp / Show Status Reportfinal TiledRenderToggleActionView / Tiled Renderingfinal JMenutoolsMenu contains different geometry manipulation actions from JOSM core (most used) The plugins should use other menusfinal UndoActionEdit / Undo...final UnGlueActionTools / Unglue Waysfinal UnJoinNodeWayActionTools / Disconnect Node from Wayfinal UnselectAllActionSelection / Unselect Allfinal JosmActionFile / Update datafinal JosmActionFile / Update modifiedfinal CreateMultipolygonActionTools / Update multipolygonfinal JosmActionFile / Update selectionfinal JosmActionFile / Upload datafinal JosmActionFile / Upload selectionfinal JMenuviewMenu contains display actions (zoom, map styles, etc.)final WindowMenuthe window menu is split into several groups.final WireframeToggleActionView / Wireframe ViewFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JMenuItemadd(JMenu menu, JosmAction action) Add a JosmAction at the end of a menu.static JMenuItemadd(JMenu menu, JosmAction action, boolean isExpert) Add a JosmAction at the end of a menu.static JMenuItemadd(JMenu menu, JosmAction action, boolean isExpert, Integer index) Add a JosmAction at the end of a menu.add(JMenu menu, JosmAction action, Enum<E> group) Add a JosmAction to a menu.static JMenuItemaddAfter(JMenu menu, JosmAction actionToBeInserted, boolean isExpert, JosmAction existingMenuEntryAction) Add the JosmActionactionToBeInserteddirectly belowexistingMenuEntryAction.addMenu(String name, String translatedName, int mnemonicKey, int position, String relativeHelpTopic) Creates a menu and adds it on the given position to the main menu.<T extends JMenu>
TAdds the given menu on the given position to the main menu.static <E extends Enum<E>>
JCheckBoxMenuItemaddWithCheckbox(JMenu menu, JosmAction action, int i, boolean isEntryExpert) Add a JosmAction to a menu and automatically prints accelerator if available.static <E extends Enum<E>>
JCheckBoxMenuItemaddWithCheckbox(JMenu menu, JosmAction action, Enum<E> group) Add a JosmAction to a menu and automatically prints accelerator if available.static <E extends Enum<E>>
JCheckBoxMenuItemaddWithCheckbox(JMenu menu, JosmAction action, Enum<E> group, boolean isEntryExpert, boolean isGroupSeparatorExpert) Add a JosmAction to a menu and automatically prints accelerator if available.findMapModeMenuItem(MapMode mode) Returns theJCheckBoxMenuItemfor the givenMapMode.findMenuItems(String textToFind, boolean skipPresets) Search main menu for items withtextToFindin title.private static voidfindMenuItems(JMenu menu, String textToFind, List<JMenuItem> result) Recursive walker for menu items.intReturns the default position of new top-level menus.private static intgetInsertionIndexForGroup(JMenu menu, int group, boolean isGroupSeparatorExpert) Finds the correct insertion index for a given group and adds separators if necessaryvoidInitialize the main menu.protected voidshowAudioMenu(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, updateUIMethods 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, updateMethods 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, validateTreeMethods 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 Details
-
newAction
File / New Layer -
newLocalAction
File / New Local Layer -
openFile
File / Open... -
recentlyOpened
File / Open Recent > -
openLocation
File / Open Location... -
deleteLayerAction
File / Delete Layer -
save
File / Save -
saveAs
File / Save As... -
sessionSave
File / Session > Save Session -
sessionSaveAs
File / Session > Save Session As... -
gpxExport
File / Export to GPX... -
download
File / Download from OSM... -
downloadInView
File / Download in current view -
downloadPrimitive
File / Download object... -
downloadNotesInView
File / Download notes in current view -
searchNotes
File / Search Notes... -
downloadReferrers
File / Download parent ways/relations... -
closeChangesetAction
File / Close open changesets... -
update
File / Update data -
updateSelection
File / Update selection -
updateModified
File / Update modified -
upload
File / Upload data -
uploadSelection
File / Upload selection -
restart
File / Restart -
exit
File / Exit -
undo
Edit / Undo... -
redo
Edit / Redo -
copy
Edit / Copy -
copyUrl
Edit / Copy URLs -
copyCoordinates
Edit / Copy Coordinates -
paste
Edit / Paste -
pasteAtSource
Edit / Paste at source -
pasteTags
Edit / Paste Tags -
duplicate
Edit / Duplicate -
delete
Edit / Delete -
purge
Edit / Purge... -
merge
Edit / Merge layer -
mergeSelected
Edit / Merge selection -
search
Edit / Search... -
preferences
Edit / Preferences -
wireFrameToggleAction
View / Wireframe View -
tiledRenderToggleAction
View / Tiled Rendering -
drawBoundariesOfDownloadedDataAction
View / Hatch area outside download -
gridMenu
View / Grid submenu: the grid drawn over the map and its placement -
showGridAction
View / Grid / Show -
setGridOriginAction
View / Grid / Set origin to selection -
alignGridRotationAction
View / Grid / Align rotation to selection -
info
View / Advanced info -
infoweb
View / Advanced info (web) -
historyinfo
View / History -
historyinfoweb
View / History (web) -
autoScaleActions
View / "Zoom to"... actions -
jumpToAct
View / Jump to position -
splitWay
Tools / Split Way -
combineWay
Tools / Combine Way -
reverseWay
Tools / Reverse Ways -
simplifyWay
Tools / Simplify Way -
alignInCircle
Tools / Align Nodes in Circle -
alignInLine
Tools / Align Nodes in Line -
distribute
Tools / Distribute Nodes -
ortho
Tools / Orthogonalize Shape -
orthoUndo
Orthogonalize undo. Action is not shown in the menu. Only triggered by shortcut -
mirror
Tools / Mirror -
followLine
Tools / Follow line -
addNode
Tools / Add Node... -
moveNode
Tools / Move Node... -
createCircle
Tools / Create Circle -
mergeNodes
Tools / Merge Nodes -
joinNodeWay
Tools / Join Node to Way -
moveNodeOntoWay
Tools / Join Way to Node -
unJoinNodeWay
Tools / Disconnect Node from Way -
unglueNodes
Tools / Unglue Ways -
joinAreas
Tools / Join overlapping Areas -
createMultipolygon
Tools / Create multipolygon -
updateMultipolygon
Tools / Update multipolygon -
downloadAlongWay
Tools / Download along way -
selectAll
Selection / Select All -
unselectAll
Selection / Unselect All -
invertSelection
Selection / Invert Selection -
nonBranchingWaySequences
Selection / Non-branching way sequences -
audioPlayPause
Audio / Play/Pause -
audioNext
Audio / Next marker -
audioPrev
Audio / Previous Marker -
audioFwd
Audio / Forward -
audioBack
Audio / Back -
audioFaster
Audio / Faster -
audioSlower
Audio / Slower -
changesetManager
Windows / Changeset Manager -
help
Help / Help -
about
Help / About -
statusreport
Help / Show Status Report -
reportbug
Help / Report bug -
fileMenu
fileMenu contains I/O actions -
editMenu
editMenu contains editing actions -
viewMenu
viewMenu contains display actions (zoom, map styles, etc.) -
modeMenu
modeMenu contains map modes -
toolsMenu
toolsMenu contains different geometry manipulation actions from JOSM core (most used) The plugins should use other menus -
moreToolsMenu
moreToolsMenu contains geometry-related actions from all the plugins- Since:
- 6082 (moved from Utilsplugin2)
-
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
selectionMenu contains all actions related to selecting different objects- Since:
- 6082 (moved from Utilsplugin2)
-
presetsMenu
presetsMenu contains presets actions (search, presets tree) -
imagerySubMenu
submenu in Imagery menu that contains plugin-managed additional imagery layers- Since:
- 6097
-
imageryMenu
imageryMenu contains all imagery-related actions -
gpsMenu
gpsMenu contains all plugin actions that are related to using GPS data, including opening, uploading and real-time tracking- Since:
- 6082
-
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
audioMenu contains all audio-related actions. Be careful, this menu is not guaranteed to be displayed at all -
helpMenu
helpMenu contains JOSM general actions (Help, About, etc.) -
defaultMenuPos
- See Also:
-
moveUpAction
Move the selection up -
moveDownAction
Move the selection down -
moveLeftAction
Move the selection left -
moveRightAction
Move the selection right -
reorderImageryLayersAction
Reorder imagery layers -
presetSearchAction
Search tagging presets -
presetSearchPrimitiveAction
Search objects by their tagging preset -
dialogsToggleAction
Toggle visibility of dialogs panel -
fullscreenToggleAction
Toggle the full-screen mode
-
-
Constructor Details
-
MainMenu
public MainMenu()
-
-
Method Details
-
getDefaultMenuPos
Returns the default position of new top-level menus.- Returns:
- the default position of new top-level menus
- Since:
- 6088
-
add
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
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
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 JMenuItem addAfter(JMenu menu, JosmAction actionToBeInserted, boolean isExpert, JosmAction existingMenuEntryAction) Add the JosmActionactionToBeInserteddirectly 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 belowexistingMenuEntryActionisExpert- whether the entry should only be visible if the expert mode is activatedexistingMenuEntryAction- an action already added to the menumenu, the actionactionToBeInsertedis added directly below- Returns:
- the created menu item
-
add
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 Enum<E>> JCheckBoxMenuItem addWithCheckbox(JMenu menu, JosmAction action, 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 Enum<E>> JCheckBoxMenuItem addWithCheckbox(JMenu menu, JosmAction action, 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 Enum<E>> JCheckBoxMenuItem addWithCheckbox(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
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 JMenu addMenu(String name, String translatedName, int mnemonicKey, int position, 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 JMenu> T addMenu(T menu, String name, int mnemonicKey, int position, 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
Initialize the main menu.- Since:
- 10340
-
findMenuItems
Search main menu for items withtextToFindin title.- Parameters:
textToFind- The text to findskipPresets- whether to skip thepresetsMenuin the search- Returns:
- not null list of found menu items.
-
findMapModeMenuItem
Returns theJCheckBoxMenuItemfor the givenMapMode.- Parameters:
mode- map mode- Returns:
- the
JCheckBoxMenuItemfor the givenMapMode - Since:
- 15438
-
findMenuItems
Recursive walker for menu items. Only menu items with action are selected. If menu item containstextToFindit's appended to result.- Parameters:
menu- menu in which search will be performedtextToFind- The text to findresult- resulting list of menu items
-
showAudioMenu
-