public class Control
extends javax.swing.AbstractAction
Modifier and Type | Class and Description |
---|---|
static interface |
Control.Command
A simple command interface, allowing for Controls based on method references
|
static interface |
Control.Iterator
Used when handling sets of Controls.
|
Constructor and Description |
---|
Control()
Constructs a new Control.
|
Control(java.lang.String name)
Constructs a new Control.
|
Control(java.lang.String name,
StateObserver enabledObserver)
Constructs a new Control.
|
Control(java.lang.String name,
StateObserver enabledObserver,
javax.swing.Icon icon)
Constructs a new Control.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
protected Control |
doSetMnemonic(int mnemonic)
Sets the mnemonic key, if overridden remember to call super.doSetMnemonic()
|
java.lang.String |
getDescription() |
StateObserver |
getEnabledObserver() |
javax.swing.Icon |
getIcon() |
int |
getMnemonic() |
java.lang.String |
getName() |
Control |
setDescription(java.lang.String description) |
void |
setEnabled(boolean newValue)
Unsupported, the enabled state of Controls is based on their
enabledObserver |
Control |
setIcon(javax.swing.Icon icon) |
Control |
setKeyStroke(javax.swing.KeyStroke ks) |
Control |
setMnemonic(int key) |
Control |
setName(java.lang.String name) |
java.lang.String |
toString() |
public Control()
public Control(java.lang.String name)
name
- the control namepublic Control(java.lang.String name, StateObserver enabledObserver)
name
- the control nameenabledObserver
- the state observer controlling the enabled state of this controlpublic Control(java.lang.String name, StateObserver enabledObserver, javax.swing.Icon icon)
name
- the control nameenabledObserver
- the state observer controlling the enabled state of this controlicon
- the iconpublic final java.lang.String toString()
toString
in class java.lang.Object
public final void setEnabled(boolean newValue)
enabledObserver
setEnabled
in interface javax.swing.Action
setEnabled
in class javax.swing.AbstractAction
java.lang.UnsupportedOperationException
- alwaysControl(String, StateObserver)
public void actionPerformed(java.awt.event.ActionEvent e)
public final java.lang.String getDescription()
public final Control setDescription(java.lang.String description)
description
- the description stringpublic final java.lang.String getName()
public final Control setName(java.lang.String name)
name
- the name of this Control instancepublic final StateObserver getEnabledObserver()
public final Control setMnemonic(int key)
key
- the mnemonic to associate with this Control instancepublic final int getMnemonic()
public final Control setKeyStroke(javax.swing.KeyStroke ks)
ks
- the KeyStroke to associate with this Controlpublic final Control setIcon(javax.swing.Icon icon)
icon
- the icon to associate with this Controlpublic final javax.swing.Icon getIcon()
protected Control doSetMnemonic(int mnemonic)
mnemonic
- the mnemonic key