@Override protected EdgeRef findSingleSelectedItem(GraphContainer container) { Collection<EdgeRef> selectedEdgeRefs = container.getSelectionManager().getSelectedEdgeRefs(); if (selectedEdgeRefs.size() == 1) { final EdgeRef edgeRef = selectedEdgeRefs.iterator().next(); return edgeRef; } return null; } }
@Override protected Optional<EdgeRef> findSingleSelectedItem(GraphContainer container) { Collection<EdgeRef> selectedEdgeRefs = container.getSelectionManager().getSelectedEdgeRefs(); if (selectedEdgeRefs.size() == 1) { final EdgeRef edgeRef = selectedEdgeRefs.iterator().next(); return Optional.of(edgeRef); } return Optional.empty(); } }
@Override public void backgroundClicked() { m_blockSelectionEvents = true; m_graphContainer.getSelectionManager().deselectAll(); updateMenuItems(); m_blockSelectionEvents = false; }
@Override public void deselectAllItems() { m_graphContainer.getSelectionManager().deselectAll(); }
@Override public void deselectAllItems() { m_graphContainer.getSelectionManager().deselectAll(); }
@Override protected Optional<EdgeRef> findSingleSelectedItem(GraphContainer container) { Collection<EdgeRef> selectedEdgeRefs = container.getSelectionManager().getSelectedEdgeRefs(); if (selectedEdgeRefs.size() == 1) { final EdgeRef edgeRef = selectedEdgeRefs.iterator().next(); return Optional.of(edgeRef); } return Optional.empty(); } }
@Override public void backgroundClicked() { m_blockSelectionEvents = true; m_graphContainer.getSelectionManager().deselectAll(); updateMenuItems(); m_blockSelectionEvents = false; }
public void centerMapOnSelection(){ computeBoundsForSelected(m_graphContainer.getSelectionManager()); }
private Map<String, Object> createContext(final GraphContainer container) { final Map<String, Object> context = Maps.newHashMap(); Optional.ofNullable(Iterables.getOnlyElement(container.getSelectionManager().getSelectedEdgeRefs(), null)) .map(this::createEdgeContext) .ifPresent(context::putAll); Optional.ofNullable(Iterables.getOnlyElement(container.getSelectionManager().getSelectedVertexRefs(), null)) .map(this::createVertexContext) .ifPresent(context::putAll); context.put("measurements", new MeasurementsWrapper(measurementsService)); return context; }
private Map<String, Object> createContext(final GraphContainer container) { final Map<String, Object> context = Maps.newHashMap(); Optional.ofNullable(Iterables.getOnlyElement(container.getSelectionManager().getSelectedEdgeRefs(), null)) .map(this::createEdgeContext) .ifPresent(context::putAll); Optional.ofNullable(Iterables.getOnlyElement(container.getSelectionManager().getSelectedVertexRefs(), null)) .map(this::createVertexContext) .ifPresent(context::putAll); context.put("measurements", new MeasurementsWrapper(measurementsService)); return context; }
@Override protected Optional<VertexRef> findSingleSelectedItem(GraphContainer container) { Collection<VertexRef> selectedVertexRefs = container.getSelectionManager().getSelectedVertexRefs(); if (selectedVertexRefs.size() == 1) { final VertexRef vertexRef = selectedVertexRefs.iterator().next(); Vertex vertex = container.getTopologyServiceClient().getVertex(vertexRef); return Optional.ofNullable(vertex); } return Optional.empty(); } }
@Override protected Optional<VertexRef> findSingleSelectedItem(GraphContainer container) { Collection<VertexRef> selectedVertexRefs = container.getSelectionManager().getSelectedVertexRefs(); if (selectedVertexRefs.size() == 1) { final VertexRef vertexRef = selectedVertexRefs.iterator().next(); Vertex vertex = container.getTopologyServiceClient().getVertex(vertexRef); return Optional.ofNullable(vertex); } return Optional.empty(); } }
@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; } }
private void selectEdge(String edgeKey) { Edge edge = getGraph().getEdgeByKey(edgeKey); m_graphContainer.getSelectionManager().setSelectedEdgeRefs(Collections.singleton(edge)); }
private void focusOnVertices(VertexRef target, Set<GraphVertex> graphVerticesToFocus, GraphContainer container) { // add to focus removeHopCriteria(container); graphVerticesToFocus.forEach(graphVertex -> container.addCriteria( new DefaultVertexHopCriteria(createTopologyVertex(graphVertex)))); // add the context vertex because it is missing in the root cause result container.addCriteria(new DefaultVertexHopCriteria(target)); container.setSemanticZoomLevel(0); // Remove the current selection before redrawing the layout in order // to avoid centering on the current vertex container.getSelectionManager().setSelectedVertexRefs(Collections.emptyList()); container.getSelectionManager().setSelectedEdgeRefs(Collections.emptyList()); container.redoLayout(); }
@Override public void graphChanged(GraphContainer container) { Graph graph = container.getGraph(); setGraph(graph); if(!m_blockSelectionEvents){ computeBoundsForSelected(m_graphContainer.getSelectionManager()); } updateGraph(); }
@Override public void graphChanged(GraphContainer container) { Graph graph = container.getGraph(); setGraph(graph); if(!m_blockSelectionEvents){ computeBoundsForSelected(m_graphContainer.getSelectionManager()); } updateGraph(); }
public SavedHistory(GraphContainer graphContainer, Collection<HistoryOperation> operations) { this( graphContainer.getSemanticZoomLevel(), graphContainer.getMapViewManager().getCurrentBoundingBox(), saveLocations(graphContainer.getGraph()), getUnmodifiableSet(graphContainer.getSelectionManager().getSelectedVertexRefs()), getFocusVertices(graphContainer), getOperationSettings(graphContainer, operations) ); }
public SavedHistory(GraphContainer graphContainer, Collection<HistoryOperation> operations) { this( graphContainer.getSemanticZoomLevel(), graphContainer.getMapViewManager().getCurrentBoundingBox(), saveLocations(graphContainer.getGraph()), getUnmodifiableSet(graphContainer.getSelectionManager().getSelectedVertexRefs()), getFocusVertices(graphContainer), getOperationSettings(graphContainer, operations), getSearchQueries(graphContainer.getCriteria())); }
public SavedHistory(GraphContainer graphContainer, Collection<HistoryOperation> operations) { this( graphContainer.getSemanticZoomLevel(), graphContainer.getMapViewManager().getCurrentBoundingBox(), saveLocations(graphContainer.getGraph()), getUnmodifiableSet(graphContainer.getSelectionManager().getSelectedVertexRefs()), getFocusVertices(graphContainer), getOperationSettings(graphContainer, operations), getSearchQueries(graphContainer.getCriteria())); }