The XSvgMagnifyingGlass class provides a means of zooming an SVG image in conjunction with the XSvgImageMap class. The zoomed region of the image is displayed within a rendered magnifying glass.
In the above example, a new instance of XSvgMagnifyingGlass is created and passed an SVGDiagram instance from the XSvgImageMap class. The TestSvgMagnifier class implements the MouseMotionListener and MouseListener interfaces. The mouseMoved method of the interface calls the setZoomPoint method of the XSvgMagnifier class, passing the current mouse location to it. The current mouse location is used to determine the part of the SVG image that is zoomed. The mouseEntered and mouseExited methods of the MouseListener interface are used to determine when to run the fade-in and fade-out animations for the magnifying glass.
Used to set which part of the SVG image will be zoomed. This can be added to a mouseMotionListener, there-by utilising the mouse to select the part of the image that is zoomed.
Calls the JComponent's paint method and scales the area that has been selected using setZoomPoint. The scaled area is then applied to the component.
7. stopRenderer
publicvoid stopRenderer()
Stops the renderer thread from running.
8. setRotational
publicvoid setRotational(boolean isRotational )
Sets whether the magnifying glass is rotated to the centre of the image during zooming.
9. setQuality
publicvoid setQuality(boolean quality )
Improves the rendering quality of the magnifying glass.
10. setOpaque
publicvoid setOpaque(boolean isOpaque )
Sets whether the magnifying glass is opaque or not.
11. run
publicvoid run ()
Implemented from the Runnable interface. Called by starting a new thread on the XSvgMagnifyingGlass component, this method handles the fade-in and fade-out animations.
There are no comments on this page. [Add comment]