From: Michael Koch Date: Mon, 24 Mar 2003 13:50:32 +0000 (+0000) Subject: 2003-03-24 Michael Koch X-Git-Tag: releases/gcc-3.4.0~7693 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=050d3e13d8b3ca7f26c017aa98e32cd86653bed4;p=thirdparty%2Fgcc.git 2003-03-24 Michael Koch * 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. From-SVN: r64798 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 7b187d74fbb1..a304c941f2f1 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,24 @@ +2003-03-24 Michael Koch + + * 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 * java/io/RandomAccessFile.java: diff --git a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java index 1042939c076f..ce4bdf8bc0ee 100644 --- a/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java +++ b/libjava/java/awt/ContainerOrderFocusTraversalPolicy.java @@ -104,6 +104,33 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy 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 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy 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 class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy */ 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() diff --git a/libjava/java/awt/Robot.java b/libjava/java/awt/Robot.java index 1de5f3f37065..cc0ab15c6e9c 100644 --- a/libjava/java/awt/Robot.java +++ b/libjava/java/awt/Robot.java @@ -45,66 +45,98 @@ public class Robot { private boolean waitForIdle; private int autoDelay; + + /** + * Creates a Robot 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 Robot object. + * + * @exception AWTException If GraphicsEnvironment.isHeadless() returns true. + * @exception IllegalArgumentException If screen 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"; diff --git a/libjava/java/awt/Toolkit.java b/libjava/java/awt/Toolkit.java index 7fc3ac0e1640..36615944a203 100644 --- a/libjava/java/awt/Toolkit.java +++ b/libjava/java/awt/Toolkit.java @@ -448,6 +448,8 @@ public abstract class Toolkit * Returns the names of the available fonts. * * @return The names of the available fonts. + * + * @deprecated */ public abstract String[] getFontList(); @@ -457,6 +459,8 @@ public abstract class Toolkit * @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 @@ public abstract class Toolkit * * @return The requested print job, or null 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 PrintJob 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 class Toolkit 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 @@ public abstract class Toolkit 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 @@ public abstract class Toolkit } } + /** + * 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 @@ public abstract class Toolkit 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)