|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StackDockComponent
A StackDockComponent
is a Component
that can show other Components
.
StackDockComponent
s are used by StackDockStation
s to display their children.
The component has one child which is "selected" (assuming there is at
least one child). This one child should be visible, the other children
should be hidden. The user must have an interface to change the
selection at any time.
A StackDockComponent
should respect the side
at which the tabs are to be placed.
StackDockStation
,
DefaultStackDockComponent
,
JTabbedPane
Method Summary | |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener listener)
Adds a ChangeListener to this component. |
void |
addTab(java.lang.String title,
javax.swing.Icon icon,
java.awt.Component comp,
Dockable dockable)
Adds a new child at an unspecified location. |
DockElementRepresentative |
createDefaultRepresentation(DockElement target)
Creates and returns a new DockElementRepresentative representing target ,
the new representation is to be used to cover all the empty areas on this StackDockComponent . |
java.awt.Rectangle |
getBoundsAt(int index)
Gets the location and size of the graphical element that allows the user to select the index 'th child. |
java.awt.Component |
getComponent()
Gets a Component on which the children of this
StackDockComponent will be displayed. |
Dockable |
getDockableAt(int index)
Gets the Dockable which was placed at the index 'th position. |
int |
getSelectedIndex()
Gets the index of the currently selected dockable |
int |
getTabCount()
Gets the number of children that are added to this StackDockComponent. |
boolean |
hasBorder()
Whether this kind of component already has a border. |
void |
insertTab(java.lang.String title,
javax.swing.Icon icon,
java.awt.Component comp,
Dockable dockable,
int index)
Adds a new child at the location index . |
boolean |
isSingleTabComponent()
Tells whether this StackDockComponent should be shown even if
the StackDockStation has only one child. |
void |
moveTab(int source,
int destination)
Moves the tab at source to location destination . |
void |
remove(int index)
Removes the child at location index . |
void |
removeAll()
Removes all children from this component |
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
Removes a ChangeListener which was added earlier. |
void |
setComponentAt(int index,
java.awt.Component component)
Sets the component which should be shown at tab index . |
void |
setController(DockController controller)
Sets the controller for which this component manages its children. |
void |
setIconAt(int index,
javax.swing.Icon newIcon)
Sets the icon of the child at location index . |
void |
setSelectedIndex(int index)
Selects the component at location index . |
void |
setTabPlacement(TabPlacement tabSide)
Sets at which side tabs should be displayed. |
void |
setTitleAt(int index,
java.lang.String newTitle)
Sets the title of the child at location index . |
void |
setTooltipAt(int index,
java.lang.String newTooltip)
Sets the tooltip of the child at location index . |
Method Detail |
---|
void addChangeListener(javax.swing.event.ChangeListener listener)
ChangeListener
to this component. The listener will be
called when the selected component changes.
listener
- the new listenervoid removeChangeListener(javax.swing.event.ChangeListener listener)
ChangeListener
which was added earlier.
listener
- the listener to removeint getSelectedIndex()
void setSelectedIndex(int index)
index
.
index
- the index of the selected componentjava.awt.Rectangle getBoundsAt(int index)
index
'th child.
index
- the index of the child
null
if the element is not directly visiblevoid addTab(java.lang.String title, javax.swing.Icon icon, java.awt.Component comp, Dockable dockable)
title
- the title of the childicon
- an icon to display for the child or null
comp
- the new child to displaydockable
- the Dockable for which the tab is usedvoid moveTab(int source, int destination)
source
to location destination
.
source
- the item to movedestination
- the target destinationvoid insertTab(java.lang.String title, javax.swing.Icon icon, java.awt.Component comp, Dockable dockable, int index)
index
.
title
- the title of the childicon
- an icon to display for the child or null
comp
- the new child to displaydockable
- the Dockable for which the tab is usedindex
- the index that the new child should haveint getTabCount()
Dockable getDockableAt(int index)
Dockable
which was placed at the index
'th position.
index
- the position of the element
void removeAll()
void remove(int index)
index
.
index
- the index of the childvoid setTitleAt(int index, java.lang.String newTitle)
index
.
index
- the index of the childnewTitle
- the new titlevoid setTooltipAt(int index, java.lang.String newTooltip)
index
.
index
- the index of the childnewTooltip
- the new tooltip, can be null
void setIconAt(int index, javax.swing.Icon newIcon)
index
.
index
- the index of the childnewIcon
- the new icon, null
if no icon
should be displayedvoid setComponentAt(int index, java.awt.Component component)
index
.
index
- the index where to show component
component
- the new content, not null
void setTabPlacement(TabPlacement tabSide)
tabSide
- the side, not null
java.awt.Component getComponent()
Component
on which the children of this
StackDockComponent
will be displayed.
Component
void setController(DockController controller)
controller
- the controller or null
boolean hasBorder()
true
if this has a border, false
if the parent should paint one.boolean isSingleTabComponent()
StackDockComponent
should be shown even if
the StackDockStation
has only one child.
true
if this component should always be shownDockElementRepresentative createDefaultRepresentation(DockElement target)
DockElementRepresentative
representing target
,
the new representation is to be used to cover all the empty areas on this StackDockComponent
.
target
- the target for the new representative, may or may not be a child of this component, not null
null
if this StackDockComponent
does not allow to
use its free spaces
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |