Skip to content

Commit d1d6fe1

Browse files
committed
fixes DND issues
1 parent f5aa55f commit d1d6fe1

File tree

11 files changed

+359
-355
lines changed

11 files changed

+359
-355
lines changed
-443 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/Component.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ public synchronized void setDropTarget(DropTarget dt) {
915915
DropTarget old;
916916

917917
if ((old = dropTarget) != null) {
918+
getOrCreatePeer();
918919
if (peer != null)
919920
dropTarget.removeNotify(peer);
920921

sources/net.sf.j2s.java.core/src/javax/swing/JDesktopPane.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@
8888
*/
8989
public class JDesktopPane extends JLayeredPane //implements Accessible
9090
{
91-
/**
92-
* @see #getUIClassID
93-
* @see #readObject
94-
*/
95-
private static final String uiClassID = "DesktopPaneUI";
9691

9792
transient DesktopManager desktopManager;
9893

@@ -126,7 +121,8 @@ public class JDesktopPane extends JLayeredPane //implements Accessible
126121
* Creates a new <code>JDesktopPane</code>.
127122
*/
128123
public JDesktopPane() {
129-
setUIProperty("opaque", Boolean.TRUE);
124+
super();
125+
initLayeredPane();
130126

131127
// SwingJS - no focus
132128
// setFocusCycleRoot(true);
@@ -144,9 +140,14 @@ public JDesktopPane() {
144140
// return comp;
145141
// }
146142
// });
147-
updateUI();
148143
}
149144

145+
protected void initLayeredPane() {
146+
uiClassID = "DesktopPaneUI";
147+
updateUI();
148+
setLayout(null);
149+
}
150+
150151
/**
151152
* Returns the L&F object that renders this component.
152153
*

sources/net.sf.j2s.java.core/src/javax/swing/JLayeredPane.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,17 @@ public class JLayeredPane extends JComponent /* implements Accessible */ {
192192
//////////////////////////////////////////////////////////////////////////////
193193
/** Create a new JLayeredPane */
194194
public JLayeredPane() {
195-
setLayout(null);
196-
uiClassID = "LayeredPaneUI";
197-
updateUI();
195+
super();
196+
initLayeredPane();
198197
}
199198

200-
private void validateOptimizedDrawing() {
199+
protected void initLayeredPane() {
200+
uiClassID = "LayeredPaneUI";
201+
updateUI();
202+
setLayout(null);
203+
}
204+
205+
private void validateOptimizedDrawing() {
201206
boolean layeredComponentFound = false;
202207
synchronized(getTreeLock()) {
203208
Integer layer = null;

sources/net.sf.j2s.java.core/src/swingjs/api/js/J2SInterface.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package swingjs.api.js;
22

3+
import java.awt.JSComponent;
34
import java.util.Hashtable;
45

56
import javajs.api.JSFunction;
@@ -32,7 +33,7 @@ void _readyCallback(String appId, String fullId, boolean isReady,
3233

3334
void _setDraggable(DOMNode tagNode, Object targetNodeOrFDown);
3435

35-
void _setDragDropTarget(Object domNode);
36+
void _setDragDropTarget(JSComponent target, DOMNode node, boolean adding);
3637

3738
int _setWindowZIndex(DOMNode domNode, int pos);
3839

0 commit comments

Comments
 (0)