This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.awt


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch to trunk to fix some issues in java.awt.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+fw1wWSOgCCdjSDsRApVpAKCG16tUj7oJhO1zFe6p+LemeKxu4QCfevXc
BbNpAZp9FGc+lStF4RyrD1U=
=Nj5H
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.1810
diff -u -r1.1810 ChangeLog
--- ChangeLog	24 Mar 2003 13:47:05 -0000	1.1810
+++ ChangeLog	24 Mar 2003 13:49:20 -0000
@@ -1,3 +1,24 @@
+2003-03-24  Michael Koch  <koqnueror at gmx dot de>
+
+	* java/awt/ContainerOrderFocusTraversalPolicy.java
+	(getFirstComponent): Implemented.
+	(getLastComponent): Implemented.
+	(getDefaultComponent): Implemented.
+	(setImplicitDownCycleTraversal): Fixed implementation.
+	* java/awt/Robot.java
+	(Robot): Added documentation.
+	* java/awt/Toolkit.java
+	(getFontList): Deprecated.
+	(getFontMetrics): Deprecated.
+	(getPrintJob): Added documentation.
+	(getSystemSelection): Added documentation.
+	(getLockingKeyState): Added documentation.
+	(setLockingKeyState): Added documentation.
+	(createCustomCursor): Added documentation.
+	(getBestCursorSize): Added documentation.
+	(getMaximumCursorColors): Added documentation.
+	(isFrameStateSupported): Added documentation.
+
 2003-03-24  Michael Koch  <konqueror at gmx dot de>
 
 	* java/io/RandomAccessFile.java:
Index: java/awt/ContainerOrderFocusTraversalPolicy.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java,v
retrieving revision 1.4
diff -u -r1.4 ContainerOrderFocusTraversalPolicy.java
--- java/awt/ContainerOrderFocusTraversalPolicy.java	2 Mar 2003 14:01:40 -0000	1.4
+++ java/awt/ContainerOrderFocusTraversalPolicy.java	24 Mar 2003 13:49:20 -0000
@@ -104,6 +104,33 @@
     if (root == null)
       throw new IllegalArgumentException ();
 
+    if (!root.isVisible ()
+        || !root.isDisplayable ())
+      return null;
+
+    if (accept (root))
+      return root;
+
+    Component[] componentArray = root.getComponents ();
+    
+    for (int i = 0; i < componentArray.length; i++)
+      {
+        Component component = componentArray [i];
+	
+        if (component instanceof Container)
+          {
+            Component result = getLastComponent ((Container) component);
+
+            if (result != null)
+              return result;
+          }
+        else
+          {
+            if (accept (component))
+              return component;
+          }
+      }
+
     return null;
   }
 
@@ -117,6 +144,33 @@
     if (root == null)
       throw new IllegalArgumentException ();
 
+    if (!root.isVisible ()
+        || !root.isDisplayable ())
+      return null;
+
+    if (accept (root))
+      return root;
+
+    Component[] componentArray = root.getComponents ();
+    
+    for (int i = componentArray.length - 1; i >= 0; i++)
+      {
+        Component component = componentArray [i];
+	
+        if (component instanceof Container)
+          {
+            Component result = getLastComponent ((Container) component);
+
+            if (result != null)
+              return result;
+          }
+        else
+          {
+            if (accept (component))
+              return component;
+          }
+      }
+
     return null;
   }
 
@@ -127,15 +181,12 @@
    */
   public Component getDefaultComponent(Container root)
   {
-    if (root == null)
-      throw new IllegalArgumentException ();
-
-    return null;
+    return getFirstComponent (root);
   }
 
   public void setImplicitDownCycleTraversal(boolean value)
   {
-    boolean implicitDownCycleTraversal = value;
+    implicitDownCycleTraversal = value;
   }
 
   public boolean getImplicitDownCycleTraversal()
Index: java/awt/Robot.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Robot.java,v
retrieving revision 1.1
diff -u -r1.1 Robot.java
--- java/awt/Robot.java	9 Aug 2002 04:26:14 -0000	1.1
+++ java/awt/Robot.java	24 Mar 2003 13:49:20 -0000
@@ -45,66 +45,98 @@
 {
   private boolean waitForIdle;
   private int autoDelay;
+  
+  /**
+   * Creates a <code>Robot</code> object.
+   * 
+   * @exception AWTException If GraphicsEnvironment.isHeadless() returns true.
+   * @exception SecurityException If createRobot permission is not granted.
+   */
   public Robot() throws AWTException
   {
     throw new Error("not implemented");
   }
+
+  /**
+   * Creates a <code>Robot</code> object.
+   * 
+   * @exception AWTException If GraphicsEnvironment.isHeadless() returns true.
+   * @exception IllegalArgumentException If <code>screen</code> is not a screen
+   * GraphicsDevice.
+   * @exception SecurityException If createRobot permission is not granted.
+   */
   public Robot(GraphicsDevice screen) throws AWTException
   {
     this();
   }
+
   public void mouseMove(int x, int y)
   {
   }
+
   public void mousePress(int buttons)
   {
   }
+
   public void mouseRelease(int buttons)
   {
   }
+
   public void mouseWheel(int wheelAmt)
   {
   }
+
   public void keyPress(int keycode)
   {
   }
+
   public void keyRelease(int keycode)
   {
   }
+  
   public Color getPixelColor(int x, int y)
   {
     return null;
   }
+
   public BufferedImage createScreenCapture(Rectangle screen)
   {
     return null;
   }
+  
   public boolean isAutoWaitForIdle()
   {
     return waitForIdle;
   }
+  
   public void setAutoWaitForIdle(boolean value)
   {
     waitForIdle = value;
   }
+  
   public int getAutoDelay()
   {
     return autoDelay;
   }
+  
   public void setAutoDelay(int ms)
   {
     if (ms < 0 || ms > 60000)
       throw new IllegalArgumentException();
+    
     autoDelay = ms;
   }
+
   public void delay(int ms)
   {
     if (ms < 0 || ms > 60000)
       throw new IllegalArgumentException();
   }
+
   public void waitForIdle()
   {
   }
+
   public String toString()
   {
     return "unimplemented";
Index: java/awt/Toolkit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Toolkit.java,v
retrieving revision 1.20
diff -u -r1.20 Toolkit.java
--- java/awt/Toolkit.java	13 Feb 2003 07:02:12 -0000	1.20
+++ java/awt/Toolkit.java	24 Mar 2003 13:49:20 -0000
@@ -448,6 +448,8 @@
    * Returns the names of the available fonts.
    *
    * @return The names of the available fonts.
+   *
+   * @deprecated
    */
   public abstract String[] getFontList();
 
@@ -457,6 +459,8 @@
    * @param name The name of the font to return metrics for.
    *
    * @return The requested font metrics.
+   *
+   * @deprecated
    */
   public abstract FontMetrics getFontMetrics(Font name);
 
@@ -597,12 +601,32 @@
    *
    * @return The requested print job, or <code>null</code> if the job
    * was cancelled.
+   *
+   * @exception NullPointerException If frame is null,
+   * or GraphicsEnvironment.isHeadless() returns true.
+   * @exception SecurityException If this thread is not allowed to initiate
+   * a print job request.
    */
   public abstract PrintJob getPrintJob(Frame frame, String title,
                                        Properties props);
 
-
   /**
+   * Returns a instance of <code>PrintJob</code> for the specified
+   * arguments.
+   *
+   * @param frame The window initiating the print job.
+   * @param title The print job title.
+   * @param jobAttr A set of job attributes which will control the print job.
+   * @param pageAttr A set of page attributes which will control the print job.
+   *
+   * @exception NullPointerException If frame is null, and either jobAttr is null
+   * or jobAttr.getDialog() returns JobAttributes.DialogType.NATIVE.
+   * @exception IllegalArgumentException If pageAttrspecifies differing cross
+   * feed and feed resolutions, or when GraphicsEnvironment.isHeadless() returns
+   * true.
+   * @exception SecurityException If this thread is not allowed to initiate
+   * a print job request.
+   *
    * @since 1.3
    */
   public PrintJob getPrintJob(Frame frame, String title,
@@ -626,6 +650,8 @@
   public abstract Clipboard getSystemClipboard();
 
   /**
+   * Gets the singleton instance of the system selection as a Clipboard object.
+   *
    * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
    *
    * @since 1.4
@@ -649,21 +675,42 @@
     return Event.CTRL_MASK;
   }
 
+  /**
+   * Returns whether the given locking key on the keyboard is currently in its
+   * "on" state.
+   *
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   * @exception IllegalArgumentException If keyCode is not one of the valid keys.
+   * @exception UnsupportedOperationException If the host system doesn't allow
+   * getting the state of this key programmatically, or if the keyboard doesn't
+   * have this key.
+   */
   public boolean getLockingKeyState(int keyCode)
   {
     if (keyCode != KeyEvent.VK_CAPS_LOCK
         && keyCode != KeyEvent.VK_NUM_LOCK
         && keyCode != KeyEvent.VK_SCROLL_LOCK)
       throw new IllegalArgumentException();
+    
     throw new UnsupportedOperationException();
   }
 
+  /**
+   * Sets the state of the given locking key on the keyboard.
+   *
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   * @exception IllegalArgumentException If keyCode is not one of the valid keys.
+   * @exception UnsupportedOperationException If the host system doesn't allow
+   * getting the state of this key programmatically, or if the keyboard doesn't
+   * have this key.
+   */
   public void setLockingKeyState(int keyCode, boolean on)
   {
     if (keyCode != KeyEvent.VK_CAPS_LOCK
         && keyCode != KeyEvent.VK_NUM_LOCK
         && keyCode != KeyEvent.VK_SCROLL_LOCK)
       throw new IllegalArgumentException();
+    
     throw new UnsupportedOperationException();
   }
 
@@ -697,6 +744,13 @@
       }
   }
 
+  /**
+   * Creates a new custom cursor object.
+   *
+   * @exception IndexOutOfBoundsException If the hotSpot values are outside
+   * the bounds of the cursor.
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   */
   public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
   {
     // Presumably the only reason this isn't abstract is for backwards
@@ -704,17 +758,33 @@
     return null;
   }
 
+  /**
+   * Returns the supported cursor dimension which is closest to the
+   * desired sizes.
+   *
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   */
   public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
   {
     return new Dimension (0,0);
   }
 
+  /**
+   * Returns the maximum number of colors the Toolkit supports in a custom
+   * cursor palette.
+   *
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   */
   public int getMaximumCursorColors()
   {
     return 0;
   }
 
   /**
+   * Returns whether Toolkit supports this state for Frames.
+   *
+   * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
+   * 
    * @since 1.4
    */
   public boolean isFrameStateSupported(int state)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]