1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.g2d.dnd;
14 import java.awt.datatransfer.Transferable;
15 import java.awt.dnd.DnDConstants;
16 import java.awt.dnd.DragGestureEvent;
17 import java.awt.dnd.DragSourceListener;
19 import org.simantics.g2d.canvas.ICanvasParticipant;
20 import org.simantics.scenegraph.g2d.events.MouseEvent.MouseDragBegin;
23 * This is an interface allows objects to be dragged from the canvas.
24 * Implementations produce serializable Transferable object in drag out event.
26 * This participant requires {@link DragInteractor} installed in the canvas context.
28 * @author Toni Kalajainen
30 public interface IDragSourceParticipant extends ICanvasParticipant, DragSourceListener {
33 * Can participant provide draggable content
34 * @return 0 for no, others operations, see {@link DnDConstants}
36 int canDrag(MouseDragBegin me);
38 Transferable dragStart(DragGestureEvent e);
41 * Get allowed ops (See DnDConstants)