Class CExternalizePerspective
java.lang.Object
bibliothek.gui.dock.common.perspective.CExternalizePerspective
- All Implemented Interfaces:
CElementPerspective,CStationPerspective
A representation of a
CExternalizeArea.- Author:
- Benjamin Sigg
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis type of object is used by theCExternalizePerspectiveas intern representation. -
Constructor Summary
ConstructorsConstructorDescriptionCExternalizePerspective(String id, Path typeId) Creates a new, empty perspective. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(CDockablePerspective dockable, int x, int y, int width, int height) Addsdockableat locationx/ywith sizewidth/heightto this area.voidadd(CDockablePerspective dockable, int x, int y, int width, int height, boolean fullscreen) Addsdockableat locationx/ywith sizewidth/heightto this area.voidadd(CDockablePerspective dockable, Rectangle bounds) Addsdockablewidth boundariesboundsto this area.voidadd(CDockablePerspective dockable, Rectangle bounds, boolean fullscreen) Addsdockablewidth boundariesboundsto this area.voidaddPlaceholder(CDockablePerspective dockable, int x, int y, int width, int height) Adds a placeholder fordockableand all its children to this area.voidaddPlaceholder(CDockablePerspective dockable, Rectangle bounds) Adds a placeholder fordockableand all its children to this area.voidaddPlaceholder(Path placeholder, int x, int y, int width, int height) Addsplaceholderto this area.voidaddPlaceholder(Path placeholder, Rectangle bounds) Addsplaceholderto this area.Getsthisas dockable, if this is a dockable.Getsthisas station, if this is a station.Gets the perspective which presents this station.Gets the unique id denoting the type of thisCStation, this should be the exact same result asCStation.getTypeId()will return.Gets the unique identifier of this station.getWindow(CDockablePerspective dockable) Gets an object that stores all the properties that are associated withdockable.intindexOf(CDockablePerspective dockable) Gets the location ofdockable.intern()Gets the internal representation for this element.
IfCElementPerspective.asDockable()returns a non-nullvalue, thenintern().asDockable()must not returnnulleither.
IfCElementPerspective.asStation()returns a non-nullvalue, thenintern().asStation()must not returnnulleither.booleanisRoot()Tells whether this is a root station or not.booleanTells whether this station will act as aworking area.remove(int index) Removes theindex'th dockable of this area.booleanremove(CDockablePerspective dockable) Removesdockablefrom this area.voidsetPerspective(CPerspective perspective) Informs this station by which perspective it is used.voidsetPlaceholders(PlaceholderMap placeholders) voidsetRoot(boolean root) Sets the root station flag.
-
Constructor Details
-
CExternalizePerspective
Creates a new, empty perspective.- Parameters:
id- the unique identifier of this perspectivetypeId- the type of this station, can benull
-
-
Method Details
-
getUniqueId
Description copied from interface:CStationPerspectiveGets the unique identifier of this station.- Specified by:
getUniqueIdin interfaceCStationPerspective- Returns:
- the unique identifier
-
getTypeId
Description copied from interface:CStationPerspectiveGets the unique id denoting the type of thisCStation, this should be the exact same result asCStation.getTypeId()will return.- Specified by:
getTypeIdin interfaceCStationPerspective- Returns:
- the type id, can be
null
-
isRoot
public boolean isRoot()Description copied from interface:CStationPerspectiveTells whether this is a root station or not.- Specified by:
isRootin interfaceCStationPerspective- Returns:
- the root flag
- See Also:
-
setRoot
public void setRoot(boolean root) Description copied from interface:CStationPerspectiveSets the root station flag. Setting flag is equivalent of setting therootparameter when callingCControl.addStation(bibliothek.gui.dock.common.CStation, boolean). The location of aDockableis always relative to its nearest root-station parent.
Please note that the root-flag set by callingCControl.addStation(bibliothek.gui.dock.common.CStation, boolean)will never be overridden by the flag set in the perspective.- Specified by:
setRootin interfaceCStationPerspective- Parameters:
root-
-
setPerspective
Description copied from interface:CStationPerspectiveInforms this station by which perspective it is used.- Specified by:
setPerspectivein interfaceCStationPerspective- Parameters:
perspective- the perspective that uses this station ornull
-
getPerspective
Description copied from interface:CStationPerspectiveGets the perspective which presents this station.- Specified by:
getPerspectivein interfaceCStationPerspective- Returns:
- the owner of this station, can be
null
-
add
Addsdockablewidth boundariesboundsto this area.- Parameters:
dockable- the element to add, notnullbounds- the boundaries ofdockable
-
add
Addsdockableat locationx/ywith sizewidth/heightto this area.- Parameters:
dockable- the element to add, notnullx- the x-coordinate on the screeny- the y-coordinate on the screenwidth- the width of the windowheight- the height of the window
-
add
Addsdockablewidth boundariesboundsto this area.- Parameters:
dockable- the element to add, notnullbounds- the boundaries ofdockablefullscreen- whetherdockableshould be extended to fullscreen mode
-
add
public void add(CDockablePerspective dockable, int x, int y, int width, int height, boolean fullscreen) Addsdockableat locationx/ywith sizewidth/heightto this area.- Parameters:
dockable- the element to add, notnullx- the x-coordinate on the screeny- the y-coordinate on the screenwidth- the width of the windowheight- the height of the windowfullscreen- whetherdockableshould be extended to fullscreen mode
-
addPlaceholder
Adds a placeholder fordockableand all its children to this area.- Parameters:
dockable- the element whose placeholder should be insertedbounds- the location and size ofdockable
-
addPlaceholder
Adds a placeholder fordockableand all its children to this area.- Parameters:
dockable- the element whose placeholder should be insertedx- the x-coordinate on the screeny- the y-coordinate on the screenwidth- the width of the windowheight- the height of the window
-
addPlaceholder
Addsplaceholderto this area.- Parameters:
placeholder- the placeholder to add, notnullbounds- the location and size ofplaceholder
-
addPlaceholder
Addsplaceholderto this area.- Parameters:
placeholder- the placeholder to add, notnullx- the x-coordinate on the screeny- the y-coordinate on the screenwidth- the width of the windowheight- the height of the window
-
getWindow
Gets an object that stores all the properties that are associated withdockable.- Parameters:
dockable- the element whose window is searched- Returns:
- the window,
nullifdockableis not known to this area
-
remove
Removesdockablefrom this area.- Parameters:
dockable- the element to remove- Returns:
trueifdockablewas found and removed,falseotherwise.
-
remove
Removes theindex'th dockable of this area.- Parameters:
index- the index of a child of this area- Returns:
- the element that was removed,
nullif the element is not aCDockablePerspective
-
indexOf
Gets the location ofdockable.- Parameters:
dockable- some child of this area- Returns:
- the location or -1 if not found
-
intern
Description copied from interface:CElementPerspectiveGets the internal representation for this element.
IfCElementPerspective.asDockable()returns a non-nullvalue, thenintern().asDockable()must not returnnulleither.
IfCElementPerspective.asStation()returns a non-nullvalue, thenintern().asStation()must not returnnulleither.- Specified by:
internin interfaceCElementPerspective- Returns:
- the internal representation
-
asDockable
Description copied from interface:CElementPerspectiveGetsthisas dockable, if this is a dockable.- Specified by:
asDockablein interfaceCElementPerspective- Returns:
thisornull
-
asStation
Description copied from interface:CElementPerspectiveGetsthisas station, if this is a station.- Specified by:
asStationin interfaceCElementPerspective- Returns:
thisornull
-
getFactoryID
-
getPlaceholders
-
setPlaceholders
-
isWorkingArea
public boolean isWorkingArea()Description copied from interface:CStationPerspectiveTells whether this station will act as aworking area.- Specified by:
isWorkingAreain interfaceCStationPerspective- Returns:
- whether this station acts as working area
-