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