summaryrefslogtreecommitdiff
path: root/java/awt/dnd
diff options
context:
space:
mode:
Diffstat (limited to 'java/awt/dnd')
-rw-r--r--java/awt/dnd/Autoscroll.java1
-rw-r--r--java/awt/dnd/DnDEventMulticaster.java4
-rw-r--r--java/awt/dnd/DragGestureEvent.java32
-rw-r--r--java/awt/dnd/DragGestureRecognizer.java2
-rw-r--r--java/awt/dnd/DragSource.java34
-rw-r--r--java/awt/dnd/DragSourceContext.java58
-rw-r--r--java/awt/dnd/DragSourceDropEvent.java2
-rw-r--r--java/awt/dnd/DragSourceEvent.java2
-rw-r--r--java/awt/dnd/DropTarget.java30
-rw-r--r--java/awt/dnd/DropTargetContext.java6
-rw-r--r--java/awt/dnd/DropTargetDragEvent.java14
-rw-r--r--java/awt/dnd/DropTargetDropEvent.java8
-rw-r--r--java/awt/dnd/DropTargetEvent.java4
-rw-r--r--java/awt/dnd/MouseDragGestureRecognizer.java4
-rw-r--r--java/awt/dnd/peer/DropTargetContextPeer.java6
15 files changed, 103 insertions, 104 deletions
diff --git a/java/awt/dnd/Autoscroll.java b/java/awt/dnd/Autoscroll.java
index ba4d4476c..094063ce1 100644
--- a/java/awt/dnd/Autoscroll.java
+++ b/java/awt/dnd/Autoscroll.java
@@ -67,4 +67,3 @@ public interface Autoscroll
void autoscroll (Point location);
} // interface Autoscroll
-
diff --git a/java/awt/dnd/DnDEventMulticaster.java b/java/awt/dnd/DnDEventMulticaster.java
index d9f5ec00f..30594c2c7 100644
--- a/java/awt/dnd/DnDEventMulticaster.java
+++ b/java/awt/dnd/DnDEventMulticaster.java
@@ -47,7 +47,7 @@ class DnDEventMulticaster extends AWTEventMulticaster
{
super (a, b);
}
-
+
public static DragSourceListener add (DragSourceListener a,
DragSourceListener b)
{
@@ -59,7 +59,7 @@ class DnDEventMulticaster extends AWTEventMulticaster
{
return (DragSourceMotionListener) addInternal (a, b);
}
-
+
public static DragSourceListener remove (DragSourceListener a,
DragSourceListener b)
{
diff --git a/java/awt/dnd/DragGestureEvent.java b/java/awt/dnd/DragGestureEvent.java
index 2a22abb12..e127a7dc1 100644
--- a/java/awt/dnd/DragGestureEvent.java
+++ b/java/awt/dnd/DragGestureEvent.java
@@ -87,67 +87,67 @@ public class DragGestureEvent extends EventObject
/**
* Returns the source casted as a DragGestureRecognizer.
- *
+ *
* @return the source casted as a DragGestureRecognizer.
*/
public DragGestureRecognizer getSourceAsDragGestureRecognizer()
{
return (DragGestureRecognizer) getSource();
}
-
+
/**
* Returns the Component corresponding to this.
- *
+ *
* @return the Component corresponding to this.
*/
public Component getComponent()
{
return component;
}
-
+
/**
* Gets the DragSource corresponding to this.
- *
+ *
* @return the DragSource corresponding to this.
*/
public DragSource getDragSource()
{
return dragSource;
}
-
+
/**
* Returns the origin of the drag.
- *
+ *
* @return the origin of the drag.
*/
public Point getDragOrigin()
{
return origin;
}
-
+
/**
* Gets an iterator representation of the List of events.
- *
+ *
* @return an iterator representation of the List of events.
*/
public Iterator<InputEvent> iterator()
{
return events.iterator();
}
-
+
/**
* Gets an array representation of the List of events.
- *
+ *
* @return an array representation of the List of events.
*/
public Object[] toArray()
{
return events.toArray();
}
-
+
/**
* Gets an array representation of the List of events.
- *
+ *
* @param array - the array to store the events in.
* @return an array representation of the List of events.
*/
@@ -158,17 +158,17 @@ public class DragGestureEvent extends EventObject
/**
* Gets the user's preferred action.
- *
+ *
* @return the user's preferred action.
*/
public int getDragAction()
{
return action;
}
-
+
/**
* Get the event that triggered this gesture.
- *
+ *
* @return the event that triggered this gesture.
*/
public InputEvent getTriggerEvent()
diff --git a/java/awt/dnd/DragGestureRecognizer.java b/java/awt/dnd/DragGestureRecognizer.java
index fb37b4fc7..c41402ca7 100644
--- a/java/awt/dnd/DragGestureRecognizer.java
+++ b/java/awt/dnd/DragGestureRecognizer.java
@@ -164,7 +164,7 @@ public abstract class DragGestureRecognizer implements Serializable
{
if(dragGestureListener != null)
dragGestureListener.dragGestureRecognized
- (new DragGestureEvent(this, dragAction, p, events));
+ (new DragGestureEvent(this, dragAction, p, events));
resetRecognizer();
}
diff --git a/java/awt/dnd/DragSource.java b/java/awt/dnd/DragSource.java
index cd4a93a3e..af8b37668 100644
--- a/java/awt/dnd/DragSource.java
+++ b/java/awt/dnd/DragSource.java
@@ -74,7 +74,7 @@ public class DragSource implements Serializable
private transient FlavorMap flavorMap = SystemFlavorMap.getDefaultFlavorMap ();
private transient DragSourceListener dragSourceListener;
private transient DragSourceMotionListener dragSourceMotionListener;
-
+
private static DragSource ds;
private DragSourceContextPeer peer;
private DragSourceContext context;
@@ -95,7 +95,7 @@ public class DragSource implements Serializable
/**
* Gets the default drag source.
- *
+ *
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*/
public static DragSource getDefaultDragSource()
@@ -139,14 +139,14 @@ public class DragSource implements Serializable
// This function sends the same message to the context, which then forwards
// it to the peer, passing itself as a parameter. Now, the native system has
// access to the Transferable through the context.
-
+
try
{
flavorMap = map;
-
+
if (peer == null)
peer = Toolkit.getDefaultToolkit().createDragSourceContextPeer(trigger);
-
+
if (context == null)
context = createDragSourceContext(peer, trigger,
dragCursor,
@@ -210,7 +210,7 @@ public class DragSource implements Serializable
/**
* Creates the DragSourceContext to handle this drag.
*
- * @exception IllegalArgumentException
+ * @exception IllegalArgumentException
* @exception NullPointerException If dscp, dgl, dragImage or t is null.
*/
protected DragSourceContext
@@ -225,16 +225,16 @@ public class DragSource implements Serializable
{
return flavorMap;
}
-
+
public <T extends DragGestureRecognizer> T
- createDragGestureRecognizer(Class<T> recognizer,
- Component c,
- int actions,
- DragGestureListener dgl)
+ createDragGestureRecognizer(Class<T> recognizer,
+ Component c,
+ int actions,
+ DragGestureListener dgl)
{
return (T) Toolkit.getDefaultToolkit().createDragGestureRecognizer(recognizer,
- this, c,
- actions, dgl);
+ this, c,
+ actions, dgl);
}
public DragGestureRecognizer createDefaultDragGestureRecognizer(Component c,
@@ -301,20 +301,20 @@ public class DragSource implements Serializable
{
if (listenerType == DragSourceListener.class)
return DnDEventMulticaster.getListeners (dragSourceListener,
- listenerType);
+ listenerType);
if (listenerType == DragSourceMotionListener.class)
return DnDEventMulticaster.getListeners (dragSourceMotionListener,
- listenerType);
+ listenerType);
// Return an empty EventListener array.
return (T[]) new EventListener [0];
}
-
+
/**
* TODO
* @return TODO
- *
+ *
* @since 1.5
*/
public static int getDragThreshold()
diff --git a/java/awt/dnd/DragSourceContext.java b/java/awt/dnd/DragSourceContext.java
index ed1cbaa44..e21b4fdae 100644
--- a/java/awt/dnd/DragSourceContext.java
+++ b/java/awt/dnd/DragSourceContext.java
@@ -72,7 +72,7 @@ public class DragSourceContext
private int sourceActions;
private Image image;
private Point offset;
-
+
/**
* Initializes a drag source context.
*
@@ -81,13 +81,13 @@ public class DragSourceContext
* or if the source actions for the DragGestureRecognizer associated with the
* trigger event are equal to DnDConstants.ACTION_NONE.
* @exception NullPointerException If peer, trans or trigger is null or if the
- * image is not null but the offset is.
+ * image is not null but the offset is.
*/
public DragSourceContext (DragSourceContextPeer peer,
DragGestureEvent trigger, Cursor cursor,
Image image, Point offset, Transferable trans,
DragSourceListener dsl)
- {
+ {
if (peer == null
|| trigger == null || trans == null
|| (image != null && offset == null))
@@ -108,7 +108,7 @@ public class DragSourceContext
this.transferable = trans;
this.dragSourceListener = dsl;
this.sourceActions = trigger.getSourceAsDragGestureRecognizer().getSourceActions();
-
+
setCursor(cursor);
updateCurrentCursor(trigger.getDragAction(), sourceActions, DEFAULT);
}
@@ -116,7 +116,7 @@ public class DragSourceContext
/**
* Returns the DragSource object associated with the
* DragGestureEvent.
- *
+ *
* @return the DragSource associated with the trigger.
*/
public DragSource getDragSource()
@@ -126,7 +126,7 @@ public class DragSourceContext
/**
* Returns the component associated with this.
- *
+ *
* @return the component associated with the trigger.
*/
public Component getComponent()
@@ -136,7 +136,7 @@ public class DragSourceContext
/**
* Gets the trigger associated with this.
- *
+ *
* @return the trigger.
*/
public DragGestureEvent getTrigger()
@@ -146,7 +146,7 @@ public class DragSourceContext
/**
* Returns the source actions for the DragGestureRecognizer.
- *
+ *
* @return the source actions for DragGestureRecognizer.
*/
public int getSourceActions()
@@ -158,7 +158,7 @@ public class DragSourceContext
/**
* Sets the cursor for this drag operation to the specified cursor.
- *
+ *
* @param cursor c - the Cursor to use, or null to use the default drag
* cursor.
*/
@@ -175,7 +175,7 @@ public class DragSourceContext
/**
* Returns the current cursor or null if the default
* drag cursor is used.
- *
+ *
* @return the current cursor or null.
*/
public Cursor getCursor()
@@ -215,57 +215,57 @@ public class DragSourceContext
/**
* Calls dragEnter on the listeners registered with this
* and with the DragSource.
- *
+ *
* @param e - the DragSourceDragEvent
*/
public void dragEnter(DragSourceDragEvent e)
{
if (dragSourceListener != null)
dragSourceListener.dragEnter(e);
-
+
DragSource ds = getDragSource();
DragSourceListener[] dsl = ds.getDragSourceListeners();
for (int i = 0; i < dsl.length; i++)
dsl[i].dragEnter(e);
-
+
updateCurrentCursor(e.getDropAction(), e.getTargetActions(), ENTER);
}
/**
* Calls dragOver on the listeners registered with this
* and with the DragSource.
- *
+ *
* @param e - the DragSourceDragEvent
*/
public void dragOver(DragSourceDragEvent e)
{
if (dragSourceListener != null)
dragSourceListener.dragOver(e);
-
+
DragSource ds = getDragSource();
DragSourceListener[] dsl = ds.getDragSourceListeners();
for (int i = 0; i < dsl.length; i++)
dsl[i].dragOver(e);
-
+
updateCurrentCursor(e.getDropAction(), e.getTargetActions(), OVER);
}
-
+
/**
* Calls dragExit on the listeners registered with this
* and with the DragSource.
- *
+ *
* @param e - the DragSourceEvent
*/
public void dragExit(DragSourceEvent e)
{
if (dragSourceListener != null)
dragSourceListener.dragExit(e);
-
+
DragSource ds = getDragSource();
DragSourceListener[] dsl = ds.getDragSourceListeners();
for (int i = 0; i < dsl.length; i++)
dsl[i].dragExit(e);
-
+
updateCurrentCursor(DnDConstants.ACTION_NONE, DnDConstants.ACTION_NONE,
DEFAULT);
}
@@ -273,33 +273,33 @@ public class DragSourceContext
/**
* Calls dropActionChanged on the listeners registered with this
* and with the DragSource.
- *
+ *
* @param e - the DragSourceDragEvent
*/
public void dropActionChanged(DragSourceDragEvent e)
{
if (dragSourceListener != null)
dragSourceListener.dropActionChanged(e);
-
+
DragSource ds = getDragSource();
DragSourceListener[] dsl = ds.getDragSourceListeners();
for (int i = 0; i < dsl.length; i++)
dsl[i].dropActionChanged(e);
-
+
updateCurrentCursor(e.getDropAction(), e.getTargetActions(), CHANGED);
}
/**
* Calls dragDropEnd on the listeners registered with this
* and with the DragSource.
- *
+ *
* @param e - the DragSourceDropEvent
*/
public void dragDropEnd(DragSourceDropEvent e)
{
if (dragSourceListener != null)
dragSourceListener.dragDropEnd(e);
-
+
DragSource ds = getDragSource();
DragSourceListener[] dsl = ds.getDragSourceListeners();
for (int i = 0; i < dsl.length; i++)
@@ -308,7 +308,7 @@ public class DragSourceContext
/**
* Calls dragMouseMoved on the listeners registered with the DragSource.
- *
+ *
* @param e - the DragSourceDragEvent
*/
public void dragMouseMoved(DragSourceDragEvent e)
@@ -321,7 +321,7 @@ public class DragSourceContext
/**
* Returns the Transferable set with this object.
- *
+ *
* @return the transferable.
*/
public Transferable getTransferable()
@@ -333,7 +333,7 @@ public class DragSourceContext
* This function sets the drag cursor for the specified operation, actions and
* status if the default drag cursor is active. Otherwise, the cursor is not
* updated in any way.
- *
+ *
* @param dropOp - the current operation.
* @param targetAct - the supported actions.
* @param status - the status of the cursor (constant).
@@ -370,7 +370,7 @@ public class DragSourceContext
newCursor = DragSource.DefaultCopyDrop;
}
}
-
+
if (cursor == null || ! cursor.equals(newCursor))
{
cursor = newCursor;
diff --git a/java/awt/dnd/DragSourceDropEvent.java b/java/awt/dnd/DragSourceDropEvent.java
index 7621262d8..4df984994 100644
--- a/java/awt/dnd/DragSourceDropEvent.java
+++ b/java/awt/dnd/DragSourceDropEvent.java
@@ -60,7 +60,7 @@ public class DragSourceDropEvent extends DragSourceEvent
this.dropAction = 0;
this.dropSuccess = false;
}
-
+
public DragSourceDropEvent (DragSourceContext context, int dropAction,
boolean dropSuccess)
{
diff --git a/java/awt/dnd/DragSourceEvent.java b/java/awt/dnd/DragSourceEvent.java
index c5cd42a4e..c9e18d712 100644
--- a/java/awt/dnd/DragSourceEvent.java
+++ b/java/awt/dnd/DragSourceEvent.java
@@ -50,7 +50,7 @@ public class DragSourceEvent extends EventObject
* Compatible with JDK 1.2+
*/
private static final long serialVersionUID = -763287114604032641L;
-
+
private final boolean locationSpecified;
private final int x;
private final int y;
diff --git a/java/awt/dnd/DropTarget.java b/java/awt/dnd/DropTarget.java
index 63be5ac04..e5180d074 100644
--- a/java/awt/dnd/DropTarget.java
+++ b/java/awt/dnd/DropTarget.java
@@ -1,4 +1,4 @@
-/* DropTarget.java --
+/* DropTarget.java --
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -164,7 +164,7 @@ public class DropTarget
private DropTargetListener dropTargetListener;
private DropTarget.DropTargetAutoScroller autoscroller;
private boolean active = true;
-
+
/**
* Creates a <code>DropTarget</code> object.
*
@@ -175,7 +175,7 @@ public class DropTarget
{
this (null, DnDConstants.ACTION_COPY_OR_MOVE, null, true, null);
}
-
+
/**
* Creates a <code>DropTarget</code> object.
*
@@ -186,7 +186,7 @@ public class DropTarget
{
this (c, DnDConstants.ACTION_COPY_OR_MOVE, dtl, true, null);
}
-
+
/**
* Creates a <code>DropTarget</code> object.
*
@@ -197,7 +197,7 @@ public class DropTarget
{
this (c, i, dtl, true, null);
}
-
+
/**
* Creates a <code>DropTarget</code> object.
*
@@ -208,7 +208,7 @@ public class DropTarget
{
this (c, i, dtl, b, null);
}
-
+
/**
* Creates a <code>DropTarget</code> object.
*
@@ -224,14 +224,14 @@ public class DropTarget
setComponent(c);
setDefaultActions(i);
dropTargetListener = dtl;
-
+
if (fm == null)
flavorMap = SystemFlavorMap.getDefaultFlavorMap();
else
flavorMap = fm;
-
+
setActive (b);
-
+
if (c != null)
c.setDropTarget(this);
}
@@ -284,7 +284,7 @@ public class DropTarget
/**
* Adds a new <code>DropTargetListener</code>.
- *
+ *
* @exception TooManyListenersException Sun's JDK does not, despite
* documentation, throw this exception here when you install an additional
* <code>DropTargetListener</code>. So to be compatible, we do the same
@@ -295,13 +295,13 @@ public class DropTarget
{
if (dtl == null)
return;
-
+
if (dtl.equals(this))
throw new IllegalArgumentException();
-
+
if (dropTargetListener != null)
throw new TooManyListenersException();
-
+
dropTargetListener = dtl;
}
@@ -397,7 +397,7 @@ public class DropTarget
{
if (dropTargetContext == null)
dropTargetContext = createDropTargetContext ();
-
+
return dropTargetContext;
}
@@ -405,7 +405,7 @@ public class DropTarget
{
if (dropTargetContext == null)
dropTargetContext = new DropTargetContext (this);
-
+
return dropTargetContext;
}
diff --git a/java/awt/dnd/DropTargetContext.java b/java/awt/dnd/DropTargetContext.java
index d970e2e08..4c21a6e8a 100644
--- a/java/awt/dnd/DropTargetContext.java
+++ b/java/awt/dnd/DropTargetContext.java
@@ -66,7 +66,7 @@ public class DropTargetContext implements Serializable
this.transferable = t;
this.isLocal = local;
}
-
+
public DataFlavor[] getTransferDataFlavors()
{
return transferable.getTransferDataFlavors();
@@ -156,7 +156,7 @@ public class DropTargetContext implements Serializable
protected void rejectDrop ()
{
if (dtcp != null)
- dtcp.rejectDrop();
+ dtcp.rejectDrop();
}
protected DataFlavor[] getCurrentDataFlavors ()
@@ -181,7 +181,7 @@ public class DropTargetContext implements Serializable
*
* @exception InvalidDnDOperationException If a drag is not outstanding.
*/
- protected Transferable getTransferable()
+ protected Transferable getTransferable()
throws InvalidDnDOperationException
{
// FIXME: Implement this
diff --git a/java/awt/dnd/DropTargetDragEvent.java b/java/awt/dnd/DropTargetDragEvent.java
index 58feb4387..21c9e2b35 100644
--- a/java/awt/dnd/DropTargetDragEvent.java
+++ b/java/awt/dnd/DropTargetDragEvent.java
@@ -89,10 +89,10 @@ public class DropTargetDragEvent extends DropTargetEvent
| DnDConstants.ACTION_COPY_OR_MOVE
| DnDConstants.ACTION_LINK
| DnDConstants.ACTION_REFERENCE;
-
+
if (~(srcActions ^ srcActionsMask) != 0)
throw new IllegalArgumentException ();
-
+
this.dropAction = dropAction;
this.srcActions = srcActions;
this.location = location;
@@ -107,12 +107,12 @@ public class DropTargetDragEvent extends DropTargetEvent
{
return context.getCurrentDataFlavors ();
}
-
+
public List<DataFlavor> getCurrentDataFlavorsAsList ()
{
return context.getCurrentDataFlavorsAsList ();
}
-
+
public int getDropAction()
{
return dropAction & ((DropTargetContext) source).getTargetActions();
@@ -137,12 +137,12 @@ public class DropTargetDragEvent extends DropTargetEvent
{
context.rejectDrag ();
}
-
+
/**
* TODO
- *
+ *
* @return
- *
+ *
* @since 1.5
*/
public Transferable getTransferable()
diff --git a/java/awt/dnd/DropTargetDropEvent.java b/java/awt/dnd/DropTargetDropEvent.java
index dd85ef712..333f8c6cc 100644
--- a/java/awt/dnd/DropTargetDropEvent.java
+++ b/java/awt/dnd/DropTargetDropEvent.java
@@ -56,7 +56,7 @@ public class DropTargetDropEvent extends DropTargetEvent
private final int actions;
private final Point location;
private final boolean isLocalTx;
-
+
/**
* Initializes a <code>DropTargetDropEvent</code>. By default this constructor
* assumes that the target is not int same JVM.
@@ -103,16 +103,16 @@ public class DropTargetDropEvent extends DropTargetEvent
| DnDConstants.ACTION_COPY_OR_MOVE
| DnDConstants.ACTION_LINK
| DnDConstants.ACTION_REFERENCE;
-
+
if (~(actions ^ actionsMask) != 0)
throw new IllegalArgumentException();
-
+
this.dropAction = dropAction;
this.actions = actions;
this.location = location;
this.isLocalTx = isLocalTx;
}
-
+
public Point getLocation()
{
return location;
diff --git a/java/awt/dnd/DropTargetEvent.java b/java/awt/dnd/DropTargetEvent.java
index cb2aec640..fc599a9e2 100644
--- a/java/awt/dnd/DropTargetEvent.java
+++ b/java/awt/dnd/DropTargetEvent.java
@@ -1,4 +1,4 @@
-/* DropTarget.java --
+/* DropTarget.java --
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -54,7 +54,7 @@ public class DropTargetEvent extends EventObject
super (context);
this.context = context;
}
-
+
public DropTargetContext getDropTargetContext ()
{
return context;
diff --git a/java/awt/dnd/MouseDragGestureRecognizer.java b/java/awt/dnd/MouseDragGestureRecognizer.java
index 9a2a7bc4c..08a2ac085 100644
--- a/java/awt/dnd/MouseDragGestureRecognizer.java
+++ b/java/awt/dnd/MouseDragGestureRecognizer.java
@@ -45,7 +45,7 @@ import java.awt.event.MouseMotionListener;
/**
* @author Michael Koch (konqueror@gmx.de)
*/
-public abstract class MouseDragGestureRecognizer
+public abstract class MouseDragGestureRecognizer
extends DragGestureRecognizer
implements MouseListener, MouseMotionListener
{
@@ -53,7 +53,7 @@ public abstract class MouseDragGestureRecognizer
* Creates a <code>MouseDragGestureRecognizer</code> object.
*/
protected MouseDragGestureRecognizer (DragSource ds, Component c, int act,
- DragGestureListener dgl)
+ DragGestureListener dgl)
{
super (ds, c, act, dgl);
}
diff --git a/java/awt/dnd/peer/DropTargetContextPeer.java b/java/awt/dnd/peer/DropTargetContextPeer.java
index 6eae29b38..2f4da5ff3 100644
--- a/java/awt/dnd/peer/DropTargetContextPeer.java
+++ b/java/awt/dnd/peer/DropTargetContextPeer.java
@@ -45,11 +45,11 @@ import java.awt.dnd.InvalidDnDOperationException;
/**
- * Used to control state of recipient protocol from the
+ * Used to control state of recipient protocol from the
* <code>DropTargetListener</code>. Occurs when a <code>Component</code>
- * with an associated <code>DropTarget</code> and visible geometry is first
+ * with an associated <code>DropTarget</code> and visible geometry is first
* intersected by a logical cursor.
- *
+ *
* @author Michael Koch (konqueror@gmx.de)
*/
public interface DropTargetContextPeer