net.java.sip.communicator.util.swing.plaf
Class SIPCommTabbedPaneUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.TabbedPaneUI
javax.swing.plaf.basic.BasicTabbedPaneUI
net.java.sip.communicator.util.swing.plaf.SIPCommTabbedPaneUI
- All Implemented Interfaces:
- SwingConstants, Skinnable
- Direct Known Subclasses:
- SIPCommTabbedPaneEnhancedUI
public class SIPCommTabbedPaneUI
- extends BasicTabbedPaneUI
- implements Skinnable
SIPCommTabbedPaneUI implementation.
| 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 |
|
Method Summary |
protected int |
calculateTabHeight(int tabPlacement,
int tabIndex,
int fontHeight)
|
protected int |
calculateTabWidth(int tabPlacement,
int tabIndex,
FontMetrics metrics)
|
protected ChangeListener |
createChangeListener()
|
protected LayoutManager |
createLayoutManager()
Invoked by installUI to create a layout manager object to
manage the JTabbedPane. |
protected MouseListener |
createMouseListener()
|
(package private) ActionMap |
createMyActionMap()
|
protected SIPCommTabbedPaneUI.ScrollableTabButton |
createScrollableTabButton(int direction)
|
static ComponentUI |
createUI(JComponent c)
|
(package private) InputMap |
getMyInputMap(int condition)
|
int |
getOverTabIndex()
|
protected Rectangle |
getTabBounds(int tabIndex,
Rectangle dest)
Returns the bounds of the specified tab in the coordinate space of the
JTabbedPane component. |
protected void |
installComponents()
Creates and installs any required subcomponents for the JTabbedPane. |
protected void |
installKeyboardActions()
|
protected void |
installListeners()
|
boolean |
isCloseEnabled()
|
boolean |
isMaxEnabled()
|
protected boolean |
isOneActionButtonEnabled()
|
protected void |
layoutLabel(int tabPlacement,
FontMetrics metrics,
int tabIndex,
String title,
Icon icon,
Rectangle tabRect,
Rectangle iconRect,
Rectangle textRect,
boolean isSelected)
|
void |
loadSkin()
Reloads close icon. |
protected Rectangle |
newCloseRect(Rectangle rect)
|
protected Rectangle |
newMaxRect(Rectangle rect)
|
void |
paint(Graphics g,
JComponent c)
|
protected void |
paintActionButton(Graphics g,
int dx,
int dy,
int status,
boolean isOver,
JButton button,
Image image)
|
protected void |
paintCloseIcon(Graphics g,
int dx,
int dy,
boolean isOver)
|
protected void |
paintContentBorder(Graphics g,
int tabPlacement,
int selectedIndex)
We don't want to have a content border. |
protected void |
paintMaxIcon(Graphics g,
int dx,
int dy,
boolean isOver)
|
protected void |
paintTab(Graphics g,
int tabPlacement,
Rectangle[] rects,
int tabIndex,
Rectangle iconRect,
Rectangle textRect)
|
(package private) boolean |
requestMyFocusForVisibleComponent()
|
void |
setCloseIcon(boolean b)
|
void |
setMaxIcon(boolean b)
|
protected void |
uninstallComponents()
Removes any installed subcomponents from the JTabbedPane. |
protected void |
uninstallKeyboardActions()
|
protected void |
uninstallListeners()
|
protected void |
updateCloseIcon(int x,
int y)
|
protected void |
updateMaxIcon(int x,
int y)
|
protected void |
updateOverTab(int x,
int y)
|
| Methods inherited from class javax.swing.plaf.basic.BasicTabbedPaneUI |
assureRectsCreated, calculateMaxTabHeight, calculateMaxTabWidth, calculateTabAreaHeight, calculateTabAreaWidth, createFocusListener, createPropertyChangeListener, createScrollButton, expandTabRunsArray, getBaseline, getBaseline, getBaselineOffset, getBaselineResizeBehavior, getContentBorderInsets, getFocusIndex, getFontMetrics, getIconForTab, getMaximumSize, getMinimumSize, getNextTabIndex, getNextTabIndexInRun, getNextTabRun, getPreviousTabIndex, getPreviousTabIndexInRun, getPreviousTabRun, getRolloverTab, getRunForTab, getSelectedTabPadInsets, getTabAreaInsets, getTabBounds, getTabInsets, getTabLabelShiftX, getTabLabelShiftY, getTabRunCount, getTabRunIndent, getTabRunOffset, getTabRunOverlay, getTextViewForTab, getVisibleComponent, installDefaults, installUI, lastTabInRun, navigateSelectedTab, paintContentBorderBottomEdge, paintContentBorderLeftEdge, paintContentBorderRightEdge, paintContentBorderTopEdge, paintFocusIndicator, paintIcon, paintTabArea, paintTabBackground, paintTabBorder, paintText, rotateInsets, selectAdjacentRunTab, selectNextTab, selectNextTabInRun, selectPreviousTab, selectPreviousTabInRun, setRolloverTab, setVisibleComponent, shouldPadTabRun, shouldRotateTabRuns, tabForCoordinate, uninstallDefaults, uninstallUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tabScroller
protected net.java.sip.communicator.util.swing.plaf.SIPCommTabbedPaneUI.ScrollableTabSupport tabScroller
motionListener
protected net.java.sip.communicator.util.swing.plaf.SIPCommTabbedPaneUI.MyMouseMotionListener motionListener
BUTTONSIZE
public static final int BUTTONSIZE
- See Also:
- Constant Field Values
WIDTHDELTA
public static final int WIDTHDELTA
- See Also:
- Constant Field Values
actionPopupMenu
protected JPopupMenu actionPopupMenu
maxItem
protected JMenuItem maxItem
closeItem
protected JMenuItem closeItem
SIPCommTabbedPaneUI
public SIPCommTabbedPaneUI()
isOneActionButtonEnabled
protected boolean isOneActionButtonEnabled()
isCloseEnabled
public boolean isCloseEnabled()
isMaxEnabled
public boolean isMaxEnabled()
setCloseIcon
public void setCloseIcon(boolean b)
setMaxIcon
public void setMaxIcon(boolean b)
calculateTabWidth
protected int calculateTabWidth(int tabPlacement,
int tabIndex,
FontMetrics metrics)
- Overrides:
calculateTabWidth in class BasicTabbedPaneUI
calculateTabHeight
protected int calculateTabHeight(int tabPlacement,
int tabIndex,
int fontHeight)
- Overrides:
calculateTabHeight in class BasicTabbedPaneUI
layoutLabel
protected void layoutLabel(int tabPlacement,
FontMetrics metrics,
int tabIndex,
String title,
Icon icon,
Rectangle tabRect,
Rectangle iconRect,
Rectangle textRect,
boolean isSelected)
- Overrides:
layoutLabel in class BasicTabbedPaneUI
createMouseListener
protected MouseListener createMouseListener()
- Overrides:
createMouseListener in class BasicTabbedPaneUI
createScrollableTabButton
protected SIPCommTabbedPaneUI.ScrollableTabButton createScrollableTabButton(int direction)
newCloseRect
protected Rectangle newCloseRect(Rectangle rect)
newMaxRect
protected Rectangle newMaxRect(Rectangle rect)
updateOverTab
protected void updateOverTab(int x,
int y)
updateCloseIcon
protected void updateCloseIcon(int x,
int y)
updateMaxIcon
protected void updateMaxIcon(int x,
int y)
createUI
public static ComponentUI createUI(JComponent c)
createLayoutManager
protected LayoutManager createLayoutManager()
- Invoked by
installUI to create a layout manager object to
manage the JTabbedPane.
- Overrides:
createLayoutManager in class BasicTabbedPaneUI
- Returns:
- a layout manager object
- See Also:
JTabbedPane.getTabLayoutPolicy()
installComponents
protected void installComponents()
- Creates and installs any required subcomponents for the JTabbedPane.
Invoked by installUI.
- Overrides:
installComponents in class BasicTabbedPaneUI
- Since:
- 1.4
uninstallComponents
protected void uninstallComponents()
- Removes any installed subcomponents from the JTabbedPane. Invoked by
uninstallUI.
- Overrides:
uninstallComponents in class BasicTabbedPaneUI
- Since:
- 1.4
installListeners
protected void installListeners()
- Overrides:
installListeners in class BasicTabbedPaneUI
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners in class BasicTabbedPaneUI
createChangeListener
protected ChangeListener createChangeListener()
- Overrides:
createChangeListener in class BasicTabbedPaneUI
installKeyboardActions
protected void installKeyboardActions()
- Overrides:
installKeyboardActions in class BasicTabbedPaneUI
getMyInputMap
InputMap getMyInputMap(int condition)
createMyActionMap
ActionMap createMyActionMap()
uninstallKeyboardActions
protected void uninstallKeyboardActions()
- Overrides:
uninstallKeyboardActions in class BasicTabbedPaneUI
paint
public void paint(Graphics g,
JComponent c)
- Overrides:
paint in class BasicTabbedPaneUI
paintTab
protected void paintTab(Graphics g,
int tabPlacement,
Rectangle[] rects,
int tabIndex,
Rectangle iconRect,
Rectangle textRect)
- Overrides:
paintTab in class BasicTabbedPaneUI
paintCloseIcon
protected void paintCloseIcon(Graphics g,
int dx,
int dy,
boolean isOver)
paintMaxIcon
protected void paintMaxIcon(Graphics g,
int dx,
int dy,
boolean isOver)
paintActionButton
protected void paintActionButton(Graphics g,
int dx,
int dy,
int status,
boolean isOver,
JButton button,
Image image)
getTabBounds
protected Rectangle getTabBounds(int tabIndex,
Rectangle dest)
- Returns the bounds of the specified tab in the coordinate space of the
JTabbedPane component. This is required because the tab rects are by
default defined in the coordinate space of the component where they are
rendered, which could be the JTabbedPane (for WRAP_TAB_LAYOUT) or a
ScrollableTabPanel (SCROLL_TAB_LAYOUT). This method should be used
whenever the tab rectangle must be relative to the JTabbedPane itself and
the result should be placed in a designated Rectangle object (rather than
instantiating and returning a new Rectangle each time). The tab index
parameter must be a valid tabbed pane tab index (0 to tab count - 1,
inclusive). The destination rectangle parameter must be a valid
Rectangle instance. The handling of invalid parameters is
unspecified.
- Overrides:
getTabBounds in class BasicTabbedPaneUI
- Parameters:
tabIndex - the index of the tabdest - the rectangle where the result should be placed
- Returns:
- the resulting rectangle
- Since:
- 1.4
getOverTabIndex
public int getOverTabIndex()
requestMyFocusForVisibleComponent
boolean requestMyFocusForVisibleComponent()
paintContentBorder
protected void paintContentBorder(Graphics g,
int tabPlacement,
int selectedIndex)
- We don't want to have a content border.
- Overrides:
paintContentBorder in class BasicTabbedPaneUI
loadSkin
public void loadSkin()
- Reloads close icon.
- Specified by:
loadSkin in interface Skinnable
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.