Class sunsoft.jws.visual.rt.base.Shadow
All Packages Class Hierarchy This Package Previous Next Index
Class sunsoft.jws.visual.rt.base.Shadow
java.lang.Object
|
+----sunsoft.jws.visual.rt.base.AttributeManager
|
+----sunsoft.jws.visual.rt.base.Shadow
- public class Shadow
- extends AttributeManager
This class implements the basic interfaces that Visual Java requires
for its visual components. Objects that wish to be added to
the Visual Java palette must be sub-classed from Shadow.
The attributes this class adds to an AttributeManager
class are listed below. In the type column, type names beginning
with "sunsoft.jws.visual.rt" have been abbreviated to begin with "rt".
name type default value
-----------------------------------------------------------------------
none
Check the super class for additional attributes.
-
body
- The AWT component for this shadow.
-
CONSTRUCTOR
- When this flag is set, a provision must be made in order to set
the attribute in the body's constructor.
-
NONBODY
- This flag signifies that the attribute has nothing to
do with a shadow 'body' and therefore
getOnBody and
setOnBody
will not be called for this attribute.
-
Shadow()
- Constructor
-
create()
- Creates this shadow.
-
createBody()
- Creates the AWT component for this shadow.
-
destroy()
- Destroys this shadow and all its children.
-
destroyBody()
- Destroys the body for this shadow.
-
get(String)
- Gets an attribute either from the body (if available) or from the
shadow's attribute list.
-
getBody()
- Returns the AWT component for this shadow.
-
getOnBody(String)
- Gets attributes from this shadow's body.
-
getUserTypeName()
- Returns a type name suitable for use in naming instances of
shadow sub-classes (i.e.
-
postCreate()
- Called just after this shadow has been created.
-
preDestroy()
- Called during destroy, but before the children are destroyed.
-
recreate()
- Creates this shadow again after a constructor attribute has been set.
-
registerBody()
- Registers newly created shadows.
-
set(String, Object)
- Sets an attribute either in the body (if available) or in the
shadow's attribute list.
-
setOnBody(String, Object)
- Sets attributes on this shadow's body.
-
toString()
- Returns a String that represents the value of this Object.
-
unregisterBody()
- Unregisters destroyed shadows.
CONSTRUCTOR
public final static int CONSTRUCTOR
- When this flag is set, a provision must be made in order to set
the attribute in the body's constructor. It is up to the caller to call
recreate on the shadow and validate on the shadow's parent after
a constructor attribute has been set.
NONBODY
public final static int NONBODY
- This flag signifies that the attribute has nothing to
do with a shadow 'body' and therefore
getOnBody and
setOnBody
will not be called for this attribute.
body
protected Object body
- The AWT component for this shadow.
Shadow
public Shadow()
- Constructor
getBody
public Object getBody()
- Returns the AWT component for this shadow. The return value is of
type Object, therefore the caller must do a cast to the
appropriate AWT component type.
getUserTypeName
protected String getUserTypeName()
- Returns a type name suitable for use in naming instances of
shadow sub-classes (i.e. names that make sense to a user.) This
can be overridden in sub-classes to give more useful names when
this (default) algorithm comes up with something ugly.
- Overrides:
- getUserTypeName in class AttributeManager
getOnBody
protected Object getOnBody(String key)
- Gets attributes from this shadow's body.
Should be overridden in each sub-class which has its own
attributes. There should be an entry for every attribute that
doesn't have the NONBODY flag, even if it's just to return
the value from the attribute list when a certain attribute can't
be looked up from the body.
get
public Object get(String key)
- Gets an attribute either from the body (if available) or from the
shadow's attribute list.
- Overrides:
- get in class AttributeManager
setOnBody
protected void setOnBody(String key,
Object value)
- Sets attributes on this shadow's body.
Should be overridden in each sub-class which has its own
attributes. There should be an entry for every attribute that
doesn't have the NONBODY flag, even if it's just to set the
value in the attribute list when a certain attribute can't be set
on the body.
set
public void set(String key,
Object value)
- Sets an attribute either in the body (if available) or in the
shadow's attribute list. Destroys the body when
a CONSTRUCTOR attribute is set. It is up to the caller to call
recreate on the shadow and validate on the shadow's parent after
a constructor attribute has been set.
- Overrides:
- set in class AttributeManager
create
public void create()
- Creates this shadow.
It is safe to call create multiple times on a shadow object.
- Overrides:
- create in class AttributeManager
postCreate
protected void postCreate()
- Called just after this shadow has been created.
createBody
public void createBody()
- Creates the AWT component for this shadow.
Sub-classes must override this method.
registerBody
protected void registerBody()
- Registers newly created shadows. Sub-classes should not override
this method.
recreate
public void recreate()
- Creates this shadow again after a constructor attribute has been set.
- Overrides:
- recreate in class AttributeManager
destroy
public void destroy()
- Destroys this shadow and all its children.
- Overrides:
- destroy in class AttributeManager
preDestroy
protected void preDestroy()
- Called during destroy, but before the children are destroyed. By
the time destroyBody is called, all the children have already
been destroyed.
destroyBody
protected void destroyBody()
- Destroys the body for this shadow. Sub-classes are not required
to override this method.
unregisterBody
protected void unregisterBody()
- Unregisters destroyed shadows. Sub-classes should not override
this method.
toString
public String toString()
- Returns a String that represents the value of this Object.
- Overrides:
- toString in class AttributeManager
All Packages Class Hierarchy This Package Previous Next Index