public final class LayoutNode extends Object implements Comparable<LayoutNode>
Module: layout-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>layout-api</artifactId> </dependency>
Constructor and Description |
---|
LayoutNode(View<CyNode> nodeView,
int index,
CyRow row)
The main constructor for a LayoutNode.
|
Modifier and Type | Method and Description |
---|---|
void |
addNeighbor(LayoutNode v)
Convenience function to keep track of neighbors of this node.
|
int |
compareTo(LayoutNode nodeView) |
void |
decrement(double x,
double y)
Decrement the location of this node by (x,y).
|
void |
decrement(double x,
double y,
double z)
Decrement the location of this node by (x,y,z).
|
void |
decrementDisp(double x,
double y)
Decrement the displacement recorded for this node by (x,y).
|
void |
decrementDisp(double x,
double y,
double z)
Decrement the displacement recorded for this node by (x,y,z).
|
double |
distance(double uX,
double uY)
Return the Euclidean distance (in 2D) between this node and a location.
|
double |
distance(LayoutNode otherNode)
Return the Euclidean distance (in 2D) between this node and another node.
|
double |
distance3D(double uX,
double uY,
double uZ)
Return the Euclidean distance (in 3D) between this node and a location.
|
double |
distance3D(LayoutNode otherNode)
Return the Euclidean distance (in 3D) between this node and another node.
|
int |
getDegree()
Return the node's degree (i.e.
|
double |
getDepth()
Return the height of this node
|
double |
getHeight()
Return the height of this node
|
String |
getIdentifier()
Return the node's identifier.
|
int |
getIndex()
Returns the index of this LayoutNode.
|
List<LayoutNode> |
getNeighbors()
Convenience function to return the list of neighbors (connected nodes) of this node.
|
CyNode |
getNode()
Accessor function to return the Node associated with
this LayoutNode.
|
View<CyNode> |
getNodeView()
Accessor function to return the View
|
CyRow |
getRow()
Accessor function to return the CyRow associated with
this LayoutNode.
|
double |
getWidth()
Return the width of this node
|
double |
getX()
Return the current X value for this LayoutNode.
|
double |
getXDisp()
Return the current X displacement value for this LayoutNode.
|
double |
getY()
Return the current Y value for this LayoutNode.
|
double |
getYDisp()
Return the current Y displacement value for this LayoutNode.
|
double |
getZ()
Return the current Z value for this LayoutNode.
|
double |
getZDisp()
Return the current Z displacement value for this LayoutNode.
|
void |
increment(double x,
double y)
Increment the location of this node by (x,y).
|
void |
increment(double x,
double y,
double z)
Increment the location of this node by (x,y,z).
|
void |
incrementDisp(double x,
double y)
Increment the displacement recorded for this node by (x,y).
|
void |
incrementDisp(double x,
double y,
double z)
Increment the displacement recorded for this node by (x,y,z).
|
boolean |
isLocked()
Returns "true" if this node is locked, false otherwise.
|
void |
lock()
Register this node as being "locked".
|
void |
moveToLocation()
Move the node to its current x,y coordinate (ignores the value of the z coordinate).
|
void |
moveToLocation3D()
Move the node to its current x,y,z coordinate.
|
String |
printDisp()
Return a string representation of the node's displacement
|
String |
printLocation()
Return a string representation of the node's location
|
void |
setDisp(double x,
double y)
Set the 2D displacement of this LayoutNode.
|
void |
setDisp(double x,
double y,
double z)
Set the 3D displacement of this LayoutNode.
|
void |
setLocation(double x,
double y)
Set the 2D location of this LayoutNode.
|
void |
setLocation(double x,
double y,
double z)
Set the 3D location of this LayoutNode.
|
void |
setX(double x)
Set the X location of this LayoutNode.
|
void |
setY(double y)
Set the Y location of this LayoutNode.
|
void |
setZ(double z)
Set the Z location of this LayoutNode.
|
String |
toString()
Return a string representation of the node
|
void |
unLock()
Register this node as being "unlocked".
|
public CyNode getNode()
public CyRow getRow()
public View<CyNode> getNodeView()
public void setLocation(double x, double y)
x
- Double representing the new X coordinate of this nodey
- Double representing the new Y coordinate of this nodepublic void setLocation(double x, double y, double z)
x
- Double representing the new X coordinate of this nodey
- Double representing the new Y coordinate of this nodez
- Double representing the new Z coordinate of this nodepublic void setX(double x)
x
- Double representing the new X coordinate of this nodepublic void setY(double y)
y
- Double representing the new Y coordinate of this nodepublic void setZ(double z)
z
- Double representing the new Z coordinate of this nodepublic void setDisp(double x, double y)
x
- Double representing the amount to offset in the x directiony
- Double representing the amount to offset in the y directionpublic void setDisp(double x, double y, double z)
x
- Double representing the amount to offset in the x directiony
- Double representing the amount to offset in the y directionz
- Double representing the amount to offset in the y directionpublic void addNeighbor(LayoutNode v)
v
- LayoutNode that is a neighbor of this LayoutNodepublic List<LayoutNode> getNeighbors()
public int getIndex()
LayoutPartition
public void lock()
public void unLock()
public boolean isLocked()
public void incrementDisp(double x, double y)
x
- the additional amount to displace in the x directiony
- the additional amount to displace in the y directionpublic void incrementDisp(double x, double y, double z)
x
- the additional amount to displace in the x directiony
- the additional amount to displace in the y directionz
- the additional amount to displace in the z directionpublic void increment(double x, double y)
x
- the amount to move in the x directiony
- the amount to move in the y directionpublic void increment(double x, double y, double z)
x
- the amount to move in the x directiony
- the amount to move in the y directionz
- the amount to move in the z directionpublic void decrementDisp(double x, double y)
x
- the additional amount to displace in the -x directiony
- the additional amount to displace in the -y directionpublic void decrementDisp(double x, double y, double z)
x
- the additional amount to displace in the -x directiony
- the additional amount to displace in the -y directionz
- the additional amount to displace in the -z directionpublic void decrement(double x, double y)
x
- the amount to move in the -x directiony
- the amount to move in the -y directionpublic void decrement(double x, double y, double z)
x
- the amount to move in the -x directiony
- the amount to move in the -y directionz
- the amount to move in the -z directionpublic double getX()
public double getY()
public double getZ()
public double getXDisp()
public double getYDisp()
public double getZDisp()
public double getWidth()
public double getHeight()
public double getDepth()
public double distance(LayoutNode otherNode)
otherNode
- the node to measure the distance topublic double distance3D(LayoutNode otherNode)
otherNode
- the node to measure the distance topublic double distance(double uX, double uY)
uX
- the X location to measure the distance touY
- the Y location to measure the distance topublic double distance3D(double uX, double uY, double uZ)
uX
- the X location to measure the distance touY
- the Y location to measure the distance touZ
- the Z location to measure the distance topublic void moveToLocation()
public void moveToLocation3D()
public String getIdentifier()
public int getDegree()
public String toString()
public String printDisp()
public String printLocation()
public int compareTo(LayoutNode nodeView)
compareTo
in interface Comparable<LayoutNode>
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.