Class sunsoft.jws.visual.rt.base.AttributeManager
All Packages Class Hierarchy This Package Previous Next Index
Class sunsoft.jws.visual.rt.base.AttributeManager
java.lang.Object
|
+----sunsoft.jws.visual.rt.base.AttributeManager
- public class AttributeManager
- extends Object
The AttributeManager class is a base class for objects that
have attributes. The Shadow and Group classes are sub-classed
from AttributeManager.
The attributes available for this
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
-----------------------------------------------------------------------
name java.lang.String null
-
attributes
- The table where attributes are stored.
-
CONTAINER
- The parent will be notified by calling updateContainerAttribute
on the parent whenever a CONTAINER attribute is changed.
-
DEFAULT
- This flag indicates that the default value for the attribute
matches the default value for the AWT body.
-
DONTFETCH
- This flag tells the attribute manager to not refetch the value
of the attribute list during the refetchAttributes call.
-
HIDDEN
- Flags attributes that will not be shown in the Visual Java
attribute editor.
-
NOEDITOR
- This flag tells the attribute editor's slot that it should not use
a type editor for this attribute, even if there is one registered.
-
READONLY
- Indicates a readonly attribute.
-
TRANSIENT
- Flags attributes that will not be stored in the
save file.
-
AttributeManager()
- Creates the attributes list and assigns a unique name to this
attribute manager.
-
action(Message, Event, Object)
-
-
create()
- Create the object.
-
destroy()
- This method is overridden in most sub-classes.
-
get(String)
- Gets an attribute from this shadow object's attribute list.
-
getAttributeList()
- Return a reference to the entire table of attributes.
-
getFlags(String)
- Returns true if the attribute has the flag set, otherwise false.
-
getForwardingGroup(String)
- Returns the group that is forwarding the specified attribute
to this attribute manager.
-
getFromTable(String)
- Gets an attribute's value directly from the attribute table.
-
getFullName()
- Returns a hierarchy name based on the group tree.
-
getGroup()
- Returns the group for this object, or null if there is none.
-
getName()
- Returns the name for this attribute manager.
-
getParent()
- Returns the parent for this attribute manager.
-
getRoot()
- Returns the root for this object, or null if these is no root.
-
getType(String)
- Returns the type string for the attribute, or null if the attribute
does not exist.
-
getUserTypeName()
- Returns a type name suitable for use in making unique names for
instances of this class (or one of its sub-classes).
-
gotFocus(Message, Event, Object)
-
-
handleEvent(Message, Event)
- May be overridden by subclasses that want to act
on AWT events that are sent to this object.
-
handleMessage(Message)
- May be overridden by subclasses that want to act
on messages that are sent to this object.
-
hasAttribute(String)
- Returns true if the attribute exists, otherwise return false.
-
hasAttribute(String, String)
- Return true if the attribute exists and the type matches, otherwise
return false.
-
hierarchy()
- Returns a string that shows the hierarchy of shadow objects.
-
inDesignerRoot()
- Returns true if this instance is a direct descendant
of the designer root.
-
initialize()
- Initialize the object.
-
isCreated()
- Returns true if the attribute manager is created.
-
isLayoutMode()
- Returns a boolean indicating if this object is in layout mode.
-
isLive()
- Returns true if we are not running inside the designer.
-
keyDown(Message, Event, int)
-
-
keyUp(Message, Event, int)
-
-
layoutMode()
- Called when Visual Java switches to layout mode.
-
lostFocus(Message, Event, Object)
-
-
mouseDown(Message, Event, int, int)
-
-
mouseDrag(Message, Event, int, int)
-
-
mouseEnter(Message, Event, int, int)
-
-
mouseExit(Message, Event, int, int)
-
-
mouseMove(Message, Event, int, int)
-
-
mouseUp(Message, Event, int, int)
-
-
postMessage(Message)
- Posts a message to this object.
-
postMessageToParent(Message)
- Posts a message to this object's parent.
-
preValidate()
- Called after addNotify and before the window is reshaped.
-
previewMode()
- Called when Visual Java switches to preview mode.
-
putInTable(String, Object)
- Puts an attribute's value directly into the attribute table.
-
recreate()
- Recreates this object after a CONSTRUCTOR attribute has been set
(overridden in Shadow).
-
refetchAttributeList()
- Calls get for all the attributes, and then stores the values
directly in the attribute hash table.
-
resolve(String)
-
-
resolveBody(String)
- Returns the body for a shadow after resolving it.
-
resolveFullName(String)
- Finds a component from its full path name.
-
set(String, Object)
- Sets an attribute in this object's attribute list.
-
setParent(AMContainer)
- Sets the parent for this attribute manager.
-
toString()
- Returns a String that represents the value of this Object.
-
updateContainerAttributes(AMContainer, AttributeManager)
- Apply all the CONTAINER attributes in the child to the given parent.
READONLY
public final static int READONLY
- Indicates a readonly attribute. An attempt
to set the attribute will result in an error.
HIDDEN
public final static int HIDDEN
- Flags attributes that will not be shown in the Visual Java
attribute editor.
TRANSIENT
public final static int TRANSIENT
- Flags attributes that will not be stored in the
save file.
CONTAINER
public final static int CONTAINER
- The parent will be notified by calling updateContainerAttribute
on the parent whenever a CONTAINER attribute is changed.
DEFAULT
public final static int DEFAULT
- This flag indicates that the default value for the attribute
matches the default value for the AWT body. If this flag is
set, the setOnBody method will not be called during
creation unless the value is actually changed.
Similarly for groups, if the DEFAULT flag is set, then
setOnGroup will only be called during initialization if the
attribute has actually changed. Otherwise setOnGroup will
be called regardless of whether the attribute has changed.
Note: This flag should only be used where performance is a
concern, since resetting the default value on the AWT body
should not change its behavior.
DONTFETCH
public final static int DONTFETCH
- This flag tells the attribute manager to not refetch the value
of the attribute list during the refetchAttributes call. This
is useful for the AWT component fonts and colors that are inherited
from their parent when set to null. If this flag were not set
for those attributes, then they would end up everywhere in the
save file.
NOEDITOR
public final static int NOEDITOR
- This flag tells the attribute editor's slot that it should not use
a type editor for this attribute, even if there is one registered.
attributes
protected AttributeList attributes
- The table where attributes are stored.
Attributes may be added to this list during construction, but
should not be added at any other time.
AttributeManager
public AttributeManager()
- Creates the attributes list and assigns a unique name to this
attribute manager. Attributes may be added to the list of attributes
in sub-class constructors, but should not be added at any other time.
getParent
public AMContainer getParent()
- Returns the parent for this attribute manager.
setParent
public void setParent(AMContainer parent)
- Sets the parent for this attribute manager.
isLive
public boolean isLive()
- Returns true if we are not running inside the designer.
inDesignerRoot
public boolean inDesignerRoot()
- Returns true if this instance is a direct descendant
of the designer root. Being a direct descendant means that there are
no intermediate groups between this attribute manager and the root.
The designer root is the root that is built inside
Visual Java.
getUserTypeName
protected String getUserTypeName()
- Returns a type name suitable for use in making unique names for
instances of this class (or one of its sub-classes). This should
be overridden in sub-classes to give more useful names.
putInTable
protected final void putInTable(String key,
Object value)
- Puts an attribute's value directly into the attribute table.
getFromTable
protected final Object getFromTable(String key)
- Gets an attribute's value directly from the attribute table.
set
public void set(String key,
Object value)
- Sets an attribute in this object's attribute list. This may be
overridden in sub-classes to introduce special behavior for the
setting of some attributes.
get
public Object get(String key)
- Gets an attribute from this shadow object's attribute list. This
may be overridden in sub-classes to introduce special behavior
for the getting of some attributes.
getType
public String getType(String key)
- Returns the type string for the attribute, or null if the attribute
does not exist.
getFlags
public int getFlags(String key)
- Returns true if the attribute has the flag set, otherwise false.
hasAttribute
public boolean hasAttribute(String key)
- Returns true if the attribute exists, otherwise return false.
hasAttribute
public boolean hasAttribute(String key,
String type)
- Return true if the attribute exists and the type matches, otherwise
return false.
updateContainerAttributes
public void updateContainerAttributes(AMContainer parent,
AttributeManager child)
- Apply all the CONTAINER attributes in the child to the given parent.
getAttributeList
public AttributeList getAttributeList()
- Return a reference to the entire table of attributes.
refetchAttributeList
public void refetchAttributeList()
- Calls get for all the attributes, and then stores the values
directly in the attribute hash table. This ensures that the
list of attributes is up to date.
resolve
public AttributeManager resolve(String name)
resolveFullName
public AttributeManager resolveFullName(String name)
- Finds a component from its full path name.
resolveBody
public Object resolveBody(String name)
- Returns the body for a shadow after resolving it.
getName
public String getName()
- Returns the name for this attribute manager.
getFullName
public String getFullName()
- Returns a hierarchy name based on the group tree.
initialize
public void initialize()
- Initialize the object. Only useful for groups.
create
public void create()
- Create the object. The AWT components are constructed during creation.
isCreated
public boolean isCreated()
- Returns true if the attribute manager is created.
recreate
public void recreate()
- Recreates this object after a CONSTRUCTOR attribute has been set
(overridden in Shadow).
destroy
public void destroy()
- This method is overridden in most sub-classes. It should be the
opposite of create() and should have the same ability to be
called safely multiple times.
hierarchy
public String hierarchy()
- Returns a string that shows the hierarchy of shadow objects.
Starts first one (the caller) off as the top level.
toString
public String toString()
- Returns a String that represents the value of this Object.
- Overrides:
- toString in class Object
getRoot
public Root getRoot()
- Returns the root for this object, or null if these is no root.
getGroup
public Group getGroup()
- Returns the group for this object, or null if there is none.
getForwardingGroup
protected Group getForwardingGroup(String attributeName)
- Returns the group that is forwarding the specified attribute
to this attribute manager. Return null if the attribute is not
being forwarded from any group.
postMessageToParent
public void postMessageToParent(Message msg)
- Posts a message to this object's parent.
postMessage
public void postMessage(Message msg)
- Posts a message to this object.
handleMessage
public boolean handleMessage(Message msg)
- May be overridden by subclasses that want to act
on messages that are sent to this object.
handleEvent
public boolean handleEvent(Message msg,
Event evt)
- May be overridden by subclasses that want to act
on AWT events that are sent to this object.
mouseDown
public boolean mouseDown(Message msg,
Event evt,
int x,
int y)
mouseDrag
public boolean mouseDrag(Message msg,
Event evt,
int x,
int y)
mouseUp
public boolean mouseUp(Message msg,
Event evt,
int x,
int y)
mouseMove
public boolean mouseMove(Message msg,
Event evt,
int x,
int y)
mouseEnter
public boolean mouseEnter(Message msg,
Event evt,
int x,
int y)
mouseExit
public boolean mouseExit(Message msg,
Event evt,
int x,
int y)
keyDown
public boolean keyDown(Message msg,
Event evt,
int key)
keyUp
public boolean keyUp(Message msg,
Event evt,
int key)
action
public boolean action(Message msg,
Event evt,
Object what)
gotFocus
public boolean gotFocus(Message msg,
Event evt,
Object what)
lostFocus
public boolean lostFocus(Message msg,
Event evt,
Object what)
isLayoutMode
public boolean isLayoutMode()
- Returns a boolean indicating if this object is in layout mode.
layoutMode
public void layoutMode()
- Called when Visual Java switches to layout mode.
previewMode
public void previewMode()
- Called when Visual Java switches to preview mode.
preValidate
public void preValidate()
- Called after addNotify and before the window is reshaped.
All Packages Class Hierarchy This Package Previous Next Index