Class DrawingPanel.ZoomBox

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

public class DrawingPanel.ZoomBox extends Object
ZoomBox creates an on-screen rectangle using XORMode for fast redrawing.
  • Constructor Details

    • ZoomBox

      public ZoomBox()
  • Method Details

    • 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
    • setVisible

      public void setVisible(boolean vis)
      Sets the visibility of the zoom box.
      Parameters:
      true - if visible
    • reportZoom

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