giny.model.Node类的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(227)

本文整理了Java中giny.model.Node类的一些代码示例,展示了Node类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node类的具体详情如下:
包路径:giny.model.Node
类名称:Node

Node介绍

暂无

代码示例

代码示例来源:origin: cytoscape.coreplugins/psi-mi

  1. /**
  2. * Create Hashkey for Edges.
  3. *
  4. * @param node1 First node.
  5. * @param node2 Second node.
  6. * @return HashKey.
  7. */
  8. private String createEdgeKey(Node node1, Node node2, Interaction interaction) {
  9. String node1Ident = node1.getIdentifier();
  10. String node2Ident = node2.getIdentifier();
  11. String interactionType = getInteractionTypeId(interaction);
  12. return new String(node1Ident + interactionType + node2Ident);
  13. }

代码示例来源:origin: cytoscape.corelibs/fing

  1. /**
  2. * DOCUMENT ME!
  3. *
  4. * @param node DOCUMENT ME!
  5. *
  6. * @return DOCUMENT ME!
  7. */
  8. public int getIndex(Node node) {
  9. if (node.getRootGraph() == this)
  10. return node.getRootGraphIndex();
  11. else
  12. return 0;
  13. }

代码示例来源:origin: cytoscape/application

  1. if (Cytoscape.getRootGraph().getEdgeCount() != 0) {
  2. int[] n1Edges = Cytoscape.getRootGraph()
  3. .getAdjacentEdgeIndicesArray(source.getRootGraphIndex(), true,
  4. true, true);
  5. CyNode edgeSource = (CyNode) edge.getSource();
  6. if ((edgeTarget.getRootGraphIndex() == target.getRootGraphIndex())
  7. && (edgeSource.getRootGraphIndex() == source.getRootGraphIndex())) {
  8. return edge;
  9. if ((edgeTarget.getRootGraphIndex() == source.getRootGraphIndex())
  10. && (edgeSource.getRootGraphIndex() == target.getRootGraphIndex())) {
  11. return edge;
  12. String edge_name = CyEdge.createIdentifier(source.getIdentifier(),
  13. (String) attribute_value,
  14. target.getIdentifier());
  15. edge.setIdentifier(edge_name);

代码示例来源:origin: cytoscape/application

  1. int rootIndex = node.getRootGraphIndex();
  2. GraphView graphView = node_view.getGraphView();
  3. GraphPerspective gp = graphView.getGraphPerspective();
  4. GraphPerspective childGP = node.getGraphPerspective();
  5. throw new IllegalStateException("Node " + node.getIdentifier()
  6. + " has a non-empty array "
  7. + " of children-node indices, but, it has no child GraphPerspective");
  8. NodeView childNV = graphView.getNodeView(childNode.getRootGraphIndex());

代码示例来源:origin: cytoscape.corelibs/fing

  1. GraphPerspectiveNodesHiddenEvent(Object source, Node[] hiddenNodes) {
  2. super(source);
  3. m_hiddenNodes = hiddenNodes;
  4. m_hiddenNodeInx = new int[m_hiddenNodes.length];
  5. for (int i = 0; i < m_hiddenNodeInx.length; i++)
  6. m_hiddenNodeInx[i] = m_hiddenNodes[i].getRootGraphIndex();
  7. }

代码示例来源:origin: cytoscape/application

  1. node = Cytoscape.getCyNode(label, true);
  2. if (nodeLabels.get(idx) != null)
  3. nodeAttr.setAttribute(node.getIdentifier(), LABEL,
  4. nodeLabels.get(idx));
  5. if (nodeNames.get(idx) != null)
  6. nodeAttr.setAttribute(node.getIdentifier(), NAME, nodeNames
  7. .get(idx));
  8. giny_nodes.add(node.getRootGraphIndex());
  9. nodeIDMap.put(nodes.get(idx), node.getRootGraphIndex());
  10. gml_id2order.put(nodes.get(idx), idx);
  11. ((KeyValue) node_root_index_pairs.get(idx)).value = (new Integer(
  12. node.getRootGraphIndex()));
  13. } else {
  14. throw new GMLException("GML id " + nodes.get(idx)

代码示例来源:origin: cytoscape.corelibs/fing

  1. /**
  2. * DOCUMENT ME!
  3. *
  4. * @param source DOCUMENT ME!
  5. * @param target DOCUMENT ME!
  6. *
  7. * @return DOCUMENT ME!
  8. */
  9. public int createEdge(Node source, Node target) {
  10. return createEdge(source, target, source.getRootGraphIndex() != target.getRootGraphIndex());
  11. }

代码示例来源:origin: cytoscape/application

  1. private String buildStringQuery() {
  2. final StringBuilder builder = new StringBuilder();
  3. final Set<Node> selectedNodes = Cytoscape.getCurrentNetwork().getSelectedNodes();
  4. for (Node node : selectedNodes) {
  5. builder.append(node.getIdentifier() + " ");
  6. }
  7. return builder.toString();
  8. }

代码示例来源:origin: cytoscape/application

  1. public int nextInt() {
  2. if ((nodeArr[index] == null) || (nodeArr[index].getRootGraph() != root))
  3. throw new IllegalArgumentException();
  4. return nodeArr[index++].getRootGraphIndex();
  5. }
  6. },

代码示例来源:origin: cytoscape/application

  1. currentGML.addMapping("id", new GMLNode("" + (-currentNode.getRootGraphIndex())));
  2. String name = currentView.getNode().getIdentifier();
  3. new GMLNode("" + (-currentEdge.getSource().getRootGraphIndex())));
  4. currentGML.addMapping("target",
  5. new GMLNode("" + (-currentEdge.getTarget().getRootGraphIndex())));

代码示例来源:origin: cytoscape/application

  1. /**
  2. * Return the requested Attribute for the given Node
  3. * @param node the given CyNode
  4. * @param attribute the name of the requested attribute
  5. * @return the value for the give node, for the given attribute
  6. */
  7. public Object getNodeAttributeValue(Node node, String attribute) {
  8. return getNodeAttributeValue(node.getRootGraphIndex(), attribute);
  9. }

代码示例来源:origin: cytoscape/application

  1. /**
  2. * Return all the terms in this ontology.<br>
  3. *
  4. * @return All ontology terms as Set object.
  5. */
  6. public Set getTerms() {
  7. Set<Term> terms = new HashSet<Term>();
  8. Iterator nodeIt = ontologyGraph.nodesIterator();
  9. while (nodeIt.hasNext()) {
  10. final Node node = (Node) nodeIt.next();
  11. final String id = node.getIdentifier();
  12. final Term term = new OntologyTerm(node.getIdentifier(), this.name,
  13. termAttr.getStringAttribute(id,
  14. OBOTags.DEF.toString()));
  15. terms.add(term);
  16. }
  17. return terms;
  18. }

代码示例来源:origin: cytoscape.corelibs/fing

  1. public int nextInt() {
  2. if ((nodeArr[index] == null) || (nodeArr[index].getRootGraph() != root))
  3. throw new IllegalArgumentException();
  4. return nodeArr[index++].getRootGraphIndex();
  5. }
  6. },

代码示例来源:origin: cytoscape/application

  1. /**
  2. * Return the requested Attribute for the given Node
  3. * @param node the given CyNode
  4. * @param attribute the name of the requested attribute
  5. * @param value the value to be set
  6. * @return if it overwrites a previous value
  7. */
  8. public boolean setNodeAttributeValue(Node node, String attribute, Object value) {
  9. return setNodeAttributeValue(node.getRootGraphIndex(), attribute, value);
  10. }

代码示例来源:origin: cytoscape/application

  1. /**
  2. * @param nodeView The clicked NodeView
  3. * @param menu popup menu to add the Bypass menu
  4. */
  5. public void addNodeContextMenuItems(NodeView nodeView, JPopupMenu menu) {
  6. NodeBypass nb = new NodeBypass();
  7. if (menu == null)
  8. menu = new JPopupMenu();
  9. /*
  10. * Add Node ID as label.
  11. */
  12. final String nodeID = nodeView.getNode().getIdentifier();
  13. final JLabel nodeLabel = new JLabel(nodeID);
  14. nodeLabel.setForeground(new Color(10, 50, 250, 150));
  15. nodeLabel.setFont(new Font("SansSerif", Font.BOLD, 18));
  16. nodeLabel.setBorder(new EmptyBorder(5, 10, 5, 5));
  17. menu.add(nodeLabel);
  18. menu.add(nb.addMenu(nodeView.getNode()));
  19. }
  20. }

代码示例来源:origin: cytoscape.corelibs/fing

  1. /**
  2. * DOCUMENT ME!
  3. *
  4. * @param parent DOCUMENT ME!
  5. * @param child DOCUMENT ME!
  6. *
  7. * @return DOCUMENT ME!
  8. */
  9. public boolean addMetaChild(Node parent, Node child) {
  10. if ((parent.getRootGraph() != this) || (child.getRootGraph() != this))
  11. return false;
  12. return addNodeMetaChild(parent.getRootGraphIndex(), child.getRootGraphIndex());
  13. }

代码示例来源:origin: cytoscape/application

  1. /**
  2. * Makes nodes request overtime pay.
  3. * @param networkList a list of cyNetworks
  4. * @return an integer array containing the indices of nodes in the union
  5. */
  6. protected static int[] unionizeNodes(List networkList) {
  7. /*
  8. * This is the set of nodes that will be in the final merged network
  9. */
  10. Set<Integer> nodes = new HashSet<Integer>();
  11. for (Iterator it = networkList.iterator(); it.hasNext();) {
  12. CyNetwork currentNetwork = (CyNetwork) it.next();
  13. for (Iterator nodeIt = currentNetwork.nodesIterator(); nodeIt.hasNext();) {
  14. nodes.add(new Integer(((Node) nodeIt.next()).getRootGraphIndex()));
  15. }
  16. }
  17. int[] result = new int[nodes.size()];
  18. int idx = 0;
  19. for (Iterator nodeIt = nodes.iterator(); nodeIt.hasNext(); idx++) {
  20. result[idx] = ((Integer) nodeIt.next()).intValue();
  21. }
  22. return result;
  23. }

代码示例来源:origin: cytoscape/application

  1. public SetNestedNetworkDialog(JFrame parent, boolean modal, NodeView nodeView) {
  2. super(parent, "Set Nested Network for " + nodeView.getNode().getIdentifier(), modal);
  3. init(nodeView);
  4. }

代码示例来源:origin: cytoscape.corelibs/fing

  1. /**
  2. * DOCUMENT ME!
  3. *
  4. * @param child DOCUMENT ME!
  5. * @param parent DOCUMENT ME!
  6. *
  7. * @return DOCUMENT ME!
  8. */
  9. public boolean isMetaParent(Node child, Node parent) {
  10. if ((child.getRootGraph() != this) || (parent.getRootGraph() != this))
  11. return false;
  12. return isNodeMetaParent(child.getRootGraphIndex(), parent.getRootGraphIndex());
  13. }

代码示例来源:origin: cytoscape/application

  1. for (Iterator nodeIt = nodes.iterator(); nodeIt.hasNext(); idx++) {
  2. Node currentNode = (Node) nodeIt.next();
  3. result[idx] = currentNode.getRootGraphIndex();

相关文章