|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.station.stack.CombinedStackDockComponent<C>
C
- the type of the tabspublic abstract class CombinedStackDockComponent<C extends CombinedTab>
A StackDockComponent
which is a combination of other components.
Field Summary | |
---|---|
private javax.swing.JPanel |
buttonPanel
A panel which displays the buttons of this FlatTab |
private java.util.List<C> |
buttons
A list of all buttons of this FlatTab |
private javax.swing.JPanel |
componentPanel
The panel which displays one of the children of this FlatTab |
private java.util.List<java.awt.Component> |
components
A list of all Components which are shown on this panel |
private DockController |
controller
The controller for which this component renders its content |
private java.util.List<javax.swing.event.ChangeListener> |
listeners
A list of listeners which have to informed when the selection changes |
private javax.swing.JPanel |
panel
The panel which shows the children |
private int |
selectedIndex
The index of the currently visible child |
Constructor Summary | |
---|---|
CombinedStackDockComponent()
Constructs a new FlatTab |
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. |
protected abstract C |
createTab(Dockable dockable)
Creates a new tab which will be shown on this component. |
protected abstract void |
destroy(C tab)
Deletes a tab that was earlier created by #createTab() . |
protected void |
fireStateChange()
Sends a ChangeEvent to all registered
ChangeListeners |
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. |
javax.swing.JComponent |
getComponent()
Gets a Component on which the children of this
StackDockComponent will be displayed. |
DockController |
getController()
Gets the controller for which this component renders its content. |
int |
getSelectedIndex()
Gets the index of the currently selected component |
C |
getTab(int index)
Gets the index'th tab of this component. |
int |
getTabCount()
Gets the number of children that are added to this StackDockComponent. |
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 . |
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 |
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 |
setTitleAt(int index,
java.lang.String newTitle)
Sets the title of the child at location index . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.swing.JPanel panel
private java.util.List<C extends CombinedTab> buttons
private DockController controller
private javax.swing.JPanel buttonPanel
private java.util.List<java.awt.Component> components
Components
which are shown on this panel
private javax.swing.JPanel componentPanel
private int selectedIndex
private java.util.List<javax.swing.event.ChangeListener> listeners
Constructor Detail |
---|
public CombinedStackDockComponent()
Method Detail |
---|
public void setController(DockController controller)
StackDockComponent
setController
in interface StackDockComponent
controller
- the controller or null
public DockController getController()
public C getTab(int index)
index
- the index of the tab
protected abstract C createTab(Dockable dockable)
dockable
- the Dockable for which the tab will be used
protected abstract void destroy(C tab)
#createTab()
.
tab
- the tab which is no longer neededpublic void addChangeListener(javax.swing.event.ChangeListener listener)
StackDockComponent
ChangeListener
to this component. The listener will be
called when the selected component changes.
addChangeListener
in interface StackDockComponent
listener
- the new listenerpublic void removeChangeListener(javax.swing.event.ChangeListener listener)
StackDockComponent
ChangeListener
which was added earlier.
removeChangeListener
in interface StackDockComponent
listener
- the listener to removeprotected void fireStateChange()
ChangeEvent
to all registered
ChangeListeners
public int getSelectedIndex()
StackDockComponent
getSelectedIndex
in interface StackDockComponent
public void setSelectedIndex(int index)
StackDockComponent
index
.
setSelectedIndex
in interface StackDockComponent
index
- the index of the selected componentpublic java.awt.Rectangle getBoundsAt(int index)
StackDockComponent
index
'th child.
getBoundsAt
in interface StackDockComponent
index
- the index of the child
public void addTab(java.lang.String title, javax.swing.Icon icon, java.awt.Component comp, Dockable dockable)
StackDockComponent
addTab
in interface StackDockComponent
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 usedpublic void insertTab(java.lang.String title, javax.swing.Icon icon, java.awt.Component comp, Dockable dockable, int index)
StackDockComponent
index
.
insertTab
in interface StackDockComponent
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 havepublic int getTabCount()
StackDockComponent
getTabCount
in interface StackDockComponent
public void removeAll()
StackDockComponent
removeAll
in interface StackDockComponent
public void remove(int index)
StackDockComponent
index
.
remove
in interface StackDockComponent
index
- the index of the childpublic void setTitleAt(int index, java.lang.String newTitle)
StackDockComponent
index
.
setTitleAt
in interface StackDockComponent
index
- the index of the childnewTitle
- the new titlepublic void setIconAt(int index, javax.swing.Icon newIcon)
StackDockComponent
index
.
setIconAt
in interface StackDockComponent
index
- the index of the childnewIcon
- the new icon, null
if no icon
should be displayedpublic javax.swing.JComponent getComponent()
StackDockComponent
Component
on which the children of this
StackDockComponent
will be displayed.
getComponent
in interface StackDockComponent
Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |