Commit 050d3e13 by Michael Koch Committed by Michael Koch

2003-03-24 Michael Koch <koqnueror@gmx.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.

From-SVN: r64798
parent 3d6431d7
2003-03-24 Michael Koch <koqnueror@gmx.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@gmx.de> 2003-03-24 Michael Koch <konqueror@gmx.de>
* java/io/RandomAccessFile.java: * java/io/RandomAccessFile.java:
......
...@@ -104,6 +104,33 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy ...@@ -104,6 +104,33 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
if (root == null) if (root == null)
throw new IllegalArgumentException (); 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; return null;
} }
...@@ -117,6 +144,33 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy ...@@ -117,6 +144,33 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
if (root == null) if (root == null)
throw new IllegalArgumentException (); 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; return null;
} }
...@@ -127,15 +181,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy ...@@ -127,15 +181,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
*/ */
public Component getDefaultComponent(Container root) public Component getDefaultComponent(Container root)
{ {
if (root == null) return getFirstComponent (root);
throw new IllegalArgumentException ();
return null;
} }
public void setImplicitDownCycleTraversal(boolean value) public void setImplicitDownCycleTraversal(boolean value)
{ {
boolean implicitDownCycleTraversal = value; implicitDownCycleTraversal = value;
} }
public boolean getImplicitDownCycleTraversal() public boolean getImplicitDownCycleTraversal()
......
...@@ -45,66 +45,98 @@ public class Robot ...@@ -45,66 +45,98 @@ public class Robot
{ {
private boolean waitForIdle; private boolean waitForIdle;
private int autoDelay; 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 public Robot() throws AWTException
{ {
throw new Error("not implemented"); 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 public Robot(GraphicsDevice screen) throws AWTException
{ {
this(); this();
} }
public void mouseMove(int x, int y) public void mouseMove(int x, int y)
{ {
} }
public void mousePress(int buttons) public void mousePress(int buttons)
{ {
} }
public void mouseRelease(int buttons) public void mouseRelease(int buttons)
{ {
} }
public void mouseWheel(int wheelAmt) public void mouseWheel(int wheelAmt)
{ {
} }
public void keyPress(int keycode) public void keyPress(int keycode)
{ {
} }
public void keyRelease(int keycode) public void keyRelease(int keycode)
{ {
} }
public Color getPixelColor(int x, int y) public Color getPixelColor(int x, int y)
{ {
return null; return null;
} }
public BufferedImage createScreenCapture(Rectangle screen) public BufferedImage createScreenCapture(Rectangle screen)
{ {
return null; return null;
} }
public boolean isAutoWaitForIdle() public boolean isAutoWaitForIdle()
{ {
return waitForIdle; return waitForIdle;
} }
public void setAutoWaitForIdle(boolean value) public void setAutoWaitForIdle(boolean value)
{ {
waitForIdle = value; waitForIdle = value;
} }
public int getAutoDelay() public int getAutoDelay()
{ {
return autoDelay; return autoDelay;
} }
public void setAutoDelay(int ms) public void setAutoDelay(int ms)
{ {
if (ms < 0 || ms > 60000) if (ms < 0 || ms > 60000)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
autoDelay = ms; autoDelay = ms;
} }
public void delay(int ms) public void delay(int ms)
{ {
if (ms < 0 || ms > 60000) if (ms < 0 || ms > 60000)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
public void waitForIdle() public void waitForIdle()
{ {
} }
public String toString() public String toString()
{ {
return "unimplemented"; return "unimplemented";
......
...@@ -448,6 +448,8 @@ public abstract class Toolkit ...@@ -448,6 +448,8 @@ public abstract class Toolkit
* Returns the names of the available fonts. * Returns the names of the available fonts.
* *
* @return The names of the available fonts. * @return The names of the available fonts.
*
* @deprecated
*/ */
public abstract String[] getFontList(); public abstract String[] getFontList();
...@@ -457,6 +459,8 @@ public abstract class Toolkit ...@@ -457,6 +459,8 @@ public abstract class Toolkit
* @param name The name of the font to return metrics for. * @param name The name of the font to return metrics for.
* *
* @return The requested font metrics. * @return The requested font metrics.
*
* @deprecated
*/ */
public abstract FontMetrics getFontMetrics(Font name); public abstract FontMetrics getFontMetrics(Font name);
...@@ -597,12 +601,32 @@ public abstract class Toolkit ...@@ -597,12 +601,32 @@ public abstract class Toolkit
* *
* @return The requested print job, or <code>null</code> if the job * @return The requested print job, or <code>null</code> if the job
* was cancelled. * 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, public abstract PrintJob getPrintJob(Frame frame, String title,
Properties props); 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 * @since 1.3
*/ */
public PrintJob getPrintJob(Frame frame, String title, public PrintJob getPrintJob(Frame frame, String title,
...@@ -626,6 +650,8 @@ public abstract class Toolkit ...@@ -626,6 +650,8 @@ public abstract class Toolkit
public abstract Clipboard getSystemClipboard(); public abstract Clipboard getSystemClipboard();
/** /**
* Gets the singleton instance of the system selection as a Clipboard object.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true. * @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
* *
* @since 1.4 * @since 1.4
...@@ -649,21 +675,42 @@ public abstract class Toolkit ...@@ -649,21 +675,42 @@ public abstract class Toolkit
return Event.CTRL_MASK; 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) public boolean getLockingKeyState(int keyCode)
{ {
if (keyCode != KeyEvent.VK_CAPS_LOCK if (keyCode != KeyEvent.VK_CAPS_LOCK
&& keyCode != KeyEvent.VK_NUM_LOCK && keyCode != KeyEvent.VK_NUM_LOCK
&& keyCode != KeyEvent.VK_SCROLL_LOCK) && keyCode != KeyEvent.VK_SCROLL_LOCK)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
throw new UnsupportedOperationException(); 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) public void setLockingKeyState(int keyCode, boolean on)
{ {
if (keyCode != KeyEvent.VK_CAPS_LOCK if (keyCode != KeyEvent.VK_CAPS_LOCK
&& keyCode != KeyEvent.VK_NUM_LOCK && keyCode != KeyEvent.VK_NUM_LOCK
&& keyCode != KeyEvent.VK_SCROLL_LOCK) && keyCode != KeyEvent.VK_SCROLL_LOCK)
throw new IllegalArgumentException(); throw new IllegalArgumentException();
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
...@@ -697,6 +744,13 @@ public abstract class Toolkit ...@@ -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) public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
{ {
// Presumably the only reason this isn't abstract is for backwards // Presumably the only reason this isn't abstract is for backwards
...@@ -704,17 +758,33 @@ public abstract class Toolkit ...@@ -704,17 +758,33 @@ public abstract class Toolkit
return null; 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) public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
{ {
return new Dimension (0,0); 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() public int getMaximumCursorColors()
{ {
return 0; return 0;
} }
/** /**
* Returns whether Toolkit supports this state for Frames.
*
* @exception HeadlessException If GraphicsEnvironment.isHeadless() is true.
*
* @since 1.4 * @since 1.4
*/ */
public boolean isFrameStateSupported(int state) public boolean isFrameStateSupported(int state)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment