Author: kono
Date: 2010-08-10 10:46:07 -0700 (Tue, 10 Aug 2010)
New Revision: 21280
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/AbstractLayout.java
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutNode.java
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutPartition.java
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/algorithms/GridNodeLayout.java
Log:
Method name changed from getSource() to getModel() for consistency.
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/AbstractLayout.java
===================================================================
---
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/AbstractLayout.java
2010-08-10 17:45:05 UTC (rev 21279)
+++
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/AbstractLayout.java
2010-08-10 17:46:07 UTC (rev 21280)
@@ -206,7 +206,7 @@
if ( networkView == null )
return;
- this.network = networkView.getSource();
+ this.network = networkView.getModel();
if (network == null)
return;
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutNode.java
===================================================================
---
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutNode.java
2010-08-10 17:45:05 UTC (rev 21279)
+++
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutNode.java
2010-08-10 17:46:07 UTC (rev 21280)
@@ -79,7 +79,7 @@
*/
public LayoutNode(View<CyNode> nodeView, int index) {
this.nodeView = nodeView;
- this.node = nodeView.getSource();
+ this.node = nodeView.getModel();
this.index = index;
this.x =
nodeView.getVisualProperty(TwoDVisualLexicon.NODE_X_LOCATION);
this.y =
nodeView.getVisualProperty(TwoDVisualLexicon.NODE_Y_LOCATION);
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutPartition.java
===================================================================
---
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutPartition.java
2010-08-10 17:45:05 UTC (rev 21279)
+++
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/LayoutPartition.java
2010-08-10 17:46:07 UTC (rev 21280)
@@ -178,7 +178,7 @@
* @param locked a boolean value to determine if this node is locked or
not
*/
protected void addNode(View<CyNode> nv, boolean locked) {
- CyNode node = nv.getSource();
+ CyNode node = nv.getModel();
LayoutNode v = new LayoutNode(nv, nodeIndex++);
nodeList.add(v);
nodeToLayoutNode.put(node, v);
@@ -513,7 +513,7 @@
this.nodeList = new
ArrayList<LayoutNode>(network.getNodeCount());
for (View<CyNode>nv: networkView.getNodeViews()){
- CyNode node = (CyNode) nv.getSource();
+ CyNode node = (CyNode) nv.getModel();
if (!nodeSet.contains(node)) {
addNode(nv, true);
@@ -525,7 +525,7 @@
private void edgeListInitialize(CyNetwork network, CyNetworkView
networkView) {
for (View<CyEdge>ev: networkView.getEdgeViews()){
- CyEdge edge = ev.getSource();
+ CyEdge edge = ev.getModel();
// Make sure we clean up after any previous layouts
//ev.clearBends(); // FIXME: this will mean some
cleanup in VisualProperty, right?
@@ -620,7 +620,7 @@
// Initialize the maps
for (View<CyNode> nv: networkView.getNodeViews()){
- int node = nv.getSource().getIndex();
+ int node = nv.getModel().getIndex();
nodesSeenMap.put(node, m_NODE_HAS_NOT_BEEN_SEEN);
nodesToViews.put(node, nv);
}
Modified:
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/algorithms/GridNodeLayout.java
===================================================================
---
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/algorithms/GridNodeLayout.java
2010-08-10 17:45:05 UTC (rev 21279)
+++
core3/layout-api/trunk/src/main/java/org/cytoscape/view/layout/internal/algorithms/GridNodeLayout.java
2010-08-10 17:46:07 UTC (rev 21280)
@@ -169,7 +169,7 @@
// Selected only?
if (selectedOnly) {
// Yes, our size and starting points need to be
different
- int nodeCount = networkView.getSource().getNodeCount()
- staticNodes.size();
+ int nodeCount = networkView.getModel().getNodeCount() -
staticNodes.size();
columns = (int) Math.sqrt(nodeCount);
// Calculate our starting point as the geographical
center of the
// selected nodes.
@@ -189,14 +189,14 @@
currX = initialX;
currY = initialY;
} else {
- columns = (int)
Math.sqrt(networkView.getSource().getNodeCount());
+ columns = (int)
Math.sqrt(networkView.getModel().getNodeCount());
}
int count = 0;
List<CyEdge> edgeList;
for ( View<CyNode> nView : networkView.getNodeViews() ) {
- edgeList =
network.getAdjacentEdgeList(nView.getSource(),CyEdge.Type.ANY);
+ edgeList =
network.getAdjacentEdgeList(nView.getModel(),CyEdge.Type.ANY);
// TODO
// for (CyEdge edge: edgeList) {
// networkView.getCyEdgeView(edge).clearBends();
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.