Package com.formdev.flatlaf.ui
Class FlatTabbedPaneUI.FlatTabbedPaneLayout
- java.lang.Object
-
- javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
-
- com.formdev.flatlaf.ui.FlatTabbedPaneUI.FlatTabbedPaneLayout
-
- All Implemented Interfaces:
LayoutManager
- Direct Known Subclasses:
FlatTabbedPaneUI.FlatTabbedPaneScrollLayout
- Enclosing class:
- FlatTabbedPaneUI
protected class FlatTabbedPaneUI.FlatTabbedPaneLayout extends BasicTabbedPaneUI.TabbedPaneLayout
Layout manager for wrap tab layout policy (and base class for scroll tab layout policy).Component hierarchy for wrap tab layout policy:
JTabbedPane +- 1...n tab content components +- (optional) BasicTabbedPaneUI.TabContainer (extends JPanel) | +- 1..n tab components (shown in tab area) +- (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.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFlatTabbedPaneLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DimensioncalculateSize(boolean minimum)protected DimensioncalculateTabAreaSize()Calculate preferred size of the tab area.protected booleanisContentEmpty()Check whether all content components are eithernullor have zero preferred size.protected voidlayoutChildComponent(Component c, Rectangle contentAreaBounds)protected voidlayoutChildComponents()voidlayoutContainer(Container parent)protected voidlayoutContainerImpl()-
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
addLayoutComponent, calculateLayoutInfo, calculateTabRects, minimumLayoutSize, normalizeTabRuns, padSelectedTab, padTabRun, preferredLayoutSize, preferredTabAreaHeight, preferredTabAreaWidth, removeLayoutComponent, rotateTabRuns
-
-
-
-
Method Detail
-
calculateSize
protected Dimension calculateSize(boolean minimum)
- Overrides:
calculateSizein classBasicTabbedPaneUI.TabbedPaneLayout
-
isContentEmpty
protected boolean isContentEmpty()
Check whether all content components are eithernullor have zero preferred size.If
true, assume that the tabbed pane is used without any content and use the size of the tab area (single run) as minimum/preferred size.
-
calculateTabAreaSize
protected Dimension calculateTabAreaSize()
Calculate preferred size of the tab area. Used only ifisContentEmpty()returnstrue.
-
layoutContainer
public void layoutContainer(Container parent)
- Specified by:
layoutContainerin interfaceLayoutManager- Overrides:
layoutContainerin classBasicTabbedPaneUI.TabbedPaneLayout
-
layoutContainerImpl
protected void layoutContainerImpl()
- Since:
- 3.3
-
layoutChildComponents
protected void layoutChildComponents()
- Since:
- 3.3
-
-