Class FlatTabbedPaneUI.FlatTabbedPaneScrollLayout
- java.lang.Object
-
- javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
-
- com.formdev.flatlaf.ui.FlatTabbedPaneUI.FlatTabbedPaneLayout
-
- com.formdev.flatlaf.ui.FlatTabbedPaneUI.FlatTabbedPaneScrollLayout
-
- All Implemented Interfaces:
java.awt.LayoutManager
- Enclosing class:
- FlatTabbedPaneUI
protected class FlatTabbedPaneUI.FlatTabbedPaneScrollLayout extends FlatTabbedPaneUI.FlatTabbedPaneLayout implements java.awt.LayoutManager
Layout manager used for scroll tab layout policy.Component hierarchy for scroll tab layout policy:
JTabbedPane +- 1...n tab content components +- BasicTabbedPaneUI.ScrollableTabViewport (extends JViewport) | +- BasicTabbedPaneUI.ScrollableTabPanel (extends JPanel) | +- (optional) BasicTabbedPaneUI.TabContainer (extends JPanel) | +- 1..n tab components (shown in tab area) +- FlatScrollableTabButton (scroll forward) +- FlatScrollableTabButton (scroll backward) +- FlatMoreTabsButton +- (optional) ContainerUIResource (extends JPanel) | +- leading component +- (optional) ContainerUIResource (extends JPanel) +- trailing componentInstead of using
super.layoutContainer(Container)and fixing some component bounds, this class implementslayoutContainer(Container)and moves/resizes components only once. This avoids that some components are moved/resized twice, which would unnecessary repaint and relayout tabbed pane. In some special case this resulted in "endless" layouting and repainting when using nested tabbed panes (top and bottom tab placement) and RSyntaxTextArea (with enabled line-wrapping) as tab content.Although this class delegates nearly all methods to the original layout manager
BasicTabbedPaneUI.TabbedPaneScrollLayout, which extendsBasicTabbedPaneUI.TabbedPaneLayout, it is necessary that this class also extendsBasicTabbedPaneUI.TabbedPaneLayoutto avoid aClassCastExceptioninBasicTabbedPaneUI.ensureCurrentLayout().
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayoutdelegate
-
Constructor Summary
Constructors Modifier Constructor Description protectedFlatTabbedPaneScrollLayout(javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutComponent(java.lang.String name, java.awt.Component comp)voidcalculateLayoutInfo()protected java.awt.DimensioncalculateTabAreaSize()Calculate preferred size of the tab area.protected voidlayoutChildComponent(java.awt.Component c, java.awt.Rectangle contentAreaBounds)protected voidlayoutContainerImpl()java.awt.DimensionminimumLayoutSize(java.awt.Container parent)java.awt.DimensionpreferredLayoutSize(java.awt.Container parent)voidremoveLayoutComponent(java.awt.Component comp)-
Methods inherited from class com.formdev.flatlaf.ui.FlatTabbedPaneUI.FlatTabbedPaneLayout
calculateSize, getContentAreaLayoutBounds, getTabAreaLayoutBounds, isContentEmpty, isTabContainer, layoutChildComponents, layoutContainer, layoutLeftAndRightComponents, layoutTabComponents, layoutTopAndBottomComponents
-
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
calculateTabRects, normalizeTabRuns, padSelectedTab, padTabRun, preferredTabAreaHeight, preferredTabAreaWidth, rotateTabRuns
-
-
-
-
Method Detail
-
calculateLayoutInfo
public void calculateLayoutInfo()
- Overrides:
calculateLayoutInfoin classjavax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
-
calculateTabAreaSize
protected java.awt.Dimension calculateTabAreaSize()
Description copied from class:FlatTabbedPaneUI.FlatTabbedPaneLayoutCalculate preferred size of the tab area. Used only ifFlatTabbedPaneUI.FlatTabbedPaneLayout.isContentEmpty()returnstrue.- Overrides:
calculateTabAreaSizein classFlatTabbedPaneUI.FlatTabbedPaneLayout
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
- Specified by:
preferredLayoutSizein interfacejava.awt.LayoutManager- Overrides:
preferredLayoutSizein classjavax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
- Specified by:
minimumLayoutSizein interfacejava.awt.LayoutManager- Overrides:
minimumLayoutSizein classjavax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
-
addLayoutComponent
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)- Specified by:
addLayoutComponentin interfacejava.awt.LayoutManager- Overrides:
addLayoutComponentin classjavax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)
- Specified by:
removeLayoutComponentin interfacejava.awt.LayoutManager- Overrides:
removeLayoutComponentin classjavax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
-
layoutContainerImpl
protected void layoutContainerImpl()
- Overrides:
layoutContainerImplin classFlatTabbedPaneUI.FlatTabbedPaneLayout- Since:
- 3.3
-
layoutChildComponent
protected void layoutChildComponent(java.awt.Component c, java.awt.Rectangle contentAreaBounds)- Overrides:
layoutChildComponentin classFlatTabbedPaneUI.FlatTabbedPaneLayout- Since:
- 3.3
-
-