Text labelTextOutline = target.createTextNode(label); Element outlineElem = target.createElement("text"); outlineElem.setAttribute("class", SVGUtils.idAsClassAttribute(edge.getId())); outlineElem.setAttribute("x", String.valueOf(x)); outlineElem.setAttribute("y", String.valueOf(y)); labelElem.setAttribute("class", SVGUtils.idAsClassAttribute(edge.getId())); labelElem.setAttribute("x", x + ""); labelElem.setAttribute("y", y + "");
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; }
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; }
private void refreshRows() { rows = columnsAndRowChooser.getRows(); Object sourceRow = columnsAndRowChooser.getRow(); Node node; Edge edge; //Prepare combo box with nodes/edges data: for (int i = 0; i < rows.length; i++) { if (rows[i] instanceof Node) { node = (Node) rows[i]; rowComboBox.addItem(node.getId() + " - " + node.getLabel()); } else { edge = (Edge) rows[i]; rowComboBox.addItem(edge.getId() + " - " + edge.getLabel()); } if (rows[i] == sourceRow) { rowComboBox.setSelectedIndex(i); } } }
List<Edge> edgesToRemove = new ArrayList<>(); for (Edge edge : targetGraph.getEdges()) { if (!visibleCurrentGraph.hasEdge(edge.getId())) { edgesToRemove.add(edge);
checkIdDoesntExist(e.getId()); checkSourceTargets(edge); checkUndirectedNotExist(edge);
checkIdDoesntExist(e.getId()); checkSourceTargets(edge); checkUndirectedNotExist(edge);