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.

Variable Index

 o body
The AWT component for this shadow.
 o CONSTRUCTOR
When this flag is set, a provision must be made in order to set the attribute in the body's constructor.
 o 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.

Constructor Index

 o Shadow()
Constructor

Method Index

 o create()
Creates this shadow.
 o createBody()
Creates the AWT component for this shadow.
 o destroy()
Destroys this shadow and all its children.
 o destroyBody()
Destroys the body for this shadow.
 o get(String)
Gets an attribute either from the body (if available) or from the shadow's attribute list.
 o getBody()
Returns the AWT component for this shadow.
 o getOnBody(String)
Gets attributes from this shadow's body.
 o getUserTypeName()
Returns a type name suitable for use in naming instances of shadow sub-classes (i.e.
 o postCreate()
Called just after this shadow has been created.
 o preDestroy()
Called during destroy, but before the children are destroyed.
 o recreate()
Creates this shadow again after a constructor attribute has been set.
 o registerBody()
Registers newly created shadows.
 o set(String, Object)
Sets an attribute either in the body (if available) or in the shadow's attribute list.
 o setOnBody(String, Object)
Sets attributes on this shadow's body.
 o toString()
Returns a String that represents the value of this Object.
 o unregisterBody()
Unregisters destroyed shadows.

Variables

 o 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.
 o 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.
 o body
  protected Object body
The AWT component for this shadow.

Constructors

 o Shadow
  public Shadow()
Constructor

Methods

 o 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.
 o 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
 o 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.
 o 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
 o 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.
 o 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
 o create
  public void create()
Creates this shadow. It is safe to call create multiple times on a shadow object.
Overrides:
create in class AttributeManager
 o postCreate
  protected void postCreate()
Called just after this shadow has been created.
 o createBody
  public void createBody()
Creates the AWT component for this shadow. Sub-classes must override this method.
 o registerBody
  protected void registerBody()
Registers newly created shadows. Sub-classes should not override this method.
 o recreate
  public void recreate()
Creates this shadow again after a constructor attribute has been set.
Overrides:
recreate in class AttributeManager
 o destroy
  public void destroy()
Destroys this shadow and all its children.
Overrides:
destroy in class AttributeManager
 o 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.
 o destroyBody
  protected void destroyBody()
Destroys the body for this shadow. Sub-classes are not required to override this method.
 o unregisterBody
  protected void unregisterBody()
Unregisters destroyed shadows. Sub-classes should not override this method.
 o 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