private BoundingBox getBoundingBox() { return getViewManager().getCurrentBoundingBox(); }
@Override public void scrollWheel(double scrollVal, int x, int y) { getViewManager().zoomToPoint(getViewManager().getScale() - scrollVal, new Point(x, y)); }
@Override public void clientCenterPoint(int x, int y) { getViewManager().setCenter(new Point(x, y)); }
@Override public void mapPhysicalBounds(int width, int height) { getState().setPhysicalDimensions(width, height); getViewManager().setViewPort(width, height); getViewManager().setMapBounds(m_graph.getLayout().getBounds()); }
private void computeBoundsForSelected(SelectionContext selectionContext) { if(selectionContext.getSelectedVertexRefs().size() > 0) { Collection<? extends Vertex> visible = m_graphContainer.getGraph().getDisplayVertices(); Collection<VertexRef> selected = selectionContext.getSelectedVertexRefs(); Collection<VertexRef> vRefs = new ArrayList<>(); for(VertexRef vRef : selected) { if(visible.contains(vRef)) { vRefs.add(vRef); } } getViewManager().setBoundingBox(m_graphContainer.getGraph().getLayout().computeBoundingBox(vRefs)); } else { getViewManager().setBoundingBox(m_graphContainer.getGraph().getLayout().getBounds()); } }
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(); }
/** * ValueChange listener for the scale property */ @Override public void valueChange(ValueChangeEvent event) { double scale = (Double) event.getProperty().getValue(); getViewManager().setScale(scale); }
@Override public void boundingBoxChanged(MapViewManager viewManager) { setScale(viewManager.getScale()); updateGraph(); }
private void setGraph(Graph graph) { m_graph = graph; getViewManager().setMapBounds(graph.getLayout().getBounds()); }
public void showAllMap(){ getViewManager().setBoundingBox(m_graphContainer.getGraph().getLayout().getBounds()); }
@Override public void mapPhysicalBounds(int width, int height) { getState().setPhysicalDimensions(width, height); getViewManager().setViewPort(width, height); getViewManager().setMapBounds(m_graph.getLayout().getBounds()); }
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(); }
/** * ValueChange listener for the scale property */ @Override public void valueChange(ValueChangeEvent event) { double scale = (Double) event.getProperty().getValue(); getViewManager().setScale(scale); }
@Override public void boundingBoxChanged(MapViewManager viewManager) { setScale(viewManager.getScale()); updateGraph(); }
private void setGraph(Graph graph) { m_graph = graph; getViewManager().setMapBounds(graph.getLayout().getBounds()); }
private void computeBoundsForSelected(SelectionContext selectionContext) { if(selectionContext.getSelectedVertexRefs().size() > 0) { Collection<? extends Vertex> visible = m_graphContainer.getGraph().getDisplayVertices(); Collection<VertexRef> selected = selectionContext.getSelectedVertexRefs(); Collection<VertexRef> vRefs = new ArrayList<>(); for(VertexRef vRef : selected) { if(visible.contains(vRef)) { vRefs.add(vRef); } } getViewManager().setBoundingBox(m_graphContainer.getGraph().getLayout().computeBoundingBox(vRefs)); } else { getViewManager().setBoundingBox(m_graphContainer.getGraph().getLayout().getBounds()); } }
private BoundingBox getBoundingBox() { return getViewManager().getCurrentBoundingBox(); }
@Override public void scrollWheel(double scrollVal, int x, int y) { getViewManager().zoomToPoint(getViewManager().getScale() - scrollVal, new Point(x, y)); }
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); }
@Override public void clientCenterPoint(int x, int y) { getViewManager().setCenter(new Point(x, y)); }