MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / doLayout

Method doLayout

CodenameOne/src/com/codename1/ui/Container.java:2517–2555  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2515 }
2516
2517 void doLayout() {
2518 doLayoutDepth++;
2519 boolean restoreBounds = false;
2520 if (safeArea && doLayoutDepth == 1) {
2521 // If this container is marked as a safe area
2522 // then we may need to add padding to make it *safe*
2523 Container parent = getParent();
2524 if (parent == null || !parent.isSafeAreaInternal(true)) {
2525 // For efficiency, we check if the parent is a safe area.
2526 // If so, we don't need to worry because it has already
2527 // added appropriate padding.
2528 if (tmpInsets == null) {
2529 tmpInsets = new TmpInsets();
2530 }
2531 Style s = getStyle();
2532 tmpInsets.set(s);
2533 restoreBounds = snapToSafeAreaInternal();
2534 }
2535 }
2536 layout.layoutContainer(this);
2537 int count = getComponentCount();
2538 for (int i = 0; i < count; i++) {
2539 Component c = getComponentAt(i);
2540 if (c instanceof Container) {
2541 ((Container) c).layoutContainer();
2542 } else {
2543 c.laidOut();
2544 }
2545 }
2546 if (restoreBounds && tmpInsets != null) {
2547 tmpInsets.restore(getStyle());
2548 }
2549 laidOut();
2550 if (Form.activePeerCount > 0) {
2551 onParentPositionChange();
2552 }
2553 doLayoutDepth--;
2554
2555 }
2556
2557 /// Returns the number of components
2558 ///

Callers 8

animateMethod · 0.95
layoutContainerMethod · 0.95
validateMethod · 0.95
sizeChangedInternalMethod · 0.45
scrollChangedMethod · 0.45
actionPerformedMethod · 0.45
setCollapsedMethod · 0.45

Calls 12

isSafeAreaInternalMethod · 0.95
getComponentCountMethod · 0.95
getComponentAtMethod · 0.95
laidOutMethod · 0.95
getParentMethod · 0.65
getStyleMethod · 0.65
setMethod · 0.65
restoreMethod · 0.65
layoutContainerMethod · 0.45
laidOutMethod · 0.45

Tested by 1