|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.TabbedPaneUI
javax.swing.plaf.basic.BasicTabbedPaneUI
javax.swing.plaf.metal.MetalTabbedPaneUI
com.jgoodies.looks.plastic.PlasticTabbedPaneUI
public final class PlasticTabbedPaneUI
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
Options| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI |
|---|
javax.swing.plaf.basic.BasicTabbedPaneUI.FocusHandler, javax.swing.plaf.basic.BasicTabbedPaneUI.MouseHandler, javax.swing.plaf.basic.BasicTabbedPaneUI.PropertyChangeHandler |
| Field Summary |
|---|
| Fields inherited from class javax.swing.plaf.metal.MetalTabbedPaneUI |
|---|
minTabWidth, selectColor, selectHighlight, tabAreaBackground |
| Fields inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI |
|---|
calcRect, contentBorderInsets, darkShadow, downKey, focus, focusListener, highlight, leftKey, lightHighlight, maxTabHeight, maxTabWidth, mouseListener, propertyChangeListener, rects, rightKey, runCount, selectedRun, selectedTabPadInsets, shadow, tabAreaInsets, tabChangeListener, tabInsets, tabPane, tabRunOverlay, tabRuns, textIconGap, upKey |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
|---|---|
PlasticTabbedPaneUI()
|
|
| Method Summary | |
|---|---|
protected javax.swing.event.ChangeListener |
createChangeListener()
|
protected java.awt.LayoutManager |
createLayoutManager()
Creates the layout manager used to set the tab's bounds. |
protected java.beans.PropertyChangeListener |
createPropertyChangeListener()
Creates and answer a handler that listens to property changes. |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent tabPane)
Creates the PlasticTabbedPaneUI. |
protected java.awt.Insets |
getContentBorderInsets(int tabPlacement)
Returns the insets (i.e. the width) of the content Border. |
protected javax.swing.Icon |
getIconForTab(int tabIndex)
Answers the icon for the tab with the specified index. |
protected java.awt.Insets |
getSelectedTabPadInsets(int tabPlacement)
Returns the insets for selected tab. |
protected java.awt.Insets |
getTabAreaInsets(int tabPlacement)
Returns the amount by which the Tab Area is inset. |
protected java.awt.Rectangle |
getTabBounds(int tabIndex,
java.awt.Rectangle dest)
|
protected java.awt.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()
|
void |
installUI(javax.swing.JComponent c)
Installs the UI. |
protected boolean |
isTabInFirstRun(int tabIndex)
|
protected void |
layoutLabel(int tabPlacement,
java.awt.FontMetrics metrics,
int tabIndex,
java.lang.String title,
javax.swing.Icon icon,
java.awt.Rectangle tabRect,
java.awt.Rectangle iconRect,
java.awt.Rectangle textRect,
boolean isSelected)
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
|
protected void |
paintContentBorder(java.awt.Graphics g,
int tabPlacement,
int selectedIndex)
|
protected void |
paintFocusIndicator(java.awt.Graphics g,
int tabPlacement,
java.awt.Rectangle[] rectangles,
int tabIndex,
java.awt.Rectangle iconRect,
java.awt.Rectangle textRect,
boolean isSelected)
Draws the rectancle around the Tab label which indicates keyboard focus. |
protected void |
paintTab(java.awt.Graphics g,
int tabPlacement,
java.awt.Rectangle[] rects,
int tabIndex,
java.awt.Rectangle iconRect,
java.awt.Rectangle textRect)
|
protected void |
paintTabArea(java.awt.Graphics g,
int tabPlacement,
int selectedIndex)
|
protected void |
paintTabBackground(java.awt.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(java.awt.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. |
int |
tabForCoordinate(javax.swing.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()
|
void |
uninstallUI(javax.swing.JComponent c)
Uninstalls the UI. |
| Methods inherited from class javax.swing.plaf.metal.MetalTabbedPaneUI |
|---|
calculateMaxTabHeight, getBaselineOffset, getColorForGap, installDefaults, paintBottomTabBorder, paintContentBorderBottomEdge, paintContentBorderLeftEdge, paintContentBorderRightEdge, paintContentBorderTopEdge, paintHighlightBelowTab, paintLeftTabBorder, paintRightTabBorder, paintTopTabBorder, shouldFillGap, shouldRotateTabRuns, update |
| Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI |
|---|
assureRectsCreated, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, calculateTabWidth, createFocusListener, createMouseListener, createScrollButton, expandTabRunsArray, getBaseline, getBaseline, getBaselineResizeBehavior, getFocusIndex, getFontMetrics, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getTabBounds, getTabRunCount, getTabRunOffset, getTextViewForTab, getVisibleComponent, lastTabInRun, navigateSelectedTab, paintIcon, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setRolloverTab, setVisibleComponent, uninstallDefaults, uninstallKeyboardActions |
| Methods inherited from class javax.swing.plaf.ComponentUI |
|---|
contains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PlasticTabbedPaneUI()
| Method Detail |
|---|
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent tabPane)
PlasticTabbedPaneUI.
ComponentUI.createUI(JComponent)public void installUI(javax.swing.JComponent c)
installUI in class javax.swing.plaf.basic.BasicTabbedPaneUIComponentUI.installUI(JComponent)public void uninstallUI(javax.swing.JComponent c)
uninstallUI in class javax.swing.plaf.basic.BasicTabbedPaneUIComponentUI.uninstallUI(JComponent)protected void installComponents()
installComponents in class javax.swing.plaf.basic.BasicTabbedPaneUIBasicTabbedPaneUI.installComponents()protected void uninstallComponents()
uninstallComponents in class javax.swing.plaf.basic.BasicTabbedPaneUIBasicTabbedPaneUI.uninstallComponents()protected void installListeners()
installListeners in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected void uninstallListeners()
uninstallListeners in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected void installKeyboardActions()
installKeyboardActions in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected java.beans.PropertyChangeListener createPropertyChangeListener()
createPropertyChangeListener in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected javax.swing.event.ChangeListener createChangeListener()
createChangeListener in class javax.swing.plaf.basic.BasicTabbedPaneUI
public void paint(java.awt.Graphics g,
javax.swing.JComponent c)
paint in class javax.swing.plaf.metal.MetalTabbedPaneUI
protected void paintTab(java.awt.Graphics g,
int tabPlacement,
java.awt.Rectangle[] rects,
int tabIndex,
java.awt.Rectangle iconRect,
java.awt.Rectangle textRect)
paintTab in class javax.swing.plaf.basic.BasicTabbedPaneUI
public int tabForCoordinate(javax.swing.JTabbedPane pane,
int x,
int y)
tabForCoordinate in class javax.swing.plaf.basic.BasicTabbedPaneUI
protected java.awt.Rectangle getTabBounds(int tabIndex,
java.awt.Rectangle dest)
getTabBounds in class javax.swing.plaf.basic.BasicTabbedPaneUI
protected void paintTabArea(java.awt.Graphics g,
int tabPlacement,
int selectedIndex)
paintTabArea in class javax.swing.plaf.basic.BasicTabbedPaneUI
protected void layoutLabel(int tabPlacement,
java.awt.FontMetrics metrics,
int tabIndex,
java.lang.String title,
javax.swing.Icon icon,
java.awt.Rectangle tabRect,
java.awt.Rectangle iconRect,
java.awt.Rectangle textRect,
boolean isSelected)
layoutLabel in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected javax.swing.Icon getIconForTab(int tabIndex)
null if and only if we have a title.
getIconForTab in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected java.awt.LayoutManager createLayoutManager()
createLayoutManager in class javax.swing.plaf.metal.MetalTabbedPaneUIprotected boolean isTabInFirstRun(int tabIndex)
protected void paintContentBorder(java.awt.Graphics g,
int tabPlacement,
int selectedIndex)
paintContentBorder in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected java.awt.Insets getContentBorderInsets(int tabPlacement)
getContentBorderInsets in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected java.awt.Insets getTabAreaInsets(int tabPlacement)
getTabAreaInsets in class javax.swing.plaf.basic.BasicTabbedPaneUI
protected int getTabLabelShiftX(int tabPlacement,
int tabIndex,
boolean isSelected)
getTabLabelShiftX in class javax.swing.plaf.metal.MetalTabbedPaneUI
protected int getTabLabelShiftY(int tabPlacement,
int tabIndex,
boolean isSelected)
getTabLabelShiftY in class javax.swing.plaf.metal.MetalTabbedPaneUIprotected int getTabRunOverlay(int tabPlacement)
getTabRunOverlay in class javax.swing.plaf.metal.MetalTabbedPaneUI
protected boolean shouldPadTabRun(int tabPlacement,
int run)
shouldPadTabRun in class javax.swing.plaf.metal.MetalTabbedPaneUI
protected int getTabRunIndent(int tabPlacement,
int run)
run
should be indented. Add six pixels for every run to make
diagonal lines align.
getTabRunIndent in class javax.swing.plaf.basic.BasicTabbedPaneUI
protected java.awt.Insets getTabInsets(int tabPlacement,
int tabIndex)
getTabInsets in class javax.swing.plaf.basic.BasicTabbedPaneUIprotected java.awt.Insets getSelectedTabPadInsets(int tabPlacement)
getSelectedTabPadInsets in class javax.swing.plaf.basic.BasicTabbedPaneUI
protected void paintFocusIndicator(java.awt.Graphics g,
int tabPlacement,
java.awt.Rectangle[] rectangles,
int tabIndex,
java.awt.Rectangle iconRect,
java.awt.Rectangle textRect,
boolean isSelected)
paintFocusIndicator in class javax.swing.plaf.metal.MetalTabbedPaneUI
protected void paintTabBackground(java.awt.Graphics g,
int tabPlacement,
int tabIndex,
int x,
int y,
int w,
int h,
boolean isSelected)
paintTabBackground in class javax.swing.plaf.metal.MetalTabbedPaneUI
protected void paintTabBorder(java.awt.Graphics g,
int tabPlacement,
int tabIndex,
int x,
int y,
int w,
int h,
boolean isSelected)
paintTabBorder in class javax.swing.plaf.metal.MetalTabbedPaneUIprotected boolean shouldRotateTabRuns(int tabPlacement)
shouldRotateTabRuns in class javax.swing.plaf.basic.BasicTabbedPaneUI
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||