|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.infonode.tabbedpanel.Tab
net.infonode.tabbedpanel.titledtab.TitledTab
A TitledTab is a tab that has support for text, icon and a custom Swing component (called title component). Titled tab supports several properties that makes it possible to change the look (borders, colors, insets), layout (up, down, left, right).
Titled tab has a line based layout, i.e. the text, icon and title component are laid out in a line. The layout of the tab can be rotated, i.e. the text and the icon will be rotated 90, 180 or 270 degrees. The title component will not be rotated but moved so that the line layout will persist.
A titled tab has 3 rendering states:
Note: If only the normal state properties have been configured, the
highlighted and disabled state will automatically use the same properties as for the normal
state, see TitledTabProperties
and TitledTabStateProperties
.
TitledTab implements the IconProvider
interface and
overloads toString() so that both text and icon for the normal state is shown in the
tab drop down list in a tabbed panel.
TitledTab supports mouse hovering. A HoverListener
can be set in the
TitledTabProperties
. The hover listener receives a HoverEvent
when the mouse
enters or exits the tab. The hover event's source will be the affected titled tab.
TitledTabProperties
,
TitledTabStateProperties
,
Serialized FormNested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Field Summary |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TitledTab(String text,
Icon icon,
JComponent contentComponent,
JComponent titleComponent)
Constructs a TitledTab with a text, icon, content component and title component. |
Method Summary | |
void |
addMouseListener(MouseListener l)
Adds a MouseListener to receive mouse events from this TitledTab. |
void |
addMouseMotionListener(MouseMotionListener l)
Adds a MouseMotionListener to receive mouse events from this TitledTab. |
boolean |
contains(int x,
int y)
|
JComponent |
getDisabledStateTitleComponent()
Gets the title component for the disabled state |
JComponent |
getHighlightedStateTitleComponent()
Gets the title component for the highlighted state |
Icon |
getIcon()
Gets the icon for the normal state |
MouseListener[] |
getMouseListeners()
Gets the mouse listeners |
MouseMotionListener[] |
getMouseMotionListeners()
Gets the mouse motion listeners |
JComponent |
getNormalStateTitleComponent()
Gets the title component for the normal state |
TitledTabProperties |
getProperties()
Gets the TitledTabProperties |
Shape |
getShape()
Gets the Shape for the current active rendering state. |
String |
getText()
Gets the text for the normal state |
boolean |
inside(int x,
int y)
|
void |
removeMouseListener(MouseListener l)
Removes a MouseListener |
void |
removeMouseMotionListener(MouseMotionListener l)
Removes a MouseMotionListener |
void |
setDisabledStateTitleComponent(JComponent titleComponent)
Sets the disabled state title component |
void |
setEnabled(boolean enabled)
Sets if this TitledTab should be enabled or disabled Note: since ITP 1.5.0 this method will change the enabled property in the TitledTabProperties for this tab. |
void |
setHighlighted(boolean highlighted)
Sets if this TitledTab should be highlighted or not. |
void |
setHighlightedStateTitleComponent(JComponent titleComponent)
Sets the highlighted state title component |
void |
setIcon(Icon icon)
Sets the icon for the normal state |
void |
setNormalStateTitleComponent(JComponent titleComponent)
Sets the normal state title component |
void |
setOpaque(boolean opaque)
|
void |
setText(String text)
Sets the text for the normal state |
void |
setTitleComponent(JComponent titleComponent)
Sets the title component. |
void |
setUI(PanelUI ui)
|
String |
toString()
Gets the text for the normal state. |
void |
updateUI()
|
Methods inherited from class net.infonode.tabbedpanel.Tab |
addNotify, addTabListener, getContentComponent, getEventComponents, getFocusableComponent, getIndex, getTabbedPanel, isHighlighted, isSelected, removeNotify, removeTabListener, setEventComponent, setEventComponents, setFocusableComponent, setSelected |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TitledTab(String text, Icon icon, JComponent contentComponent, JComponent titleComponent)
text
- text or null for no text. The text will be applied to the
normal state propertiesicon
- icon or null for no icon. The icon will be applied to the
normal state propertiescontentComponent
- content component or null for no content componenttitleComponent
- title component or null for no title component. The title
component will be applied to all the statesTabFactory
Method Detail |
public boolean contains(int x, int y)
public boolean inside(int x, int y)
public JComponent getNormalStateTitleComponent()
public JComponent getHighlightedStateTitleComponent()
public JComponent getDisabledStateTitleComponent()
public void setTitleComponent(JComponent titleComponent)
Sets the title component.
This method is a convenience method for setting the same title component for all states.
titleComponent
- the title component or null for no title componentpublic void setNormalStateTitleComponent(JComponent titleComponent)
titleComponent
- the title component or null for no title componentpublic void setHighlightedStateTitleComponent(JComponent titleComponent)
titleComponent
- the title component or null for no title componentpublic void setDisabledStateTitleComponent(JComponent titleComponent)
titleComponent
- the title component or null for no title componentpublic void setHighlighted(boolean highlighted)
Sets if this TitledTab should be highlighted or not.
Note: This will only have effect if this TitledTab is enabled and a member of a tabbed panel.
setHighlighted
in class Tab
highlighted
- true for highlight, otherwise falsepublic void setEnabled(boolean enabled)
Sets if this TitledTab should be enabled or disabled
Note: since ITP 1.5.0 this method will change the enabled property
in the TitledTabProperties
for this tab. Enabled/disabled can be controlled by
modifying the property or this method.
setEnabled
in class Tab
enabled
- true for enabled, otherwise falsepublic String getText()
public void setText(String text)
text
- the text or null for no textpublic Icon getIcon()
getIcon
in interface IconProvider
public void setIcon(Icon icon)
icon
- the icon or null for no iconpublic TitledTabProperties getProperties()
public String toString()
getText()
public void addMouseListener(MouseListener l)
l
- the MouseListenerpublic void removeMouseListener(MouseListener l)
l
- the MouseListener to removepublic MouseListener[] getMouseListeners()
public void addMouseMotionListener(MouseMotionListener l)
l
- the MouseMotionListenerpublic void removeMouseMotionListener(MouseMotionListener l)
l
- the MouseMotionListener to removepublic MouseMotionListener[] getMouseMotionListeners()
public Shape getShape()
getShape
in class Tab
public void setUI(PanelUI ui)
public void updateUI()
public void setOpaque(boolean opaque)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |