return new Dimensions(this.getPreferredWidth(-1),
this.getPreferredHeight(-1));
}
public void layout() {
Expander expander = (Expander)getComponent();
Component content = expander.getContent();
int width = getWidth();
int height = getHeight();
int titleBarHeight;
if (expandTransition == null) {
titleBarHeight = titleBarFlowPane.getPreferredHeight(-1);
titleBarFlowPane.setSize(Math.max(width - 2, 0), titleBarHeight);
titleBarFlowPane.setLocation(1, 1);
} else {
titleBarHeight = titleBarFlowPane.getHeight();
}
if (content != null) {
if (expander.isExpanded()) {
content.setVisible(true);
int reservedWidth = 2 + padding.left + padding.right;
int contentWidth = Math.max(width - reservedWidth, 0);