Object i1 = attributes.getAttribute(e1.getIdentifier(),Semantics.INTERACTION); Object i2 = attributes.getAttribute(e2.getIdentifier(),Semantics.INTERACTION); return false; if (e1.isDirected()) { // directed if (!e2.isDirected()) return false; return matchNode(net1, e1.getSource(), net2, e2.getSource()) && matchNode(net1, e1.getTarget(), net2, e2.getTarget()); } else { //non directed if (e2.isDirected()) return false; if (matchNode(net1, e1.getSource(), net2, e2.getSource()) && matchNode(net1, e1.getTarget(), net2, e2.getTarget())) return true; if (matchNode(net1, e1.getSource(), net2, e2.getTarget()) && matchNode(net1, e1.getTarget(), net2, e2.getSource())) return true; return false;
/** * DOCUMENT ME! * * @param edge DOCUMENT ME! * * @return DOCUMENT ME! */ public int getIndex(Edge edge) { if (edge.getRootGraph() == this) return edge.getRootGraphIndex(); else return 0; }
private boolean isHit(Edge pEdge, BitSet pPassFilter_nodeBits) { // Get the list of relevant nodes for this edge List<Node> adjacentNodes = new ArrayList<Node>(); if (nodeType == NODE_SOURCE) { adjacentNodes.add(pEdge.getSource()); } else if (nodeType == NODE_TARGET) { adjacentNodes.add(pEdge.getTarget()); } else if (nodeType == NODE_SOURCE_TARGET) { adjacentNodes.add(pEdge.getSource()); adjacentNodes.add(pEdge.getTarget()); } else { //nodeType == NODE_UNDEFINED --Neither source or target is selected return false; } int nodeIndex = -1; for (int i=0; i < adjacentNodes.size(); i++) { nodeIndex = network.nodesList().indexOf(adjacentNodes.get(i)); if (pPassFilter_nodeBits.get(nodeIndex) == true) { return true; } } return false; } }
giny.model.Edge edge = (giny.model.Edge) it.next(); if (node == edge.getSource()) { //do only for outgoing edges giny.model.Node target = edge.getTarget(); String edgeName = edge.getIdentifier(); String interactionName = edgeAtts.getStringAttribute(edge.getIdentifier(), Semantics.INTERACTION);
protected void selectEdgesByName(TreePath treePath) { java.util.List list = view.getEdgeViewsList(); Vector vector = new Vector(); for (Iterator i = list.iterator(); i.hasNext();) { EdgeView ev = (EdgeView) i.next(); String canonicalName = ev.getEdge().getIdentifier(); if (pathMatchesEdge(canonicalName, treePath, edgeAttributes)) vector.add(ev); } // for ec for (Iterator vi = vector.iterator(); vi.hasNext();) { EdgeView edge = (EdgeView) vi.next(); edge.setSelected(true); } } // selectEdgesByName //------------------------------------------------------------------------------
if (knownNodes.contains(edgeCandidate.getSource()) && knownNodes.contains(edgeCandidate.getTarget())) acceptableEdges.add(edgeCandidate.getRootGraphIndex());
GraphPerspectiveEdgesHiddenEvent(Object source, Edge[] hiddenEdges) { super(source); m_hiddenEdges = hiddenEdges; m_hiddenEdgeInx = new int[m_hiddenEdges.length]; for (int i = 0; i < m_hiddenEdgeInx.length; i++) m_hiddenEdgeInx[i] = m_hiddenEdges[i].getRootGraphIndex(); }
edge.setIdentifier(edgeName); edgeAttr.setAttribute(edgeName, Semantics.INTERACTION, label); mapAttributes(edge, edgeAttr, edgeAttributes.get(idx)); giny_edges.add(edge.getRootGraphIndex()); ((KeyValue) edge_root_index_pairs.get(idx)).value = (new Integer( edge.getRootGraphIndex())); } else { throw new GMLException(
String sourceId = ed.getSource().getIdentifier(); String targetId = ed.getTarget().getIdentifier(); String edgeId = ed.getIdentifier(); generateExternalLinks(edgeAttributes, ed.getIdentifier(), top_menu);
/** * DOCUMENT ME! * * @param e DOCUMENT ME! */ public void actionPerformed(ActionEvent e) { final CyNetwork currentNetwork = Cytoscape.getCurrentNetwork(); Set<CyEdge> edgeSet = currentNetwork.getSelectedEdges(); final List<Edge> selectedEdges = new ArrayList<Edge>(edgeSet); final Set<Node>nodesToSelect = new HashSet<Node>(); for (Edge edge: selectedEdges) { nodesToSelect.add(edge.getSource()); nodesToSelect.add(edge.getTarget()); } currentNetwork.setSelectedNodeState(nodesToSelect, true); Cytoscape.getCurrentNetworkView().updateView(); } // actionPerformed
protected void hideEdgesByName(TreePath treePath) { java.util.List list = view.getEdgeViewsList(); for (Iterator i = list.iterator(); i.hasNext();) { EdgeView ev = (EdgeView) i.next(); String edgeName = ev.getEdge().getIdentifier(); if (pathMatchesEdge(edgeName, treePath, edgeAttributes)) view.hideGraphObject(ev); } // for ec } // hideEdgesByName //------------------------------------------------------------------------------
/** * Return the requested Attribute for the given Edge */ public boolean setEdgeAttributeValue(Edge edge, String attribute, Object value) { return setEdgeAttributeValue(edge.getRootGraphIndex(), attribute, value); }
targetPair.value = new Integer(edge.getTarget().getRootGraphIndex()); sourcePair.value = new Integer(edge.getSource().getRootGraphIndex()); .getStringAttribute(edge.getIdentifier(), Semantics.INTERACTION);
/** * An object passes this Filter if it is the source/target * node for an edge that has a matching property for * the given Edge atttribute. */ public boolean passesFilter(Object object) { Filter filter = FilterManager.defaultManager().getFilter(this.filter); if (filter == null) { return false; } if (!(object instanceof Edge)) { return false; } Edge edge = (Edge) object; //get the list of all relevant edges Node adjacentNode; if (target == SOURCE) { return filter.passesFilter(edge.getSource()); } else if (target == TARGET) { return filter.passesFilter(edge.getTarget()); } else { return filter.passesFilter(edge.getSource()) || filter.passesFilter(edge.getTarget()); } }
final Node source = mapNN.get(edge_ori.getSource()); final Node target = mapNN.get(edge_ori.getTarget()); if (source==null||target==null) { // some of the node may be exluded when intersection or difference continue; final boolean directed = edge_ori.isDirected(); final CyAttributes attributes = Cytoscape.getEdgeAttributes(); final String interaction = (String)attributes.getAttribute(edge_ori.getIdentifier(),Semantics.INTERACTION);
/** * Returns the interaction type of the given edge. Formally, gets from the * edge attributes the value for the "interaction" attribute". * * If either argument is null, returns null. */ public static String getInteractionType(final CyNetwork network, final Edge edge) { if ((network == null) || (edge == null)) { return null; } return Cytoscape.getEdgeAttributes() .getStringAttribute(edge.getIdentifier(), Semantics.INTERACTION); }
public int nextInt() { if ((edgeArr[index] == null) || (edgeArr[index].getRootGraph() != root)) throw new IllegalArgumentException(); return edgeArr[index++].getRootGraphIndex(); } });
/** * Return the requested Attribute for the given Edge */ public Object getEdgeAttributeValue(Edge edge, String attribute) { return getEdgeAttributeValue(edge.getRootGraphIndex(), attribute); }
new GMLNode("" + (-currentEdge.getSource().getRootGraphIndex()))); currentGML.addMapping("target", new GMLNode("" + (-currentEdge.getTarget().getRootGraphIndex()))); String interaction = edgeAttributes.getStringAttribute(currentEdge.getIdentifier(), Semantics.INTERACTION);