Class sunsoft.jws.visual.rt.base.Group
All Packages Class Hierarchy This Package Previous Next Index
Class sunsoft.jws.visual.rt.base.Group
java.lang.Object
|
+----sunsoft.jws.visual.rt.base.AttributeManager
|
+----sunsoft.jws.visual.rt.base.Group
- public class Group
- extends AttributeManager
The base class for every kind of group.
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
-----------------------------------------------------------------------
visible java.lang.Boolean true
Check the super class for additional attributes.
-
FORWARD
- This flag is set for forwarded attributes in a group.
-
FORWARD_REMOVE
- This flag is set for forwarded attributes that will
be removed during initialization if the group's
container does not define the attribute.
-
RESTORE_CURSOR
- This constant can be passed to the setCursor call.
-
Group()
- All the attributes used by this group must be defined in the
constructor.
-
addAttributeForward(AttributeManager)
- Adds the attribute manager to the list of forwards.
-
addComponentAttributes()
- Compatibility method - do not use!
-
addDialogAttributes()
- Compatibility method - do not use!
-
addForwardedAttributes()
- Adds a set of attributes to this group that
are suitable for forwarding to a frame, dialog or panel.
-
addFrameAttributes()
- Compatibility method - do not use!
-
addOperations(Operations)
- Add an operations class.
-
addPanelAttributes()
- Compatibility method - do not use!
-
create()
- Create the group.
-
createGroup()
- Called during group creation.
-
destroy()
- Destroy the group.
-
destroyGroup()
- Called during the destroy operation.
-
exit()
- Exit the application with no error code.
-
exit(int)
- Exit the application.
-
get(String)
- Get the value of a named attribute.
-
getApplet()
- Accessor method for the applet.
-
getBase()
- Returns the base group.
-
getChild(String)
- Looks up a named child group of this group.
-
getChildList()
- Returns an enumerated list of this group's children.
-
getCmdLineArgs()
- Accessor method for the command line arguments.
-
getFrame()
- Returns the first frame found while traversing up the
group tree.
-
getFullName()
- Returns a hierarchy name based on the group tree.
-
getGroup()
- Returns this group (overrides the behavior of getGroup
as defined in AttributeManager).
-
getOnGroup(String)
- May be overridden by sub-groups that
store attribute values themselves, and do not depend on the
group superclass to store them.
-
getParentGroup()
- Returns this group's parent.
-
getRegistry()
- Accessor method for the registry.
-
getTopLevel()
- Accessor method for the top level frame.
-
getUserTypeName()
- Returns a type name for this group to be used by visual java.
-
handleEvent(Message, Event)
- May be overridden by subclasses that want to get
notified when AWT events that are sent by the gui components.
-
handleMessage(Message)
- May be overridden by subclasses that want to act
on messages that are sent to the group.
-
hasBase()
- Returns true if this group is either the base group or is a descendant
of the base group.
-
hasStarted()
- Returns true if the base group has been started.
-
hide()
- Hides the group by setting the visible attribute to false.
-
hideGroup()
- May be overridden by group subclasses that want
to know when the group becomes non-visible.
-
initGroup()
- Called during initialization.
-
initialize()
- Initialize the group.
-
initRoot()
- initRoot must be overridden in group subclasses to
initialize the shadow tree.
-
isBase()
- Returns true if this group is the base group.
-
isBaseWindow(Window)
- Returns true if the given window this group's base window.
-
isInitialized()
- Returns true if the group is currently initialized.
-
isShowing()
- Returns true if the group is currently showing.
-
isStarted()
- Returns true if the group is currently started.
-
isVisible()
- Returns true if the visible attributes of the group and
all of its parents are all set to true.
-
layoutMode()
- Called when Visual Java switches to layout mode.
-
postMessage(Message)
- Posts a message to this group.
-
postMessageToParent(Message)
- Posts a message to this group's parent.
-
preValidate()
- Called after addNotify and before the window is reshaped.
-
previewMode()
- Called when Visual Java switches to preview mode.
-
removeOperations(Operations)
- Remove an operations class.
-
resolveFullName(String)
- Find a component from its full path name.
-
resolveGroup(String)
- Recursively looks for a named sub-group of this group.
-
set(String, Object)
- Set the value of a named attribute.
-
setCursor(int)
- Sets the cursor for all of the group's frames to the given
cursor value.
-
setEnvironmentInfo(Applet, String[])
- Sets the environment information for the group.
-
setOnGroup(String, Object)
- May be overridden by sub-groups that
want notification when attributes are changed.
-
setTopLevel(Frame)
- Sets the top level frame for the group.
-
show()
- Shows the group by setting the visible attribute to true.
-
show(boolean)
- Calls show or hide, depending on the value of cond.
-
showGroup()
- May be overridden by group subclasses that want
to know when the group becomes visible.
-
start()
- This method should not be overridden by group subclasses.
-
startGroup()
- May be overridden by group subclasses that want
to be informed when the application is starting.
-
stop()
- This method should not be overridden by group subclasses.
-
stopGroup()
- May be overridden by group subclasses that want
to be informed when the application is stopping.
-
windowDestroy(Message)
- Called when a WINDOW_DESTROY event is received by this group.
FORWARD
public final static int FORWARD
- This flag is set for forwarded attributes in a group.
FORWARD_REMOVE
public final static int FORWARD_REMOVE
- This flag is set for forwarded attributes that will
be removed during initialization if the group's
container does not define the attribute.
RESTORE_CURSOR
public final static int RESTORE_CURSOR
- This constant can be passed to the setCursor call. It indicates
that the cursor should be restored to its previous value.
Group
public Group()
- All the attributes used by this group must be defined in the
constructor. setOnGroup is called at initialization for all
the attributes. If the attribute has not been set prior to
initialization, setOnGroup is called with the default value.
initialize
public void initialize()
- Initialize the group. The shadow tree for the group is created
during initialization.
- Overrides:
- initialize in class AttributeManager
isInitialized
public boolean isInitialized()
- Returns true if the group is currently initialized.
initRoot
protected abstract Root initRoot()
- initRoot must be overridden in group subclasses to
initialize the shadow tree. The return value must be the
root of the newly initialized shadow tree.
initGroup
protected void initGroup()
- Called during initialization. It is called just after
initRoot is called, but before the sub-groups are initialized and
before the attributes are sent to the setOnGroup method.
initGroup is only called once in the lifetime of the Group.
This is because groups cannot be uninitialized. Anything that
needs to be cleaned up should be created in createGroup instead
of initGroup, and then can be cleaned up in destroyGroup.
createGroup and destroyGroup may be called multiple times during
the lifetime of a group.
getUserTypeName
protected String getUserTypeName()
- Returns a type name for this group to be used by visual java.
May be overridden in sub-classes to give more useful names.
- Overrides:
- getUserTypeName in class AttributeManager
show
public void show(boolean cond)
- Calls show or hide, depending on the value of cond.
show
public void show()
- Shows the group by setting the visible attribute to true.
hide
public void hide()
- Hides the group by setting the visible attribute to false.
isVisible
public boolean isVisible()
- Returns true if the visible attributes of the group and
all of its parents are all set to true.
isShowing
public boolean isShowing()
- Returns true if the group is currently showing.
showGroup
protected void showGroup()
- May be overridden by group subclasses that want
to know when the group becomes visible. It is called just before
the group becomes visible. The group will already be initialized
and created at this point.
hideGroup
protected void hideGroup()
- May be overridden by group subclasses that want
to know when the group becomes non-visible. It is called just
before the group becomes non-visible.
create
public void create()
- Create the group. Creating the group causes all the AWT components
to be created. Also, the createGroup method is called during
group creation.
- Overrides:
- create in class AttributeManager
createGroup
protected void createGroup()
- Called during group creation. Groups can be
created and destroyed multiple times during their lifetime.
Anything that is created in createGroup should be cleaned up
in destroyGroup. createGroup is called just after the group
has been created. Anything that needs to be done before the
group is created should be done in initGroup.
destroy
public void destroy()
- Destroy the group. This will destroy all AWT components, but
does not destroy the shadow tree or the group tree. The group
can be created again after a destroy by calling the "create"
method.
- Overrides:
- destroy in class AttributeManager
destroyGroup
protected void destroyGroup()
- Called during the destroy operation. Groups can
be created and destroyed multiple times during their lifetime.
Anything that has been created in createGroup should be cleaned up
in destroyGroup. destroyGroup is called just before the group
is destroyed.
start
public void start()
- This method should not be overridden by group subclasses.
The "startGroup" method should be overridden instead.
startGroup
protected void startGroup()
- May be overridden by group subclasses that want
to be informed when the application is starting. This method is
only called after the entire application has been initialized and
created.
For applets, startGroup is called whenever start is called on the
applet.
isStarted
public boolean isStarted()
- Returns true if the group is currently started.
stop
public void stop()
- This method should not be overridden by group subclasses.
The "stopGroup" method should be overridden instead.
stopGroup
protected void stopGroup()
- May be overridden by group subclasses that want
to be informed when the application is stopping. This method
will be called before a destroy is done.
For applets, stopGroup is called whenever stop is called on the
applet.
hasStarted
protected boolean hasStarted()
- Returns true if the base group has been started.
getChild
public Group getChild(String name)
- Looks up a named child group of this group. Not recursive.
getChildList
public Enumeration getChildList()
- Returns an enumerated list of this group's children. The list
is cloned because the caller might use it for removing child
groups from this group.
getParentGroup
public Group getParentGroup()
- Returns this group's parent.
getGroup
public Group getGroup()
- Returns this group (overrides the behavior of getGroup
as defined in AttributeManager).
- Overrides:
- getGroup in class AttributeManager
getFullName
public String getFullName()
- Returns a hierarchy name based on the group tree.
- Overrides:
- getFullName in class AttributeManager
resolveFullName
public AttributeManager resolveFullName(String name)
- Find a component from its full path name.
- Overrides:
- resolveFullName in class AttributeManager
resolveGroup
public Group resolveGroup(String name)
- Recursively looks for a named sub-group of this group.
addOperations
public synchronized void addOperations(Operations ops)
- Add an operations class.
removeOperations
public synchronized void removeOperations(Operations ops)
- Remove an operations class.
postMessageToParent
public void postMessageToParent(Message msg)
- Posts a message to this group's parent. This method should
be used when sending a message from within this group.
- Overrides:
- postMessageToParent in class AttributeManager
postMessage
public void postMessage(Message msg)
- Posts a message to this group. This method should
be used when sending a message to this group.
- Overrides:
- postMessage in class AttributeManager
handleMessage
public boolean handleMessage(Message msg)
- May be overridden by subclasses that want to act
on messages that are sent to the group. Typically, messages are
either AWT events that have been translated to messages, or they
are messages that have been sent by other groups.
super.handleMessage should be called for any messages that aren't
handled. If super.handleMessage is not called, then handleEvent
will not be called.
The default implementation of handleMessage returns "true". This
means that no events will be passed up the group tree, unless a
subclass overrides this method to return "false". AWT events are
not propagated regardless of the return value from handleEvent.
If you want a message to go to the parent group, override
handleMessage to return false for that message.
If you want an AWT event to go to the parent group, you need to
call postMessageToParent() with the event message.
- Overrides:
- handleMessage in class AttributeManager
handleEvent
public boolean handleEvent(Message msg,
Event evt)
- May be overridden by subclasses that want to get
notified when AWT events that are sent by the gui components.
The return value should be true for handled events, and
super.handleEvent should be called for unhandled events.
If super.handleEvent is not called, then the specific event
handling methods will not be called.
The message's target is set to the shadow that sent the event.
The event's target is set to the AWT component that sent the event.
The following more specific methods may also be overridden:
public boolean mouseDown(Message msg, Event evt, int x, int y);
public boolean mouseDrag(Message msg, Event evt, int x, int y);
public boolean mouseUp(Message msg, Event evt, int x, int y);
public boolean mouseMove(Message msg, Event evt, int x, int y);
public boolean mouseEnter(Message msg, Event evt, int x, int y);
public boolean mouseExit(Message msg, Event evt, int x, int y);
public boolean keyDown(Message msg, Event evt, int key);
public boolean keyUp(Message msg, Event evt, int key);
public boolean action(Message msg, Event evt, Object what);
public boolean gotFocus(Message msg, Event evt, Object what);
public boolean lostFocus(Message msg, Event evt, Object what);
- Overrides:
- handleEvent in class AttributeManager
exit
public void exit()
- Exit the application with no error code.
exit
public void exit(int errCode)
- Exit the application. Calls exit on the parent if there is a parent.
Only calls System.exit() if there is no applet.
windowDestroy
protected void windowDestroy(Message msg)
- Called when a WINDOW_DESTROY event is received by this group.
The default behavior for WINDOW_DESTROY events is to set the visible
attribute to false for the target of the event. If the target of
the event is the main window, then set this group's visible attribute
to false. If this group is the base group, then exit the
application.
addAttributeForward
protected void addAttributeForward(AttributeManager mgr)
- Adds the attribute manager to the list of forwards. When
an attribute is set and is flagged FORWARD, the value for the
attribute will be forwarded to every matching attribute manager
in the list of forwards.
addForwardedAttributes
protected void addForwardedAttributes()
- Adds a set of attributes to this group that
are suitable for forwarding to a frame, dialog or panel.
addComponentAttributes
protected void addComponentAttributes()
- Compatibility method - do not use!
addPanelAttributes
protected void addPanelAttributes()
- Compatibility method - do not use!
addFrameAttributes
protected void addFrameAttributes()
- Compatibility method - do not use!
addDialogAttributes
protected void addDialogAttributes()
- Compatibility method - do not use!
get
public Object get(String key)
- Get the value of a named attribute.
- Overrides:
- get in class AttributeManager
getOnGroup
protected Object getOnGroup(String key)
- May be overridden by sub-groups that
store attribute values themselves, and do not depend on the
group superclass to store them. This method should be overridden
instead of "get". Any attributes handled in setOnGroup where
super.setOnGroup is not called must also be handled in getOnGroup.
The default implementation of getOnGroup retrieves the value
from the attribute table.
The reason that "getOnGroup" should be overridden instead
of "get" is that "getOnGroup" is guaranteed not to be called
until the group class is initialized. This means that initRoot
will always be called before any calls to getOnGroup are made.
Also, this method is only for attributes that are defined in the
sub-groups. It is not called for forwarded attributes.
set
public void set(String key,
Object value)
- Set the value of a named attribute.
- Overrides:
- set in class AttributeManager
setOnGroup
protected void setOnGroup(String key,
Object value)
- May be overridden by sub-groups that
want notification when attributes are changed. This method
should be overridden instead of "set". Any attributes handled
in setOnGroup where super.setOnGroup is not called must also be
handled in getOnGroup.
The default implementation of setOnGroup puts the value
in the attribute table.
The reason that "setOnGroup" should be overridden instead
of "set" is that "setOnGroup" is guaranteed not to be called
until the group class is initialized. This means that initRoot
will always be called before any calls to setOnGroup are made.
During initialization, "setOnGroup" will be called for all
the group's attributes even if they have not be changed from
the default value. But for attributes that have the DEFAULT
flag set, "setOnGroup" will only be called if the value
of the attribute has changed from the default.
Also, this method is only called when attributes defined in the
sub-groups are updated. It is not called for forwarded attributes.
isBase
public boolean isBase()
- Returns true if this group is the base group.
isBaseWindow
protected boolean isBaseWindow(Window win)
- Returns true if the given window this group's base window.
hasBase
public boolean hasBase()
- Returns true if this group is either the base group or is a descendant
of the base group.
getBase
public Group getBase()
- Returns the base group.
setEnvironmentInfo
public void setEnvironmentInfo(Applet applet,
String args[])
- Sets the environment information for the group. This method should
be invoked only on the top-most group in the application. Invoking
setEnvironmentInfo and setTopLevel on a group makes it the base group.
setTopLevel
public void setTopLevel(Frame topLevel)
- Sets the top level frame for the group. This method should
be invoked only on the top most group in the application.
Invoking setEnvironmentInfo and setTopLevel on a group makes it
the base group.
setCursor
public void setCursor(int cursor)
- Sets the cursor for all of the group's frames to the given
cursor value. Calls setCursor on all the child groups.
getApplet
public Applet getApplet()
- Accessor method for the applet. Null is returned when you're not
running as an applet.
getCmdLineArgs
public String[] getCmdLineArgs()
- Accessor method for the command line arguments. Null is returned
when you're not running from the command line.
getFrame
public Frame getFrame()
- Returns the first frame found while traversing up the
group tree. If no frame is found, then the top level frame is
returned.
getTopLevel
public Frame getTopLevel()
- Accessor method for the top level frame. This will not
return null providing that the base group has been initialized
properly.
getRegistry
public Registry getRegistry()
- Accessor method for the registry. The registry is created when
the application starts.
layoutMode
public void layoutMode()
- Called when Visual Java switches to layout mode.
- Overrides:
- layoutMode in class AttributeManager
previewMode
public void previewMode()
- Called when Visual Java switches to preview mode.
- Overrides:
- previewMode in class AttributeManager
preValidate
public void preValidate()
- Called after addNotify and before the window is reshaped.
- Overrides:
- preValidate in class AttributeManager
All Packages Class Hierarchy This Package Previous Next Index