* @param y Document coordinate
* @see CH.ifa.draw.framework.Tool#mouseUp(MouseEvent, int, int)
*/
public void mouseUp(MouseEvent e, int x, int y)
{
Modeler modeler = miniView.getModeler();
if (modeler != null)
{
if (e.getClickCount() == 2)
{
modeler.setScaleFactor(1.0);
modeler.centerTrackerAt(calculateDocumentCoordinates(e.getPoint()));
}
else if (tracking)
{
miniView.setTrackRect(null);
int rx = x < lastX ? x : lastX;
int ry = y < lastY ? y : lastY;
int w = x < lastX ? lastX - x : x - lastX;
int h = y < lastX ? lastY - y : y - lastY;
Rectangle r = new Rectangle(rx, ry, w, h);
modeler.setVisibleArea(calculateDocumentCoordinates(r));
}
else
{
modeler.centerTrackerAt(calculateDocumentCoordinates(e.getPoint()));
}
}
tracking = false;