public class MergeOperation extends java.lang.Object implements RelocateOperation
Merger
to merge two DockStation
s.Constructor and Description |
---|
MergeOperation(DockController controller,
Merger merger,
DockStation station,
StationDropOperation operation,
StationDropItem item)
Creates a new operation.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy(RelocateOperation next)
Informs this operation that it will never be used (again) and that it should release any
resources it has acquired.
|
boolean |
execute(Dockable selection,
VetoableDockRelocatorListener listener)
Executes this operation.
|
Dockable[] |
getImplicit(Dockable selection)
Gets the
Dockable s whose parent will change due to this operation. |
StationDropOperation |
getOperation()
Gets the operation that would be executed by the
dock station . |
DockStation |
getStation()
Gets the station which is the target of this operation
|
public MergeOperation(DockController controller, Merger merger, DockStation station, StationDropOperation operation, StationDropItem item)
controller
- the controller in whose realm this operation worksmerger
- the merger that will be used to merge the stationsstation
- the target of this operationoperation
- the operation that would be executed by the stationitem
- information about the source of the operationpublic DockStation getStation()
RelocateOperation
getStation
in interface RelocateOperation
null
public StationDropOperation getOperation()
RelocateOperation
dock station
.getOperation
in interface RelocateOperation
null
public void destroy(RelocateOperation next)
RelocateOperation
destroy
in interface RelocateOperation
next
- the operation that will be executed next, can be null
public Dockable[] getImplicit(Dockable selection)
RelocateOperation
Dockable
s whose parent will change due to this operation.getImplicit
in interface RelocateOperation
selection
- the element that is moved aroundnull
but can be emptypublic boolean execute(Dockable selection, VetoableDockRelocatorListener listener)
RelocateOperation
dragging
and
dragged
of listener
, all other
methods will throw an IllegalStateException
.execute
in interface RelocateOperation
selection
- the element that is moved aroundlistener
- a listener to be informed about events happening because of this operationtrue
if the operation was a success, false
if the operation was
canceled