org.graffiti.editor.actions.cutcopypaste
Class ClipboardContents

java.lang.Object
  extended by org.graffiti.selection.Selection
      extended by org.graffiti.editor.actions.cutcopypaste.ClipboardContents
All Implemented Interfaces:
Transferable

public class ClipboardContents
extends Selection
implements Transferable

Class is a subclass of the Selection class that implements the Transferable interface due to be written to the system clipboard

Author:
MH

Field Summary
static DataFlavor imageFlavor
          The DataFlavor that implements the kind of data that will be written to the system clipboard and will be pasted as an image into other applications, e.g.
static DataFlavor selectionFlavor
          The DataFlavor that implements the kind of data that will be written to the system clipboard and will be pasted into Gravisto
 
Constructor Summary
ClipboardContents(Selection selection, int numOfCopies)
          Creates a new instance of the ClipboardContents class
 
Method Summary
 void decreaseNumOfCopies()
          DOCUMENT ME!
 int getNumOfCopiesInGraph()
          Returns if this selection was cut or copied from the graph
 Object getTransferData(DataFlavor arg0)
          Gets the data that is saved in this class.
 DataFlavor[] getTransferDataFlavors()
          Returns all dataFlavors that are supported by Gravisto
 void increaseNumOfCopies()
          DOCUMENT ME!
 boolean isDataFlavorSupported(DataFlavor arg0)
          Returns true if the DataFlavor is supported
 
Methods inherited from class org.graffiti.selection.Selection
add, add, add, addAll, addSelection, clear, clone, committedChanges, contains, getEdges, getElements, getName, getNewMarked, getNewUnmarked, getNodes, isEmpty, remove, setName, setNewMarked, setNewUnmarked, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

selectionFlavor

public static DataFlavor selectionFlavor
The DataFlavor that implements the kind of data that will be written to the system clipboard and will be pasted into Gravisto


imageFlavor

public static DataFlavor imageFlavor
The DataFlavor that implements the kind of data that will be written to the system clipboard and will be pasted as an image into other applications, e.g. MS Word or MS Powerpoint

Constructor Detail

ClipboardContents

public ClipboardContents(Selection selection,
                         int numOfCopies)
Creates a new instance of the ClipboardContents class

Parameters:
selection - is saved in the elements of the ClipboardContents
numOfCopies - DOCUMENT ME!
Method Detail

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor arg0)
Returns true if the DataFlavor is supported

Specified by:
isDataFlavorSupported in interface Transferable
Parameters:
arg0 - the DataFlavor that is tested
Returns:
true if the DataFlavor is suppported

getNumOfCopiesInGraph

public int getNumOfCopiesInGraph()
Returns if this selection was cut or copied from the graph

Returns:
0 if the selection was cut

getTransferData

public Object getTransferData(DataFlavor arg0)
                       throws UnsupportedFlavorException,
                              IOException
Gets the data that is saved in this class. In this case the data is represented by the class itself

Specified by:
getTransferData in interface Transferable
Parameters:
arg0 - identifies if the class itself or the image should be returned
Returns:
the class itself or the image of the graph
Throws:
UnsupportedFlavorException - if DataFlavor is not supported
IOException - if the data is no longer present for some reason

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Returns all dataFlavors that are supported by Gravisto

Specified by:
getTransferDataFlavors in interface Transferable
Returns:
array of DataFlavors

decreaseNumOfCopies

public void decreaseNumOfCopies()
DOCUMENT ME!


increaseNumOfCopies

public void increaseNumOfCopies()
DOCUMENT ME!



Generated at 2012-05-30 11:00:36 PM CEST