|
||||||||||
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 |
addStackDockComponentListener(StackDockComponentListener listener)
Adds a listener to this component, it will be called if the selection changes. |
void |
addTab(String title,
Icon icon,
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 . |
Rectangle |
getBoundsAt(int index)
Gets the location and size of the graphical element that allows the user to select the index 'th child. |
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. |
TabPlacement |
getDockTabPlacement()
Tells at which side tabs should be displayer. |
int |
getSelectedIndex()
Gets the index of the currently selected dockable |
DockElementRepresentative |
getTabAt(int index)
Gets an element representing the tab of the Dockable at index . |
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(String title,
Icon icon,
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 |
removeStackDockComponentListener(StackDockComponentListener listener)
Removes listener from this component. |
void |
setComponentAt(int index,
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 |
setDockTabPlacement(TabPlacement tabSide)
Sets at which side tabs should be displayed. |
void |
setIconAt(int index,
Icon newIcon)
Sets the icon of the child at location index . |
void |
setSelectedIndex(int index)
Selects the component at location index . |
void |
setTitleAt(int index,
String newTitle)
Sets the title of the child at location index . |
void |
setTooltipAt(int index,
String newTooltip)
Sets the tooltip of the child at location index . |
Method Detail |
---|
void addStackDockComponentListener(StackDockComponentListener listener)
listener
- the new listener, not null
void removeStackDockComponentListener(StackDockComponentListener listener)
listener
from this component.
listener
- the listener to removeint getSelectedIndex()
void setSelectedIndex(int index)
index
.
index
- the index of the selected componentRectangle getBoundsAt(int index)
index
'th child.
index
- the index of the child
null
if the element is not directly visiblevoid addTab(String title, Icon icon, 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(String title, Icon icon, 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
DockElementRepresentative getTabAt(int index)
Dockable
at index
.
index
- the index of some child of this stack
null
if no tab exists or tabs cannot be used as DockElementRepresentative
svoid removeAll()
void remove(int index)
index
.
index
- the index of the childvoid setTitleAt(int index, String newTitle)
index
.
index
- the index of the childnewTitle
- the new titlevoid setTooltipAt(int index, String newTooltip)
index
.
index
- the index of the childnewTooltip
- the new tooltip, can be null
void setIconAt(int index, Icon newIcon)
index
.
index
- the index of the childnewIcon
- the new icon, null
if no icon
should be displayedvoid setComponentAt(int index, Component component)
index
.
index
- the index where to show component
component
- the new content, not null
void setDockTabPlacement(TabPlacement tabSide)
tabSide
- the side, not null
TabPlacement getDockTabPlacement()
null
setDockTabPlacement(TabPlacement)
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 |