|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DockStationDropLayer
A DockStationDropLayer
describes an area of the screen where a drag and drop operation
can end with the "drop event". Several levels can be active at the same time, and there is a strong
order in which level is more important than the other level, the first level hit by the mouse wins.
The order of two DockStationDropLayer
s is calculated by applying the following steps, the first conclusive
result is the final result.
true
on canCompare(DockStationDropLayer)
, then
the compare(DockStationDropLayer)
method is called for comparison. If both levels implement
the compare
method but the results contradict each other, then this step
is ignored.LayerPriority
s are compared, the one level where LayerPriority.getPriority()
is higher
also has a higher priority.LayerPriority.isReverse()
does not match, the level where reverse
is
false
has higher priority.LayerPriority.isReverse()
the result of the remaining steps is inverted.station
of one level is an ancestor of the other level, then the child station
has higher priority.contains(int, int)
method returns false
for the current position of the mouse
are ignored for the order, but not when calling modify
.
Method Summary | |
---|---|
boolean |
canCompare(DockStationDropLayer level)
Tells whether this level contains code to tell whether it has a higher or lower priority as level . |
int |
compare(DockStationDropLayer level)
Compares this level with level . |
boolean |
contains(int x,
int y)
Tells whether this level contains the point x/y , which is the position
of the mouse on the screen. |
Component |
getComponent()
Gets a Component which is associated with this level. |
LayerPriority |
getPriority()
Gets the basic priority of this level. |
DockStation |
getStation()
Gets the DockStation which created this level. |
DockStationDropLayer |
modify(DockStationDropLayer child)
This method is called for any DockStationDropLayer whose station
is a child to the station of this level. |
void |
setPriority(LayerPriority priority)
Sets a new priority for this level. |
Method Detail |
---|
DockStation getStation()
DockStation
which created this level.
Component getComponent()
Component
which is associated with this level. The Component
can be used to order
levels because Component
s can overlap each other. This is an optional method, a result of
null
is perfectly valid.
null
DockStationDropLayer modify(DockStationDropLayer child)
DockStationDropLayer
whose station
is a child to the station of this
level. This method may modify the level, e.g. increase or
decrease its priority. This method is called before this
level itself gets modified by its
parents. This method is called independent of whether contains(int, int)
returns true
or false
.
child
- the child to modify, this method may either directly modify child
, create a wrapper or
a copy of child
child
or a new DockStationDropLayer
replacing child
, not null
boolean contains(int x, int y)
level
contains the point x/y
, which is the position
of the mouse on the screen.
x
- the x-coordinate of the mouse on the screeny
- the y-coordinate of the mouse on the screen
true
if this
level contains x/y
, false
otherwiseLayerPriority getPriority()
null
void setPriority(LayerPriority priority)
priority
- the new priority, must not be null
boolean canCompare(DockStationDropLayer level)
level
. For most implementations the result of this method should be false
.true
, then the ordering defined by the custom algorithm supercedes
any other conditions.
level
- some other level to check
true
if this DockStationDropLayer
contains code to compare level
with
this
int compare(DockStationDropLayer level)
level
. This method is only called if canCompare(DockStationDropLayer)
returned true
for level
. This method works like Comparable.compareTo(Object)
.
level
- another level to compare
level
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |