org.opensourcephysics.display
Class DrawingPanel.ZoomBox

java.lang.Object
  extended by org.opensourcephysics.display.DrawingPanel.ZoomBox
Enclosing class:
DrawingPanel

public class DrawingPanel.ZoomBox
extends java.lang.Object

ZoomBox creates an on-screen rectangle using XORMode for fast redrawing.


Constructor Summary
DrawingPanel.ZoomBox()
           
 
Method Summary
 void drag(int xpix, int ypix)
          Drags the corner of the ZoomBox.
 void hide()
          Hides the zoom box.
 boolean isDragged()
          Reports the drag status of the zoom box.
 boolean isVisible()
          Gets the visibility of the zoom box.
 java.awt.Rectangle reportZoom()
          Reports the zoom rectangle in pixel units.
 void setShowUndraggedBox(boolean show)
          Sets the showUndraggedBox flag.
 void startZoom(int xpix, int ypix)
          Starts the zoom by saving the corner location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawingPanel.ZoomBox

public DrawingPanel.ZoomBox()
Method Detail

startZoom

public void startZoom(int xpix,
                      int ypix)
Starts the zoom by saving the corner location.

Parameters:
xpix -
ypix -

hide

public void hide()
Hides the zoom box.


setShowUndraggedBox

public void setShowUndraggedBox(boolean show)
Sets the showUndraggedBox flag.

Parameters:
show - true to show a zoom box when the mouse is not dragged

drag

public void drag(int xpix,
                 int ypix)
Drags the corner of the ZoomBox. Drag uses XORMode drawing to first erase and then repaint the box.

Parameters:
xpix -
ypix -

isDragged

public boolean isDragged()
Reports the drag status of the zoom box.

Returns:
true if the zoom box has been dragged

isVisible

public boolean isVisible()
Gets the visibility of the zoom box.

Returns:
true if visible

reportZoom

public java.awt.Rectangle reportZoom()
Reports the zoom rectangle in pixel units.