Commit 76c16dd4 by Michael Koch Committed by Michael Koch

2003-03-10 Michael Koch <konqueror@gmx.de>

	* 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
parent e0fd3e7a
2003-03-10 Michael Koch <konqueror@gmx.de>
* 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 <tromey@redhat.com> 2003-03-09 Tom Tromey <tromey@redhat.com>
PR libgcj/9934: PR libgcj/9934:
......
...@@ -39,26 +39,63 @@ exception statement from your version. */ ...@@ -39,26 +39,63 @@ exception statement from your version. */
package java.awt; package java.awt;
/** /**
* STUB CLASS ONLY * @since 1.4
*/ */
public abstract class FocusTraversalPolicy public abstract class FocusTraversalPolicy
{ {
/**
* Creates a <code>FocusTraversalPolicy</code> object.
*/
public FocusTraversalPolicy() 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, public abstract Component getComponentAfter(Container root,
Component current); 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, public abstract Component getComponentBefore(Container root,
Component current); Component current);
/**
* Returns the first Component in the traversal cycle.
*
* @exception IllegalArgumentException If root is null.
*/
public abstract Component getFirstComponent(Container root); 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); public abstract Component getLastComponent(Container root);
/**
* Returns the default Component to focus.
*
* @exception IllegalArgumentException If root is null.
*/
public abstract Component getDefaultComponent(Container root); 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) public Component getInitialComponent(Window window)
{ {
return getDefaultComponent(window); return getDefaultComponent(window);
......
...@@ -503,30 +503,30 @@ public class Window extends Container ...@@ -503,30 +503,30 @@ public class Window extends Container
{ {
if (windowListener != null) if (windowListener != null)
{ {
switch (evt.getID()) switch (evt.getID())
{ {
case WindowEvent.WINDOW_ACTIVATED: case WindowEvent.WINDOW_ACTIVATED:
windowListener.windowActivated(evt); windowListener.windowActivated(evt);
break; break;
case WindowEvent.WINDOW_CLOSED: case WindowEvent.WINDOW_CLOSED:
windowListener.windowClosed(evt); windowListener.windowClosed(evt);
break; break;
case WindowEvent.WINDOW_CLOSING: case WindowEvent.WINDOW_CLOSING:
windowListener.windowClosing(evt); windowListener.windowClosing(evt);
break; break;
case WindowEvent.WINDOW_DEACTIVATED: case WindowEvent.WINDOW_DEACTIVATED:
windowListener.windowDeactivated(evt); windowListener.windowDeactivated(evt);
break; break;
case WindowEvent.WINDOW_DEICONIFIED: case WindowEvent.WINDOW_DEICONIFIED:
windowListener.windowDeiconified(evt); windowListener.windowDeiconified(evt);
break; break;
case WindowEvent.WINDOW_ICONIFIED: case WindowEvent.WINDOW_ICONIFIED:
windowListener.windowIconified(evt); windowListener.windowIconified(evt);
break; break;
case WindowEvent.WINDOW_OPENED: case WindowEvent.WINDOW_OPENED:
windowListener.windowOpened(evt); windowListener.windowOpened(evt);
break; break;
} }
} }
} }
......
...@@ -51,11 +51,11 @@ import java.nio.ByteBuffer; ...@@ -51,11 +51,11 @@ import java.nio.ByteBuffer;
import java.nio.CharBuffer; import java.nio.CharBuffer;
/** /**
* This class represents a particular data format used for transferring * This class represents a particular data format used for transferring
* data via the clipboard. * data via the clipboard.
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public class DataFlavor implements java.io.Externalizable, Cloneable public class DataFlavor implements java.io.Externalizable, Cloneable
{ {
static final long serialVersionUID = 8367026044764648243L; static final long serialVersionUID = 8367026044764648243L;
...@@ -67,50 +67,50 @@ public class DataFlavor implements java.io.Externalizable, Cloneable ...@@ -67,50 +67,50 @@ public class DataFlavor implements java.io.Externalizable, Cloneable
*/ */
/** /**
* This is the data flavor used for tranferring plain text. The MIME * This is the data flavor used for tranferring plain text. The MIME
* type is "text/plain; charset=unicode". The representation class * type is "text/plain; charset=unicode". The representation class
* is <code>java.io.InputStream</code>. * is <code>java.io.InputStream</code>.
* *
* @deprecated The charset unicode is platform specific and InputStream * @deprecated The charset unicode is platform specific and InputStream
* deals with bytes not chars. Use <code>getRederForText()</code>. * deals with bytes not chars. Use <code>getRederForText()</code>.
*/ */
public static final DataFlavor plainTextFlavor; public static final DataFlavor plainTextFlavor;
/** /**
* This is the data flavor used for transferring Java strings. The * This is the data flavor used for transferring Java strings. The
* MIME type is "application/x-java-serialized-object" and the * MIME type is "application/x-java-serialized-object" and the
* representation class is <code>java.lang.String</code>. * representation class is <code>java.lang.String</code>.
*/ */
public static final DataFlavor stringFlavor; public static final DataFlavor stringFlavor;
/** /**
* This is a data flavor used for transferring lists of files. The * This is a data flavor used for transferring lists of files. The
* representation type is a <code>java.util.List</code>, with each element of * representation type is a <code>java.util.List</code>, with each element of
* the list being a <code>java.io.File</code>. * the list being a <code>java.io.File</code>.
*/ */
public static final DataFlavor javaFileListFlavor; public static final DataFlavor javaFileListFlavor;
public static final DataFlavor imageFlavor; public static final DataFlavor imageFlavor;
/** /**
* This is the MIME type used for transferring a serialized object. * This is the MIME type used for transferring a serialized object.
* The representation class is the type of object be deserialized. * The representation class is the type of object be deserialized.
*/ */
public static final String javaSerializedObjectMimeType = public static final String javaSerializedObjectMimeType =
"application/x-java-serialized-object"; "application/x-java-serialized-object";
/** /**
* This is the MIME type used to transfer a Java object reference within * 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 * the same JVM. The representation class is the class of the object
* being transferred. * being transferred.
*/ */
public static final String javaJVMLocalObjectMimeType = public static final String javaJVMLocalObjectMimeType =
"application/x-java-jvm-local-object"; "application/x-java-jvm-local-object";
/** /**
* This is the MIME type used to transfer a link to a remote 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. * The representation class is the type of object being linked to.
*/ */
public static final String javaRemoteObjectMimeType = public static final String javaRemoteObjectMimeType =
"application/x-java-remote-object"; "application/x-java-remote-object";
...@@ -158,17 +158,17 @@ private String humanPresentableName; ...@@ -158,17 +158,17 @@ private String humanPresentableName;
*/ */
/** /**
* This method attempts to load the named class. The following class * This method attempts to load the named class. The following class
* loaders are searched in order: the bootstrap class loader, the * loaders are searched in order: the bootstrap class loader, the
* system class loader, the context class loader (if it exists), and * system class loader, the context class loader (if it exists), and
* the specified fallback class loader. * the specified fallback class loader.
* *
* @param className The name of the class to load. * @param className The name of the class to load.
* @param classLoader The class loader to use if all others fail, which * @param classLoader The class loader to use if all others fail, which
* may be <code>null</code>. * may be <code>null</code>.
* *
* @exception ClassNotFoundException If the class cannot be loaded. * @exception ClassNotFoundException If the class cannot be loaded.
*/ */
protected static final Class protected static final Class
tryToLoadClass(String className, ClassLoader classLoader) tryToLoadClass(String className, ClassLoader classLoader)
throws ClassNotFoundException throws ClassNotFoundException
...@@ -214,9 +214,9 @@ tryToLoadClass(String className, ClassLoader classLoader) ...@@ -214,9 +214,9 @@ tryToLoadClass(String className, ClassLoader classLoader)
*/ */
/** /**
* Empty public constructor needed for externalization. * Empty public constructor needed for externalization.
* Should not be used for normal instantiation. * Should not be used for normal instantiation.
*/ */
public public
DataFlavor() DataFlavor()
{ {
...@@ -228,8 +228,8 @@ DataFlavor() ...@@ -228,8 +228,8 @@ DataFlavor()
/*************************************************************************/ /*************************************************************************/
/** /**
* Private constructor. * Private constructor.
*/ */
private private
DataFlavor(Class representationClass, DataFlavor(Class representationClass,
String mimeType, String mimeType,
...@@ -246,15 +246,15 @@ DataFlavor(Class representationClass, ...@@ -246,15 +246,15 @@ DataFlavor(Class representationClass,
/*************************************************************************/ /*************************************************************************/
/** /**
* Initializes a new instance of <code>DataFlavor</code>. The class * Initializes a new instance of <code>DataFlavor</code>. The class
* and human readable name are specified, the MIME type will be * and human readable name are specified, the MIME type will be
* "application/x-java-serialized-object". If the human readable name * "application/x-java-serialized-object". If the human readable name
* is not specified (<code>null</code>) then the human readable name * is not specified (<code>null</code>) then the human readable name
* will be the same as the MIME type. * will be the same as the MIME type.
* *
* @param representationClass The representation class for this object. * @param representationClass The representation class for this object.
* @param humanPresentableName The display name of the object. * @param humanPresentableName The display name of the object.
*/ */
public public
DataFlavor(Class representationClass, String humanPresentableName) DataFlavor(Class representationClass, String humanPresentableName)
{ {
...@@ -268,23 +268,23 @@ DataFlavor(Class representationClass, String humanPresentableName) ...@@ -268,23 +268,23 @@ DataFlavor(Class representationClass, String humanPresentableName)
/*************************************************************************/ /*************************************************************************/
/** /**
* Initializes a new instance of <code>DataFlavor</code> with the * Initializes a new instance of <code>DataFlavor</code> with the
* specified MIME type and description. If the MIME type has a * specified MIME type and description. If the MIME type has a
* "class=<rep class>" parameter then the representation class will * "class=<rep class>" parameter then the representation class will
* be the class name specified. Otherwise the class defaults to * be the class name specified. Otherwise the class defaults to
* <code>java.io.InputStream</code>. If the human readable name * <code>java.io.InputStream</code>. If the human readable name
* is not specified (<code>null</code>) then the human readable name * is not specified (<code>null</code>) then the human readable name
* will be the same as the MIME type. * will be the same as the MIME type.
* *
* @param mimeType The MIME type for this flavor. * @param mimeType The MIME type for this flavor.
* @param humanPresentableName The display name of this flavor. * @param humanPresentableName The display name of this flavor.
* @param classLoader The class loader for finding classes if the default * @param classLoader The class loader for finding classes if the default
* class loaders do not work. * class loaders do not work.
* *
* @exception IllegalArgumentException If the representation class * @exception IllegalArgumentException If the representation class
* specified cannot be loaded. * specified cannot be loaded.
* @exception ClassNotFoundException If the class is not loaded. * @exception ClassNotFoundException If the class is not loaded.
*/ */
public public
DataFlavor(String mimeType, String humanPresentableName, DataFlavor(String mimeType, String humanPresentableName,
ClassLoader classLoader) throws ClassNotFoundException ClassLoader classLoader) throws ClassNotFoundException
...@@ -317,22 +317,22 @@ getRepresentationClassFromMime(String mimeString, ClassLoader classLoader) ...@@ -317,22 +317,22 @@ getRepresentationClassFromMime(String mimeString, ClassLoader classLoader)
/*************************************************************************/ /*************************************************************************/
/** /**
* Initializes a new instance of <code>DataFlavor</code> with the * Initializes a new instance of <code>DataFlavor</code> with the
* specified MIME type and description. If the MIME type has a * specified MIME type and description. If the MIME type has a
* "class=<rep class>" parameter then the representation class will * "class=<rep class>" parameter then the representation class will
* be the class name specified. Otherwise the class defaults to * be the class name specified. Otherwise the class defaults to
* <code>java.io.InputStream</code>. If the human readable name * <code>java.io.InputStream</code>. If the human readable name
* is not specified (<code>null</code>) then the human readable name * is not specified (<code>null</code>) then the human readable name
* will be the same as the MIME type. This is the same as calling * will be the same as the MIME type. This is the same as calling
* <code>new DataFlavor(mimeType, humanPresentableName, null)</code>. * <code>new DataFlavor(mimeType, humanPresentableName, null)</code>.
* *
* @param mimeType The MIME type for this flavor. * @param mimeType The MIME type for this flavor.
* @param humanPresentableName The display name of this flavor. * @param humanPresentableName The display name of this flavor.
* @param classLoader The class loader for finding classes. * @param classLoader The class loader for finding classes.
* *
* @exception IllegalArgumentException If the representation class * @exception IllegalArgumentException If the representation class
* specified cannot be loaded. * specified cannot be loaded.
*/ */
public public
DataFlavor(String mimeType, String humanPresentableName) DataFlavor(String mimeType, String humanPresentableName)
throws ClassNotFoundException throws ClassNotFoundException
...@@ -343,19 +343,19 @@ DataFlavor(String mimeType, String humanPresentableName) ...@@ -343,19 +343,19 @@ DataFlavor(String mimeType, String humanPresentableName)
/*************************************************************************/ /*************************************************************************/
/** /**
* Initializes a new instance of <code>DataFlavor</code> with the specified * Initializes a new instance of <code>DataFlavor</code> with the specified
* MIME type. This type can have a "class=" parameter to specify the * MIME type. This type can have a "class=" parameter to specify the
* representation class, and then the class must exist or an exception will * representation class, and then the class must exist or an exception will
* be thrown. If there is no "class=" parameter then the representation class * be thrown. If there is no "class=" parameter then the representation class
* will be <code>java.io.InputStream</code>. This is the same as calling * will be <code>java.io.InputStream</code>. This is the same as calling
* <code>new DataFlavor(mimeType, null)</code>. * <code>new DataFlavor(mimeType, null)</code>.
* *
* @param mimeType The MIME type for this flavor. * @param mimeType The MIME type for this flavor.
* *
* @exception IllegalArgumentException If a class is not specified in * @exception IllegalArgumentException If a class is not specified in
* the MIME type. * the MIME type.
* @exception ClassNotFoundException If the class cannot be loaded. * @exception ClassNotFoundException If the class cannot be loaded.
*/ */
public public
DataFlavor(String mimeType) throws ClassNotFoundException DataFlavor(String mimeType) throws ClassNotFoundException
{ {
...@@ -365,10 +365,10 @@ DataFlavor(String mimeType) throws ClassNotFoundException ...@@ -365,10 +365,10 @@ DataFlavor(String mimeType) throws ClassNotFoundException
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the MIME type of this flavor. * Returns the MIME type of this flavor.
* *
* @return The MIME type for this flavor. * @return The MIME type for this flavor.
*/ */
public String public String
getMimeType() getMimeType()
{ {
...@@ -378,10 +378,10 @@ getMimeType() ...@@ -378,10 +378,10 @@ getMimeType()
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the representation class for this flavor. * Returns the representation class for this flavor.
* *
* @return The representation class for this flavor. * @return The representation class for this flavor.
*/ */
public Class public Class
getRepresentationClass() getRepresentationClass()
{ {
...@@ -391,10 +391,10 @@ getRepresentationClass() ...@@ -391,10 +391,10 @@ getRepresentationClass()
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the human presentable name for this flavor. * Returns the human presentable name for this flavor.
* *
* @return The human presentable name for this flavor. * @return The human presentable name for this flavor.
*/ */
public String public String
getHumanPresentableName() getHumanPresentableName()
{ {
...@@ -404,10 +404,10 @@ getHumanPresentableName() ...@@ -404,10 +404,10 @@ getHumanPresentableName()
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the primary MIME type for this flavor. * Returns the primary MIME type for this flavor.
* *
* @return The primary MIME type for this flavor. * @return The primary MIME type for this flavor.
*/ */
public String public String
getPrimaryType() getPrimaryType()
{ {
...@@ -421,10 +421,10 @@ getPrimaryType() ...@@ -421,10 +421,10 @@ getPrimaryType()
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the MIME subtype for this flavor. * Returns the MIME subtype for this flavor.
* *
* @return The MIME subtype for this flavor. * @return The MIME subtype for this flavor.
*/ */
public String public String
getSubType() getSubType()
{ {
...@@ -444,15 +444,15 @@ getSubType() ...@@ -444,15 +444,15 @@ getSubType()
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the value of the named MIME type parameter, or <code>null</code> * Returns the value of the named MIME type parameter, or <code>null</code>
* if the parameter does not exist. Given the parameter name and the mime * if the parameter does not exist. Given the parameter name and the mime
* string. * string.
* *
* @param paramName The name of the parameter. * @param paramName The name of the parameter.
* @param mimeString The mime string from where the name should be found. * @param mimeString The mime string from where the name should be found.
* *
* @return The value of the parameter or null. * @return The value of the parameter or null.
*/ */
private static String private static String
getParameter(String paramName, String mimeString) getParameter(String paramName, String mimeString)
{ {
...@@ -470,14 +470,15 @@ getParameter(String paramName, String mimeString) ...@@ -470,14 +470,15 @@ getParameter(String paramName, String mimeString)
} }
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the value of the named MIME type parameter, or <code>null</code> * Returns the value of the named MIME type parameter, or <code>null</code>
* if the parameter does not exist. * if the parameter does not exist.
* *
* @param paramName The name of the paramter. * @param paramName The name of the paramter.
* *
* @return The value of the parameter. * @return The value of the parameter.
*/ */
public String public String
getParameter(String paramName) getParameter(String paramName)
{ {
...@@ -487,10 +488,10 @@ getParameter(String paramName) ...@@ -487,10 +488,10 @@ getParameter(String paramName)
/*************************************************************************/ /*************************************************************************/
/** /**
* Sets the human presentable name to the specified value. * Sets the human presentable name to the specified value.
* *
* @param humanPresentableName The new display name. * @param humanPresentableName The new display name.
*/ */
public void public void
setHumanPresentableName(String humanPresentableName) setHumanPresentableName(String humanPresentableName)
{ {
...@@ -500,16 +501,16 @@ setHumanPresentableName(String humanPresentableName) ...@@ -500,16 +501,16 @@ setHumanPresentableName(String humanPresentableName)
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests the MIME type of this object for equality against the specified * Tests the MIME type of this object for equality against the specified
* MIME type. * MIME type.
* *
* @param mimeType The MIME type to test against. * @param mimeType The MIME type to test against.
* *
* @return <code>true</code> if the MIME type is equal to this object's * @return <code>true</code> if the MIME type is equal to this object's
* MIME type, <code>false</code> otherwise. * MIME type, <code>false</code> otherwise.
* *
* @exception NullPointerException If mimeType is null. * @exception NullPointerException If mimeType is null.
*/ */
public boolean public boolean
isMimeTypeEqual(String mimeType) isMimeTypeEqual(String mimeType)
{ {
...@@ -521,14 +522,14 @@ isMimeTypeEqual(String mimeType) ...@@ -521,14 +522,14 @@ isMimeTypeEqual(String mimeType)
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests the MIME type of this object for equality against the specified * Tests the MIME type of this object for equality against the specified
* data flavor's MIME type * data flavor's MIME type
* *
* @param flavor The flavor to test against. * @param flavor The flavor to test against.
* *
* @return <code>true</code> if the flavor's MIME type is equal to this * @return <code>true</code> if the flavor's MIME type is equal to this
* object's MIME type, <code>false</code> otherwise. * object's MIME type, <code>false</code> otherwise.
*/ */
public boolean public boolean
isMimeTypeEqual(DataFlavor flavor) isMimeTypeEqual(DataFlavor flavor)
{ {
...@@ -538,11 +539,11 @@ isMimeTypeEqual(DataFlavor flavor) ...@@ -538,11 +539,11 @@ isMimeTypeEqual(DataFlavor flavor)
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether or not this flavor represents a serialized object. * Tests whether or not this flavor represents a serialized object.
* *
* @return <code>true</code> if this flavor represents a serialized * @return <code>true</code> if this flavor represents a serialized
* object, <code>false</code> otherwise. * object, <code>false</code> otherwise.
*/ */
public boolean public boolean
isMimeTypeSerializedObject() isMimeTypeSerializedObject()
{ {
...@@ -552,12 +553,12 @@ isMimeTypeSerializedObject() ...@@ -552,12 +553,12 @@ isMimeTypeSerializedObject()
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether or not this flavor has a representation class of * Tests whether or not this flavor has a representation class of
* <code>java.io.InputStream</code>. * <code>java.io.InputStream</code>.
* *
* @param <code>true</code> if the representation class of this flavor * @param <code>true</code> if the representation class of this flavor
* is <code>java.io.InputStream</code>, <code>false</code> otherwise. * is <code>java.io.InputStream</code>, <code>false</code> otherwise.
*/ */
public boolean public boolean
isRepresentationClassInputStream() isRepresentationClassInputStream()
{ {
...@@ -567,12 +568,12 @@ isRepresentationClassInputStream() ...@@ -567,12 +568,12 @@ isRepresentationClassInputStream()
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether the representation class for this flavor is * Tests whether the representation class for this flavor is
* serializable. * serializable.
* *
* @param <code>true</code> if the representation class is serializable, * @param <code>true</code> if the representation class is serializable,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean
isRepresentationClassSerializable() isRepresentationClassSerializable()
{ {
...@@ -592,11 +593,11 @@ isRepresentationClassSerializable() ...@@ -592,11 +593,11 @@ isRepresentationClassSerializable()
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether the representation class for his flavor is remote. * Tests whether the representation class for his flavor is remote.
* *
* @return <code>true</code> if the representation class is remote, * @return <code>true</code> if the representation class is remote,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean
isRepresentationClassRemote() isRepresentationClassRemote()
{ {
...@@ -607,11 +608,11 @@ isRepresentationClassRemote() ...@@ -607,11 +608,11 @@ isRepresentationClassRemote()
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether or not this flavor represents a serialized object. * Tests whether or not this flavor represents a serialized object.
* *
* @return <code>true</code> if this flavor represents a serialized * @return <code>true</code> if this flavor represents a serialized
* object, <code>false</code> otherwise. * object, <code>false</code> otherwise.
*/ */
public boolean public boolean
isFlavorSerializedObjectType() isFlavorSerializedObjectType()
{ {
...@@ -622,11 +623,11 @@ isFlavorSerializedObjectType() ...@@ -622,11 +623,11 @@ isFlavorSerializedObjectType()
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether or not this flavor represents a remote object. * Tests whether or not this flavor represents a remote object.
* *
* @return <code>true</code> if this flavor represents a remote object, * @return <code>true</code> if this flavor represents a remote object,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean
isFlavorRemoteObjectType() isFlavorRemoteObjectType()
{ {
...@@ -636,11 +637,11 @@ isFlavorRemoteObjectType() ...@@ -636,11 +637,11 @@ isFlavorRemoteObjectType()
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether or not this flavor represents a list of files. * Tests whether or not this flavor represents a list of files.
* *
* @return <code>true</code> if this flavor represents a list of files, * @return <code>true</code> if this flavor represents a list of files,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean
isFlavorJavaFileListType() isFlavorJavaFileListType()
{ {
...@@ -654,14 +655,14 @@ isFlavorJavaFileListType() ...@@ -654,14 +655,14 @@ isFlavorJavaFileListType()
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns a copy of this object. * Returns a copy of this object.
* *
* @return A copy of this object. * @return A copy of this object.
* *
* @exception CloneNotSupportedException If the object's class does not support * @exception CloneNotSupportedException If the object's class does not support
* the Cloneable interface. Subclasses that override the clone method can also * the Cloneable interface. Subclasses that override the clone method can also
* throw this exception to indicate that an instance cannot be cloned. * throw this exception to indicate that an instance cannot be cloned.
*/ */
public Object clone () throws CloneNotSupportedException public Object clone () throws CloneNotSupportedException
{ {
try try
...@@ -677,15 +678,15 @@ public Object clone () throws CloneNotSupportedException ...@@ -677,15 +678,15 @@ public Object clone () throws CloneNotSupportedException
/*************************************************************************/ /*************************************************************************/
/** /**
* This method test the specified <code>DataFlavor</code> for equality * This method test the specified <code>DataFlavor</code> for equality
* against this object. This will be true if the MIME type and * against this object. This will be true if the MIME type and
* representation type are the equal. * representation type are the equal.
* *
* @param flavor The <code>DataFlavor</code> to test against. * @param flavor The <code>DataFlavor</code> to test against.
* *
* @return <code>true</code> if the flavor is equal to this object, * @return <code>true</code> if the flavor is equal to this object,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean
equals(DataFlavor flavor) equals(DataFlavor flavor)
{ {
...@@ -704,22 +705,22 @@ equals(DataFlavor flavor) ...@@ -704,22 +705,22 @@ equals(DataFlavor flavor)
/*************************************************************************/ /*************************************************************************/
/** /**
* This method test the specified <code>Object</code> for equality * This method test the specified <code>Object</code> for equality
* against this object. This will be true if the following conditions * against this object. This will be true if the following conditions
* are met: * are met:
* <p> * <p>
* <ul> * <ul>
* <li>The object is not <code>null</code>. * <li>The object is not <code>null</code>.
* <li>The object is an instance of <code>DataFlavor</code>. * <li>The object is an instance of <code>DataFlavor</code>.
* <li>The object's MIME type and representation class are equal to * <li>The object's MIME type and representation class are equal to
* this object's. * this object's.
* </ul> * </ul>
* *
* @param obj The <code>Object</code> to test against. * @param obj The <code>Object</code> to test against.
* *
* @return <code>true</code> if the flavor is equal to this object, * @return <code>true</code> if the flavor is equal to this object,
* <code>false</code> otherwise. * <code>false</code> otherwise.
*/ */
public boolean public boolean
equals(Object obj) equals(Object obj)
{ {
...@@ -735,17 +736,17 @@ equals(Object obj) ...@@ -735,17 +736,17 @@ equals(Object obj)
/*************************************************************************/ /*************************************************************************/
/** /**
* Tests whether or not the specified string is equal to the MIME type * Tests whether or not the specified string is equal to the MIME type
* of this object. * of this object.
* *
* @param str The string to test against. * @param str The string to test against.
* *
* @return <code>true</code> if the string is equal to this object's MIME * @return <code>true</code> if the string is equal to this object's MIME
* type, <code>false</code> otherwise. * type, <code>false</code> otherwise.
* *
* @deprecated Not compatible with <code>hashCode()</code>. * @deprecated Not compatible with <code>hashCode()</code>.
* Use <code>isMimeTypeEqual()</code> * Use <code>isMimeTypeEqual()</code>
*/ */
public boolean public boolean
equals(String str) equals(String str)
{ {
...@@ -755,10 +756,10 @@ equals(String str) ...@@ -755,10 +756,10 @@ equals(String str)
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns the hash code for this data flavor. * Returns the hash code for this data flavor.
* The hash code is based on the (lower case) mime type and the * The hash code is based on the (lower case) mime type and the
* representation class. * representation class.
*/ */
public int public int
hashCode() hashCode()
{ {
...@@ -768,9 +769,9 @@ hashCode() ...@@ -768,9 +769,9 @@ hashCode()
/*************************************************************************/ /*************************************************************************/
/** /**
* Returns <code>true</code> when the given <code>DataFlavor</code> * Returns <code>true</code> when the given <code>DataFlavor</code>
* matches this one. * matches this one.
*/ */
public boolean public boolean
match(DataFlavor dataFlavor) match(DataFlavor dataFlavor)
{ {
...@@ -781,16 +782,16 @@ match(DataFlavor dataFlavor) ...@@ -781,16 +782,16 @@ match(DataFlavor dataFlavor)
/*************************************************************************/ /*************************************************************************/
/** /**
* This method exists for backward compatibility. It simply returns * This method exists for backward compatibility. It simply returns
* the same name/value pair passed in. * the same name/value pair passed in.
* *
* @param name The parameter name. * @param name The parameter name.
* @param value The parameter value. * @param value The parameter value.
* *
* @return The name/value pair. * @return The name/value pair.
* *
* @deprecated * @deprecated
*/ */
protected String protected String
normalizeMimeTypeParameter(String name, String value) normalizeMimeTypeParameter(String name, String value)
{ {
...@@ -800,15 +801,15 @@ normalizeMimeTypeParameter(String name, String value) ...@@ -800,15 +801,15 @@ normalizeMimeTypeParameter(String name, String value)
/*************************************************************************/ /*************************************************************************/
/** /**
* This method exists for backward compatibility. It simply returns * This method exists for backward compatibility. It simply returns
* the MIME type string unchanged. * the MIME type string unchanged.
* *
* @param type The MIME type. * @param type The MIME type.
* *
* @return The MIME type. * @return The MIME type.
* *
* @deprecated * @deprecated
*/ */
protected String protected String
normalizeMimeType(String type) normalizeMimeType(String type)
{ {
...@@ -818,12 +819,12 @@ normalizeMimeType(String type) ...@@ -818,12 +819,12 @@ normalizeMimeType(String type)
/*************************************************************************/ /*************************************************************************/
/** /**
* Serialize this class. * Serialize this class.
* *
* @param stream The <code>ObjectOutput</code> stream to serialize to. * @param stream The <code>ObjectOutput</code> stream to serialize to.
* *
* @exception IOException If an error occurs. * @exception IOException If an error occurs.
*/ */
public void public void
writeExternal(ObjectOutput stream) throws IOException writeExternal(ObjectOutput stream) throws IOException
{ {
...@@ -833,14 +834,14 @@ writeExternal(ObjectOutput stream) throws IOException ...@@ -833,14 +834,14 @@ writeExternal(ObjectOutput stream) throws IOException
/*************************************************************************/ /*************************************************************************/
/** /**
* De-serialize this class. * De-serialize this class.
* *
* @param stream The <code>ObjectInput</code> stream to deserialize from. * @param stream The <code>ObjectInput</code> stream to deserialize from.
* *
* @exception IOException If an error ocurs. * @exception IOException If an error ocurs.
* @exception ClassNotFoundException If the class for an object being restored * @exception ClassNotFoundException If the class for an object being restored
* cannot be found. * cannot be found.
*/ */
public void public void
readExternal(ObjectInput stream) throws IOException, ClassNotFoundException readExternal(ObjectInput stream) throws IOException, ClassNotFoundException
{ {
...@@ -850,9 +851,9 @@ 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 * Returns a string representation of this DataFlavor. Including the
* representation class name, MIME type and human presentable name. * representation class name, MIME type and human presentable name.
*/ */
public String public String
toString() toString()
{ {
...@@ -867,8 +868,8 @@ toString() ...@@ -867,8 +868,8 @@ toString()
/*************************************************************************/ /*************************************************************************/
/** /**
* XXX - Currently returns <code>plainTextFlavor</code>. * XXX - Currently returns <code>plainTextFlavor</code>.
*/ */
public static final DataFlavor public static final DataFlavor
getTextPlainUnicodeFlavor() getTextPlainUnicodeFlavor()
{ {
...@@ -878,10 +879,10 @@ getTextPlainUnicodeFlavor() ...@@ -878,10 +879,10 @@ getTextPlainUnicodeFlavor()
/*************************************************************************/ /*************************************************************************/
/** /**
* XXX - Currently returns <code>java.io.InputStream</code>. * XXX - Currently returns <code>java.io.InputStream</code>.
* *
* @since 1.3 * @since 1.3
*/ */
public final Class public final Class
getDefaultRepresentationClass() getDefaultRepresentationClass()
{ {
...@@ -890,8 +891,8 @@ getDefaultRepresentationClass() ...@@ -890,8 +891,8 @@ getDefaultRepresentationClass()
/*************************************************************************/ /*************************************************************************/
/** /**
* XXX - Currently returns <code>java.io.InputStream</code>. * XXX - Currently returns <code>java.io.InputStream</code>.
*/ */
public final String public final String
getDefaultRepresentationClassAsString() getDefaultRepresentationClassAsString()
{ {
...@@ -901,15 +902,15 @@ getDefaultRepresentationClassAsString() ...@@ -901,15 +902,15 @@ getDefaultRepresentationClassAsString()
/*************************************************************************/ /*************************************************************************/
/** /**
* Selects the best supported text flavor on this implementation. * Selects the best supported text flavor on this implementation.
* Returns <code>null</code> when none of the given flavors is liked. * Returns <code>null</code> when none of the given flavors is liked.
* *
* The <code>DataFlavor</code> returned the first data flavor in the * The <code>DataFlavor</code> returned the first data flavor in the
* array that has either a representation class which is (a subclass of) * array that has either a representation class which is (a subclass of)
* <code>Reader</code> or <code>String</code>, or has a representation * <code>Reader</code> or <code>String</code>, or has a representation
* class which is (a subclass of) <code>InputStream</code> and has a * class which is (a subclass of) <code>InputStream</code> and has a
* primary MIME type of "text" and has an supported encoding. * primary MIME type of "text" and has an supported encoding.
*/ */
public static final DataFlavor public static final DataFlavor
selectBestTextFlavor(DataFlavor[] availableFlavors) selectBestTextFlavor(DataFlavor[] availableFlavors)
{ {
...@@ -952,30 +953,30 @@ selectBestTextFlavor(DataFlavor[] availableFlavors) ...@@ -952,30 +953,30 @@ selectBestTextFlavor(DataFlavor[] availableFlavors)
/*************************************************************************/ /*************************************************************************/
/** /**
* Creates a <code>Reader</code> for a given <code>Transferable</code>. * Creates a <code>Reader</code> for a given <code>Transferable</code>.
* *
* If the representation class is a (subclass of) <code>Reader</code> * If the representation class is a (subclass of) <code>Reader</code>
* then an instance of the representation class is returned. If the * then an instance of the representation class is returned. If the
* representatation class is a <code>String</code> then a * representatation class is a <code>String</code> then a
* <code>StringReader</code> is returned. And if the representation class * <code>StringReader</code> is returned. And if the representation class
* is a (subclass of) <code>InputStream</code> and the primary MIME type * is a (subclass of) <code>InputStream</code> and the primary MIME type
* is "text" then a <code>InputStreamReader</code> for the correct charset * is "text" then a <code>InputStreamReader</code> for the correct charset
* encoding is returned. * encoding is returned.
* *
* @param transferable The <code>Transferable</code> for which a text * @param transferable The <code>Transferable</code> for which a text
* <code>Reader</code> is requested. * <code>Reader</code> is requested.
* *
* @exception IllegalArgumentException If the representation class is not one * @exception IllegalArgumentException If the representation class is not one
* of the seven listed above or the Transferable has null data. * of the seven listed above or the Transferable has null data.
* @exception NullPointerException If the Transferable is null. * @exception NullPointerException If the Transferable is null.
* @exception UnsupportedFlavorException when the transferable doesn't * @exception UnsupportedFlavorException when the transferable doesn't
* support this <code>DataFlavor</code>. Or if the representable class * support this <code>DataFlavor</code>. Or if the representable class
* isn't a (subclass of) <code>Reader</code>, <code>String</code>, * isn't a (subclass of) <code>Reader</code>, <code>String</code>,
* <code>InputStream</code> and/or the primary MIME type isn't "text". * <code>InputStream</code> and/or the primary MIME type isn't "text".
* @exception IOException when any IOException occurs. * @exception IOException when any IOException occurs.
* @exception UnsupportedEncodingException if the "charset" isn't supported * @exception UnsupportedEncodingException if the "charset" isn't supported
* on this platform. * on this platform.
*/ */
public Reader getReaderForText(Transferable transferable) public Reader getReaderForText(Transferable transferable)
throws UnsupportedFlavorException, IOException throws UnsupportedFlavorException, IOException
{ {
......
...@@ -39,76 +39,87 @@ package java.awt.font; ...@@ -39,76 +39,87 @@ package java.awt.font;
/** /**
* @author John Leuner <jewel@debian.org> * @author John Leuner <jewel@debian.org>
*
*
*/ */
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() public int getCharIndex()
{ {
return -1; return charIndex;
} }
public boolean isLeadingEdge() public boolean isLeadingEdge()
{ {
return false; return leadingEdge;
} }
public int getInsertionIndex() public int getInsertionIndex()
{ {
return -1; return (leadingEdge ? charIndex : charIndex + 1);
} }
public int hashCode() public int hashCode()
{ {
return getCharIndex(); return charIndex;
} }
public boolean equals(Object obj) public boolean equals(Object obj)
{ {
if(obj instanceof TextHitInfo) if(obj instanceof TextHitInfo)
return this.equals((TextHitInfo) obj); return this.equals((TextHitInfo) obj);
return false; return false;
} }
public boolean equals(TextHitInfo hitInfo) 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) public static TextHitInfo leading(int charIndex)
{ {
return new TextHitInfo(); return new TextHitInfo (charIndex, true);
} }
public static TextHitInfo trailing(int charIndex) public static TextHitInfo trailing(int charIndex)
{ {
return new TextHitInfo(); return new TextHitInfo (charIndex, false);
} }
public static TextHitInfo beforeOffset(int offset) public static TextHitInfo beforeOffset(int offset)
{ {
return new TextHitInfo(); return new TextHitInfo (offset, false);
} }
public static TextHitInfo afterOffset(int offset) public static TextHitInfo afterOffset(int offset)
{ {
return new TextHitInfo(); return new TextHitInfo (offset, true);
} }
public TextHitInfo getOtherHit() public TextHitInfo getOtherHit()
{ {
return new TextHitInfo(); return (leadingEdge ? trailing (charIndex - 1) : leading (charIndex + 1));
} }
public TextHitInfo getOffsetHit(int offset) public TextHitInfo getOffsetHit(int offset)
{ {
return new TextHitInfo(); return new TextHitInfo (charIndex + offset, leadingEdge);
} }
public String toString() public String toString()
{ {
return ""; return "TextHitInfo["
+ charIndex
+ (leadingEdge ? "L" : "T" )
+ "]";
} }
} }
...@@ -53,8 +53,8 @@ import gnu.java.awt.ComponentDataBlitOp; ...@@ -53,8 +53,8 @@ import gnu.java.awt.ComponentDataBlitOp;
* *
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no> * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
*/ */
public class BufferedImage extends java.awt.Image public class BufferedImage extends Image
//implements java.awt.image.WritableRenderedImage implements WritableRenderedImage
{ {
public static final int TYPE_CUSTOM = 0, public static final int TYPE_CUSTOM = 0,
TYPE_INT_RGB = 1, TYPE_INT_RGB = 1,
...@@ -88,6 +88,8 @@ public class BufferedImage extends java.awt.Image ...@@ -88,6 +88,8 @@ public class BufferedImage extends java.awt.Image
0x03e0, 0x03e0,
0x001f, 0x001f,
DataBuffer.TYPE_USHORT}; DataBuffer.TYPE_USHORT};
Vector observers;
public BufferedImage(int w, int h, int type) public BufferedImage(int w, int h, int type)
{ {
...@@ -569,4 +571,33 @@ public class BufferedImage extends java.awt.Image ...@@ -569,4 +571,33 @@ public class BufferedImage extends java.awt.Image
// FIXME: implement: // FIXME: implement:
return super.toString(); 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);
}
} }
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