Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified sources/net.sf.j2s.core/dist/swingjs/SwingJS-site.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20190315122942
20190316185356
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/SwingJS-site.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20190315122942
20190316185356
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
15 changes: 13 additions & 2 deletions sources/net.sf.j2s.java.core/src/java/awt/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,13 @@ protected void addImpl(Component comp, Object constraints, int index) {
addImplCont(comp, constraints, index);
}

@SuppressWarnings("unused")
protected void addImplCont(Component comp, Object constraints, int index) {
synchronized (getTreeLock()) {


if (/** @j2sNative comp.getWrap$ && !this.isWrapper$ || */ false) {
comp = ((A2SWrappedComponent) comp).getWrap$();
}
// SwingJS used for all add methods

/*
Expand Down Expand Up @@ -1246,8 +1250,15 @@ public void remove(int index) {
* @see #validate
* @see #remove(int)
*/
public void remove(Component comp) {
@SuppressWarnings("unused")
public void remove(Component comp) {
synchronized (getTreeLock()) {

if (/** @j2sNative comp.getWrap$ && !this.isWrapper$ || */ false) {
comp = ((A2SWrappedComponent) comp).getWrap$();
}


if (comp.parent == this) {
int index = component.indexOf(comp);
if (index >= 0) {
Expand Down
27 changes: 26 additions & 1 deletion sources/net.sf.j2s.java.core/src/java/awt/JSComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
*/
package java.awt;

import java.applet.JSApplet;
import java.awt.event.KeyListener;
import java.awt.peer.ComponentPeer;
import java.beans.PropertyChangeListener;
Expand Down Expand Up @@ -67,6 +66,32 @@
*/
public abstract class JSComponent extends Component {

/**
* A marker for the SwingJS version of JViewPort to indicate that it
* can add an A2SWrappedComponent, not pass it back for wrapping.
*
* @author hansonr
*
*/
public interface A2SComponentWrapper {

public void isWrapper$();
}

/**
* For JViewPort.
*
* Implementations of java.awt.List require a JScrollPane/JViewPort
* wrapper.
*
* @author hansonr
*
*/
public interface A2SWrappedComponent {

public Component getWrap$();

}
/**
* overridden in Applet
*
Expand Down
9 changes: 8 additions & 1 deletion sources/net.sf.j2s.java.core/src/java/awt/JSDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
package java.awt;

import java.awt.Dialog.ModalityType;
import java.awt.event.ComponentEvent;
import java.awt.event.HierarchyEvent;
import java.awt.event.WindowEvent;
Expand All @@ -35,6 +36,8 @@
import java.util.ArrayList;
import java.util.Iterator;

import swingjs.plaf.JSDialogUI;

/**
* A Dialog is a top-level window with a title and a border
* that is typically used to take some form of input from the user.
Expand Down Expand Up @@ -839,10 +842,14 @@ private boolean conditionalShow(Component toFocus, Long time) {

closeSplashScreen();

// synchronized (getTreeLock()) {
if (ui != null && ((JSDialogUI) ui).isDisposed)
addNotify();
// synchronized (getTreeLock()) {
// if (peer == null) {
// addNotify();
// }


validate();
if (visible) {
toFront();
Expand Down
6 changes: 5 additions & 1 deletion sources/net.sf.j2s.java.core/src/java/awt/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
//import java.util.logging.Logger;
import swingjs.JSUtil;
import swingjs.plaf.JSComponentUI;
import swingjs.plaf.JSWindowUI;

/**
*
Expand Down Expand Up @@ -842,7 +843,7 @@ public void printAll(Graphics g) {

@Override
public Dimension getPreferredSize() {
return preferredSizeContainer();
return preferredSize();// for AWT classes
}


Expand Down Expand Up @@ -890,6 +891,9 @@ public void setVisible(boolean b) {
@Override
@Deprecated
public void show() {

if (ui != null && ((JSWindowUI) ui).isDisposed)
addNotify();
// if (peer == null) {
// addNotify();
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ public Dimension getPreferredSize() {
public Dimension getPrefSizeJComp() {
Dimension size = (!isPreferredSizeSet() && ui != null ? ui
.getPreferredSize(this) : null);
return (size == null ? super.preferredSize() : size);
return (size == null ? preferredSize() : size);
}

/**
Expand Down
Loading