From: Michael Koch Date: Mon, 10 Mar 2003 13:21:38 +0000 (+0000) Subject: 2003-03-10 Michael Koch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76c16dd4c24cbf9ca6c311edcde5336e8c8b63f0;p=gcc.git 2003-03-10 Michael Koch * java/awt/FocusTraversalPolicy.java (FocusTraversalPolicy): Documentation added. (getComponentAfter): Documentation added. (getComponentBefore): Documentation added. (getFirstComponent): Documentation added. (getLastComponent): Documentation added. (getDefaultComponent): Documentation added. (getInitialComponent): Documentation added. * java/awt/ScrollPaneAdjustable.java (sp): New member variable. (orientation): New member variable. (value): New member variable. (minimum): New member variable. (maximum): New member variable. (visibleAmount): New member variable. (unitIncrement): New member variable. (blockIncrement): New member variable. (adjustmentListener): New member variable. (ScrollPaneAdjustable): Rewrote. (addAdjustmentListener): New method. (removeAdjustmentListener): New method. (getAdjustmentListeners): New method. (getBlockIncrement): New method. (getMaximum): New method. (getMinimum): New method. (getOrientation): New method. (getUnitIncrement): New method. (getValue): New method. (getVisibleAmount): New method. (setBlockIncrement): New method. (setUnitIncrement): New method. (setMaximum): Implemented. (setMinimum): Implemented. (setValue): New method. (setVisibleAmount): Implemented. (paramString): New method. * java/awt/Window.java (show): Use setVisible(true) instead of super.show(). (hide): Use sevVisible(false) instead of super.hide(). (processWindowEvent): Added cases for WINDOW_GAINED_FOCUS, WINDOW_LOST_FOCUS and WINDOW_STATE_CHANGED. (postEvent): Deprecated. (applyResourceBundle): Deprecated. (processWindowFocusEvent): New method. (processWindowStateEvent): New method. * java/awt/datatransfer/DataFlavor.java: Reindented. * java/awt/font/TextHitInfo.java (charIndex): New member variable. (leadingEdge): New member variable. (TextHitInfo): New constructor. (getCharIndex): Implemented. (isLeadingEdge): Implemented. (getInsertionIndex): Implemented. (hashCode): Access charIndex directly. (equals): Reformated. (leading): Implemented. (trailing): Implemented. (beforeOffset): Implemented. (afterOffset): Implemented. (getOtherHit): Implemented. (getOffsetHit): Implemented. (toString): Implemented. * java/awt/image/BufferedImage.java (BufferedImage): Implements WritableRenderedImage. (observers): New member variable. (addTileObserver): New method. (removeTileObserver): New method. From-SVN: r64078 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 8689e79a3d4..9d4f506ccee 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,73 @@ +2003-03-10 Michael Koch + + * java/awt/FocusTraversalPolicy.java + (FocusTraversalPolicy): Documentation added. + (getComponentAfter): Documentation added. + (getComponentBefore): Documentation added. + (getFirstComponent): Documentation added. + (getLastComponent): Documentation added. + (getDefaultComponent): Documentation added. + (getInitialComponent): Documentation added. + * java/awt/ScrollPaneAdjustable.java + (sp): New member variable. + (orientation): New member variable. + (value): New member variable. + (minimum): New member variable. + (maximum): New member variable. + (visibleAmount): New member variable. + (unitIncrement): New member variable. + (blockIncrement): New member variable. + (adjustmentListener): New member variable. + (ScrollPaneAdjustable): Rewrote. + (addAdjustmentListener): New method. + (removeAdjustmentListener): New method. + (getAdjustmentListeners): New method. + (getBlockIncrement): New method. + (getMaximum): New method. + (getMinimum): New method. + (getOrientation): New method. + (getUnitIncrement): New method. + (getValue): New method. + (getVisibleAmount): New method. + (setBlockIncrement): New method. + (setUnitIncrement): New method. + (setMaximum): Implemented. + (setMinimum): Implemented. + (setValue): New method. + (setVisibleAmount): Implemented. + (paramString): New method. + * java/awt/Window.java + (show): Use setVisible(true) instead of super.show(). + (hide): Use sevVisible(false) instead of super.hide(). + (processWindowEvent): Added cases for WINDOW_GAINED_FOCUS, + WINDOW_LOST_FOCUS and WINDOW_STATE_CHANGED. + (postEvent): Deprecated. + (applyResourceBundle): Deprecated. + (processWindowFocusEvent): New method. + (processWindowStateEvent): New method. + * java/awt/datatransfer/DataFlavor.java: Reindented. + * java/awt/font/TextHitInfo.java + (charIndex): New member variable. + (leadingEdge): New member variable. + (TextHitInfo): New constructor. + (getCharIndex): Implemented. + (isLeadingEdge): Implemented. + (getInsertionIndex): Implemented. + (hashCode): Access charIndex directly. + (equals): Reformated. + (leading): Implemented. + (trailing): Implemented. + (beforeOffset): Implemented. + (afterOffset): Implemented. + (getOtherHit): Implemented. + (getOffsetHit): Implemented. + (toString): Implemented. + * java/awt/image/BufferedImage.java + (BufferedImage): Implements WritableRenderedImage. + (observers): New member variable. + (addTileObserver): New method. + (removeTileObserver): New method. + 2003-03-09 Tom Tromey PR libgcj/9934: diff --git a/libjava/java/awt/FocusTraversalPolicy.java b/libjava/java/awt/FocusTraversalPolicy.java index fcabeceb375..0354a7fe1a2 100644 --- a/libjava/java/awt/FocusTraversalPolicy.java +++ b/libjava/java/awt/FocusTraversalPolicy.java @@ -39,26 +39,63 @@ exception statement from your version. */ package java.awt; /** - * STUB CLASS ONLY + * @since 1.4 */ public abstract class FocusTraversalPolicy { + /** + * Creates a FocusTraversalPolicy object. + */ public FocusTraversalPolicy() { + // Do nothing in here. } + /** + * Returns the Component that should receive the focus after a Component. + * + * @exception IllegalArgumentException If root or current is null, + * or if root is not a focus cycle root of current. + */ public abstract Component getComponentAfter(Container root, Component current); + /** + * Returns the Component that should receive the focus before a Component. + * + * @exception IllegalArgumentException If root or current is null, + * or if root is not a focus cycle root of current. + */ public abstract Component getComponentBefore(Container root, Component current); + /** + * Returns the first Component in the traversal cycle. + * + * @exception IllegalArgumentException If root is null. + */ public abstract Component getFirstComponent(Container root); + /** + * Returns the last Component in the traversal cycle. + * + * @exception IllegalArgumentException If root is null. + */ public abstract Component getLastComponent(Container root); + /** + * Returns the default Component to focus. + * + * @exception IllegalArgumentException If root is null. + */ public abstract Component getDefaultComponent(Container root); + /** + * Returns the Component that should receive the focus when a Window is made + * visible for the first time. + * + * @exception IllegalArgumentException If window is null. + */ public Component getInitialComponent(Window window) { return getDefaultComponent(window); diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java index 805152e5405..e98c5edb3fa 100644 --- a/libjava/java/awt/Window.java +++ b/libjava/java/awt/Window.java @@ -503,30 +503,30 @@ public class Window extends Container { if (windowListener != null) { - switch (evt.getID()) - { - case WindowEvent.WINDOW_ACTIVATED: - windowListener.windowActivated(evt); - break; - case WindowEvent.WINDOW_CLOSED: - windowListener.windowClosed(evt); - break; - case WindowEvent.WINDOW_CLOSING: - windowListener.windowClosing(evt); - break; - case WindowEvent.WINDOW_DEACTIVATED: - windowListener.windowDeactivated(evt); - break; - case WindowEvent.WINDOW_DEICONIFIED: - windowListener.windowDeiconified(evt); - break; - case WindowEvent.WINDOW_ICONIFIED: - windowListener.windowIconified(evt); - break; - case WindowEvent.WINDOW_OPENED: - windowListener.windowOpened(evt); - break; - } + switch (evt.getID()) + { + case WindowEvent.WINDOW_ACTIVATED: + windowListener.windowActivated(evt); + break; + case WindowEvent.WINDOW_CLOSED: + windowListener.windowClosed(evt); + break; + case WindowEvent.WINDOW_CLOSING: + windowListener.windowClosing(evt); + break; + case WindowEvent.WINDOW_DEACTIVATED: + windowListener.windowDeactivated(evt); + break; + case WindowEvent.WINDOW_DEICONIFIED: + windowListener.windowDeiconified(evt); + break; + case WindowEvent.WINDOW_ICONIFIED: + windowListener.windowIconified(evt); + break; + case WindowEvent.WINDOW_OPENED: + windowListener.windowOpened(evt); + break; + } } } diff --git a/libjava/java/awt/datatransfer/DataFlavor.java b/libjava/java/awt/datatransfer/DataFlavor.java index 7239adde772..51b610b8ae5 100644 --- a/libjava/java/awt/datatransfer/DataFlavor.java +++ b/libjava/java/awt/datatransfer/DataFlavor.java @@ -51,11 +51,11 @@ import java.nio.ByteBuffer; import java.nio.CharBuffer; /** - * This class represents a particular data format used for transferring - * data via the clipboard. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This class represents a particular data format used for transferring + * data via the clipboard. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public class DataFlavor implements java.io.Externalizable, Cloneable { static final long serialVersionUID = 8367026044764648243L; @@ -67,50 +67,50 @@ public class DataFlavor implements java.io.Externalizable, Cloneable */ /** - * This is the data flavor used for tranferring plain text. The MIME - * type is "text/plain; charset=unicode". The representation class - * is java.io.InputStream. - * - * @deprecated The charset unicode is platform specific and InputStream - * deals with bytes not chars. Use getRederForText(). - */ + * This is the data flavor used for tranferring plain text. The MIME + * type is "text/plain; charset=unicode". The representation class + * is java.io.InputStream. + * + * @deprecated The charset unicode is platform specific and InputStream + * deals with bytes not chars. Use getRederForText(). + */ public static final DataFlavor plainTextFlavor; /** - * This is the data flavor used for transferring Java strings. The - * MIME type is "application/x-java-serialized-object" and the - * representation class is java.lang.String. - */ + * This is the data flavor used for transferring Java strings. The + * MIME type is "application/x-java-serialized-object" and the + * representation class is java.lang.String. + */ public static final DataFlavor stringFlavor; /** - * This is a data flavor used for transferring lists of files. The - * representation type is a java.util.List, with each element of - * the list being a java.io.File. - */ + * This is a data flavor used for transferring lists of files. The + * representation type is a java.util.List, with each element of + * the list being a java.io.File. + */ public static final DataFlavor javaFileListFlavor; public static final DataFlavor imageFlavor; /** - * This is the MIME type used for transferring a serialized object. - * The representation class is the type of object be deserialized. - */ + * This is the MIME type used for transferring a serialized object. + * The representation class is the type of object be deserialized. + */ public static final String javaSerializedObjectMimeType = "application/x-java-serialized-object"; /** - * This is the MIME type used to transfer a Java object reference within - * the same JVM. The representation class is the class of the object - * being transferred. - */ + * This is the MIME type used to transfer a Java object reference within + * the same JVM. The representation class is the class of the object + * being transferred. + */ public static final String javaJVMLocalObjectMimeType = "application/x-java-jvm-local-object"; /** - * This is the MIME type used to transfer a link to a remote object. - * The representation class is the type of object being linked to. - */ + * This is the MIME type used to transfer a link to a remote object. + * The representation class is the type of object being linked to. + */ public static final String javaRemoteObjectMimeType = "application/x-java-remote-object"; @@ -158,17 +158,17 @@ private String humanPresentableName; */ /** - * This method attempts to load the named class. The following class - * loaders are searched in order: the bootstrap class loader, the - * system class loader, the context class loader (if it exists), and - * the specified fallback class loader. - * - * @param className The name of the class to load. - * @param classLoader The class loader to use if all others fail, which - * may be null. - * - * @exception ClassNotFoundException If the class cannot be loaded. - */ + * This method attempts to load the named class. The following class + * loaders are searched in order: the bootstrap class loader, the + * system class loader, the context class loader (if it exists), and + * the specified fallback class loader. + * + * @param className The name of the class to load. + * @param classLoader The class loader to use if all others fail, which + * may be null. + * + * @exception ClassNotFoundException If the class cannot be loaded. + */ protected static final Class tryToLoadClass(String className, ClassLoader classLoader) throws ClassNotFoundException @@ -214,9 +214,9 @@ tryToLoadClass(String className, ClassLoader classLoader) */ /** - * Empty public constructor needed for externalization. - * Should not be used for normal instantiation. - */ + * Empty public constructor needed for externalization. + * Should not be used for normal instantiation. + */ public DataFlavor() { @@ -228,8 +228,8 @@ DataFlavor() /*************************************************************************/ /** - * Private constructor. - */ + * Private constructor. + */ private DataFlavor(Class representationClass, String mimeType, @@ -246,15 +246,15 @@ DataFlavor(Class representationClass, /*************************************************************************/ /** - * Initializes a new instance of DataFlavor. The class - * and human readable name are specified, the MIME type will be - * "application/x-java-serialized-object". If the human readable name - * is not specified (null) then the human readable name - * will be the same as the MIME type. - * - * @param representationClass The representation class for this object. - * @param humanPresentableName The display name of the object. - */ + * Initializes a new instance of DataFlavor. The class + * and human readable name are specified, the MIME type will be + * "application/x-java-serialized-object". If the human readable name + * is not specified (null) then the human readable name + * will be the same as the MIME type. + * + * @param representationClass The representation class for this object. + * @param humanPresentableName The display name of the object. + */ public DataFlavor(Class representationClass, String humanPresentableName) { @@ -268,23 +268,23 @@ DataFlavor(Class representationClass, String humanPresentableName) /*************************************************************************/ /** - * Initializes a new instance of DataFlavor with the - * specified MIME type and description. If the MIME type has a - * "class=" parameter then the representation class will - * be the class name specified. Otherwise the class defaults to - * java.io.InputStream. If the human readable name - * is not specified (null) then the human readable name - * will be the same as the MIME type. - * - * @param mimeType The MIME type for this flavor. - * @param humanPresentableName The display name of this flavor. - * @param classLoader The class loader for finding classes if the default - * class loaders do not work. - * - * @exception IllegalArgumentException If the representation class - * specified cannot be loaded. - * @exception ClassNotFoundException If the class is not loaded. - */ + * Initializes a new instance of DataFlavor with the + * specified MIME type and description. If the MIME type has a + * "class=" parameter then the representation class will + * be the class name specified. Otherwise the class defaults to + * java.io.InputStream. If the human readable name + * is not specified (null) then the human readable name + * will be the same as the MIME type. + * + * @param mimeType The MIME type for this flavor. + * @param humanPresentableName The display name of this flavor. + * @param classLoader The class loader for finding classes if the default + * class loaders do not work. + * + * @exception IllegalArgumentException If the representation class + * specified cannot be loaded. + * @exception ClassNotFoundException If the class is not loaded. + */ public DataFlavor(String mimeType, String humanPresentableName, ClassLoader classLoader) throws ClassNotFoundException @@ -317,22 +317,22 @@ getRepresentationClassFromMime(String mimeString, ClassLoader classLoader) /*************************************************************************/ /** - * Initializes a new instance of DataFlavor with the - * specified MIME type and description. If the MIME type has a - * "class=" parameter then the representation class will - * be the class name specified. Otherwise the class defaults to - * java.io.InputStream. If the human readable name - * is not specified (null) then the human readable name - * will be the same as the MIME type. This is the same as calling - * new DataFlavor(mimeType, humanPresentableName, null). - * - * @param mimeType The MIME type for this flavor. - * @param humanPresentableName The display name of this flavor. - * @param classLoader The class loader for finding classes. - * - * @exception IllegalArgumentException If the representation class - * specified cannot be loaded. - */ + * Initializes a new instance of DataFlavor with the + * specified MIME type and description. If the MIME type has a + * "class=" parameter then the representation class will + * be the class name specified. Otherwise the class defaults to + * java.io.InputStream. If the human readable name + * is not specified (null) then the human readable name + * will be the same as the MIME type. This is the same as calling + * new DataFlavor(mimeType, humanPresentableName, null). + * + * @param mimeType The MIME type for this flavor. + * @param humanPresentableName The display name of this flavor. + * @param classLoader The class loader for finding classes. + * + * @exception IllegalArgumentException If the representation class + * specified cannot be loaded. + */ public DataFlavor(String mimeType, String humanPresentableName) throws ClassNotFoundException @@ -343,19 +343,19 @@ DataFlavor(String mimeType, String humanPresentableName) /*************************************************************************/ /** - * Initializes a new instance of DataFlavor with the specified - * MIME type. This type can have a "class=" parameter to specify the - * representation class, and then the class must exist or an exception will - * be thrown. If there is no "class=" parameter then the representation class - * will be java.io.InputStream. This is the same as calling - * new DataFlavor(mimeType, null). - * - * @param mimeType The MIME type for this flavor. - * - * @exception IllegalArgumentException If a class is not specified in - * the MIME type. - * @exception ClassNotFoundException If the class cannot be loaded. - */ + * Initializes a new instance of DataFlavor with the specified + * MIME type. This type can have a "class=" parameter to specify the + * representation class, and then the class must exist or an exception will + * be thrown. If there is no "class=" parameter then the representation class + * will be java.io.InputStream. This is the same as calling + * new DataFlavor(mimeType, null). + * + * @param mimeType The MIME type for this flavor. + * + * @exception IllegalArgumentException If a class is not specified in + * the MIME type. + * @exception ClassNotFoundException If the class cannot be loaded. + */ public DataFlavor(String mimeType) throws ClassNotFoundException { @@ -365,10 +365,10 @@ DataFlavor(String mimeType) throws ClassNotFoundException /*************************************************************************/ /** - * Returns the MIME type of this flavor. - * - * @return The MIME type for this flavor. - */ + * Returns the MIME type of this flavor. + * + * @return The MIME type for this flavor. + */ public String getMimeType() { @@ -378,10 +378,10 @@ getMimeType() /*************************************************************************/ /** - * Returns the representation class for this flavor. - * - * @return The representation class for this flavor. - */ + * Returns the representation class for this flavor. + * + * @return The representation class for this flavor. + */ public Class getRepresentationClass() { @@ -391,10 +391,10 @@ getRepresentationClass() /*************************************************************************/ /** - * Returns the human presentable name for this flavor. - * - * @return The human presentable name for this flavor. - */ + * Returns the human presentable name for this flavor. + * + * @return The human presentable name for this flavor. + */ public String getHumanPresentableName() { @@ -404,10 +404,10 @@ getHumanPresentableName() /*************************************************************************/ /** - * Returns the primary MIME type for this flavor. - * - * @return The primary MIME type for this flavor. - */ + * Returns the primary MIME type for this flavor. + * + * @return The primary MIME type for this flavor. + */ public String getPrimaryType() { @@ -421,10 +421,10 @@ getPrimaryType() /*************************************************************************/ /** - * Returns the MIME subtype for this flavor. - * - * @return The MIME subtype for this flavor. - */ + * Returns the MIME subtype for this flavor. + * + * @return The MIME subtype for this flavor. + */ public String getSubType() { @@ -444,15 +444,15 @@ getSubType() /*************************************************************************/ /** - * Returns the value of the named MIME type parameter, or null - * if the parameter does not exist. Given the parameter name and the mime - * string. - * - * @param paramName The name of the parameter. - * @param mimeString The mime string from where the name should be found. - * - * @return The value of the parameter or null. - */ + * Returns the value of the named MIME type parameter, or null + * if the parameter does not exist. Given the parameter name and the mime + * string. + * + * @param paramName The name of the parameter. + * @param mimeString The mime string from where the name should be found. + * + * @return The value of the parameter or null. + */ private static String getParameter(String paramName, String mimeString) { @@ -470,14 +470,15 @@ getParameter(String paramName, String mimeString) } /*************************************************************************/ + /** - * Returns the value of the named MIME type parameter, or null - * if the parameter does not exist. - * - * @param paramName The name of the paramter. - * - * @return The value of the parameter. - */ + * Returns the value of the named MIME type parameter, or null + * if the parameter does not exist. + * + * @param paramName The name of the paramter. + * + * @return The value of the parameter. + */ public String getParameter(String paramName) { @@ -487,10 +488,10 @@ getParameter(String paramName) /*************************************************************************/ /** - * Sets the human presentable name to the specified value. - * - * @param humanPresentableName The new display name. - */ + * Sets the human presentable name to the specified value. + * + * @param humanPresentableName The new display name. + */ public void setHumanPresentableName(String humanPresentableName) { @@ -500,16 +501,16 @@ setHumanPresentableName(String humanPresentableName) /*************************************************************************/ /** - * Tests the MIME type of this object for equality against the specified - * MIME type. - * - * @param mimeType The MIME type to test against. - * - * @return true if the MIME type is equal to this object's - * MIME type, false otherwise. - * - * @exception NullPointerException If mimeType is null. - */ + * Tests the MIME type of this object for equality against the specified + * MIME type. + * + * @param mimeType The MIME type to test against. + * + * @return true if the MIME type is equal to this object's + * MIME type, false otherwise. + * + * @exception NullPointerException If mimeType is null. + */ public boolean isMimeTypeEqual(String mimeType) { @@ -521,14 +522,14 @@ isMimeTypeEqual(String mimeType) /*************************************************************************/ /** - * Tests the MIME type of this object for equality against the specified - * data flavor's MIME type - * - * @param flavor The flavor to test against. - * - * @return true if the flavor's MIME type is equal to this - * object's MIME type, false otherwise. - */ + * Tests the MIME type of this object for equality against the specified + * data flavor's MIME type + * + * @param flavor The flavor to test against. + * + * @return true if the flavor's MIME type is equal to this + * object's MIME type, false otherwise. + */ public boolean isMimeTypeEqual(DataFlavor flavor) { @@ -538,11 +539,11 @@ isMimeTypeEqual(DataFlavor flavor) /*************************************************************************/ /** - * Tests whether or not this flavor represents a serialized object. - * - * @return true if this flavor represents a serialized - * object, false otherwise. - */ + * Tests whether or not this flavor represents a serialized object. + * + * @return true if this flavor represents a serialized + * object, false otherwise. + */ public boolean isMimeTypeSerializedObject() { @@ -552,12 +553,12 @@ isMimeTypeSerializedObject() /*************************************************************************/ /** - * Tests whether or not this flavor has a representation class of - * java.io.InputStream. - * - * @param true if the representation class of this flavor - * is java.io.InputStream, false otherwise. - */ + * Tests whether or not this flavor has a representation class of + * java.io.InputStream. + * + * @param true if the representation class of this flavor + * is java.io.InputStream, false otherwise. + */ public boolean isRepresentationClassInputStream() { @@ -567,12 +568,12 @@ isRepresentationClassInputStream() /*************************************************************************/ /** - * Tests whether the representation class for this flavor is - * serializable. - * - * @param true if the representation class is serializable, - * false otherwise. - */ + * Tests whether the representation class for this flavor is + * serializable. + * + * @param true if the representation class is serializable, + * false otherwise. + */ public boolean isRepresentationClassSerializable() { @@ -592,11 +593,11 @@ isRepresentationClassSerializable() /*************************************************************************/ /** - * Tests whether the representation class for his flavor is remote. - * - * @return true if the representation class is remote, - * false otherwise. - */ + * Tests whether the representation class for his flavor is remote. + * + * @return true if the representation class is remote, + * false otherwise. + */ public boolean isRepresentationClassRemote() { @@ -607,11 +608,11 @@ isRepresentationClassRemote() /*************************************************************************/ /** - * Tests whether or not this flavor represents a serialized object. - * - * @return true if this flavor represents a serialized - * object, false otherwise. - */ + * Tests whether or not this flavor represents a serialized object. + * + * @return true if this flavor represents a serialized + * object, false otherwise. + */ public boolean isFlavorSerializedObjectType() { @@ -622,11 +623,11 @@ isFlavorSerializedObjectType() /*************************************************************************/ /** - * Tests whether or not this flavor represents a remote object. - * - * @return true if this flavor represents a remote object, - * false otherwise. - */ + * Tests whether or not this flavor represents a remote object. + * + * @return true if this flavor represents a remote object, + * false otherwise. + */ public boolean isFlavorRemoteObjectType() { @@ -636,11 +637,11 @@ isFlavorRemoteObjectType() /*************************************************************************/ /** - * Tests whether or not this flavor represents a list of files. - * - * @return true if this flavor represents a list of files, - * false otherwise. - */ + * Tests whether or not this flavor represents a list of files. + * + * @return true if this flavor represents a list of files, + * false otherwise. + */ public boolean isFlavorJavaFileListType() { @@ -654,14 +655,14 @@ isFlavorJavaFileListType() /*************************************************************************/ /** - * Returns a copy of this object. - * - * @return A copy of this object. - * - * @exception CloneNotSupportedException If the object's class does not support - * the Cloneable interface. Subclasses that override the clone method can also - * throw this exception to indicate that an instance cannot be cloned. - */ + * Returns a copy of this object. + * + * @return A copy of this object. + * + * @exception CloneNotSupportedException If the object's class does not support + * the Cloneable interface. Subclasses that override the clone method can also + * throw this exception to indicate that an instance cannot be cloned. + */ public Object clone () throws CloneNotSupportedException { try @@ -677,15 +678,15 @@ public Object clone () throws CloneNotSupportedException /*************************************************************************/ /** - * This method test the specified DataFlavor for equality - * against this object. This will be true if the MIME type and - * representation type are the equal. - * - * @param flavor The DataFlavor to test against. - * - * @return true if the flavor is equal to this object, - * false otherwise. - */ + * This method test the specified DataFlavor for equality + * against this object. This will be true if the MIME type and + * representation type are the equal. + * + * @param flavor The DataFlavor to test against. + * + * @return true if the flavor is equal to this object, + * false otherwise. + */ public boolean equals(DataFlavor flavor) { @@ -704,22 +705,22 @@ equals(DataFlavor flavor) /*************************************************************************/ /** - * This method test the specified Object for equality - * against this object. This will be true if the following conditions - * are met: - *

- *

    - *
  • The object is not null. - *
  • The object is an instance of DataFlavor. - *
  • The object's MIME type and representation class are equal to - * this object's. - *
- * - * @param obj The Object to test against. - * - * @return true if the flavor is equal to this object, - * false otherwise. - */ + * This method test the specified Object for equality + * against this object. This will be true if the following conditions + * are met: + *

+ *

    + *
  • The object is not null. + *
  • The object is an instance of DataFlavor. + *
  • The object's MIME type and representation class are equal to + * this object's. + *
+ * + * @param obj The Object to test against. + * + * @return true if the flavor is equal to this object, + * false otherwise. + */ public boolean equals(Object obj) { @@ -735,17 +736,17 @@ equals(Object obj) /*************************************************************************/ /** - * Tests whether or not the specified string is equal to the MIME type - * of this object. - * - * @param str The string to test against. - * - * @return true if the string is equal to this object's MIME - * type, false otherwise. - * - * @deprecated Not compatible with hashCode(). - * Use isMimeTypeEqual() - */ + * Tests whether or not the specified string is equal to the MIME type + * of this object. + * + * @param str The string to test against. + * + * @return true if the string is equal to this object's MIME + * type, false otherwise. + * + * @deprecated Not compatible with hashCode(). + * Use isMimeTypeEqual() + */ public boolean equals(String str) { @@ -755,10 +756,10 @@ equals(String str) /*************************************************************************/ /** - * Returns the hash code for this data flavor. - * The hash code is based on the (lower case) mime type and the - * representation class. - */ + * Returns the hash code for this data flavor. + * The hash code is based on the (lower case) mime type and the + * representation class. + */ public int hashCode() { @@ -768,9 +769,9 @@ hashCode() /*************************************************************************/ /** - * Returns true when the given DataFlavor - * matches this one. - */ + * Returns true when the given DataFlavor + * matches this one. + */ public boolean match(DataFlavor dataFlavor) { @@ -781,16 +782,16 @@ match(DataFlavor dataFlavor) /*************************************************************************/ /** - * This method exists for backward compatibility. It simply returns - * the same name/value pair passed in. - * - * @param name The parameter name. - * @param value The parameter value. - * - * @return The name/value pair. - * - * @deprecated - */ + * This method exists for backward compatibility. It simply returns + * the same name/value pair passed in. + * + * @param name The parameter name. + * @param value The parameter value. + * + * @return The name/value pair. + * + * @deprecated + */ protected String normalizeMimeTypeParameter(String name, String value) { @@ -800,15 +801,15 @@ normalizeMimeTypeParameter(String name, String value) /*************************************************************************/ /** - * This method exists for backward compatibility. It simply returns - * the MIME type string unchanged. - * - * @param type The MIME type. - * - * @return The MIME type. - * - * @deprecated - */ + * This method exists for backward compatibility. It simply returns + * the MIME type string unchanged. + * + * @param type The MIME type. + * + * @return The MIME type. + * + * @deprecated + */ protected String normalizeMimeType(String type) { @@ -818,12 +819,12 @@ normalizeMimeType(String type) /*************************************************************************/ /** - * Serialize this class. - * - * @param stream The ObjectOutput stream to serialize to. - * - * @exception IOException If an error occurs. - */ + * Serialize this class. + * + * @param stream The ObjectOutput stream to serialize to. + * + * @exception IOException If an error occurs. + */ public void writeExternal(ObjectOutput stream) throws IOException { @@ -833,14 +834,14 @@ writeExternal(ObjectOutput stream) throws IOException /*************************************************************************/ /** - * De-serialize this class. - * - * @param stream The ObjectInput stream to deserialize from. - * - * @exception IOException If an error ocurs. - * @exception ClassNotFoundException If the class for an object being restored - * cannot be found. - */ + * De-serialize this class. + * + * @param stream The ObjectInput stream to deserialize from. + * + * @exception IOException If an error ocurs. + * @exception ClassNotFoundException If the class for an object being restored + * cannot be found. + */ public void readExternal(ObjectInput stream) throws IOException, ClassNotFoundException { @@ -850,9 +851,9 @@ readExternal(ObjectInput stream) throws IOException, ClassNotFoundException /*************************************************************************/ /** - * Returns a string representation of this DataFlavor. Including the - * representation class name, MIME type and human presentable name. - */ + * Returns a string representation of this DataFlavor. Including the + * representation class name, MIME type and human presentable name. + */ public String toString() { @@ -867,8 +868,8 @@ toString() /*************************************************************************/ /** - * XXX - Currently returns plainTextFlavor. - */ + * XXX - Currently returns plainTextFlavor. + */ public static final DataFlavor getTextPlainUnicodeFlavor() { @@ -878,10 +879,10 @@ getTextPlainUnicodeFlavor() /*************************************************************************/ /** - * XXX - Currently returns java.io.InputStream. - * - * @since 1.3 - */ + * XXX - Currently returns java.io.InputStream. + * + * @since 1.3 + */ public final Class getDefaultRepresentationClass() { @@ -890,8 +891,8 @@ getDefaultRepresentationClass() /*************************************************************************/ /** - * XXX - Currently returns java.io.InputStream. - */ + * XXX - Currently returns java.io.InputStream. + */ public final String getDefaultRepresentationClassAsString() { @@ -901,15 +902,15 @@ getDefaultRepresentationClassAsString() /*************************************************************************/ /** - * Selects the best supported text flavor on this implementation. - * Returns null when none of the given flavors is liked. - * - * The DataFlavor returned the first data flavor in the - * array that has either a representation class which is (a subclass of) - * Reader or String, or has a representation - * class which is (a subclass of) InputStream and has a - * primary MIME type of "text" and has an supported encoding. - */ + * Selects the best supported text flavor on this implementation. + * Returns null when none of the given flavors is liked. + * + * The DataFlavor returned the first data flavor in the + * array that has either a representation class which is (a subclass of) + * Reader or String, or has a representation + * class which is (a subclass of) InputStream and has a + * primary MIME type of "text" and has an supported encoding. + */ public static final DataFlavor selectBestTextFlavor(DataFlavor[] availableFlavors) { @@ -952,30 +953,30 @@ selectBestTextFlavor(DataFlavor[] availableFlavors) /*************************************************************************/ /** - * Creates a Reader for a given Transferable. - * - * If the representation class is a (subclass of) Reader - * then an instance of the representation class is returned. If the - * representatation class is a String then a - * StringReader is returned. And if the representation class - * is a (subclass of) InputStream and the primary MIME type - * is "text" then a InputStreamReader for the correct charset - * encoding is returned. - * - * @param transferable The Transferable for which a text - * Reader is requested. - * - * @exception IllegalArgumentException If the representation class is not one - * of the seven listed above or the Transferable has null data. - * @exception NullPointerException If the Transferable is null. - * @exception UnsupportedFlavorException when the transferable doesn't - * support this DataFlavor. Or if the representable class - * isn't a (subclass of) Reader, String, - * InputStream and/or the primary MIME type isn't "text". - * @exception IOException when any IOException occurs. - * @exception UnsupportedEncodingException if the "charset" isn't supported - * on this platform. - */ + * Creates a Reader for a given Transferable. + * + * If the representation class is a (subclass of) Reader + * then an instance of the representation class is returned. If the + * representatation class is a String then a + * StringReader is returned. And if the representation class + * is a (subclass of) InputStream and the primary MIME type + * is "text" then a InputStreamReader for the correct charset + * encoding is returned. + * + * @param transferable The Transferable for which a text + * Reader is requested. + * + * @exception IllegalArgumentException If the representation class is not one + * of the seven listed above or the Transferable has null data. + * @exception NullPointerException If the Transferable is null. + * @exception UnsupportedFlavorException when the transferable doesn't + * support this DataFlavor. Or if the representable class + * isn't a (subclass of) Reader, String, + * InputStream and/or the primary MIME type isn't "text". + * @exception IOException when any IOException occurs. + * @exception UnsupportedEncodingException if the "charset" isn't supported + * on this platform. + */ public Reader getReaderForText(Transferable transferable) throws UnsupportedFlavorException, IOException { diff --git a/libjava/java/awt/font/TextHitInfo.java b/libjava/java/awt/font/TextHitInfo.java index 903f1f616b9..daeb7c689b3 100644 --- a/libjava/java/awt/font/TextHitInfo.java +++ b/libjava/java/awt/font/TextHitInfo.java @@ -39,76 +39,87 @@ package java.awt.font; /** * @author John Leuner - * - * */ - -public final class TextHitInfo { - +public final class TextHitInfo +{ + private int charIndex; + private boolean leadingEdge; + + TextHitInfo (int charIndex, boolean leadingEdge) + { + this.charIndex = charIndex; + this.leadingEdge = leadingEdge; + } + public int getCharIndex() { - return -1; + return charIndex; } public boolean isLeadingEdge() { - return false; + return leadingEdge; } public int getInsertionIndex() { - return -1; + return (leadingEdge ? charIndex : charIndex + 1); } public int hashCode() { - return getCharIndex(); + return charIndex; } public boolean equals(Object obj) { if(obj instanceof TextHitInfo) return this.equals((TextHitInfo) obj); + return false; } public boolean equals(TextHitInfo hitInfo) { - return (getCharIndex() == hitInfo.getCharIndex()) && (isLeadingEdge() == hitInfo.isLeadingEdge()); + return (charIndex == hitInfo.getCharIndex ()) + && (leadingEdge == hitInfo.isLeadingEdge ()); } public static TextHitInfo leading(int charIndex) { - return new TextHitInfo(); + return new TextHitInfo (charIndex, true); } public static TextHitInfo trailing(int charIndex) { - return new TextHitInfo(); + return new TextHitInfo (charIndex, false); } public static TextHitInfo beforeOffset(int offset) { - return new TextHitInfo(); + return new TextHitInfo (offset, false); } public static TextHitInfo afterOffset(int offset) { - return new TextHitInfo(); + return new TextHitInfo (offset, true); } public TextHitInfo getOtherHit() { - return new TextHitInfo(); + return (leadingEdge ? trailing (charIndex - 1) : leading (charIndex + 1)); } public TextHitInfo getOffsetHit(int offset) { - return new TextHitInfo(); + return new TextHitInfo (charIndex + offset, leadingEdge); } public String toString() { - return ""; + return "TextHitInfo[" + + charIndex + + (leadingEdge ? "L" : "T" ) + + "]"; } } diff --git a/libjava/java/awt/image/BufferedImage.java b/libjava/java/awt/image/BufferedImage.java index bf6c45cab99..5d72288f589 100644 --- a/libjava/java/awt/image/BufferedImage.java +++ b/libjava/java/awt/image/BufferedImage.java @@ -53,8 +53,8 @@ import gnu.java.awt.ComponentDataBlitOp; * * @author Rolf W. Rasmussen */ -public class BufferedImage extends java.awt.Image - //implements java.awt.image.WritableRenderedImage +public class BufferedImage extends Image + implements WritableRenderedImage { public static final int TYPE_CUSTOM = 0, TYPE_INT_RGB = 1, @@ -88,6 +88,8 @@ public class BufferedImage extends java.awt.Image 0x03e0, 0x001f, DataBuffer.TYPE_USHORT}; + + Vector observers; public BufferedImage(int w, int h, int type) { @@ -569,4 +571,33 @@ public class BufferedImage extends java.awt.Image // FIXME: implement: return super.toString(); } + + /** + * Adds a tile observer. If the observer is already present, it receives + * multiple notifications. + * + * @param to The TileObserver to add. + */ + public void addTileObserver (TileObserver to) + { + if (observers == null) + observers = new Vector (); + + observers.add (to); + } + + /** + * Removes a tile observer. If the observer was not registered, + * nothing happens. If the observer was registered for multiple + * notifications, it is now registered for one fewer notification. + * + * @param to The TileObserver to remove. + */ + public void removeTileObserver (TileObserver to) + { + if (observers == null) + return; + + observers.remove (to); + } }