public class SynthTabbedPaneUI extends BasicTabbedPaneUIimplements PropertyChangeListener , SynthUI
JTabbedPane.
Looks up the selectedTabPadInsets property from the Style, which represents additional insets for the selected tab.
BasicTabbedPaneUI.FocusHandler , BasicTabbedPaneUI.MouseHandler , BasicTabbedPaneUI.PropertyChangeHandler , BasicTabbedPaneUI.TabbedPaneLayout , BasicTabbedPaneUI.TabSelectionHandler 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, upKeyDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTEDBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| Constructor and Description |
|---|
SynthTabbedPaneUI()
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateMaxTabHeight(int tabPlacement)
|
protected int |
calculateMaxTabWidth(int tabPlacement)
|
protected int |
calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics
|
protected LayoutManager |
createLayoutManager()
Invoked by
installUI to create a layout manager object to manage the
JTabbedPane.
|
protected MouseListener |
createMouseListener()
Overridden to keep track of whether the selected tab is also pressed.
|
protected JButton |
createScrollButton(int direction)
Creates and returns a JButton that will provide the user with a way to scroll the tabs in a particular direction.
|
static ComponentUI |
createUI(JComponent
Creates a new UI object for the given component.
|
protected int |
getBaseline(int tab)
Returns the baseline for the specified tab.
|
SynthContext |
getContext(JComponent
Returns the Context for the specified component.
|
protected FontMetrics |
getFontMetrics()
|
protected Insets |
getTabInsets(int tabPlacement, int tabIndex)
|
protected int |
getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected)
|
protected int |
getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected)
|
protected void |
installDefaults()
|
protected void |
installListeners()
|
void |
paint(Graphics
Paints the specified component according to the Look and Feel.
|
protected void |
paint(SynthContext
Paints the specified component.
|
void |
paintBorder(SynthContext
Paints the border.
|
protected void |
paintTabArea(Graphics
Paints the tabs in the tab area.
|
void |
propertyChange(PropertyChangeEvent
This method gets called when a bound property is changed.
|
protected void |
setRolloverTab(int index)
Sets the tab the mouse is currently over to
index.
|
protected void |
uninstallDefaults()
|
protected void |
uninstallListeners()
|
void |
update(Graphics
Notifies this UI delegate to repaint the specified component.
|
assureRectsCreated, calculateTabAreaHeight, calculateTabAreaWidth, calculateTabHeight, createChangeListener, createFocusListener, createPropertyChangeListener, expandTabRunsArray, getBaseline, getBaselineOffset, getBaselineResizeBehavior, getContentBorderInsets, getFocusIndex, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getSelectedTabPadInsets, getTabAreaInsets, getTabBounds, getTabBounds, getTabRunCount, getTabRunIndent, getTabRunOffset, getTabRunOverlay, getTextViewForTab, getVisibleComponent, installComponents, installKeyboardActions, installUI, lastTabInRun, layoutLabel, navigateSelectedTab, paintContentBorder, paintContentBorderBottomEdge, paintContentBorderLeftEdge, paintContentBorderRightEdge, paintContentBorderTopEdge, paintFocusIndicator, paintIcon, paintTab, paintTabBackground, paintTabBorder, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setVisibleComponent, shouldPadTabRun, shouldRotateTabRuns, tabForCoordinate, uninstallComponents, uninstallKeyboardActions, uninstallUIcontains, getAccessibleChild, getAccessibleChildrenCount, getPreferredSizepublic static ComponentUIcreateUI(JComponent c)
c - component to create UI object for
protected void installDefaults()
protected void installListeners()
protected void uninstallListeners()
protected void uninstallDefaults()
public SynthContextgetContext(JComponent c)
getContext in interface
SynthUI
c - Component requesting SynthContext.
protected JButtoncreateScrollButton(int direction)
createScrollButton in class
BasicTabbedPaneUI
direction - One of the SwingConstants constants: SOUTH, NORTH, EAST or WEST
JTabbedPane.setTabPlacement(int) ,
SwingConstants
public void propertyChange(PropertyChangeEvente)
propertyChange in interface
PropertyChangeListener
e - A PropertyChangeEvent object describing the event source and the property that has changed.
protected MouseListenercreateMouseListener()
protected int getTabLabelShiftX(int tabPlacement,
int tabIndex,
boolean isSelected)
protected int getTabLabelShiftY(int tabPlacement,
int tabIndex,
boolean isSelected)
public void update(Graphicsg, JComponent c)
paint(SynthContext,Graphics) method.
In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.
update in class
ComponentUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
protected int getBaseline(int tab)
getBaseline in class
BasicTabbedPaneUI
tab - index of tab to get baseline for
public void paintBorder(SynthContextcontext, Graphics g, int x, int y, int w, int h)
paintBorder in interface
SynthUI
context - a component context
g -
Graphics to paint on
x - the X coordinate
y - the Y coordinate
w - width of the border
h - height of the border
public void paint(Graphicsg, JComponent c)
This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext,Graphics) method.
paint in class
BasicTabbedPaneUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
protected void paint(SynthContextcontext, Graphics g)
context - context for the component being painted
g - the
Graphics object used for painting
update(Graphics,JComponent)
protected void paintTabArea(Graphicsg, int tabPlacement, int selectedIndex)
BasicTabbedPaneUI
Graphics object. Tab placement may be either:
JTabbedPane.TOP,
JTabbedPane.BOTTOM,
JTabbedPane.LEFT, or
JTabbedPane.RIGHT. The selected index must be a valid tabbed pane tab index (0 to tab count - 1, inclusive) or -1 if no tab is currently selected. The handling of invalid parameters is unspecified.
paintTabArea in class
BasicTabbedPaneUI
g - the graphics object to use for rendering
tabPlacement - the placement for the tabs within the JTabbedPane
selectedIndex - the tab index of the selected component
protected void setRolloverTab(int index)
index.
index will be -1 if the mouse is no longer over any tab. No checking is done to ensure the passed in index identifies a valid tab.
setRolloverTab in class
BasicTabbedPaneUI
index - Index of the tab the mouse is over.
protected int calculateMaxTabHeight(int tabPlacement)
protected int calculateTabWidth(int tabPlacement,
int tabIndex,
FontMetrics metrics)
protected int calculateMaxTabWidth(int tabPlacement)
protected InsetsgetTabInsets(int tabPlacement, int tabIndex)
protected FontMetricsgetFontMetrics()
protected LayoutManagercreateLayoutManager()
installUI to create a layout manager object to manage the
JTabbedPane. Overridden to create a TabbedPaneLayout subclass which takes into account tabOverlap.
createLayoutManager in class
BasicTabbedPaneUI
BasicTabbedPaneUI.TabbedPaneLayout,
JTabbedPane.getTabLayoutPolicy()