Package totalcross.ui
Class SlidingWindow
- java.lang.Object
-
- totalcross.ui.gfx.GfxSurface
-
- totalcross.ui.Control
-
- totalcross.ui.Container
-
- totalcross.ui.Window
-
- totalcross.ui.SlidingWindow
-
- All Implemented Interfaces:
EventHandler,KeyListener,PenListener
- Direct Known Subclasses:
MaterialWindow
public class SlidingWindow extends Window implements PenListener, KeyListener
A window with a top bar + return button supporting slide-in animations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class totalcross.ui.Control
Control.TranslucentShape
-
-
Field Summary
Fields Modifier and Type Field Description protected intanimDirprotected ControlAnimationcurrentAnimationprotected SpinnerdelayedUiSpinnerprotected booleandelayInitUIprotected Presenter<Container>providerprotected intslackSpaceprotected inttotalTime-
Fields inherited from class totalcross.ui.Window
_controlEvent, _dragEvent, _focus, _keyEvent, _mouseEvent, _multiEvent, _penEvent, androidBorderThickness, beepIfOut, blocking, borderStyle, cancelPenUp, canDrag, dragThreshold, fadeOtherWindows, fadeValue, firstFocus, flickEnabled, focusOnPenUp, footerColor, footerH, gradientTitleEndColor, gradientTitleStartColor, headerColor, highlighted, highResPrepared, HORIZONTAL_GRADIENT, ignoreEventOfType, keyHook, lastShiftY, lastSwappedContainer, mainSwapContainer, menubar, multiTouching, needsPaint, NO_BORDER, ORIENTATION_INVERTED, ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, popped, RECT_BORDER, repaintOnSwap, robot, ROUND_BORDER, rTitle, sameBackgroundColor, shiftH, shiftY, SIP_BOTTOM, SIP_HIDE, SIP_SHOW, SIP_TOP, TAB_BORDER, TAB_ONLY_BORDER, tempTitle, title, titleAlign, titleColor, titleFont, titleGap, topMost, VERTICAL_GRADIENT, zStack
-
Fields inherited from class totalcross.ui.Container
alwaysEraseBackground, BACKGROUND_CYLINDRIC_SHADED, BACKGROUND_SHADED, BACKGROUND_SHADED_INV, BACKGROUND_SOLID, backgroundStyle, BORDER_LOWERED, BORDER_NONE, BORDER_RAISED, BORDER_ROUNDED, BORDER_SIMPLE, BORDER_TOP, borderColor, children, controlFound, finishedStart, ignoreOnAddAgain, ignoreOnRemove, insets, lastH, lastScreenWidth, lastW, npback, numChildren, started, tabOrder, tail, TRANSITION_CLOSE, TRANSITION_FADE, TRANSITION_NONE, TRANSITION_OPEN, TRANSITION_TIME, transitionEffect
-
Fields inherited from class totalcross.ui.Control
AFTER, alphaValue, appId, appObj, asContainer, asWindow, backColor, BEFORE, BOTTOM, BOTTOM_OF, BRIGHTER_BACKGROUND, callListenersOnAllTargets, CENTER, CENTER_OF, clearValueInt, clearValueStr, DARKER_BACKGROUND, DP, effect, enableUpdateScreen, esce, eventsEnabled, FILL, fillColor, FIT, floating, fm, fmH, focusHandler, focusLess, focusOnPenDown, focusTraversable, font, FONTSIZE, foreColor, height, ignoreInsets, isHighlighting, isTablet, KEEP, keepDisabled, keepEnabled, LEFT, next, nextTabControl, npParts, offscreen, offscreen0, onEventFirst, parent, PARENTSIZE, PARENTSIZEMAX, PARENTSIZEMIN, PREFERRED, prev, RANGE, repositionAllowed, RIGHT, RIGHT_OF, SAME, SCREENSIZE, SCREENSIZEMAX, SCREENSIZEMIN, setFont, setH, setRel, setW, setX, SETX_NOT_SET, setY, tempW, textShadowColor, TOP, translucentShape, transparentBackground, uiAdjustmentsBasedOnFontHeightIsSupported, uiAndroid, UICONST, uiFlat, uiHolo, uiMaterial, uiVista, visible, width, WILL_RESIZE, x, y
-
-
Constructor Summary
Constructors Constructor Description SlidingWindow(boolean delayInitUI, Presenter<Container> provider)SlidingWindow(Presenter<Container> provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionkeyPressed(KeyEvent e)An ACTION_KEY_PRESS event was dispatched.intgetSlackSpace()Gets the slack space left by this window on pop-upvoidinitUI()Called to initialize the User Interface of this container.voidkeyPressed(KeyEvent e)A KEY_PRESS event was dispatched.voidonPopup()Placeholder called imediatly before the popup began.voidpenDown(PenEvent e)A PEN_DOWN event was dispatched.voidpenDrag(DragEvent e)A PEN_DRAG event was dispatched.voidpenDragEnd(DragEvent e)A PEN_DRAG_END event was dispatched.voidpenDragStart(DragEvent e)A PEN_DRAG_START event was dispatched.voidpenUp(PenEvent e)A PEN_UP event was dispatched.voidpopup()Pops up this window, blocking the execution until the window closes.protected voidpostPopup()Placeholder called after the popup is done and after the repaint of this window.voidscreenResized()Called when the screen is resized, probably caused by a rotation.protected voidsetRect(boolean screenResized)voidsetSlackSpace(int slackSpace)Sets the slack space left by this window on pop-upvoidspecialkeyPressed(KeyEvent e)A SPECIAL_KEY_PRESS event was dispatched.voidunpop()Hides this window.-
Methods inherited from class totalcross.ui.Window
_doPaint, _postEvent, destroyZStack, drawHighlight, getBorderStyle, getClientRect, getClientRect, getDefaultDragThreshold, getFocus, getHighlighted, getPopupCount, getPreferredHeight, getPreferredWidth, getSafeAreaInsets, getTitleFont, getTopMost, handleFocusChangeKeys, isScreenShifted, isSipShown, isSipShown4D, isTopMost, isVisible, loadBehind, makeUnmovable, onClickedOutside, onRobotKey, onUnpop, paintTitle, paintWindowBackground, popupMenuBar, popupNonBlocking, postPressedEvent, postUnpop, pumpEvents, removeFocus, repaintActiveWindows, resize, resizeHeight, resizeWidth, setBorderStyle, setDeviceTitle, setFocus, setGrabPenEvents, setHighlighted, setMenuBar, setOrientation, setSIP, setTitle, setTitleFont, shiftScreen, swap, swapFocus, validate
-
Methods inherited from class totalcross.ui.Container
add, add, add, add, add, applyTransitionEffect, broadcastEvent, clear, fillBackground, fillBackground, findChild, findNearestChild, findNextFocusControl, getChildren, getChildrenCount, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, isPressed, moveFocusToNextControl, moveFocusToNextEditable, onAddAgain, onColorsChanged, onPaint, onRemove, onSwapFinished, paintChildren, remove, removeAll, setEnabled, setFocusTraversable, setHighlighting, setInsets, setNextTransitionEffect, setPressColor, setPressed, swapToTopmostWindow
-
Methods inherited from class totalcross.ui.Control
_onEvent, addEnabledStateListener, addFocusListener, addFontChangeHandler, addGridListener, addHandler, addHighlightListener, addKeyListener, addListContainerListener, addMouseListener, addMultiTouchListener, addPenListener, addPressListener, addPushNotificationListener, addSizeChangeHandler, addTimer, addTimer, addTimerListener, addValueChangeHandler, addWindowListener, bringToFront, changeHighlighted, contains, drawTranslucentBackground, getAbsoluteRect, getBackColor, getDoEffect, getEffectH, getEffectW, getEffectX, getEffectY, getEventListeners, getFont, getForeColor, getGap, getGraphics, getHeight, getNext, getParent, getParentWindow, getPos, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, handleGeographicalFocusChangeKeys, hasFocus, internalSetEnabled, intXYWH, isActionEvent, isChildOf, isDisplayed, isEnabled, isFloating, isInsideOrNear, isObscured, isVisibleAndInside, onBoundsChanged, onEvent, onFontChanged, onWindowPaintFinished, post, postEvent, releaseScreenShot, removeEnabledStateListener, removeFocusListener, removeGridListener, removeHandler, removeHighlightListener, removeKeyListener, removeListContainerListener, removeMouseListener, removeMultiTouchListener, removePenListener, removePressListener, removePushNotificationListener, removeTimer, removeTimerListener, removeWindowListener, repaint, repaintNow, reposition, reposition, repositionChildren, requestFocus, resetSetPositions, resetStyle, safeRepaintNow, safeUpdateScreen, sendToBack, setBackColor, setBackForeColors, setDoEffect, setFloating, setFocusLess, setFont, setForeColor, setNinePatch, setNinePatch, setRect, setRect, setRect, setRect, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
-
-
-
-
Field Detail
-
currentAnimation
protected ControlAnimation currentAnimation
-
animDir
protected int animDir
-
slackSpace
protected int slackSpace
-
totalTime
protected int totalTime
-
delayedUiSpinner
protected Spinner delayedUiSpinner
-
delayInitUI
protected boolean delayInitUI
-
-
Method Detail
-
setRect
protected void setRect(boolean screenResized)
-
unpop
public void unpop()
Description copied from class:WindowHides this window. Calling unpop when only the MainWindow is active does nothing.
-
popup
public void popup()
Description copied from class:WindowPops up this window, blocking the execution until the window closes.
-
initUI
public void initUI()
Description copied from class:ContainerCalled to initialize the User Interface of this container. This differs from the onAddAgain method by that this method is called only once, at the first time the control is added to the parent. When the container is being setup, the initUI method is called; then, the onAddAgain is called every time the container is added again.
-
postPopup
protected void postPopup()
Description copied from class:WindowPlaceholder called after the popup is done and after the repaint of this window. The default implementation does nothing.
-
onPopup
public void onPopup()
Description copied from class:WindowPlaceholder called imediatly before the popup began. The default implementation does nothing.
-
screenResized
public void screenResized()
Description copied from class:WindowCalled when the screen is resized, probably caused by a rotation. ATTENTION: THIS CALL CANNOT BE BLOCKED OR THE SYSTEM WILL LOCK!- Overrides:
screenResizedin classWindow
-
getSlackSpace
public int getSlackSpace()
Gets the slack space left by this window on pop-up
-
setSlackSpace
public void setSlackSpace(int slackSpace)
Sets the slack space left by this window on pop-up
-
penDrag
public void penDrag(DragEvent e)
Description copied from interface:PenListenerA PEN_DRAG event was dispatched.- Specified by:
penDragin interfacePenListener- See Also:
PenEvent
-
penDown
public void penDown(PenEvent e)
Description copied from interface:PenListenerA PEN_DOWN event was dispatched.- Specified by:
penDownin interfacePenListener- See Also:
PenEvent
-
penUp
public void penUp(PenEvent e)
Description copied from interface:PenListenerA PEN_UP event was dispatched.- Specified by:
penUpin interfacePenListener- See Also:
PenEvent
-
penDragStart
public void penDragStart(DragEvent e)
Description copied from interface:PenListenerA PEN_DRAG_START event was dispatched.- Specified by:
penDragStartin interfacePenListener- See Also:
PenEvent
-
penDragEnd
public void penDragEnd(DragEvent e)
Description copied from interface:PenListenerA PEN_DRAG_END event was dispatched.- Specified by:
penDragEndin interfacePenListener- See Also:
PenEvent
-
specialkeyPressed
public void specialkeyPressed(KeyEvent e)
Description copied from interface:KeyListenerA SPECIAL_KEY_PRESS event was dispatched.- Specified by:
specialkeyPressedin interfaceKeyListener- See Also:
KeyEvent
-
keyPressed
public void keyPressed(KeyEvent e)
Description copied from interface:KeyListenerA KEY_PRESS event was dispatched.- Specified by:
keyPressedin interfaceKeyListener- See Also:
KeyEvent
-
actionkeyPressed
public void actionkeyPressed(KeyEvent e)
Description copied from interface:KeyListenerAn ACTION_KEY_PRESS event was dispatched.- Specified by:
actionkeyPressedin interfaceKeyListener- See Also:
KeyEvent
-
-