Skip to content

Commit 473e259

Browse files
hansonrhansonr
authored andcommitted
JComboBox total upgrade to j2scb JQuery widget; ContainerPeer set
correctly. JList key action implemented
1 parent c8e6a51 commit 473e259

Some content is hidden

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

60 files changed

+13781
-447
lines changed
123 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190706052225
1+
20190708084938
123 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20190706052225
1+
20190708084938

sources/net.sf.j2s.java.core/TODO.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2019.07.07 Why do we have to run rootPane.addNotify after init()?
2+
This is causing two full creations of components.
3+
14
2019.07.01 working on JSEditorPaneUI tab business
25
2019.07.01 AppContext.getApplet(name) initial work
36
2019.07.01 working on JTable key navigation events
123 KB
Binary file not shown.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5068,7 +5068,10 @@ protected final void disableEvents(long eventsToDisable) {
50685068
*/
50695069
transient private boolean coalescingEnabled = checkCoalescing();
50705070

5071-
public boolean 秘j2sInvalidateOnAdd = true; // not for menu items?
5071+
/**
5072+
* false only for menu items and menu separators
5073+
*/
5074+
public boolean 秘j2sInvalidateOnAdd = true;
50725075

50735076
/**
50745077
* Weak map of known coalesceEvent overriders. Value indicates whether
@@ -5865,6 +5868,7 @@ public void addNotify() {
58655868

58665869
// Update stacking order
58675870
if (parent != null && parent.peer != null) {
5871+
@SuppressWarnings("unused")
58685872
ContainerPeer parentContPeer = (ContainerPeer) parent.peer;
58695873
// if our parent is lightweight and we are not
58705874
// we should call restack on nearest heavyweight

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,8 @@ final Component[] getComponents_NoClientCode() {
362362
* @since JDK1.1
363363
*/
364364
public Insets getInsets() {
365-
// in SwingJS, we do not clone. Everything is a ContainerPeer.
366-
// it is inconsistent with other classes that this would need cloning.
367-
Insets i = (peer == null ? null : ((ContainerPeer) peer).getInsets());
368-
return (i == null ? NULL_INSETS : i);
365+
// Panel, ScrollPane, and Window only
366+
return (peer instanceof ContainerPeer ? this.秘getInsetsC() : NULL_INSETS);
369367
}
370368

371369
public Insets 秘getInsetsC() {
@@ -4678,7 +4676,7 @@ void retargetMouseEvent(Component target, int id, MouseEvent e) {
46784676

46794677
int x = e.getX(), y = e.getY();
46804678
Component component = target;
4681-
Component p = ((JSComponentUI) ((JSComponent) target).getUI()).getTargetParent();
4679+
Component p = ((JSComponent) target).秘getUI().getTargetParent();
46824680
if (p != null) {
46834681
target = component = p;
46844682
}

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ public interface A2SWrappedComponent {
114114
public HTML5Canvas 秘canvas;
115115
public ComponentUI ui; // from JComponent
116116

117+
public JSComponentUI 秘getUI() {
118+
return (JSComponentUI) ui;
119+
}
120+
117121
private String 秘uiClassID;
118122

119123
Boolean 秘peerVis;
@@ -132,8 +136,13 @@ public interface A2SWrappedComponent {
132136
*
133137
*/
134138
private int 秘iPaintMyself = PAINTS_SELF_UNKNOWN;
139+
private boolean 秘iPaintMyselfEntirely;
135140
private boolean 秘repaintAsUpdate = true;
136141
private static boolean 秘isRepaint = true;
142+
143+
public boolean 秘paintsSelfEntirely() {
144+
return 秘iPaintMyselfEntirely;
145+
}
137146

138147
protected static void 秘setIsRepaint(boolean b) {
139148
秘isRepaint = b;
@@ -451,10 +460,10 @@ public boolean isFontSet() {
451460
JSComponent[] components = (JSComponent[]) 秘getChildArray((Container) this);
452461
int[] zorders = new int[n];
453462
for (int i = 0; i < n; i++)
454-
zorders[i] = ((JSComponentUI) components[i].getUI()).getZIndex(null);
463+
zorders[i] = components[i].秘getUI().getZIndex(null);
455464
Arrays.sort(zorders);
456465
for (int i = 0; i < n; i++)
457-
((JSComponentUI) components[i].getUI()).setZOrder(zorders[n - 1 - i]);
466+
components[i].秘getUI().setZOrder(zorders[n - 1 - i]);
458467
}
459468

460469

@@ -614,10 +623,13 @@ public void removeKeyListener(KeyListener l) {
614623
// don't allow if JComponent.paint(Graphics) has been overridden
615624
// don't allow if AbstractBorder.paintBorder(...) has been overridden
616625
// unchecked here is if a class calls getGraphics outside of this context
617-
秘iPaintMyself = 秘setPaintsSelf(JSUtil.isOverridden(this, "paint$java_awt_Graphics", 秘paintClass)
618-
|| JSUtil.isOverridden(this, "paintComponent$java_awt_Graphics", /** @j2sNative javax.swing.JComponent || */null)
619-
|| JSUtil.isOverridden(this, "update$java_awt_Graphics", 秘updateClass)
620-
|| JSUtil.isOverridden(this, "paintContainer$java_awt_Graphics", /** @j2sNative java.awt.Container || */null)
626+
秘iPaintMyself = 秘setPaintsSelf(
627+
(秘iPaintMyselfEntirely = (
628+
JSUtil.isOverridden(this, "paint$java_awt_Graphics", 秘paintClass)
629+
|| JSUtil.isOverridden(this, "paintComponent$java_awt_Graphics", /** @j2sNative javax.swing.JComponent || */null)
630+
|| JSUtil.isOverridden(this, "update$java_awt_Graphics", 秘updateClass)
631+
|| JSUtil.isOverridden(this, "paintContainer$java_awt_Graphics", /** @j2sNative java.awt.Container || */null)
632+
))
621633
|| 秘paintsBorder() && JSUtil.isOverridden(秘border, "paintBorder$java_awt_Component$java_awt_Graphics$I$I$I$I",
622634
秘border.秘paintClass)
623635
? PAINTS_SELF_YES : PAINTS_SELF_NO);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,10 @@ public int getModifiersEx() {
352352
* Consumes this event so that it will not be processed in the default manner by
353353
* the source which originated it.
354354
*/
355+
@SuppressWarnings("unused")
355356
@Override
356357
public void consume() {
357-
JSComponentUI ui = (JSComponentUI) ((JComponent) source).getUI();
358+
JSComponentUI ui = ((JComponent) source).秘getUI();
358359
if (bdata != null && ui != null && ui.buttonListener == null
359360
&& ((/** @j2sNative !this.bdata.doPropagate || */false))) {
360361
JSToolkit.consumeEvent(this);

0 commit comments

Comments
 (0)