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.Widget.ZOrderClass
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.
|
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, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, defaultFocus, destroy, detach, dimension, endSizeChange, findMouseSource, firstFocus, focus, focusTraversable, focusWorker, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, hasFocusable, height, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, prepareWidgets, prevFocus, processKeyEvent, remove, repaint, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setWidth, startSizeChange, unrealize, updateSizeWorker, widgets, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, ignoreAction, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, isDirectManipulable, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, topLevelWindow, window
protected 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
- 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 ScrollListener
event
- 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.