| javax.swing.plaf.basic.BasicTabbedPaneUI javax.swing.plaf.metal.MetalTabbedPaneUI com.jgoodies.looks.plastic.PlasticTabbedPaneUI
PlasticTabbedPaneUI | final public class PlasticTabbedPaneUI extends MetalTabbedPaneUI (Code) | | The JGoodies Plastic Look&Feel implementation of
TabbedPaneUI . It differs from its superclass
MetalTabbedPaneUI in that it paints new tab shapes,
provides two options, and supports ClearLook.
You can enable or disable icons in tabs globally via
com.jgoodies.looks.Options.setTabIconsEnabled(boolean).
To disable the content border set
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.putClientProperty(Option.NO_CONTENT_BORDER_KEY, Boolean.TRUE);
To paint embedded tabs use
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.putClientProperty(Option.EMBEDDED_TABS_KEY, Boolean.TRUE);
There's a special mode that helps you detect content borders in
heavily wrapped component hierarchies - such as the NetBeans IDE.
In this marked mode the content border is painted as a Magenta line.
You can enable this mode by setting the System property
markContentBorders to true; in a command line:
java -DmarkContentBorders=true
author: Karsten Lentzsch author: Torge Husfeldt author: Andrej Golovnin version: $Revision: 1.6 $ See Also: Options |
Method Summary | |
protected ChangeListener | createChangeListener() | protected LayoutManager | createLayoutManager() Creates the layout manager used to set the tab's bounds. | protected PropertyChangeListener | createPropertyChangeListener() Creates and answer a handler that listens to property changes. | public static ComponentUI | createUI(JComponent tabPane) Creates the PlasticTabbedPaneUI . | protected Insets | getContentBorderInsets(int tabPlacement) Returns the insets (i.e. | protected Icon | getIconForTab(int tabIndex) Answers the icon for the tab with the specified index. | protected Insets | getSelectedTabPadInsets(int tabPlacement) Returns the insets for selected tab. | protected Insets | getTabAreaInsets(int tabPlacement) Returns the amount by which the Tab Area is inset. | protected Rectangle | getTabBounds(int tabIndex, Rectangle dest) | protected Insets | getTabInsets(int tabPlacement, int tabIndex) Returns the insets for this tab. | protected int | getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) Returns the amount by which the label should be shifted horizontally. | protected int | getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) Returns the amount by which the label should be shifted vertically. | protected int | getTabRunIndent(int tabPlacement, int run) Returns the amount by which the run number run
should be indented. | protected int | getTabRunOverlay(int tabPlacement) Returns the amount (in pixels) by which two runs should overlap. | protected void | installComponents() Creates and installs any required subcomponents for the JTabbedPane. | protected void | installKeyboardActions() | protected void | installListeners() | public void | installUI(JComponent c) Installs the UI. | protected boolean | isTabInFirstRun(int tabIndex) | protected void | layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected) | public void | paint(Graphics g, JComponent c) | protected void | paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) | protected void | paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rectangles, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected) Draws the rectancle around the Tab label which indicates keyboard focus. | protected void | paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) | protected void | paintTabArea(Graphics g, int tabPlacement, int selectedIndex) | protected void | paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) Fills the background of the given tab to make sure overlap of
tabs is handled correctly. | protected void | paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) Paints the border for one tab. | protected boolean | shouldPadTabRun(int tabPlacement, int run) This boolean controls wheather the given run should be padded to
use up as much space as the others (with more tabs in them). | protected boolean | shouldRotateTabRuns(int tabPlacement) Answers wheather tab runs should be rotated. | public int | tabForCoordinate(JTabbedPane pane, int x, int y) Returns the tab index which intersects the specified point
in the JTabbedPane's coordinate space. | protected void | uninstallComponents() Removes any installed subcomponents from the JTabbedPane. | protected void | uninstallListeners() | public void | uninstallUI(JComponent c) Uninstalls the UI. |
createLayoutManager | protected LayoutManager createLayoutManager()(Code) | | Creates the layout manager used to set the tab's bounds.
|
createPropertyChangeListener | protected PropertyChangeListener createPropertyChangeListener()(Code) | | Creates and answer a handler that listens to property changes.
Unlike the superclass BasicTabbedPane, the PlasticTabbedPaneUI
uses an extended Handler.
|
getContentBorderInsets | protected Insets getContentBorderInsets(int tabPlacement)(Code) | | Returns the insets (i.e. the width) of the content Border.
|
getIconForTab | protected Icon getIconForTab(int tabIndex)(Code) | | Answers the icon for the tab with the specified index.
In case, we have globally switched of the use tab icons,
we answer null if and only if we have a title.
|
getSelectedTabPadInsets | protected Insets getSelectedTabPadInsets(int tabPlacement)(Code) | | Returns the insets for selected tab.
|
getTabAreaInsets | protected Insets getTabAreaInsets(int tabPlacement)(Code) | | Returns the amount by which the Tab Area is inset.
|
getTabInsets | protected Insets getTabInsets(int tabPlacement, int tabIndex)(Code) | | Returns the insets for this tab.
|
getTabLabelShiftX | protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)(Code) | | Returns the amount by which the label should be shifted horizontally.
|
getTabLabelShiftY | protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)(Code) | | Returns the amount by which the label should be shifted vertically.
|
getTabRunIndent | protected int getTabRunIndent(int tabPlacement, int run)(Code) | | Returns the amount by which the run number run
should be indented. Add six pixels for every run to make
diagonal lines align.
|
getTabRunOverlay | protected int getTabRunOverlay(int tabPlacement)(Code) | | Returns the amount (in pixels) by which two runs should overlap.
|
installKeyboardActions | protected void installKeyboardActions()(Code) | | |
installListeners | protected void installListeners()(Code) | | |
isTabInFirstRun | protected boolean isTabInFirstRun(int tabIndex)(Code) | | |
paintContentBorder | protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex)(Code) | | |
paintFocusIndicator | protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rectangles, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)(Code) | | Draws the rectancle around the Tab label which indicates keyboard focus.
|
paintTabArea | protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex)(Code) | | |
paintTabBackground | protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)(Code) | | Fills the background of the given tab to make sure overlap of
tabs is handled correctly.
Note: that tab backgrounds seem to be painted somewhere else, too.
|
paintTabBorder | protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)(Code) | | Paints the border for one tab. Gets the bounds of the tab as parameters.
Note that the result is not clipped so you can paint outside that
rectangle. Tabs painted later on have a chance to overwrite though.
|
shouldPadTabRun | protected boolean shouldPadTabRun(int tabPlacement, int run)(Code) | | This boolean controls wheather the given run should be padded to
use up as much space as the others (with more tabs in them).
|
shouldRotateTabRuns | protected boolean shouldRotateTabRuns(int tabPlacement)(Code) | | Answers wheather tab runs should be rotated. If true, the layout mechanism
will move the run containing the selected tab so that it touches
the content pane.
|
tabForCoordinate | public int tabForCoordinate(JTabbedPane pane, int x, int y)(Code) | | Returns the tab index which intersects the specified point
in the JTabbedPane's coordinate space.
|
uninstallListeners | protected void uninstallListeners()(Code) | | |
Methods inherited from javax.swing.plaf.metal.MetalTabbedPaneUI | protected int calculateMaxTabHeight(int tabPlacement)(Code)(Java Doc) protected LayoutManager createLayoutManager()(Code)(Java Doc) public static ComponentUI createUI(JComponent x)(Code)(Java Doc) protected int getBaselineOffset()(Code)(Java Doc) protected Color getColorForGap(int currentRun, int x, int y)(Code)(Java Doc) protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)(Code)(Java Doc) protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)(Code)(Java Doc) protected int getTabRunOverlay(int tabPlacement)(Code)(Java Doc) protected void installDefaults()(Code)(Java Doc) public void paint(Graphics g, JComponent c)(Code)(Java Doc) protected void paintBottomTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)(Code)(Java Doc) protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)(Code)(Java Doc) protected void paintHighlightBelowTab()(Code)(Java Doc) protected void paintLeftTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)(Code)(Java Doc) protected void paintRightTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)(Code)(Java Doc) protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)(Code)(Java Doc) protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)(Code)(Java Doc) protected void paintTopTabBorder(int tabIndex, Graphics g, int x, int y, int w, int h, int btm, int rght, boolean isSelected)(Code)(Java Doc) protected boolean shouldFillGap(int currentRun, int tabIndex, int x, int y)(Code)(Java Doc) protected boolean shouldPadTabRun(int tabPlacement, int run)(Code)(Java Doc) protected boolean shouldRotateTabRuns(int tabPlacement, int selectedRun)(Code)(Java Doc) public void update(Graphics g, JComponent c)(Code)(Java Doc)
|
Methods inherited from javax.swing.plaf.basic.BasicTabbedPaneUI | protected void assureRectsCreated(int tabCount)(Code)(Java Doc) protected int calculateMaxTabHeight(int tabPlacement)(Code)(Java Doc) protected int calculateMaxTabWidth(int tabPlacement)(Code)(Java Doc) protected int calculateTabAreaHeight(int tabPlacement, int horizRunCount, int maxTabHeight)(Code)(Java Doc) protected int calculateTabAreaWidth(int tabPlacement, int vertRunCount, int maxTabWidth)(Code)(Java Doc) protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight)(Code)(Java Doc) protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics)(Code)(Java Doc) protected ChangeListener createChangeListener()(Code)(Java Doc) protected FocusListener createFocusListener()(Code)(Java Doc) protected LayoutManager createLayoutManager()(Code)(Java Doc) protected MouseListener createMouseListener()(Code)(Java Doc) protected PropertyChangeListener createPropertyChangeListener()(Code)(Java Doc) protected JButton createScrollButton(int direction)(Code)(Java Doc) public static ComponentUI createUI(JComponent c)(Code)(Java Doc) protected void expandTabRunsArray()(Code)(Java Doc) public int getBaseline(JComponent c, int width, int height)(Code)(Java Doc) protected int getBaseline(int tab)(Code)(Java Doc) protected int getBaselineOffset()(Code)(Java Doc) public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)(Code)(Java Doc) protected Insets getContentBorderInsets(int tabPlacement)(Code)(Java Doc) protected int getFocusIndex()(Code)(Java Doc) protected FontMetrics getFontMetrics()(Code)(Java Doc) protected Icon getIconForTab(int tabIndex)(Code)(Java Doc) public Dimension getMaximumSize(JComponent c)(Code)(Java Doc) public Dimension getMinimumSize(JComponent c)(Code)(Java Doc) protected int getNextTabIndex(int base)(Code)(Java Doc) protected int getNextTabIndexInRun(int tabCount, int base)(Code)(Java Doc) protected int getNextTabRun(int baseRun)(Code)(Java Doc) protected int getPreviousTabIndex(int base)(Code)(Java Doc) protected int getPreviousTabIndexInRun(int tabCount, int base)(Code)(Java Doc) protected int getPreviousTabRun(int baseRun)(Code)(Java Doc) protected int getRolloverTab()(Code)(Java Doc) protected int getRunForTab(int tabCount, int tabIndex)(Code)(Java Doc) protected Insets getSelectedTabPadInsets(int tabPlacement)(Code)(Java Doc) protected Insets getTabAreaInsets(int tabPlacement)(Code)(Java Doc) public Rectangle getTabBounds(JTabbedPane pane, int i)(Code)(Java Doc) protected Rectangle getTabBounds(int tabIndex, Rectangle dest)(Code)(Java Doc) protected Insets getTabInsets(int tabPlacement, int tabIndex)(Code)(Java Doc) protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)(Code)(Java Doc) protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)(Code)(Java Doc) public int getTabRunCount(JTabbedPane pane)(Code)(Java Doc) protected int getTabRunIndent(int tabPlacement, int run)(Code)(Java Doc) protected int getTabRunOffset(int tabPlacement, int tabCount, int tabIndex, boolean forward)(Code)(Java Doc) protected int getTabRunOverlay(int tabPlacement)(Code)(Java Doc) protected View getTextViewForTab(int tabIndex)(Code)(Java Doc) protected Component getVisibleComponent()(Code)(Java Doc) protected void installComponents()(Code)(Java Doc) protected void installDefaults()(Code)(Java Doc) protected void installKeyboardActions()(Code)(Java Doc) protected void installListeners()(Code)(Java Doc) public void installUI(JComponent c)(Code)(Java Doc) protected int lastTabInRun(int tabCount, int run)(Code)(Java Doc) protected void layoutLabel(int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, Rectangle textRect, boolean isSelected)(Code)(Java Doc) protected void navigateSelectedTab(int direction)(Code)(Java Doc) public void paint(Graphics g, JComponent c)(Code)(Java Doc) protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex)(Code)(Java Doc) protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)(Code)(Java Doc) protected void paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)(Code)(Java Doc) protected void paintIcon(Graphics g, int tabPlacement, int tabIndex, Icon icon, Rectangle iconRect, boolean isSelected)(Code)(Java Doc) protected void paintTab(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect)(Code)(Java Doc) protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex)(Code)(Java Doc) protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)(Code)(Java Doc) protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected)(Code)(Java Doc) protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected)(Code)(Java Doc) protected static void rotateInsets(Insets topInsets, Insets targetInsets, int targetPlacement)(Code)(Java Doc) protected void selectAdjacentRunTab(int tabPlacement, int tabIndex, int offset)(Code)(Java Doc) protected void selectNextTab(int current)(Code)(Java Doc) protected void selectNextTabInRun(int current)(Code)(Java Doc) protected void selectPreviousTab(int current)(Code)(Java Doc) protected void selectPreviousTabInRun(int current)(Code)(Java Doc) protected void setRolloverTab(int index)(Code)(Java Doc) protected void setVisibleComponent(Component component)(Code)(Java Doc) protected boolean shouldPadTabRun(int tabPlacement, int run)(Code)(Java Doc) protected boolean shouldRotateTabRuns(int tabPlacement)(Code)(Java Doc) public int tabForCoordinate(JTabbedPane pane, int x, int y)(Code)(Java Doc) protected void uninstallComponents()(Code)(Java Doc) protected void uninstallDefaults()(Code)(Java Doc) protected void uninstallKeyboardActions()(Code)(Java Doc) protected void uninstallListeners()(Code)(Java Doc) public void uninstallUI(JComponent c)(Code)(Java Doc)
|
|
|