return baseline;
}
@Override
public void layout() {
Rollup rollup = (Rollup)getComponent();
Component heading = rollup.getHeading();
Component content = rollup.getContent();
Dimensions rollupButtonSize = rollupButton.getPreferredSize();
rollupButton.setSize(rollupButtonSize.width, rollupButtonSize.height);
int x = rollupButtonSize.width + buffer;
int y = 0;
int justifiedWidth = Math.max(getWidth() - rollupButtonSize.width - buffer, 0);
if (heading != null) {
int headingWidth, headingHeight;
if (fill) {
headingWidth = justifiedWidth;
headingHeight = heading.getPreferredHeight(headingWidth);
} else {
Dimensions headingPreferredSize = heading.getPreferredSize();
headingWidth = headingPreferredSize.width;
headingHeight = headingPreferredSize.height;
}
heading.setLocation(x, y);
heading.setSize(headingWidth, headingHeight);
y += headingHeight + spacing;
}
if (content != null) {
if (rollup.isExpanded()
|| (expandTransition != null
&& !expandTransition.isReversed())) {
int contentWidth, contentHeight;
if (fill) {
contentWidth = justifiedWidth;