aokell.lib.control.factory
Class AbstractFactoryImpl

java.lang.Object
  extended by aokell.lib.control.factory.AbstractFactoryImpl
All Implemented Interfaces:
Controller, FactoryItf, Factory
Direct Known Subclasses:
CompositeFactoryImpl, PrimitiveFactoryImpl

public abstract class AbstractFactoryImpl
extends Object
implements FactoryItf, Controller

Root implementation for primitive and composite factories.

Author:
Lionel Seinturier

Field Summary
protected  Component compctrl
           
 
Fields inherited from interface aokell.lib.control.factory.FactoryItf
NAME, TYPE
 
Constructor Summary
AbstractFactoryImpl()
           
 
Method Summary
 void cloneFcCtrl(Component dst, Object hints)
          Clone the controller state from the current component to another one.
protected  void copyAttributeControllerState(Component component, Component newComponent, Map newContent)
          Copy the state of the attribute controller which is in the same membrane as the current factory controller into the attribute controller of the newly created component.
 Object getFcContentDesc()
           
 Object getFcControllerDesc()
           
 Type getFcInstanceType()
           
 void initFcCtrl()
          Initialize the controller.
abstract  Component newFcInstance()
           
 void setFcCompCtrl(Component compctrl)
          Set the reference towards the component controller associated to this controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface aokell.lib.control.factory.FactoryItf
newFcInstance
 

Field Detail

compctrl

protected Component compctrl
Constructor Detail

AbstractFactoryImpl

public AbstractFactoryImpl()
Method Detail

getFcControllerDesc

public Object getFcControllerDesc()
Specified by:
getFcControllerDesc in interface Factory

getFcContentDesc

public Object getFcContentDesc()
Specified by:
getFcContentDesc in interface Factory

getFcInstanceType

public Type getFcInstanceType()
Specified by:
getFcInstanceType in interface Factory

newFcInstance

public abstract Component newFcInstance()
                                 throws InstantiationException
Specified by:
newFcInstance in interface Factory
Throws:
InstantiationException

copyAttributeControllerState

protected void copyAttributeControllerState(Component component,
                                            Component newComponent,
                                            Map newContent)
                                     throws CloneCtrlException
Copy the state of the attribute controller which is in the same membrane as the current factory controller into the attribute controller of the newly created component.

Parameters:
newComponent - the newly created component
newContent - all newly created components
Throws:
CloneCtrlException

setFcCompCtrl

public void setFcCompCtrl(Component compctrl)
Set the reference towards the component controller associated to this controller.

Specified by:
setFcCompCtrl in interface Controller

initFcCtrl

public void initFcCtrl()
Initialize the controller.

Specified by:
initFcCtrl in interface Controller

cloneFcCtrl

public void cloneFcCtrl(Component dst,
                        Object hints)
                 throws CloneCtrlException
Clone the controller state from the current component to another one. This method may receive some hints on how to do this, or provide some hints on how this has been done. For instance, the hints may be a map that is read and/or written by the controller. The raison d'etre of these hints is that when its state is cloned, a controller may produce results that are needed by other controllers.

Specified by:
cloneFcCtrl in interface Controller
Parameters:
dst - the destination component
hints - hints for performing the operation
Throws:
CloneCtrlException