*/
public void setSelectedArea(Rectangle2D r) {
_selectedArea = r;
if (_imageDisplay == null || r == null)
return;
CoordinateConverter wcs = _imageDisplay.getCoordinateConverter();
if (!wcs.isWCS()) {
//DialogUtil.error("The image does not support world coordinates.");
return;
}
// get the center position
Point2D.Double center = new Point2D.Double(r.getX() + r.getWidth() / 2.,
r.getY() + r.getHeight() / 2.);
wcs.screenToWorldCoords(center, false);
double equinox = wcs.getEquinox();
WorldCoords centerPos = new WorldCoords(center, equinox);
// get the radius in arcmin
Point2D.Double p = new Point2D.Double(r.getX(), r.getY());
wcs.screenToWorldCoords(p, false);
WorldCoords origin = new WorldCoords(p, equinox);
double radius = centerPos.dist(origin);
// get the image width and height in arcmin
Point2D.Double dims = new Point2D.Double(r.getWidth(), r.getHeight());
wcs.screenToWorldCoords(dims, true);
double width = dims.x * 60; // convert deg to arcmin
double height = dims.y * 60;
// set the values in the query panel
CatalogQueryPanel catalogQueryPanel = getCatalogQueryPanel();