本文整理了Java中giny.model.Node
类的一些代码示例,展示了Node
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node
类的具体详情如下:
包路径:giny.model.Node
类名称:Node
暂无
代码示例来源:origin: cytoscape.coreplugins/psi-mi
/**
* Create Hashkey for Edges.
*
* @param node1 First node.
* @param node2 Second node.
* @return HashKey.
*/
private String createEdgeKey(Node node1, Node node2, Interaction interaction) {
String node1Ident = node1.getIdentifier();
String node2Ident = node2.getIdentifier();
String interactionType = getInteractionTypeId(interaction);
return new String(node1Ident + interactionType + node2Ident);
}
代码示例来源:origin: cytoscape.corelibs/fing
/**
* DOCUMENT ME!
*
* @param node DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public int getIndex(Node node) {
if (node.getRootGraph() == this)
return node.getRootGraphIndex();
else
return 0;
}
代码示例来源:origin: cytoscape/application
if (Cytoscape.getRootGraph().getEdgeCount() != 0) {
int[] n1Edges = Cytoscape.getRootGraph()
.getAdjacentEdgeIndicesArray(source.getRootGraphIndex(), true,
true, true);
CyNode edgeSource = (CyNode) edge.getSource();
if ((edgeTarget.getRootGraphIndex() == target.getRootGraphIndex())
&& (edgeSource.getRootGraphIndex() == source.getRootGraphIndex())) {
return edge;
if ((edgeTarget.getRootGraphIndex() == source.getRootGraphIndex())
&& (edgeSource.getRootGraphIndex() == target.getRootGraphIndex())) {
return edge;
String edge_name = CyEdge.createIdentifier(source.getIdentifier(),
(String) attribute_value,
target.getIdentifier());
edge.setIdentifier(edge_name);
代码示例来源:origin: cytoscape/application
int rootIndex = node.getRootGraphIndex();
GraphView graphView = node_view.getGraphView();
GraphPerspective gp = graphView.getGraphPerspective();
GraphPerspective childGP = node.getGraphPerspective();
throw new IllegalStateException("Node " + node.getIdentifier()
+ " has a non-empty array "
+ " of children-node indices, but, it has no child GraphPerspective");
NodeView childNV = graphView.getNodeView(childNode.getRootGraphIndex());
代码示例来源:origin: cytoscape.corelibs/fing
GraphPerspectiveNodesHiddenEvent(Object source, Node[] hiddenNodes) {
super(source);
m_hiddenNodes = hiddenNodes;
m_hiddenNodeInx = new int[m_hiddenNodes.length];
for (int i = 0; i < m_hiddenNodeInx.length; i++)
m_hiddenNodeInx[i] = m_hiddenNodes[i].getRootGraphIndex();
}
代码示例来源:origin: cytoscape/application
node = Cytoscape.getCyNode(label, true);
if (nodeLabels.get(idx) != null)
nodeAttr.setAttribute(node.getIdentifier(), LABEL,
nodeLabels.get(idx));
if (nodeNames.get(idx) != null)
nodeAttr.setAttribute(node.getIdentifier(), NAME, nodeNames
.get(idx));
giny_nodes.add(node.getRootGraphIndex());
nodeIDMap.put(nodes.get(idx), node.getRootGraphIndex());
gml_id2order.put(nodes.get(idx), idx);
((KeyValue) node_root_index_pairs.get(idx)).value = (new Integer(
node.getRootGraphIndex()));
} else {
throw new GMLException("GML id " + nodes.get(idx)
代码示例来源:origin: cytoscape.corelibs/fing
/**
* DOCUMENT ME!
*
* @param source DOCUMENT ME!
* @param target DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public int createEdge(Node source, Node target) {
return createEdge(source, target, source.getRootGraphIndex() != target.getRootGraphIndex());
}
代码示例来源:origin: cytoscape/application
private String buildStringQuery() {
final StringBuilder builder = new StringBuilder();
final Set<Node> selectedNodes = Cytoscape.getCurrentNetwork().getSelectedNodes();
for (Node node : selectedNodes) {
builder.append(node.getIdentifier() + " ");
}
return builder.toString();
}
代码示例来源:origin: cytoscape/application
public int nextInt() {
if ((nodeArr[index] == null) || (nodeArr[index].getRootGraph() != root))
throw new IllegalArgumentException();
return nodeArr[index++].getRootGraphIndex();
}
},
代码示例来源:origin: cytoscape/application
currentGML.addMapping("id", new GMLNode("" + (-currentNode.getRootGraphIndex())));
String name = currentView.getNode().getIdentifier();
new GMLNode("" + (-currentEdge.getSource().getRootGraphIndex())));
currentGML.addMapping("target",
new GMLNode("" + (-currentEdge.getTarget().getRootGraphIndex())));
代码示例来源:origin: cytoscape/application
/**
* Return the requested Attribute for the given Node
* @param node the given CyNode
* @param attribute the name of the requested attribute
* @return the value for the give node, for the given attribute
*/
public Object getNodeAttributeValue(Node node, String attribute) {
return getNodeAttributeValue(node.getRootGraphIndex(), attribute);
}
代码示例来源:origin: cytoscape/application
/**
* Return all the terms in this ontology.<br>
*
* @return All ontology terms as Set object.
*/
public Set getTerms() {
Set<Term> terms = new HashSet<Term>();
Iterator nodeIt = ontologyGraph.nodesIterator();
while (nodeIt.hasNext()) {
final Node node = (Node) nodeIt.next();
final String id = node.getIdentifier();
final Term term = new OntologyTerm(node.getIdentifier(), this.name,
termAttr.getStringAttribute(id,
OBOTags.DEF.toString()));
terms.add(term);
}
return terms;
}
代码示例来源:origin: cytoscape.corelibs/fing
public int nextInt() {
if ((nodeArr[index] == null) || (nodeArr[index].getRootGraph() != root))
throw new IllegalArgumentException();
return nodeArr[index++].getRootGraphIndex();
}
},
代码示例来源:origin: cytoscape/application
/**
* Return the requested Attribute for the given Node
* @param node the given CyNode
* @param attribute the name of the requested attribute
* @param value the value to be set
* @return if it overwrites a previous value
*/
public boolean setNodeAttributeValue(Node node, String attribute, Object value) {
return setNodeAttributeValue(node.getRootGraphIndex(), attribute, value);
}
代码示例来源:origin: cytoscape/application
/**
* @param nodeView The clicked NodeView
* @param menu popup menu to add the Bypass menu
*/
public void addNodeContextMenuItems(NodeView nodeView, JPopupMenu menu) {
NodeBypass nb = new NodeBypass();
if (menu == null)
menu = new JPopupMenu();
/*
* Add Node ID as label.
*/
final String nodeID = nodeView.getNode().getIdentifier();
final JLabel nodeLabel = new JLabel(nodeID);
nodeLabel.setForeground(new Color(10, 50, 250, 150));
nodeLabel.setFont(new Font("SansSerif", Font.BOLD, 18));
nodeLabel.setBorder(new EmptyBorder(5, 10, 5, 5));
menu.add(nodeLabel);
menu.add(nb.addMenu(nodeView.getNode()));
}
}
代码示例来源:origin: cytoscape.corelibs/fing
/**
* DOCUMENT ME!
*
* @param parent DOCUMENT ME!
* @param child DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public boolean addMetaChild(Node parent, Node child) {
if ((parent.getRootGraph() != this) || (child.getRootGraph() != this))
return false;
return addNodeMetaChild(parent.getRootGraphIndex(), child.getRootGraphIndex());
}
代码示例来源:origin: cytoscape/application
/**
* Makes nodes request overtime pay.
* @param networkList a list of cyNetworks
* @return an integer array containing the indices of nodes in the union
*/
protected static int[] unionizeNodes(List networkList) {
/*
* This is the set of nodes that will be in the final merged network
*/
Set<Integer> nodes = new HashSet<Integer>();
for (Iterator it = networkList.iterator(); it.hasNext();) {
CyNetwork currentNetwork = (CyNetwork) it.next();
for (Iterator nodeIt = currentNetwork.nodesIterator(); nodeIt.hasNext();) {
nodes.add(new Integer(((Node) nodeIt.next()).getRootGraphIndex()));
}
}
int[] result = new int[nodes.size()];
int idx = 0;
for (Iterator nodeIt = nodes.iterator(); nodeIt.hasNext(); idx++) {
result[idx] = ((Integer) nodeIt.next()).intValue();
}
return result;
}
代码示例来源:origin: cytoscape/application
public SetNestedNetworkDialog(JFrame parent, boolean modal, NodeView nodeView) {
super(parent, "Set Nested Network for " + nodeView.getNode().getIdentifier(), modal);
init(nodeView);
}
代码示例来源:origin: cytoscape.corelibs/fing
/**
* DOCUMENT ME!
*
* @param child DOCUMENT ME!
* @param parent DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public boolean isMetaParent(Node child, Node parent) {
if ((child.getRootGraph() != this) || (parent.getRootGraph() != this))
return false;
return isNodeMetaParent(child.getRootGraphIndex(), parent.getRootGraphIndex());
}
代码示例来源:origin: cytoscape/application
for (Iterator nodeIt = nodes.iterator(); nodeIt.hasNext(); idx++) {
Node currentNode = (Node) nodeIt.next();
result[idx] = currentNode.getRootGraphIndex();
内容来源于网络,如有侵权,请联系作者删除!