|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.station.AbstractDockStation
bibliothek.gui.dock.ScreenDockStation
public class ScreenDockStation
A DockStation which is the whole screen. Every child of this
station is a window. These windows can be moved and resized by the user.
This station tries to register a DockTitleVersion with
the key TITLE_ID.
| Field Summary | |
|---|---|
static PropertyKey<BoundaryRestriction> |
BOUNDARY_RESTRICTION
a key for a property telling which boundaries a ScreenDockWindow can have |
static PropertyKey<java.lang.Boolean> |
EXPAND_ON_DOUBLE_CLICK
global setting to change the effect happening on a double click |
static PropertyKey<ScreenDockFullscreenStrategy> |
FULL_SCREEN_STRATEGY
a key for a property telling how to handle fullscreen mode |
static java.lang.String |
TITLE_ID
The key for the DockTitleVersion of this station |
static PropertyKey<ScreenDockWindowFactory> |
WINDOW_FACTORY
a key for a property telling how to create new windows |
| Fields inherited from class bibliothek.gui.dock.station.AbstractDockStation |
|---|
listeners |
| Constructor Summary | |
|---|---|
ScreenDockStation(java.awt.Window owner)
Constructs a new ScreenDockStation. |
|
ScreenDockStation(WindowProvider owner)
Constructs a new ScreenDockStation. |
|
| Method Summary | ||
|---|---|---|
void |
addDockable(Dockable dockable,
java.awt.Rectangle bounds)
Adds a Dockable on a newly created ScreenDockWindow to
the station. |
|
void |
addDockable(Dockable dockable,
java.awt.Rectangle bounds,
boolean boundsIncludeWindow)
Adds a Dockable on a newly created ScreenDockWindow to
the station. |
|
protected void |
addDockable(Dockable dockable,
java.awt.Rectangle bounds,
Path placeholder,
boolean boundsIncludeWindow)
Adds a Dockable on a newly created ScreenDockWindow to
the station. |
|
void |
addScreenDockStationListener(ScreenDockStationListener listener)
Adds listener to this station. |
|
Dockable |
asDockable()
Returns this if this is an instance of
Dockable. |
|
DockStation |
asDockStation()
Returns this if this is an instance of
DockStation. |
|
protected void |
callDockUiUpdateTheme()
Calls the method DockUI. |
|
boolean |
canCompare(DockStation station)
Tells whether this station knows a rule how to compare itself with station. |
|
boolean |
canDrag(Dockable dockable)
Tells whether dockable can be removed from this station or not. |
|
boolean |
canReplace(Dockable old,
Dockable next)
Tells whether its possible to replace the child old
with next where next is not a child of this station. |
|
void |
checkWindowBoundaries()
Checks the boundaries of all windows of this station |
|
void |
clearExpandOnDoubleClick()
Resets the expand-on-double-click property to its default value. |
|
void |
combine(Dockable lower,
Dockable upper)
Combines the lower and the upper Dockable
to one Dockable, and replaces the lower with
this new Dockable. |
|
void |
combine(Dockable lower,
Dockable upper,
DockableProperty property)
Combines the lower and the upper Dockable
to one Dockable, and replaces the lower with
this new Dockable. |
|
int |
compare(DockStation station)
Compares this station with station. |
|
protected ListeningDockAction |
createFullscreenAction()
Creates an action which is added to all children
of this station. |
|
protected ScreenDockWindow |
createWindow()
Creates a new window which is associated with this station. |
|
protected void |
deregister(Dockable dockable,
ScreenDockWindow window)
Invoked when a ScreenDockWindow is no longer needed. |
|
void |
drag(Dockable dockable)
Removes a child from this station. |
|
void |
draw()
Informs this station that the information gathered by prepareDrop or
prepareMove should
be painted somehow onto this station. |
|
void |
drop()
Adds the Dockable of the last run of
prepareDrop to this station. |
|
void |
drop(Dockable dockable)
Adds dockable to this station. |
|
boolean |
drop(Dockable dockable,
Dockable location)
Drops dockable at the same coordinates as location, a
direct child of this station. |
|
boolean |
drop(Dockable dockable,
DockableProperty property)
Tries to add dockable to this station such that the location
given by property is matched. |
|
boolean |
drop(Dockable dockable,
ScreenDockProperty property)
Tries to add the dockable to this station, and uses
the property to determine its location. |
|
boolean |
drop(Dockable dockable,
ScreenDockProperty property,
boolean boundsIncludeWindow)
Tries to add the dockable to this station, and uses
the property to determine its location. |
|
void |
forget()
Tells this station that a possible drop or move on this station was canceled. |
|
BoundaryRestriction |
getBoundaryRestriction()
Gets the currently used BoundaryRestriction. |
|
StationCombinerValue |
getCombiner()
Gets the Combiner that is used to merge two Dockables
on this station. |
|
DefaultDockActionSource |
getDirectActionOffers(Dockable dockable)
Gets a list of actions which should be available for the user and affect the child dockable. |
|
DefaultDisplayerFactoryValue |
getDisplayerFactory()
Gets the DisplayerFactory that is used by this station
to create an underground for its children. |
|
DisplayerCollection |
getDisplayers()
Gets the current set of displayers used
on this station. |
|
Dockable |
getDockable(int index)
Gets the index'th child of this station. |
|
int |
getDockableCount()
Gets the number of children. |
|
DockableProperty |
getDockableProperty(Dockable dockable,
Dockable target)
Gets precise information about the location of a child of this station. |
|
double |
getDropOverRatio()
Tells the current overlapping two windows must have in order to be merged. |
|
java.lang.String |
getFactoryID()
Gets the unique name of the DockFactory which can read
and write elements of this type. |
|
Dockable |
getFrontDockable()
Gets the favorite child of this station. |
|
Dockable[] |
getFullscreenChildren()
Gets a list of all children of this station that are currently in fullscreen mode. |
|
ScreenDockFullscreenStrategy |
getFullscreenStrategy()
Gets the current fullscreen strategy. |
|
DockActionSource |
getIndirectActionOffers(Dockable dockable)
Gets a list of actions which should be available for the user and affect dockable. |
|
ScreenDockProperty |
getLocation(Dockable dockable,
Dockable target)
Gets the location of dockable and its current state. |
|
java.awt.Window |
getOwner()
Gets the owner of this station. |
|
DefaultStationPaintValue |
getPaint()
Gets the StationPaint for this station. |
|
PlaceholderMap |
getPlaceholders()
Gets a snapshot of all placeholders that are currently stored in this DockStation. |
|
PlaceholderMap |
getPlaceholders(java.util.Map<Dockable,java.lang.Integer> children)
Gets the placeholders of this station using a PlaceholderListItemConverter to
encode the children of this station. |
|
PlaceholderStrategy |
getPlaceholderStrategy()
Gets the PlaceholderStrategy that is currently in use. |
|
WindowProvider |
getProvider()
Gets the provider which delivers window owners for the windows of this station. |
|
java.awt.Rectangle |
getStationBounds()
Gets a rectangle in which all points of the station are. |
|
DockTitleVersion |
getTitleVersion()
Gets the DockTitleVersion used by this station to create
new DockTitles. |
|
ScreenDockWindow |
getWindow(Dockable dockable)
Searches the ScreenDockWindow which displays the dockable. |
|
ScreenDockWindow |
getWindow(int index)
Gets the index'th window of this station. |
|
ScreenDockWindowFactory |
getWindowFactory()
Gets the factory that is currently used to create new windows for this station. |
|
protected PropertyValue<ScreenDockWindowFactory> |
getWindowFactoryProperty()
Gets the property which represents the window factory. |
|
int |
indexOf(Dockable dockable)
Gets the index of a Dockable that is shown on this
station. |
|
boolean |
isExpandOnDoubleClick()
Tells whether children change their fullscreen mode if the user double clicks on them. |
|
boolean |
isFullscreen(Dockable dockable)
Tells whether dockable is currently shown in fullscreen mode. |
|
|
isInOverrideZone(int x,
int y,
D invoker,
Dockable drop)
If the controller asks a station if a child could be dropped or moved, the controller assumes that no other station has interest in this event. |
|
boolean |
isShowing()
Tells whether this station shows its children or not. |
|
boolean |
isStationVisible()
Tells whether this station is visible or not. |
|
boolean |
isVisible(Dockable dockable)
Tells whether the child dockable is visible or not. |
|
void |
move()
Moves a child of this station to a new location according to the information gathered by prepareMove. |
|
void |
move(Dockable dockable,
DockableProperty property)
Tries to move the child dockable in such a way, that
DockStation.getDockableProperty(Dockable, Dockable) would return a
DockableProperty that equals property. |
|
boolean |
prepare(int x,
int y,
int titleX,
int titleY,
Dockable dockable,
boolean drop)
|
|
boolean |
prepareDrop(int x,
int y,
int titleX,
int titleY,
boolean checkOverrideZone,
Dockable dockable)
Prepares this station to get the new child dockable. |
|
boolean |
prepareMove(int x,
int y,
int titleX,
int titleY,
boolean checkOverrideZone,
Dockable dockable)
Prepares the station that one of its children is moved from one location to another location. |
|
protected ScreenDockWindowHandle |
register(Dockable dockable,
Path placeholder,
ScreenDockWindow window)
Invoked after a new ScreenDockWindow has been created. |
|
void |
removeDockable(Dockable dockable)
Removes the dockable from this station. |
|
void |
removeDockable(int index)
Removes the index'th Dockable of this station. |
|
void |
removeScreenDockStationListener(ScreenDockStationListener listener)
Removes listener from this station. |
|
void |
replace(Dockable current,
Dockable other)
Replaces the child old by next which is
not yet a child of this station. |
|
void |
replace(Dockable current,
Dockable other,
boolean station)
|
|
void |
replace(DockStation old,
Dockable next)
Replaces the child old by next which is
not yet a child of this station. |
|
protected ScreenDockStationListener[] |
screenDockStationListeners()
Gets all the ScreenDockStationListeners that were added to this station. |
|
protected ScreenDockWindow |
searchCombineDockable(int x,
int y,
Dockable drop,
boolean combineArea)
Searches a window on the coordinates x/y which can be used to create a combination with drop. |
|
void |
setBoundaryRestriction(BoundaryRestriction restriction)
Changes the boundary restriction used to check the boundaries of the windows of this station. |
|
void |
setController(DockController controller)
Sets the controller of this station. |
|
void |
setDropOverRatio(double dropOverRatio)
Sets how much two windows must overlap in order to be merged. |
|
void |
setExpandOnDoubleClick(boolean expand)
Tells this station what to do on a double click on a child. |
|
void |
setFrontDockable(Dockable dockable)
Sets the most important child. |
|
void |
setFullscreen(Dockable dockable,
boolean fullscreen)
Changes the fullscreen mode of dockable. |
|
void |
setFullscreenAction(ListeningDockAction fullScreenAction)
Sets an action which allows to expand children. |
|
void |
setFullscreenStrategy(ScreenDockFullscreenStrategy strategy)
Sets the strategy used to handle fullscreen mode. |
|
void |
setPlaceholders(PlaceholderMap placeholders)
Sets an earlier snapshot of the placeholders of this station. |
|
void |
setPlaceholders(PlaceholderMap map,
java.util.Map<java.lang.Integer,Dockable> children)
Sets a new layout on this station, this method assumes that map was created
using getPlaceholders(Map). |
|
void |
setPlaceholderStrategy(PlaceholderStrategy strategy)
Sets the PlaceholderStrategy to use, null will set
the default strategy. |
|
void |
setShowing(boolean showing)
Sets the visibility of all windows of this station. |
|
void |
setWindowFactory(ScreenDockWindowFactory factory)
Sets the factory that will be used to create new windows for this station, already existing windows are not affected by this change. |
|
| Methods inherited from class bibliothek.gui.dock.station.AbstractDockStation |
|---|
accept, addDockStationListener, changed, getController, getTheme, removeDockStationListener, requestChildDockTitle, updateTheme |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TITLE_ID
DockTitleVersion of this station
public static final PropertyKey<BoundaryRestriction> BOUNDARY_RESTRICTION
ScreenDockWindow can have
public static final PropertyKey<ScreenDockWindowFactory> WINDOW_FACTORY
public static final PropertyKey<ScreenDockFullscreenStrategy> FULL_SCREEN_STRATEGY
public static final PropertyKey<java.lang.Boolean> EXPAND_ON_DOUBLE_CLICK
| Constructor Detail |
|---|
public ScreenDockStation(java.awt.Window owner)
ScreenDockStation.
owner - the window which will be used as parent for the
windows of this station, must not be nullpublic ScreenDockStation(WindowProvider owner)
ScreenDockStation.
owner - the window which will be used as parent for
the windows of this station, must not be null| Method Detail |
|---|
protected ListeningDockAction createFullscreenAction()
action which is added to all children
of this station. The action allows the user to expand a child to
fullscreen. The action is also added to subchildren, but the effect
does only affect direct children of this station.
null if this feature should be
disabled, or the action is set laterpublic void addScreenDockStationListener(ScreenDockStationListener listener)
listener to this station.
listener - the new listenerpublic void removeScreenDockStationListener(ScreenDockStationListener listener)
listener from this station.
listener - the listener to removeprotected ScreenDockStationListener[] screenDockStationListeners()
ScreenDockStationListeners that were added to this station.
public void setFullscreenAction(ListeningDockAction fullScreenAction)
action which allows to expand children. This
method can only be invoked if there is not already set an action. It is
a condition that createFullscreenAction() returns null
fullScreenAction - the new action
java.lang.IllegalStateException - if there is already an action presentpublic DefaultDockActionSource getDirectActionOffers(Dockable dockable)
DockStationdockable.
dockable - a child of this station
dockable, can be nullpublic DockActionSource getIndirectActionOffers(Dockable dockable)
DockStationdockable. The argument dockable
can be a child of this station, or a child of any station which is
below this station.
dockable - a child of this station or a child of another station
which is below this station
dockable or nullpublic DefaultDisplayerFactoryValue getDisplayerFactory()
DisplayerFactory that is used by this station
to create an underground for its children.
DefaultDisplayerFactoryValue#setDelegate(DisplayerFactory)public DisplayerCollection getDisplayers()
displayers used
on this station.
public StationCombinerValue getCombiner()
Combiner that is used to merge two Dockables
on this station.
StationCombinerValue#setDelegate(Combiner)public DefaultStationPaintValue getPaint()
StationPaint for this station. The paint is needed to
paint information on this station, when a Dockable is dragged
or moved.
DefaultStationPaintValue#setDelegate(StationPaint)
protected void callDockUiUpdateTheme()
throws java.io.IOException
AbstractDockStationDockUI.DockUI.updateTheme(DockStation, DockFactory)
with this as the first argument, and an appropriate factory
as the second argument.
callDockUiUpdateTheme in class AbstractDockStationjava.io.IOException - if the DockUI throws an exceptionpublic void setController(DockController controller)
DockStationDockTitle, then the titles have to be replaced
by new instances (assuming the controller is really new). The
title has to get new DockTitleVersions through
the DockTitleManager of controller.null means that this station is currently
not shown.
setController in interface DockStationsetController in class AbstractDockStationcontroller - the owner of this station, can be nullpublic int getDockableCount()
DockStation
public Dockable getDockable(int index)
DockStation
index - a value between 0 (incl.) and DockStation.getDockableCount()
(excl.).
public int indexOf(Dockable dockable)
Dockable that is shown on this
station. A call to getDockable(int) with the result of this
method would return dockable, if dockable
is on this station.
dockable - the item to search
public PlaceholderMap getPlaceholders()
DockStationDockStation.
A DockStation is free in the format it chooses to fill the map. The map is to be
created with the assumptions that DockStation.getDockableCount() is 0, meaning
any existing Dockable gets replaced by its placeholder. The current
PlaceholderStrategy should be used to convert Dockables to placeholders.
null if this station does not support
placeholderspublic PlaceholderMap getPlaceholders(java.util.Map<Dockable,java.lang.Integer> children)
PlaceholderListItemConverter to
encode the children of this station. To be exact, the converter puts the following
parameters for each Dockable into the map:
children
children - a unique identifier for each child of this station
public void setPlaceholders(PlaceholderMap placeholders)
DockStationDockStation.getDockableCount() is 0).placeholders.
placeholders - some set of placeholders
public void setPlaceholders(PlaceholderMap map,
java.util.Map<java.lang.Integer,Dockable> children)
map was created
using getPlaceholders(Map).
map - the map to readchildren - the new children of this stations
java.lang.IllegalStateException - if there are children left on this stationpublic PlaceholderStrategy getPlaceholderStrategy()
PlaceholderStrategy that is currently in use.
nullpublic void setPlaceholderStrategy(PlaceholderStrategy strategy)
PlaceholderStrategy to use, null will set
the default strategy.
strategy - the new strategy, can be nullpublic Dockable getFrontDockable()
DockStationnull indicates that there are no children
at all, or that there is no favorite child (all children are equal important).DockController.setFocusedDockable(Dockable, boolean)
which will then call DockStation.setFrontDockable(Dockable). Note that the
DockController itself listens to the DockTitles, and maybe the station
doesn't need a logic to decide which child is important.
nullpublic void setFrontDockable(Dockable dockable)
DockStationDockStation.getFrontDockable() how stations can change
this property.
dockable - the new favorite child, can be nullDockStation.getFrontDockable()
public boolean prepareDrop(int x,
int y,
int titleX,
int titleY,
boolean checkOverrideZone,
Dockable dockable)
DockStationdockable. The
station has to store a possible location of the child, and should draw
some indicators where the child will be put. The station can refuse
dockable, in this case nothing has to be painted and
this method returns false.false if this station is dockable,
checkOverrideZone is true and the mouse is in
the override-zone. of the parent. However, that condition is just "good manners" and may
be broken.DockStation.accept(Dockable) and Dockable.accept(DockStation)
or Dockable.accept(DockStation, Dockable) to ensure that the desired
drop-location is valid.DockAcceptance of its controller
(see DockController.getAcceptance()) to ensure that the drop/location is valid.mouseX/mouseY is the location
of the mouse, titleX/titleY is the location of the dragged
title. The second point may be interesting if the title of a dropped
child should have the same coordinates as the image of the dragged title.dockable is a child of this
station. In such a case prepareMove
is invoked.
x - the x-coordinate of the mouse on the screeny - the y-coordinate of the mouse on the screentitleX - the x-location of the dragged title or mouseX if no
title is draggedtitleY - the y-location of the dragged title or mouseY if no
title is draggedcheckOverrideZone - whether this station has to check if the mouse
is in the override-zone of its parentdockable - the element which will be dropped
true if dockable can be added at the
current location, false otherwise.
public boolean prepare(int x,
int y,
int titleX,
int titleY,
Dockable dockable,
boolean drop)
protected ScreenDockWindow searchCombineDockable(int x,
int y,
Dockable drop,
boolean combineArea)
drop.
x - the x-coordinate on the screeny - die y-coordinate on the screendrop - the Dockable which might be combined with a windowcombineArea - whether the point x/y must be over the
combine area or just
over the window.
drop.public void drop()
DockStationDockable of the last run of
prepareDrop to this station.
This method is only called if the new child and this station accepted
each other, prepareDrop returned true and
the new child is not yet a child of this station.
public void drop(Dockable dockable)
DockStationdockable to this station. The station can decide
by its own where to put dockable.
dockable - a new child
public DockableProperty getDockableProperty(Dockable dockable,
Dockable target)
DockStationDockStation.drop(Dockable, DockableProperty).
dockable - a child of this station, this childs location is askedtarget - an optional hint telling for which dockable the location information
will be used, can be null. This hint can be used to find a placeholder
that should be part of the result.
DockUtilities.getPropertyChain(DockStation, Dockable)
public ScreenDockProperty getLocation(Dockable dockable,
Dockable target)
dockable and its current state.
dockable - some child of this stationtarget - the final element for which the location is needd
nullpublic ScreenDockWindow getWindow(Dockable dockable)
ScreenDockWindow which displays the dockable.
dockable - the Dockable to search
nullpublic ScreenDockWindow getWindow(int index)
index'th window of this station. The number
of windows is identical to the number of Dockables.
index - the index of the window
public Dockable[] getFullscreenChildren()
nullpublic boolean isFullscreen(Dockable dockable)
dockable is currently shown in fullscreen mode.
dockable - the element to check
java.lang.IllegalArgumentException - if dockable is not known
public void setFullscreen(Dockable dockable,
boolean fullscreen)
dockable.
dockable - the element whose mode is to be changedfullscreen - the new mode
java.lang.IllegalArgumentException - if dockable is not known to this stationpublic void setExpandOnDoubleClick(boolean expand)
true, then the childs fullscreen mode gets changed.
expand - whether to react on double clickspublic void clearExpandOnDoubleClick()
setExpandOnDoubleClick(boolean)public boolean isExpandOnDoubleClick()
public boolean prepareMove(int x,
int y,
int titleX,
int titleY,
boolean checkOverrideZone,
Dockable dockable)
DockStationprepareDrop
for detailed information about the behavior of this method. The only
difference between this method and prepareDrop is, that
dockable is a child of this station.
x - the x-coordinate of the mouse on the screeny - the y-coordinate of the mouse on the screentitleX - the x-location of the dragged title or mouseX if no
title is draggedtitleY - the y-location of the dragged title or mouseY if no
title is draggedcheckOverrideZone - whether this station has to check if the
mouse is in the override-zone of its parentdockable - the element which will be moved
true if dockable can be added at the
current location, false otherwise.public void move()
DockStationprepareMove.
public void move(Dockable dockable,
DockableProperty property)
DockStationdockable in such a way, that
DockStation.getDockableProperty(Dockable, Dockable) would return a
DockableProperty that equals property.DockStation
does nothing at all.
dockable - a child of this stationproperty - the preferred position of dockablepublic void draw()
DockStationprepareDrop or
prepareMove should
be painted somehow onto this station.StationPaint of its theme
to draw.
public void forget()
DockStationprepareDrop
or prepareMoveDockStation.draw(), than the station can throw away these markings too.
public <D extends Dockable & DockStation> boolean isInOverrideZone(int x,
int y,
D invoker,
Dockable drop)
DockStationtrue.true.
D - the type of invokerx - the x-coordinate of the mouse on the screeny - the y-coordinate of the mouse on the screeninvoker - a child of this station which invoked the methoddrop - a Dockable which might become a child
true if the location of the mouse is of special
interestpublic boolean canDrag(Dockable dockable)
DockStationdockable can be removed from this station or not.
This method assumes that dockable is a child of
this station, if not, then the behavior of this method is unspecified.
dockable - a child of this station
true if dockable can be draggedpublic void drag(Dockable dockable)
DockStationDockStation.canDrag(Dockable) returned false.DockController.freezeLayout()
and DockController.meltLayout() to ensure noone else adds or
removes Dockables.
dockable - the child to remove
public void addDockable(Dockable dockable,
java.awt.Rectangle bounds)
Dockable on a newly created ScreenDockWindow to
the station. If the station is visible, the window
will be made visible too.
dockable - the Dockable to showbounds - the bounds that the window will have
public void addDockable(Dockable dockable,
java.awt.Rectangle bounds,
boolean boundsIncludeWindow)
Dockable on a newly created ScreenDockWindow to
the station. If the station is visible, the window
will be made visible too.
dockable - the Dockable to showbounds - the bounds that the window will haveboundsIncludeWindow - if true, the bounds describe the size
of the resulting window. Otherwise the size of the window will be a bit larger
such that the title can be shown in the new space
protected void addDockable(Dockable dockable,
java.awt.Rectangle bounds,
Path placeholder,
boolean boundsIncludeWindow)
Dockable on a newly created ScreenDockWindow to
the station. If the station is visible, the window
will be made visible too.
dockable - the Dockable to showbounds - the bounds that the window will haveplaceholder - the name of dockable, used to associate a group of other dockables
to dockable. Can be null.boundsIncludeWindow - if true, the bounds describe the size
of the resulting window. Otherwise the size of the window will be a bit larger
such that the title can be shown in the new space
java.lang.IllegalStateException - if there is already a window associated with the group of placeholder
public boolean drop(Dockable dockable,
DockableProperty property)
DockStationdockable to this station such that the location
given by property is matched. If property
has a successor and points to
another station, just call the drop-method of this
child-station. Note that property can be of any type and
contain invalid information.
dockable - the new childproperty - the location of the child, may be invalid data
true if property could be read
and dockable was dropped, false
otherwise.
public boolean drop(Dockable dockable,
ScreenDockProperty property)
dockable to this station, and uses
the property to determine its location. If the preferred
location overlaps an existing window, then the Dockable may be
added to a child-station of this station.
dockable - the new Dockableproperty - the preferred location of the dockable
true if the dockable could be added, false
otherwise.
public boolean drop(Dockable dockable,
ScreenDockProperty property,
boolean boundsIncludeWindow)
dockable to this station, and uses
the property to determine its location. If the preferred
location overlaps an existing window, then the Dockable may be
added to a child-station of this station.
dockable - the new Dockableproperty - the preferred location of the dockableboundsIncludeWindow - if true, the bounds describe the size
of the resulting window. Otherwise the size of the window will be a bit larger
such that the title can be shown in the new space
true if the dockable could be added, false
otherwise.
public boolean drop(Dockable dockable,
Dockable location)
dockable at the same coordinates as location, a
direct child of this station.
dockable - a new dockablelocation - a known dockable
public void combine(Dockable lower,
Dockable upper)
lower and the upper Dockable
to one Dockable, and replaces the lower with
this new Dockable. There are no checks whether this station
accepts the new child or the children
can be combined. The creation of the new Dockable is done
by the combiner.
lower - a Dockable which must be child of this stationupper - a Dockable which may be child of this station
public void combine(Dockable lower,
Dockable upper,
DockableProperty property)
lower and the upper Dockable
to one Dockable, and replaces the lower with
this new Dockable. There are no checks whether this station
accepts the new child or the children
can be combined. The creation of the new Dockable is done
by the combiner.
lower - a Dockable which must be child of this stationupper - a Dockable which may be child of this stationproperty - location information associated with upper, may be null
public boolean canReplace(Dockable old,
Dockable next)
DockStationold
with next where next is not a child of this station.
old - a child of this stationnext - the replacement of next.
true if the replacement is possible
public void replace(DockStation old,
Dockable next)
DockStationold by next which is
not yet a child of this station. This method should not be
called if canReplace returned
false. This method can assume that next was
a child of old but no longer is.
old - a dockable station that is a child of this stationnext - the replacement of old
public void replace(Dockable current,
Dockable other)
DockStationold by next which is
not yet a child of this station. This method should not be
called if canReplace returned
false.
current - a childother - the replacement of old
public void replace(Dockable current,
Dockable other,
boolean station)
public void removeDockable(Dockable dockable)
dockable from this station.DockController.freezeLayout()
and DockController.meltLayout() to ensure noone else adds or
removes Dockables.
dockable - the Dockable to removepublic void removeDockable(int index)
index'th Dockable of this station.DockController.freezeLayout()
and DockController.meltLayout() to ensure noone else adds or
removes Dockables.
index - the index of the Dockable to remove
protected ScreenDockWindowHandle register(Dockable dockable,
Path placeholder,
ScreenDockWindow window)
ScreenDockWindow has been created. This
method adds some listeners to the window. If the method is overridden,
it should be called from the subclass to ensure the correct function
of this station.
dockable - the element for which window will be usedplaceholder - the name of dockable, used to place the new
ScreenDockWindowHandle at its correct position. Can be null.window - the window which was newly created
window
protected void deregister(Dockable dockable,
ScreenDockWindow window)
ScreenDockWindow is no longer needed. This
method removes some listeners from the window. If overridden
by a subclass, the subclass should ensure that this implementation
is invoked too.
dockable - the element for which window was usedwindow - the old windowprotected ScreenDockWindow createWindow()
public java.awt.Window getOwner()
getProvider()public WindowProvider getProvider()
public ScreenDockWindowFactory getWindowFactory()
nullprotected PropertyValue<ScreenDockWindowFactory> getWindowFactoryProperty()
public void setWindowFactory(ScreenDockWindowFactory factory)
factory - the new factory, null to set the default
valuepublic ScreenDockFullscreenStrategy getFullscreenStrategy()
nullpublic void setFullscreenStrategy(ScreenDockFullscreenStrategy strategy)
strategy - the new strategy, null will reapply the default strategypublic boolean isShowing()
true if the windows are visible, false
otherwisesetShowing(boolean)public void setShowing(boolean showing)
showing - true if all windows should be visible,
false otherwise.public boolean isStationVisible()
DockStationJFrame is not visible if the frame is minimized.
public boolean isVisible(Dockable dockable)
DockStationdockable 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 DockStationisVisible in class AbstractDockStationdockable - the child whose visibility-state is questioned
dockable is visible or notDockStation.isStationVisible()public java.awt.Rectangle getStationBounds()
DockStationDockable into this area onto this station.
null to indicate that
this station has not any boundspublic Dockable asDockable()
DockElementthis if this is an instance of
Dockable. Otherwise null is returned.
this or null. Must not return null if DockElement.asDockable()
already returns null.public DockStation asDockStation()
DockElementthis if this is an instance of
DockStation. Otherwise null is returned.
this or null. Must not return null if DockElement.asDockable()
already returns nullpublic java.lang.String getFactoryID()
DockElementDockFactory which can read
and write elements of this type.
public boolean canCompare(DockStation station)
DockStationstation. See DockStation.compare(DockStation) for more
details.
canCompare in interface DockStationcanCompare in class AbstractDockStationstation - another station
true if a call to compare
will not end in an exception and return another value than 0public int compare(DockStation station)
DockStationstation. 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 DockStationcompare in class AbstractDockStationstation - another station
station.public DockTitleVersion getTitleVersion()
DockTitleVersion used by this station to create
new DockTitles.
nullpublic BoundaryRestriction getBoundaryRestriction()
BoundaryRestriction.
public void setBoundaryRestriction(BoundaryRestriction restriction)
restriction - the new restriction or null to reset
the default valuepublic void checkWindowBoundaries()
public double getDropOverRatio()
setDropOverRatio(double)public void setDropOverRatio(double dropOverRatio)
dropping a Dockable. A value of 0 means that
the windows don't have to overlap, a value of 1 indicates a perfect match. The default value is 0.75.
dropOverRatio - the new ratio, a value between 0 and 1 inclusive
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||