public class IlvJScrollPane extends JScrollPane implements IlvVerticalScrollable
IlvJScrollPane class implements the
IlvVerticalScrollable interface for a standard Swing
JScrollPane. As such, it can be used inside a
Gantt configuration to contain and scroll the
table. When scrolled vertically, the
IlvJScrollPane will notify the configuration to which it belongs. It will also be notified by the
configuration when some other UI component scrolls vertically, and it will
then scroll accordingly.JScrollPane.AccessibleJScrollPane, JScrollPane.ScrollBarJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategycolumnHeader, horizontalScrollBar, horizontalScrollBarPolicy, lowerLeft, lowerRight, rowHeader, upperLeft, upperRight, verticalScrollBar, verticalScrollBarPolicy, viewportlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCOLUMN_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, VIEWPORTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
IlvJScrollPane(Component view)
Creates an
IlvJScrollPane that displays the contents of the
specified component, where both horizontal and vertical scroll bars appear
whenever the contents of the component are larger than the view. |
IlvJScrollPane(Component view,
int vsbPolicy,
int hsbPolicy)
Creates an
IlvJScrollPane that displays the contents of the
specified component in a viewport whose view position can be controlled
with a pair of scroll bars. |
| Modifier and Type | Method and Description |
|---|---|
void |
addVerticalScrollListener(VerticalScrollListener listener)
Adds the specified listener to receive vertical scroll events from this
scroll pane.
|
protected JViewport |
createViewport()
Creates and returns a new
JViewport for use by this scroll
pane. |
protected void |
fireMaxVerticalPositionChanged()
Call this method to fire a
maxVerticalPositionChanged event to all registered listeners. |
protected void |
fireVerticalExtentChanged()
Call this method to fire a
verticalExtentChanged
event to all registered listeners. |
protected void |
fireVerticalPositionChanged()
Call this method to fire a
verticalPositionChanged event to all registered listeners. |
int |
getMaxVerticalPosition()
Returns the maximum vertical position that the scroll pane can display.
|
int |
getVerticalExtent()
Returns the extent of the vertical range displayed by the scroll pane.
|
int |
getVerticalPosition()
Returns the beginning of the vertical range displayed by the scroll pane.
|
Color |
getViewportBackground()
Returns the background color of the main
JViewPort. |
boolean |
isOpaque()
Returns
true if this component is completely opaque. |
void |
removeVerticalScrollListener(VerticalScrollListener listener)
Removes the specified listener so that it will no longer receive vertical
scroll events from this scroll pane.
|
void |
setMaxVerticalPosition(int max)
Sets the maximum vertical position that the scroll pane can display.
|
void |
setVerticalExtent(int extent)
Sets the extent of the vertical range displayed by the scroll pane.
|
void |
setVerticalPosition(int position)
Sets the beginning of the vertical range displayed by the scroll pane.
|
void |
setViewportBackground(Color color)
Sets the background color of the main
JViewPort. |
createHorizontalScrollBar, createVerticalScrollBar, getAccessibleContext, getColumnHeader, getCorner, getHorizontalScrollBar, getHorizontalScrollBarPolicy, getRowHeader, getUI, getUIClassID, getVerticalScrollBar, getVerticalScrollBarPolicy, getViewport, getViewportBorder, getViewportBorderBounds, isValidateRoot, isWheelScrollingEnabled, paramString, setColumnHeader, setColumnHeaderView, setComponentOrientation, setCorner, setHorizontalScrollBar, setHorizontalScrollBarPolicy, setLayout, setRowHeader, setRowHeaderView, setUI, setVerticalScrollBar, setVerticalScrollBarPolicy, setViewport, setViewportBorder, setViewportView, setWheelScrollingEnabled, updateUIaddAncestorListener, 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, 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, updateadd, 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, validateTreeaction, 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, transferFocusUpCyclepublic IlvJScrollPane(Component view, int vsbPolicy, int hsbPolicy)
IlvJScrollPane that displays the contents of the
specified component in a viewport whose view position can be controlled
with a pair of scroll bars. The scroll bar policies specify when the
scroll bars are displayed, for example, if vsbPolicy is
VERTICAL_SCROLLBAR_AS_NEEDED then the vertical scroll bar
only appears if the view does not fit vertically.view - The component to display in the scroll pane viewport.vsbPolicy - The vertical scroll bar policy.hsbPolicy - The horizontal scroll bar policy.public IlvJScrollPane(Component view)
IlvJScrollPane that displays the contents of the
specified component, where both horizontal and vertical scroll bars appear
whenever the contents of the component are larger than the view.view - The component to display in the scroll pane viewport.public boolean isOpaque()
true if this component is completely opaque. This
method is overridden to always return true. This mimics the
default JScrollPane behavior as of JDK 1.3. Prior to JDK 1.3,
JScrollPane.isOpaque() returned false if the
view component in the primary viewport did not completely occupy the
full bounds of the viewport.isOpaque in class JComponentpublic Color getViewportBackground()
JViewPort. If the
component or view contained within the viewport does not completely occupy
the viewport, the color returned is the color around its border.setViewportBackground(java.awt.Color)public void setViewportBackground(Color color)
JViewPort. If the
component or view contained within the viewport does not completely occupy
the viewport, the color set will be the color around its border.getViewportBackground()protected JViewport createViewport()
JViewport for use by this scroll
pane.
This method is overridden to return a viewport that is opaque by default.
This mimics the JViewport behavior as of JDK 1.3. Prior to
JDK 1.3, JViewport.isOpaque() returned false by
default.createViewport in class JScrollPanepublic int getMaxVerticalPosition()
getMaxVerticalPosition in interface IlvVerticalScrollablesetMaxVerticalPosition(int)public void setMaxVerticalPosition(int max)
setMaxVerticalPosition in interface IlvVerticalScrollablemax - The maximum position.getMaxVerticalPosition()public int getVerticalPosition()
viewPosition of the scroll pane viewport.getVerticalPosition in interface IlvVerticalScrollablesetVerticalPosition(int)public void setVerticalPosition(int position)
viewPosition of the scroll pane viewport. The
specified value
is compared against the max displayable
value and is trimmed if necessary. A
verticalPositionChanged event is then fired to all
registered listeners.setVerticalPosition in interface IlvVerticalScrollableposition - The new position.getVerticalPosition()public int getVerticalExtent()
getVerticalExtent in interface IlvVerticalScrollablesetVerticalExtent(int)public void setVerticalExtent(int extent)
setVerticalExtent in interface IlvVerticalScrollableextent - The new extent.getVerticalExtent()public void addVerticalScrollListener(VerticalScrollListener listener)
addVerticalScrollListener in interface IlvVerticalScrollablelistener - The listener that will be subscribed to subsequent
scroll events.removeVerticalScrollListener(ilog.views.gantt.event.VerticalScrollListener)public void removeVerticalScrollListener(VerticalScrollListener listener)
removeVerticalScrollListener in interface IlvVerticalScrollablelistener - The listener that will be unsubscribed from receiving
vertical scroll events.addVerticalScrollListener(ilog.views.gantt.event.VerticalScrollListener)protected void fireMaxVerticalPositionChanged()
maxVerticalPositionChanged event to all registered listeners.setMaxVerticalPosition(int)protected void fireVerticalPositionChanged()
verticalPositionChanged event to all registered listeners.setVerticalPosition(int)protected void fireVerticalExtentChanged()
verticalExtentChanged
event to all registered listeners.setVerticalExtent(int)© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.