/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Platform-specific support for the data transfer subsystem.
*/
/**
* Singleton constructor
*/
private XDataTransferer() {
}
synchronized (XDataTransferer.class) {
if (transferer == null) {
transferer = new XDataTransferer();
}
}
return transferer;
}
return "iso-10646-ucs-2";
}
return false;
}
return super.isTextFormat(format)
}
// Ignore the charset parameter of the MIME type if the subtype
// doesn't support charset.
return null;
}
return charset;
}
}
return super.getCharsetForTextFormat(lFormat);
}
return false;
}
try {
return true;
}
} catch (Exception e) {
// Not a MIME format.
}
return false;
}
}
}
// Just get the atom. If it has already been retrived
// once, we'll get a copy so this should be very fast.
}
return getTargetNameForAtom(format);
}
}
/**
* Gets an format name for a given format (atom)
*/
}
throws IOException {
} else {
// Check if an image MIME format.
try {
}
} catch (Exception e) {
// Not an image MIME format.
}
}
} else {
" is not supported.");
}
}
throws IOException
{
{
}
return bos;
}
/**
* Translates either a byte array or an input stream which contain
* platform-specific image data in the given format into an Image.
*/
byte[] bytes,
long format)
throws IOException {
} else {
// Check if an image MIME format.
try {
}
} catch (Exception e) {
// Not an image MIME format.
}
}
} else {
" is not supported.");
}
}
try {
} finally {
}
}
byte[] bytes,
long format,
throws IOException {
if (localeTransferable != null &&
try {
"UTF-8"
);
} catch (UnsupportedFlavorException cannotHappen) {
}
} else {
}
// Only happens when we have a custom text type.
}
try {
try {
} catch (URISyntaxException uriSyntaxException) {
throw new IOException(uriSyntaxException);
}
}
} finally {
}
}
/**
* Returns true if and only if the name of the specified format Atom
* constitutes a valid MIME type with the specified primary type.
*/
return false;
}
try {
return true;
}
} catch (Exception e) {
// Not a MIME format.
}
return false;
}
/*
* The XDnD protocol prescribes that the Atoms used as targets for data
* transfer should have string names that represent the corresponding MIME
* types.
* To meet this requirement we check if the passed native format constitutes
* a valid MIME and return a list of flavors to which the data in this MIME
* type can be translated by the Data Transfer subsystem.
*/
return flavors;
}
try {
} catch (Exception e) {
// The string doesn't constitute a valid MIME type.
return flavors;
}
// For text formats we map natives to MIME strings instead of data
// flavors to enable dynamic text native-to-flavor mapping generation.
// See SystemFlavorMap.getFlavorsForNative() for details.
}
}
return flavors;
}
if (defaultSpecifier == null) {
null);
}
return defaultSpecifier;
}
/*
* The XDnD protocol prescribes that the Atoms used as targets for data
* transfer should have string names that represent the corresponding MIME
* types.
* To meet this requirement we return a list of formats that represent
* MIME types to which the data in this flavor can be translated by the Data
* Transfer subsystem.
*/
return natives;
}
}
// Add a mapping to the MIME native whenever the representation class
// doesn't require translation.
}
break;
}
}
}
}
// stringFlavor is semantically equivalent to the standard
}
}
}
// Add a MIME format without specified charset.
}
}
return natives;
}
}