com.vlsolutions.swing.tabbedpane
public class JTabbedPaneSmartIcon extends Object implements Icon, Cloneable
As JTabbedPanes cannot use any JComponents as tab selectors (the access if protected and we just have a label, an icon and a tooltip), we have to rely on tricks to bypass them.
UNKNOWN: 2005/11/01 Lilian Chamontin : fixed NPE when otherIcons == null (tabs without smart icons) 2005/11/08 Lilian Chamontin : fixed bug related to event management when multiple other-icons are used (big thanks to Emmanuel GAUVRIT). 2005/11/21 Lilian Chamontin : enhanced width calculation of the icon size.
Constructor Summary | |
---|---|
JTabbedPaneSmartIcon(Icon icon, String label, SmartIconJButton[] otherIcons) Constructs a new smart icon with a given set of additional buttons |
Method Summary | |
---|---|
Object | clone() |
JTabbedPaneSmartIcon | copy() Creates a shalow copy of this icon |
Icon | getIcon() Return the tab icon |
int | getIconHeight() Returns the height of this icon |
int | getIconWidth() Returns the width of this icon |
String | getLabel() Return the tab label |
String | getLocalTooltipText() Return the local tooltip of this icon (the one associated with inner mouse movements) |
SmartIconJButton | getSmartButton(int index) |
String | getTooltipText() Return the tooltip of this icon |
boolean | onMouseExited(MouseEvent e) Process the mouse exited event.
|
boolean | onMouseMoved(MouseEvent e) Process the mouse moved event.
|
boolean | onMousePressed(MouseEvent e) Process the mouse pressed event.
|
boolean | onMouseReleased(MouseEvent e) Process the mouse released event.
|
void | paintIcon(Component c, Graphics g, int x, int y) paints the icon (and the associated label and sub-icons) |
void | setIcon(Icon icon) Update the main icon (left) to be displayed on the tab |
void | setIconForTabbedPane(JTabbedPane container) Specify which container will use this icon.
|
void | setLabel(String label) Update the label to be displayed on the tab |
void | setSmartButton(int index, SmartIconJButton btn) |
void | setTooltipText(String tooltip) Update the tooltip of this icon |
Mouse coordinates are given relative to this icon
Mouse coordinates are given relative to this icon
Mouse coordinates are given relative to this icon
Mouse coordinates are given relative to this icon
If the icon is shared between containers, please provide at least one as this allows the icon to properly estimate its dimension.