Commit 92bc8733 by Tom Tromey Committed by Tom Tromey

Makefile.in: Rebuilt.

	* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added new files.
	* java/awt/Toolkit.java: Merged with Classpath.
	* java/awt/PrintGraphics.java: New file from Classpath.
	* java/awt/PrintJob.java: New file from Classpath.
	* java/awt/datatransfer/Clipboard.java: New file from Classpath.
	* java/awt/datatransfer/ClipboardOwner.java: New file from
	Classpath.
	* java/awt/datatransfer/DataFlavor.java: New file from Classpath.
	* java/awt/datatransfer/FlavorMap.java: New file from Classpath.
	* java/awt/datatransfer/MimeTypeParseException.java: New file from
	Classpath.
	* java/awt/datatransfer/StringSelection.java: New file from
	Classpath.
	* java/awt/datatransfer/SystemFlavorMap.java: New file from
	Classpath.
	* java/awt/datatransfer/Transferable.java: New file from
	Classpath.
	* java/awt/datatransfer/UnsupportedFlavorException.java: New file
	from Classpath.

From-SVN: r49171
parent e1d71275
......@@ -2,6 +2,27 @@
* Makefile.in: Rebuilt.
* Makefile.am (awt_java_source_files): Added new files.
* java/awt/Toolkit.java: Merged with Classpath.
* java/awt/PrintGraphics.java: New file from Classpath.
* java/awt/PrintJob.java: New file from Classpath.
* java/awt/datatransfer/Clipboard.java: New file from Classpath.
* java/awt/datatransfer/ClipboardOwner.java: New file from
Classpath.
* java/awt/datatransfer/DataFlavor.java: New file from Classpath.
* java/awt/datatransfer/FlavorMap.java: New file from Classpath.
* java/awt/datatransfer/MimeTypeParseException.java: New file from
Classpath.
* java/awt/datatransfer/StringSelection.java: New file from
Classpath.
* java/awt/datatransfer/SystemFlavorMap.java: New file from
Classpath.
* java/awt/datatransfer/Transferable.java: New file from
Classpath.
* java/awt/datatransfer/UnsupportedFlavorException.java: New file
from Classpath.
* Makefile.in: Rebuilt.
* Makefile.am (awt_java_source_files): Added new files.
* java/awt/image/AreaAveragingScaleFilter.java: New file from
Classpath.
* java/awt/image/CropImageFilter.java: New file from Classpath.
......
......@@ -661,6 +661,8 @@ java/awt/Panel.java \
java/awt/Point.java \
java/awt/Polygon.java \
java/awt/PopupMenu.java \
java/awt/PrintGraphics.java \
java/awt/PrintJob.java \
java/awt/Rectangle.java \
java/awt/RenderingHints.java \
java/awt/ScrollPane.java \
......@@ -677,6 +679,14 @@ java/awt/color/ColorSpace.java \
java/awt/color/ICC_ColorSpace.java \
java/awt/color/ICC_Profile.java \
java/awt/datatransfer/Clipboard.java \
java/awt/datatransfer/ClipboardOwner.java \
java/awt/datatransfer/DataFlavor.java \
java/awt/datatransfer/FlavorMap.java \
java/awt/datatransfer/MimeTypeParseException.java \
java/awt/datatransfer/StringSelection.java \
java/awt/datatransfer/SystemFlavorMap.java \
java/awt/datatransfer/Transferable.java \
java/awt/datatransfer/UnsupportedFlavorException.java \
java/awt/event/AWTEventListener.java \
java/awt/event/ActionEvent.java \
java/awt/event/ActionListener.java \
......
......@@ -412,6 +412,8 @@ java/awt/Panel.java \
java/awt/Point.java \
java/awt/Polygon.java \
java/awt/PopupMenu.java \
java/awt/PrintGraphics.java \
java/awt/PrintJob.java \
java/awt/Rectangle.java \
java/awt/RenderingHints.java \
java/awt/ScrollPane.java \
......@@ -428,6 +430,14 @@ java/awt/color/ColorSpace.java \
java/awt/color/ICC_ColorSpace.java \
java/awt/color/ICC_Profile.java \
java/awt/datatransfer/Clipboard.java \
java/awt/datatransfer/ClipboardOwner.java \
java/awt/datatransfer/DataFlavor.java \
java/awt/datatransfer/FlavorMap.java \
java/awt/datatransfer/MimeTypeParseException.java \
java/awt/datatransfer/StringSelection.java \
java/awt/datatransfer/SystemFlavorMap.java \
java/awt/datatransfer/Transferable.java \
java/awt/datatransfer/UnsupportedFlavorException.java \
java/awt/event/AWTEventListener.java \
java/awt/event/ActionEvent.java \
java/awt/event/ActionListener.java \
......@@ -2028,7 +2038,8 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/awt/MenuItem.P .deps/java/awt/MenuShortcut.P \
.deps/java/awt/Paint.P .deps/java/awt/PaintContext.P \
.deps/java/awt/Panel.P .deps/java/awt/Point.P .deps/java/awt/Polygon.P \
.deps/java/awt/PopupMenu.P .deps/java/awt/Rectangle.P \
.deps/java/awt/PopupMenu.P .deps/java/awt/PrintGraphics.P \
.deps/java/awt/PrintJob.P .deps/java/awt/Rectangle.P \
.deps/java/awt/RenderingHints.P .deps/java/awt/ScrollPane.P \
.deps/java/awt/Scrollbar.P .deps/java/awt/Shape.P \
.deps/java/awt/SystemColor.P .deps/java/awt/TextArea.P \
......@@ -2038,6 +2049,14 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/awt/color/ICC_ColorSpace.P \
.deps/java/awt/color/ICC_Profile.P \
.deps/java/awt/datatransfer/Clipboard.P \
.deps/java/awt/datatransfer/ClipboardOwner.P \
.deps/java/awt/datatransfer/DataFlavor.P \
.deps/java/awt/datatransfer/FlavorMap.P \
.deps/java/awt/datatransfer/MimeTypeParseException.P \
.deps/java/awt/datatransfer/StringSelection.P \
.deps/java/awt/datatransfer/SystemFlavorMap.P \
.deps/java/awt/datatransfer/Transferable.P \
.deps/java/awt/datatransfer/UnsupportedFlavorException.P \
.deps/java/awt/event/AWTEventListener.P \
.deps/java/awt/event/ActionEvent.P \
.deps/java/awt/event/ActionListener.P \
......
/* PrintGraphics.java -- A print graphics context.
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt;
/**
* This interface allows the originating print job to be obtained.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface PrintGraphics
{
/**
* Returns the <code>PrintJob</code> that this object is being
* managed by.
*
* @return The print job for this object.
*/
public abstract PrintJob
getPrintJob();
} // interface PrintGraphics
/* PrintJob.java -- A print job class
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt;
/**
* This abstract class represents a print job.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public abstract class PrintJob
{
/*
* Constructors
*/
/**
* This method initializes a new instance of <code>PrintJob</code>.
*/
public
PrintJob()
{
}
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Returns a graphics context suitable for rendering the next page.
*
* @return A graphics context for printing the next page.
*/
public abstract Graphics
getGraphics();
/*************************************************************************/
/**
* Returns the dimension of the page in pixels. The resolution will be
* chosen to be similar to the on screen image.
*
* @return The page dimensions.
*/
public abstract Dimension
getPageDimension();
/*************************************************************************/
/**
* Returns the resolution of the page in pixels per inch.
*
* @return The resolution of the page in pixels per inch.
*/
public abstract int
getPageResolution();
/*************************************************************************/
/**
* Tests whether or not the last page will be printed first.
*
* @return <code>true</code> if the last page prints first, <code>false</code>
* otherwise.
*/
public abstract boolean
lastPageFirst();
/*************************************************************************/
/**
* Informs the print job that printing is complete.
*/
public abstract void
end();
/*************************************************************************/
/**
* This method explicitly ends the print job in the event the job
* becomes un-referenced without the application having done so.
*/
public void
finalize()
{
end();
}
} // class PrintJob
/* Copyright (C) 2000 Free Software Foundation
/* Clipboard.java -- Class for transferring data via cut and paste.
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of libgcj.
This file is part of GNU Classpath.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
package java.awt.datatransfer;
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
/* A very incomplete placeholder. */
package java.awt.datatransfer;
/**
* This class allows data to be transferred using a cut and paste type
* mechanism.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class Clipboard
{
/*
* Instance Variables
*/
/**
* The data being transferred.
*/
protected Transferable contents;
/**
* The owner of this clipboard.
*/
protected ClipboardOwner owner;
// The clipboard name
private String name;
/*************************************************************************/
/*
* Constructors
*/
/**
* Initializes a new instance of <code>Clipboard</code> with the
* specified name.
*
* @param name The clipboard name.
*/
public
Clipboard(String name)
{
this.name = name;
}
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Returns the name of the clipboard.
*/
public String
getName()
{
return(name);
}
/*************************************************************************/
/**
* Returns the contents of the clipboard.
*
* @param requestor The object requesting the contents.
*/
public synchronized Transferable
getContents(Object requestor)
{
return(contents);
}
/*************************************************************************/
/**
* Sets the content and owner of this clipboard.
* If the given owner is different from the current owner
* then lostOwnership is called on the current owner.
* XXX - is this called with the old or new contents.
*
* @param contents The new clipboard contents.
* @param owner The new clipboard owner
*/
public synchronized void
setContents(Transferable contents, ClipboardOwner owner)
{
if (this.owner != owner)
if (this.owner != null)
this.owner.lostOwnership(this, contents);
this.owner = owner;
this.contents = contents;
}
} // class Clipboard
/* ClipboardOwner.java -- Interface for clipboard providers
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.datatransfer;
/**
* This interface is for classes that will own a clipboard object.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface ClipboardOwner
{
/**
* This method is called to notify this object that it no longer
* has ownership of the specified <code>Clipboard</code>.
*
* @param clipboard The clipboard for which ownership was lost.
* @param contents The contents of the clipboard which are no longer owned.
*/
public abstract void
lostOwnership(Clipboard clipboard, Transferable contents);
} // interface ClipboardOwner
/* FlavorMap.java -- Maps between flavor names and MIME types.
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.datatransfer;
import java.util.Map;
/**
* This interface maps between native platform type names and DataFlavors.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface FlavorMap
{
/**
* Maps the specified <code>DataFlavor</code> objects to the native
* data type name. The returned <code>Map</code> has keys that are
* the data flavors and values that are strings. The returned map
* may be modified. This can be useful for implementing nested mappings.
*
* @param flavors An array of data flavors to map
* or null for all data flavors.
*
* @return A <code>Map</code> of native data types.
*/
public abstract Map
getNativesForFlavors(DataFlavor[] flavors);
/*************************************************************************/
/**
* Maps the specified native type names to <code>DataFlavor</code>'s.
* The returned <code>Map</code> has keys that are strings and values
* that are <code>DataFlavor</code>'s. The returned map may be
* modified. This can be useful for implementing nested mappings.
*
* @param natives An array of native types to map
* or null for all native types.
*
* @return A <code>Map</code> of data flavors.
*/
public abstract Map
getFlavorsForNatives(String[] natives);
} // interface FlavorMap
/* MimeTypeParseException.java -- Thrown when MIME string couldn't be parsed.
Copyright (C) 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.datatransfer;
/**
* MIME string couldn't be parsed correctly.
*
* @author Mark Wielaard (mark@klomp.org)
*/
public class MimeTypeParseException extends Exception
{
/**
* Initializes a new instance of <code>MimeTypeParseException</code>
* without any message.
*/
public
MimeTypeParseException()
{
super();
}
/**
* Initializes a new instance of <code>MimeTypeParseException</code>
* with a specified detailed error message.
*/
public
MimeTypeParseException(String message)
{
super(message);
}
} // class MimeTypeParseException
/* StringSelection.java -- Clipboard handler for text.
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.datatransfer;
import java.io.StringBufferInputStream;
import java.io.IOException;
/**
* This class transfers a string as plain text using the clipboard.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class StringSelection implements Transferable, ClipboardOwner
{
/*
* Class Variables
*/
// List of flavors we support
public static final DataFlavor[] supported_flavors
= { DataFlavor.plainTextFlavor };
/*************************************************************************/
/*
* Instance Variables
*/
// This is the data to transfer
private String data;
/*************************************************************************/
/*
* Constructors
*/
/**
* Transfer the specfied string as text.
*/
public
StringSelection(String data)
{
this.data = data;
}
/*************************************************************************/
/*
* Instance Methods
*/
/**
* Returns a list of supported data flavors.
*
* @return A list of supported data flavors.
*/
public DataFlavor[]
getTransferDataFlavors()
{
return(supported_flavors);
}
/*************************************************************************/
/**
* Tests whether or not the specified data flavor is supported.
*
* @param flavor The data flavor to test.
*
* @return <code>true</code> if the data flavor is supported,
* <code>false</code> otherwise.
*/
public boolean
isDataFlavorSupported(DataFlavor flavor)
{
for (int i = 0; i < supported_flavors.length; i++)
if (supported_flavors[i].equals(flavor))
return(true);
return(false);
}
/*************************************************************************/
/**
* This method returns the data in the requested format.
*
* @param flavor The desired data flavor.
*
* @return The transferred data.
*
* @exception UnsupportedFlavorException If the specified flavor is not
* supported.
* @exception IOException If any other error occurs.
*/
public Object
getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,
IOException
{
if (!isDataFlavorSupported(flavor))
throw new UnsupportedFlavorException(flavor);
return(new StringBufferInputStream(data));
}
/*************************************************************************/
/**
* Called when ownership of the clipboard object is lost.
*
* @param clipboard The affected clipboard.
* @param contents The clipboard contents.
*/
public void
lostOwnership(Clipboard clipboard, Transferable contents)
{
// FIXME: What does this do?
}
} // class StringSelection
/* SystemFlavorMap.java -- Maps between native flavor names and MIME types.
Copyright (C) 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.datatransfer;
import java.util.HashMap;
import java.util.Map;
/**
* This class maps between native platform type names and DataFlavors.
*
* XXX - The current implementation does no mapping at all.
*
* @author Mark Wielaard (mark@klomp.org)
*/
public final class SystemFlavorMap implements FlavorMap
{
/**
* The default (instance) flavor map.
*/
private static FlavorMap defaultFlavorMap;
/**
* Private constructor.
*/
private SystemFlavorMap()
{
}
/*************************************************************************/
/**
* Maps the specified <code>DataFlavor</code> objects to the native
* data type name. The returned <code>Map</code> has keys that are
* the data flavors and values that are strings. The returned map
* may be modified. This can be useful for implementing nested mappings.
*
* @param flavors An array of data flavors to map
* or null for all data flavors.
*
* @return A <code>Map</code> of native data types to data flavors.
*/
public Map
getNativesForFlavors(DataFlavor[] flavors)
{
return(new HashMap());
}
/*************************************************************************/
/**
* Maps the specified native type names to <code>DataFlavor</code>'s.
* The returned <code>Map</code> has keys that are strings and values
* that are <code>DataFlavor</code>'s. The returned map may be
* modified. This can be useful for implementing nested mappings.
*
* @param natives An array of native types to map
* or null for all native types.
*
* @return A <code>Map</code> of data flavors to native type names.
*/
public Map
getFlavorsForNatives(String[] natives)
{
return(new HashMap());
}
/*************************************************************************/
/**
* Returns the default (instance) (System)FlavorMap.
*/
public static FlavorMap
getDefaultFlavorMap()
{
if (defaultFlavorMap == null)
defaultFlavorMap = new SystemFlavorMap();
return(defaultFlavorMap);
}
/*************************************************************************/
/**
* Returns the native type name for the given java mime type.
*/
public static String
encodeJavaMIMEType(String mime)
{
return null;
}
/*************************************************************************/
/**
* Returns the native type name for the given data flavor.
*/
public static String
encodeDataFlavor(DataFlavor df)
{
return null;
}
/*************************************************************************/
/**
* Returns true if the native type name can be represented as
* a java mime type.
*/
public static boolean
isJavaMIMEType(String name)
{
return(false);
}
/*************************************************************************/
/**
* Returns the java mime type for the given the native type name.
*/
public static String
decodeJavaMIMEType(String name)
{
return null;
}
/*************************************************************************/
/**
* Returns the data flavor given the native type name
* or null when no such data flavor exists.
*/
public static DataFlavor
decodeDataFlavor(String name) throws ClassNotFoundException
{
String javaMIMEType = decodeJavaMIMEType(name);
if (javaMIMEType != null)
return(new DataFlavor(javaMIMEType));
else
return(null);
}
} // class SystemFlavorMap
/* Transferable.java -- Data transfer source
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.datatransfer;
import java.io.IOException;
/**
* This interface is implemented by classes that can transfer data.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public interface Transferable
{
/**
* Returns the data in the specified <code>DataFlavor</code>
*
* @param flavor The data flavor to return.
*
* @return The data in the appropriate flavor.
*
* @exception UnsupportedFlavorException If the flavor is not supported.
* @exception IOException If the data is not available.
*/
public abstract Object
getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,
IOException;
/*************************************************************************/
/**
* This method returns a list of available data flavors for the
* data being transferred. The array returned will be sorted from most
* preferred flavor at the beginning to least preferred at the end.
*
* @return A list of data flavors for this data.
*/
public abstract DataFlavor[]
getTransferDataFlavors();
/*************************************************************************/
/**
* Tests whether or not this data can be delivered in the specified
* data flavor.
*
* @param flavor The data flavor to test.
*
* @return <code>true</code> if the data flavor is supported,
* <code>false</code> otherwise.
*/
public abstract boolean
isDataFlavorSupported(DataFlavor flavor);
} // interface Transferable
/* UnsupportedFlavorException.java -- Data flavor is not valid.
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.awt.datatransfer;
/**
* The data flavor requested is not supported for the transfer data.
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class UnsupportedFlavorException extends Exception
{
/**
* Initializes a new instance of <code>UnsupportedDataFlavor</code>
* for the specified data flavor.
*
* @param flavor The data flavor that is not supported.
*/
public
UnsupportedFlavorException(DataFlavor flavor)
{
super(flavor.getHumanPresentableName());
}
} // class UnsupportedFlavorException
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