diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | examples/gnu/classpath/examples/awt/Demo.java | 3 | ||||
-rw-r--r-- | gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java | 63 |
3 files changed, 73 insertions, 9 deletions
@@ -1,3 +1,19 @@ +2006-07-19 Lillian Angel <langel@redhat.com> + + * examples/gnu/classpath/examples/awt/Demo.java + (DragDropWindow): Fixed typo in Label text. + * gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java + (GtkDragSourceContextPeer): Removed unneeded initialization for field. + (startDrag): Initialized context field. + (transferablesFlavorsChanged): Removed FIXME. Nothing is done in this + function. + (dragEnter): New function. + (dragExit): Likewise. + (dragDropEnd): Likewise. + (dragMouseMoved): Likewise. + (dragOver): Likewise. + (dragActionChanged): Likewise. + 2006-07-19 Raif S. Naffah <raif@swiftdsl.com.au> PR Classpath/26302 diff --git a/examples/gnu/classpath/examples/awt/Demo.java b/examples/gnu/classpath/examples/awt/Demo.java index 1ca09ff23..bd5e755cb 100644 --- a/examples/gnu/classpath/examples/awt/Demo.java +++ b/examples/gnu/classpath/examples/awt/Demo.java @@ -863,8 +863,7 @@ class Demo extends SubFrame implements ActionListener, DropTargetListener { - DragLabel source = new DragLabel( - "Drag and drop me to the following JButton", + DragLabel source = new DragLabel("Drag and drop me to the following Button", Label.CENTER); Button target = new Button(); diff --git a/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java b/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java index 6a5299201..4f9229822 100644 --- a/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java +++ b/gnu/java/awt/dnd/peer/gtk/GtkDragSourceContextPeer.java @@ -44,9 +44,11 @@ import java.awt.Component; import java.awt.Cursor; import java.awt.Image; import java.awt.Point; -import java.awt.Window; import java.awt.dnd.DragGestureEvent; import java.awt.dnd.DragSourceContext; +import java.awt.dnd.DragSourceDragEvent; +import java.awt.dnd.DragSourceDropEvent; +import java.awt.dnd.DragSourceEvent; import java.awt.dnd.InvalidDnDOperationException; import java.awt.dnd.peer.DragSourceContextPeer; import java.awt.peer.ComponentPeer; @@ -56,10 +58,9 @@ public class GtkDragSourceContextPeer extends GtkGenericPeer implements DragSourceContextPeer { - - private DragGestureEvent dge; private ComponentPeer peer; private Cursor cursor; + private DragSourceContext context; native void nativeStartDrag(Image i, int x, int y, int action, String target); native void connectSignals(ComponentPeer comp); @@ -69,11 +70,9 @@ public class GtkDragSourceContextPeer public GtkDragSourceContextPeer(DragGestureEvent e) { super(e.getComponent()); - dge = e; - Component comp = e.getComponent(); - peer = getComponentPeer(comp); + create(peer); connectSignals(peer); cursor = comp.getCursor(); @@ -93,6 +92,8 @@ public class GtkDragSourceContextPeer public void startDrag(DragSourceContext context, Cursor c, Image i, Point p) throws InvalidDnDOperationException { + this.context = context; + if (p == null) p = new Point(); @@ -120,6 +121,54 @@ public class GtkDragSourceContextPeer public void transferablesFlavorsChanged() { - // FIXME: Not Implemented + // Nothing to do here. + } + + /** + * Called from native code. + */ + + public void dragEnter(int action, int modifiers) + { + context.dragEnter(new DragSourceDragEvent(context, action, + action + & context.getSourceActions(), + modifiers)); + } + + public void dragExit(int action, int x, int y) + { + context.dragExit(new DragSourceEvent(context, x, y)); + } + + public void dragDropEnd(int action, boolean success, int x, int y) + { + context.dragDropEnd(new DragSourceDropEvent(context, action, success, x, y)); + } + + public void dragMouseMoved(int action, int modifiers) + { + context.dragMouseMoved(new DragSourceDragEvent(context, + action, + action + & context.getSourceActions(), + modifiers)); + } + + public void dragOver(int action, int modifiers) + { + context.dragOver(new DragSourceDragEvent(context, action, + action + & context.getSourceActions(), + modifiers)); + } + + public void dragActionChanged(int newAction, int modifiers) + { + context.dropActionChanged(new DragSourceDragEvent(context, + newAction, + newAction + & context.getSourceActions(), + modifiers)); } } |