public class FloatingGroup extends Object implements Cloneable, Serializable
Dockables
within a floating DockingFrame
.
The FloatingGroup
tracks the current screen bounds of the DockingFrame
and
the ID for each Dockable
within the group. The FloatingGroup
may be persisted to external storage and recreated across JVM sessions. This allows the
DockingFrame
to be recreated and displayed with the previous screen bounds and all
of the Dockables
contained within the group to be restored to their previous state
within the DockingFrame
.
FloatingGroup
allows for a floating Dockable
to be closed and then later restored to its original
floating state within the same JVM session. The currently installed FloatManager
may
use FloatingGroups
to determine which visible DockingFrame
into which to
restore a closed Dockable
, or to create and display a new DockingFrame
to the same end on an as-needed basis.Constructor and Description |
---|
FloatingGroup(String groupName)
Creates a new
FloatingGroup with the specified groupName . |
Modifier and Type | Method and Description |
---|---|
void |
addDockable(String dockableId) |
Object |
clone() |
void |
destroy() |
Rectangle |
getBounds()
Returns the cached screen bounds of the
DockingFrame associated with this
FloatingGroup . |
int |
getDockableCount() |
Iterator |
getDockableIterator() |
DockingFrame |
getFrame()
Returns a reference to the
DockingFrame associated with this FloatingGroup . |
String |
getName()
Returns the name of this
FloatingGroup . |
void |
removeDockable(String dockableId) |
void |
setBounds(Rectangle rect)
Sets the screen bounds representing the
DockingFrame associated with this
FloatingGroup . |
void |
setFrame(DockingFrame frame)
Sets a reference to the
DockingFrame associated with this FloatingGroup . |
public FloatingGroup(String groupName)
FloatingGroup
with the specified groupName
. This
group may be looked up from the currently installed FloatManager
using this
groupName
. groupName
should be unique to this group.groupName
- the unique identifier for this FloatingGroup
FloatManager.getGroup(String)
public Rectangle getBounds()
DockingFrame
associated with this
FloatingGroup
. If no screen bounds have been previously cached, this method
returns null
. Otherwise, this method returns a clone of the cached
Rectangle
so that its fields may not be directly modified.DockingFrame
associated with this
FloatingGroup
.setBounds(Rectangle)
public void setBounds(Rectangle rect)
DockingFrame
associated with this
FloatingGroup
. If rect
is null
, then the cached
screen bounds are set to null
. Otherwise, the field values are copied from the
specified Rectangle
into the cached screen bounds rather than updating the
internal object reference. This is done to prevent the cached screen bounds' fields from
subsequently being modified directly.rect
- the new screen bounds representing the DockingFrame
associated with this
FloatingGroup
.getBounds()
public String getName()
FloatingGroup
. This value may be used as a key to lookup
this FloatingGroup
from the currently installed FloatManager
by
invoking its getGroup(String groupName)
method.FloatingGroup
.FloatingGroup(String)
,
FloatManager.getGroup(String)
public DockingFrame getFrame()
DockingFrame
associated with this FloatingGroup
.
This method allows easy lookup to establish an association with a Dockable
and
a DockingFrame
. When attempting to find an existing DockingFrame
into which
to restore a hidden Dockable
, the Dockable's
FloatingGroup
may be looked up by the currently installed FloatManager
by calling its
getGroup(Dockable dockable)
method. Once the group has been resolved, the actual
DockingFrame
reference may be obtained by this method and the Dockable
may be restored to the screen. Or, this method may return null
and the
DockingFrame
will have to be recreated before the Dockable
can be restored.DockingFrame
associated with this FloatingGroup
.setFrame(DockingFrame)
,
FloatManager.getGroup(Dockable)
public void setFrame(DockingFrame frame)
DockingFrame
associated with this FloatingGroup
.
This method allows help enable easy lookup to establish an association with a Dockable
and
a DockingFrame
. When attempting to find an existing DockingFrame
into which
to restore a hidden Dockable
, the Dockable's
FloatingGroup
may be looked up by the currently installed FloatManager
by calling its
getGroup(Dockable dockable)
method. Once the group has been resolved, the actual
DockingFrame
reference may be obtained by calling getFrame()
and the
Dockable
may be restored to the screen. Or, getFrame()
may return
null
and the DockingFrame
will have to be recreated before the
Dockable
can be restored. This method establishes the association between
FloatingGroup
and DockingFrame
.frame
- the DockingFrame
to be associated with this FloatingGroup
.getFrame()
,
FloatManager.getGroup(Dockable)
public void addDockable(String dockableId)
public Iterator getDockableIterator()
public void removeDockable(String dockableId)
public int getDockableCount()
public void destroy()