org.progeeks.meta.swing
Class AbstractMetaObjectUI

java.lang.Object
  extended by org.progeeks.meta.swing.AbstractMetaObjectUI
All Implemented Interfaces:
MetaObjectUI, MetaPropertyEditor, MetaPropertyRenderer, MetaPropertyUI
Direct Known Subclasses:
MetaTabbedPanelUI, MultiColumnPanelUI

public abstract class AbstractMetaObjectUI
extends java.lang.Object
implements MetaPropertyEditor, MetaPropertyRenderer, MetaObjectUI

A component that allows rendering or editing a specific type of MetaObject.

Version:
$Revision: 1.7 $
Author:
Paul Speed

Constructor Summary
AbstractMetaObjectUI()
           
 
Method Summary
 void flushEdits()
          Causes any edits in progress to be flushed to the mutator if possible.
protected  FactoryRegistry getFactories()
           
 java.awt.Component getUIComponent()
          Returns the component that renders the associated property mutator's value.
 MetaPropertyContext getViewContext()
          Returns the MetaPropertyContext for which this MetaPropertyUI is a participant.
 void initializeView(MetaPropertyContext viewContext)
          Initializes this MetaPropertyUI as a participant in the specified MetaPropertyContext's hierarchy.
protected  boolean isEditable()
          Returns true if this UI is editable.
 boolean isLabeled()
          Returns false as a hint that the returned component should be labeled by the container.
 boolean isSingleColumn()
          Returns false as a hint that the returned component should be displayed differently.
protected  void propertyChanged()
           
 void release()
          Releases any listeners or resources associated with this MetaPropertyUI.
protected  void setComponent(java.awt.Component component)
          Called to set the component.
protected abstract  void setComponentObject(java.awt.Component component, MetaObject object)
          Called to set the value currently displayed in the component.
 void setMetaObject(MetaObject object)
          Sets this MetaObjectUI instance to reflect the value of the specified meta-object.
protected  void setObject(MetaObject object, PropertyMutator mutator)
          Sets the internal object information for this component.
 void setPropertyMutator(PropertyMutator mutator)
          Sets this MetaPropertyUI instance to reflect value of the specified property mutator.
protected  void terminateView()
          Called by the release method to remove any listeners that may have been registered with the view context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMetaObjectUI

public AbstractMetaObjectUI()
Method Detail

initializeView

public void initializeView(MetaPropertyContext viewContext)
Initializes this MetaPropertyUI as a participant in the specified MetaPropertyContext's hierarchy. The default implementation just sets the internal MetaPropertyContext reference. Subclasses should rememeber to call the super.initializeView() method.

Specified by:
initializeView in interface MetaObjectUI
Specified by:
initializeView in interface MetaPropertyUI

terminateView

protected void terminateView()
Called by the release method to remove any listeners that may have been registered with the view context. Default implementation does nothing.


getViewContext

public MetaPropertyContext getViewContext()
Returns the MetaPropertyContext for which this MetaPropertyUI is a participant.

Specified by:
getViewContext in interface MetaObjectUI
Specified by:
getViewContext in interface MetaPropertyUI

getFactories

protected FactoryRegistry getFactories()

setComponent

protected void setComponent(java.awt.Component component)
Called to set the component.


isEditable

protected boolean isEditable()
Returns true if this UI is editable.


setComponentObject

protected abstract void setComponentObject(java.awt.Component component,
                                           MetaObject object)
Called to set the value currently displayed in the component.


setPropertyMutator

public void setPropertyMutator(PropertyMutator mutator)
Sets this MetaPropertyUI instance to reflect value of the specified property mutator. If any previously associated property mutator exists, it will be replaced and any internal renderer data structures will be reset accordingly. Any component that was returned from a getUIComponent() call will be reused.

Specified by:
setPropertyMutator in interface MetaPropertyUI

setMetaObject

public void setMetaObject(MetaObject object)
Sets this MetaObjectUI instance to reflect the value of the specified meta-object. If any previously associated meta-object exists, it will be replaced and any internal data structures will be reset accordingly. Any component that was returned from a getUIComponent() call will be reused.

Specified by:
setMetaObject in interface MetaObjectUI

setObject

protected void setObject(MetaObject object,
                         PropertyMutator mutator)
Sets the internal object information for this component.


isSingleColumn

public boolean isSingleColumn()
Returns false as a hint that the returned component should be displayed differently.

Specified by:
isSingleColumn in interface MetaPropertyUI

isLabeled

public boolean isLabeled()
Returns false as a hint that the returned component should be labeled by the container.

Specified by:
isLabeled in interface MetaPropertyUI

flushEdits

public void flushEdits()
Causes any edits in progress to be flushed to the mutator if possible.

Specified by:
flushEdits in interface MetaPropertyEditor

getUIComponent

public java.awt.Component getUIComponent()
Returns the component that renders the associated property mutator's value.

Specified by:
getUIComponent in interface MetaObjectUI
Specified by:
getUIComponent in interface MetaPropertyUI

release

public void release()
Releases any listeners or resources associated with this MetaPropertyUI.

Specified by:
release in interface MetaObjectUI
Specified by:
release in interface MetaPropertyUI

propertyChanged

protected void propertyChanged()


Copyright © 2002-2003 Paul Speed. All Rights Reserved.