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

Method calcPreferredSize

CodenameOne/src/com/codename1/ui/List.java:2048–2067  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2046
2047 /// {@inheritDoc}
2048 @Override
2049 protected Dimension calcPreferredSize() {
2050 if (shouldShowHint()) {
2051 Label l = getHintLabelImpl();
2052 if (l != null) {
2053 Dimension d1 = getUIManager().getLookAndFeel().getListPreferredSize(this);
2054 Dimension d2 = l.getPreferredSize();
2055 return new Dimension(d1.getWidth() + d2.getWidth(), d1.getHeight() + d2.getHeight());
2056 }
2057 }
2058 Dimension d = getUIManager().getLookAndFeel().getListPreferredSize(this);
2059 if (spinnerOverlay != null) {
2060 if (spinnerOverlay.getBorder() != null) {
2061 d.setWidth(Math.max(spinnerOverlay.getBorder().getMinimumWidth(), d.getWidth()));
2062 d.setHeight(Math.max(spinnerOverlay.getBorder().getMinimumHeight(), d.getHeight()));
2063 }
2064
2065 }
2066 return d;
2067 }
2068
2069 /// Allows adding an element to a list if the underlying model supports this, notice that
2070 /// it is an optional operation and if the model does not support it (default list model does)

Callers

nothing calls this directly

Calls 14

shouldShowHintMethod · 0.95
getHintLabelImplMethod · 0.95
getWidthMethod · 0.95
getHeightMethod · 0.95
setWidthMethod · 0.95
maxMethod · 0.95
setHeightMethod · 0.95
getLookAndFeelMethod · 0.80
getMinimumWidthMethod · 0.65
getMinimumHeightMethod · 0.65
getListPreferredSizeMethod · 0.45
getUIManagerMethod · 0.45

Tested by

no test coverage detected