Class MapPaintMenu.MapPaintAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.gui.mappaint.MapPaintMenu.MapPaintAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,Destroyable
- Enclosing class:
- MapPaintMenu
private static class MapPaintMenu.MapPaintAction extends JosmAction
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JCheckBoxMenuItembuttonprivate StyleSourcestyle-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description MapPaintAction(StyleSource style)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ae)javax.swing.JCheckBoxMenuItemgetButton()protected booleanlistenToSelectionChange()Overwrite this ifJosmAction.updateEnabledState()should be called when the selection changed.private static booleanmapHasGpxOrMarkerLayer()voidsetStyle(StyleSource style)private voidtoggleStyle()private voidupdateButton()voidupdateEnabledState()Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
style
private transient StyleSource style
-
button
private final javax.swing.JCheckBoxMenuItem button
-
-
Constructor Detail
-
MapPaintAction
MapPaintAction(StyleSource style)
-
-
Method Detail
-
updateButton
private void updateButton()
-
toggleStyle
private void toggleStyle()
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
-
getButton
public javax.swing.JCheckBoxMenuItem getButton()
-
setStyle
public void setStyle(StyleSource style)
-
listenToSelectionChange
protected boolean listenToSelectionChange()
Description copied from class:JosmActionOverwrite this ifJosmAction.updateEnabledState()should be called when the selection changed. Default is true.- Overrides:
listenToSelectionChangein classJosmAction- Returns:
trueif aDataSelectionListenershould be registered.
-
updateEnabledState
public void updateEnabledState()
Description copied from class:JosmActionOverride in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e. when a layer is removed or added. SeeJosmAction.updateEnabledState(Collection)to respond to changes in the collection of selected primitives. Default behavior is empty.- Overrides:
updateEnabledStatein classJosmAction- See Also:
JosmAction.updateEnabledState(Collection),JosmAction.initEnabledState(),JosmAction.listenToLayerChange()
-
mapHasGpxOrMarkerLayer
private static boolean mapHasGpxOrMarkerLayer()
-
-