public interface Merger
DockStation
s. The Merger
usually is not
accessed by the involved DockStation
s or Dockable
s directly, rather it is accessed
by the DockRelocator
once a StationDropOperation
has been found.Modifier and Type | Method and Description |
---|---|
boolean |
canMerge(StationDropOperation operation,
DockStation parent,
DockStation child)
Checks whether
merge(StationDropOperation, DockStation, DockStation) will succeed or not. |
void |
merge(StationDropOperation operation,
DockStation parent,
DockStation child)
Moves all children of
child to parent , leaving child
empty. |
boolean canMerge(StationDropOperation operation, DockStation parent, DockStation child)
merge(StationDropOperation, DockStation, DockStation)
will succeed or not. This
method will only be called if parent
would accept all children
of child
. This method may be called during "drop" and during "move" operations.operation
- the operation that would be executed, can be null
parent
- an existing stationchild
- a station that is dragged around and may be dropped onto parent
merge(StationDropOperation, DockStation, DockStation)
will succeedvoid merge(StationDropOperation operation, DockStation parent, DockStation child)
child
to parent
, leaving child
empty. This method is only called if canMerge
returned true
and if the accept
-methods allow the operation.child
is not parent
, then child
will be removed
from its parent. Otherwise the child remains, allowing this Merger
to reuse it.operation
- the operation that would be executed, can be null
parent
- the new parent of the childrenchild
- the station to dissolve