Class JaxoMenuUtils
java.lang.Object
net.sf.jaxodraw.gui.menu.JaxoMenuUtils
Menu-related utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks whether the given JMenuItem is selected.static JMenuItem=newCheckmarMenuItem(null).static JMenuItemnewCheckmarkMenuItem(String text) Depending on configuration, a JCheckBoxMenuItem or a JMenuItem with custom Icon.static voidsetAccelerator(JMenuItem m, char keyChar) Sets the Keyboard Accelerator of a JMenuItem to the specified character.static voidsetAccelerator(JMenuItem m, int keyCode, int modifiers) Sets the Keyboard Accelerator of a JMenuItem to a KeyStroke given by a numeric key code and a set of modifiers.static voidsetActionCommand(JMenuItem m, int mode) Sets the ActionCommand of a JMenuItem to the given mode.static voidsetChecked(JMenuItem m, boolean value) Sets the given JMenuItem as selected.static voidsetLanguageKey(JMenuItem m, String key) Set the i18n key of a JMenuItem.static voidUpdate the text of a JMenuItem.
-
Method Details
-
newCheckmarkMenuItem
=newCheckmarMenuItem(null).- Returns:
- A new JMenuItem.
-
newCheckmarkMenuItem
-
isChecked
Checks whether the given JMenuItem is selected.- Parameters:
m- The JMenuItem to check.- Returns:
- True if the JMenuItem is selected.
- See Also:
-
setChecked
Sets the given JMenuItem as selected.- Parameters:
m- The JMenuItem to check.value- True to set the JMenuItem as selected.- See Also:
-
updateLanguage
Update the text of a JMenuItem.- Parameters:
m- The JMenuItem.
-
setLanguageKey
-
setAccelerator
Sets the Keyboard Accelerator of a JMenuItem to the specified character.- Parameters:
m- The JMenuItem.keyChar- the character value for a keyboard key- See Also:
-
setAccelerator
Sets the Keyboard Accelerator of a JMenuItem to a KeyStroke given by a numeric key code and a set of modifiers.- Parameters:
m- The JMenuItem.keyCode- an int specifying the numeric code for a keyboard key.modifiers- a bitwise-ored combination of any modifiers.- See Also:
-
setActionCommand
Sets the ActionCommand of a JMenuItem to the given mode.- Parameters:
m- The JMenuItem.mode- A mode as defined in JaxoConstants.- See Also:
-