I have a contour plot applet that I want to implement panning in. Currently, I can pan the graph any way that I want, but I would like to constrain the allowable panning area so that a user can't pan outside of the dataset range. My current dataset is a 320x240 grid of temperature values with no values outside of that range and they will never be outside that range as we're mapping an image into a contour plot (XYPlot using an XYZDataset). I'm looking at the various methods available in the XYPlot but I can't figure out the process that I should use to limit it so that a user can't pan outside that range.
Has anyone implemented something like this before?
Thanks