|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.common.perspective.AbstractCDockablePerspective bibliothek.gui.dock.common.perspective.SingleCDockablePerspective bibliothek.gui.dock.common.perspective.CGridPerspective
@Todo(description="nested dockable/stations will not work due to ClassCastException") public class CGridPerspective
A representation of a CGridArea
. If this perspective is loaded with content, then all the coordinates
are in a range between 0 and 100.
Nested Class Summary | |
---|---|
class |
CGridPerspective.CommonSplitDockPerspective
The type of object that is used by a CGridPerspective as intern representation. |
Nested classes/interfaces inherited from class bibliothek.gui.dock.common.perspective.SingleCDockablePerspective |
---|
SingleCDockablePerspective.Intern |
Constructor Summary | |
---|---|
CGridPerspective(java.lang.String id,
Path typeId)
Creates a new, empty perspective. |
|
CGridPerspective(java.lang.String id,
Path typeId,
boolean workingArea)
Creates a new, empty perspective. |
Method Summary | |
---|---|
CStationPerspective |
asStation()
Gets this as station, if this is a station. |
protected CGridPerspective.CommonSplitDockPerspective |
create()
Called the first time SingleCDockablePerspective.intern() is called, this method creates
the intern representation of this SingleCDockablePerspective . |
java.lang.String |
getFactoryID()
|
PerspectiveDockable |
getMaximized()
Gets the element that is maximized. |
PlaceholderMap |
getPlaceholders()
|
SplitDockPerspective.Root |
getRoot()
Gets access to the intern tree that represents the layout of this area. |
Path |
getTypeId()
Gets the unique id denoting the type of this CStation , this should be the
exact same result as CStation.getTypeId() will return. |
PerspectiveSplitDockGrid |
grid()
Allows access to the internal representation of this area as grid. |
void |
gridAdd(double x,
double y,
double width,
double height,
CDockablePerspective... dockables)
Adds dockables at location x/y with size width/height to an internal
list of pending commands to execute. |
void |
gridClear()
Deletes all pending commands that were collected by the grid* methods. |
void |
gridDeploy()
Removes all children of this area, then executes pending commands that add dockables at specified locations. |
void |
gridHorizontal(double x1,
double x2,
double y)
Adds a constraint to the algorithm that is executed by gridDeploy() , the constraint tells that
there should be a horizontal divider from x1/y to x2/y . |
void |
gridPlaceholder(double x,
double y,
double width,
double height,
CDockablePerspective... dockables)
Adds dockables as placeholder at location x/y with size width/height to
an internal list of pending commands to execute. |
void |
gridPrepare()
Reads the contents of the root and resets the grid to reflect that
root. |
void |
gridSelect(double x,
double y,
double width,
double height,
CDockablePerspective selection)
Using location x/y and size width/height as key, this method set the selection
in a group of dockables. |
void |
gridVertical(double x,
double y1,
double y2)
Adds a constraint to the algorithm that is executed by gridDeploy() , the constraint tells that
there should be a vertical divider from x/y1 to x/y2 . |
CGridPerspective.CommonSplitDockPerspective |
intern()
Gets the internal representation for this element. |
boolean |
isAutoDeploy()
Tells whether gridDeploy() will be called automatically before accessing the tree of Dockable s. |
boolean |
isWorkingArea()
Tells whether this station will act as a working area . |
void |
maximize(CDockablePerspective dockable)
Maximized dockable on this station. |
void |
maximize(PerspectiveDockable dockable)
Maximized dockable on this station. |
protected void |
maybeDeploy()
Calls gridDeploy() , but only if isAutoDeploy() returns true and
if the grid was accessed. |
void |
setAutoDeploy(boolean autoDeploy)
Sets whether gridDeploy() is called automatically by this area before accessing the tree
of Dockable s. |
void |
setPerspective(CPerspective perspective)
Informs this station by which perspective it is used. |
void |
setPlaceholders(PlaceholderMap placeholders)
|
void |
setWorkingArea(boolean workingArea)
Sets whether this station should be regarded as a working area or not. |
Methods inherited from class bibliothek.gui.dock.common.perspective.SingleCDockablePerspective |
---|
asDockable, getUniqueId |
Methods inherited from class bibliothek.gui.dock.common.perspective.AbstractCDockablePerspective |
---|
getLocationHistory, getParent, getWorkingArea, setWorkingArea |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.common.perspective.CStationPerspective |
---|
getUniqueId |
Methods inherited from interface bibliothek.gui.dock.common.perspective.CElementPerspective |
---|
asDockable |
Constructor Detail |
---|
public CGridPerspective(java.lang.String id, Path typeId)
id
- the unique identifier of this perspectivetypeId
- the type of this station, can be null
public CGridPerspective(java.lang.String id, Path typeId, boolean workingArea)
id
- the unique identifier of this perspectivetypeId
- the type of this station, can be null
workingArea
- whether this station should be treated as working area
or not.Method Detail |
---|
public boolean isWorkingArea()
CStationPerspective
working area
.
isWorkingArea
in interface CStationPerspective
public Path getTypeId()
CStationPerspective
CStation
, this should be the
exact same result as CStation.getTypeId()
will return.
getTypeId
in interface CStationPerspective
null
public void setWorkingArea(boolean workingArea)
working area
or not. This
setting is not stored, it is the clients responsibility to make sure that the matching CStation
is
or is not a working area.
workingArea
- whether this station is to be treated like a working area or notprotected CGridPerspective.CommonSplitDockPerspective create()
SingleCDockablePerspective
SingleCDockablePerspective.intern()
is called, this method creates
the intern representation of this SingleCDockablePerspective
.
create
in class SingleCDockablePerspective
this
public CGridPerspective.CommonSplitDockPerspective intern()
CElementPerspective
CElementPerspective.asDockable()
returns a non-null
value, then intern().asDockable()
must not
return null
either.CElementPerspective.asStation()
returns a non-null
value, then intern().asStation()
must not
return null
either.
intern
in interface CElementPerspective
intern
in class SingleCDockablePerspective
public void setPerspective(CPerspective perspective)
CStationPerspective
setPerspective
in interface CStationPerspective
perspective
- the perspective that uses this station or null
protected void maybeDeploy()
gridDeploy()
, but only if isAutoDeploy()
returns true
and
if the grid
was accessed.
public void gridAdd(double x, double y, double width, double height, CDockablePerspective... dockables)
dockables
at location x/y
with size width/height
to an internal
list of pending commands to execute. This method does not change the layout of this area, but a call
to gridDeploy()
will.
x
- the x-coordinate of dockables
, can be any numbery
- the y-coordinate of dockables
, can be any numberwidth
- the width of dockables
, can be any number greater than 0height
- the height of dockables
, can be any number greater than 0dockables
- the elements to add, should contain at least one itemgridClear()
,
gridDeploy()
public void gridPlaceholder(double x, double y, double width, double height, CDockablePerspective... dockables)
dockables
as placeholder at location x/y
with size width/height
to
an internal list of pending commands to execute. This method does not change the layout of this area, but a call
to gridDeploy()
will.
x
- the x-coordinate of dockables
, can be any numbery
- the y-coordinate of dockables
, can be any numberwidth
- the width of dockables
, can be any number greater than 0height
- the height of dockables
, can be any number greater than 0dockables
- the elements whose placeholders to add, should contain at least one item
java.lang.IllegalArgumentException
- if not all dockables have a placeholdergridClear()
,
gridDeploy()
public void gridSelect(double x, double y, double width, double height, CDockablePerspective selection)
x/y
and size width/height
as key, this method set the selection
in a group of dockables. This method does not change the layout directly, but a call to gridDeploy()
will.
x
- the x-coordinate of dockables
, can be any numbery
- the y-coordinate of dockables
, can be any numberwidth
- the width of dockables
, can be any number greater than 0height
- the height of dockables
, can be any number greater than 0selection
- the element that should be selected, must already be in the groupgridClear()
,
gridDeploy()
public void gridHorizontal(double x1, double x2, double y)
gridDeploy()
, the constraint tells that
there should be a horizontal divider from x1/y
to x2/y
.
x1
- the beginning of the dividerx2
- the end of the dividery
- the vertical position of the dividerpublic void gridVertical(double x, double y1, double y2)
gridDeploy()
, the constraint tells that
there should be a vertical divider from x/y1
to x/y2
.
x
- the horizontal position of the dividery1
- the beginning of the dividery2
- the end of the dividerpublic void gridClear()
grid*
methods. A call to this
method does not change the current layout of this area, but a call to gridDeploy()
will.
gridDeploy()
public void gridDeploy()
grid*
methods
and merges them into a layout that fits the locations and sizes the client specified as good as possible.isAutoDeploy()
returns true
, then this method is called automatically before storing
the layout of this area.
isAutoDeploy()
,
gridAdd(double, double, double, double, CDockablePerspective...)
,
gridSelect(double, double, double, double, CDockablePerspective)
,
gridHorizontal(double, double, double)
,
gridVertical(double, double, double)
,
gridClear()
public void gridPrepare()
root
and resets the grid
to reflect that
root. This method is called once during construction of this perspective, it can later be called
to reset the perspective.
public PerspectiveSplitDockGrid grid()
gridDeploy()
will change the layout however.
gridDeploy()
public void setAutoDeploy(boolean autoDeploy)
gridDeploy()
is called automatically by this area before accessing the tree
of Dockable
s. The default value for this property is true
.gridDeploy()
if this property is false
in order to execute commands
that were collected with the grid*
methods.
autoDeploy
- whether gridDeploy()
is called automaticallypublic boolean isAutoDeploy()
gridDeploy()
will be called automatically before accessing the tree of Dockable
s.
setAutoDeploy(boolean)
public SplitDockPerspective.Root getRoot()
automatic deployment
is active, gridDeploy()
can be triggered by invoking this method.
null
if this area does not have any childrenpublic void maximize(CDockablePerspective dockable)
dockable
on this station. Please read about the side effects in maximize(PerspectiveDockable)
.
dockable
- the element to maximize, not null
public void maximize(PerspectiveDockable dockable)
dockable
on this station. Note that maximized elements will be de-maximized by a
CControl
unless CControl.setRevertToBasicModes(boolean)
was switched to false
.
A call to this method has several side effects that must be cared for:
gridDeploy()
is called.dockable
is not this station, then dockable
is removed from the parent and added to this. The location dockable
has on its
parent is stored and can be used during un-maximization.dockable
has no parent, then it is added to this station. No location
information is stored. This is no problem for CDockablePerspective
as they usually have a
history of legal locations associated, but for any other dockable the missing location can lead to
strange behavior when un-maximizing.
dockable
- the element to maximizepublic PerspectiveDockable getMaximized()
null
public CStationPerspective asStation()
CElementPerspective
this
as station, if this is a station.
asStation
in interface CElementPerspective
asStation
in class SingleCDockablePerspective
this
or null
public java.lang.String getFactoryID()
public PlaceholderMap getPlaceholders()
public void setPlaceholders(PlaceholderMap placeholders)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |