japlot.jaxodraw
Class JaxoZoom
- java.lang.Object
-
- japlot.jaxodraw.JaxoZoom
-
public class JaxoZoom extends java.lang.ObjectA zoom on the canvas.
-
-
Constructor Summary
Constructors Constructor and Description JaxoZoom()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadjustZoomWindow(int oldX, int oldY, int newX, int newY)Adjusts the zoom when the zoom window gets dragged.voiddragZoomWindow(int eX, int eY)Drags the zoom when the zoom window gets dragged.voiddrawZoomWindow()Draws the zoom by clipping to the zoom window and scaling the background image.voideraseZoomWindow()Erases the zoom window.java.awt.ImagegetBackground()Returns the background image of the zoom.intgetCanvasHeight()Returns the height of the canvas (the portion of the image that is visible).intgetCanvasWidth()Returns the width of the canvas (the portion of the image that is visible).java.awt.GraphicsgetGraphics()Returns the graphics context of the zoom.intgetImageHeight()Returns the height of the image.intgetImageWidth()Returns the width of the image.intgetZoomFactor()Returns the zoom factor.intgetZoomWindowHeight()Returns the height of the zoom window.intgetZoomWindowWidth()Returns the width of the zoom window.intgetZoomWindowX()Returns the x-coordinate of the ZoomWindow's origin.intgetZoomWindowY()Returns the y-coordinate of the ZoomWindow's origin.voidsetBackground(java.awt.Image bg)Sets the background image for the zoom.voidsetCanvasHeight(int cHeight)Sets the height of the canvas (the portion of the image that is visible).voidsetCanvasWidth(int cWidth)Sets the width of the canvas (the portion of the image that is visible).voidsetGraphics(java.awt.Graphics gr)Sets the graphics context for the zoom.voidsetImageHeight(int iHeight)Sets the height of the image.voidsetImageWidth(int iWidth)Sets the width of the image.voidsetTmpImage()Sets the temporary image that is used for double-buffering the zoom.voidsetZoomFactor(int zf)Sets the zoom factor.voidsetZoomWindowHeight(int zwHeight)Sets the height of the zoom window.voidsetZoomWindowWidth(int zwWidth)Sets the width of the zoom window.voidsetZoomWindowX(int x)Sets the x-coordinate of the ZoomWindow's origin.voidsetZoomWindowY(int y)Sets the y-coordinate of the ZoomWindow's origin.
-
-
-
Method Detail
-
setZoomFactor
public final void setZoomFactor(int zf)
Sets the zoom factor.- Parameters:
zf- The zoom factor.
-
getZoomFactor
public final int getZoomFactor()
Returns the zoom factor.- Returns:
- The zoom factor.
-
setZoomWindowWidth
public final void setZoomWindowWidth(int zwWidth)
Sets the width of the zoom window.- Parameters:
zwWidth- The width of the zoom window.
-
getZoomWindowWidth
public final int getZoomWindowWidth()
Returns the width of the zoom window.- Returns:
- The width of the zoom window.
-
setZoomWindowHeight
public final void setZoomWindowHeight(int zwHeight)
Sets the height of the zoom window.- Parameters:
zwHeight- The width of the zoom window.
-
getZoomWindowHeight
public final int getZoomWindowHeight()
Returns the height of the zoom window.- Returns:
- The height of the zoom window.
-
setImageWidth
public final void setImageWidth(int iWidth)
Sets the width of the image.- Parameters:
iWidth- The width of the image.
-
getImageWidth
public final int getImageWidth()
Returns the width of the image.- Returns:
- The width of the image.
-
setImageHeight
public final void setImageHeight(int iHeight)
Sets the height of the image.- Parameters:
iHeight- The width of the image.
-
getImageHeight
public final int getImageHeight()
Returns the height of the image.- Returns:
- The height of the image.
-
setCanvasWidth
public final void setCanvasWidth(int cWidth)
Sets the width of the canvas (the portion of the image that is visible).- Parameters:
cWidth- The width of the canvas.
-
getCanvasWidth
public final int getCanvasWidth()
Returns the width of the canvas (the portion of the image that is visible).- Returns:
- The width of the canvas.
-
setCanvasHeight
public final void setCanvasHeight(int cHeight)
Sets the height of the canvas (the portion of the image that is visible).- Parameters:
cHeight- The height of the canvas.
-
getCanvasHeight
public final int getCanvasHeight()
Returns the height of the canvas (the portion of the image that is visible).- Returns:
- The height of the canvas.
-
setZoomWindowX
public final void setZoomWindowX(int x)
Sets the x-coordinate of the ZoomWindow's origin.- Parameters:
x- The x-coordinate of the ZoomWindow's origin.
-
getZoomWindowX
public final int getZoomWindowX()
Returns the x-coordinate of the ZoomWindow's origin.- Returns:
- The x-coordinate of the ZoomWindow's origin.
-
setZoomWindowY
public final void setZoomWindowY(int y)
Sets the y-coordinate of the ZoomWindow's origin.- Parameters:
y- The y-coordinate of the ZoomWindow's origin.
-
getZoomWindowY
public final int getZoomWindowY()
Returns the y-coordinate of the ZoomWindow's origin.- Returns:
- The y-coordinate of the ZoomWindow's origin.
-
setBackground
public final void setBackground(java.awt.Image bg)
Sets the background image for the zoom.- Parameters:
bg- The background image.
-
setTmpImage
public final void setTmpImage()
Sets the temporary image that is used for double-buffering the zoom.
-
getBackground
public final java.awt.Image getBackground()
Returns the background image of the zoom.- Returns:
- The background image.
-
setGraphics
public final void setGraphics(java.awt.Graphics gr)
Sets the graphics context for the zoom.- Parameters:
gr- The graphics context.
-
getGraphics
public final java.awt.Graphics getGraphics()
Returns the graphics context of the zoom.- Returns:
- The graphics context.
-
drawZoomWindow
public final void drawZoomWindow()
Draws the zoom by clipping to the zoom window and scaling the background image.
-
eraseZoomWindow
public final void eraseZoomWindow()
Erases the zoom window.
-
adjustZoomWindow
public final void adjustZoomWindow(int oldX, int oldY, int newX, int newY)Adjusts the zoom when the zoom window gets dragged.- Parameters:
oldX- The old x-coordinate of the zoom window.oldY- The old y-coordinate of the zoom window.newX- The new x-coordinate of the zoom window.newY- The new y-coordinate of the zoom window.
-
dragZoomWindow
public final void dragZoomWindow(int eX, int eY)Drags the zoom when the zoom window gets dragged.- Parameters:
eX- The x-coordinate of the center of the zoom window (where the mouse event occurred).eY- The y-coordinate of the center of the zoom window.
-
-
DMelt 3.0 © DataMelt by jWork.ORG