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

Method getPos

CodenameOne/src/com/codename1/ui/layouts/mig/Grid.java:1363–1386  ·  view source on GitHub ↗
(ComponentWrapper cw, CC cc)

Source from the content-addressed store, hash-verified

1361 }
1362
1363 private UnitValue[] getPos(ComponentWrapper cw, CC cc) {
1364 UnitValue[] callbackPos = null;
1365 if (callbackList != null) {
1366 for (int i = 0; i < callbackList.size() && callbackPos == null; i++) {
1367 callbackPos = callbackList.get(i).getPosition(cw); // NOT a copy!
1368 }
1369 }
1370
1371 // If one is null, return the other (which many also be null)
1372 UnitValue[] ccPos = cc.getPos(); // A copy!!
1373 if (callbackPos == null || ccPos == null) {
1374 return callbackPos != null ? callbackPos : ccPos;
1375 }
1376
1377 // Merge
1378 for (int i = 0; i < 4; i++) {
1379 UnitValue cbUv = callbackPos[i];
1380 if (cbUv != null) {
1381 ccPos[i] = cbUv;
1382 }
1383 }
1384
1385 return ccPos;
1386 }
1387
1388 private BoundSize[] getCallbackSize(ComponentWrapper cw) {
1389 if (callbackList != null) {

Callers 2

GridMethod · 0.95
getAbsoluteDimBoundsMethod · 0.95

Calls 3

sizeMethod · 0.65
getPositionMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected