|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oktiva.mogno.Component
This is the base class for all components. It implements the knowledge for owning another components and to save and load its data.
Field Summary | |
protected java.util.Hashtable |
bag
A bag with extra data for the component. |
protected ComponentFiler |
componentFiler
|
protected java.util.Hashtable |
componentFilerParams
|
protected boolean |
designing
Controls the behavior of the component. |
protected java.util.Vector |
eventQueue
Queue of events |
java.lang.String |
evOnCreate
Method to be called when the onCreate event is dispatched. |
java.lang.String |
name
The name of the component, used to identify an owned component inside its owner. |
protected java.util.Hashtable |
owned
A hash table with all the owned components. |
protected java.util.Hashtable |
ownedClasses
A hash table with all the owned component's classes . |
protected Component |
owner
The owner of this component. |
protected java.lang.String |
tag
|
protected java.lang.String |
xmlFileName
This variable is used when loading the component. |
Constructor Summary | |
Component()
|
Method Summary | |
java.util.Hashtable |
attribsHash()
Return all this component's attributes in a hash. |
protected void |
createOwnedComponents(java.util.Hashtable owned)
|
boolean |
descendentOf(java.lang.String name)
Verify if this component has an ancestor named name In Component, this is always false, because there is no parent. |
void |
dispatch(java.lang.String eventName)
Dispatch an event from this object. |
void |
dispatchAll()
dispatch all the events in the event queue |
void |
dispatchFunction(java.lang.String function,
java.lang.Class[] paramTypes,
java.lang.Object[] values)
|
java.lang.Class[] |
eventParamTypes(java.lang.String ev)
|
java.lang.Object[] |
eventParamValues(java.lang.String ev)
|
void |
freeChild(java.lang.String name)
Removes the component |
Application |
getApplication()
Get the Application object from the TopLevel. |
java.util.Hashtable |
getAttrsTypes()
Get the Class of the returns of the getters. |
java.util.Hashtable |
getBag()
Getter for property bag. |
Component |
getChild(java.lang.String name)
Get the component with name "name" |
java.lang.Class |
getChildClass(java.lang.String name)
Get the class of the component with name "name" |
Component |
getClone()
|
java.lang.String |
getEvOnCreate()
|
java.lang.Object |
getFromBag(java.lang.Object key)
Put the object in this component's bag. |
java.lang.String |
getName()
|
protected java.util.Vector |
getOrderedChildNames()
|
protected Component |
getOwner()
Getter for property owner. |
void |
initialize()
Initialize this component with a custom filer. |
void |
initialize(java.util.Hashtable params)
Initialize this component passing the properties. |
void |
initialize(java.io.InputStream in)
Initialize this component with a InputStream. |
void |
initialize(java.lang.String xmlFileName)
Initialize this component passing the XML file to load. |
boolean |
isDesigning()
Getter for property designing. |
java.util.Enumeration |
listChilds()
|
java.util.Vector |
nonAttributeGetters()
Method used to define what methods started with "get" or "is" are not component attributes getter methods. |
void |
putInBag(java.lang.Object key,
java.lang.Object value)
Put the object in this component's bag. |
void |
queue(java.lang.String ev)
queue an event |
void |
registerChild(Component obj)
Register a component as owned of this component |
java.lang.Object |
removeFromBag(java.lang.Object key)
Remove the object from this component's bag. |
java.lang.String |
serializedBag()
|
void |
setBag(java.util.Hashtable bag)
Setter for property bag. |
void |
setComponentFiler(ComponentFiler filer)
Set a custom ComponentFiler to use instead of the DefaultComponentFiler. |
void |
setComponentFilerParams(java.util.Hashtable params)
Set the params for the custom ComponentFiler. |
void |
setDesigning(boolean designing)
Setter for property designing. |
void |
setEvOnCreate(java.lang.String evOnCreate)
|
void |
setName(java.lang.String name)
|
protected void |
setOwner(Component owner)
Setter for property owner. |
void |
setProperties(java.util.Hashtable mine)
|
void |
store()
Store the current component into the file defined by the xmlFileName property |
protected void |
unserializeBag(java.lang.String data)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String xmlFileName
public java.lang.String name
public java.lang.String evOnCreate
protected Component owner
protected boolean designing
protected java.util.Hashtable owned
protected java.util.Hashtable ownedClasses
protected java.lang.String tag
protected java.util.Vector eventQueue
protected ComponentFiler componentFiler
protected java.util.Hashtable componentFilerParams
protected java.util.Hashtable bag
setBag(Hashtable)
,
getBag()
,
getFromBag(Object)
,
putInBag(Object,Object)
Constructor Detail |
public Component()
Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getEvOnCreate()
public void setEvOnCreate(java.lang.String evOnCreate)
public void initialize(java.util.Hashtable params) throws InitializeException
params
- A key-value hashtable with the properties.
InitializeException
initialize()
public void initialize(java.lang.String xmlFileName) throws InitializeException
xmlFileName
- The path to the XML file to load.
InitializeException
initialize()
public void initialize(java.io.InputStream in) throws InitializeException
InitializeException
initialize()
public void initialize() throws InitializeException
InitializeException
initialize(String)
,
initialize(Hashtable)
,
initialize(InputStream)
,
DefaultComponentFiler
public void setProperties(java.util.Hashtable mine)
public java.util.Hashtable getAttrsTypes()
public java.util.Vector nonAttributeGetters()
Vector v = super.nonAttributeGetters();
return v;
setProperties(Hashtable)
,
attribsHash()
,
store()
protected void createOwnedComponents(java.util.Hashtable owned) throws InitializeException
InitializeException
public void setComponentFiler(ComponentFiler filer)
filer
- The ComponentFiler to use.setComponentFilerParams(Hashtable)
,
initialize()
public void setComponentFilerParams(java.util.Hashtable params)
params
- The params to pass to the filer.setComponentFiler(ComponentFiler)
,
initialize()
public void store() throws java.io.IOException
java.io.IOException
protected java.util.Vector getOrderedChildNames()
public java.util.Hashtable attribsHash()
public void registerChild(Component obj)
obj
- The object itselfpublic void freeChild(java.lang.String name)
name
- The name of the componentpublic Component getChild(java.lang.String name)
name
- the name of the component to get
public java.lang.Class getChildClass(java.lang.String name)
name
- The name of the component to get
public java.util.Enumeration listChilds()
public void dispatch(java.lang.String eventName) throws java.lang.Exception
eventName
-
java.lang.Exception
designing
public java.lang.Class[] eventParamTypes(java.lang.String ev)
public java.lang.Object[] eventParamValues(java.lang.String ev)
public void dispatchFunction(java.lang.String function, java.lang.Class[] paramTypes, java.lang.Object[] values) throws java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
public void queue(java.lang.String ev)
ev
- the name of the eventpublic void dispatchAll() throws java.lang.Exception
java.lang.Exception
public Application getApplication()
TopLevel.getApplication()
public Component getClone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public boolean isDesigning()
designing
public void setDesigning(boolean designing)
designing
- New value of property designing.designing
public java.util.Hashtable getBag()
bag
,
setBag(Hashtable)
public void setBag(java.util.Hashtable bag)
bag
- The new bag to overwrite the current one.bag
,
getBag()
public void putInBag(java.lang.Object key, java.lang.Object value)
key
- The key.value
- The object to put.bag
,
getFromBag(Object)
public java.lang.Object getFromBag(java.lang.Object key)
key
- The key.
bag
,
putInBag(Object,Object)
public java.lang.Object removeFromBag(java.lang.Object key)
key
- The key.
bag
,
putInBag(Object,Object)
public boolean descendentOf(java.lang.String name)
name
- The name of the ancestor component
protected Component getOwner()
protected void setOwner(Component owner)
owner
- New value of property owner.public java.lang.String serializedBag()
protected void unserializeBag(java.lang.String data)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |