|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
org.xhtmlrenderer.simple.FSScrollPane
public class FSScrollPane
FSScrollPane is a JScrollPane set up to support keyboard navigation of an XHTML/XML
document rendered with Flying Saucer. In particular, it assigns key bindings to the view's InputMap
for page-up, page-down, line-up/down, page-start and page-end.
The amount the document scrolls is based on the current viewport and the current line height.
If the view is resized, the scroll increment is automatically adjusted. Using FSScrollPane
to display an XHTMLPanel should save you time as your users
will have standard keyboard navigation out of the box.
To use FSScrollPane, just instantiate it and add your XHTMLPanel on instantiation:
XHTMLPanel panel = new XHTMLPanel(); FSScrollPane scroll = new FSScrollPane(view);
The current input mappings to keys are:
InputMap; these Strings will be trigger the relevant Action
associated with the scrolling. To change the key binding for "Scroll to Top" to Alt-Home,
do this:
panel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).
put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, KeyEvent.ALT_MASK), FSScrollPane.PAGE_START);
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JScrollPane |
|---|
JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBar |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
LINE_DOWN
Constant used for mapping a key binding to "scroll down 1 line" |
static String |
LINE_UP
Constant used for mapping a key binding to "scroll up 1 line" |
static String |
PAGE_DOWN
Constant used for mapping a key binding to "scroll down 1 page" |
static String |
PAGE_END
Constant used for mapping a key binding to "scroll to end of document" |
static String |
PAGE_START
Constant used for mapping a key binding to "scroll to top of document" |
static String |
PAGE_UP
Constant used for mapping a key binding to "scroll up 1 page" |
| Fields inherited from class javax.swing.JScrollPane |
|---|
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
FSScrollPane()
|
|
FSScrollPane(JPanel aview)
Instantiates a new FSScrollPane around the given Panel; see class documentation. |
|
| Method Summary | |
|---|---|
void |
setViewportView(Component view)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PAGE_DOWN
public static final String PAGE_UP
public static final String LINE_DOWN
public static final String LINE_UP
public static final String PAGE_END
public static final String PAGE_START
| Constructor Detail |
|---|
public FSScrollPane()
public FSScrollPane(JPanel aview)
| Method Detail |
|---|
public void setViewportView(Component view)
setViewportView in class JScrollPane
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||