|
||||||||||
| 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.Node
public class Node
A Node represents an element in the tree of a SplitDockStation.
Every node has two children. The areas of the children are separated by
a "divider", whose position can be changed.
| Field Summary |
|---|
| Fields inherited from class bibliothek.gui.dock.station.split.SplitNode |
|---|
height, width, x, y |
| Constructor Summary | |
|---|---|
Node(SplitDockAccess access)
Constructs a new node. |
|
Node(SplitDockAccess access,
long id)
Constructs a new node. |
|
Node(SplitDockAccess access,
SplitNode left,
SplitNode right)
Constructs a new node. |
|
Node(SplitDockAccess access,
SplitNode left,
SplitNode right,
long id)
Constructs a new node. |
|
Node(SplitDockAccess access,
SplitNode left,
SplitNode right,
SplitDockStation.Orientation orientation)
Constructs a new node. |
|
Node(SplitDockAccess access,
SplitNode left,
SplitNode right,
SplitDockStation.Orientation orientation,
long id)
Constructs a new node. |
|
| Method Summary | ||
|---|---|---|
boolean |
aside(AsideRequest request)
Inserts a new placeholder at this node. |
|
boolean |
aside(SplitDockPathProperty property,
int depth,
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. |
|
double |
getActualDivider()
Gets the divider as it is actually seen by the user. |
|
SplitNode |
getChild(int location)
Gets the child at location. |
|
int |
getChildLocation(SplitNode child)
Gets the location of a child. |
|
double |
getDivider()
Gets the location of the divider. |
|
double |
getDividerAt(int x,
int y)
Calculates the value which the divider must have on condition that the point x/y lies inside the divider bounds. |
|
Rectangle |
getDividerBounds(double divider,
Rectangle bounds)
Calculates the location and the size of the area which represents the divider. |
|
Node |
getDividerNode(int x,
int y)
Gets the Node whose divider area contains the point x/y. |
|
Leaf |
getLeaf(Dockable dockable)
Gets the leaf which represents dockable. |
|
SplitNode |
getLeft()
Gets the left child of this node. |
|
int |
getMaxChildrenCount()
Gets the maximal number of children this node can have. |
|
Dimension |
getMinimumSize()
Gets the minimal size of this node. |
|
SplitDockStation.Orientation |
getOrientation()
Gets the orientation of this divideable. |
|
Dimension |
getPreferredSize()
Gets the preferred 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 |
getRight()
Gets the right child of this node. |
|
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.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,
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 |
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,
int location)
Adds a child to this node at a given location. |
|
void |
setDivider(double divider)
Sets the location of the divider. |
|
void |
setLeft(SplitNode left)
Sets the left child of this node. |
|
void |
setOrientation(SplitDockStation.Orientation orientation)
Changes the orientation of this node. |
|
void |
setRight(SplitNode right)
Sets the right child of this node. |
|
|
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. |
|
double |
validateDivider(double divider)
Validates the new location divider. |
|
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, getPlaceholderNode, getPlaceholders, getRoot, getSize, getStation, getTotalChildrenCount, getWidth, getX, getY, hasPlaceholder, hasPlaceholders, intersection, movePlaceholderMap, relativeSidePut, removePlaceholder, removePlaceholders, replace, setParent, setPlaceholderMap, setPlaceholders, split, split, toString, treeChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Node(SplitDockAccess access,
SplitNode left,
SplitNode right,
SplitDockStation.Orientation orientation)
access - the access to the owner-station of this node.left - the left childright - the right childorientation - how the children are aligned
public Node(SplitDockAccess access,
SplitNode left,
SplitNode right,
SplitDockStation.Orientation orientation,
long id)
access - the access to the owner-station of this node.left - the left childright - the right childorientation - how the children are alignedid - the unique id of this node, can be -1
public Node(SplitDockAccess access,
SplitNode left,
SplitNode right)
access - the access to the owner-station of this nodeleft - the left childright - the right child
public Node(SplitDockAccess access,
SplitNode left,
SplitNode right,
long id)
access - the access to the owner-station of this nodeleft - the left childright - the right childid - the unique id of this nodepublic Node(SplitDockAccess access)
access - the access to the owner-station of this node
public Node(SplitDockAccess access,
long id)
access - the access to the owner-station of this nodeid - the unique id of this node| Method Detail |
|---|
public void setLeft(SplitNode left)
null does not delete
the child from the system, only a call to SplitNode.delete(boolean)
does that.
left - the left child or nullpublic SplitNode getLeft()
setLeft(SplitNode)public void setRight(SplitNode right)
null does not delete
the child from the system, only a call to SplitNode.delete(boolean)
does that.
right - the right childpublic SplitNode getRight()
setRight(SplitNode)public 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 childpublic int getMaxChildrenCount()
SplitNode
getMaxChildrenCount in class SplitNodepublic SplitNode getChild(int location)
SplitNodelocation.
getChild in class SplitNodelocation - the location of the child
null if the location is invalid or if there is no child at the locationpublic SplitDockStation.Orientation getOrientation()
DivideableSplitDockStation.Orientation.VERTICAL, one child
will be at the top and the other at the bottom.
getOrientation in interface Divideablepublic void setOrientation(SplitDockStation.Orientation orientation)
orientation - the new orientationpublic Dimension getMinimumSize()
SplitNode
getMinimumSize in class SplitNodepublic Dimension getPreferredSize()
SplitNode
getPreferredSize in class SplitNodepublic void setDivider(double divider)
Divideabledivider.
setDivider in interface Divideabledivider - the dividierpublic double getDivider()
Divideable
getDivider in interface DivideableDivideable.setDivider(double)public double getActualDivider()
Divideabledivider as it is actually seen by the user. Usually this is equivalent
to validateDivider( getDivider() ), subclasses may however consider other restrictions.
getActualDivider in interface Divideablepublic double validateDivider(double divider)
Divideabledivider.
validateDivider in interface Divideabledivider - the new divider
dividerpublic 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
otherwise
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 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 Rectangle getDividerBounds(double divider,
Rectangle bounds)
Divideable
getDividerBounds in interface Divideabledivider - The location of the divider, should be between 0 and 1.bounds - A rectangle in which the result will be stored. It can be null
bounds or a new Rectangle if bounds
was null
public double getDividerAt(int x,
int y)
Divideablex/y lies inside the divider bounds.
getDividerAt in interface Divideablex - x-coordinate of the point in pixely - y-coordinate of the point in pixel
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 Leaf.setDockable(Dockable, bibliothek.gui.dock.DockHierarchyLock.Token)
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
otherwisepublic boolean aside(AsideRequest request)
SplitNode
aside in class SplitNoderequest - more information about the request, including the placeholder to add
true if the placeholder was added, false if it could
not be added
public boolean aside(SplitDockPathProperty property,
int depth,
AsideRequest request)
SplitNodeproperty.
aside in class SplitNodeproperty - the path to the placeholderdepth - the current segment, represents this noderequest - more information about the request, including the placeholder to add
true if the placeholder was added, false if it could
not be added
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 | |||||||||