Skip to content

Commit abe06ab

Browse files
committed
J2S._version = "3.1.2_2018.06.22
// first attempt to add JDeskTopPane
1 parent 98e8b22 commit abe06ab

File tree

10 files changed

+2574
-23
lines changed

10 files changed

+2574
-23
lines changed
6.15 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
J2S._version = "3.1.2_2018.06.22
2+
// first attempt to add JDeskTopPane

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,6 +3972,7 @@ final void decreaseComponentCount(Component c) {
39723972
// return super.getOpaqueShape();
39733973
// }
39743974

3975+
39753976
// final void recursiveSubtractAndApplyShape(Region shape) {
39763977
// recursiveSubtractAndApplyShape(shape, getTopmostComponentIndex(), getBottommostComponentIndex());
39773978
// }

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import java.awt.peer.ComponentPeer;
3131
import java.beans.PropertyChangeListener;
3232

33+
import javax.swing.ArrayTable;
3334
import javax.swing.JComponent;
3435
import javax.swing.UIDefaults;
3536
import javax.swing.UIManager;
@@ -282,4 +283,16 @@ public boolean isBackgroundSet() {
282283
// !isBackgroundPainted);
283284
}
284285

286+
protected transient ArrayTable clientProperties;
287+
288+
public Object getClientProperty(Object key) {
289+
if (clientProperties == null) {
290+
return null;
291+
} else {
292+
synchronized (clientProperties) {
293+
return clientProperties.get(key);
294+
}
295+
}
296+
}
297+
285298
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ public Toolkit getToolkit() {
11991199
* @return the warning string for this window.
12001200
* @see java.lang.SecurityManager#checkTopLevelWindow(java.lang.Object)
12011201
*/
1202-
public final String getWarningString() {
1202+
public String getWarningString() {
12031203
return warningString;
12041204
}
12051205

@@ -2243,7 +2243,7 @@ public Set<AWTKeyStroke> getFocusTraversalKeys(int id) {
22432243
* @see Container#getFocusTraversalPolicy
22442244
* @since 1.4
22452245
*/
2246-
public final void setFocusCycleRoot(boolean focusCycleRoot) {
2246+
public void setFocusCycleRoot(boolean focusCycleRoot) {
22472247
}
22482248

22492249
/**
@@ -2257,7 +2257,7 @@ public final void setFocusCycleRoot(boolean focusCycleRoot) {
22572257
* @since 1.4
22582258
*/
22592259
@Override
2260-
public final boolean isFocusCycleRoot() {
2260+
public boolean isFocusCycleRoot() {
22612261
return true;
22622262
}
22632263

@@ -2270,7 +2270,7 @@ public final boolean isFocusCycleRoot() {
22702270
* @since 1.4
22712271
*/
22722272
@Override
2273-
public final Container getFocusCycleRootAncestor() {
2273+
public Container getFocusCycleRootAncestor() {
22742274
return null;
22752275
}
22762276

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* @author Scott Violet
4444
*/
4545
@SuppressWarnings({"rawtypes", "unchecked"})
46-
class ArrayTable implements Cloneable {
46+
public class ArrayTable implements Cloneable { // public needed for JSComponent
4747
// Our field for storage
4848
private Object table = null;
4949
private static final int ARRAY_BOUNDARY = 8;

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public abstract class JComponent extends Container {
216216
/** A list of event listeners for this component. */
217217
protected EventListenerList listenerList = new EventListenerList();
218218

219-
private transient ArrayTable clientProperties;
219+
protected transient ArrayTable clientProperties;
220220
// private VetoableChangeSupport vetoableChangeSupport;
221221
/**
222222
* Whether or not autoscroll has been enabled.
@@ -3331,19 +3331,21 @@ private ArrayTable getClientProperties() {
33313331
* @return the value of this property or <code>null</code>
33323332
* @see #putClientProperty
33333333
*/
3334-
public final Object getClientProperty(Object key) {
3334+
public /* SwingJS final*/ Object getClientProperty(Object key) {
3335+
// moved to java.awt.JSComponent
3336+
return super.getClientProperty(key);
33353337
// if (key == SwingUtilities2.AA_TEXT_PROPERTY_KEY) {
33363338
// return aaTextInfo;
33373339
// } else if (key == SwingUtilities2.COMPONENT_UI_PROPERTY_KEY) {
33383340
// return ui;
33393341
// }
3340-
if (clientProperties == null) {
3341-
return null;
3342-
} else {
3343-
synchronized (clientProperties) {
3344-
return clientProperties.get(key);
3345-
}
3346-
}
3342+
// if (clientProperties == null) {
3343+
// return null;
3344+
// } else {
3345+
// synchronized (clientProperties) {
3346+
// return clientProperties.get(key);
3347+
// }
3348+
// }
33473349
}
33483350

33493351
/**

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,16 +399,21 @@ public void setLayer(Component c, int layer, int position) {
399399
* @param c the Component to check
400400
* @return an int specifying the component's current layer
401401
*/
402-
public int getLayer(Component c) {
402+
public static int getLayer(Component c) {
403403
Integer i;
404-
if(c instanceof JComponent)
405-
i = (Integer)((JComponent)c).getClientProperty(LAYER_PROPERTY);
406-
else
407-
i = (Integer)getComponentToLayer().get((Component)c);
408-
409-
if(i == null)
410-
return DEFAULT_LAYER.intValue();
411-
return i.intValue();
404+
if((i = (Integer)((JComponent) c).getClientProperty(LAYER_PROPERTY)) != null)
405+
return i.intValue();
406+
return DEFAULT_LAYER.intValue();
407+
//
408+
// Integer i;
409+
// if(c instanceof JComponent)
410+
// i = (Integer)((JComponent)c).getClientProperty(LAYER_PROPERTY);
411+
// else
412+
// i = (Integer)getComponentToLayer().get((Component)c);
413+
//
414+
// if(i == null)
415+
// return DEFAULT_LAYER.intValue();
416+
// return i.intValue();
412417
}
413418

414419
/**

0 commit comments

Comments
 (0)