de.jreality.ui.viewerapp.actions.edit
Class ToggleAppearance
java.lang.Object
javax.swing.AbstractAction
de.jreality.ui.viewerapp.actions.AbstractJrAction
de.jreality.ui.viewerapp.actions.AbstractSelectionListenerAction
de.jreality.ui.viewerapp.actions.edit.ToggleAppearance
- All Implemented Interfaces:
- SelectionListener, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public class ToggleAppearance
- extends AbstractSelectionListenerAction
Toggles appearance atributes of a selected SceneGraphComponent or Appearance
(if something different is selected, this action is disabled).
Note that this action does not create new Appearances in the scene tree.
- Author:
- msommer
- See Also:
- Serialized Form
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
Toggles the specified appearance attribute of the responsible appearance
- the first one existing along the path from the selected component to the scene root. |
boolean |
isEnabled(SelectionEvent e)
Override this method to specify when to disable or enable the action
based on the current selection. |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ToggleAppearance
public ToggleAppearance(java.lang.String name,
java.lang.String attribute,
SelectionManager sm)
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Toggles the specified appearance attribute of the responsible appearance
- the first one existing along the path from the selected component to the scene root.
If there is no appearance along the path, nothing is toggled.
In particular, no new Appearances are created in the scene tree.
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
- Specified by:
actionPerformed
in class AbstractJrAction
isEnabled
public boolean isEnabled(SelectionEvent e)
- Description copied from class:
AbstractSelectionListenerAction
- Override this method to specify when to disable or enable the action
based on the current selection.
This method is called in AbstractSelectionListenerAction.selectionChanged(SelectionEvent)
.
- Overrides:
isEnabled
in class AbstractSelectionListenerAction
- Parameters:
e
- the selection event
- Returns:
- true iff the action is enabled based on the current selection
- See Also:
AbstractSelectionListenerAction.selectionChanged(SelectionEvent)