|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.station.split.SplitNode bibliothek.gui.dock.station.split.VisibleSplitNode bibliothek.gui.dock.station.split.Root
public class Root
The root of the tree that represents the internal structure of a
SplitDockStation
.
Field Summary |
---|
Fields inherited from class bibliothek.gui.dock.station.split.SplitNode |
---|
height, width, x, y |
Constructor Summary | |
---|---|
Root(SplitDockAccess access)
Creates a new root. |
|
Root(SplitDockAccess access,
long id)
Creates a new root. |
Method Summary | ||
---|---|---|
void |
evolve(SplitDockTree.Key key,
boolean checkValidity,
java.util.Map<Leaf,Dockable> linksToSet)
Creates or replaces children according to the values found in key . |
|
java.awt.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. |
|
java.awt.Dimension |
getMinimumSize()
Gets the minimal size of this node. |
|
PutInfo |
getPut(int x,
int y,
Dockable drop)
Gets the preferred operation when dragging the Dockable
drop to the location x/y . |
|
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. |
|
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 |
setBaseBounds(java.awt.Rectangle baseBounds)
Sets the result of getBaseBounds() , a value of null allows
this Root to calculate the base bounds anew. |
|
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. |
|
|
submit(SplitTreeFactory<N> factory)
Writes the contents of this node into a new tree create by factory . |
|
void |
toString(int tabs,
java.lang.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. |
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, ensureIdUnique, ensureIdUniqueAsync, getAccess, getBounds, getHeight, getId, getParent, getPlaceholderMap, getPlaceholders, getSize, getStation, getTotalChildrenCount, getWidth, getX, getY, hasPlaceholder, hasPlaceholders, intersection, movePlaceholderMap, relativeSidePut, removePlaceholder, removePlaceholders, replace, setParent, setPlaceholderMap, setPlaceholders, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Root(SplitDockAccess access)
access
- the access to internal methods of the
SplitDockStation
, must not be null
public Root(SplitDockAccess access, long id)
access
- the access to internal methods of the
SplitDockStation
, must not be null
id
- the unique identifier of this rootMethod Detail |
---|
protected void treeChanged()
SplitNode
treeChanged
in class SplitNode
public 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 null
public SplitNode getChild()
null
setChild(SplitNode)
public int getChildLocation(SplitNode child)
SplitNode
getChildLocation
in class SplitNode
child
- a child of this node
child
or -1 if the child is unknownpublic void setChild(SplitNode child, int location)
SplitNode
setChild
in class SplitNode
child
- the new childlocation
- the location of the childpublic int getMaxChildrenCount()
SplitNode
getMaxChildrenCount
in class SplitNode
public SplitNode getChild(int location)
SplitNode
location
.
getChild
in class SplitNode
location
- the location of the child
null
if the location is invalid or if there is no child at the locationpublic Root getRoot()
SplitNode
getRoot
in class SplitNode
null
public boolean isOfUse()
SplitNode
isOfUse
in class SplitNode
true
if this node has to remain in the tree, false
otherwisepublic java.awt.Dimension getMinimumSize()
SplitNode
getMinimumSize
in class SplitNode
public double getWidthFactor()
public double getHeightFactor()
public void setBaseBounds(java.awt.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 java.awt.Rectangle getBaseBounds()
Component
setBaseBounds(Rectangle)
public PutInfo getPut(int x, int y, Dockable drop)
Dockable
drop
to the location x/y
.
x
- the x-coordinate of the mousey
- the y-coordinate of the mousedrop
- the Dockable which will be dropped
null
public boolean isInOverrideZone(int x, int y)
x
- the x-coordinate of the mousey
- the y-coordinate of the mouse
true
if this station should have priority
over all other stations when the mouse is in x/y.public void evolve(SplitDockTree.Key key, boolean checkValidity, java.util.Map<Leaf,Dockable> linksToSet)
SplitNode
key
. Note that this method does not remove any Dockable
s
from the station. They must be removed explicitly using Leaf.setDockable(Dockable, bibliothek.gui.dock.DockHierarchyLock.Token)
evolve
in class SplitNode
key
- the key to readcheckValidity
- whether to ensure that all new Dockable
s are
acceptable or not.linksToSet
- a map that is to be filled with all new Leaf
s and their Dockable
s which are not yet set.public boolean insert(SplitDockPlaceholderProperty property, Dockable dockable)
SplitNode
property
and inserts the dockable
there. Also removes
the placeholder from this node.
insert
in class SplitNode
property
- the placeholder to searchdockable
- the new element
true
if the element was inserted, false
otherwisepublic boolean insert(SplitDockPathProperty property, int depth, Dockable dockable)
SplitNode
property
, 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 SplitNode
property
- 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)
SplitNode
factory
.
submit
in class SplitNode
N
- the type of element the factory
will createfactory
- the factory transforming the elements of the tree into a
new form.
public boolean isVisible()
SplitNode
isVisible
in class SplitNode
true
if this node or one of its children contains
a graphical elementpublic SplitNode getVisible()
SplitNode
getVisible
in class SplitNode
null
, this
or any
child of this nodepublic void updateBounds(double x, double y, double width, double height, double factorW, double factorH, boolean components)
SplitNode
Component
, then
the bounds of the component have to be updated as well.
updateBounds
in class VisibleSplitNode
x
- 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 Component
s
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)
SplitNode
Dockable
drop
if the mouse is at location x/y.
getPut
in class SplitNode
x
- 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 droppedpublic boolean isInOverrideZone(int x, int y, double factorW, double factorH)
SplitNode
SplitDockStation
or not.
isInOverrideZone
in class SplitNode
x
- 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)
SplitNode
dockable
.
getLeaf
in class SplitNode
dockable
- the Dockable whose leaf is searched
null
if no leaf was foundpublic Node getDividerNode(int x, int y)
SplitNode
getDividerNode
in class SplitNode
x
- the x-coordinatey
- the y-coordinate
null
is returnedpublic void visit(SplitNodeVisitor visitor)
SplitNode
visitor
for every
child in the subtree with this as root.
visit
in class SplitNode
visitor
- the visitorpublic void toString(int tabs, java.lang.StringBuilder out)
SplitNode
out
.
toString
in class SplitNode
tabs
- 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 |