public class ExpertToggleAction extends ToggleAction
Modifier and Type | Class and Description |
---|---|
static interface |
ExpertToggleAction.ExpertModeChangeListener
This listener is notified whenever the expert mode setting changed.
|
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
Modifier and Type | Field and Description |
---|---|
private static ExpertToggleAction |
INSTANCE |
private static ListenerList<ExpertToggleAction.ExpertModeChangeListener> |
listeners |
private static BooleanProperty |
PREF_EXPERT |
private static ListenerList<java.awt.Component> |
visibilityToggleListeners |
sc
Constructor and Description |
---|
ExpertToggleAction()
Constructs a new
ExpertToggleAction . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
static void |
addExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener)
Register a expert mode change listener.
|
static void |
addExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener,
boolean fireWhenAdding)
Register a expert mode change listener, and optionnally fires it.
|
static void |
addVisibilitySwitcher(java.awt.Component c)
Marks a component to be only visible when expert mode is enabled.
|
private static void |
fireExpertModeChanged(boolean isExpert) |
static ExpertToggleAction |
getInstance()
Replies the unique instance of this action.
|
static boolean |
isExpert()
Determines if expert mode is enabled.
|
protected void |
notifySelectedState() |
static void |
removeExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener)
Removes a expert mode change listener
|
static void |
removeVisibilitySwitcher(java.awt.Component c)
Stops tracking visibility changes for the given component.
|
void |
setExpert(boolean isExpert)
Forces the expert mode state to the given state.
|
addButtonModel, isSelected, removeButtonModel, setSelected, toggleSelectedState
checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
private static final ListenerList<ExpertToggleAction.ExpertModeChangeListener> listeners
private static final ListenerList<java.awt.Component> visibilityToggleListeners
private static final BooleanProperty PREF_EXPERT
private static final ExpertToggleAction INSTANCE
public ExpertToggleAction()
ExpertToggleAction
.private static void fireExpertModeChanged(boolean isExpert)
public static void addExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener)
listener
- the listener. Ignored if null.public static void addExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener, boolean fireWhenAdding)
listener
- the listener. Ignored if null.fireWhenAdding
- if true, the listener will be fired immediately after addedpublic static void removeExpertModeChangeListener(ExpertToggleAction.ExpertModeChangeListener listener)
listener
- the listener. Ignored if null.public static void addVisibilitySwitcher(java.awt.Component c)
c
- The component.public static void removeVisibilitySwitcher(java.awt.Component c)
c
- The component.addVisibilitySwitcher(Component)
protected final void notifySelectedState()
notifySelectedState
in class ToggleAction
public void setExpert(boolean isExpert)
isExpert
- if expert mode should be used.public void actionPerformed(java.awt.event.ActionEvent e)
public static ExpertToggleAction getInstance()
public static boolean isExpert()
true
if expert mode is enabled, false
otherwise.