@Override public boolean evaluate(Graph graph, Edge edge) { return !edge.isSelfLoop(); }
@Override public boolean evaluate(Graph graph, Edge edge) { DirectedGraph directedGraph = (DirectedGraph) graph; //Make sure the edge is not self loop if (!edge.isSelfLoop()) { //Get the potential mutual edge Edge mutualEdge = directedGraph.getMutualEdge(edge); //Remove the mutual edge if exists //Make sure only one of the two mutual edges will be removed if (mutualEdge != null && mutualEdge.getStoreId() < edge.getStoreId()) { return false; } } return true; }
Node newEdgeSource; Node newEdgeTarget; if (edge.getSource() == node) { newEdgeSource = newNode; if (nodesSet.contains(edge.getTarget())) { newEdgeTarget = edge.getTarget(); if (nodesSet.contains(edge.getSource())) { newEdgeSource = edge.getSource(); newEdge = createEdge(newEdgeSource, newEdgeTarget, edge.isDirected(), edge.getTypeLabel(), graph); Object value = edge.getAttribute(column); if (value == null) { newEdge.removeAttribute(column); } else { newEdge.setAttribute(column, edge.getAttribute(column));
float x1 = edge.getSource().x(); float x2 = edge.getTarget().x(); float y1 = edge.getSource().y(); float y2 = edge.getTarget().y(); float t1 = w; float t2 = w; float g; float b; float a = edge.alpha(); if (a == 0f) { if (vizModel.isEdgeHasUniColor()) { b = uni[2]; a = uni[3]; } else if (edge.isDirected()) { Node source = edge.getSource(); r = source.r(); g = source.g(); a = source.alpha(); } else { Node source = edge.getSource(); Node target = edge.getTarget(); r = edge.r(); g = edge.g(); b = edge.b();
private EdgeImpl verifyEdge(Edge edge) { EdgeImpl edgeImpl = (EdgeImpl) edge; verifyElement(edgeImpl); EdgeImpl existingEdge = store.getEdge(edge.getId()); if (existingEdge != null && (!existingEdge.getSource().getId().equals(edge.getSource().getId()) || !existingEdge .getTarget().getId().equals(edge.getTarget().getId()))) { throw new RuntimeException("An edge with a similar id '" + edge.getId() + "' already exists"); } return edgeImpl; }
boolean t = edgeBitVector.get(e.getStoreId()); if (t && (!nodeBitVector.get(e.getSource().getStoreId()) || !nodeBitVector.get(e.getTarget() .getStoreId()))) { removeEdge((EdgeImpl) e);
if (edge.isDirected() != directed) { sameEdgeDefinition = false; } else { if (directed) { if (edge.getSource() != source || edge.getTarget() != target) { sameEdgeDefinition = false; if (edge.getSource() == source) { if (edge.getTarget() != target) { sameEdgeDefinition = false; } else if (edge.getTarget() == source) { if (edge.getSource() != target) { sameEdgeDefinition = false; id, source.getId(), target.getId(), directed, edge.getSource().getId(), edge.getTarget().getId(), edge.isDirected() if (edge != null && edge.isDirected() != directed) {
@Override public Graph filter(Subgraph[] graphs) { if (graphs.length > 1) { throw new IllegalArgumentException("Not Filter accepts a single graph in parameter"); } Graph graph = graphs[0]; Graph mainGraph = graph.getView().getGraphModel().getGraph(); for (Edge e : mainGraph.getEdges()) { Node source = e.getSource(); Node target = e.getTarget(); if (graph.contains(source) && graph.contains(target)) { Edge edgeInGraph = graph.getEdge(source, target, e.getType()); if (edgeInGraph == null) { //The edge is not in graph graph.addEdge(e); } else { //The edge is in the graph graph.removeEdge(edgeInGraph); } } } return graph; }
for (Edge e : edges) { for (Edge f : edges) { if (e != f && graph.contains(e) && graph.contains(f) && !e.isSelfLoop() && !f.isSelfLoop()) { Node s1 = e.getSource(); Node t1 = e.getTarget(); Node s2 = f.getSource(); Node t2 = f.getTarget(); double s1x = s1.x(); double s1y = s1.y();
if (edge != null && (edge.getEdge().getStoreId() == -1 || (isView && !graph.contains(edge.getEdge())))) { int sourceId = edge.getEdge().getSource().getStoreId(); int targetId = edge.getEdge().getTarget().getStoreId(); NodeModel sourceModel = sourceId == -1 ? null : nodes[sourceId]; NodeModel targetModel = targetId == -1 ? null : nodes[targetId]; float maxWeight = Float.MIN_VALUE; for (Edge edge : graph.getEdges()) { int id = edge.getStoreId(); EdgeModel model; if (id >= edges.length || edges[id] == null) { growEdges(id); NodeModel sourceModel = nodes[edge.getSource().getStoreId()]; NodeModel targetModel = nodes[edge.getTarget().getStoreId()]; model = edgeModeler.initModel(edge, sourceModel, targetModel); sourceModel.addEdge(model); model = edges[id]; float w = (float) edge.getWeight(graphView); model.setWeight(w); minWeight = Math.min(w, minWeight);
@Override public Item[] getItems(Graph graph) { EdgeItem[] items = new EdgeItem[graph.getEdgeCount()]; int i = 0; for (Edge e : graph.getEdges()) { EdgeItem item = new EdgeItem(e); item.setData(EdgeItem.WEIGHT, e.getWeight(graph.getView())); item.setData(EdgeItem.DIRECTED, e.isDirected()); if (graph.isDirected(e)) { item.setData(EdgeItem.MUTUAL, ((DirectedGraph) graph).getMutualEdge(e) != null); } item.setData(EdgeItem.SELF_LOOP, e.isSelfLoop()); item.setData(EdgeItem.COLOR, e.alpha() == 0 ? null : e.getColor()); items[i++] = item; } return items; }
Node node = edge.getSource(); float x = node.x(); float y = node.y(); float g; float b; float a = edge.alpha(); if (vizModel.isEdgeHasUniColor()) { float[] uni = vizModel.getEdgeUniColor(); a = uni[3]; } else if (a == 0f) { Node source = edge.getSource(); r = source.r(); g = source.g(); a = source.alpha(); } else { g = edge.g(); b = edge.b(); r = edge.r(); a = edge.alpha(); r = edge.r(); g = edge.g(); b = edge.b(); if (edge.alpha() == 0f) { Node source = edge.getSource();
@Override public boolean isDirected(Edge edge) { return edge.isDirected(); }