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:
LayoutManager
- Enclosing class:
- FlatTabbedPaneUI
protected class FlatTabbedPaneUI.FlatTabbedPaneScrollLayout extends FlatTabbedPaneUI.FlatTabbedPaneLayout implements 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().
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFlatTabbedPaneScrollLayout(BasicTabbedPaneUI.TabbedPaneLayout delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutComponent(String name, Component comp)voidcalculateLayoutInfo()protected DimensioncalculateTabAreaSize()Calculate preferred size of the tab area.protected voidlayoutChildComponent(Component c, Rectangle contentAreaBounds)protected voidlayoutContainerImpl()DimensionminimumLayoutSize(Container parent)DimensionpreferredLayoutSize(Container parent)voidremoveLayoutComponent(Component comp)-
Methods inherited from class com.formdev.flatlaf.ui.FlatTabbedPaneUI.FlatTabbedPaneLayout
calculateSize, isContentEmpty, layoutChildComponents, layoutContainer
-
Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI.TabbedPaneLayout
calculateTabRects, normalizeTabRuns, padSelectedTab, padTabRun, preferredTabAreaHeight, preferredTabAreaWidth, rotateTabRuns
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.awt.LayoutManager
layoutContainer
-
-
-
-
Constructor Detail
-
FlatTabbedPaneScrollLayout
protected FlatTabbedPaneScrollLayout(BasicTabbedPaneUI.TabbedPaneLayout delegate)
-
-
Method Detail
-
calculateLayoutInfo
public void calculateLayoutInfo()
- Overrides:
calculateLayoutInfoin classBasicTabbedPaneUI.TabbedPaneLayout
-
calculateTabAreaSize
protected 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 Dimension preferredLayoutSize(Container parent)
- Specified by:
preferredLayoutSizein interfaceLayoutManager- Overrides:
preferredLayoutSizein classBasicTabbedPaneUI.TabbedPaneLayout
-
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- Specified by:
minimumLayoutSizein interfaceLayoutManager- Overrides:
minimumLayoutSizein classBasicTabbedPaneUI.TabbedPaneLayout
-
addLayoutComponent
public void addLayoutComponent(String name, Component comp)
- Specified by:
addLayoutComponentin interfaceLayoutManager- Overrides:
addLayoutComponentin classBasicTabbedPaneUI.TabbedPaneLayout
-
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- Specified by:
removeLayoutComponentin interfaceLayoutManager- Overrides:
removeLayoutComponentin classBasicTabbedPaneUI.TabbedPaneLayout
-
layoutContainerImpl
protected void layoutContainerImpl()
- Overrides:
layoutContainerImplin classFlatTabbedPaneUI.FlatTabbedPaneLayout- Since:
- 3.3
-
layoutChildComponent
protected void layoutChildComponent(Component c, Rectangle contentAreaBounds)
- Overrides:
layoutChildComponentin classFlatTabbedPaneUI.FlatTabbedPaneLayout- Since:
- 3.3
-
-