/** * Construct a new controller for the zoom bar. * * @param cc reference to all controllers */ @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") public ZoomBarController(ControllerContainer cc) { this.cc = cc; zoomBarView = new ZoomBarView(); zoomBarView.addMouseListener(new ZoomBarMouseClicked()); zoomBarView.addMouseMotionListener(new ZoomBarMouseDragged()); cc.getGraphController().addGraphMovedListener(this); cc.getGraphController().getGraphView().addGraphLoadedListener(this); cc.getGraphController().getFilteredObservable().addObserver(zoomBarView); }
private void updateView() { zoomBarView.setMaxInterest(cc.getGraphController().getMaxInterest()); zoomBarView.setInterest(cc.getGraphController().getInterest()); zoomBarView.setZoomCenter(cc.getGraphController().getCurrentZoomCenter()); zoomBarView.setViewPercent(cc.getGraphController().getViewPercent()); zoomBarView.setGraphWidth((float) cc.getGraphController().getGraphDimension()); zoomBarView.setOffsetToCenter(cc.getGraphController().getOffsetToCenter()); zoomBarView.moved(); }