final Point2D source = new Point2D.Double(0, 0);
double percentage = 0.01;
XYPlot plot = chart.getXYPlot();
NewStarMessage newStarMsg = Mediator.getInstance()
.getLatestNewStarMessage();
List<ValidObservation> obs = newStarMsg.getObservations();
switch (msg.getPanType()) {
case LEFT:
if (plot.getDomainAxis().getLowerBound() >= obs.get(0)
.getJD()) {
plot.panDomainAxes(-percentage, plotInfo, source);
} else {
if (newStarMsg.getNewStarType() == NewStarType.NEW_STAR_FROM_DATABASE) {
// TODO: ask whether to read more AID data before
// last JD
}
}
break;
case RIGHT:
if (plot.getDomainAxis().getUpperBound() <= obs.get(
obs.size() - 1).getJD()) {
plot.panDomainAxes(percentage, plotInfo, source);
} else {
if (newStarMsg.getNewStarType() == NewStarType.NEW_STAR_FROM_DATABASE) {
// TODO: ask whether to read more AID data after
// last JD
}
}
break;
case UP:
if (newStarMsg.getMinMag() <= plot.getRangeAxis()
.getLowerBound()) {
plot.panRangeAxes(percentage, plotInfo, source);
}
break;
case DOWN:
if (newStarMsg.getMaxMag() >= plot.getRangeAxis()
.getUpperBound()) {
plot.panRangeAxes(-percentage, plotInfo, source);
}
break;
}