Example usage for java.awt.datatransfer SystemFlavorMap decodeDataFlavor

List of usage examples for java.awt.datatransfer SystemFlavorMap decodeDataFlavor

Introduction

In this page you can find the example usage for java.awt.datatransfer SystemFlavorMap decodeDataFlavor.

Prototype

public static DataFlavor decodeDataFlavor(String nat) throws ClassNotFoundException 

Source Link

Document

Decodes a String native for use as a DataFlavor .

Usage

From source file:ec.util.chart.swing.Charts.java

private static DataFlavor registerSystemFlavor(String nat, String mimeType, String humanPresentableName) {
    DataFlavor result = null;/*from   w  w  w. ja  v a  2 s  .c om*/
    try {
        result = SystemFlavorMap.decodeDataFlavor(nat);
    } catch (ClassNotFoundException ex) {
    }
    if (result == null) {
        result = new DataFlavor(mimeType, humanPresentableName);
        SystemFlavorMap map = (SystemFlavorMap) SystemFlavorMap.getDefaultFlavorMap();
        map.addUnencodedNativeForFlavor(result, nat);
        map.addFlavorForUnencodedNative(nat, result);
        return result;
    }
    return result;
}