In the above example, a new instance of XSvgMagnifier is created and passed an SVGDiagram instance from the XSvgImageMap class. The JFrame object used to contain the XSvgImageMap object is also passed. The TestSvgMagnifier class implements the MouseMotionListener interface. 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 and displayed in either the window or the magnifying glass.
2. Constructor
public XSvgMagnifier (JFrame imageFrame, XSvgImageMap svgImage)
The constructor takes a JFrame instance which should point to the frame that contains the XSvgImageMap instance. The glass pane of the frame is needed to display 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.
2. setWindowScale
publicvoid setWindowScale(float scale)
Sets the scale factor of the XSvgMagnifyingWindow object used within this class.
3. setGlassScale
publicvoid setGlassScale(float scale)
Sets the scale factor of the XSvgMagnifyingGlass object used within this class.
There are no comments on this page. [Add comment]