public abstract class ConditionallyEnabledAction
extends javax.swing.AbstractAction
Modifier and Type | Class and Description |
---|---|
static class |
ConditionallyEnabledAction.EnablingCondition
Possible conditions under which to enable the action:
NEURONS: if at least one neuron is selected
SYNAPSES: if at least one synapse is selected
ALLITEMS: if at least one synapse or neuron is selected
SOURCE_NEURONS: if at least one neuron is designated as source neuron
SOURCE_AND_TARGET_NEURONS: if at least one neuron is designated as
source and one neuron is designated as target.
SOURCE_AND_TARGET_NEURON_GROUPS: if at least one neuron group is
designated as source and one neuron group is designated as target.
|
Modifier and Type | Field and Description |
---|---|
protected NetworkPanel |
networkPanel
Network panel.
|
Constructor and Description |
---|
ConditionallyEnabledAction(NetworkPanel networkPanel,
java.lang.String title,
ConditionallyEnabledAction.EnablingCondition updateType)
Construct the update action.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
sourceAndTargetNeuronGroupsSelected(NetworkPanel networkPanel)
True if at least one source and one target neuron group are selected.
|
static boolean |
sourceAndTargetNeuronSelected(NetworkPanel networkPanel)
True if at least one source and one target neuron are selected.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected final NetworkPanel networkPanel
public ConditionallyEnabledAction(NetworkPanel networkPanel, java.lang.String title, ConditionallyEnabledAction.EnablingCondition updateType)
networkPanel
- parent network panel, must not be nulltitle
- the name for this action, passed up to superclassupdateType
- in what conditions to enable the actionpublic static boolean sourceAndTargetNeuronGroupsSelected(NetworkPanel networkPanel)
networkPanel
- the network panel to check.public static boolean sourceAndTargetNeuronSelected(NetworkPanel networkPanel)
networkPanel
- the network panel to check.