Skip to content

Commit 5665196

Browse files
hansonrhansonr
authored andcommitted
misc fixes
adds move cursor for JSplitPane corrects EventDispatchThread miscoding adds dummy frame consideration for SwingUtilities.SharedOwnerFrame sets mouse click for multiple click from jqevent.originalEvent adds JSplitPane drag cursor on mouse move fixes JComboBox not being disabled fixes early setCursor before peer is created
1 parent 53772b2 commit 5665196

File tree

18 files changed

+108
-60
lines changed

18 files changed

+108
-60
lines changed
721 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181117145755
1+
20181117231441
721 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181117145755
1+
20181117231441
482 Bytes
Binary file not shown.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2884,7 +2884,8 @@ final void updateCursorImmediately() {
28842884
// cPeer.updateCursorImmediately();
28852885
// }
28862886
// } else if (peer != null) {
2887-
peer.updateCursorImmediately();
2887+
if (peer != null)
2888+
peer.updateCursorImmediately();
28882889
// }
28892890
}
28902891

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public void run() {
9696
}
9797
};
9898
JSThread me = this;
99-
JSFunction f = /** @j2sNative function() {r.run$();me.run1$I(mode)} || */ null;
10099
int mode = LOOP;
100+
JSFunction f = /** @j2sNative function() {r.run$();me.run1$I(mode)} || */ null;
101101
JSToolkit.dispatch(f, 0, 0);
102102
// handling sleepAndReturn myself
103103
// and once through only

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ public JFrame(String title, GraphicsConfiguration gc, String uiid) {
288288
rootPane.addNotify(); // builds a peer for the root pane
289289
}
290290

291+
public JFrame(Object object, Object object2, Object object3, Object object4) {
292+
uiClassID = "FrameUI";
293+
294+
}
295+
291296
private static int frameCount;
292297

293298
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ public static ActionMap getUIActionMap(JComponent component) {
17651765
static class SharedOwnerFrame extends JFrame implements WindowListener {
17661766

17671767
SharedOwnerFrame() {
1768-
super(); // required by SwingJS
1768+
super(null, null, null, null); // required by SwingJS
17691769
}
17701770

17711771
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ private void clicked(long time, int x, int y, int modifiers, int clickCount) {
183183
// clearKeyBuffer();
184184
// clickedCount is not reliable on some platforms
185185
// so we will just deal with it ourselves
186-
mouseAction(MouseEvent.MOUSE_CLICKED, time, x, y, 1, modifiers, 0);
186+
mouseAction(MouseEvent.MOUSE_CLICKED, time, x, y, clickCount, modifiers, 0);
187187
}
188188

189189
private boolean isCtrlShiftMouseDown; // Macintosh may not recognize CTRL-SHIFT-LEFT as
@@ -278,7 +278,7 @@ private void mouseAction(int id, long time, int x, int y, int xcount,
278278
extended == InputEvent.META_DOWN_MASK ||
279279
JSToolkit.isMac && extended == (InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK));
280280
int button = getButton(modifiers);
281-
int count = updateClickCount(id, time, x, y);
281+
int count = (xcount > 1 && id == MouseEvent.MOUSE_CLICKED ? xcount : updateClickCount(id, time, x, y));
282282

283283
Component source = viewer.getTopComponent(); // may be a JFrame
284284
MouseEvent e;

0 commit comments

Comments
 (0)