|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.common.perspective.AbstractCDockablePerspective
bibliothek.gui.dock.common.perspective.SingleCDockablePerspective
bibliothek.gui.dock.common.perspective.CGridPerspective
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(String id)
Creates a new, empty perspective. |
|
CGridPerspective(String id,
Path typeId)
Creates a new, empty perspective. |
|
CGridPerspective(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. |
String |
getFactoryID()
|
PerspectiveDockable |
getMaximized()
Gets the element that is maximized. |
CPerspective |
getPerspective()
Gets the perspective which presents this station. |
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. In particular this method analyzes all the commands that were generated by calls to the grid* methods
and merges them into a layout that fits the locations and sizes the client specified as good as possible.If isAutoDeploy() returns true, then this method is called automatically before storing
the layout of this area.This method will silently return if the list of pending commands was never accessed directly or indirectly by the client. |
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. If CElementPerspective.asDockable() returns a non-null value, then intern().asDockable() must not
return null either.If CElementPerspective.asStation() returns a non-null value, then intern().asStation() must not
return null either. |
boolean |
isAutoDeploy()
Tells whether gridDeploy() will be called automatically before accessing the tree of Dockables. |
boolean |
isRoot()
Tells whether this is a root station or not. |
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 Dockables. |
void |
setPerspective(CPerspective perspective)
Informs this station by which perspective it is used. |
void |
setPlaceholders(PlaceholderMap placeholders)
|
void |
setRoot(boolean root)
Sets the root station flag. |
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, remove, 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(String id)
id - the unique identifier of this perspective
public CGridPerspective(String id,
Path typeId)
id - the unique identifier of this perspectivetypeId - the type of this station, can be null
public CGridPerspective(String id,
Path typeId,
boolean workingArea)
id - the unique identifier of this perspectivetypeId - the type of this station, can be nullworkingArea - whether this station should be treated as working area or not.| Method Detail |
|---|
public boolean isWorkingArea()
CStationPerspectiveworking area.
isWorkingArea in interface CStationPerspectivepublic Path getTypeId()
CStationPerspectiveCStation, this should be the
exact same result as CStation.getTypeId() will return.
getTypeId in interface CStationPerspectivenullpublic boolean isRoot()
CStationPerspective
isRoot in interface CStationPerspectiveCStationPerspective.setRoot(boolean)public void setRoot(boolean root)
CStationPerspectiveroot parameter when calling
CControl.addStation(bibliothek.gui.dock.common.CStation, boolean). The location of a Dockable is
always relative to its nearest root-station parent.CControl.addStation(bibliothek.gui.dock.common.CStation, boolean) will
never be overriden by the flag set in the perspective.
setRoot in interface CStationPerspectivepublic 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()
SingleCDockablePerspectiveSingleCDockablePerspective.intern() is called, this method creates
the intern representation of this SingleCDockablePerspective.
create in class SingleCDockablePerspectivethispublic CGridPerspective.CommonSplitDockPerspective intern()
CElementPerspectiveCElementPerspective.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 CElementPerspectiveintern in class SingleCDockablePerspectivepublic void setPerspective(CPerspective perspective)
CStationPerspective
setPerspective in interface CStationPerspectiveperspective - the perspective that uses this station or nullpublic CPerspective getPerspective()
CStationPerspective
getPerspective in interface CStationPerspectivenullprotected 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
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 divider
public 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 Dockables. 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 Dockables.
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 nullpublic 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()
nullpublic CStationPerspective asStation()
CElementPerspectivethis as station, if this is a station.
asStation in interface CElementPerspectiveasStation in class SingleCDockablePerspectivethis or nullpublic 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 | |||||||||