@Override public void resetContainer() { super.resetContainer(); }
@Override public final AbstractVertex addGroup(String groupName, String groupIconKey) { String nextGroupId = getNextGroupId(); return addGroup(nextGroupId, groupIconKey, groupName); }
@Override public final AbstractVertex addVertex(int x, int y) { String id = getNextVertexId(); return addVertex(id, x, y); }
@Override public Edge connectVertices(VertexRef sourceVertextId, VertexRef targetVertextId) { String nextEdgeId = getNextEdgeId(); return connectVertices(nextEdgeId, sourceVertextId, targetVertextId, getNamespace()); }
@Override public void resetContainer() { clearVertices(); clearEdges(); clearCounters(); }
protected final AbstractVertex addGroup(String groupId, String iconKey, String label) { AbstractVertex vertex = new SimpleGroup(getNamespace(), groupId); if (containsVertexId(vertex)) { throw new IllegalArgumentException("A vertex or group with id " + groupId + " already exists!"); } LoggerFactory.getLogger(this.getClass()).debug("Adding a group: {}", groupId); vertex.setLabel(label); vertex.setIconKey(iconKey); addVertices(vertex); return vertex; }
@Override public Edge connectVertices(VertexRef sourceVertextId, VertexRef targetVertextId) { String nextEdgeId = getNextEdgeId(); return connectVertices(nextEdgeId, sourceVertextId, targetVertextId, getEdgeNamespace()); }
protected final AbstractVertex addGroup(String groupId, String iconKey, String label) { AbstractVertex vertex = new SimpleGroup(getVertexNamespace(), groupId); if (containsVertexId(vertex)) { throw new IllegalArgumentException("A vertex or group with id " + groupId + " already exists!"); } LoggerFactory.getLogger(this.getClass()).debug("Adding a group: {}", groupId); vertex.setLabel(label); vertex.setIconKey(iconKey); addVertices(vertex); return vertex; }
/** * Returns true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. * @param generatedId The generated id * @return true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. */ @SuppressWarnings("deprecation") private boolean isValid(String generatedId) { return !provider.containsVertexId(new DefaultVertexRef(provider.getNamespace(), generatedId)); }
/** * Returns true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. * @param generatedId The generated id * @return true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. */ @SuppressWarnings("deprecation") private boolean isValid(String generatedId) { return !provider.containsVertexId(new DefaultVertexRef(provider.getVertexNamespace(), generatedId)); }
protected final AbstractEdge connectVertices(String id, VertexRef sourceId, VertexRef targetId, String namespace) { if (sourceId == null) { if (targetId == null) { LOG.warn("Source and target vertices are null"); return null; } else { LOG.warn("Source vertex is null"); return null; } } else if (targetId == null) { LOG.warn("Target vertex is null"); return null; } SimpleConnector source = new SimpleConnector(sourceId.getNamespace(), sourceId.getId()+"-"+id+"-connector", sourceId); SimpleConnector target = new SimpleConnector(targetId.getNamespace(), targetId.getId()+"-"+id+"-connector", targetId); AbstractEdge edge = new AbstractEdge(namespace, id, source, target); addEdges(edge); return edge; }
@Override public void resetContainer() { clearVertices(); clearEdges(); clearCounters(); }
@Override public Edge connectVertices(VertexRef sourceVertextId, VertexRef targetVertextId) { String nextEdgeId = getNextEdgeId(); return connectVertices(nextEdgeId, sourceVertextId, targetVertextId, getNamespace()); }
protected final AbstractVertex addGroup(String groupId, String iconKey, String label) { AbstractVertex vertex = new SimpleGroup(getNamespace(), groupId); if (containsVertexId(vertex)) { throw new IllegalArgumentException("A vertex or group with id " + groupId + " already exists!"); } LoggerFactory.getLogger(this.getClass()).debug("Adding a group: {}", groupId); vertex.setLabel(label); vertex.setIconKey(iconKey); addVertices(vertex); return vertex; }
/** * Returns true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. * @param generatedId The generated id * @return true if the {@link #provider} does not contain a vertex id '<generatedId>', false otherwise. */ @SuppressWarnings("deprecation") private boolean isValid(String generatedId) { return !provider.containsVertexId(new DefaultVertexRef(provider.getNamespace(), generatedId)); }
protected final AbstractEdge connectVertices(String id, VertexRef sourceId, VertexRef targetId, String namespace) { if (sourceId == null) { if (targetId == null) { LOG.warn("Source and target vertices are null"); return null; } else { LOG.warn("Source vertex is null"); return null; } } else if (targetId == null) { LOG.warn("Target vertex is null"); return null; } SimpleConnector source = new SimpleConnector(sourceId.getNamespace(), sourceId.getId()+"-"+id+"-connector", sourceId); SimpleConnector target = new SimpleConnector(targetId.getNamespace(), targetId.getId()+"-"+id+"-connector", targetId); AbstractEdge edge = new AbstractEdge(namespace, id, source, target); addEdges(edge); return edge; }
@Override public void resetContainer() { clearVertices(); clearEdges(); clearCounters(); }
@Override public final AbstractVertex addGroup(String groupName, String groupIconKey) { String nextGroupId = getNextGroupId(); return addGroup(nextGroupId, groupIconKey, groupName); }
@Override public final AbstractVertex addVertex(int x, int y) { String id = getNextVertexId(); return addVertex(id, x, y); }
@Override public void resetContainer() { super.resetContainer(); }