Documentation of 'com.mxgraph.swing.util.mxGraphTransferable' Java class
mxGraphTransferable
com.mxgraph.swing.util

Class mxGraphTransferable

  • All Implemented Interfaces:
    java.awt.datatransfer.Transferable, java.io.Serializable, javax.swing.plaf.UIResource


    public class mxGraphTransferable
    extends java.lang.Object
    implements java.awt.datatransfer.Transferable, javax.swing.plaf.UIResource, java.io.Serializable
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.awt.datatransfer.DataFlavor dataFlavor
      Serialized Data Flavor.
      static boolean enableImageSupport
      Global switch to disable image support in transferables.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      mxRectangle getBounds()
      Returns the unscaled, untranslated bounding box of the cells.
      java.lang.Object[] getCells() 
      javax.swing.ImageIcon getImage() 
      java.lang.Object getRicherData(java.awt.datatransfer.DataFlavor flavor) 
      java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
      Returns an object which represents the data to be transferred.
      java.awt.datatransfer.DataFlavor[] getTransferDataFlavors() 
      boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
      Returns whether or not the specified data flavor is supported for this object.
      boolean isImageSupported() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • enableImageSupport

        public static boolean enableImageSupport
        Global switch to disable image support in transferables. Set this to false as a workaround for Data translation failed: not an image format in Java 1.7 on Mac OS X.
      • dataFlavor

        public static java.awt.datatransfer.DataFlavor dataFlavor
        Serialized Data Flavor. Use the following code to switch to local reference flavor: try { mxGraphTransferable.dataFlavor = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + "; class=com.mxgraph.swing.util.mxGraphTransferable"); } catch (ClassNotFoundException cnfe) { // do nothing } If you get a class not found exception, try the following instead: mxGraphTransferable.dataFlavor = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + "; class=com.mxgraph.swing.util.mxGraphTransferable", null, new com.mxgraph.swing.util.mxGraphTransferable(null, null).getClass().getClassLoader());
    • Constructor Detail

      • mxGraphTransferable

        public mxGraphTransferable(java.lang.Object[] cells,
                                   mxRectangle bounds)
      • mxGraphTransferable

        public mxGraphTransferable(java.lang.Object[] cells,
                                   mxRectangle bounds,
                                   javax.swing.ImageIcon image)
    • Method Detail

      • getCells

        public java.lang.Object[] getCells()
        Returns:
        Returns the cells.
      • getBounds

        public mxRectangle getBounds()
        Returns the unscaled, untranslated bounding box of the cells.
      • getImage

        public javax.swing.ImageIcon getImage()
      • getTransferDataFlavors

        public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
        Specified by:
        getTransferDataFlavors in interface java.awt.datatransfer.Transferable
      • isDataFlavorSupported

        public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
        Returns whether or not the specified data flavor is supported for this object.
        Specified by:
        isDataFlavorSupported in interface java.awt.datatransfer.Transferable
        Parameters:
        flavor - the requested flavor for the data
        Returns:
        boolean indicating whether or not the data flavor is supported
      • getTransferData

        public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor)
                                         throws java.awt.datatransfer.UnsupportedFlavorException,
                                                java.io.IOException
        Returns an object which represents the data to be transferred. The class of the object returned is defined by the representation class of the flavor.
        Specified by:
        getTransferData in interface java.awt.datatransfer.Transferable
        Parameters:
        flavor - the requested flavor for the data
        Throws:
        java.io.IOException - if the data is no longer available in the requested flavor.
        java.awt.datatransfer.UnsupportedFlavorException - if the requested data flavor is not supported.
        See Also:
        DataFlavor.getRepresentationClass()
      • getRicherData

        public java.lang.Object getRicherData(java.awt.datatransfer.DataFlavor flavor)
                                       throws java.awt.datatransfer.UnsupportedFlavorException
        Parameters:
        flavor -
        Returns:
        the richer data flavor of this and the specified
        Throws:
        java.awt.datatransfer.UnsupportedFlavorException
      • isImageSupported

        public boolean isImageSupported()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.