|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cytoscape.view.layout.LayoutPartition
public final class LayoutPartition
The LayoutPartition class contains all of the information about a single graph partition, where a partition is defined as all nodes in a graph that connect only to each other. This class also provides static methods that are used to partition an existing graph.
Constructor Summary | |
---|---|
LayoutPartition(CyNetworkView networkView,
Collection<View<CyNode>> nodeSet,
EdgeWeighter edgeWeighter)
LayoutPartition: use this constructor to create a LayoutPartition that includes the entire network. |
|
LayoutPartition(int nodeCount,
int edgeCount)
LayoutPartition: use this constructor to create an empty LayoutPartition. |
Method Summary | |
---|---|
protected void |
addEdge(CyEdge edge,
CyRow row)
Add an edge to this partition assuming that the source and target nodes are not yet known. |
protected void |
addEdge(CyEdge edge,
LayoutNode v1,
LayoutNode v2,
CyRow row)
Add an edge to this partition assuming that the source and target nodes are known. |
protected void |
addNode(CyNetwork network,
View<CyNode> nv,
boolean locked)
Add a node to this partition. |
void |
calculateEdgeWeights()
Calculate and set the edge weights. |
int |
edgeCount()
Return the number of edges in this partition |
Iterator<LayoutEdge> |
edgeIterator()
Return an iterator over all of the LayoutEdges in this partition |
void |
fixEdges()
Convenience routine to update the source and target for all of the edges in a partition. |
LayoutPoint |
getAverageLocation()
Return the average location of the nodes in this partition |
List<LayoutEdge> |
getEdgeList()
Return the list of LayoutEdges within this partition. |
double |
getHeight()
Return the total height of all of the LayoutNodes |
double |
getMaxX()
Return the maximum X location of all of the LayoutNodes |
double |
getMaxY()
Return the maximum Y location of all of the LayoutNodes |
double |
getMinX()
Return the minimum X location of all of the LayoutNodes |
double |
getMinY()
Return the minimum Y location of all of the LayoutNodes |
List<LayoutNode> |
getNodeList()
Return the list of LayoutNodes within this partition. |
int |
getPartitionNumber()
Return the partition number of this partition |
double |
getWidth()
Return the total width of all of the LayoutNodes |
int |
lockedNodeCount()
Return the number of locked nodes within this partition |
void |
moveNodeToLocation(LayoutNode node)
Move the node to its current X and Y values. |
int |
nodeCount()
Return the number of nodes in this partition |
Iterator<LayoutNode> |
nodeIterator()
Return an iterator over all of the LayoutNodes in this partition |
void |
offset(double xoffset,
double yoffset)
Offset all of the nodes in the partition by a fixed amount. |
void |
randomizeLocations()
Randomize the graph locations. |
void |
resetNodes()
Reset all of the data maintained for the LayoutNodes contained within this partition, including the min, max and average x and y values. |
void |
setEdgeWeighter(EdgeWeighter edgeWeighter)
Set the EdgeWeighter to use for this partition. |
void |
setPartitionNumber(int part)
Set the partition number of this partition |
int |
size()
Return the size of this partition, which is defined as the number of nodes that it contains. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LayoutPartition(int nodeCount, int edgeCount)
nodeCount
- The number of nodes in the new partition.edgeCount
- The number of edges in the new partition.public LayoutPartition(CyNetworkView networkView, Collection<View<CyNode>> nodeSet, EdgeWeighter edgeWeighter)
networkView
- the CyNetworkView to usenodeSet
- the nodes to be considerededgeWeighter
- the weighter to use for edge weightingMethod Detail |
---|
public void setEdgeWeighter(EdgeWeighter edgeWeighter)
edgeWeighter
- the weighter to use for edge weightingprotected void addNode(CyNetwork network, View<CyNode> nv, boolean locked)
nv
- the Viewlocked
- a boolean value to determine if this node is locked or notprotected void addEdge(CyEdge edge, CyRow row)
edge
- the Edge to add to the partitionprotected void addEdge(CyEdge edge, LayoutNode v1, LayoutNode v2, CyRow row)
edge
- the Edge to add to the partitionv1
- the LayoutNode of the edge sourcev2
- the LayoutNode of the edge targetpublic void randomizeLocations()
public void moveNodeToLocation(LayoutNode node)
node
- the LayoutNode to movepublic void fixEdges()
public void calculateEdgeWeights()
public int size()
public List<LayoutNode> getNodeList()
LayoutNode
public List<LayoutEdge> getEdgeList()
LayoutEdge
public Iterator<LayoutNode> nodeIterator()
LayoutNode
public Iterator<LayoutEdge> edgeIterator()
LayoutEdge
public int nodeCount()
public int edgeCount()
public double getMaxX()
public double getMaxY()
public double getMinX()
public double getMinY()
public double getWidth()
public double getHeight()
public int getPartitionNumber()
public void setPartitionNumber(int part)
part
- partition numberpublic int lockedNodeCount()
public LayoutPoint getAverageLocation()
public void offset(double xoffset, double yoffset)
xoffset
- the amount to offset in the X directionyoffset
- the amount to offset in the Y directionpublic void resetNodes()
|
Cytoscape 3.0.0-beta1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |