public abstract class ScrollPane<O extends OutputManager<?>> extends AbstractContainer<O> implements WidgetWithConfig<BaseConfig>, ScrollListener
Viewport -
scroll bars and ScrollableWidget. Scroll bars provide a visual feedback
of the scroll state, viewport marks the visible portion of ScrollableWidget,
the widget being scrolled. The class also functions as the scroll event hub,
it makes sure the events are dispatched by the right sub-components.| Modifier and Type | Field and Description |
|---|---|
protected BaseConfig |
config
Attribute container.
|
private java.lang.String |
label
New label to be used with this container.
|
protected BorderedPanel<O> |
rootPanel
The root panel, holds border, contains scroll bars and viewport.
|
private Viewport<O> |
viewport
View port for the visible part of the pane.
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
ScrollPane(ScrollableWidget<O> widget)
Create a ScrollPane that displays the contents of the specified widget.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterConfigUpdate(BaseConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
protected double |
calcHscroll(Dimension childSize,
Dimension extentSize,
Point viewPosition)
Calculate horizontal thumbnail position.
|
Dimension |
calcInitialViewportSize()
Calculates and returns initial viewport size.
|
protected double |
calcVscroll(Dimension childSize,
Dimension extentSize,
Point viewPosition)
Calculate vertical thumbnail position.
|
BaseConfig |
config()
Provide access to the attributes stored in the widget.
|
void |
doLayout()
Lay out container.
|
abstract void |
draw()
The main renderer for this container.
|
abstract void |
draw(Widget<O>[] list)
The secondary renderer for this container.
|
Border<O> |
getBorder()
Get the effective border implementation.
|
Widget<O> |
getChild()
Getting the wrapped component from the scroll pane.
|
BorderedPanel<O> |
getRootPanel()
Get the root panel.
|
void |
handleScrollEvent(ScrollEvent event)
This method is invoked when scroll pane is scrolled.
|
void |
initialize(WidgetId id,
BaseConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
boolean |
isFocusable()
Checks whether this attribute container can receive focus generally.
|
Dimension |
minimumSize()
Get widget minimum size.
|
void |
setBorder(Border<O> border)
Set a border implementation.
|
void |
setLocation(Point point)
Setting the location of this component.
|
void |
setScrollBars(ScrollBar.Bars bars)
Set container scroll bars.
|
void |
setSize(double width,
double height)
Set container size.
|
Viewport<O> |
viewport()
Get pane viewport.
|
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, destroy, detach, dimension, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusTraversable, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, height, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, processKeyEvent, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged, width_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitwidgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unregisterWidgetListener, validateDisplayValue, windowprotected BorderedPanel<O extends OutputManager<?>> rootPanel
private Viewport<O extends OutputManager<?>> viewport
private java.lang.String label
protected BaseConfig config
public ScrollPane(ScrollableWidget<O> widget)
widget - The widget to be displayed. This widget must implement
the ScrollPublisher interface.public BorderedPanel<O> getRootPanel()
rootPanel.public void initialize(WidgetId id, BaseConfig cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<BaseConfig>id - The widget's ID.cfg - The config used to initialize this widget.public BaseConfig config()
config in interface Widget<O extends OutputManager<?>>config in interface ConfigOwner<BaseConfig>config in class AbstractWidget<O extends OutputManager<?>>public void afterConfigUpdate(BaseConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwner<BaseConfig>beforeUpdate - Config reference capturing the config state before
the owner's config was modified.public abstract void draw()
draw in interface Widget<O extends OutputManager<?>>draw in class AbstractContainer<O extends OutputManager<?>>public abstract void draw(Widget<O>[] list)
list - Array of components to draw.public Widget<O> getChild()
public boolean isFocusable()
isFocusable in interface Widget<O extends OutputManager<?>>isFocusable in class AbstractWidget<O extends OutputManager<?>>true if this container can be focused under
certain conditions. false if, and only if, this
attribute container can never receive focus.public Dimension minimumSize()
minimumSize in interface Widget<O extends OutputManager<?>>minimumSize in class AbstractContainer<O extends OutputManager<?>>public void handleScrollEvent(ScrollEvent event)
handleScrollEvent in interface ScrollListenerevent - Event which triggered this call.public void setLocation(Point point)
setLocation in interface Widget<O extends OutputManager<?>>setLocation in class AbstractWidget<O extends OutputManager<?>>point - The Point object to be used as the new location of the
container.public void setSize(double width,
double height)
setSize in interface Container<O extends OutputManager<?>>setSize in class AbstractContainer<O extends OutputManager<?>>width - New width.height - New height.public Border<O> getBorder()
Border reference, never null.public void setBorder(Border<O> border)
border - A Border reference or null to clear the border.public void doLayout()
doLayout in interface Container<O extends OutputManager<?>>doLayout in class AbstractContainer<O extends OutputManager<?>>public Dimension calcInitialViewportSize()
protected double calcHscroll(Dimension childSize, Dimension extentSize, Point viewPosition)
childSize - The size of the child pane.extentSize - The size of the viewport.viewPosition - The current view position.protected double calcVscroll(Dimension childSize, Dimension extentSize, Point viewPosition)
childSize - The size of the child pane.extentSize - The size of the viewport.viewPosition - The current view position.public void setScrollBars(ScrollBar.Bars bars)
bars - Scroll bars.