|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.dockable.AbstractDockable bibliothek.gui.dock.station.AbstractDockableStation
public abstract class AbstractDockableStation
An abstract combination between DockStation
and Dockable
. This
station has no functionality except the ability to store and call
DockStationListeners
.
Field Summary | |
---|---|
protected DockStationListenerManager |
listeners
The list of DockStationListeners which
can be used to send events to all listeners. |
Constructor Summary | |
---|---|
AbstractDockableStation()
Constructs a new station, but does nothing more |
|
AbstractDockableStation(DockTheme theme)
Constructs a new station and sets the theme. |
Method Summary | |
---|---|
boolean |
accept(Dockable child)
Tells whether this station accepts child as a new child,
or refuses child . |
protected boolean |
acceptable(Dockable child)
Tells whether this station accepts child as new child. |
void |
addDockStationListener(DockStationListener listener)
Adds a listener to this station. |
DockStation |
asDockStation()
Returns this if this is an instance of
DockStation . |
protected abstract void |
callDockUiUpdateTheme()
Calls the method DockUI . |
boolean |
canCompare(DockStation station)
Tells whether this station knows a rule how to compare itself with station . |
void |
changed(Dockable dockable,
DockTitle title,
boolean active)
Called by the DockController of this station to indicate that
the active-state of title has been changed. |
int |
compare(DockStation station)
Compares this station with station . |
DockActionSource |
getDirectActionOffers(Dockable dockable)
Gets a list of actions which should be available for the user and affect the child dockable . |
DockActionSource |
getIndirectActionOffers(Dockable dockable)
Gets a list of actions which should be available for the user and affect dockable . |
Rectangle |
getStationBounds()
Gets a rectangle in which all points of the station are. |
DockTheme |
getTheme()
Gets the current theme of this station. |
boolean |
isStationVisible()
Tells whether this station is visible or not. |
boolean |
isVisible(Dockable dockable)
Tells whether the child dockable is visible or not. |
void |
removeDockStationListener(DockStationListener listener)
Removes a listener from this station. |
void |
requestChildDockTitle(DockTitleRequest request)
Provides a DockTitle for a child of this station. |
void |
requestDockTitle(DockTitleRequest request)
The default behavior of this method is todo nothing. |
void |
updateTheme()
Updates the DockTheme of this station. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.DockStation |
---|
canDrag, canReplace, drag, draw, drop, drop, drop, forget, getController, getDockable, getDockableCount, getDockableProperty, getFrontDockable, getPlaceholders, isInOverrideZone, move, move, prepareDrop, prepareMove, replace, replace, setController, setFrontDockable, setPlaceholders |
Methods inherited from interface bibliothek.gui.dock.DockElement |
---|
asDockable, getFactoryID |
Methods inherited from interface bibliothek.gui.Dockable |
---|
getComponent |
Field Detail |
---|
protected DockStationListenerManager listeners
DockStationListeners
which
can be used to send events to all listeners.
Constructor Detail |
---|
public AbstractDockableStation()
public AbstractDockableStation(DockTheme theme)
theme
- the theme, may be null
Method Detail |
---|
public DockStation asDockStation()
DockElement
this
if this
is an instance of
DockStation
. Otherwise null
is returned.
asDockStation
in interface DockElement
this
or null
public DockTheme getTheme()
DockStation
null
,
but that means that the station is not fully initialized, and might not
work correct.
getTheme
in interface DockStation
null
.public void updateTheme()
DockStation
DockTheme
of this station. The new theme
has to be read from the controller
of
this station. If the controller is null
, this method
should return immediately.DockUI.updateTheme(DockStation, DockFactory)
to implement this method.
updateTheme
in interface DockStation
protected abstract void callDockUiUpdateTheme() throws IOException
DockUI
.DockUI.updateTheme(DockStation, DockFactory)
with this
as the first argument, and an appropriate factory
as the second argument.
IOException
- if the DockUI throws an exceptionpublic void requestDockTitle(DockTitleRequest request)
AbstractDockable
requestDockTitle
in interface Dockable
requestDockTitle
in class AbstractDockable
request
- which title is required. If this Dockable does not have
a special rule for the given request it just ignores the callpublic DockActionSource getDirectActionOffers(Dockable dockable)
DockStation
dockable
.
getDirectActionOffers
in interface DockStation
dockable
- a child of this station
dockable
, can be null
public DockActionSource getIndirectActionOffers(Dockable dockable)
DockStation
dockable
. The argument dockable
can be a child of this station, or a child of any station which is
below this station.
getIndirectActionOffers
in interface DockStation
dockable
- a child of this station or a child of another station
which is below this station
dockable
or null
public void addDockStationListener(DockStationListener listener)
DockStation
addDockStationListener
in interface DockStation
listener
- the listener to addpublic void removeDockStationListener(DockStationListener listener)
DockStation
removeDockStationListener
in interface DockStation
listener
- the listener to removepublic boolean isVisible(Dockable dockable)
DockStation
dockable
is visible or not. Visible
means that the component
of dockable
can be seen by the user. The result must be false
if
this station is not visible.
isVisible
in interface DockStation
dockable
- the child whose visibility-state is questioned
dockable
is visible or notDockStation.isStationVisible()
public boolean isStationVisible()
DockStation
JFrame
is not visible if the frame is minimized.
isStationVisible
in interface DockStation
public boolean accept(Dockable child)
DockStation
child
as a new child,
or refuses child
. The user will not be able to drop
a Dockable
onto this station if this method returns
false
.
accept
in interface DockStation
child
- a Dockable
which may become a child
true
if child
is acceptedprotected boolean acceptable(Dockable child)
child
as new child.
child
- the child to add
true
if acceptablepublic boolean canCompare(DockStation station)
DockStation
station
. See DockStation.compare(DockStation)
for more
details.
canCompare
in interface DockStation
station
- another station
true
if a call to compare
will not end in an exception and return another value than 0public int compare(DockStation station)
DockStation
station
. The comparison is needed
if the stations bounds
of the two station
have common points. On a drag-event, the controller needs a way to
decide which station is more important (and receives the opportunity
to get a new child first). The controller will use the method
compare
to do this. This method works like
Comparable.compareTo(Object)
.
compare
in interface DockStation
station
- another station
station
.public void changed(Dockable dockable, DockTitle title, boolean active)
DockStation
DockController
of this station to indicate that
the active-state of title
has been changed. This station
should call the method title.changed
with an appropriate event. The station may add some additional information
to this call.
changed
in interface DockStation
dockable
- the child whose title is changedtitle
- the changed title, may not be boundactive
- the new state of the titlepublic void requestChildDockTitle(DockTitleRequest request)
DockStation
DockTitle
for a child of this station. This method
must call DockTitleRequest.answer(DockTitle)
to set the result.DockStation
s won't have the need to implement this method,
leaving it empty will advice the framework to use another source for
new DockTitle
s.
requestChildDockTitle
in interface DockStation
request
- the request to answer, not null
public Rectangle getStationBounds()
DockStation
Dockable
into this area onto this station.
getStationBounds
in interface DockStation
null
to indicate that
this station has not any bounds
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |