public class TabComponentLayoutManager
extends java.lang.Object
implements java.awt.LayoutManager
Constructor and Description |
---|
TabComponentLayoutManager(OrientedLabel label,
ButtonPanel panel,
TabConfiguration configuration)
Creates a new layout manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp) |
java.awt.Insets |
getActionInsets()
Gets the empty space around the actions.
|
ButtonPanel |
getActions()
Gets the panels showing the actions
|
TabConfiguration |
getConfiguration()
Gets the current configuration of the tab
|
int |
getFreeSpaceBetweenLabelAndActions()
Gets the size of the gap between text/icon and actions.
|
int |
getFreeSpaceToOpenSide()
Gets the size of the open side.
|
int |
getFreeSpaceToParallelBorder()
Gets the size of the border at the side of the
Dockable |
int |
getFreeSpaceToSideBorder()
Gets the size of the free space between the borders that are on the same line as
the text/icon and the actions.
|
OrientedLabel |
getLabel()
Gets the label showing icon and text
|
java.awt.Insets |
getLabelInsets()
Gets the empty space around the label.
|
TabPlacement |
getOrientation()
Gets the current position of the tab in relation to the
Dockable s. |
void |
layoutContainer(java.awt.Container parent) |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent) |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent) |
void |
removeLayoutComponent(java.awt.Component comp) |
void |
setActionInsets(java.awt.Insets actionInsets)
Sets the empty space around the actions.
|
void |
setConfiguration(TabConfiguration configuration)
Changes the look and behavior of the tab.
|
void |
setFreeSpaceBetweenLabelAndActions(int freeSpaceBetweenLabelAndActions)
Sets the size of the gap that is between the label (icon and text) and the
DockAction s (if there are any). |
void |
setFreeSpaceToOpenSide(int freeSpaceToOpenSide)
Sets the size of the free space between content and the open side.
|
void |
setFreeSpaceToParallelBorder(int freeSpaceToParallelBorder)
Sets the size of the free space between content and the border at the side
of the
Dockable . |
void |
setFreeSpaceToSideBorder(int freeSpaceToSideBorder)
Sets the size of the free space between the borders that are on the same line as
the text/icon and the actions.
|
void |
setLabelInsets(java.awt.Insets labelInsets)
Sets the space that should be left empty around the label.
|
void |
setOrientation(TabPlacement orientation) |
protected boolean |
shouldShowActions(java.awt.Container parent)
Using the current
TabConfiguration , this method decides whether there is enough space to show
the actions or not. |
protected boolean |
shouldShowIcon()
Tells whether the icon should be shown for the current size of
the label . |
public TabComponentLayoutManager(OrientedLabel label, ButtonPanel panel, TabConfiguration configuration)
label
- the label shown on the tabpanel
- the actions shown on the tabconfiguration
- the exact look and behavior of the tabpublic ButtonPanel getActions()
null
public OrientedLabel getLabel()
null
public TabConfiguration getConfiguration()
null
public void setConfiguration(TabConfiguration configuration)
configuration
- the new configuration to use, not null
public void setFreeSpaceToOpenSide(int freeSpaceToOpenSide)
freeSpaceToOpenSide
- the sizepublic int getFreeSpaceToOpenSide()
setFreeSpaceToOpenSide(int)
public void setFreeSpaceBetweenLabelAndActions(int freeSpaceBetweenLabelAndActions)
DockAction
s (if there are any).freeSpaceBetweenLabelAndActions
- the sizepublic int getFreeSpaceBetweenLabelAndActions()
setFreeSpaceBetweenLabelAndActions(int)
public void setFreeSpaceToParallelBorder(int freeSpaceToParallelBorder)
Dockable
.freeSpaceToParallelBorder
- the sizepublic int getFreeSpaceToParallelBorder()
Dockable
setFreeSpaceToParallelBorder(int)
public void setFreeSpaceToSideBorder(int freeSpaceToSideBorder)
freeSpaceToSideBorder
- the sizepublic int getFreeSpaceToSideBorder()
setFreeSpaceToSideBorder(int)
public void setLabelInsets(java.awt.Insets labelInsets)
labelInsets
- the empty space, not null
public java.awt.Insets getLabelInsets()
public void setActionInsets(java.awt.Insets actionInsets)
actionInsets
- the empty space, not null
public java.awt.Insets getActionInsets()
public void setOrientation(TabPlacement orientation)
public TabPlacement getOrientation()
Dockable
s.public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
protected boolean shouldShowActions(java.awt.Container parent)
TabConfiguration
, this method decides whether there is enough space to show
the actions or not.parent
- the parent Container
of the label and the actionsprotected boolean shouldShowIcon()
the label
.public void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager