Skip to content

Commit 2fa9c91

Browse files
committed
fixes for DND, JColorChooser, JSFileBytes, J2SInterface, j2sApplet,
j2sClazz
1 parent 037c120 commit 2fa9c91

File tree

14 files changed

+1425
-1366
lines changed

14 files changed

+1425
-1366
lines changed
375 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/java/awt/datatransfer/DataFlavor.java

Lines changed: 1350 additions & 1345 deletions
Large diffs are not rendered by default.

sources/net.sf.j2s.java.core/src/java/lang/Class.java

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,15 +646,46 @@ public String getName() {
646646
private transient String name;
647647

648648
private String getName0() {
649-
/**
650-
* @j2sNative return this.$clazz$.__CLASS_NAME$__ || this.$clazz$.__CLASS_NAME__;
649+
String code = "";
651650

651+
/**
652+
* @j2sNative
653+
*
654+
* code = this.$clazz$.__CLASS_NAME$__ ||
655+
* this.$clazz$.__CLASS_NAME__;
656+
*
657+
* if (code) return code;
658+
*
659+
* code = this.$clazz$.__PARAMCODE;
660+
*
652661
*/
653-
{
662+
663+
switch (code) {
664+
case "S":
665+
code = "String";
666+
break;
667+
case "I":
668+
code = "Integer";
669+
break;
670+
case "H":
671+
code = "Short";
672+
break;
673+
case "B":
674+
code = "Byte";
675+
break;
676+
case "L":
677+
code = "Long";
678+
break;
679+
case "C":
680+
code = "Character";
681+
break;
682+
default:
654683
return null;
655684
}
656-
}
685+
return "java.lang." + code;
657686

687+
}
688+
658689
/**
659690
* Returns the class loader for the class. Some implementations may use null
660691
* to represent the bootstrap class loader. This method will return null in

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
*
6060
* SwingJS note:
6161
*
62-
* This class in JavaScript will run a modal dialog that will initially return
62+
* This class in JavaScript will run a modal dialog that will initially
63+
* return
6364
* an instance of JColorChooser.ASYNCHRONOUS_COLOR, testable as ret instanceof
6465
* javax.swing.UIResource if the parent component implements
6566
* PropertyChangeListener, or null if not. The final result of color selection

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343

4444
import javax.swing.plaf.UIResource;
4545

46+
import swingjs.JSUtil;
47+
import swingjs.plaf.JSComponentUI;
48+
4649
// BH: Added rootPane.addNotify(); // builds a peer for the root pane
4750

4851
/**

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
import java.awt.event.WindowEvent;
4343
//
4444

45+
import swingjs.JSUtil;
46+
import swingjs.plaf.JSComponentUI;
47+
4548
//BH: Added rootPane.addNotify(); // builds a peer for the root pane
4649

4750
/**

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
import java.awt.Window;
4040
import java.awt.event.WindowListener;
4141

42+
import swingjs.JSUtil;
43+
import swingjs.plaf.JSComponentUI;
44+
4245

4346
//
4447

@@ -264,11 +267,11 @@ public JWindow(Window owner, GraphicsConfiguration gc) {
264267
protected void windowInit() {
265268
setLocale(JComponent.getDefaultLocale());
266269
setRootPane(createRootPane());
267-
rootPane.setFrameViewer(setFrameViewer(null));
270+
rootPane.setFrameViewer(setFrameViewer(null));
268271
setRootPaneCheckingEnabled(true);
269272
uiClassID = "WindowUI";
270273
updateUI();
271-
addNotify(); // BH added; applet will not do this automatically
274+
addNotify(); // BH added; applet will not do this automatically
272275
rootPane.addNotify(); // builds a peer for the root pane
273276
}
274277

sources/net.sf.j2s.java.core/src/swingjs/JSFileBytes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
public class JSFileBytes extends File {
66

7-
private byte[] bytes;
7+
private byte[] _bytes;
88

99
public JSFileBytes(String name, byte[] data) {
1010
super(name);
11-
bytes = data;
11+
_bytes = data;
1212
}
1313

1414
public byte[] getData() {
15-
return bytes;
15+
return _bytes;
1616
}
1717

1818
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ void _readyCallback(String appId, String fullId, boolean isReady,
3131
Object _getFileData(String fileName, Object fSuccess, boolean doProcess, boolean isBinary);
3232

3333
void _setDraggable(DOMNode tagNode, Object targetNodeOrFDown);
34+
35+
void _setDragDropTarget(Object domNode);
3436

3537
int _setWindowZIndex(DOMNode domNode, int pos);
3638

sources/net.sf.j2s.java.core/src/swingjs/jquery/JQueryUI.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)