public class DefaultDragAndDropPolicy extends AbstractPolicy implements IDragAndDropPolicy
IDragAndDropPolicy
.Constructor and Description |
---|
DefaultDragAndDropPolicy() |
Modifier and Type | Method and Description |
---|---|
int |
getDragActions(TimelineObjectPath path,
IGanttChartModel model)
Determines how the given timeline object can be dragged (copy, move, copy
or move, none).
|
ICommand |
getDragAndDropCommand(TimelineObjectPath path,
IGanttChartModel model,
Object newNode,
IGanttChartModel newModel,
long newStartTime,
Object[] timelineObjects,
ILayer layer,
int dropAction)
Returns a command object that will be used to make the necessary
modifications to the models when the user dragged several timeline
objects from one row to another at the same time.
|
int |
getDropActions(TimelineObjectPath path,
IGanttChartModel model,
Object newNode,
IGanttChartModel newModel,
long newStartTime)
Determines whether the new location as specified by the new tree node,
new model and new time span can be used as a drop location for the given
timeline object.
|
assertClass
public int getDragActions(TimelineObjectPath path, IGanttChartModel model)
IDragAndDropPolicy
DnDConstants
class.getDragActions
in interface IDragAndDropPolicy
path
- the path to the timeline object that has to participate in a
drag and drop operationmodel
- the data source of the tree node and the timeline objectpublic int getDropActions(TimelineObjectPath path, IGanttChartModel model, Object newNode, IGanttChartModel newModel, long newStartTime)
IDragAndDropPolicy
getDropActions
in interface IDragAndDropPolicy
path
- the path to the timeline object that has to participate in a
drag and drop operationmodel
- the data source of the tree node and the timeline objectnewNode
- the tree node that will be the new owner of the timeline
objectnewModel
- the data source of the new tree node ownernewStartTime
- the time point that will be the new start time of the timeline
objectDnDConstants
public ICommand getDragAndDropCommand(TimelineObjectPath path, IGanttChartModel model, Object newNode, IGanttChartModel newModel, long newStartTime, Object[] timelineObjects, ILayer layer, int dropAction)
IDragAndDropPolicy
getDragAndDropCommand
in interface IDragAndDropPolicy
path
- the path to the timeline object that was dragged and droppedmodel
- the data source of the tree node and the timeline objectsnewNode
- the tree node that will be the new owner of the timeline
objectsnewModel
- the data source of the new tree node ownernewStartTime
- the time point that will be the new start time of the timeline
objecttimelineObjects
- the timeline objects that might have to participate in a drag
and drop operation because they were selected at the same timelayer
- the layer on which the drag and drop operation takes placedropAction
- an value used to distinguish between different types of drop
operations (possible values listed in DnDConstants
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.