Control.TranslucentShape
Modifier and Type | Field and Description |
---|---|
protected int |
alignment
The elements alignment with regard to this component.
|
static int |
ALIGNMENT_CENTER
Centers each child object
|
static int |
ALIGNMENT_LEFT
Aligns each child along the left/top border
|
static int |
ALIGNMENT_RIGHT
Aligns each child along the right/bottom border
|
static int |
ALIGNMENT_STRETCH
Stretches each child object
|
static int |
LAYOUT_DISTRIBUTE
Distributes the elements along the width of the container
|
static int |
LAYOUT_FILL
Distribute and scale each element to fill the entire width of this component
|
static int |
LAYOUT_STACK_CENTER
Organizes each element around the center
|
protected int |
mode
The mode that the components will be displayed.
|
protected int |
spacing
The spacing between each component.
|
protected boolean |
suspendLayout
Switches if the 'add' method will also layout each component or if this is
deferred until a 'resumeLayout' call
|
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, borderRadius, children, controlFound, finishedStart, ignoreOnAddAgain, ignoreOnRemove, insets, lastH, lastScreenWidth, lastW, lastX, lastY, numChildren, started, tabOrder, tail, TRANSITION_TIME
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 and Description |
---|
LinearBox() |
LinearBox(int mode,
int alignment) |
Modifier and Type | Method and Description |
---|---|
void |
add(Control control)
Adds the given control to this component and performs all layout operations
to fit it within the layout.
|
void |
add(Control[] controls)
Adds several controls to this layout at once
|
void |
add(Control control,
int w,
int h)
Adds the given control to this component using the given width and height
and performs all layout operations to fit it within the layout.
|
void |
add(Control control,
int x,
int y,
int w,
int h)
This layout does not supports this action.
|
void |
add(Control control,
int x,
int y,
int w,
int h,
Control relative)
This layout does not supports this action.
|
protected void |
doLayout()
Recalculates every element's width and height, and also the paddings and
spacings every time one of these values are changed.
|
int |
getSpacing()
Gets the spacing between components.
|
protected void |
internalAdd(Control control,
int x,
int y,
int w,
int h,
Control relative)
Used internally to add controls to this layout
|
protected abstract void |
resizeElements(int mode,
int alignment)
Recalculates every element's width and height, and also the paddings and
spacings every time one of these values are changed.
|
void |
resumeLayout()
Performs all queued layout operations and resumes the default layout
behaviour of the 'add' method.
|
void |
setInsets(int left,
int right,
int top,
int bottom)
Sets the internal paddings of this component.
|
void |
setLayout(int mode,
int alignment)
Sets the layout mode of this component
|
void |
setRect(int x,
int y,
int width,
int height,
Control relative,
boolean screenChanged)
The relative positioning will be made with the given control (relative).
|
void |
setSpacing(int spacing)
Sets the spacing between components.
|
void |
suspendLayout()
Suspends all layout operations from 'add' calls until a 'resumeLayout' call.
|
add, broadcastEvent, clear, fillBackground, findChild, findNearestChild, findNextFocusControl, getBorderRadius, getBorderStyle, getChildren, getChildrenCount, getClientRect, getClientRect, getFirstChild, getFocusableControls, getInsets, incLastX, incLastY, initUI, isPressed, moveFocusToNextControl, moveFocusToNextEditable, onAddAgain, onColorsChanged, onPaint, onRemove, onSwapFinished, paintChildren, remove, removeAll, resize, resizeHeight, resizeWidth, setBorderRadius, setBorderStyle, setEnabled, setFocusTraversable, setHighlighting, setPressColor, setPressed, swapToTopmostWindow
_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, getPreferredHeight, 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, setSet, setTextShadowColor, setTranslucent, setVisible, showTip, takeInitialScreenShot, takeScreenShot, translateFromOrigin, uiStyleChanged, updateScreen, updateTemporary, willOpenKeyboard
public static final int LAYOUT_STACK_CENTER
public static final int LAYOUT_DISTRIBUTE
public static final int LAYOUT_FILL
public static final int ALIGNMENT_LEFT
public static final int ALIGNMENT_RIGHT
public static final int ALIGNMENT_CENTER
public static final int ALIGNMENT_STRETCH
protected int mode
protected int alignment
protected int spacing
protected boolean suspendLayout
public void setRect(int x, int y, int width, int height, Control relative, boolean screenChanged)
Control
Important note: you can't use FILL/FIT with BEFORE/RIGHT/BOTTOM (for x,y).
add(new Label("1"),CENTER,CENTER); add(new Label("2"),AFTER,SAME); add(new Label("3"),SAME,AFTER); add(new Label("4"),BEFORE,SAME); add(new Label("5"),BEFORE,BEFORE);You will see this on screen:
512 43Note: add(control, x,y) does:
add(control); control.setRect(x,y,PREFERRED,PREFERRED);
Important! Always add the control to the container before doing a setRect.
The relative positioning does not work well if the control is placed outside screen bounds.
setRect
in class Control
x
- One of the relative positioning constants: LEFT, RIGHT, SAME, BEFORE, AFTER, CENTER, with a small adjustment. You can also use an absolute value, but this is strongly discouraged.y
- One of the relative positioning constants: TOP, BOTTOM, SAME, BEFORE, AFTER, CENTER, with a small adjustment. You can also use an absolute value, but this is strongly discouraged.width
- One of the relative positioning constants: PREFERRED, FILL, FIT, SAME. You can also use an absolute value, but this is strongly discouraged.height
- One of the relative positioning constants: PREFERRED, FILL, FIT, SAME. You can also use an absolute value, but this is strongly discouraged.relative
- To whom the position should be relative to; or null to be relative to the last control.screenChanged
- Indicates that a screen change (resize, collapse) occured and the reposition
method is calling this method. Set by the system. If you call this method directly, always pass false to it.Control.LEFT
,
Control.TOP
,
Control.RIGHT
,
Control.BOTTOM
,
Control.BEFORE
,
Control.AFTER
,
Control.CENTER
,
Control.SAME
,
Control.FILL
,
Control.PREFERRED
,
Control.FIT
,
Control.CENTER_OF
,
Control.RIGHT_OF
,
Control.BOTTOM_OF
,
Control.SCREENSIZE
,
Control.SCREENSIZEMIN
,
Control.SCREENSIZEMAX
,
Control.PARENTSIZE
,
Control.PARENTSIZEMIN
,
Control.PARENTSIZEMAX
,
Control.FONTSIZE
,
Container.add(Control, int, int)
,
Container.add(Control, int, int, Control)
public void add(Control control)
public void add(Control control, int w, int h)
add
in class Container
Control.setRect(int, int, int, int, Control, boolean)
public void add(Control[] controls)
public void add(Control control, int x, int y, int w, int h)
add
in class Container
Control.setRect(int, int, int, int, Control, boolean)
public void add(Control control, int x, int y, int w, int h, Control relative)
add
in class Container
Control.setRect(int, int, int, int, Control, boolean)
protected void internalAdd(Control control, int x, int y, int w, int h, Control relative)
public void suspendLayout()
public void resumeLayout()
protected void doLayout()
protected abstract void resizeElements(int mode, int alignment)
public void setLayout(int mode, int alignment)
public int getSpacing()
public void setSpacing(int spacing)