|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.station.split.SplitNode
bibliothek.gui.dock.station.split.VisibleSplitNode
bibliothek.gui.dock.station.split.Leaf
public class Leaf
Represents a leaf in the tree that is the structure of a SplitDockStation.
A leaf also represents a single Dockable which is shown
on the owner-station.
| Field Summary |
|---|
| Fields inherited from class bibliothek.gui.dock.station.split.SplitNode |
|---|
height, width, x, y |
| Constructor Summary | |
|---|---|
Leaf(SplitDockAccess access)
Creates a new leaf. |
|
Leaf(SplitDockAccess access,
long id)
Creates a new leaf. |
|
| Method Summary | ||
|---|---|---|
void |
evolve(SplitDockTree.Key key,
boolean checkValidity,
Map<Leaf,Dockable> linksToSet)
Creates or replaces children according to the values found in key. |
|
int |
getChildLocation(SplitNode child)
Gets the location of a child. |
|
DockableDisplayer |
getDisplayer()
Gets the displayer of this leaf. |
|
Node |
getDividerNode(int x,
int y)
Gets the Node whose divider area contains the point x/y. |
|
Dockable |
getDockable()
Gets the Dockable which is shown on the displayer
of this leaf. |
|
StationChildHandle |
getDockableHandle()
Gets the handle which is responsible for the current Dockable. |
|
Leaf |
getLeaf(Dockable dockable)
Gets the leaf which represents dockable. |
|
Dimension |
getMinimumSize()
Gets the minimal size of this node. |
|
PutInfo |
getPut(int x,
int y,
double factorW,
double factorH,
Dockable drop)
Determines where to drop the Dockable drop
if the mouse is at location x/y. |
|
SplitNode |
getVisible()
Gets the root of a subtree such that the root is visible and such that the is the uppermost visible node. |
|
boolean |
insert(SplitDockPathProperty property,
int depth,
Dockable dockable)
If there are elements left in property, then the next node
is to be read and the insert-method of the matching child
to be called. |
|
boolean |
insert(SplitDockPlaceholderProperty property,
Dockable dockable)
Recursively searches for a node or leaf that uses the placeholder specified by property and inserts the dockable there. |
|
boolean |
isInOverrideZone(int x,
int y,
double factorW,
double factorH)
Tells whether the coordinates x/y lie inside the override-zone of the SplitDockStation or not. |
|
boolean |
isOfUse()
Tells whether this node still has any use or can safely be removed from the tree |
|
boolean |
isVisible()
Tells whether this node (or one of this children) contains element that are visible to the user. |
|
void |
placehold(boolean keepCurrent)
Disconnects this leaf from its Dockable. |
|
void |
setChild(SplitNode child,
int location)
Adds a child to this node at a given location. |
|
void |
setDockable(Dockable dockable,
boolean fire)
Sets the element of this leaf. |
|
void |
setDockable(Dockable dockable,
boolean fire,
boolean updatePlaceholders,
boolean storePlaceholderMap)
Sets the element of this leaf. |
|
void |
setHandle(StationChildHandle handle)
Sets the element of this leaf. |
|
|
submit(SplitTreeFactory<N> factory)
Writes the contents of this node into a new tree create by factory. |
|
void |
toString(int tabs,
StringBuilder out)
Writes some contents of this node into out. |
|
void |
updateBounds(double x,
double y,
double width,
double height,
double factorW,
double factorH,
boolean components)
Updates the bounds of this node. |
|
void |
visit(SplitNodeVisitor visitor)
Invokes one of the methods of the visitor for every
child in the subtree with this as root. |
|
| Methods inherited from class bibliothek.gui.dock.station.split.VisibleSplitNode |
|---|
getCurrentBounds |
| Methods inherited from class bibliothek.gui.dock.station.split.SplitNode |
|---|
above, addPlaceholder, create, create, createLeaf, createNode, createPlaceholder, delete, getAccess, getBounds, getHeight, getId, getParent, getPlaceholderMap, getPlaceholders, getRoot, getSize, getStation, getWidth, getX, getY, hasPlaceholder, hasPlaceholders, intersection, movePlaceholderMap, relativeSidePut, removePlaceholder, removePlaceholders, replace, setParent, setPlaceholderMap, setPlaceholders, toString, treeChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Leaf(SplitDockAccess access)
access - the access to the private functions of the owning SplitDockStation
public Leaf(SplitDockAccess access,
long id)
access - the access to the private functions of the owning SplitDockStationid - the unique id of this leaf| Method Detail |
|---|
public void setHandle(StationChildHandle handle)
handle - the elementpublic Dimension getMinimumSize()
SplitNode
getMinimumSize in class SplitNodepublic int getChildLocation(SplitNode child)
SplitNode
getChildLocation in class SplitNodechild - a child of this node
child or -1 if the child is unknown
public void setChild(SplitNode child,
int location)
SplitNode
setChild in class SplitNodechild - the new childlocation - the location of the child
public void setDockable(Dockable dockable,
boolean fire)
dockable
is registered in the DockStation
dockable - the new element or null to remove the
old Dockablefire - whether to inform DockStationListeners about the
change or not. Clients should set fire = true.
public void setDockable(Dockable dockable,
boolean fire,
boolean updatePlaceholders,
boolean storePlaceholderMap)
dockable
is registered in the DockStation
dockable - the new element or null to remove the
old Dockablefire - whether to inform DockStationListeners about the
change or not. Clients should set fire = true.updatePlaceholders - if true, the placeholder list of this leaf is
automatically updatedstorePlaceholderMap - if true, the current PlaceholderMap is
replaced by the map provided by the current Dockable which is a DockStationpublic Dockable getDockable()
Dockable which is shown on the displayer
of this leaf.
public DockableDisplayer getDisplayer()
public StationChildHandle getDockableHandle()
Dockable.
nullpublic boolean isVisible()
SplitNode
isVisible in class SplitNodetrue if this node or one of its children contains
a graphical elementpublic SplitNode getVisible()
SplitNode
getVisible in class SplitNodenull, this or any
child of this nodepublic boolean isOfUse()
SplitNode
isOfUse in class SplitNodetrue if this node has to remain in the tree, false
otherwisepublic void placehold(boolean keepCurrent)
Dockable. This leaf either deletes
itself or replaces itself with a Placeholder.
keepCurrent - if true, the placeholder of the current
Dockable is added to the set of the placeholders, otherwise the placeholder
is removed.
public void updateBounds(double x,
double y,
double width,
double height,
double factorW,
double factorH,
boolean components)
SplitNodeComponent, then
the bounds of the component have to be updated as well.
updateBounds in class VisibleSplitNodex - the relative x-coordinatey - the relative y-coordinatewidth - the relative width of the nodeheight - the relative height of the nodefactorW - a factor to be multiplied with x and width
to get the size of the node in pixelfactorH - a factor to be multiplied with y and height
to get the size of the node in pixelcomponents - whether to update the bounds of Components
that are in the tree. If set to false, then all updates stay within
the tree and the graphical user interface is not changed. That can be useful
if more than one round of updates is necessary. If in doubt, set this parameter
to true.
public PutInfo getPut(int x,
int y,
double factorW,
double factorH,
Dockable drop)
SplitNodeDockable drop
if the mouse is at location x/y.
getPut in class SplitNodex - the x-coordinate of the mousey - the y-coordinate of the mousefactorW - a factor to be multiplied with the relative
x and width to get the
size in pixel.factorH - a factor to be multiplied with the relative
y and height to get the
size in pixel.drop - the Dockable which will be dropped
null if
the dockable can't be dropped
public boolean isInOverrideZone(int x,
int y,
double factorW,
double factorH)
SplitNodeSplitDockStation or not.
isInOverrideZone in class SplitNodex - the x-coordinate of the mousey - the y-coordinate of the mousefactorW - a factor to be multiplied with the relative
x and width to get the
size in pixel.factorH - a factor to be multiplied with the relative
y and height to get the
size in pixel.
true if the station should not allow child-stations
to make a drop when the mouse is at x/y
public void evolve(SplitDockTree.Key key,
boolean checkValidity,
Map<Leaf,Dockable> linksToSet)
SplitNodekey. Note that this method does not remove any Dockables
from the station. They must be removed explicitly using setDockable(Dockable, boolean)
evolve in class SplitNodekey - the key to readcheckValidity - whether to ensure that all new Dockables are
acceptable or not.linksToSet - a map that is to be filled with all new Leafs and their Dockables which are not yet set.
public boolean insert(SplitDockPlaceholderProperty property,
Dockable dockable)
SplitNodeproperty and inserts the dockable there. Also removes
the placeholder from this node.
insert in class SplitNodeproperty - the placeholder to searchdockable - the new element
true if the element was inserted, false
otherwise
public boolean insert(SplitDockPathProperty property,
int depth,
Dockable dockable)
SplitNodeproperty, then the next node
is to be read and the insert-method of the matching child
to be called.dockable has to be inserted
as new child.this and the a leaf with dockable.dockable.
insert in class SplitNodeproperty - a list of nodesdepth - the index of the node that corresponds to thisdockable - the element to insert
true if the element was inserted, false
otherwisepublic <N> N submit(SplitTreeFactory<N> factory)
SplitNodefactory.
submit in class SplitNodeN - the type of element the factory will createfactory - the factory transforming the elements of the tree into a
new form.
public Leaf getLeaf(Dockable dockable)
SplitNodedockable.
getLeaf in class SplitNodedockable - the Dockable whose leaf is searched
null if no leaf was found
public Node getDividerNode(int x,
int y)
SplitNode
getDividerNode in class SplitNodex - the x-coordinatey - the y-coordinate
null is returnedpublic void visit(SplitNodeVisitor visitor)
SplitNodevisitor for every
child in the subtree with this as root.
visit in class SplitNodevisitor - the visitor
public void toString(int tabs,
StringBuilder out)
SplitNodeout.
toString in class SplitNodetabs - the number of tabs that should be added before the text if
a new line is necessary.out - the container to write into
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||