public class StackDockPerspective extends Object implements PerspectiveDockable, PerspectiveStation
StackDockStation in a Perspective.| Constructor and Description |
|---|
StackDockPerspective()
Creates a new empty
StackDockPerspective. |
StackDockPerspective(PerspectiveDockable[] children,
PerspectiveDockable selection)
Creates a new perspective.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(PerspectiveDockable dockable)
Adds
dockable at the end of the list of dockables. |
void |
addPlaceholder(Path placeholder)
Adds
placeholder at the end of the list of dockables. |
void |
addPlaceholder(PerspectiveDockable dockable)
Adds a placeholder for
dockable at the end of the list of dockables. |
PerspectiveDockable |
asDockable()
Returns the representation of
this as PerspectiveDockable. |
PerspectiveStation |
asStation()
Returns the representation of
this as PerspectiveStation |
boolean |
canRead(PlaceholderMap placeholders)
Tells whether
placeholders has the right format for this perspective to read it. |
PerspectiveDockable |
getDockable(int index)
Gets the index'th child of this station.
|
int |
getDockableCount()
Gets the number of children this station has.
|
DockableProperty |
getDockableProperty(PerspectiveDockable child,
PerspectiveDockable target)
Gets precise information about the location of a child of this station.
|
String |
getFactoryID()
Gets the identifier of the
DockFactory that will be able to
understand the layout information this element generates. |
int |
getItemCount()
Gets the number of children, this includes
dockables and placeholders. |
PerspectiveStation |
getParent()
Gets the parent
DockStation of this Dockable. |
Path |
getPlaceholder()
Gets the placeholder which is associated with this
Dockable. |
PlaceholderMap |
getPlaceholders()
Converts the contents of this station into a map of placeholders.
|
PerspectiveDockable |
getSelection()
Gets the currently selected element.
|
int |
indexOf(Path placeholder)
Gets the location where
placeholder would be found if it were a
dockable. |
int |
indexOf(PerspectiveDockable dockable)
Gets the location of
dockable. |
void |
insert(int index,
PerspectiveDockable dockable)
Inserts
dockable at location index. |
void |
insertPlaceholder(int index,
Path placeholder,
PlaceholderList.Level level)
Adds
placeholder at location index. |
void |
insertPlaceholder(int index,
PerspectiveDockable dockable)
Adds a placeholder for
dockable at location index. |
void |
read(PlaceholderMap placeholders,
Map<Integer,PerspectiveDockable> children,
int selected)
Reads the contents of
map and replaces any content of this perspective. |
PerspectiveDockable |
remove(int index)
Removes the
index'th child of this station. |
boolean |
remove(PerspectiveDockable dockable)
Removes
dockable from this station. |
void |
replace(PerspectiveDockable oldDockable,
PerspectiveDockable newDockable)
Replaces
oldDockable by newDockable. |
void |
setParent(PerspectiveStation parent)
Sets the parent
DockStation of this Dockable. |
void |
setPlaceholders(PlaceholderMap placeholders)
Informs this station of the content that it should show
|
void |
setSelection(PerspectiveDockable dockable)
Changes the selected element of this station.
|
PlaceholderMap |
toMap(Map<PerspectiveDockable,Integer> children)
Converts this perspective into a
PlaceholderMap. |
public StackDockPerspective()
StackDockPerspective.public StackDockPerspective(PerspectiveDockable[] children, PerspectiveDockable selection)
children - the children of the new stationselection - the current selection, may be nullpublic void read(PlaceholderMap placeholders, Map<Integer,PerspectiveDockable> children, int selected)
map and replaces any content of this perspective.placeholders - the map to convertchildren - the children of this stationselected - the selected child or -1public boolean canRead(PlaceholderMap placeholders)
placeholders has the right format for this perspective to read it.placeholders - the map whose format needs checkingtrue if a call to setPlaceholders(PlaceholderMap) will not result in an exceptionpublic void setPlaceholders(PlaceholderMap placeholders)
PerspectiveStationsetPlaceholders in interface PerspectiveStationplaceholders - a map that was earlier created by PerspectiveStation.getPlaceholders()public PlaceholderMap getPlaceholders()
PerspectiveStationgetPlaceholders in interface PerspectiveStationpublic PlaceholderMap toMap(Map<PerspectiveDockable,Integer> children)
PlaceholderMap.children - identifiers for the children of this stationpublic void addPlaceholder(PerspectiveDockable dockable)
dockable at the end of the list of dockables.dockable - the element for which a placeholder should be addedpublic void addPlaceholder(Path placeholder)
placeholder at the end of the list of dockables.placeholder - the new placeholderpublic void insertPlaceholder(int index,
PerspectiveDockable dockable)
dockable at location index.index - the location where the placeholder goesdockable - the element for which a placeholder should be leftpublic void insertPlaceholder(int index,
Path placeholder,
PlaceholderList.Level level)
placeholder at location index.index - the location where the placeholder goesplaceholder - the new placeholderlevel - at which level index should be evaluated, not nullpublic void add(PerspectiveDockable dockable)
dockable at the end of the list of dockables.dockable - the element to addpublic void insert(int index,
PerspectiveDockable dockable)
dockable at location index.index - the locationdockable - the new elementpublic int indexOf(PerspectiveDockable dockable)
dockable.dockable - the dockable whose location is searchedpublic int indexOf(Path placeholder)
placeholder would be found if it were a
dockable.placeholder - the placeholder to searchplaceholder or -1public boolean remove(PerspectiveDockable dockable)
dockable from this station.remove in interface PerspectiveStationdockable - the element to removetrue if dockable was removed, false
otherwisepublic PerspectiveDockable remove(int index)
index'th child of this station. If the child is the
selected element, then the selected
element is set to null.index - the location of the childpublic void replace(PerspectiveDockable oldDockable, PerspectiveDockable newDockable)
PerspectiveStationoldDockable by newDockable. This method should behave the same way
is if oldDockable was removed and newDockable added at the same location.replace in interface PerspectiveStationoldDockable - some child of this stationnewDockable - the replacement for oldDockablepublic void setSelection(PerspectiveDockable dockable)
dockable - the selected element, can be nullpublic PerspectiveDockable getSelection()
nullpublic DockableProperty getDockableProperty(PerspectiveDockable child, PerspectiveDockable target)
PerspectiveStationgetDockableProperty in interface PerspectiveStationchild - a child of this station, this child's location is askedtarget - an optional hint telling for which dockable the location information
will be used, can be null. This hint can be used to find a placeholder
that should be part of the result.public void setParent(PerspectiveStation parent)
PerspectiveDockableDockStation of this Dockable.setParent in interface PerspectiveDockableparent - the new parent, can be nullpublic PerspectiveStation getParent()
PerspectiveDockableDockStation of this Dockable.getParent in interface PerspectiveDockablenullpublic Path getPlaceholder()
PerspectiveDockableDockable.getPlaceholder in interface PerspectiveDockablenullpublic PerspectiveDockable asDockable()
PerspectiveElementthis as PerspectiveDockable.asDockable in interface PerspectiveElementasDockable in interface PlaceholderListItem<PerspectiveDockable>this, a representation of this or nullpublic PerspectiveStation asStation()
PerspectiveElementthis as PerspectiveStationasStation in interface PerspectiveElementthis, a representation of this or nullpublic String getFactoryID()
PerspectiveElementDockFactory that will be able to
understand the layout information this element generates.getFactoryID in interface PerspectiveElementpublic PerspectiveDockable getDockable(int index)
PerspectiveStationgetDockable in interface PerspectiveStationindex - the index of a childnullpublic int getDockableCount()
PerspectiveStationgetDockableCount in interface PerspectiveStationpublic int getItemCount()
dockables and placeholders.Copyright © 2017 Docking Frames. All rights reserved.