Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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 @@
20181114074826
20181117145755
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 @@
20181114074826
20181117145755
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
8 changes: 5 additions & 3 deletions sources/net.sf.j2s.java.core/src/java/awt/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -1450,9 +1450,11 @@ public void doLayout() {
@Deprecated
public void layout() {
// called by Component and Container
if (this.layoutMgr != null && this.width > 0 && this.height > 0) {
this.layoutMgr.layoutContainer(this);
}
// The reason we don't care about w&h is that
// we can be working just with preferences here.
// This is when getPreferredSize() is copied to getSize()
if (layoutMgr != null)//BH out 11/16/18 && this.width > 0 && this.height > 0) {
layoutMgr.layoutContainer(this);
}

/**
Expand Down
36 changes: 36 additions & 0 deletions sources/net.sf.j2s.java.core/src/java/awt/JSDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ public class JSDialog extends Window {
public JSDialog(JSFrame owner) {
this(owner, "", false);
}
public JSDialog(Frame owner) {
this(owner, "", false);
}

/**
* Constructs an initially invisible <code>Dialog</code> with the specified
Expand Down Expand Up @@ -256,6 +259,10 @@ public JSDialog(JSFrame owner, boolean modal) {
this(owner, "", modal);
}

public JSDialog(Frame owner, boolean modal) {
this(owner, "", modal);
}

/**
* Constructs an initially invisible, modeless <code>Dialog</code> with
* the specified owner <code>Frame</code> and title.
Expand All @@ -277,6 +284,10 @@ public JSDialog(JSFrame owner, String title) {
this(owner, title, false);
}

public JSDialog(Frame owner, String title) {
this(owner, title, false);
}

/**
* Constructs an initially invisible <code>Dialog</code> with the
* specified owner <code>Frame</code>, title and modality.
Expand Down Expand Up @@ -307,6 +318,10 @@ public JSDialog(JSFrame owner, String title, boolean modal) {
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS);
}

public JSDialog(Frame owner, String title, boolean modal) {
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS);
}

/**
* Constructs an initially invisible <code>Dialog</code> with the specified owner
* <code>Frame</code>, title, modality, and <code>GraphicsConfiguration</code>.
Expand Down Expand Up @@ -341,6 +356,11 @@ public JSDialog(JSFrame owner, String title, boolean modal,
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS, gc);
}

public JSDialog(Frame owner, String title, boolean modal,
GraphicsConfiguration gc) {
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS, gc);
}

/**
* Constructs an initially invisible, modeless <code>Dialog</code> with
* the specified owner <code>Dialog</code> and an empty title.
Expand All @@ -358,6 +378,10 @@ public JSDialog(JSDialog owner) {
this(owner, "", false);
}

public JSDialog(Dialog owner) {
this(owner, "", false);
}

/**
* Constructs an initially invisible, modeless <code>Dialog</code>
* with the specified owner <code>Dialog</code> and title.
Expand All @@ -378,6 +402,10 @@ public JSDialog(JSDialog owner, String title) {
this(owner, title, false);
}

public JSDialog(Dialog owner, String title) {
this(owner, title, false);
}

/**
* Constructs an initially invisible <code>Dialog</code> with the
* specified owner <code>Dialog</code>, title, and modality.
Expand Down Expand Up @@ -408,6 +436,10 @@ public JSDialog(JSDialog owner, String title, boolean modal) {
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS);
}

public JSDialog(Dialog owner, String title, boolean modal) {
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS);
}

/**
* Constructs an initially invisible <code>Dialog</code> with the
* specified owner <code>Dialog</code>, title, modality and
Expand Down Expand Up @@ -445,6 +477,10 @@ public JSDialog(JSDialog owner, String title, boolean modal,
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS, gc);
}

public JSDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc) {
this(owner, title, modal ? Dialog.DEFAULT_MODALITY_TYPE : Dialog.ModalityType.MODELESS, gc);
}

/**
* Constructs an initially invisible, modeless <code>Dialog</code> with the
* specified owner <code>Window</code> and an empty title.
Expand Down
16 changes: 16 additions & 0 deletions sources/net.sf.j2s.java.core/src/java/awt/Toolkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ public abstract class Toolkit {
* @see java.awt.peer.FramePeer
*/
protected abstract FramePeer createFrame(JSFrame target);
protected abstract FramePeer createFrame(Frame target);
//
// /**
// * Creates this toolkit's implementation of <code>Canvas</code> using
Expand Down Expand Up @@ -1177,6 +1178,9 @@ public abstract Image createImage(byte[] imagedata,
public abstract PrintJob getPrintJob(JSFrame frame, String jobtitle,
Properties props);

public abstract PrintJob getPrintJob(Frame frame, String jobtitle,
Properties props);

/**
* Gets a <code>PrintJob</code> object which is the result of initiating
* a print operation on the toolkit's platform.
Expand Down Expand Up @@ -1240,6 +1244,18 @@ public PrintJob getPrintJob(JSFrame frame, String jobtitle,
}
}

public PrintJob getPrintJob(Frame frame, String jobtitle,
JobAttributes jobAttributes,
PageAttributes pageAttributes) {
if (this != Toolkit.getDefaultToolkit()) {
return Toolkit.getDefaultToolkit().getPrintJob(frame, jobtitle,
jobAttributes,
pageAttributes);
} else {
return getPrintJob(frame, jobtitle, null);
}
}

//
// /**
// * Emits an audio beep.
Expand Down
14 changes: 7 additions & 7 deletions sources/net.sf.j2s.java.core/src/java/awt/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -1364,13 +1364,13 @@ boolean isModalBlocked() {
}

void setModalBlocked(JSDialog blocker, boolean blocked, boolean peerCall) {
// this.modalBlocker = blocked ? blocker : null;
// if (peerCall) {
// WindowPeer peer = (WindowPeer)this.peer;
// if (peer != null) {
// peer.setModalBlocked(blocker, blocked);
// }
// }
this.modalBlocker = blocked ? blocker : null;
if (peerCall) {
WindowPeer peer = (WindowPeer)this.peer;
if (peer != null) {
peer.setModalBlocked(blocker, blocked);
}
}
}

void setModalBlocked(Dialog blocker, boolean blocked, boolean peerCall) {
Expand Down
92 changes: 50 additions & 42 deletions sources/net.sf.j2s.java.core/src/java/awt/peer/WindowPeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,52 +35,60 @@
import java.awt.image.BufferedImage;

/**
* The peer interfaces are intended only for use in porting
* the AWT. They are not intended for use by application
* developers, and developers should not implement peers
* nor invoke any of the peer methods directly on the peer
* The peer interfaces are intended only for use in porting the AWT. They are
* not intended for use by application developers, and developers should not
* implement peers nor invoke any of the peer methods directly on the peer
* instances.
*
* Not a LightWeightPeer
*
*/
public interface WindowPeer extends ContainerPeer {
void toFront();
void toBack();
void updateAlwaysOnTopState();
void updateFocusableWindowState();
boolean requestWindowFocus();
void setModalBlocked(Dialog blocker, boolean blocked);
void updateMinimumSize();
void updateIconImages();

/**
* Sets the level of opacity for the window.
*
* @see Window#setOpacity(float)
*/
void setOpacity(float opacity);

/**
* Enables the per-pixel alpha support for the window.
*
* @see Window#setBackground(Color)
*/
void setOpaque(boolean isOpaque);

/**
* Updates the native part of non-opaque window using
* the given image with color+alpha values for each pixel.
*
* @see Window#setBackground(Color)
*/
void updateWindow(BufferedImage backBuffer);

/**
* Instructs the peer to update the position of the security warning.
*/
void repositionSecurityWarning();

WindowPeer setFrame(Window target, boolean b);

void toFront();

void toBack();

void updateAlwaysOnTopState();

void updateFocusableWindowState();

boolean requestWindowFocus();

void setModalBlocked(Dialog blocker, boolean blocked);

void setModalBlocked(JSDialog blocker, boolean blocked);

void updateMinimumSize();

void updateIconImages();

/**
* Sets the level of opacity for the window.
*
* @see Window#setOpacity(float)
*/
void setOpacity(float opacity);

/**
* Enables the per-pixel alpha support for the window.
*
* @see Window#setBackground(Color)
*/
void setOpaque(boolean isOpaque);

/**
* Updates the native part of non-opaque window using the given image with
* color+alpha values for each pixel.
*
* @see Window#setBackground(Color)
*/
void updateWindow(BufferedImage backBuffer);

/**
* Instructs the peer to update the position of the security warning.
*/
void repositionSecurityWarning();

WindowPeer setFrame(Window target, boolean b);

}
15 changes: 15 additions & 0 deletions sources/net.sf.j2s.java.core/src/javax/swing/JColorChooser.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.awt.Dialog;
import java.awt.JSDialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.JSFrame;

//import java.io.IOException;
Expand Down Expand Up @@ -623,13 +624,27 @@ public ColorChooserDialog(JSFrame owner, String title, boolean modal, Component
initColorChooserDialog(c, chooserPane, okListener, cancelListener);
}

public ColorChooserDialog(Frame owner, String title, boolean modal, Component c, JColorChooser chooserPane,
ActionListener okListener, ActionListener cancelListener) {
super(owner, title, modal);
this.disposeOnHide = false;
initColorChooserDialog(c, chooserPane, okListener, cancelListener);
}

ColorChooserDialog(JSFrame owner, String title, boolean modal, Component c, JColorChooser chooserPane,
ActionListener okListener, ActionListener cancelListener, boolean disposeOnHide) {
super(owner, title, modal);
this.disposeOnHide = disposeOnHide;
initColorChooserDialog(c, chooserPane, okListener, cancelListener);
}

ColorChooserDialog(Frame owner, String title, boolean modal, Component c, JColorChooser chooserPane,
ActionListener okListener, ActionListener cancelListener, boolean disposeOnHide) {
super(owner, title, modal);
this.disposeOnHide = disposeOnHide;
initColorChooserDialog(c, chooserPane, okListener, cancelListener);
}

private boolean haveActionListener;


Expand Down
34 changes: 34 additions & 0 deletions sources/net.sf.j2s.java.core/src/javax/swing/JDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.awt.Component;
import java.awt.Container;
import java.awt.Dialog;
import java.awt.Frame;
import java.awt.JSDialog;
import java.awt.JSFrame;
import java.awt.Graphics;
Expand Down Expand Up @@ -220,6 +221,10 @@ public JDialog(JSFrame owner) {
this(owner, false);
}

public JDialog(Frame owner) {
this(owner, false);
}

/**
* Creates a dialog with the specified owner <code>Frame</code>, modality
* and an empty title. If <code>owner</code> is <code>null</code>,
Expand Down Expand Up @@ -247,6 +252,10 @@ public JDialog(JSFrame owner, boolean modal) {
this(owner, null, modal);
}

public JDialog(Frame owner, boolean modal) {
this(owner, null, modal);
}

/**
* Creates a modeless dialog with the specified title and
* with the specified owner frame. If <code>owner</code>
Expand Down Expand Up @@ -274,6 +283,10 @@ public JDialog(JSFrame owner, String title) {
this(owner, title, false);
}

public JDialog(Frame owner, String title) {
this(owner, title, false);
}

/**
* Creates a dialog with the specified title, owner <code>Frame</code>
* and modality. If <code>owner</code> is <code>null</code>,
Expand Down Expand Up @@ -320,6 +333,17 @@ public JDialog(JSFrame owner, String title, boolean modal) {
dialogInit();
}

public JDialog(Frame owner, String title, boolean modal) {
super(owner == null? SwingUtilities.getSharedOwnerFrame() : owner,
title, modal);
if (owner == null) {
WindowListener ownerShutdownListener =
(WindowListener)SwingUtilities.getSharedOwnerFrameShutdownListener();
addWindowListener(ownerShutdownListener);
}
dialogInit();
}

/**
* Creates a dialog with the specified title,
* owner <code>Frame</code>, modality and <code>GraphicsConfiguration</code>.
Expand Down Expand Up @@ -372,6 +396,16 @@ public JDialog(JSFrame owner, String title, boolean modal,
dialogInit();
}

public JDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc) {
super(owner == null ? SwingUtilities.getSharedOwnerFrame() : owner, title, modal, gc);
if (owner == null) {
WindowListener ownerShutdownListener = (WindowListener) SwingUtilities
.getSharedOwnerFrameShutdownListener();
addWindowListener(ownerShutdownListener);
}
dialogInit();
}

/**
* Creates a modeless dialog without a title with the
* specified <code>Dialog</code> as its owner.
Expand Down
Loading