JavaTM 2 Platform
Std. Ed. v1.3.1

com.apple.mrj.datatransfer
Class OSTypeFlavor

java.lang.Object
  |
  +--java.awt.datatransfer.DataFlavor
        |
        +--com.apple.mrj.datatransfer.OSTypeFlavor
All Implemented Interfaces:
Cloneable, Externalizable, Serializable

Deprecated. As of MacOSX 10.2

public class OSTypeFlavor
extends DataFlavor

A DataFlavor subclass that represents a Macintosh OSType, for better integration with native Mac data transfer services like drag & drop and the Clipboard.

See Also:
Serialized Form

Field Summary
static OSTypeFlavor[] kHFSFileFlavorArray
          Deprecated. A few classes need to check whether we're currently dragging files, so rather than having all of them allocate their own arrays, we do it here.
static String kOSTypeMIMEPrefix
          Deprecated. The MIME attribute attached to the kOSTypeMIMEType, whose value is the actual OSType (as four characters, with URL encoding of non-printable-ascii characters).
static OSTypeFlavor kTypeHFS
          Deprecated. Flavor for commonly used OSType.
static OSTypeFlavor kTypeJavaFile
          Deprecated. Flavor for commonly used OSType.
static OSTypeFlavor kTypePICT
          Deprecated. Flavor for commonly used OSType.
static OSTypeFlavor kTypeStyl
          Deprecated. Flavor for commonly used OSType.
static OSTypeFlavor kTypeTEXT
          Deprecated. Flavor for commonly used OSType.
static OSTypeFlavor kTypeURL
          Deprecated. Flavor for commonly used OSType.
static OSTypeFlavor kTypeUstl
          Deprecated. Flavor for commonly used OSType.
static OSTypeFlavor kTypeUtxt
          Deprecated. Flavor for commonly used OSType.
 
Fields inherited from class java.awt.datatransfer.DataFlavor
javaFileListFlavor, javaJVMLocalObjectMimeType, javaRemoteObjectMimeType, javaSerializedObjectMimeType, plainTextFlavor, stringFlavor
 
Constructor Summary
OSTypeFlavor(MRJOSType osType)
          Deprecated. Creates an OSTypeFlavor that represents the data as an OSType'd stream.
OSTypeFlavor(MRJOSType osType, String humanPresentableName)
          Deprecated. Creates an OSTypeFlavor that represents the data as an OSType'd stream.
OSTypeFlavor(MRJOSType osType, String mimeType, String humanPresentableName)
          Deprecated. Creates an OSTypeFlavor that represents the data as an OSType'd stream.
 
Method Summary
static boolean addMapping(MRJOSType osType, String mimeType)
          Deprecated. Adds a bidirectional mapping between an OSType and a MIME type.
static String getMimeTypeForOSType(MRJOSType osType)
          Deprecated. Returns a MIME-based DataFlavor equivalent to the given OSType.
 MRJOSType getOSType()
          Deprecated. Returns the OSType of this data flavor.
static MRJOSType getOSTypeForMimeType(String mimeType)
          Deprecated. Returns an OSType-based DataFlavor equivalent to the given MIME type.
static MRJOSType readSynthesizedMimeType(String mime)
          Deprecated. Generic conversion of a MIME type to an OSType, parsing the format generated by the synthesizeMimeType method.
static String synthesizeMimeType(MRJOSType osType)
          Deprecated. Generic conversion of an OSType into a MIME type, for use when no more specific MIME type is known.
 String toString()
          Deprecated. String representation of this DataFlavor and its parameters.
 
Methods inherited from class java.awt.datatransfer.DataFlavor
clone, equals, equals, equals, getDefaultRepresentationClass, getDefaultRepresentationClassAsString, getHumanPresentableName, getMimeType, getParameter, getPrimaryType, getReaderForText, getRepresentationClass, getSubType, getTextPlainUnicodeFlavor, hashCode, isFlavorJavaFileListType, isFlavorRemoteObjectType, isFlavorSerializedObjectType, isMimeTypeEqual, isMimeTypeEqual, isMimeTypeSerializedObject, isRepresentationClassInputStream, isRepresentationClassRemote, isRepresentationClassSerializable, match, normalizeMimeType, normalizeMimeTypeParameter, readExternal, selectBestTextFlavor, setHumanPresentableName, tryToLoadClass, writeExternal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

kOSTypeMIMEPrefix

public static final String kOSTypeMIMEPrefix
Deprecated. 
The MIME attribute attached to the kOSTypeMIMEType, whose value is the actual OSType (as four characters, with URL encoding of non-printable-ascii characters).

kTypeTEXT

public static final OSTypeFlavor kTypeTEXT
Deprecated. 
Flavor for commonly used OSType.

kTypeStyl

public static final OSTypeFlavor kTypeStyl
Deprecated. 
Flavor for commonly used OSType.

kTypeUtxt

public static final OSTypeFlavor kTypeUtxt
Deprecated. 
Flavor for commonly used OSType.

kTypeUstl

public static final OSTypeFlavor kTypeUstl
Deprecated. 
Flavor for commonly used OSType.

kTypePICT

public static final OSTypeFlavor kTypePICT
Deprecated. 
Flavor for commonly used OSType.

kTypeHFS

public static final OSTypeFlavor kTypeHFS
Deprecated. 
Flavor for commonly used OSType.

kTypeURL

public static final OSTypeFlavor kTypeURL
Deprecated. 
Flavor for commonly used OSType.

kTypeJavaFile

public static final OSTypeFlavor kTypeJavaFile
Deprecated. 
Flavor for commonly used OSType.

kHFSFileFlavorArray

public static final OSTypeFlavor[] kHFSFileFlavorArray
Deprecated. 
A few classes need to check whether we're currently dragging files, so rather than having all of them allocate their own arrays, we do it here.
Constructor Detail

OSTypeFlavor

public OSTypeFlavor(MRJOSType osType,
                    String mimeType,
                    String humanPresentableName)
Deprecated. 
Creates an OSTypeFlavor that represents the data as an OSType'd stream.
Parameters:
osType - The OSType of the data.
mimeType - The MIME type of the data (cannot be null)
humanPresentableName - The user-visible name of this type

OSTypeFlavor

public OSTypeFlavor(MRJOSType osType,
                    String humanPresentableName)
Deprecated. 
Creates an OSTypeFlavor that represents the data as an OSType'd stream. A MIME type will automatically be associated with it by calling getMimeTypeForOSType.
Parameters:
osType - The OSType of the data.
humanPresentableName - The user-visible name of this type

OSTypeFlavor

public OSTypeFlavor(MRJOSType osType)
Deprecated. 
Creates an OSTypeFlavor that represents the data as an OSType'd stream. A MIME type will automatically be associated with it by calling getMimeTypeForOSType.

A default human-presentable name is used that simply gives the textual (four-letter) representation of the OSType.

Parameters:
osType - The OSType of the data.
Method Detail

getOSType

public MRJOSType getOSType()
Deprecated. 
Returns the OSType of this data flavor. The result will be null if this object was constructed from a MIME type that doesn't represent an OSType.

toString

public String toString()
Deprecated. 
Description copied from class: DataFlavor
String representation of this DataFlavor and its parameters. The result String contains name of DataFlavor class, representation class and Mime type of this Flavor.
Overrides:
toString in class DataFlavor
Following copied from class: java.awt.datatransfer.DataFlavor
Returns:
string representation of this DataFlavor

addMapping

public static boolean addMapping(MRJOSType osType,
                                 String mimeType)
Deprecated. 
Adds a bidirectional mapping between an OSType and a MIME type.
Returns:
true if the mapping did not previously exist, false if it did.

getMimeTypeForOSType

public static String getMimeTypeForOSType(MRJOSType osType)
Deprecated. 
Returns a MIME-based DataFlavor equivalent to the given OSType. For instance, given the type 'moov' it will return a flavor whose MIME type is "video/quicktime".

If no mapping is known, it will synthesize a MIME type by calling synthesizeMimeType.


getOSTypeForMimeType

public static MRJOSType getOSTypeForMimeType(String mimeType)
Deprecated. 
Returns an OSType-based DataFlavor equivalent to the given MIME type. For instance, given the type "video/quicktime" it will return an OSTypeFlavor whose OSType is 'moov'.

If the MIME type is a synthesized wrapper for an OSType (its base type is "application/x-mac-data") the wrapped OSType will be returned.

Otherwise null is returned if no mapping is known.


synthesizeMimeType

public static String synthesizeMimeType(MRJOSType osType)
Deprecated. 
Generic conversion of an OSType into a MIME type, for use when no more specific MIME type is known.

The base MIME type used is "application/x-mac-ostype-" followed by the raw OSType encoded as an eight-character hex string (big-endian byte order.) It's not possible to represent the OSType literally since the syntax of a MIME type allows so few characters, and is case-insensitive.

MRJ 2.2 used a different format with a single type "application/x-mac-data" and an "ostype=" attribute containing the OSType. Unfortunately we can't use this with Java2 since the MimeType class ignores parameters when comparing types.

See Also:
readSynthesizedMimeType(java.lang.String)

readSynthesizedMimeType

public static MRJOSType readSynthesizedMimeType(String mime)
Deprecated. 
Generic conversion of a MIME type to an OSType, parsing the format generated by the synthesizeMimeType method. The value null will be returned if the MIME type does not match the canonical representation of a generic OSType.
See Also:
synthesizeMimeType

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.