|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.javadocking.dockable.DefaultCompositeDockable
public class DefaultCompositeDockable
The default composite dockable implementation that keeps its dockables in an array.
Its content component, title, icon and actions are null.
| Constructor Summary | |
|---|---|
DefaultCompositeDockable(Dockable[] dockablesArray)
Constructs a composite dockable with the given array of dockables. |
|
DefaultCompositeDockable(Dockable[] dockablesArray,
int selectedIndex)
Constructs a composite dockable with the given array of dockables. |
|
| Method Summary | |
|---|---|
void |
addDockingListener(DockingListener listener)
Adds a listener for docking events of this dockable. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a java.beans.PropertyChangeListener. |
boolean |
equals(java.lang.Object object)
Returns true if the given object is a Dockable with the same ID
as this dockable. |
void |
fireDockingChanged(DockableEvent dockableEvent)
Notifies all listeners that have registered interest for notification on this event type. |
void |
fireDockingWillChange(DockableEvent dockableEvent)
Notifies all listeners that have registered interest for notification on this event type. |
javax.swing.Action[][] |
getActions()
Always returns null. |
java.awt.Component |
getContent()
Always returns null. |
java.lang.String |
getDescription()
Always returns null. |
LeafDock |
getDock()
Gets the dock in which the dockable is docked. |
Dockable |
getDockable(int index)
Gets the child dockable with the specified index. |
int |
getDockableCount()
Gets the number of child dockables of this composite dockable. |
int |
getDockingModes()
Calculates the docking modes with the values of the child dockables by using a bitwise and-operation. |
javax.swing.Icon |
getIcon()
Always returns null. |
java.lang.String |
getID()
Generates an ID with the IDs of the child dockables (separated by a space). |
int |
getLastDockingMode()
The default value is taken from the first child dockable. |
int |
getPossibleStates()
Gets the possible states of the dockable. |
Dockable |
getSelectedDockable()
Gets the selected dockable. |
int |
getSelectedIndex()
Gets the index of the selected dockable. |
int |
getState()
Gets the state of the dockable. |
java.lang.String |
getTitle()
Always returns null. |
java.lang.Object |
getVisualizer()
Gets the object that currently shows the content of the dockable. |
int |
hashCode()
|
boolean |
isWithHeader()
Always returns true. |
void |
removeDockingListener(DockingListener listener)
Removes a listener for docking events of this dockable. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a java.beans.PropertyChangeListener. |
void |
setDock(LeafDock dock)
Sets the dock in which the dockable is docked. |
void |
setLastDockingMode(int lastDockingMode)
Sets the mode how the dockable is docked in its current dock or how it was docked the last time it was in a dock. |
void |
setPossibleStates(int possibleStates)
Sets the possible states of the dockable. |
void |
setSelectedIndex(int selectedIndex)
Sets the index of the selected dockable. |
void |
setState(int state,
java.lang.Object visualizer)
Tries to set the new state of the dockable. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultCompositeDockable(Dockable[] dockablesArray)
Constructs a composite dockable with the given array of dockables.
No dockable will be selected.
dockablesArray - The array of dockables for the composite dockable.
public DefaultCompositeDockable(Dockable[] dockablesArray,
int selectedIndex)
Constructs a composite dockable with the given array of dockables.
The dockable with the given index will be selected.
dockablesArray - The array of dockables for the composite dockable.selectedIndex - The index of the selected dockable in the given array.| Method Detail |
|---|
public Dockable getDockable(int index)
throws java.lang.IndexOutOfBoundsException
CompositeDockable
getDockable in interface CompositeDockablejava.lang.IndexOutOfBoundsException - If the index is out of range (index < 0 || index >= getDockableCount()).public int getDockableCount()
CompositeDockable
getDockableCount in interface CompositeDockablepublic Dockable getSelectedDockable()
CompositeDockable
getSelectedDockable in interface CompositeDockablepublic java.lang.String getID()
Generates an ID with the IDs of the child dockables (separated by a space).
getID in interface Dockablepublic java.awt.Component getContent()
getContent in interface Dockablepublic void setDock(LeafDock dock)
Dockable
setDock in interface Dockabledock - The dock in which the dockable is docked.
This can be null, if the dockable is not docked.public LeafDock getDock()
Dockable
getDock in interface Dockablepublic java.lang.String getTitle()
getTitle in interface Dockablepublic java.lang.String getDescription()
getDescription in interface Dockablepublic javax.swing.Icon getIcon()
getIcon in interface Dockablepublic int getDockingModes()
Calculates the docking modes with the values of the child dockables by using a bitwise and-operation.
When there are no child dockables, DockingMode.ALL is returned.
getDockingModes in interface DockableDockingMode.public void setLastDockingMode(int lastDockingMode)
Dockable
setLastDockingMode in interface DockablelastDockingMode - The mode how the dockable is docked in its current dock or how it was docked the last time it was
in a dock. This integer should be a constant defined by DockingMode.public int getLastDockingMode()
The default value is taken from the first child dockable. Typically, the last docking modes of all the child dockables are the same.
getLastDockingMode in interface DockableDockingMode.public boolean isWithHeader()
isWithHeader in interface Dockablepublic javax.swing.Action[][] getActions()
getActions in interface Dockablepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Dockabledock property.
addPropertyChangeListener in interface Dockablelistener - The property change listener to be added.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Dockable
removePropertyChangeListener in interface Dockablelistener - The property change listener to be removedpublic void addDockingListener(DockingListener listener)
Dockable
addDockingListener in interface Dockablelistener - A docking listener that will be notified, when this dockable is added, moved, or removed.public void removeDockingListener(DockingListener listener)
Dockable
removeDockingListener in interface Dockablelistener - A docking listener to remove.public void fireDockingWillChange(DockableEvent dockableEvent)
Dockable
fireDockingWillChange in interface DockabledockableEvent - Gives more information about the origin dock, the destination dock,
and the object whose docking state changed.public void fireDockingChanged(DockableEvent dockableEvent)
Dockable
fireDockingChanged in interface DockabledockableEvent - Gives more information about the origin dock, the destination dock,
and the object whose docking state changed.
public void setState(int state,
java.lang.Object visualizer)
Tries to set the new state of the dockable.
When the given state is DockableState.CLOSED, the dock of this dockable will be set to null.
When the given state is DockableState.NORMAL, the visualizer should be the LeafDock where the
dockable is docked in. The dock of this dockable will be set.
For other states the visualizer can have another type, but these types are not obligatory. The visualizer can even be null.
setState in interface Dockablestate - The new state of the dockable. This should be a constant defined by DockableState.visualizer - The object that currently shows the content of the dockable.
Can be null, i.e. when the state of the dockable is DockableState.CLOSED.public java.lang.Object getVisualizer()
DockableDockableState.CLOSED.
getVisualizer in interface Dockablepublic int getState()
Dockable
getState in interface DockableDockableState.public int getPossibleStates()
Gets the possible states of the dockable. This can be a combination of constants defined by DockableState.
A combination is made by the bitwise or-operation on the integer constants.
The default states are DockableState.CLOSED | DockableState.NORMAL | DockableState.MAXIMIZED | DockableState.MINIMIZED.
getPossibleStates in interface Dockablepublic void setPossibleStates(int possibleStates)
possibleStates - The possible states of the dockable.getPossibleStates()public int getSelectedIndex()
public void setSelectedIndex(int selectedIndex)
throws java.lang.IndexOutOfBoundsException
selectedIndex - The index of the selected dockable.
java.lang.IndexOutOfBoundsException - If the index is out of range (index < 0 || index >= getDockableCount()).public boolean equals(java.lang.Object object)
Dockable with the same ID
as this dockable.
equals in class java.lang.Objectobject -
Dockable with the same ID
as this dockable, false otherwise.public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||