public MapViewManager getViewManager() { return m_graphContainer.getMapViewManager(); }
public MapViewManager getViewManager() { return m_graphContainer.getMapViewManager(); }
public void apply(GraphContainer graphContainer, Collection<HistoryOperation> operations) { LOG.debug("Applying " + toString()); // Apply the history for each registered HistoryOperation for (HistoryOperation operation : operations) { try { operation.applyHistory(graphContainer, m_settings); } catch (Throwable e) { LOG.warn("Failed to perform applyHistory() operation", e); } } // Set Vertices in Focus after all other operations are applied, otherwise the topology provider may have changed // which results in a graphContainer.clearCriteria() applyVerticesInFocus(m_focusVertices, graphContainer); applySavedLocations(m_locations, graphContainer.getGraph().getLayout()); graphContainer.setSemanticZoomLevel(getSemanticZoomLevel()); graphContainer.getSelectionManager().setSelectedVertexRefs(m_selectedVertices); // Apply the selected vertices graphContainer.getMapViewManager().setBoundingBox(getBoundingBox()); }
@Override public void centerSearchSuggestion(SearchSuggestion searchSuggestion) { LOG.debug("SearchBox->centerSearchSuggestion: called with searchSuggestion: {}", searchSuggestion); SearchResult searchResult = new SearchResult(searchSuggestion.getNamespace(), searchSuggestion.getId(), searchSuggestion.getLabel(), searchSuggestion.getQuery(), searchSuggestion.isCollapsible(), searchSuggestion.isCollapsed()); Set<VertexRef> vRefs = new TreeSet<>(); Multiset<SearchProvider> keys = m_suggestionMap.keys(); for(SearchProvider key : keys){ Collection<SearchResult> searchResults = m_suggestionMap.get(key); if(searchResults.contains(searchResult)) { key.onCenterSearchResult(searchResult, m_operationContext.getGraphContainer()); vRefs.addAll(key.getVertexRefsBy(searchResult, m_operationContext.getGraphContainer())); break; } } // Hack for now, change to a better way. VertexHopCriteria criteria = VertexHopGraphProvider.getWrappedVertexHopCriteria(m_operationContext.getGraphContainer()); DefaultVertexRef vertexRef = new DefaultVertexRef(searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel()); if(criteria.getVertices().contains(vertexRef)){ vRefs.add(vertexRef); } GraphContainer graphContainer = m_operationContext.getGraphContainer(); MapViewManager mapViewManager = graphContainer.getMapViewManager(); mapViewManager.setBoundingBox(graphContainer.getGraph().getLayout().computeBoundingBox(vRefs)); }
@Override public void centerSearchSuggestion(SearchSuggestion searchSuggestion) { LOG.debug("SearchBox->centerSearchSuggestion: called with searchSuggestion: {}", searchSuggestion); SearchResult searchResult = new SearchResult(searchSuggestion.getNamespace(), searchSuggestion.getId(), searchSuggestion.getLabel(), searchSuggestion.getQuery(), searchSuggestion.isCollapsible(), searchSuggestion.isCollapsed()); Set<VertexRef> vRefs = new TreeSet<>(); Multiset<SearchProvider> keys = m_suggestionMap.keys(); for(SearchProvider key : keys){ Collection<SearchResult> searchResults = m_suggestionMap.get(key); if(searchResults.contains(searchResult)) { key.onCenterSearchResult(searchResult, m_operationContext.getGraphContainer()); vRefs.addAll(key.getVertexRefsBy(searchResult, m_operationContext.getGraphContainer())); break; } } // Hack for now, change to a better way. VertexHopCriteria criteria = VertexHopGraphProvider.getWrappedVertexHopCriteria(m_operationContext.getGraphContainer()); DefaultVertexRef vertexRef = new DefaultVertexRef(searchResult.getNamespace(), searchResult.getId(), searchResult.getLabel()); if(criteria.getVertices().contains(vertexRef)){ vRefs.add(vertexRef); } GraphContainer graphContainer = m_operationContext.getGraphContainer(); MapViewManager mapViewManager = graphContainer.getMapViewManager(); mapViewManager.setBoundingBox(graphContainer.getGraph().getLayout().computeBoundingBox(vRefs)); }
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())); }
graphContainer.setSemanticZoomLevel(getSemanticZoomLevel()); graphContainer.getMapViewManager().setBoundingBox(getBoundingBox());
graphContainer.setSemanticZoomLevel(getSemanticZoomLevel()); graphContainer.getMapViewManager().setBoundingBox(getBoundingBox());
public TopologyComponent(GraphContainer dataSource, IconRepositoryManager iconRepositoryManager, ContextMenuHandler contextMenuHandler) { m_graphContainer = dataSource; m_iconRepoManager = iconRepositoryManager; m_contextMenuHandler = contextMenuHandler; registerRpc(m_rpc); setGraph(m_graphContainer.getGraph()); m_graphContainer.getSelectionManager().addSelectionListener(new SelectionListener() { @Override public void selectionChanged(SelectionContext selectionContext) { if (!m_blockSelectionEvents) { computeBoundsForSelected(selectionContext); } updateGraph(); } }); m_graphContainer.getMapViewManager().addListener(this); m_graphContainer.addChangeListener(this); setScaleDataSource(m_graphContainer.getScaleProperty()); getState().setSVGDefFiles(m_iconRepoManager.getSVGIconFiles()); updateGraph(); }
public TopologyComponent(GraphContainer dataSource, IconRepositoryManager iconRepositoryManager, ContextMenuHandler contextMenuHandler) { m_graphContainer = dataSource; m_iconRepoManager = iconRepositoryManager; m_contextMenuHandler = contextMenuHandler; registerRpc(m_rpc); setGraph(m_graphContainer.getGraph()); m_graphContainer.getSelectionManager().addSelectionListener(new SelectionListener() { @Override public void selectionChanged(SelectionContext selectionContext) { if (!m_blockSelectionEvents) { computeBoundsForSelected(selectionContext); } updateGraph(); } }); m_graphContainer.getMapViewManager().addListener(this); m_graphContainer.addChangeListener(this); setScaleDataSource(m_graphContainer.getScaleProperty()); getState().setSVGDefFiles(m_iconRepoManager.getSVGIconFiles()); updateGraph(); }
private void setupListeners() { getPage().addUriFragmentChangedListener(this); m_selectionManager.addSelectionListener(this); m_graphContainer.addChangeListener(this); m_graphContainer.getMapViewManager().addListener(this); m_menuBar.addMenuItemUpdateListener(this); m_contextMenu.addMenuItemUpdateListener(this); m_graphContainer.addChangeListener(m_searchBox); m_selectionManager.addSelectionListener(m_searchBox); m_graphContainer.addChangeListener(m_verticesUpdateManager); m_selectionManager.addSelectionListener(m_verticesUpdateManager); // Register the Info Panel to listen for certain events final InfoPanelItemManager infoPanelItemManager = new InfoPanelItemManager(); m_selectionManager.addSelectionListener(infoPanelItemManager); m_menuBar.addMenuItemUpdateListener(infoPanelItemManager); m_contextMenu.addMenuItemUpdateListener(infoPanelItemManager); m_graphContainer.addChangeListener(infoPanelItemManager); // Register the Toolbar Panel m_graphContainer.addChangeListener(m_toolbarPanel); m_selectionManager.addSelectionListener(m_toolbarPanel); // Register the Breadcrumb Panel m_graphContainer.addChangeListener(m_breadcrumbComponent); // Register layout hint component m_graphContainer.addChangeListener(m_layoutHintComponent); }
private void setupListeners() { getPage().addUriFragmentChangedListener(this); m_selectionManager.addSelectionListener(this); m_graphContainer.addChangeListener(this); m_graphContainer.getMapViewManager().addListener(this); m_menuBar.addMenuItemUpdateListener(this); m_contextMenu.addMenuItemUpdateListener(this); m_graphContainer.addChangeListener(m_searchBox); m_selectionManager.addSelectionListener(m_searchBox); m_graphContainer.addChangeListener(m_verticesUpdateManager); m_selectionManager.addSelectionListener(m_verticesUpdateManager); // Register the Info Panel to listen for certain events final InfoPanelItemManager infoPanelItemManager = new InfoPanelItemManager(); m_selectionManager.addSelectionListener(infoPanelItemManager); m_menuBar.addMenuItemUpdateListener(infoPanelItemManager); m_contextMenu.addMenuItemUpdateListener(infoPanelItemManager); m_graphContainer.addChangeListener(infoPanelItemManager); // Register the Toolbar Panel m_graphContainer.addChangeListener(m_toolbarPanel); m_selectionManager.addSelectionListener(m_toolbarPanel); // Register the Breadcrumb Panel m_graphContainer.addChangeListener(m_breadcrumbComponent); // Register layout hint component m_graphContainer.addChangeListener(m_layoutHintComponent); }