public class SimpleScrollPane
extends javax.swing.JScrollPane
implements javax.swing.event.ChangeListener, java.awt.event.MouseWheelListener
SimpleScrollPane
is a special scroll pane. There is no scroll bar. It just uses four scroll buttons to
do the scrolling.Modifier and Type | Class and Description |
---|---|
class |
SimpleScrollPane.ScrollButton
The scroll button for SimpleScrollPane.
|
javax.swing.JScrollPane.AccessibleJScrollPane, javax.swing.JScrollPane.ScrollBar
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCROLL_DOWN_BUTTON |
static java.lang.String |
SCROLL_LEFT_BUTTON |
static java.lang.String |
SCROLL_RIGHT_BUTTON |
static java.lang.String |
SCROLL_UP_BUTTON |
columnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewport
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
COLUMN_HEADER, HORIZONTAL_SCROLLBAR, HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_POLICY, LOWER_LEADING_CORNER, LOWER_LEFT_CORNER, LOWER_RIGHT_CORNER, LOWER_TRAILING_CORNER, ROW_HEADER, UPPER_LEADING_CORNER, UPPER_LEFT_CORNER, UPPER_RIGHT_CORNER, UPPER_TRAILING_CORNER, VERTICAL_SCROLLBAR, VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED, VERTICAL_SCROLLBAR_NEVER, VERTICAL_SCROLLBAR_POLICY, VIEWPORT
Constructor and Description |
---|
SimpleScrollPane()
Creates an empty (no viewport view)
JideScrollPane where both horizontal and vertical scrollbars
appear when needed. |
SimpleScrollPane(java.awt.Component view)
Creates a
JideScrollPane that displays the contents of the specified component, where both
horizontal and vertical scrollbars appear whenever the component's contents are larger than the view. |
SimpleScrollPane(java.awt.Component view,
int vsbPolicy,
int hsbPolicy)
Creates a
JideScrollPane that displays the view component in a viewport whose view position can be
controlled with a pair of scrollbars. |
SimpleScrollPane(int vsbPolicy,
int hsbPolicy)
Creates an empty (no viewport view)
JideScrollPane with specified scrollbar policies. |
Modifier and Type | Method and Description |
---|---|
protected javax.swing.AbstractButton |
createScrollButton(int type)
Creates the scroll button.
|
int |
getHorizontalUnitIncrement() |
int |
getRepeatDelay()
Gets the delay in ms between each unit scrolling.
|
javax.swing.AbstractButton |
getScrollDownButton() |
javax.swing.AbstractButton |
getScrollLeftButton() |
javax.swing.AbstractButton |
getScrollRightButton() |
javax.swing.AbstractButton |
getScrollUpButton() |
int |
getVerticalUnitIncrement() |
java.awt.Rectangle |
getViewportBorderBounds() |
boolean |
isScrollOnRollover()
Checks if the scroll button scrolls on rollover.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e) |
void |
scroll(javax.swing.JViewport viewport,
int type) |
void |
setHorizontalUnitIncrement(int horizontalUnitIncrement) |
void |
setRepeatDelay(int repeatDelay)
Sets the delay in ms between each unit scrolling.
|
void |
setScrollDownButton(javax.swing.AbstractButton scrollDownButton) |
void |
setScrollLeftButton(javax.swing.AbstractButton scrollLeftButton) |
void |
setScrollOnRollover(boolean scrollOnRollover)
Sets scroll on rollover.
|
void |
setScrollRightButton(javax.swing.AbstractButton scrollRightButton) |
void |
setScrollUpButton(javax.swing.AbstractButton scrollUpButton) |
void |
setVerticalUnitIncrement(int verticalUnitIncrement) |
void |
setWheelScrollingEnabled(boolean handleWheel) |
void |
stateChanged(javax.swing.event.ChangeEvent e) |
protected void |
updateButtonState() |
void |
updateUI() |
createHorizontalScrollBar, createVerticalScrollBar, createViewport, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String SCROLL_UP_BUTTON
public static final java.lang.String SCROLL_DOWN_BUTTON
public static final java.lang.String SCROLL_LEFT_BUTTON
public static final java.lang.String SCROLL_RIGHT_BUTTON
public SimpleScrollPane(java.awt.Component view, int vsbPolicy, int hsbPolicy)
JideScrollPane
that displays the view component in a viewport whose view position can be
controlled with a pair of scrollbars. The scrollbar policies specify when the scrollbars are displayed, For
example, if vsbPolicy
is VERTICAL_SCROLLBAR_AS_NEEDED
then the vertical scrollbar only
appears if the view doesn't fit vertically. The available policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int)
and JScrollPane.setHorizontalScrollBarPolicy(int)
.view
- the component to display in the scrollpanes viewportvsbPolicy
- an integer that specifies the vertical scrollbar policyhsbPolicy
- an integer that specifies the horizontal scrollbar policyJScrollPane.setViewportView(java.awt.Component)
public SimpleScrollPane(java.awt.Component view)
JideScrollPane
that displays the contents of the specified component, where both
horizontal and vertical scrollbars appear whenever the component's contents are larger than the view.view
- the component to display in the scrollpane's viewportJScrollPane.setViewportView(java.awt.Component)
public SimpleScrollPane(int vsbPolicy, int hsbPolicy)
JideScrollPane
with specified scrollbar policies. The available
policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int)
and JScrollPane.setHorizontalScrollBarPolicy(int)
.vsbPolicy
- an integer that specifies the vertical scrollbar policyhsbPolicy
- an integer that specifies the horizontal scrollbar policyJScrollPane.setViewportView(java.awt.Component)
public SimpleScrollPane()
JideScrollPane
where both horizontal and vertical scrollbars
appear when needed.public void updateUI()
updateUI
in class javax.swing.JScrollPane
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public javax.swing.AbstractButton getScrollUpButton()
public void setScrollUpButton(javax.swing.AbstractButton scrollUpButton)
public javax.swing.AbstractButton getScrollDownButton()
public void setScrollDownButton(javax.swing.AbstractButton scrollDownButton)
public javax.swing.AbstractButton getScrollLeftButton()
public void setScrollLeftButton(javax.swing.AbstractButton scrollLeftButton)
public javax.swing.AbstractButton getScrollRightButton()
public void setScrollRightButton(javax.swing.AbstractButton scrollRightButton)
protected javax.swing.AbstractButton createScrollButton(int type)
SimpleScrollPane pane = new SimpleScrollPane(){
protected AbstractButton createScrollButton(int type) {
AbstractButton scrollButton = super.createScrollButton(type);
scrollButton.setPreferredSize(new Dimension(20, 20));
return scrollButton;
}
};
type
- the type of the scroll button. It could be SwingConstants.NORTH
, SwingConstants.SOUTH
, SwingConstants.WEST
or SwingConstants.EAST
.protected void updateButtonState()
public void scroll(javax.swing.JViewport viewport, int type)
public java.awt.Rectangle getViewportBorderBounds()
getViewportBorderBounds
in class javax.swing.JScrollPane
public int getHorizontalUnitIncrement()
public void setHorizontalUnitIncrement(int horizontalUnitIncrement)
public int getVerticalUnitIncrement()
public void setVerticalUnitIncrement(int verticalUnitIncrement)
public boolean isScrollOnRollover()
public void setScrollOnRollover(boolean scrollOnRollover)
scrollOnRollover
- true or false.public int getRepeatDelay()
public void setRepeatDelay(int repeatDelay)
repeatDelay
- the new repeat delay.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public void setWheelScrollingEnabled(boolean handleWheel)
setWheelScrollingEnabled
in class javax.swing.JScrollPane