org.apache.batik.swing
public class JSVGScrollPane extends JPanel
Reimplementation, rather than imlementing the Scrollable interface, provides several advantages. The main advantage is the ability to control more precisely ScrollBar events; fewer JSVGCanvas updates are required when scrolling. This creates a significant performance (reflected by an increase in scroll speed) advantage compared to implementing the Scrollable interface.
Nested Class Summary | |
---|---|
protected class | JSVGScrollPane.SBListener
Advanced JScrollBar listener.
|
protected class | JSVGScrollPane.ScrollListener Handle scroll, zoom, and resize events |
Field Summary | |
---|---|
protected JSVGCanvas | canvas |
protected Component | cornerBox |
protected JScrollBar | horizontal |
protected JPanel | horizontalPanel |
protected JSVGScrollPane.SBListener | hsbListener |
protected boolean | ignoreScrollChange |
protected boolean | scrollbarsAlwaysVisible |
protected JScrollBar | vertical |
protected Rectangle2D | viewBox |
protected JSVGScrollPane.SBListener | vsbListener |
Constructor Summary | |
---|---|
JSVGScrollPane(JSVGCanvas canvas)
Creates a JSVGScrollPane, which will scroll an JSVGCanvas. |
Method Summary | |
---|---|
protected void | checkAndSetViewBoxRect()
Derives the SVG Viewbox from the SVG root element.
|
protected SVGDocumentLoaderListener | createLoadListener()
Factory method so subclasses can override the default load listener. |
protected JSVGScrollPane.SBListener | createScrollBarListener(boolean isVertical)
Scrollbar listener factory method so subclasses can
override the default SBListener behaviour. |
protected JSVGScrollPane.ScrollListener | createScrollListener()
Factory method so subclasses can override the default listener behaviour |
JSVGCanvas | getCanvas() |
boolean | getScrollbarsAlwaysVisible() |
protected Rectangle2D | getViewBoxRect() |
void | reset()
Resets this object (for reloads),
releasing any cached data and recomputing
scroll extents. |
protected void | resizeScrollBars()
Compute the scrollbar extents, and determine if
scrollbars should be visible.
|
void | scaleChange(float scale)
Called when the scale size changes. |
void | setScrollbarsAlwaysVisible(boolean vis) |
protected void | setScrollPosition()
Sets the translation portion of the transform based upon the
current scroll bar position |
protected void | updateScrollbarState(boolean hNeeded, boolean vNeeded) |
protected Dimension | updateScrollbarVisibility(int tx, int ty, int maxW, int maxH) |