public class Root extends SpanSplitNode
SplitDockStation.| Constructor and Description |
|---|
Root(SplitDockAccess access)
Creates a new root.
|
Root(SplitDockAccess access,
long id)
Creates a new root.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
aside(AsideRequest request)
Inserts a new placeholder at this node.
|
boolean |
aside(SplitDockPathProperty property,
int index,
AsideRequest request)
Inserts a new placeholder at location
property. |
void |
evolve(SplitDockTree.Key key,
boolean checkValidity,
Map<Leaf,Dockable> linksToSet)
Creates or replaces children according to the values found in
key. |
Rectangle |
getBaseBounds()
Gets the location and size of the area which can be occupied by the children.
|
SplitNode |
getChild()
Gets the child of this root.
|
SplitNode |
getChild(int location)
Gets the child at
location. |
int |
getChildLocation(SplitNode child)
Gets the location of a child.
|
Node |
getDividerNode(int x,
int y)
Gets the Node whose divider area contains the point x/y.
|
double |
getHeightFactor()
Gets the factor which has to be multiplied with a relative y coordinate
or height to get their size in pixel.
|
Leaf |
getLeaf(Dockable dockable)
Gets the leaf which represents
dockable. |
int |
getMaxChildrenCount()
Gets the maximal number of children this node can have.
|
Dimension |
getMinimumSize()
Gets the minimal size of this node.
|
Dimension |
getPreferredSize()
Gets the preferred size of this node.
|
PutInfo |
getPut(int x,
int y,
Dockable drop)
|
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. |
Root |
getRoot()
Gets the root of the tree in which this node is
|
SplitNode |
getVisible()
Gets the root of a subtree such that the root is visible and such that the
is the uppermost visible node.
|
double |
getWidthFactor()
Gets the factor which has to be multiplied with relative x coordinates
and widths to get their size in pixel.
|
boolean |
hasTreeChanged()
Tells whether the tree below this root has changed (children have
been added or removed) since the boundaries of this root were
last updated.
|
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.If there are no children, then dockable has to be inserted
as new child.Otherwise this element is to be replaced by a node containing this and the a leaf with dockable.Subclasses may wary this scheme in order to optimize or to find a better place for the dockable. |
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)
Tells whether the location x/y is in the override zone.
|
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 |
onSpanResize()
Called if a
Span of this node changed its size |
void |
setBaseBounds(Rectangle baseBounds)
Sets the result of
getBaseBounds(), a value of null allows
this Root to calculate the base bounds anew. |
void |
setBounds(double x,
double y,
double width,
double height,
double factorW,
double factorH,
boolean updateComponentBounds)
Updates the bounds of this node.
|
void |
setChild(SplitNode child)
Sets the child of this root.
|
void |
setChild(SplitNode child,
int location)
Adds a child to this node at a given location.
|
<N> N |
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. |
protected void |
treeChanged()
Called if a child of this node changed.
|
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. |
createSpans, getSpansgetCurrentBoundsabove, addPlaceholder, create, create, createLeaf, createNode, createPlaceholder, delete, ensureIdUnique, ensureIdUniqueAsync, getAccess, getBounds, getHeight, getId, getParent, getPlaceholderMap, getPlaceholderNode, getPlaceholders, getSize, getStation, getTotalChildrenCount, getWidth, getX, getY, hasPlaceholder, hasPlaceholders, intersection, movePlaceholderMap, relativeSidePut, removePlaceholder, removePlaceholders, replace, setParent, setPlaceholderMap, setPlaceholders, split, split, toStringpublic Root(SplitDockAccess access)
access - the access to internal methods of the
SplitDockStation, must not be nullpublic Root(SplitDockAccess access, long id)
access - the access to internal methods of the
SplitDockStation, must not be nullid - the unique identifier of this rootprotected void treeChanged()
SplitNodetreeChanged in class SplitNodepublic boolean hasTreeChanged()
true if the tree changedpublic void setChild(SplitNode child)
null does not delete
the child from the system, only a call to SplitNode.delete(boolean)
does that.child - the child of the root, can be nullpublic SplitNode getChild()
nullsetChild(SplitNode)public int getChildLocation(SplitNode child)
SplitNodegetChildLocation in class SplitNodechild - a child of this nodechild or -1 if the child is unknownpublic void setChild(SplitNode child, int location)
SplitNodepublic int getMaxChildrenCount()
SplitNodegetMaxChildrenCount in class SplitNodepublic SplitNode getChild(int location)
SplitNodelocation.public Root getRoot()
SplitNodepublic boolean isOfUse()
SplitNodepublic Dimension getMinimumSize()
SplitNodegetMinimumSize in class SplitNodepublic Dimension getPreferredSize()
SplitNodegetPreferredSize in class SplitNodepublic double getWidthFactor()
public double getHeightFactor()
public void setBaseBounds(Rectangle baseBounds)
getBaseBounds(), a value of null allows
this Root to calculate the base bounds anew.baseBounds - the result of setBaseBounds(Rectangle) or null
if the boundaries should be calculated automaticallypublic Rectangle getBaseBounds()
ComponentsetBaseBounds(Rectangle)public PutInfo getPut(int x, int y, Dockable drop)
x - the x-coordinate of the mousey - the y-coordinate of the mousedrop - the Dockable which will be droppednullpublic boolean isInOverrideZone(int x,
int y)
x - the x-coordinate of the mousey - the y-coordinate of the mousetrue if this station should have priority
over all other stations when the mouse is in x/y.public boolean aside(AsideRequest request)
SplitNodepublic boolean aside(SplitDockPathProperty property, int index, AsideRequest request)
SplitNodeproperty.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 Leaf.setDockable(Dockable, bibliothek.gui.dock.DockHierarchyLock.Token)public boolean insert(SplitDockPlaceholderProperty property, Dockable dockable)
SplitNodeproperty and inserts the dockable there. Also removes
the placeholder from this node.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.public <N> N submit(SplitTreeFactory<N> factory)
SplitNodefactory.public boolean isVisible()
SplitNodepublic SplitNode getVisible()
SplitNodegetVisible in class SplitNodenull, this or any
child of this nodepublic 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 on
the children of this node.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.SplitNode.setBounds(double, double, double, double, double, double, boolean)public void setBounds(double x,
double y,
double width,
double height,
double factorW,
double factorH,
boolean updateComponentBounds)
SplitNodeComponent, then
the bounds of the component have to be updated as well. This method is not recursive, it does not
call getBounds on the children of this node.setBounds in class SplitNodex - 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 pixelupdateComponentBounds - 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.SplitNode.updateBounds(double, double, double, double, double, double, boolean)public void onSpanResize()
SpanSplitNodeSpan of this node changed its sizeonSpanResize in class SpanSplitNodepublic 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 droppednull if
the dockable can't be droppedpublic 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/ypublic Leaf getLeaf(Dockable dockable)
SplitNodedockable.public Node getDividerNode(int x, int y)
SplitNodegetDividerNode in class SplitNodex - the x-coordinatey - the y-coordinatenull is returnedpublic void visit(SplitNodeVisitor visitor)
SplitNodevisitor for every
child in the subtree with this as root.public void toString(int tabs,
StringBuilder out)
SplitNodeout.Copyright © 2017 Docking Frames. All rights reserved.