Class CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
java.lang.Object
org.pushingpixels.radiance.component.api.ribbon.resize.CoreRibbonResizePolicies.BaseRibbonBandResizePolicy<JRibbonBand>
org.pushingpixels.radiance.component.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
public abstract static class CoreRibbonResizePolicies.BaseCoreRibbonBandResizePolicy
extends CoreRibbonResizePolicies.BaseRibbonBandResizePolicy<JRibbonBand>
The base class for mapping-based core resize policies.
- Author:
- Kirill Grouchnikov
-
Field Summary
Fields inherited from class CoreRibbonResizePolicies.BaseRibbonBandResizePolicy
controlPanel, ribbonBand -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseCoreRibbonBandResizePolicy(JRibbonBand ribbonBand, CoreRibbonResizePolicies.Mapping mapping) Creates a new resize policy. -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetPreferredButtonWidth(JBandControlPanel.ControlPanelGroup controlPanelGroup, int gap) Returns the preferred width of all the buttons in the specified control panel group.intgetPreferredWidth(int availableHeight, int gap) Returns the preferred width of the associated ribbon band under the specified dimensions.protected intgetWidth(int gap, List<JCommandButton> bigButtons, List<JCommandButton> mediumButtons, List<JCommandButton> smallButtons) Returns the total width of the specified buttons.voidinstall(int availableHeight, int gap) Installs this resize policy on the associated ribbon band.
-
Constructor Details
-
BaseCoreRibbonBandResizePolicy
protected BaseCoreRibbonBandResizePolicy(JRibbonBand ribbonBand, CoreRibbonResizePolicies.Mapping mapping) Creates a new resize policy.- Parameters:
ribbonBand- The associated ribbon band.mapping- The element priority mapping.
-
-
Method Details
-
getWidth
protected int getWidth(int gap, List<JCommandButton> bigButtons, List<JCommandButton> mediumButtons, List<JCommandButton> smallButtons) Returns the total width of the specified buttons.- Parameters:
gap- Inter component gap.bigButtons- List of buttons in big presentation state.mediumButtons- List of buttons in medium presentation state.smallButtons- List of buttons in small presentation state.- Returns:
- Total width of the specified buttons.
-
getPreferredWidth
public int getPreferredWidth(int availableHeight, int gap) Description copied from interface:RibbonBandResizePolicyReturns 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:RibbonBandResizePolicyInstalls this resize policy on the associated ribbon band. ForJFlowRibbonBands only changes the bounds of the flow components. ForJRibbonBands can also change the presentation state of the command buttons (withJCommandButton.setPresentationState(CommandButtonPresentationState)) 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.
-