JPanel testPanel = new Panel(); // create parent panel
testPanel.setLayout(new BoxLayout(testPanel, BoxLayout.PAGE_AXIS));
GUIPropertyString name = new GUIPropertyString("Name", "Anne");
testPanel.add(name.getPropertyPanel()); // add one property
GUIPropertyString city = new GUIPropertyString("City", "Eindhoven");
testPanel.add(city.getPropertyPanel()); // add another property
return testPanel;
- See Also:
getValue
,
getPropertyPanel
Constructor Summary |
GUIPropertyString(java.lang.String name,
java.lang.String defaultValue)
Creates a boolean property without a discription and notification. |
GUIPropertyString(java.lang.String name,
java.lang.String defaultValue,
GuiNotificationTarget target)
Creates a boolean property without a discription. |
GUIPropertyString(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue)
Creates a boolean property without notification. |
GUIPropertyString(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target)
Creates a boolean property. |
GUIPropertyString(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target,
int width)
Creates a boolean property. |
Method Summary |
javax.swing.JPanel |
getPropertyPanel()
Creates GUI panel containg this property, ready to display in
some settings dialog. |
java.lang.String |
getValue()
The method to be invoked when the value of this property is
to be used. |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
The method automatically invoked when changing the text field status. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
myName
protected java.lang.String myName
myDescription
protected java.lang.String myDescription
myValue
protected java.lang.String myValue
myWidth
protected int myWidth
myTarget
protected GuiNotificationTarget myTarget
myTextField
protected javax.swing.JTextField myTextField
GUIPropertyString
public GUIPropertyString(java.lang.String name,
java.lang.String defaultValue)
- Creates a boolean property without a discription and notification.
- Parameters:
name
- the name of this propertydefaultValue
- the default value of this property
GUIPropertyString
public GUIPropertyString(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue)
- Creates a boolean property without notification.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this property
GUIPropertyString
public GUIPropertyString(java.lang.String name,
java.lang.String defaultValue,
GuiNotificationTarget target)
- Creates a boolean property without a discription.
- Parameters:
name
- the name of this propertydefaultValue
- the default value of this propertytarget
- the object to be notified as soon the state of this property changes
GUIPropertyString
public GUIPropertyString(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target)
- Creates a boolean property.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this propertytarget
- the object to be notified as soon the state of this property changes
GUIPropertyString
public GUIPropertyString(java.lang.String name,
java.lang.String description,
java.lang.String defaultValue,
GuiNotificationTarget target,
int width)
- Creates a boolean property.
- Parameters:
name
- the name of this propertydescription
- of this property (to be displayed as a tool tip)defaultValue
- the default value of this propertytarget
- the object to be notified as soon the state of this property changeswidth
- a custom width may be specified (default value is 100 otherwise)
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- The method automatically invoked when changing the text field status.
- Specified by:
keyTyped
in interface java.awt.event.KeyListener
- Parameters:
e
- the passed action event (not used)
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
- Specified by:
keyPressed
in interface java.awt.event.KeyListener
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleased
in interface java.awt.event.KeyListener
getValue
public java.lang.String getValue()
- The method to be invoked when the value of this property is
to be used.
- Returns:
- the current value of this property
getPropertyPanel
public javax.swing.JPanel getPropertyPanel()
- Creates GUI panel containg this property, ready to display in
some settings dialog.
- Returns:
- the graphical panel representing this property