public class SensitiveScrollContainer<O extends OutputManager<?>> extends NativeScrollContainer<O>
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private boolean |
first_view
Track first time when widget is displayed.
|
private boolean |
scrollable
Scrollable flag.
|
config
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
SensitiveScrollContainer() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
ensureVisibility(NativePoint p,
NativeRectangle r)
Make sure that given component is visible in the viewport.
|
boolean |
ensureVisibility(Widget<O> comp)
Make sure that given component is visible in the viewport.
|
NativeDimension |
getScrollDimension()
Returns the scroll dimension of this widget.
|
private boolean |
isScrollable()
Check if container can be scrolled.
|
void |
processKeyEvent(KeyInput keyEvent)
Handling the key event.
|
void |
setFocus(Widget<O> focus)
Set focus to specified widget.
|
void |
setScrollable(boolean scrollable)
Set the scrollable flag.
|
void |
setVisible(boolean visible)
Hide/show widget.
|
private int |
shift4overlap(int x1,
int x2,
int t1,
int t2)
Find min shift offset to achieve max overlap of two line segments
|
private int |
shiftInside(int x1,
int x2,
int t1,
int t2)
Find min shift offset to out first line segment inside the second one
|
getVisibleDimension, scroll
addScrollListener, afterConfigUpdate, config, getScrollStep, getViewport, initialize, isScrollPopupSupported, postScrollEvent
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, defaultFocus, destroy, detach, dimension, doLayout, draw, endSizeChange, findMouseSource, firstFocus, focus, focusTraversable, focusWorker, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, hasFocusable, height, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, prepareWidgets, prevFocus, remove, repaint, replace, requestFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, 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, isFocusable, 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, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, destroy, dimension, displayPhysicalLocation, draw, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, height, hidden, hide, highlighted, insets, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, topLevelWindow, unrealize, width, window
private boolean first_view
private boolean scrollable
public void setVisible(boolean visible)
setVisible
in interface Widget<O extends OutputManager<?>>
setVisible
in class AbstractWidget<O extends OutputManager<?>>
visible
- New visible state.public void setScrollable(boolean scrollable)
scrollable
- The new scrollable value.public void processKeyEvent(KeyInput keyEvent)
processKeyEvent
in interface Widget<O extends OutputManager<?>>
processKeyEvent
in class AbstractContainer<O extends OutputManager<?>>
keyEvent
- The KeyEvent object to be handled within the ScrollContainer.public boolean ensureVisibility(Widget<O> comp)
comp
- The component which should be made visible.true
if there was scrolling.public void setFocus(Widget<O> focus)
setFocus
in interface Container<O extends OutputManager<?>>
setFocus
in class AbstractContainer<O extends OutputManager<?>>
focus
- Widget to set focus on.public NativeDimension getScrollDimension()
The returned dimension doesn't need to be in the same units as the
widget's physical size but it must be compatible with the result
of NativeScrollContainer.getVisibleDimension()
and ScrollContainer.getScrollStep()
.
getScrollDimension
in interface ScrollableWidget<O extends OutputManager<?>>
getScrollDimension
in class NativeScrollContainer<O extends OutputManager<?>>
protected boolean ensureVisibility(NativePoint p, NativeRectangle r)
p
- The component's location.r
- The component's sub-rectangle which should be visible as much as possible.true
if there was scrolling.private int shift4overlap(int x1, int x2, int t1, int t2)
x1
- start of the first segmentx2
- end of the first segment, x1 < x2t1
- start of the second segmentt2
- end of the second segment, t1 < 21private int shiftInside(int x1, int x2, int t1, int t2)
x1
- start of the first segmentx2
- end of the first segment, x1 < x2t1
- start of the second segmentt2
- end of the second segment, t1 < x2,private boolean isScrollable()
true
if container can be scrolled.