@Override public Vertex getVertex(String namespace, String id) { return m_delegate.getVertex(namespace, id); }
@Override public Vertex getVertex(String namespace, String id) { return m_delegate.getVertex(namespace, id); }
@Override public Vertex getVertex(String namespace, String id) { return m_delegate.getVertex(namespace, id); }
@Override public Vertex getVertex(String namespace, String vertexId) { return topologyService.getGraphProvider(metaTopologyId, namespace).getVertex(namespace, vertexId); }
@Override public Vertex getVertex(VertexRef target, Criteria... criteria) { return topologyService.getGraphProvider(metaTopologyId, namespace).getVertex(target, criteria); }
@Override public Vertex getVertex(String namespace, String vertexId) { return topologyService.getGraphProvider(metaTopologyId, namespace).getVertex(namespace, vertexId); }
private VertexRef getVertex(GraphMLNode node) { return graphsByNamespace.values().stream() .map(g -> g.getVertex(g.getNamespace(), node.getId())) .filter(Objects::nonNull) .findFirst().orElse(null); }
@Override public Vertex getVertex(VertexRef target, Criteria... criteria) { return topologyService.getGraphProvider(metaTopologyId, namespace).getVertex(target, criteria); }
private VertexRef getVertex(GraphMLNode node) { return graphsByNamespace.values().stream() .map(g -> g.getVertex(g.getNamespace(), node.getId())) .filter(Objects::nonNull) .findFirst().orElse(null); }
@Override protected VertexRef findSingleSelectedItem(GraphContainer container) { Collection<VertexRef> selectedVertexRefs = container.getSelectionManager().getSelectedVertexRefs(); if (selectedVertexRefs.size() == 1) { final VertexRef vertexRef = selectedVertexRefs.iterator().next(); Vertex vertex = container.getBaseTopology().getVertex(vertexRef); return vertex; } return null; } }
public SimpleGraphBuilder parent(String parentId) { Vertex parent = m_graphProvider.getVertex(ns(), parentId); m_graphProvider.setParent(m_currentVertex, parent); return this; }
public SimpleGraphBuilder parent(String parentId) { Vertex parent = m_graphProvider.getVertex(ns(), parentId); m_graphProvider.setParent(m_currentVertex, parent); return this; }
protected static Vertex getVertexItem(final OperationContext operationContext, final VertexRef target) { Vertex vertex = operationContext.getGraphContainer().getBaseTopology().getVertex(target, operationContext.getGraphContainer().getCriteria()); if (vertex == null) { LoggerFactory.getLogger(AbstractOperation.class).debug("Null vertex found for vertex reference: {}:{}", target.getNamespace(), target.getId()); return null; } else { return vertex; } }
@Override public Vertex getVertex(VertexRef reference, Criteria... criteria) { for (CollapsibleCriteria criterium : getCollapsedCriteria(criteria)) { Vertex collapsed = criterium.getCollapsedRepresentation(); if (new RefComparator().compare(collapsed, reference) == 0) { return collapsed; } } return m_delegate.getVertex(reference, criteria); }
@Override public Vertex getVertex(VertexRef reference, Criteria... criteria) { for (CollapsibleCriteria criterium : getCollapsedCriteria(criteria)) { Vertex collapsed = criterium.getCollapsedRepresentation(); if (new RefComparator().compare(collapsed, reference) == 0) { return collapsed; } } return m_delegate.getVertex(reference, criteria); }
@Override public Vertex getVertex(VertexRef reference, Criteria... criteria) { for (CollapsibleCriteria criterium : getCollapsedCriteria(criteria)) { Vertex collapsed = criterium.getCollapsedRepresentation(); if (new RefComparator().compare(collapsed, reference) == 0) { return collapsed; } } return m_delegate.getVertex(reference, criteria); }
@Override public void onFocusSearchResult(SearchResult searchResult, OperationContext operationContext) { final GraphContainer graphContainer = operationContext.getGraphContainer(); final DefaultVertexRef vertexRef = new DefaultVertexRef(searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel()); if (graphContainer.getTopologyServiceClient().getVertex(vertexRef) == null) { // The vertex to add to focus is not in the current layer // Find the GraphProvider it belongs to Optional<GraphProvider> first = graphContainer.getTopologyServiceClient().getGraphProviders().stream() .filter(eachProvider -> eachProvider.getNamespace().equals(searchResult.getNamespace())) .findFirst(); // If there is a graph provider (which should) select it if (first.isPresent() && first.get().getVertex(vertexRef) != null) { graphContainer.selectTopologyProvider(first.get()); graphContainer.clearCriteria(); } } super.onFocusSearchResult(searchResult, operationContext); }
@Override public void onFocusSearchResult(SearchResult searchResult, OperationContext operationContext) { final GraphContainer graphContainer = operationContext.getGraphContainer(); final DefaultVertexRef vertexRef = new DefaultVertexRef(searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel()); if (graphContainer.getTopologyServiceClient().getVertex(vertexRef) == null) { // The vertex to add to focus is not in the current layer // Find the GraphProvider it belongs to Optional<GraphProvider> first = graphContainer.getTopologyServiceClient().getGraphProviders().stream() .filter(eachProvider -> eachProvider.getNamespace().equals(searchResult.getNamespace())) .findFirst(); // If there is a graph provider (which should) select it if (first.isPresent() && first.get().getVertex(vertexRef) != null) { graphContainer.selectTopologyProvider(first.get()); graphContainer.clearCriteria(); } } super.onFocusSearchResult(searchResult, operationContext); }
public SimpleGraphBuilder edge(String id, String srcId, String tgtId) { VertexRef srcVertex = m_graphProvider.getVertex(ns(), srcId); if (srcVertex == null) { srcVertex = new DefaultVertexRef(ns(), srcId); } VertexRef tgtVertex = m_graphProvider.getVertex(ns(), tgtId); if (tgtVertex == null) { tgtVertex = new DefaultVertexRef(ns(), tgtId); } SimpleConnector source = new SimpleConnector(ns(), srcId+"-"+id+"-connector", srcVertex); SimpleConnector target = new SimpleConnector(ns(), tgtId+"-"+id+"-connector", tgtVertex); m_currentEdge = new AbstractEdge(ns(), id, source, target); source.setEdge(m_currentEdge); target.setEdge(m_currentEdge); m_graphProvider.addEdges(m_currentEdge); return this; }
public SimpleGraphBuilder edge(String id, String srcId, String tgtId) { VertexRef srcVertex = m_graphProvider.getVertex(ns(), srcId); if (srcVertex == null) { srcVertex = new DefaultVertexRef(ns(), srcId); } VertexRef tgtVertex = m_graphProvider.getVertex(ns(), tgtId); if (tgtVertex == null) { tgtVertex = new DefaultVertexRef(ns(), tgtId); } SimpleConnector source = new SimpleConnector(ns(), srcId+"-"+id+"-connector", srcVertex); SimpleConnector target = new SimpleConnector(ns(), tgtId+"-"+id+"-connector", tgtVertex); m_currentEdge = new AbstractEdge(ns(), id, source, target); source.setEdge(m_currentEdge); target.setEdge(m_currentEdge); m_graphProvider.addEdges(m_currentEdge); return this; }