This brings the AWT peers interfaces in sync with OpenJDK, that is, all
the new abstract methods have been added to java.awt.peer.* and stubbed
methods to their implementation classes. This was needed to get the GTK
peers working with OpenJDK:
http://kennke.org/blog/2007/06/21/gtk-peers-on-openjdk/
The reason why I post this as RFC is that I added the
sun.awt.CausedFocusEvent class. This class is needed in the
java.awt.peer.ComponentPeer interface. I rewrote it completely but I
have to admit that I have looked at OpenJDK's version before..
I'll remove the obsolete abstract methods and refactor the AWT to use
the new methods later.
Ok to go in?
2007-06-21 Roman Kennke <[EMAIL PROTECTED]>
* sun/awt/CausedFocusEvent.java: New class. Needed for compatibility
in java.awt.peer.
* java/awt/Dialog.java
(ModalExclusionType): New enum.
(ModalityType): New enum.
* java/awt/Toolkit.java
(isModalExclusionTypeSupported): New abstract method.
(isModalityTypeSupported): New abstract method.
* java/awt/peer/ComponentPeer.java
(requestFocus): New method.
* java/awt/peer/FramePeer.java
(getBoundsPrivate): New method.
* java/awt/peer/RobotPeer.java
(dispose): New method.
* java/awt/peer/WindowPeer.java
(setAlwaysOnTop): New method.
(updateFocusableWindowState): New method.
(setModalBlocked): New method.
(updateMinimumSize): New method.
(updateIconImages): New method.
* gnu/java/awt/peer/GLightweightPeer.java
(requestFocus): New method.
* gnu/java/awt/peer/gtk/GdkRobotPeer.java
(dispose): New method.
* gnu/java/awt/peer/gtk/GtkComponentPeer.java
(requestFocus): New method.
* gnu/java/awt/peer/gtk/GtkFramePeer.java
(getBoundsPrivate): New method.
* gnu/java/awt/peer/gtk/GtkToolkit.java
(isModalExclusionTypeSupported): New method.
(isModalityTypeSupported): New method.
* gnu/java/awt/peer/gtk/GtkWindowPeer.java
(updateIconImages): New method.
(updateMinimumSize): New method.
(setModalBlocked): New method.
(updateFocusableWindowState): New method.
(setAlwaysOnTop): New method.
* gnu/java/awt/peer/headless/HeadlessToolkit.java
(isModalExclusionTypeSupported): New method.
(isModalityTypeSupported): New method.
* gnu/java/awt/peer/qt/QtComponentPeer.java
(requestFocus): New method.
* gnu/java/awt/peer/qt/QtFramePeer.java
(getBoundsPrivate): New method.
* gnu/java/awt/peer/qt/QtToolkit.java
(isModalExclusionTypeSupported): New method.
(isModalityTypeSupported): New method.
* gnu/java/awt/peer/qt/QtWindowPeer.java
(updateIconImages): New method.
(updateMinimumSize): New method.
(setModalBlocked): New method.
(updateFocusableWindowState): New method.
(setAlwaysOnTop): New method.
* gnu/java/awt/peer/swing/SwingComponentPeer.java
(requestFocus): New method.
* gnu/java/awt/peer/swing/SwingToolkit.java
(isModalExclusionTypeSupported): New method.
(isModalityTypeSupported): New method.
* gnu/java/awt/peer/swing/SwingWindowPeer.java
(updateIconImages): New method.
(updateMinimumSize): New method.
(setModalBlocked): New method.
(updateFocusableWindowState): New method.
(setAlwaysOnTop): New method.
* gnu/java/awt/peer/x/XFramePeer.java
(getBoundsPrivate): New method.
* gnu/java/awt/peer/x/XToolkit.java
(isModalExclusionTypeSupported): New method.
(isModalityTypeSupported): New method.
/Roman
--
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
Index: java/awt/Dialog.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Dialog.java,v
retrieving revision 1.29
diff -u -1 -0 -r1.29 Dialog.java
--- java/awt/Dialog.java 25 Oct 2006 20:57:52 -0000 1.29
+++ java/awt/Dialog.java 21 Jun 2007 14:51:51 -0000
@@ -54,20 +54,35 @@
* if this owner is visible to the user. The default layout of dialogs is the
* <code>BorderLayout</code>. Dialogs can be modal (blocks user input to other
* components) or non-modal (user input in other components are allowed).
* </p>
*
* @author Aaron M. Renn ([EMAIL PROTECTED])
* @author Tom Tromey ([EMAIL PROTECTED])
*/
public class Dialog extends Window
{
+ public enum ModalExclusionType
+ {
+ APPLICATION_EXCLUDE,
+ NO_EXCLUDE,
+ TOOLKIT_EXCLUDE
+ }
+
+ public enum ModalityType
+ {
+ APPLICATION_MODAL,
+ DOCUMENT_MODAL,
+ MODELESS,
+ TOOLKIT_MODAL
+ }
+
// Serialization constant
private static final long serialVersionUID = 5920926903803293709L;
/**
* @serial Indicates whether or not this dialog box is modal.
*/
private boolean modal;
/**
* @serial Indicates whether or not this dialog box is resizable.
Index: java/awt/Toolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Toolkit.java,v
retrieving revision 1.50
diff -u -1 -0 -r1.50 Toolkit.java
--- java/awt/Toolkit.java 2 Mar 2007 21:01:41 -0000 1.50
+++ java/awt/Toolkit.java 21 Jun 2007 14:51:51 -0000
@@ -1280,20 +1280,26 @@
proxy.eventDispatched(ev);
}
}
/**
* @since 1.3
*/
public abstract Map<TextAttribute,?>
mapInputMethodHighlight(InputMethodHighlight highlight);
+ public abstract boolean isModalExclusionTypeSupported
+ (Dialog.ModalExclusionType modalExclusionType);
+
+ public abstract boolean isModalityTypeSupported
+ (Dialog.ModalityType modalityType);
+
/**
* Initializes the accessibility framework. In particular, this loads the
* properties javax.accessibility.screen_magnifier_present and
* javax.accessibility.screen_reader_present and loads
* the classes specified in javax.accessibility.assistive_technologies.
*/
private static void initAccessibility()
{
AccessController.doPrivileged
(new PrivilegedAction()
Index: java/awt/peer/ComponentPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/peer/ComponentPeer.java,v
retrieving revision 1.18
diff -u -1 -0 -r1.18 ComponentPeer.java
--- java/awt/peer/ComponentPeer.java 3 Aug 2006 09:54:56 -0000 1.18
+++ java/awt/peer/ComponentPeer.java 21 Jun 2007 14:51:51 -0000
@@ -52,20 +52,22 @@
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.PaintEvent;
import java.awt.image.ColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.image.VolatileImage;
+import sun.awt.CausedFocusEvent;
+
/**
* Defines the methods that a component peer is required to implement.
*/
public interface ComponentPeer
{
/**
* Returns the construction status of the specified image. This is called
* by [EMAIL PROTECTED] Component#checkImage(Image, int, int, ImageObserver)}.
*
* @param img the image
@@ -257,21 +259,21 @@
* @param x the X coordinate of the upper left corner of the damaged rectangle
* @param y the Y coordinate of the upper left corner of the damaged rectangle
* @param width the width of the damaged rectangle
* @param height the height of the damaged rectangle
*/
void repaint(long tm, int x, int y, int width, int height);
/**
* Requests that this component receives the focus. This is called from
* [EMAIL PROTECTED] Component#requestFocus()}.
- *
+ *
* @specnote Part of the earlier 1.1 API, apparently replaced by argument
* form of the same method.
*/
void requestFocus();
/**
* Requests that this component receives the focus. This is called from
* [EMAIL PROTECTED] Component#requestFocus()}.
*
* This method is only called for heavyweight component's peers. Lightweight
@@ -511,11 +513,20 @@
* @since 1.5
*/
boolean isReparentSupported();
/**
* Layout this component peer.
*
* @since 1.5
*/
void layout();
+
+
+ /**
+ * Requests the focus on the component.
+ */
+ boolean requestFocus(Component lightweightChild, boolean temporary,
+ boolean focusedWindowChangeAllowed, long time,
+ CausedFocusEvent.Cause cause);
+
}
Index: java/awt/peer/FramePeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/peer/FramePeer.java,v
retrieving revision 1.10
diff -u -1 -0 -r1.10 FramePeer.java
--- java/awt/peer/FramePeer.java 19 Aug 2005 01:29:26 -0000 1.10
+++ java/awt/peer/FramePeer.java 21 Jun 2007 14:51:51 -0000
@@ -64,12 +64,15 @@
/**
* Sets the bounds of this frame peer.
*
* @param x the new x co-ordinate
* @param y the new y co-ordinate
* @param width the new width
* @param height the new height
* @since 1.5
*/
void setBoundsPrivate(int x, int y, int width, int height);
+
+ Rectangle getBoundsPrivate();
+
} // interface FramePeer
Index: java/awt/peer/RobotPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/peer/RobotPeer.java,v
retrieving revision 1.4
diff -u -1 -0 -r1.4 RobotPeer.java
--- java/awt/peer/RobotPeer.java 2 Jul 2005 20:32:36 -0000 1.4
+++ java/awt/peer/RobotPeer.java 21 Jun 2007 14:51:51 -0000
@@ -43,12 +43,14 @@
public interface RobotPeer
{
void mouseMove (int x, int y);
void mousePress (int buttons);
void mouseRelease (int buttons);
void mouseWheel (int wheelAmt);
void keyPress (int keycode);
void keyRelease (int keycode);
int getRGBPixel (int x, int y);
int[] getRGBPixels (Rectangle screen);
+ void dispose();
+
} // interface RobotPeer
Index: java/awt/peer/WindowPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/peer/WindowPeer.java,v
retrieving revision 1.11
diff -u -1 -0 -r1.11 WindowPeer.java
--- java/awt/peer/WindowPeer.java 15 Jul 2006 08:02:23 -0000 1.11
+++ java/awt/peer/WindowPeer.java 21 Jun 2007 14:51:51 -0000
@@ -31,31 +31,40 @@
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.peer;
+import java.awt.Dialog;
+
public interface WindowPeer extends ContainerPeer
{
void toBack();
void toFront();
/**
* Update the always-on-top status of the Window.
*
* @since 1.5
*/
void updateAlwaysOnTop();
/**
* Request that this window peer be given the window focus.
*
* @return true if the window received focus, false otherwise
* @since 1.5
*/
boolean requestWindowFocus();
+
+ void setAlwaysOnTop(boolean alwaysOnTop);
+ void updateFocusableWindowState();
+ void setModalBlocked(Dialog blocker, boolean blocked);
+ void updateMinimumSize();
+ void updateIconImages();
+
} // interface WindowPeer
Index: gnu/java/awt/peer/GLightweightPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/GLightweightPeer.java,v
retrieving revision 1.11
diff -u -1 -0 -r1.11 GLightweightPeer.java
--- gnu/java/awt/peer/GLightweightPeer.java 14 Nov 2006 10:15:58 -0000 1.11
+++ gnu/java/awt/peer/GLightweightPeer.java 21 Jun 2007 14:51:51 -0000
@@ -442,11 +442,21 @@
public boolean isReparentSupported()
{
// Nothing to do here for lightweights.
return true;
}
public void layout()
{
// Nothing to do here for lightweights.
}
+
+ @Override
+ public boolean requestFocus(Component lightweightChild, boolean temporary,
+ boolean focusedWindowChangeAllowed,
+ long time, sun.awt.CausedFocusEvent.Cause cause)
+ {
+ // Always grant focus request.
+ return true;
+ }
+
}
Index: gnu/java/awt/peer/gtk/GdkRobotPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GdkRobotPeer.java,v
retrieving revision 1.4
diff -u -1 -0 -r1.4 GdkRobotPeer.java
--- gnu/java/awt/peer/gtk/GdkRobotPeer.java 2 Jul 2005 20:32:12 -0000 1.4
+++ gnu/java/awt/peer/gtk/GdkRobotPeer.java 21 Jun 2007 14:51:51 -0000
@@ -84,11 +84,17 @@
public int[] getRGBPixels (Rectangle r)
{
int[] gdk_pixels = nativeGetRGBPixels (r.x, r.y, r.width, r.height);
int[] pixels = new int[r.width * r.height];
for (int i = 0; i < r.width * r.height; i++)
pixels[i] = cm.getRGB (gdk_pixels[i]);
return pixels;
}
+
+ @Override
+ public void dispose()
+ {
+ // Nothing to do here yet.
+ }
}
Index: gnu/java/awt/peer/gtk/GtkComponentPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java,v
retrieving revision 1.125
diff -u -1 -0 -r1.125 GtkComponentPeer.java
--- gnu/java/awt/peer/gtk/GtkComponentPeer.java 12 Feb 2007 21:39:20 -0000 1.125
+++ gnu/java/awt/peer/gtk/GtkComponentPeer.java 21 Jun 2007 14:51:52 -0000
@@ -892,11 +892,22 @@
{
// FIXME: implement
return false;
}
public void layout()
{
// FIXME: implement
}
+
+ @Override
+ public boolean requestFocus(Component lightweightChild, boolean temporary,
+ boolean focusedWindowChangeAllowed,
+ long time, sun.awt.CausedFocusEvent.Cause cause)
+ {
+ // TODO: Implement this properly and remove the other requestFocus()
+ // methods.
+ return true;
+ }
+
}
Index: gnu/java/awt/peer/gtk/GtkFramePeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkFramePeer.java,v
retrieving revision 1.51
diff -u -1 -0 -r1.51 GtkFramePeer.java
--- gnu/java/awt/peer/gtk/GtkFramePeer.java 4 Apr 2007 22:58:55 -0000 1.51
+++ gnu/java/awt/peer/gtk/GtkFramePeer.java 21 Jun 2007 14:51:52 -0000
@@ -237,13 +237,21 @@
{
// TODO Auto-generated method stub
}
public boolean requestWindowFocus()
{
// TODO Auto-generated method stub
return false;
}
+
+ @Override
+ public Rectangle getBoundsPrivate()
+ {
+ // TODO: Implement this properly.
+ throw new InternalError("Not yet implemented");
+ }
+
}
Index: gnu/java/awt/peer/gtk/GtkToolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java,v
retrieving revision 1.103
diff -u -1 -0 -r1.103 GtkToolkit.java
--- gnu/java/awt/peer/gtk/GtkToolkit.java 25 Apr 2007 14:53:03 -0000 1.103
+++ gnu/java/awt/peer/gtk/GtkToolkit.java 21 Jun 2007 14:51:52 -0000
@@ -738,11 +738,24 @@
}
private void checkHeadless()
{
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException();
}
public native int getMouseNumberOfButtons();
+ @Override
+ public boolean isModalExclusionTypeSupported
+ (Dialog.ModalExclusionType modalExclusionType)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isModalityTypeSupported(Dialog.ModalityType modalityType)
+ {
+ return false;
+ }
+
} // class GtkToolkit
Index: gnu/java/awt/peer/gtk/GtkWindowPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java,v
retrieving revision 1.59
diff -u -1 -0 -r1.59 GtkWindowPeer.java
--- gnu/java/awt/peer/gtk/GtkWindowPeer.java 12 Feb 2007 21:39:20 -0000 1.59
+++ gnu/java/awt/peer/gtk/GtkWindowPeer.java 21 Jun 2007 14:51:52 -0000
@@ -391,11 +391,41 @@
x + insets.left, y + insets.top,
clickCount, popupTrigger);
}
// We override this to keep it in sync with our internal
// representation.
public Rectangle getBounds()
{
return new Rectangle(x, y, width, height);
}
+
+ @Override
+ public void updateIconImages()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void updateMinimumSize()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void setModalBlocked(java.awt.Dialog d, boolean b)
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void updateFocusableWindowState()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void setAlwaysOnTop(boolean b)
+ {
+ // TODO: Implement properly.
+ }
}
Index: gnu/java/awt/peer/headless/HeadlessToolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/headless/HeadlessToolkit.java,v
retrieving revision 1.1
diff -u -1 -0 -r1.1 HeadlessToolkit.java
--- gnu/java/awt/peer/headless/HeadlessToolkit.java 9 Nov 2006 21:03:33 -0000 1.1
+++ gnu/java/awt/peer/headless/HeadlessToolkit.java 21 Jun 2007 14:51:52 -0000
@@ -361,11 +361,25 @@
return null;
}
public GraphicsEnvironment getLocalGraphicsEnvironment()
{
if (graphicsEnv == null)
graphicsEnv = new HeadlessGraphicsEnvironment();
return graphicsEnv;
}
+ @Override
+ public boolean isModalExclusionTypeSupported
+ (Dialog.ModalExclusionType modalExclusionType)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isModalityTypeSupported(Dialog.ModalityType modalityType)
+ {
+ return false;
+ }
+
+
}
Index: gnu/java/awt/peer/qt/QtComponentPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/qt/QtComponentPeer.java,v
retrieving revision 1.9
diff -u -1 -0 -r1.9 QtComponentPeer.java
--- gnu/java/awt/peer/qt/QtComponentPeer.java 26 Jul 2006 20:08:07 -0000 1.9
+++ gnu/java/awt/peer/qt/QtComponentPeer.java 21 Jun 2007 14:51:52 -0000
@@ -814,11 +814,22 @@
public boolean isReparentSupported()
{
return true;
}
// What does this do, anyway?
public void layout()
{
// TODO Auto-generated method stub
}
+
+ @Override
+ public boolean requestFocus(Component lightweightChild, boolean temporary,
+ boolean focusedWindowChangeAllowed,
+ long time, sun.awt.CausedFocusEvent.Cause cause)
+ {
+ // TODO: Implement this properly and remove the other requestFocus()
+ // methods.
+ return true;
+ }
+
}
Index: gnu/java/awt/peer/qt/QtFramePeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/qt/QtFramePeer.java,v
retrieving revision 1.6
diff -u -1 -0 -r1.6 QtFramePeer.java
--- gnu/java/awt/peer/qt/QtFramePeer.java 23 Aug 2005 02:13:48 -0000 1.6
+++ gnu/java/awt/peer/qt/QtFramePeer.java 21 Jun 2007 14:51:52 -0000
@@ -148,11 +148,18 @@
// TODO Auto-generated method stub
}
public boolean requestWindowFocus()
{
// TODO Auto-generated method stub
return false;
}
+ @Override
+ public Rectangle getBoundsPrivate()
+ {
+ // TODO: Implement this properly.
+ throw new InternalError("Not yet implemented");
+ }
+
}
Index: gnu/java/awt/peer/qt/QtToolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/qt/QtToolkit.java,v
retrieving revision 1.12
diff -u -1 -0 -r1.12 QtToolkit.java
--- gnu/java/awt/peer/qt/QtToolkit.java 2 Mar 2007 21:01:38 -0000 1.12
+++ gnu/java/awt/peer/qt/QtToolkit.java 21 Jun 2007 14:51:52 -0000
@@ -445,11 +445,26 @@
public RobotPeer createRobot (GraphicsDevice screen) throws AWTException
{
throw new UnsupportedOperationException();
}
public EmbeddedWindowPeer createEmbeddedWindow(EmbeddedWindow w)
{
// return new QtEmbeddedWindowPeer( this, w );
return null;
}
+
+ @Override
+ public boolean isModalExclusionTypeSupported
+ (Dialog.ModalExclusionType modalExclusionType)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isModalityTypeSupported(Dialog.ModalityType modalityType)
+ {
+ return false;
+ }
+
+
}
Index: gnu/java/awt/peer/qt/QtWindowPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/qt/QtWindowPeer.java,v
retrieving revision 1.3
diff -u -1 -0 -r1.3 QtWindowPeer.java
--- gnu/java/awt/peer/qt/QtWindowPeer.java 19 Aug 2005 01:29:26 -0000 1.3
+++ gnu/java/awt/peer/qt/QtWindowPeer.java 21 Jun 2007 14:51:52 -0000
@@ -58,23 +58,55 @@
public native void toBack();
public native void toFront();
/*
* Belongs to Frame and Dialog, but no sense in duplicating code.
*/
public native void setTitle(String title);
+ @Override
public void updateAlwaysOnTop()
{
// TODO Auto-generated method stub
}
+ @Override
public boolean requestWindowFocus()
{
// TODO Auto-generated method stub
return false;
}
+ @Override
+ public void updateIconImages()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void updateMinimumSize()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void setModalBlocked(java.awt.Dialog d, boolean b)
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void updateFocusableWindowState()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void setAlwaysOnTop(boolean b)
+ {
+ // TODO: Implement properly.
+ }
+
}
Index: gnu/java/awt/peer/swing/SwingComponentPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/swing/SwingComponentPeer.java,v
retrieving revision 1.8
diff -u -1 -0 -r1.8 SwingComponentPeer.java
--- gnu/java/awt/peer/swing/SwingComponentPeer.java 30 Apr 2007 14:14:26 -0000 1.8
+++ gnu/java/awt/peer/swing/SwingComponentPeer.java 21 Jun 2007 14:51:52 -0000
@@ -1118,11 +1118,20 @@
/**
* Returns the AWT component for this peer.
*
* @return the AWT component for this peer
*/
public Component getComponent()
{
return awtComponent;
}
+
+ @Override
+ public boolean requestFocus(Component lightweightChild, boolean temporary,
+ boolean focusedWindowChangeAllowed,
+ long time, sun.awt.CausedFocusEvent.Cause cause)
+ {
+ return true;
+ }
+
}
Index: gnu/java/awt/peer/swing/SwingToolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/swing/SwingToolkit.java,v
retrieving revision 1.1
diff -u -1 -0 -r1.1 SwingToolkit.java
--- gnu/java/awt/peer/swing/SwingToolkit.java 14 Jan 2006 00:26:26 -0000 1.1
+++ gnu/java/awt/peer/swing/SwingToolkit.java 21 Jun 2007 14:51:52 -0000
@@ -33,20 +33,21 @@
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package gnu.java.awt.peer.swing;
import java.awt.Button;
import java.awt.Canvas;
+import java.awt.Dialog;
import java.awt.Label;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.Panel;
import java.awt.TextField;
import java.awt.peer.ButtonPeer;
import java.awt.peer.CanvasPeer;
import java.awt.peer.LabelPeer;
import java.awt.peer.MenuBarPeer;
@@ -155,11 +156,26 @@
* Creates a SwingTextFieldPeer.
*
* @param textField the AWT text field
*
* @return the Swing text field peer
*/
protected TextFieldPeer createTextField(TextField textField)
{
return new SwingTextFieldPeer(textField);
}
+
+ @Override
+ public boolean isModalExclusionTypeSupported
+ (Dialog.ModalExclusionType modalExclusionType)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isModalityTypeSupported(Dialog.ModalityType modalityType)
+ {
+ return false;
+ }
+
+
}
Index: gnu/java/awt/peer/swing/SwingWindowPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/swing/SwingWindowPeer.java,v
retrieving revision 1.3
diff -u -1 -0 -r1.3 SwingWindowPeer.java
--- gnu/java/awt/peer/swing/SwingWindowPeer.java 9 Nov 2006 20:53:24 -0000 1.3
+++ gnu/java/awt/peer/swing/SwingWindowPeer.java 21 Jun 2007 14:51:52 -0000
@@ -64,11 +64,41 @@
/**
* Creates a new instance of WindowPeer.
*
* @param window the AWT window
*/
public SwingWindowPeer(Window window)
{
super(window);
init(window, null);
}
+
+ @Override
+ public void updateIconImages()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void updateMinimumSize()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void setModalBlocked(java.awt.Dialog d, boolean b)
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void updateFocusableWindowState()
+ {
+ // TODO: Implement properly.
+ }
+
+ @Override
+ public void setAlwaysOnTop(boolean b)
+ {
+ // TODO: Implement properly.
+ }
}
Index: gnu/java/awt/peer/x/XFramePeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/x/XFramePeer.java,v
retrieving revision 1.2
diff -u -1 -0 -r1.2 XFramePeer.java
--- gnu/java/awt/peer/x/XFramePeer.java 18 Jul 2006 10:23:20 -0000 1.2
+++ gnu/java/awt/peer/x/XFramePeer.java 21 Jun 2007 14:51:52 -0000
@@ -130,11 +130,18 @@
* @param width the new width
* @param height the new height
* @since 1.5
*/
public void setBoundsPrivate(int x, int y, int width, int height)
{
// TODO: Implement this.
throw new UnsupportedOperationException("Not yet implemented.");
}
+ @Override
+ public Rectangle getBoundsPrivate()
+ {
+ // TODO: Implement this properly.
+ throw new InternalError("Not yet implemented");
+ }
+
}
Index: gnu/java/awt/peer/x/XToolkit.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/x/XToolkit.java,v
retrieving revision 1.7
diff -u -1 -0 -r1.7 XToolkit.java
--- gnu/java/awt/peer/x/XToolkit.java 30 Apr 2007 20:30:56 -0000 1.7
+++ gnu/java/awt/peer/x/XToolkit.java 21 Jun 2007 14:51:52 -0000
@@ -61,20 +61,22 @@
import java.awt.MenuItem;
import java.awt.Panel;
import java.awt.PopupMenu;
import java.awt.PrintJob;
import java.awt.ScrollPane;
import java.awt.Scrollbar;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.Transparency;
import java.awt.Window;
+import java.awt.Dialog.ModalExclusionType;
+import java.awt.Dialog.ModalityType;
import java.awt.datatransfer.Clipboard;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.peer.DragSourceContextPeer;
import java.awt.im.InputMethodHighlight;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.DirectColorModel;
import java.awt.image.ImageObserver;
import java.awt.image.ImageProducer;
import java.awt.peer.ButtonPeer;
@@ -592,11 +594,27 @@
*
* @return the default XGraphicsDevice
*/
static XGraphicsDevice getDefaultDevice()
{
XGraphicsEnvironment env = (XGraphicsEnvironment)
XGraphicsEnvironment.getLocalGraphicsEnvironment();
return (XGraphicsDevice) env.getDefaultScreenDevice();
}
+ @Override
+ public boolean isModalExclusionTypeSupported
+ (Dialog.ModalExclusionType modalExclusionType)
+ {
+ // TODO: Implement properly.
+ return false;
+ }
+
+ @Override
+ public boolean isModalityTypeSupported(Dialog.ModalityType modalityType)
+ {
+ // TODO: Implement properly.
+ return false;
+ }
+
+
}
Index: sun/awt/CausedFocusEvent.java
===================================================================
RCS file: sun/awt/CausedFocusEvent.java
diff -N sun/awt/CausedFocusEvent.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ sun/awt/CausedFocusEvent.java 21 Jun 2007 14:51:52 -0000
@@ -0,0 +1,89 @@
+/* CausedFocusEvent.java -- A special focus event for peers.
+ Copyright (C) 2007 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package sun.awt;
+
+import java.awt.Component;
+import java.awt.event.FocusEvent;
+
+/**
+ * Special FocusEvent for peers. This has additional knowledge about the
+ * cause of the focus change.
+ */
+public class CausedFocusEvent
+extends FocusEvent
+{
+
+ public enum Cause
+ {
+ UNKNOWN,
+ MOUSE_EVENT,
+ TRAVERSAL,
+ TRAVERSAL_UP,
+ TRAVERSAL_DOWN,
+ TRAVERSAL_FORWARD,
+ TRAVERSAL_BACKWARD,
+ MANUAL_REQUEST,
+ AUTOMATIC_TRAVERSE,
+ ROLLBACK,
+ NATIVE_SYSTEM,
+ ACTIVATION,
+ CLEAR_GLOBAL_FOCUS_OWNER,
+ RETARGETED
+ }
+
+ /**
+ * The cause of the focus change.
+ */
+ private Cause cause;
+
+ public CausedFocusEvent(Component c, int id, boolean temporary,
+ Component opposite, Cause cause)
+ {
+ super(c, id, temporary, opposite);
+ if (cause == null)
+ {
+ cause = Cause.UNKNOWN;
+ }
+ this.cause = cause;
+ }
+
+ public Cause getCause()
+ {
+ return cause;
+ }
+}