use of org.pushingpixels.flamingo.internal.ui.ribbon.AbstractBandControlPanel in project freeplane by freeplane.
the class RibbonBandContributorFactory method reorganizePolicies.
/**
*********************************************************************************
* CONSTRUCTORS
*********************************************************************************
*/
@SuppressWarnings("unchecked")
protected void reorganizePolicies(JRibbonBand band, boolean tolerateExceptions) {
Insets ins = band.getInsets();
AbstractBandControlPanel controlPanel = band.getControlPanel();
if (controlPanel == null)
return;
int height = controlPanel.getPreferredSize().height + band.getUI().getBandTitleHeight() + ins.top + ins.bottom;
List<RibbonBandResizePolicy> resizePolicies = band.getResizePolicies();
FlamingoUtilities.checkResizePoliciesConsistencyBase(band);
int index = -1;
while ((index = checkPolicies(band, height, resizePolicies)) > -1) {
if (tolerateExceptions) {
band.setResizePolicies(buildNewList(resizePolicies, index));
break;
} else {
throw new IllegalStateException(getExceptionMessage(band, height, resizePolicies, index));
}
}
}
Aggregations