javax.swing.plaf.metal
public class MetalTabbedPaneUI extends BasicTabbedPaneUI
Nested Class Summary | |
---|---|
class | MetalTabbedPaneUI.TabbedPaneLayout
A {@link LayoutManager} responsible for placing all the tabs and the
visible component inside the {@link JTabbedPane}. |
Field Summary | |
---|---|
protected int | minTabWidth
The minimum tab width. |
protected Color | selectColor
The color for the selected tab. |
protected Color | selectHighlight
The color for a highlighted selected tab. |
protected Color | tabAreaBackground
The background color used for the tab area. |
Constructor Summary | |
---|---|
MetalTabbedPaneUI()
Constructs a new instance of MetalTabbedPaneUI. |
Method Summary | |
---|---|
protected int | calculateMaxTabHeight(int tabPlacement) |
protected LayoutManager | createLayoutManager()
Creates and returns an instance of {@link TabbedPaneLayout}.
|
static ComponentUI | createUI(JComponent component)
Returns an instance of MetalTabbedPaneUI.
|
protected Color | getColorForGap(int currentRun, int x, int y)
Returns the color for the gap.
|
protected int | getTabLabelShiftX(int tabPlacement, int index, boolean isSelected) |
protected int | getTabLabelShiftY(int tabPlacement, int index, boolean isSelected) |
protected int | getTabRunOverlay(int tabPlacement)
Returns the amount of overlay among the tabs. |
protected void | installDefaults()
Installs the defaults for this UI. |
protected void | paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the bottom
({@link #BOTTOM}).
|
protected void | paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
Paints the lower edge of the content border.
|
protected void | paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
Paints the left edge of the content border.
|
protected void | paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
Paints the right edge of the content border.
|
protected void | paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
Paints the upper edge of the content border.
|
protected void | paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
This method paints the focus rectangle around the selected tab.
|
protected void | paintHighlightBelowTab()
Paints the highlight below the tab, if there is one. |
protected void | paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the left
({@link #LEFT}).
|
protected void | paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the right
({@link #RIGHT}).
|
protected void | paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
Paints the background for a tab.
|
protected void | paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)
Paints the border for a single tab.
|
protected void | paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)
Paints the border for a tab assuming that the tab position is at the top
({@link #TOP}).
|
protected boolean | shouldFillGap(int currentRun, int tabIndex, int x, int y)
Returns true if the gap should be filled in.
|
protected boolean | shouldPadTabRun(int tabPlacement, int run)
Returns true if the tabs in the specified run should be
padded to make the run fill the width/height of the {@link JTabbedPane}.
|
protected boolean | shouldRotateTabRuns(int tabPlacement, int selectedRun)
Returns true if we should rotate the tab runs.
|
Returns: A layout manager used by this UI delegate.
Parameters: component the component for which we return an UI instance
Returns: an instance of MetalTabbedPaneUI
Parameters: currentRun - The current run to return the color for x - The x position of the current run y - The y position of the current run
Returns: the color for the gap in the current run.
Parameters: tabPlacement the placement
Returns: the amount of overlay among the tabs
Parameters: tabIndex the tab index. g the graphics device. x the x-coordinate for the tab's bounding rectangle. y the y-coordinate for the tab's bounding rectangle. w the width for the tab's bounding rectangle. h the height for the tab's bounding rectangle. btm ??? rght ??? isSelected indicates whether the tab is selected.
Parameters: g the graphics to use for painting tabPlacement the tab placement selectedIndex the index of the selected tab x the upper left coordinate of the content area y the upper left coordinate of the content area w the width of the content area h the height of the content area
Parameters: g the graphics to use for painting tabPlacement the tab placement selectedIndex the index of the selected tab x the upper left coordinate of the content area y the upper left coordinate of the content area w the width of the content area h the height of the content area
Parameters: g the graphics to use for painting tabPlacement the tab placement selectedIndex the index of the selected tab x the upper left coordinate of the content area y the upper left coordinate of the content area w the width of the content area h the height of the content area
Parameters: g the graphics to use for painting tabPlacement the tab placement selectedIndex the index of the selected tab x the upper left coordinate of the content area y the upper left coordinate of the content area w the width of the content area h the height of the content area
Parameters: g The Graphics object to paint with. tabPlacement The JTabbedPane's tab placement. rects The array of rectangles keeping track of size and position. tabIndex The tab index. iconRect The icon bounds. textRect The text bounds. isSelected Whether this tab is selected.
Parameters: tabIndex the tab index. g the graphics device. x the x-coordinate for the tab's bounding rectangle. y the y-coordinate for the tab's bounding rectangle. w the width for the tab's bounding rectangle. h the height for the tab's bounding rectangle. btm ??? rght ??? isSelected indicates whether the tab is selected.
Parameters: tabIndex the tab index. g the graphics device. x the x-coordinate for the tab's bounding rectangle. y the y-coordinate for the tab's bounding rectangle. w the width for the tab's bounding rectangle. h the height for the tab's bounding rectangle. btm ??? rght ??? isSelected indicates whether the tab is selected.
Parameters: g the graphics device. tabPlacement the tab placement ({@link #TOP}, {@link #LEFT}, {@link #BOTTOM} or {@link #RIGHT}). tabIndex the index of the tab to draw the border for. x the x-coordinate for the tab's bounding rectangle. y the y-coordinate for the tab's bounding rectangle. w the width for the tab's bounding rectangle. h the height for the tab's bounding rectangle. isSelected indicates whether or not the tab is selected.
Parameters: g the graphics device. tabPlacement the tab placement ({@link #TOP}, {@link #LEFT}, {@link #BOTTOM} or {@link #RIGHT}). tabIndex the index of the tab to draw the border for. x the x-coordinate for the tab's bounding rectangle. y the y-coordinate for the tab's bounding rectangle. w the width for the tab's bounding rectangle. h the height for the tab's bounding rectangle. isSelected indicates whether or not the tab is selected.
Parameters: tabIndex the tab index. g the graphics device. x the x-coordinate for the tab's bounding rectangle. y the y-coordinate for the tab's bounding rectangle. w the width for the tab's bounding rectangle. h the height for the tab's bounding rectangle. btm the y coordinate of the bottom border rght the x coordinate of the right border isSelected indicates whether the tab is selected.
Parameters: currentRun - The current run tabIndex - The current tab x - The x position of the tab y - The y position of the tab
Returns: true if the gap at the current run should be filled
true
if the tabs in the specified run should be
padded to make the run fill the width/height of the {@link JTabbedPane}.
Parameters: tabPlacement the tab placement for the {@link JTabbedPane} (one of {@link #TOP}, {@link #BOTTOM}, {@link #LEFT} and {@link #RIGHT}). run the run index.
Returns: A boolean.
Parameters: tabPlacement - The current tab placement. selectedRun - The selected run.
Returns: true if the tab runs should be rotated.