Major merge with Classpath.
Removed many duplicate files. * HACKING: Updated.x * classpath: Imported new directory. * standard.omit: New file. * Makefile.in, aclocal.m4, configure: Rebuilt. * sources.am: New file. * configure.ac: Run Classpath configure script. Moved code around to support. Disable xlib AWT peers (temporarily). * Makefile.am (SUBDIRS): Added 'classpath' (JAVAC): Removed. (AM_CPPFLAGS): Added more -I options. (BOOTCLASSPATH): Simplified. Completely redid how sources are built. Include sources.am. * include/Makefile.am (tool_include__HEADERS): Removed jni.h. * include/jni.h: Removed (in Classpath). * scripts/classes.pl: Updated to look at built classes. * scripts/makemake.tcl: New file. * testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Added -I options. (gcj_jni_invocation_compile_c_to_binary): Likewise. From-SVN: r102082
This commit is contained in:
parent
ea54b29342
commit
b0fa81eea9
2817 changed files with 11656 additions and 643398 deletions
|
@ -1,114 +0,0 @@
|
|||
/* Clipboard.java -- Class for transferring data via cut and paste.
|
||||
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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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 class allows data to be transferred using a cut and paste type
|
||||
* mechanism.
|
||||
*
|
||||
* @author Aaron M. Renn (arenn@urbanophile.com)
|
||||
*/
|
||||
public class Clipboard
|
||||
{
|
||||
/**
|
||||
* The data being transferred.
|
||||
*/
|
||||
protected Transferable contents;
|
||||
|
||||
/**
|
||||
* The owner of this clipboard.
|
||||
*/
|
||||
protected ClipboardOwner owner;
|
||||
|
||||
// The clipboard name
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of <code>Clipboard</code> with the
|
||||
* specified name.
|
||||
*
|
||||
* @param name The clipboard name.
|
||||
*/
|
||||
public Clipboard(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the clipboard.
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the contents of the clipboard.
|
||||
*
|
||||
* @param requestor The object requesting the contents.
|
||||
*
|
||||
* @exception IllegalStateException If the clipboard is currently unavailable
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @exception IllegalStateException If the clipboard is currently unavailable
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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.
|
||||
*/
|
||||
void lostOwnership (Clipboard clipboard, Transferable contents);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,75 +0,0 @@
|
|||
/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
Map getFlavorsForNatives (String[] natives);
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/* FlavorTable.java -- A relaxed mapping between flavors
|
||||
Copyright (C) 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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.List;
|
||||
|
||||
/**
|
||||
* A FlavorMap which no longer requires a 1-to-1 mapping between flavors. Any
|
||||
* native can map to multiple flavors, and any flavor can map to multiple
|
||||
* natives; although the mappings are usually symmetric.
|
||||
*
|
||||
* @author Eric Blake (ebb9@email.byu.edu)
|
||||
* @since 1.4
|
||||
* @status updated to 1.4
|
||||
*/
|
||||
public interface FlavorTable extends FlavorMap
|
||||
{
|
||||
/**
|
||||
* Returns a list of String natives corresponding to the given flavor. The
|
||||
* list should be sorted from best to worst. The list must be modifiable
|
||||
* without affecting this table.
|
||||
*
|
||||
* @param flavor the flavor to look up, or null to return all natives
|
||||
* @return the sorted list of natives
|
||||
*/
|
||||
List getNativesForFlavor(DataFlavor flavor);
|
||||
|
||||
/**
|
||||
* Returns a list of flavors corresponding to the given String native. The
|
||||
* list should be sorted from best to worst. The list must be modifiable
|
||||
* without affecting this table.
|
||||
*
|
||||
* @param name the native name to look up, or null to return all flavors
|
||||
* @return the sorted list of flavors
|
||||
*/
|
||||
List getFlavorsForNative(String name);
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/* MimeTypeParseException.java -- thrown when MIME string couldn't be parsed
|
||||
Copyright (C) 2001, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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)
|
||||
* @status updated to 1.4
|
||||
*/
|
||||
public class MimeTypeParseException extends Exception
|
||||
{
|
||||
/**
|
||||
* Compatible with JDK 1.1+.
|
||||
*/
|
||||
private static final long serialVersionUID = -5604407764691570741L;
|
||||
|
||||
/**
|
||||
* Create a new instance without any message.
|
||||
*/
|
||||
public MimeTypeParseException()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance with a specified detailed error message.
|
||||
*
|
||||
* @param message the message
|
||||
*/
|
||||
public MimeTypeParseException(String message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
} // class MimeTypeParseException
|
|
@ -1,158 +0,0 @@
|
|||
/* StringSelection.java -- Clipboard handler for text.
|
||||
Copyright (C) 1999, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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;
|
||||
import java.io.StringReader;
|
||||
|
||||
/**
|
||||
* 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
|
||||
// XXX: DataFlavor.plainTextFlavor is deprecated.
|
||||
static final DataFlavor[] supported_flavors
|
||||
= { DataFlavor.stringFlavor,
|
||||
DataFlavor.plainTextFlavor };
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* Instance Variables
|
||||
*/
|
||||
|
||||
// This is the data to transfer
|
||||
private String data;
|
||||
|
||||
/**
|
||||
* Transfer the specfied string as text.
|
||||
*
|
||||
* @param data the data for the string selection
|
||||
*/
|
||||
public StringSelection(String data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
if (DataFlavor.plainTextFlavor == flavor)
|
||||
/* The behavior of this method for DataFlavor.plainTextFlavor and
|
||||
equivalent DataFlavors is inconsistent with the definition of
|
||||
DataFlavor.plainTextFlavor. We choose to do like Sun's implementation
|
||||
and return a Reader instead of an InputString. */
|
||||
/* return(new StringBufferInputStream(data)); */
|
||||
return(new StringReader(data));
|
||||
else // DataFlavor.stringFlavor
|
||||
return 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
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
/* SystemFlavorMap.java -- Maps between native flavor names and MIME types.
|
||||
Copyright (C) 2001, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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.List;
|
||||
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)
|
||||
*
|
||||
* @since 1.2
|
||||
*/
|
||||
public final class SystemFlavorMap implements FlavorMap, FlavorTable
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
public List getFlavorsForNative (String nat)
|
||||
{
|
||||
throw new Error ("Not implemented");
|
||||
}
|
||||
|
||||
public List getNativesForFlavor (DataFlavor flav)
|
||||
{
|
||||
throw new Error ("Not implemented");
|
||||
}
|
||||
|
||||
} // class SystemFlavorMap
|
|
@ -1,83 +0,0 @@
|
|||
/* Transferable.java -- Data transfer source
|
||||
Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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)
|
||||
* @since 1.1
|
||||
* @status updated to 1.4
|
||||
*/
|
||||
public interface Transferable
|
||||
{
|
||||
/**
|
||||
* 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 adA list of data flavors for this data
|
||||
*/
|
||||
DataFlavor[] getTransferDataFlavors();
|
||||
|
||||
/**
|
||||
* Tests whether or not this data can be delivered in the specified data
|
||||
* flavor.
|
||||
*
|
||||
* @param flavor the data flavor to test
|
||||
* @return true if the data flavor is supported
|
||||
*/
|
||||
boolean isDataFlavorSupported(DataFlavor flavor);
|
||||
|
||||
/**
|
||||
* Returns the data in the specified <code>DataFlavor</code>.
|
||||
*
|
||||
* @param flavor the data flavor to return
|
||||
* @return the data in the appropriate flavor
|
||||
* @throws UnsupportedFlavorException if the flavor is not supported
|
||||
* @throws IOException if the data is not available
|
||||
* @see DataFlavor#getRepresentationClass
|
||||
*/
|
||||
Object getTransferData(DataFlavor flavor)
|
||||
throws UnsupportedFlavorException, IOException;
|
||||
|
||||
} // interface Transferable
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/* UnsupportedFlavorException.java -- ata flavor is not valid
|
||||
Copyright (C) 1999, 2002, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 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)
|
||||
* @see Transferable#getTransferData(DataFlavor)
|
||||
* @status updated to 1.4
|
||||
*/
|
||||
public class UnsupportedFlavorException extends Exception
|
||||
{
|
||||
/**
|
||||
* Compatible with JDK 1.1+.
|
||||
*/
|
||||
private static final long serialVersionUID = 5383814944251665601L;
|
||||
|
||||
/**
|
||||
* 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 == null ? null : flavor.getHumanPresentableName());
|
||||
}
|
||||
} // class UnsupportedFlavorException
|
Loading…
Add table
Add a link
Reference in a new issue