|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.station.screen.magnet.StickMagnetGraph.DefaultNode
protected class StickMagnetGraph.DefaultNode
The default implementation of StickMagnetGraph.Node
| Constructor Summary | |
|---|---|
StickMagnetGraph.DefaultNode(int index,
ScreenDockWindow window)
Creates a new node. |
|
| Method Summary | |
|---|---|
void |
add(MagnetRequest.Side side,
StickMagnetGraph.DefaultNode depending)
Creates a new edge between this and depending. |
void |
add(StickMagnetGraph.DefaultEdge edge)
|
boolean |
contains(StickMagnetGraph.DefaultNode node)
Checks whether there is an edge from this node to node. |
void |
doVisit(StickMagnetGraph.Visitor visitor)
Visits this node and all its children, sets the mark flag. |
StickMagnetGraphConstraint |
getConstraints()
Gets the constraints telling how this node has to be modified. |
StickMagnetGraph.DefaultEdge[] |
getEdges()
Gets a list of all edges that either start or end at this node. |
int |
getIndex()
Gets the location of this node in the array of all nodes. |
MagnetRequest.Side |
getNeighbor(ScreenDockWindow window)
Tells whether window is a neighbor of this node and
depends on this node, and if so tells on which side of this node
window lies. |
int |
getRootDistance()
Gets the distance of this node to the root node. |
ScreenDockWindow |
getWindow()
Gest the window which is described by this node. |
boolean |
isMarked()
Tells whether a flag was set by StickMagnetGraph.Node.mark(). |
void |
mark()
Marks this node with a flag. |
void |
unmark()
Unmarks this node from the flag that was set by StickMagnetGraph.Node.mark(). |
void |
visit(StickMagnetGraph.Visitor visitor)
Visits this node and all its children. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StickMagnetGraph.DefaultNode(int index,
ScreenDockWindow window)
index - the location of this node in the array of all nodeswindow - the window represented by this node| Method Detail |
|---|
public void visit(StickMagnetGraph.Visitor visitor)
StickMagnetGraph.Node
visit in interface StickMagnetGraph.Nodevisitor - the visitor used to traverse the nodepublic StickMagnetGraphConstraint getConstraints()
getConstraints in interface StickMagnetGraph.Nodepublic int getRootDistance()
public void doVisit(StickMagnetGraph.Visitor visitor)
mark flag.
visitor - the visitor that is calledpublic void mark()
StickMagnetGraph.Node
mark in interface StickMagnetGraph.Nodepublic boolean isMarked()
StickMagnetGraph.NodeStickMagnetGraph.Node.mark().
isMarked in interface StickMagnetGraph.Nodepublic void unmark()
StickMagnetGraph.NodeStickMagnetGraph.Node.mark().
unmark in interface StickMagnetGraph.Nodepublic ScreenDockWindow getWindow()
StickMagnetGraph.Node
getWindow in interface StickMagnetGraph.Nodepublic int getIndex()
public void add(MagnetRequest.Side side,
StickMagnetGraph.DefaultNode depending)
this and depending. If there is already
an edge from either node to the other, then nothing happens.
side - the side at which depending liesdepending - the node to which a new edge may be createdpublic void add(StickMagnetGraph.DefaultEdge edge)
public boolean contains(StickMagnetGraph.DefaultNode node)
this node to node.
node - the node to search
true if there is a directed edgepublic MagnetRequest.Side getNeighbor(ScreenDockWindow window)
StickMagnetGraph.Nodewindow is a neighbor of this node and
depends on this node, and if so tells on which side of this node
window lies.
getNeighbor in interface StickMagnetGraph.Nodewindow - a window that might be a neighbor of this node
window lies or nullpublic StickMagnetGraph.DefaultEdge[] getEdges()
StickMagnetGraph.Node
getEdges in interface StickMagnetGraph.Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||