|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Unsafe: An interface that provides information to a scrolling container like JScrollPane. A complex component that's likely to be used as a viewing a JScrollPane viewport (or other scrolling container) should implement this interface.
JViewport
,
JScrollPane
,
JScrollBar
Method Summary | |
Dimension |
getPreferredScrollableViewportSize()
Enabled: Returns the preferred size of the viewport for a view component. |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Enabled: Components that display logical rows or columns should compute the scroll increment that will completely expose one block of rows or columns, depending on the value of orientation. |
boolean |
getScrollableTracksViewportHeight()
Enabled: Return true if a viewport should always force the height of this Scrollable to match the height of the viewport. |
boolean |
getScrollableTracksViewportWidth()
Enabled: Return true if a viewport should always force the width of this Scrollable to match the width of the viewport. |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Enabled: Components that display logical rows or columns should compute the scroll increment that will completely expose one new row or column, depending on the value of orientation. |
Method Detail |
public Dimension getPreferredScrollableViewportSize()
JComponent.getPreferredSize()
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a unit scroll.
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
JScrollBar.setUnitIncrement(int)
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
Scrolling containers, like JScrollPane, will use this method each time the user requests a block scroll.
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
JScrollBar.setBlockIncrement(int)
public boolean getScrollableTracksViewportWidth()
Scrollable
to match the width of the viewport.
For example a normal
text view that supported line wrapping would return true here, since it
would be undesirable for wrapped lines to disappear beyond the right
edge of the viewport. Note that returning true for a Scrollable
whose ancestor is a JScrollPane effectively disables horizontal
scrolling.
Scrolling containers, like JViewport, will use this method each time they are validated.
public boolean getScrollableTracksViewportHeight()
Scrolling containers, like JViewport, will use this method each time they are validated.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |