AWT/Swing merge from GNU Classpath.

From-SVN: r56147
This commit is contained in:
Bryce McKinlay
2002-08-09 04:26:17 +00:00
committed by Bryce McKinlay
parent 097684ce62
commit 7bde45b2eb
490 changed files with 86038 additions and 9753 deletions
+72
View File
@@ -0,0 +1,72 @@
/* DnDConstants.java -- constants for drag-and-drop operations
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
/**
* This class contains various constants used in drag-and-drop operations.
* Why it is not an interface is beyond me.
*
* @author Eric Blake <ebb9@email.byu.edu>
* @since 1.2
* @status updated to 1.4
*/
public final class DnDConstants
{
/** No action takes place. */
public static final int ACTION_NONE = 0;
/** The copy action. */
public static final int ACTION_COPY = 1;
/** The move action. */
public static final int ACTION_MOVE = 2;
/** Either a copy or a move. */
public static final int ACTION_COPY_OR_MOVE = 3;
/**
* A link action. This does not copy or move, but creates a reference back
* to the original. However, since platforms differ on how a reference should
* behave, this action is not recommended for common use.
*/
public static final int ACTION_LINK = 1073741824;
/** A synonym for {@link #ACTION_LINK}. */
public static final int ACTION_REFERENCE = ACTION_LINK;
} // class DnDConstants
+129
View File
@@ -0,0 +1,129 @@
/* DragGestureEvent.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.datatransfer.Transferable;
import java.awt.event.InputEvent;
import java.util.EventObject;
import java.util.Iterator;
import java.util.List;
/**
* STUBBED
* @see DragGestureRecognizer
* @see DragGestureListener
* @see DragSource
* @since 1.2
*/
public class DragGestureEvent extends EventObject
{
/**
* Compatible with JDK 1.2+.
*/
private static final long serialVersionUID = 9080172649166731306L;
private DragSource dragSource;
private Component component;
private final Point origin;
private final int action;
public DragGestureEvent(DragGestureRecognizer dgr, int action, Point origin,
List events)
{
super(dgr);
if (origin == null || events == null)
throw new IllegalArgumentException();
this.origin = origin;
this.action = action;
}
public DragGestureRecognizer getSourceAsDragGestureRecognizer()
{
return (DragGestureRecognizer) source;
}
public Component getComponent()
{
return null;
}
public DragSource getDragSource()
{
return null;
}
public Point getDragOrigin()
{
return origin;
}
public Iterator iterator()
{
return null;
}
public Object[] toArray()
{
return null;
}
public Object[] toArray(Object[] array)
{
return array;
}
public int getDragAction()
{
return 0;
}
public InputEvent getTriggerEvent()
{
return null;
}
public void startDrag(Cursor dragCursor, Transferable trans)
{
startDrag(dragCursor, null, null, trans, null);
}
public void startDrag(Cursor dragCursor, Transferable trans,
DragSourceListener l)
{
startDrag(dragCursor, null, null, trans, l);
}
public void startDrag(Cursor dragCursor, Image dragImage, Point imageOffset,
Transferable trans, DragSourceListener l)
{
}
} // class DragGestureEvent
@@ -0,0 +1,63 @@
/* DragGestureListener.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.util.EventListener;
/**
* This is a listener for starting a drag-and-drop gesture. Upon receiving
* notification, the implementor then starts the drag operation.
*
* @author Eric Blake <ebb9@email.byu.edu>
* @see DragGestureRecognizer
* @see DragGestureEvent
* @see DragSource
* @since 1.2
* @status updated to 1.4
*/
public interface DragGestureListener extends EventListener
{
/**
* Called when the native platform notifies the virtual machine that a
* drag-and-drop has been initiated.
*
* @param e the event
*/
void dragGestureRecognized(DragGestureEvent e);
} // interface DragGestureListener
@@ -0,0 +1,173 @@
/* DragGestureRecognizer.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.awt.Component;
import java.awt.Point;
import java.awt.event.InputEvent;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.TooManyListenersException;
/**
* STUBBED
* @since 1.2
*/
public abstract class DragGestureRecognizer implements Serializable
{
/**
* Compatible with JDK 1.2+.
*/
private static final long serialVersionUID = 8996673345831063337L;
protected DragSource dragSource;
protected Component component;
protected transient DragGestureListener dragGestureListener;
protected int sourceActions;
protected ArrayList events = new ArrayList();
protected DragGestureRecognizer(DragSource ds, Component c, int sa,
DragGestureListener dgl)
{
if (ds == null)
throw new IllegalArgumentException();
dragSource = ds;
component = c;
sourceActions = sa;
dragGestureListener = dgl;
}
protected DragGestureRecognizer(DragSource ds, Component c, int sa)
{
this(ds, c, sa, null);
}
protected DragGestureRecognizer(DragSource ds, Component c)
{
this(ds, c, 0, null);
}
protected DragGestureRecognizer(DragSource ds)
{
this(ds, null, 0, null);
}
protected abstract void registerListeners();
protected abstract void unregisterListeners();
public DragSource getDragSource()
{
return dragSource;
}
public Component getComponent()
{
return component;
}
public void setComponent(Component c)
{
component = c;
}
public int getSourceActions()
{
return sourceActions;
}
public void setSourceActions(int sa)
{
sourceActions = sa;
}
public InputEvent getTriggerEvent()
{
return events.size() > 0 ? (InputEvent) events.get(0) : null;
}
public void resetRecognizer()
{
throw new Error("not implemented");
}
public void addDragGestureListener(DragGestureListener dgl)
throws TooManyListenersException
{
if (dragGestureListener != null)
throw new TooManyListenersException();
dragGestureListener = dgl;
}
public void removeDragGestureListener(DragGestureListener dgl)
{
if (dragGestureListener != dgl)
throw new IllegalArgumentException();
dragGestureListener = null;
}
protected void fireDragGestureRecognized(int dragAction, Point p)
{
throw new Error("not implemented");
}
protected void appendEvent(InputEvent e)
{
if (e == null)
return;
events.add(e);
}
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException
{
s.defaultReadObject();
dragGestureListener = (DragGestureListener) s.readObject();
}
private void writeObject(ObjectOutputStream s) throws IOException
{
s.defaultWriteObject();
s.writeObject(dragGestureListener instanceof Serializable
? dragGestureListener : null);
}
} // class DragGestureRecognizer
+163
View File
@@ -0,0 +1,163 @@
/* DragSource.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.datatransfer.FlavorMap;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.peer.DragSourceContextPeer;
import java.io.Serializable;
import java.util.EventListener;
public class DragSource implements Serializable
{
/**
* Compatible with JDK 1.2+.
*/
private static final long serialVersionUID = 6236096958971414066L;
public static final Cursor DefaultCopyDrop = null;
public static final Cursor DefaultMoveDrop = null;
public static final Cursor DefaultLinkDrop = null;
public static final Cursor DefaultCopyNoDrop = null;
public static final Cursor DefaultMoveNoDrop = null;
public static final Cursor DefaultLinkNoDrop = null;
public DragSource()
{
}
public static DragSource getDefaultDragSource()
{
return null;
}
public static boolean isDragImageSupported()
{
return false;
}
public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Image dragImage, Point imageOffset,
Transferable trans, DragSourceListener dsl,
FlavorMap map)
{
}
public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Transferable trans, DragSourceListener dsl,
FlavorMap map)
{
startDrag(trigger, dragCursor, null, null, trans, dsl, map);
}
public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Image dragImage, Point imageOffset,
Transferable trans, DragSourceListener dsl)
{
startDrag(trigger, dragCursor, dragImage, imageOffset, trans, dsl, null);
}
public void startDrag(DragGestureEvent trigger, Cursor dragCursor,
Transferable trans, DragSourceListener dsl)
{
startDrag(trigger, dragCursor, null, null, trans, dsl, null);
}
protected DragSourceContext
createDragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge,
Cursor cursor, Image image, Point offset,
Transferable t, DragSourceListener dsl)
{
return null;
}
public FlavorMap getFlavorMap()
{
return null;
}
public DragGestureRecognizer
createDragGestureRecognizer(Class recognizer, Component c, int actions,
DragGestureListener dgl)
{
return null;
}
public DragGestureRecognizer
createDefaultDragGestureRecognizer(Component c, int actions,
DragGestureListener dgl)
{
return null;
}
public void addDragSourceListener(DragSourceListener l)
{
}
public void removeDragSourceListener(DragSourceListener l)
{
}
public DragSourceListener[] getDragSourceListeners()
{
return null;
}
public void addDragSourceMotionListener(DragSourceMotionListener l)
{
}
public void removeDragSourceMotionListener(DragSourceMotionListener l)
{
}
public DragSourceMotionListener[] getDragSourceMotionListeners()
{
return null;
}
public EventListener[] getListeners(Class type)
{
return null;
}
} // class DragSource
+126
View File
@@ -0,0 +1,126 @@
/* DragSourceAdapter.java -- drag-and-drop listener adapter
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
/**
* This class implements <code>DragSourceListener</code> and
* <code>DragSourceMotionListener</code>, and implements all methods
* with empty bodies. This allows a listener interested in implementing only
* a subset of these interfaces to extend this class and override only the
* desired methods.
*
* @author Eric Blake <ebb9@email.byu.edu>
* @see DragSourceEvent
* @see DragSourceListener
* @see DragSourceMotionListener
* @since 1.4
* @status updated to 1.4
*/
public abstract class DragSourceAdapter
implements DragSourceListener, DragSourceMotionListener
{
/**
* Default constructor.
*/
public DragSourceAdapter()
{
}
/**
* Called when the cursor hotspot enters a drop site which will accept the
* drag.
*
* @param e the event
*/
public void dragEnter(DragSourceDragEvent e)
{
}
/**
* Called when the cursor hotspot moves inside of a drop site which will
* accept the drag.
*
* @param e the event
*/
public void dragOver(DragSourceDragEvent e)
{
}
/**
* Called whenever the mouse is moved during a drag-and-drop operation.
*
* @param e the event
*/
public void dragMouseMoved(DragSourceDragEvent e)
{
}
/**
* Called when the user modifies the drop gesture. This is often the case
* when additional mouse or key events are received during the drag.
*
* @param e the event
*/
public void dropActionChanged(DragSourceDragEvent e)
{
}
/**
* Called when the cursor hotspot moves outside of a drop site which will
* accept the drag. This could also happen if the drop site is no longer
* active, or no longer accepts the drag.
*
* @param e the event
*/
public void dragExit(DragSourceDragEvent e)
{
}
/**
* Called when the drag and drop operation is complete. After this event,
* <code>getDropSuccess</code> of the event is valid, and
* <code>getDropAction</code> holds the action requested by the drop site.
* Furthermore, the <code>DragSourceContext</code> is invalidated.
*
* @param e the event
*/
public void dragDropEnd(DragSourceDragEvent e)
{
}
} // class DragSourceAdapter
+138
View File
@@ -0,0 +1,138 @@
/* DragSourceContext.java --
Copyright (C) 2002 Free Software Foundation
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.peer.DragSourceContextPeer;
import java.io.Serializable;
import java.util.TooManyListenersException;
public class DragSourceContext
implements DragSourceListener, DragSourceMotionListener, Serializable
{
protected static final int DEFAULT = 0;
protected static final int ENTER = 1;
protected static final int OVER = 2;
protected static final int CHANGED = 3;
public DragSourceContext(DragSourceContextPeer peer, DragGestureEvent dge,
Cursor cursor, Image image, Point offset,
Transferable trans, DragSourceListener dsl)
{
}
public DragSource getDragSource()
{
return null;
}
public Component getComponent()
{
return null;
}
public DragGestureEvent getTrigger()
{
return null;
}
public int getSourceActions()
{
return 0;
}
public void setCursor(Cursor c)
{
}
public Cursor getCursor()
{
return null;
}
public void addDragSourceListener(DragSourceListener l)
throws TooManyListenersException
{
}
public void removeDragSourceListener(DragSourceListener l)
{
}
public void transferablesFlavorsChanged()
{
}
public void dragEnter(DragSourceDragEvent e)
{
}
public void dragOver(DragSourceDragEvent e)
{
}
public void dragExit(DragSourceDragEvent e)
{
}
public void dropActionChanged(DragSourceDragEvent e)
{
}
public void dragDropEnd(DragSourceDragEvent e)
{
}
public void dragMouseMoved(DragSourceDragEvent e)
{
}
public Transferable getTransferable()
{
return null;
}
protected void updateCurrentCursor(int dropOp, int targetAct, int status)
{
}
} // class DragSourceContext
@@ -0,0 +1,95 @@
/* DragSourceDragEvent.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import gnu.java.awt.EventModifier;
/**
* STUBBED
*/
public class DragSourceDragEvent extends DragSourceEvent
{
private final int dropAction;
private final int targetActions;
private final int gestureModifiers;
public DragSourceDragEvent(DragSourceContext context, int dropAction,
int actions, int modifiers)
{
super(context);
this.dropAction = dropAction;
targetActions = actions;
gestureModifiers = EventModifier.extend(modifiers);
}
public DragSourceDragEvent(DragSourceContext context, int dropAction,
int actions, int modifiers, int x, int y)
{
super(context, x, y);
this.dropAction = dropAction;
targetActions = actions;
gestureModifiers = EventModifier.extend(modifiers);
}
public int getTargetActions()
{
return targetActions;
}
public int getGestureModifiers()
{
return EventModifier.revert(gestureModifiers);
}
public int getGestureModifiersEx()
{
return gestureModifiers;
}
public int getUserAction()
{
return dropAction;
}
public int getDropAction()
{
return dropAction & targetActions
& ((DragSourceContext) source).getSourceActions();
}
} // class DragSourceDragEvent
+85
View File
@@ -0,0 +1,85 @@
/* DragSourceEvent.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.awt.Point;
import java.util.EventObject;
public class DragSourceEvent extends EventObject
{
private final boolean locationSpecified;
private final int x;
private final int y;
public DragSourceEvent(DragSourceContext context)
{
super(context);
locationSpecified = false;
x = 0;
y = 0;
}
public DragSourceEvent(DragSourceContext context, int x, int y)
{
super(context);
locationSpecified = true;
this.x = x;
this.y = y;
}
public DragSourceContext getDragSourceContext()
{
return (DragSourceContext) source;
}
public Point getLocation()
{
return locationSpecified ? new Point(x, y) : null;
}
public int getX()
{
return x;
}
public int getY()
{
return y;
}
} // class DragSourceEvent
@@ -0,0 +1,97 @@
/* DragSourceListener.java -- listen to events during the drag
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.util.EventListener;
/**
* This class allows an object to listen for drag and drop events. It can
* be used to provide appropriate feedback for "drag over" actions. You can
* also use a <code>DragSourceAdapter</code> to filter the events you are
* interested in.
*
* @author Eric Blake <ebb9@email.byu.edu>
* @since 1.2
* @status updated to 1.4
*/
public interface DragSourceListener extends EventListener
{
/**
* Called when the cursor hotspot enters a drop site which will accept the
* drag.
*
* @param e the drag source drag event
*/
void dragEnter(DragSourceDragEvent e);
/**
* Called when the cursor hotspot moves inside of a drop site which will
* accept the drag.
*
* @param e the drag source drag event
*/
void dragOver(DragSourceDragEvent e);
/**
* Called when the user modifies the drop gesture. This is often the case
* when additional mouse or key events are received during the drag.
*
* @param e the drag source drag event
*/
void dropActionChanged(DragSourceDragEvent e);
/**
* Called when the cursor hotspot moves outside of a drop site which will
* accept the drag. This could also happen if the drop site is no longer
* active, or no longer accepts the drag.
*
* @param e the drag source drag event
*/
void dragExit(DragSourceDragEvent e);
/**
* Called when the drag and drop operation is complete. After this event,
* <code>getDropSuccess</code> of the event is valid, and
* <code>getDropAction</code> holds the action requested by the drop site.
* Furthermore, the <code>DragSourceContext</code> is invalidated.
*
* @param e the drag source drag event
*/
void dragDropEnd(DragSourceDragEvent e);
} // interface DragSourceListener
@@ -0,0 +1,64 @@
/* DragSourceMotionListener.java -- tracks motion in the drag source
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
import java.util.EventListener;
/**
* This is a listener for mouse motion in the drag source before the drop
* event occurs. You can also use a <code>DragSourceAdapter</code> to filter
* the events you are interested in.
*
* @author Eric Blake <ebb9@email.byu.edu>
* @see DragSourceDragEvent
* @see DragSource
* @see DragSourceListener
* @see DragSourceAdapter
* @since 1.4
* @status updated to 1.4
*/
public interface DragSourceMotionListener extends EventListener
{
/**
* Called whenever the mouse is moved during a drag-and-drop operation.
*
* @param e the event
*/
void dragMouseMoved(DragSourceDragEvent e);
} // interface DragSourceMotionListener
+40
View File
@@ -0,0 +1,40 @@
/* DropTarget.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
/** STUB CLASS ONLY */
public class DropTarget {}
@@ -0,0 +1,73 @@
/* InvalidDnDOperationException.java -- thrown when drag-and-drop fails
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd;
/**
* Thrown when a method in the java.awt.dnd package is unable to perform a
* requested operation, usually because the underlying DnD system is in the
* wrong state.
*
* @author Eric Blake <ebb9@email.byu.edu>
* @since 1.2
* @status updated to 1.4
*/
public class InvalidDnDOperationException extends IllegalStateException
{
/**
* Compatible with JDK 1.2+.
*/
private static final long serialVersionUID = -6062568741193956678L;
/**
* Create an exception without a message.
*/
public InvalidDnDOperationException()
{
}
/**
* Create an exception with a message.
*
* @param s the message
*/
public InvalidDnDOperationException(String s)
{
super(s);
}
} // class InvalidDnDOperationException
@@ -0,0 +1,55 @@
/* DragSourceContextPeer.java -- interface for drag-and-drop peers
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.dnd.peer;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.Point;
import java.awt.dnd.DragSourceContext;
/**
* STUBBED
*/
public interface DragSourceContextPeer
{
void startDrag(DragSourceContext context, Cursor c, Image i, Point p);
Cursor getCursor();
void setCursor(Cursor c);
void transferablesFlavorsChanged();
} // interface DragSourceContextPeer