Skip to content

Commit b2e359e

Browse files
hansonrhansonr
authored andcommitted
major upgrade for JComboBox, JList, and JToolTip
additions to core will be necessary?
1 parent 473e259 commit b2e359e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2728
-2584
lines changed
3.88 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190708084938
1+
20190710094824
3.88 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190708084938
1+
20190710094824
3.88 KB
Binary file not shown.

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import sun.awt.AppContext;
5151
import sun.awt.SunGraphicsCallback;
5252
import swingjs.JSFrameViewer;
53+
import swingjs.JSMouse;
5354
import swingjs.plaf.JSComponentUI;
5455

5556

@@ -3642,6 +3643,7 @@ public void addPropertyChangeListener(String propertyName,
36423643
super.addPropertyChangeListener(propertyName, listener);
36433644
}
36443645

3646+
36453647
// * --- Accessibility Support ---
36463648
// */
36473649
//
@@ -4337,7 +4339,7 @@ private boolean processMouseEvent(MouseEvent e) {
43374339

43384340
// sensitive to mouse events
43394341

4340-
Component mouseOver = targetLastKnown = nativeContainer.getMouseEventTarget(e.getX(), e.getY(), Container.INCLUDE_SELF);
4342+
Component mouseOver = nativeContainer.getMouseEventTarget(e.getX(), e.getY(), Container.INCLUDE_SELF);
43414343

43424344
trackMouseEnterExit(mouseOver, e);
43434345

@@ -4352,11 +4354,11 @@ private boolean processMouseEvent(MouseEvent e) {
43524354
actualTarget = targetLastKnown;
43534355
break;
43544356
default:
4355-
// see swingjs.plaf.JSButtionUI
4356-
actualTarget = (/** @j2sNative e.bdata.jqevent && e.bdata.jqevent.target["data-component"] || */
4357-
null);
4357+
actualTarget = JSMouse.getJ2SEventTarget(e);
43584358
break;
43594359
}
4360+
// SwingJS note: This was moved here 7/8/2019 from above.
4361+
targetLastKnown = (actualTarget == null ? mouseOver : actualTarget);
43604362

43614363
// 4508327 : MOUSE_CLICKED should only go to the recipient of
43624364
// the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
@@ -4372,6 +4374,8 @@ else if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
43724374
switch (id) {
43734375
case MouseEvent.MOUSE_ENTERED:
43744376
case MouseEvent.MOUSE_EXITED:
4377+
if (JSMouse.getJ2SEventTarget(e) == mouseEventTarget)
4378+
retargetMouseEvent(mouseEventTarget, id, e);
43754379
break;
43764380
case MouseEvent.MOUSE_PRESSED:
43774381
checkInternalFrameMouseDown((JSComponent) e.getSource());
@@ -4742,12 +4746,7 @@ void retargetMouseEvent(Component target, int id, MouseEvent e) {
47424746
}
47434747
} else {
47444748
target.dispatchEvent(retargeted);
4745-
/**
4746-
* @j2sNative
4747-
*
4748-
* if (e.bdata && e.bdata.jqevent && target.ui.j2sDoPropagate)
4749-
* e.bdata.jqevent.doPropagate = true;
4750-
*/
4749+
JSMouse.setPropagation(target, e);
47514750
}
47524751
}
47534752
}

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,10 @@ public boolean isFontSet() {
460460
JSComponent[] components = (JSComponent[]) 秘getChildArray((Container) this);
461461
int[] zorders = new int[n];
462462
for (int i = 0; i < n; i++)
463-
zorders[i] = components[i].秘getUI().getZIndex(null);
463+
zorders[i] = JSComponentUI.getInheritedZ((JComponent)components[i]);
464464
Arrays.sort(zorders);
465465
for (int i = 0; i < n; i++)
466-
components[i].秘getUI().setZOrder(zorders[n - 1 - i]);
466+
components[i].秘getUI().setZ(zorders[n - 1 - i]);
467467
}
468468

469469

@@ -712,5 +712,14 @@ protected boolean canPaint() {
712712
// return false;
713713
// }
714714

715-
715+
private boolean 秘isDesktop;
716+
717+
public void 秘setIsDesktop() {
718+
秘isDesktop = true;
719+
}
720+
721+
public boolean 秘isDesktop() {
722+
return 秘isDesktop;
723+
}
724+
716725
}

sources/net.sf.j2s.java.core/src/java/awt/event/InputEvent.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,11 @@
2828

2929
package java.awt.event;
3030

31-
import java.awt.Event;
3231
import java.awt.Component;
33-
//import java.awt.GraphicsEnvironment;
32+
import java.awt.Event;
3433
import java.awt.Toolkit;
35-
//import java.util.logging.Logger;
36-
//import java.util.logging.Level;
3734

38-
import javax.swing.JComponent;
39-
40-
import swingjs.JSToolkit;
41-
import swingjs.plaf.JSComponentUI;
35+
import swingjs.JSMouse;
4236

4337
/**
4438
* The root event class for all component-level input events.
@@ -352,14 +346,9 @@ public int getModifiersEx() {
352346
* Consumes this event so that it will not be processed in the default manner by
353347
* the source which originated it.
354348
*/
355-
@SuppressWarnings("unused")
356349
@Override
357350
public void consume() {
358-
JSComponentUI ui = ((JComponent) source).秘getUI();
359-
if (bdata != null && ui != null && ui.buttonListener == null
360-
&& ((/** @j2sNative !this.bdata.doPropagate || */false))) {
361-
JSToolkit.consumeEvent(this);
362-
}
351+
JSMouse.checkConsume(this);
363352
consumed = true;
364353
}
365354

0 commit comments

Comments
 (0)