© 2006-2007 ETH Zurich

org.ximtec.igesture.tool.binding
Class DataBinding<T extends JComponent>

java.lang.Object
  extended by org.ximtec.igesture.tool.binding.DataBinding<T>
All Implemented Interfaces:
FocusListener, PropertyChangeListener, EventListener
Direct Known Subclasses:
ConstraintTextFieldBinding, LabelBinding, MapTextFieldBinding, TextAreaBinding, TextFieldBinding

public abstract class DataBinding<T extends JComponent>
extends Object
implements FocusListener, PropertyChangeListener


Constructor Summary
DataBinding(DataObject dataObject, String property)
          Constructor
 
Method Summary
 void focusGained(FocusEvent arg0)
           
 void focusLost(FocusEvent arg0)
           
abstract  T getComponent()
          Returns the JComponent which is involved in the binding process.
 Object getObject()
          Returns the data object
 String getProperty()
          Returns the property name
protected  String getValue()
          Read a value from the data object
 void propertyChange(PropertyChangeEvent evt)
           
protected  void setValue(Object object)
          Set a value in the dataobject
protected abstract  void updateModel()
          This method provides functionality to update the model.
protected abstract  void updateView()
          This method provides functionality to update the view in case of model changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataBinding

public DataBinding(DataObject dataObject,
                   String property)
Constructor

Parameters:
dataObject - the data object
property - the name of the property
key - the key used by the localization handler (can be null)
Method Detail

updateView

protected abstract void updateView()
This method provides functionality to update the view in case of model changes. This method is invoked on a propertyChange event.


updateModel

protected abstract void updateModel()
This method provides functionality to update the model.


getComponent

public abstract T getComponent()
Returns the JComponent which is involved in the binding process.

Returns:

setValue

protected void setValue(Object object)
Set a value in the dataobject

Parameters:
object -
Throws:
PropertyVetoException

getValue

protected String getValue()
Read a value from the data object

Returns:

getObject

public Object getObject()
Returns the data object

Returns:

getProperty

public String getProperty()
Returns the property name

Returns:

focusGained

public void focusGained(FocusEvent arg0)
Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent arg0)
Specified by:
focusLost in interface FocusListener

propertyChange

public final void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.