for (Iterator i = parent.getNodeViewsIterator(); i.hasNext();) { NodeView nodeView = (NodeView) i.next(); for (Iterator i = parent.getNodeViewsIterator(); i.hasNext();) { NodeView nodeView = (NodeView) i.next(); nodeView.setXPosition((m * ((nodeView.getXPosition()) - cx)) + cx);
public void actionPerformed(ActionEvent e) { List<CyNetworkView> views = Cytoscape.getSelectedNetworkViews(); for ( CyNetworkView netView : views ) { if (layout.supportsSelectedOnly()) { layout.setSelectedOnly(selectedOnly); if (selectedOnly && (selectedNodes.size() > 0)) { // Lock all unselected nodes Iterator nodeViews = netView.getNodeViewsIterator(); while (nodeViews.hasNext()) { NodeView nv = (NodeView) nodeViews.next(); Node node = nv.getNode(); if (!selectedNodes.contains(node)) layout.lockNode(nv); } } } if ((layout.supportsNodeAttributes() != null) || (layout.supportsEdgeAttributes() != null)) { layout.setLayoutAttribute(e.getActionCommand()); } TaskManager.executeTask( new LayoutTask(layout, netView), LayoutTask.getDefaultTaskConfig() ); } } }
Iterator<NodeView> nodeViews = networkView.getNodeViewsIterator(); Iterator<NodeView> nodeViews = networkView.getNodeViewsIterator(); int count = 0;
/** * Recalculates and reapplies all of the node appearances. The visual * attributes are calculated by delegating to the NodeAppearanceCalculator * member of the current visual style. */ public void applyNodeAppearances(final CyNetwork network, final CyNetworkView network_view) { final NodeAppearanceCalculator nodeAppearanceCalculator = activeVS .getNodeAppearanceCalculator(); List<VisualPropertyType> bypassedVPs = getBypassedVPs("NODE", Cytoscape .getNodeAttributes()); final Set<CyCustomGraphics> byPassedCustomGraphics = new HashSet<CyCustomGraphics>(); final Iterator<NodeView> itr = network_view.getNodeViewsIterator(); while (itr.hasNext()) { final NodeView nodeView = itr.next(); final Node node = nodeView.getNode(); // Identify and collect the bypassed custom graphics: final List<Object> bypassedProps = getByPassedVisProps(nodeView, bypassedVPs); for (final Object bypassedProp : bypassedProps) { if (bypassedProp instanceof CyCustomGraphics) byPassedCustomGraphics.add((CyCustomGraphics)bypassedProp); } nodeAppearanceCalculator.calculateNodeAppearance(myNodeApp, node, network, bypassedVPs); myNodeApp.applyAppearance(nodeView, activeVS.getDependency()); } checkCustomGraphicsInUse(byPassedCustomGraphics); }
@SuppressWarnings("unchecked") public static void setNodeToolTips(CyNetworkView networkView) { // grab node attributes CyAttributes nodeAttributes = Cytoscape.getNodeAttributes(); // iterate through the nodes Iterator<NodeView> nodesIt = networkView.getNodeViewsIterator(); while (nodesIt.hasNext()) { NodeView nodeView = nodesIt.next(); String id = nodeView.getNode().getIdentifier(); String tip = nodeAttributes.getStringAttribute(id, MapBioPaxToCytoscape.BIOPAX_ENTITY_TYPE) + "\n" + nodeAttributes.getListAttribute(id, MapBioPaxToCytoscape.BIOPAX_CELLULAR_LOCATIONS); nodeView.setToolTip(tip); if(log.isDebugging()) log.debug("tooltip set "+ tip + " for node " + id); } networkView.updateView(); } }
double maxY = Double.MIN_VALUE; final CyNetworkView graphView = Cytoscape.getCurrentNetworkView(); Iterator iter = graphView.getNodeViewsIterator();
String curNodeName = null; for (Iterator i = view.getNodeViewsIterator(); i.hasNext();) { NodeView nview = (NodeView) i.next();