|
||||||||||
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.Root
public class Root
The root of the tree that represents the internal structure of a
SplitDockStation
.
Field Summary | |
---|---|
private SplitNode |
child
the single child of this root |
private java.awt.Insets |
insets
space around the root that is left free |
Fields inherited from class bibliothek.gui.dock.station.split.SplitNode |
---|
height, width, x, y |
Constructor Summary | |
---|---|
Root(SplitDockAccess access)
Creates a new root. |
Method Summary | |
---|---|
void |
evolve(SplitDockTree.Key key)
Creates or replaces children according to the values found in key . |
SplitNode |
getChild()
Gets the child of this root. |
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. |
java.awt.Insets |
getInsets()
Gets the insets which will be free from any Component . |
Leaf |
getLeaf(Dockable dockable)
Gets the leaf which represents dockable . |
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. |
protected Root |
getRoot()
Gets the root of the tree in which this node is |
double |
getWidthFactor()
Gets the factor which has to be multiplied with relative x coordinates and widths to get their size in pixel. |
SplitNode |
read(java.util.Map<java.lang.Integer,Dockable> children,
java.io.DataInputStream in)
Reads an earlier written node from the stream in . |
void |
setChild(SplitNode child)
Sets the child of this root. |
SplitDockTree.Key |
submit(SplitDockTree tree)
Writes the contents of this node into tree . |
void |
updateBounds()
Updates all locations and sizes of the Components
which are in the structure of this tree. |
void |
updateBounds(double x,
double y,
double width,
double height,
double factorW,
double factorH)
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. |
void |
write(java.util.Map<Dockable,java.lang.Integer> children,
java.io.DataOutputStream out)
Writes the structure of the subtree with this as root into out . |
Methods inherited from class bibliothek.gui.dock.station.split.SplitNode |
---|
above, create, getAccess, getBounds, getHeight, getParent, getSize, getWidth, getX, getY, intersection, readChild, relativeSidePut, setParent, writeChild |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private SplitNode child
private java.awt.Insets insets
Constructor Detail |
---|
public Root(SplitDockAccess access)
access
- the access to internal methods of the
SplitDockStation
, must not be null
Method Detail |
---|
public void setChild(SplitNode child)
child
- the child of the root, can be null
public SplitNode getChild()
null
setChild(SplitNode)
protected Root getRoot()
SplitNode
getRoot
in class SplitNode
public java.awt.Dimension getMinimumSize()
SplitNode
getMinimumSize
in class SplitNode
public void updateBounds()
Components
which are in the structure of this tree.
public double getWidthFactor()
public double getHeightFactor()
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 java.awt.Insets getInsets()
Component
.
public void evolve(SplitDockTree.Key key)
SplitNode
key
.
evolve
in class SplitNode
key
- the key to readpublic SplitDockTree.Key submit(SplitDockTree tree)
SplitNode
tree
.
submit
in class SplitNode
tree
- the tree to write into
public void updateBounds(double x, double y, double width, double height, double factorW, double factorH)
SplitNode
Component
, then
the bounds of the component have to be updated as well.
updateBounds
in class SplitNode
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 pixelpublic 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 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 write(java.util.Map<Dockable,java.lang.Integer> children, java.io.DataOutputStream out) throws java.io.IOException
SplitNode
out
.
write
in class SplitNode
children
- a map that contains for every Dockable
an id. This id will be written into out
to represent
the Dockable
.out
- the stream to fill
java.io.IOException
- if the stream throws an exceptionpublic SplitNode read(java.util.Map<java.lang.Integer,Dockable> children, java.io.DataInputStream in) throws java.io.IOException
SplitNode
in
.
read
in class SplitNode
children
- a map of substitutions for ids that are found in the stream.in
- the source
java.io.IOException
- if the stream throws an exceptionSplitNode.write(Map, DataOutputStream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |