PlotNavigator extends AbstractNavigator { public void setCenter(PointND<? extends Number> center) { if (!isPannable()) { return; } PointND<? extends Number> centerOld = getCenter(); if (centerOld.equals(center)) { return; } List<String> axesNames = getAxes(); int axisIndex = 0; for (String axisName : axesNames) { NavigationInfo info = getInfo(axisName); if (info != null) { Number centerCoordNew = center.get(axisIndex); info.setCenter(centerCoordNew.doubleValue()); } axisIndex++; } NavigationEvent<PointND<? extends Number>> event = new NavigationEvent<>(this, centerOld, center); fireCenterChanged(event); refresh(); } PlotNavigator(Plot plot, List<String> axesNames);  PlotNavigator(Plot plot, String... axesNames); double getZoom(); void setZoom(double zoomNew); PointND<? extends Number> getCenter(); void setCenter(PointND<? extends Number> center); void pan(PointND<? extends Number> deltas); void setDefaultState(); void reset();  }
@Test public void testCenter() { nav.setCenter(new PointND<>(0.0, 0.0)); assertEquals(-4.0, plot.getAxis(XYPlot.AXIS_X).getMin().doubleValue(), DELTA); assertEquals(4.0, plot.getAxis(XYPlot.AXIS_X).getMax().doubleValue(), DELTA); }