Package org.opensourcephysics.display
Class DrawingPanel.ZoomBox
java.lang.Object
org.opensourcephysics.display.DrawingPanel.ZoomBox
- Enclosing class:
- DrawingPanel
ZoomBox creates an on-screen rectangle using XORMode for fast redrawing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrag(int xpix, int ypix) Drags the corner of the ZoomBox.voidhide()Hides the zoom box.booleanReports the drag status of the zoom box.booleanGets the visibility of the zoom box.Reports the zoom rectangle in pixel units.voidsetShowUndraggedBox(boolean show) Sets the showUndraggedBox flag.voidsetVisible(boolean vis) Sets the visibility of the zoom box.voidstartZoom(int xpix, int ypix) Starts the zoom by saving the corner location.
-
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
Reports the zoom rectangle in pixel units.
-