|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
de.jreality.ui.viewerapp.actions.AbstractJrAction
de.jreality.ui.viewerapp.actions.AbstractSelectionListenerAction
public abstract class AbstractSelectionListenerAction
Abstract class for actions used in jReality applications which do something if the selection given by the underlying selection manager changes (e.g. which act on specific scene tree or scene graph nodes and need to disable or enable themselves based on the current selection).
Field Summary |
---|
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 |
Constructor Summary | |
---|---|
AbstractSelectionListenerAction(String name,
SelectionManagerInterface sm)
Default constructor. |
|
AbstractSelectionListenerAction(String name,
SelectionManagerInterface sm,
Component parentComp)
Constructor for actions which need a parent component e.g. |
Method Summary | |
---|---|
Selection |
getSelection()
Get the current selection. |
SelectionManagerInterface |
getSelectionManager()
Get the underlying selection manager. |
boolean |
isEnabled(SelectionEvent e)
Override this method to specify when to disable or enable the action based on the current selection. |
void |
selectionChanged(SelectionEvent e)
Override this method to specify what to do when the selection changes. |
Methods inherited from class de.jreality.ui.viewerapp.actions.AbstractJrAction |
---|
actionPerformed, setAcceleratorKey, setName, setShortDescription |
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 |
Constructor Detail |
---|
public AbstractSelectionListenerAction(String name, SelectionManagerInterface sm)
name
- the name of the actionsm
- the underlying selection manager
IllegalArgumentException
- if sm is null
public AbstractSelectionListenerAction(String name, SelectionManagerInterface sm, Component parentComp)
name
- the name of the actionsm
- the underlying selection managerparentComp
- the parent component
IllegalArgumentException
- if sm is null
Method Detail |
---|
public void selectionChanged(SelectionEvent e)
selectionChanged
in interface SelectionListener
e
- the selection eventisEnabled(SelectionEvent)
public boolean isEnabled(SelectionEvent e)
selectionChanged(SelectionEvent)
.
e
- the selection event
selectionChanged(SelectionEvent)
public Selection getSelection()
public SelectionManagerInterface getSelectionManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |