Class CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
java.lang.Object
org.pushingpixels.flamingo.api.ribbon.resize.BaseRibbonBandResizePolicy<JBandControlPanel>
org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
- All Implemented Interfaces:
RibbonBandResizePolicy
- Direct Known Subclasses:
CoreRibbonResizePolicies.High2Low
,CoreRibbonResizePolicies.High2Mid
,CoreRibbonResizePolicies.Low2Mid
,CoreRibbonResizePolicies.Mid2Low
,CoreRibbonResizePolicies.Mid2Mid
,CoreRibbonResizePolicies.Mirror
,CoreRibbonResizePolicies.None
- Enclosing class:
- CoreRibbonResizePolicies
protected abstract static class CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
extends BaseRibbonBandResizePolicy<JBandControlPanel>
The base class for mapping-based core resize policies.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies.Mapping
The element priority mapping.Fields inherited from class org.pushingpixels.flamingo.api.ribbon.resize.BaseRibbonBandResizePolicy
controlPanel
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BaseCoreRibbonBandResizePolicy
(JBandControlPanel controlPanel, org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies.Mapping mapping) Creates a new resize policy. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
getPreferredButtonWidth
(JBandControlPanel.ControlPanelGroup controlPanelGroup, int gap) Returns the preferred width of all the buttons in the specified control panel group.int
getPreferredWidth
(int availableHeight, int gap) Returns the preferred width of the associated ribbon band under the specified dimensions.protected int
getWidth
(int gap, List<AbstractCommandButton> bigButtons, List<AbstractCommandButton> mediumButtons, List<AbstractCommandButton> smallButtons) Returns the total width of the specified buttons.void
install
(int availableHeight, int gap) Installs this resize policy on the associated ribbon band.
-
Field Details
-
mapping
protected org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies.Mapping mappingThe element priority mapping.
-
-
Constructor Details
-
BaseCoreRibbonBandResizePolicy
protected BaseCoreRibbonBandResizePolicy(JBandControlPanel controlPanel, org.pushingpixels.flamingo.api.ribbon.resize.CoreRibbonResizePolicies.Mapping mapping) Creates a new resize policy.- Parameters:
controlPanel
- The control panel of the associated ribbon band.mapping
- The element priority mapping.
-
-
Method Details
-
getWidth
protected int getWidth(int gap, List<AbstractCommandButton> bigButtons, List<AbstractCommandButton> mediumButtons, List<AbstractCommandButton> smallButtons) Returns the total width of the specified buttons.- Parameters:
gap
- Inter component gap.bigButtons
- List of buttons in big display state.mediumButtons
- List of buttons in medium display state.smallButtons
- List of buttons in small display state.- Returns:
- Total width of the specified buttons.
-
getPreferredWidth
public int getPreferredWidth(int availableHeight, int gap) Description copied from interface:RibbonBandResizePolicy
Returns the preferred width of the associated ribbon band under the specified dimensions.- Parameters:
availableHeight
- The height available for the associated ribbon band.gap
- The inter-component gap.- Returns:
- The preferred width of the associated ribbon band under the specified dimensions.
-
getPreferredButtonWidth
protected int getPreferredButtonWidth(JBandControlPanel.ControlPanelGroup controlPanelGroup, int gap) Returns the preferred width of all the buttons in the specified control panel group.- Parameters:
controlPanelGroup
- A single control panel group in the associated ribbon band.gap
- Inter component gap.- Returns:
- The preferred width of all the buttons in the specified control panel group.
-
install
public void install(int availableHeight, int gap) Description copied from interface:RibbonBandResizePolicy
Installs this resize policy on the associated ribbon band. ForJFlowRibbonBand
s only changes the bounds of the flow components. ForJRibbonBand
s can also change the display state of the command buttons (withAbstractCommandButton.setDisplayState(org.pushingpixels.flamingo.api.common.CommandButtonDisplayState)
) and the number of visible buttons in the ribbon galleries. Note that this method is for internal use only and should not be called by the application code.- Parameters:
availableHeight
- The height available for the associated ribbon band.gap
- The inter-component gap.
-