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

Method getPreferredW

CodenameOne/src/com/codename1/ui/Sheet.java:1115–1127  ·  view source on GitHub ↗
(Container cnt)

Source from the content-addressed store, hash-verified

1113 ///
1114 /// - `cnt`: The container in the FormLayeredPane where the sheet is to be rendered.
1115 private int getPreferredW(Container cnt) {
1116 switch (getPositionInt()) {
1117 case N:
1118 case S:
1119 return cnt.getWidth();
1120 case C:
1121 case W:
1122 case E:
1123 return Math.min(getPreferredW() + (backButton.getPreferredW() + backButton.getStyle().getHorizontalMargins()) * 2, cnt.getWidth());
1124 default:
1125 return getPreferredW();
1126 }
1127 }
1128
1129 private int getPositionInt() {
1130 String pos = getPosition();

Callers 2

showMethod · 0.95
getHiddenXMethod · 0.95

Calls 5

getPositionIntMethod · 0.95
minMethod · 0.95
getHorizontalMarginsMethod · 0.80
getWidthMethod · 0.65
getStyleMethod · 0.65

Tested by

no test coverage detected