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
This commit is contained in:
parent
e0fd3e7af4
commit
76c16dd4c2
6 changed files with 518 additions and 368 deletions
|
@ -1,3 +1,73 @@
|
|||
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>
|
||||
|
||||
PR libgcj/9934:
|
||||
|
|
|
@ -39,26 +39,63 @@ exception statement from your version. */
|
|||
package java.awt;
|
||||
|
||||
/**
|
||||
* STUB CLASS ONLY
|
||||
* @since 1.4
|
||||
*/
|
||||
public abstract class FocusTraversalPolicy
|
||||
{
|
||||
/**
|
||||
* Creates a <code>FocusTraversalPolicy</code> 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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 <code>java.io.InputStream</code>.
|
||||
*
|
||||
* @deprecated The charset unicode is platform specific and InputStream
|
||||
* deals with bytes not chars. Use <code>getRederForText()</code>.
|
||||
*/
|
||||
* This is the data flavor used for tranferring plain text. The MIME
|
||||
* type is "text/plain; charset=unicode". The representation class
|
||||
* is <code>java.io.InputStream</code>.
|
||||
*
|
||||
* @deprecated The charset unicode is platform specific and InputStream
|
||||
* deals with bytes not chars. Use <code>getRederForText()</code>.
|
||||
*/
|
||||
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 <code>java.lang.String</code>.
|
||||
*/
|
||||
* This is the data flavor used for transferring Java strings. The
|
||||
* MIME type is "application/x-java-serialized-object" and the
|
||||
* representation class is <code>java.lang.String</code>.
|
||||
*/
|
||||
public static final DataFlavor stringFlavor;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* the list being a <code>java.io.File</code>.
|
||||
*/
|
||||
* 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
|
||||
* the list being a <code>java.io.File</code>.
|
||||
*/
|
||||
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 <code>null</code>.
|
||||
*
|
||||
* @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 <code>null</code>.
|
||||
*
|
||||
* @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 <code>DataFlavor</code>. 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 (<code>null</code>) 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 <code>DataFlavor</code>. 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 (<code>null</code>) 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 <code>DataFlavor</code> with the
|
||||
* specified MIME type and description. If the MIME type has a
|
||||
* "class=<rep class>" parameter then the representation class will
|
||||
* be the class name specified. Otherwise the class defaults to
|
||||
* <code>java.io.InputStream</code>. If the human readable name
|
||||
* is not specified (<code>null</code>) 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 <code>DataFlavor</code> with the
|
||||
* specified MIME type and description. If the MIME type has a
|
||||
* "class=<rep class>" parameter then the representation class will
|
||||
* be the class name specified. Otherwise the class defaults to
|
||||
* <code>java.io.InputStream</code>. If the human readable name
|
||||
* is not specified (<code>null</code>) 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 <code>DataFlavor</code> with the
|
||||
* specified MIME type and description. If the MIME type has a
|
||||
* "class=<rep class>" parameter then the representation class will
|
||||
* be the class name specified. Otherwise the class defaults to
|
||||
* <code>java.io.InputStream</code>. If 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
|
||||
* <code>new DataFlavor(mimeType, humanPresentableName, null)</code>.
|
||||
*
|
||||
* @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 <code>DataFlavor</code> with the
|
||||
* specified MIME type and description. If the MIME type has a
|
||||
* "class=<rep class>" parameter then the representation class will
|
||||
* be the class name specified. Otherwise the class defaults to
|
||||
* <code>java.io.InputStream</code>. If 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
|
||||
* <code>new DataFlavor(mimeType, humanPresentableName, null)</code>.
|
||||
*
|
||||
* @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 <code>DataFlavor</code> 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 <code>java.io.InputStream</code>. This is the same as calling
|
||||
* <code>new DataFlavor(mimeType, null)</code>.
|
||||
*
|
||||
* @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 <code>DataFlavor</code> 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 <code>java.io.InputStream</code>. This is the same as calling
|
||||
* <code>new DataFlavor(mimeType, null)</code>.
|
||||
*
|
||||
* @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 <code>null</code>
|
||||
* 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 <code>null</code>
|
||||
* 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 <code>null</code>
|
||||
* 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 <code>null</code>
|
||||
* 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 <code>true</code> if the MIME type is equal to this object's
|
||||
* MIME type, <code>false</code> 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 <code>true</code> if the MIME type is equal to this object's
|
||||
* MIME type, <code>false</code> 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 <code>true</code> if the flavor's MIME type is equal to this
|
||||
* object's MIME type, <code>false</code> 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 <code>true</code> if the flavor's MIME type is equal to this
|
||||
* object's MIME type, <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
isMimeTypeEqual(DataFlavor flavor)
|
||||
{
|
||||
|
@ -538,11 +539,11 @@ isMimeTypeEqual(DataFlavor flavor)
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Tests whether or not this flavor represents a serialized object.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a serialized
|
||||
* object, <code>false</code> otherwise.
|
||||
*/
|
||||
* Tests whether or not this flavor represents a serialized object.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a serialized
|
||||
* object, <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
isMimeTypeSerializedObject()
|
||||
{
|
||||
|
@ -552,12 +553,12 @@ isMimeTypeSerializedObject()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Tests whether or not this flavor has a representation class of
|
||||
* <code>java.io.InputStream</code>.
|
||||
*
|
||||
* @param <code>true</code> if the representation class of this flavor
|
||||
* is <code>java.io.InputStream</code>, <code>false</code> otherwise.
|
||||
*/
|
||||
* Tests whether or not this flavor has a representation class of
|
||||
* <code>java.io.InputStream</code>.
|
||||
*
|
||||
* @param <code>true</code> if the representation class of this flavor
|
||||
* is <code>java.io.InputStream</code>, <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
isRepresentationClassInputStream()
|
||||
{
|
||||
|
@ -567,12 +568,12 @@ isRepresentationClassInputStream()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Tests whether the representation class for this flavor is
|
||||
* serializable.
|
||||
*
|
||||
* @param <code>true</code> if the representation class is serializable,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
* Tests whether the representation class for this flavor is
|
||||
* serializable.
|
||||
*
|
||||
* @param <code>true</code> if the representation class is serializable,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
isRepresentationClassSerializable()
|
||||
{
|
||||
|
@ -592,11 +593,11 @@ isRepresentationClassSerializable()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Tests whether the representation class for his flavor is remote.
|
||||
*
|
||||
* @return <code>true</code> if the representation class is remote,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
* Tests whether the representation class for his flavor is remote.
|
||||
*
|
||||
* @return <code>true</code> if the representation class is remote,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
isRepresentationClassRemote()
|
||||
{
|
||||
|
@ -607,11 +608,11 @@ isRepresentationClassRemote()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Tests whether or not this flavor represents a serialized object.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a serialized
|
||||
* object, <code>false</code> otherwise.
|
||||
*/
|
||||
* Tests whether or not this flavor represents a serialized object.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a serialized
|
||||
* object, <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
isFlavorSerializedObjectType()
|
||||
{
|
||||
|
@ -622,11 +623,11 @@ isFlavorSerializedObjectType()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Tests whether or not this flavor represents a remote object.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a remote object,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
* Tests whether or not this flavor represents a remote object.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a remote object,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
isFlavorRemoteObjectType()
|
||||
{
|
||||
|
@ -636,11 +637,11 @@ isFlavorRemoteObjectType()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Tests whether or not this flavor represents a list of files.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a list of files,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
* Tests whether or not this flavor represents a list of files.
|
||||
*
|
||||
* @return <code>true</code> if this flavor represents a list of files,
|
||||
* <code>false</code> 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 <code>DataFlavor</code> for equality
|
||||
* against this object. This will be true if the MIME type and
|
||||
* representation type are the equal.
|
||||
*
|
||||
* @param flavor The <code>DataFlavor</code> to test against.
|
||||
*
|
||||
* @return <code>true</code> if the flavor is equal to this object,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
* This method test the specified <code>DataFlavor</code> for equality
|
||||
* against this object. This will be true if the MIME type and
|
||||
* representation type are the equal.
|
||||
*
|
||||
* @param flavor The <code>DataFlavor</code> to test against.
|
||||
*
|
||||
* @return <code>true</code> if the flavor is equal to this object,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
public boolean
|
||||
equals(DataFlavor flavor)
|
||||
{
|
||||
|
@ -704,22 +705,22 @@ equals(DataFlavor flavor)
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* This method test the specified <code>Object</code> for equality
|
||||
* against this object. This will be true if the following conditions
|
||||
* are met:
|
||||
* <p>
|
||||
* <ul>
|
||||
* <li>The object is not <code>null</code>.
|
||||
* <li>The object is an instance of <code>DataFlavor</code>.
|
||||
* <li>The object's MIME type and representation class are equal to
|
||||
* this object's.
|
||||
* </ul>
|
||||
*
|
||||
* @param obj The <code>Object</code> to test against.
|
||||
*
|
||||
* @return <code>true</code> if the flavor is equal to this object,
|
||||
* <code>false</code> otherwise.
|
||||
*/
|
||||
* This method test the specified <code>Object</code> for equality
|
||||
* against this object. This will be true if the following conditions
|
||||
* are met:
|
||||
* <p>
|
||||
* <ul>
|
||||
* <li>The object is not <code>null</code>.
|
||||
* <li>The object is an instance of <code>DataFlavor</code>.
|
||||
* <li>The object's MIME type and representation class are equal to
|
||||
* this object's.
|
||||
* </ul>
|
||||
*
|
||||
* @param obj The <code>Object</code> to test against.
|
||||
*
|
||||
* @return <code>true</code> if the flavor is equal to this object,
|
||||
* <code>false</code> 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 <code>true</code> if the string is equal to this object's MIME
|
||||
* type, <code>false</code> otherwise.
|
||||
*
|
||||
* @deprecated Not compatible with <code>hashCode()</code>.
|
||||
* Use <code>isMimeTypeEqual()</code>
|
||||
*/
|
||||
* Tests whether or not the specified string is equal to the MIME type
|
||||
* of this object.
|
||||
*
|
||||
* @param str The string to test against.
|
||||
*
|
||||
* @return <code>true</code> if the string is equal to this object's MIME
|
||||
* type, <code>false</code> otherwise.
|
||||
*
|
||||
* @deprecated Not compatible with <code>hashCode()</code>.
|
||||
* Use <code>isMimeTypeEqual()</code>
|
||||
*/
|
||||
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 <code>true</code> when the given <code>DataFlavor</code>
|
||||
* matches this one.
|
||||
*/
|
||||
* Returns <code>true</code> when the given <code>DataFlavor</code>
|
||||
* 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 <code>ObjectOutput</code> stream to serialize to.
|
||||
*
|
||||
* @exception IOException If an error occurs.
|
||||
*/
|
||||
* Serialize this class.
|
||||
*
|
||||
* @param stream The <code>ObjectOutput</code> 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 <code>ObjectInput</code> 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 <code>ObjectInput</code> 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 <code>plainTextFlavor</code>.
|
||||
*/
|
||||
* XXX - Currently returns <code>plainTextFlavor</code>.
|
||||
*/
|
||||
public static final DataFlavor
|
||||
getTextPlainUnicodeFlavor()
|
||||
{
|
||||
|
@ -878,10 +879,10 @@ getTextPlainUnicodeFlavor()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* XXX - Currently returns <code>java.io.InputStream</code>.
|
||||
*
|
||||
* @since 1.3
|
||||
*/
|
||||
* XXX - Currently returns <code>java.io.InputStream</code>.
|
||||
*
|
||||
* @since 1.3
|
||||
*/
|
||||
public final Class
|
||||
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
|
||||
getDefaultRepresentationClassAsString()
|
||||
{
|
||||
|
@ -901,15 +902,15 @@ getDefaultRepresentationClassAsString()
|
|||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Selects the best supported text flavor on this implementation.
|
||||
* Returns <code>null</code> when none of the given flavors is liked.
|
||||
*
|
||||
* The <code>DataFlavor</code> returned the first data flavor in the
|
||||
* array that has either a representation class which is (a subclass of)
|
||||
* <code>Reader</code> or <code>String</code>, or has a representation
|
||||
* class which is (a subclass of) <code>InputStream</code> and has a
|
||||
* primary MIME type of "text" and has an supported encoding.
|
||||
*/
|
||||
* Selects the best supported text flavor on this implementation.
|
||||
* Returns <code>null</code> when none of the given flavors is liked.
|
||||
*
|
||||
* The <code>DataFlavor</code> returned the first data flavor in the
|
||||
* array that has either a representation class which is (a subclass of)
|
||||
* <code>Reader</code> or <code>String</code>, or has a representation
|
||||
* class which is (a subclass of) <code>InputStream</code> 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 <code>Reader</code> for a given <code>Transferable</code>.
|
||||
*
|
||||
* If the representation class is a (subclass of) <code>Reader</code>
|
||||
* then an instance of the representation class is returned. If the
|
||||
* representatation class is a <code>String</code> then a
|
||||
* <code>StringReader</code> is returned. And if the representation class
|
||||
* is a (subclass of) <code>InputStream</code> and the primary MIME type
|
||||
* is "text" then a <code>InputStreamReader</code> for the correct charset
|
||||
* encoding is returned.
|
||||
*
|
||||
* @param transferable The <code>Transferable</code> for which a text
|
||||
* <code>Reader</code> 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 <code>DataFlavor</code>. Or if the representable class
|
||||
* isn't a (subclass of) <code>Reader</code>, <code>String</code>,
|
||||
* <code>InputStream</code> 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 <code>Reader</code> for a given <code>Transferable</code>.
|
||||
*
|
||||
* If the representation class is a (subclass of) <code>Reader</code>
|
||||
* then an instance of the representation class is returned. If the
|
||||
* representatation class is a <code>String</code> then a
|
||||
* <code>StringReader</code> is returned. And if the representation class
|
||||
* is a (subclass of) <code>InputStream</code> and the primary MIME type
|
||||
* is "text" then a <code>InputStreamReader</code> for the correct charset
|
||||
* encoding is returned.
|
||||
*
|
||||
* @param transferable The <code>Transferable</code> for which a text
|
||||
* <code>Reader</code> 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 <code>DataFlavor</code>. Or if the representable class
|
||||
* isn't a (subclass of) <code>Reader</code>, <code>String</code>,
|
||||
* <code>InputStream</code> 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
|
||||
{
|
||||
|
|
|
@ -39,76 +39,87 @@ package java.awt.font;
|
|||
|
||||
/**
|
||||
* @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()
|
||||
{
|
||||
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" )
|
||||
+ "]";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,8 +53,8 @@ import gnu.java.awt.ComponentDataBlitOp;
|
|||
*
|
||||
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue