FreeHEP API
Version current

org.freehep.util.export
Class VectorGraphicsTransferable

java.lang.Object
  extended byorg.freehep.util.export.VectorGraphicsTransferable
All Implemented Interfaces:
ClipboardOwner, Transferable

public class VectorGraphicsTransferable
extends Object
implements ClipboardOwner, Transferable

A Transferable for putting vector graphics onto the system clipboard. This is particularly useful on Windows where EMF format can be used to copy vector graphics onto the system clipboard, from where it can be pasted into many applications, including PowerPoint and Word. VectorGraphicsTranferable will fall back to using a bitmap image format if no suitable VectorGraphics format is registered.

Note: This only works with JDK 1.4 or later.

Version:
$Id: VectorGraphicsTransferable.java,v 1.6 2003/05/16 20:20:34 duns Exp $
Author:
tonyj
Source Code:
VectorGraphicsTransferable.java

Constructor Summary
VectorGraphicsTransferable(Component c)
          Create a VectorGraphicsTransferable with the built-in flavor/ExportFileType associations
VectorGraphicsTransferable(Component c, boolean addDefaultAssociations)
          Create a VectorGraphicsTransferable.
 
Method Summary
 void addExportFileType(DataFlavor flavor, ExportFileType type)
          Associate a DataFlavor with the ExportFileType
 Object getTransferData(DataFlavor dataFlavor)
           
 DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(DataFlavor dataFlavor)
           
 void lostOwnership(Clipboard clipboard, Transferable transferable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorGraphicsTransferable

public VectorGraphicsTransferable(Component c)
Create a VectorGraphicsTransferable with the built-in flavor/ExportFileType associations

Parameters:
c - The Component whose graphics will be transfered

VectorGraphicsTransferable

public VectorGraphicsTransferable(Component c,
                                  boolean addDefaultAssociations)
Create a VectorGraphicsTransferable.

Parameters:
c - The Component whose graphics will be transfered
addDefaultAssociations - Add the standard flavor/ExportFileType associations
Method Detail

getTransferData

public Object getTransferData(DataFlavor dataFlavor)
                       throws UnsupportedFlavorException,
                              IOException
Specified by:
getTransferData in interface Transferable
Throws:
UnsupportedFlavorException
IOException

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor dataFlavor)
Specified by:
isDataFlavorSupported in interface Transferable

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable transferable)
Specified by:
lostOwnership in interface ClipboardOwner

addExportFileType

public void addExportFileType(DataFlavor flavor,
                              ExportFileType type)
Associate a DataFlavor with the ExportFileType


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.