protected class StickMagnetGraph.DefaultNode extends Object implements StickMagnetGraph.Node
StickMagnetGraph.Node| Constructor and Description |
|---|
DefaultNode(int index,
ScreenDockWindow window)
Creates a new node.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public DefaultNode(int index,
ScreenDockWindow window)
index - the location of this node in the array of all nodeswindow - the window represented by this nodepublic void visit(StickMagnetGraph.Visitor visitor)
StickMagnetGraph.Nodevisit 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.Nodemark in interface StickMagnetGraph.Nodepublic boolean isMarked()
StickMagnetGraph.NodeStickMagnetGraph.Node.mark().isMarked in interface StickMagnetGraph.NodeStickMagnetGraph.Node.mark().public void unmark()
StickMagnetGraph.NodeStickMagnetGraph.Node.mark().unmark in interface StickMagnetGraph.Nodepublic ScreenDockWindow getWindow()
StickMagnetGraph.NodegetWindow 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 searchtrue 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 nodewindow lies or nullpublic StickMagnetGraph.DefaultEdge[] getEdges()
StickMagnetGraph.NodegetEdges in interface StickMagnetGraph.NodeCopyright © 2017 Docking Frames. All rights reserved.