jimgpnt.util
Class PropertiesGUIField

java.lang.Object
  extended by jimgpnt.util.PropertiesGUIField
All Implemented Interfaces:
java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.event.FocusListener, java.beans.PropertyChangeListener

public class PropertiesGUIField
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.FocusListener, javax.swing.event.ChangeListener, java.beans.PropertyChangeListener

A collection of a JLabel and a JPanel that contains all that is needed to fiddle with fields of a properties file. There is some type checking and in conjunction with a PropertiesGUI will create quick dialogs to edit Properties objects. Note that PropertyChangeListeners added to this object will actually be added to the component that handles the changing of the property. This may be a JTextFiels, a JCheckBox, or a ColorButton depending on the type of this PropertiesGUIField.

Copyright (c) 2004 Alistair Dickie. All Rights Reserved. See alistairdickie.com for contact details See licence.txt for licence infomation


Field Summary
static int TYPE_BOOLEAN
           
static int TYPE_COLOR
           
static int TYPE_DOUBLE
           
static int TYPE_INT
           
static int TYPE_STRING
           
 
Constructor Summary
PropertiesGUIField(java.util.Properties properties, java.lang.String fieldName, int fieldType)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
protected  void buildComponents()
           
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 boolean getBooleanProperty()
           
 javax.swing.JComponent getComponent()
           
 double getDoubleProperty()
           
 java.lang.String getFieldName()
           
 int getFieldType()
           
 int getIntProperty()
           
 javax.swing.JLabel getLabel()
           
 javax.swing.JPanel getLine()
           
 java.util.Properties getProperties()
           
 java.lang.String getStringProperty()
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void setLabel(javax.swing.JLabel label)
           
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_DOUBLE

public static final int TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_INT

public static final int TYPE_INT
See Also:
Constant Field Values

TYPE_COLOR

public static final int TYPE_COLOR
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
See Also:
Constant Field Values
Constructor Detail

PropertiesGUIField

public PropertiesGUIField(java.util.Properties properties,
                          java.lang.String fieldName,
                          int fieldType)
Method Detail

getLabel

public javax.swing.JLabel getLabel()

setLabel

public void setLabel(javax.swing.JLabel label)

getLine

public javax.swing.JPanel getLine()

getComponent

public javax.swing.JComponent getComponent()

getProperties

public java.util.Properties getProperties()

getFieldName

public java.lang.String getFieldName()

getFieldType

public int getFieldType()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

buildComponents

protected void buildComponents()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

getStringProperty

public java.lang.String getStringProperty()

getIntProperty

public int getIntProperty()

getDoubleProperty

public double getDoubleProperty()

getBooleanProperty

public boolean getBooleanProperty()


Copyright © 2004 Alistair Dickie. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

1. The origin of this Software must not be misrepresented; you must not claim that you wrote the original software. If you use the Software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original Software.

3. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Alistair Dickie - See alistairdickie.com for contact details.