|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.common.CGrid
public class CGrid
A CGrid
is a mechanism to layout a set of CDockable
on
a SplitDockStation
like the one used in the center of the
CContentArea
or on the CWorkingArea
. CGrid
s
also can register new CDockable
s to a CControl
.
Usage:
A CGrid
consists of a set of entries
where each
entry
consists of a set of CDockable
s and a rectangle
(position= x/y
, size=width/height
). The rectangle
tells where the CDockable
s and how big they are compared to the
other entries
.
A client first fills a CGrid
with such entries. Then the client calls
CGridArea.deploy(CGrid)
, CWorkingArea.deploy(CGrid)
or
toTree()
. This triggers the CGrid
to convert its entries
into a tree of Dockable
s. This tree can then be given to a
SplitDockStation
. The CGrid
can be trashed after it created
the tree - changes to the grid will not be forwarded to the tree.
If the CGrid
was created using the constructor CGrid(CControl)
,
then the method CControl.addDockable(SingleCDockable)
or CControl.addDockable(MultipleCDockable)
is called for any new CDockable
.
Constructor Summary | |
---|---|
CGrid()
Deprecated. Use CGrid(CControl) with an argument of null instead. This
method may be removed in a future release. |
|
CGrid(CControl control)
Creates a new grid. |
Method Summary | |
---|---|
void |
add(double x,
double y,
double width,
double height,
CDockable... dockables)
Adds a new set of CDockable s to this grid. |
void |
addHorizontalDivider(double x1,
double x2,
double y)
Informs this grid about a horizontal divider that should be inserted into the layout. |
void |
addMulti(double x,
double y,
double width,
double height,
String... identifiers)
Adds some placeholders for MultipleCDockable s to this CGrid . |
void |
addPlaceholders(double x,
double y,
double width,
double height,
Path... placeholders)
Adds some placeholders to this CGrid . |
void |
addSingle(double x,
double y,
double width,
double height,
String... identifiers)
Adds some placeholders for SingleCDockable s to this CGrid . |
void |
addVerticalDivider(double x,
double y1,
double y2)
Informs this grid about a vertical divider that should be inserted into the layout. |
void |
select(double x,
double y,
double width,
double height,
CDockable dockable)
Marks dockable as beeing selected in the stack that
has the boundaries of x, y, width, height . |
DockableSplitDockTree |
toTree()
Creates and returns a tree which contains the CommonDockable s
of this CGrid . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public CGrid()
CGrid(CControl)
with an argument of null
instead. This
method may be removed in a future release.
public CGrid(CControl control)
CDockable
s is not null
, then new CDockable
s
will be registered at control
. While a value of null
is valid,
for most clients a non-null
value will be the better choice. Please note that
some methods will not work if control
is null
.
control
- the control where this grid should register new CDockable
s,
should not be null
for most clientsMethod Detail |
---|
public DockableSplitDockTree toTree()
CommonDockable
s
of this CGrid
. The branches of the tree are put in a way, that
the boundaries of the CommonDockable
s are respected as good
as possible.
public void add(double x, double y, double width, double height, CDockable... dockables)
CDockable
s to this grid. The CDockable
s
are also added to the CControl
of this CGrid
.
x
- the x-coordinate of the dockablesy
- the y-coordinate of the dockableswidth
- the width of the dockablesheight
- the height of the dockablesdockables
- a list of SingleCDockable
s and MultipleCDockable
s.public void addSingle(double x, double y, double width, double height, String... identifiers)
SingleCDockable
s to this CGrid
. This method does not make any checks concerning
the validity of the placeholders, the placeholders will however be checked once the CGrid
is deployed.CPlaceholderStrategy
is installed and use the method CPlaceholderStrategy.getSingleDockablePlaceholder(String)
CDockable
s, if
order is important then clients must use a CControlPerspective
to create the layout.
to convert the identifiers into placeholders.
x
- the x-coordinate of the dockablesy
- the y-coordinate of the dockableswidth
- the width of the dockablesheight
- the height of the dockablesidentifiers
- the identifiers that would be returned by SingleCDockable.getUniqueId()
IllegalStateException
- if this CGrid
does not have access to the a CControl
public void addMulti(double x, double y, double width, double height, String... identifiers)
MultipleCDockable
s to this CGrid
. This method does not make any checks concerning
the validity of the placeholders, the placeholders will however be checked once the CGrid
is deployed.CPlaceholderStrategy
is installed and use the method CPlaceholderStrategy.getMultipleDockablePlaceholder(String)
to convert the identifiers into placeholders.CDockable
s, if
order is important then clients must use a CControlPerspective
to create the layout.
x
- the x-coordinate of the dockablesy
- the y-coordinate of the dockableswidth
- the width of the dockablesheight
- the height of the dockablesidentifiers
- the identifiers that are used when calling CControl.addDockable(String, MultipleCDockable)
IllegalStateException
- if this CGrid
does not have access to the a CControl
public void addPlaceholders(double x, double y, double width, double height, Path... placeholders)
CGrid
. This method does not make any checks concerning
the validity of the placeholders, the placeholders will however be checked once the CGrid
is deployed.CDockable
s, if
order is important then clients must use a CControlPerspective
to create the layout.
x
- the x-coordinate of the dockablesy
- the y-coordinate of the dockableswidth
- the width of the dockablesheight
- the height of the dockablesplaceholders
- the list of new placeholderspublic void select(double x, double y, double width, double height, CDockable dockable)
dockable
as beeing selected in the stack that
has the boundaries of x, y, width, height
.
x
- the x coordinate of the stacky
- the y coordinate of the stackwidth
- the width of the stackheight
- the height of the stackdockable
- the element to select, not null
IllegalArgumentException
- if dockable
is not registered at location x/y/width/height
public void addHorizontalDivider(double x1, double x2, double y)
x1
- the first x coordinate of the dividerx2
- the second x coordinate of the dividery
- the y coordinate of the dividerpublic void addVerticalDivider(double x, double y1, double y2)
x
- the x coordinate of the dividery1
- the first y coordinate of the dividery2
- the second y coordinate of the divider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |