You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/12/16 14:36:12 UTC

svn commit: r891233 - /incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java

Author: gbrown
Date: Wed Dec 16 13:36:12 2009
New Revision: 891233

URL: http://svn.apache.org/viewvc?rev=891233&view=rev
Log:
Resolve issue PIVOT-362.

Modified:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java?rev=891233&r1=891232&r2=891233&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java Wed Dec 16 13:36:12 2009
@@ -760,13 +760,17 @@
                     @Override
                     public DropAction dragMove(Component component, Manifest dragContent,
                         int supportedDropActions, int x, int y, DropAction userDropAction) {
-                        return (dragContent.containsImage() ? DropAction.MOVE : null);
+                        ImageView imageView = (ImageView)component;
+                        return (imageView.getImage() == null
+                            && dragContent.containsImage() ? DropAction.MOVE : null);
                     }
 
                     @Override
                     public DropAction userDropActionChange(Component component, Manifest dragContent,
                         int supportedDropActions, int x, int y, DropAction userDropAction) {
-                        return (dragContent.containsImage() ? DropAction.MOVE : null);
+                        ImageView imageView = (ImageView)component;
+                        return (imageView.getImage() == null
+                            && dragContent.containsImage() ? DropAction.MOVE : null);
                     }
 
                     @Override
@@ -774,8 +778,9 @@
                         int supportedDropActions, int x, int y, DropAction userDropAction) {
                         DropAction dropAction = null;
 
-                        if (dragContent.containsImage()) {
-                            ImageView imageView = (ImageView)component;
+                        ImageView imageView = (ImageView)component;
+                        if (imageView.getImage() == null
+                            && dragContent.containsImage()) {
                             try {
                                 imageView.setImage(dragContent.getImage());
                                 dropAction = DropAction.MOVE;