use of org.apache.pivot.wtk.Accordion in project pivot by apache.
the class TerraAccordionSkin method getPreferredHeight.
@Override
public int getPreferredHeight(int width) {
Accordion accordion = (Accordion) getComponent();
int preferredHeight = 0;
// of the headers and selected panel, plus border
for (PanelHeader panelHeader : panelHeaders) {
preferredHeight += panelHeader.getPreferredHeight(width) - 1;
}
if (width != -1) {
width = Math.max(0, width - (padding.getWidth() + 2));
}
int maxPanelHeight = 0;
for (Component panel : accordion.getPanels()) {
maxPanelHeight = Math.max(maxPanelHeight, panel.getPreferredHeight(width));
}
preferredHeight += (maxPanelHeight + padding.getHeight() + 2);
return preferredHeight;
}
use of org.apache.pivot.wtk.Accordion in project pivot by apache.
the class TerraAccordionSkin method install.
@Override
public void install(Component component) {
super.install(component);
Accordion accordion = (Accordion) component;
accordion.getAccordionListeners().add(this);
accordion.getAccordionSelectionListeners().add(this);
accordion.getAccordionAttributeListeners().add(this);
}
Aggregations