Package totalcross.ui
Class AccordionContainer
- java.lang.Object
-
- totalcross.ui.gfx.GfxSurface
-
- totalcross.ui.Control
-
- totalcross.ui.Container
-
- totalcross.ui.ClippedContainer
-
- totalcross.ui.AccordionContainer
-
- All Implemented Interfaces:
ControlAnimation.AnimationFinished,PathAnimation.SetPosition
public class AccordionContainer extends ClippedContainer implements PathAnimation.SetPosition, ControlAnimation.AnimationFinished
A Container that can be expanded or collapsed Sample:AccordionContainer ac = new AccordionContainer(); ac.maxH = fmH*10; add(ac, LEFT+50,TOP+100,FILL-50,ac.minH); ac.add(ac.new Caption("Type text"), LEFT,TOP,FILL,PREFERRED); ac.add(new MultiEdit(),LEFT+50,AFTER+50,FILL-50,FONTSIZE+700);Note that when the container is changing its height, it callsparent.repositionto open space for its growth.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAccordionContainer.Captionstatic classAccordionContainer.Group-
Nested classes/interfaces inherited from class totalcross.ui.Control
Control.TranslucentShape
-
-
Field Summary
Fields Modifier and Type Field Description static intANIMATION_TIMEintminHThe minH defines the height of this container when it is collapsed.-
Fields inherited from class totalcross.ui.ClippedContainer
bagClipX0, bagClipXf, bagClipY0, bagClipYf, lastMid, verticalOnly
-
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, lastX, lastY, 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 AccordionContainer()AccordionContainer(AccordionContainer.Group g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcollapse()voidcollapse(boolean showAnimation)voidexpand()voidexpand(boolean showAnimation)intgetPreferredHeight()Returns the preferred height of this control.booleanisExpanded()voidonAnimationFinished(ControlAnimation anim)voidsetPos(int x, int y)-
Methods inherited from class totalcross.ui.ClippedContainer
computeClipRect, paintChildren
-
Methods inherited from class totalcross.ui.Container
add, add, add, add, add, applyTransitionEffect, broadcastEvent, clear, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderStyle, getChildren, getChildrenCount, getClientRect, getClientRect, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, initUI, isPressed, moveFocusToNextControl, moveFocusToNextEditable, onAddAgain, onColorsChanged, onPaint, onRemove, onSwapFinished, remove, removeAll, resize, resizeHeight, resizeWidth, setBorderStyle, 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, getPreferredWidth, getPressedEvent, getPrev, getRect, getSize, getTextShadowColor, getWidth, getX, getX2, getY, getY2, hadParentScrolled, handleGeographicalFocusChangeKeys, hasFocus, internalSetEnabled, intXYWH, isActionEvent, isChildOf, isDisplayed, isEnabled, isFloating, isInsideOrNear, isObscured, isTopMost, isVisible, isVisibleAndInside, onBoundsChanged, onEvent, onFontChanged, onWindowPaintFinished, post, postEvent, postPressedEvent, 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
-
-
-
-
Constructor Detail
-
AccordionContainer
public AccordionContainer()
-
AccordionContainer
public AccordionContainer(AccordionContainer.Group g)
-
-
Method Detail
-
expand
public void expand()
-
expand
public void expand(boolean showAnimation)
-
collapse
public void collapse(boolean showAnimation)
-
collapse
public void collapse()
-
isExpanded
public boolean isExpanded()
-
onAnimationFinished
public void onAnimationFinished(ControlAnimation anim)
- Specified by:
onAnimationFinishedin interfaceControlAnimation.AnimationFinished
-
setPos
public void setPos(int x, int y)- Specified by:
setPosin interfacePathAnimation.SetPosition
-
getPreferredHeight
public int getPreferredHeight()
Description copied from class:ControlReturns the preferred height of this control.- Overrides:
getPreferredHeightin classControl
-
-