Class TLcyDataTransferManager

java.lang.Object
com.luciad.lucy.datatransfer.TLcyDataTransferManager

public class TLcyDataTransferManager extends Object

This manager is a central container for ALcyLayerSelectionTransferHandler objects by using a TLcyCompositeLayerSelectionTransferHandler. The registered ALcyLayerSelectionTransferHandler objects are responsible for converting model objects from one representation to another. This allows Lucy to provide, for instance, copy/paste functionality.

Consult the javadoc of TLcyCompositeLayerSelectionTransferHandler for more information about adding and/or removing ALcyLayerSelectionTransferHandlers, either directly to the TLcyCompositeLayerSelectionTransferHandler or by using the Lucy back-end services.

Obtaining, adding and/or removing ALcyLayerSelectionTransferHandler instances can either be achieved by using the corresponding methods in this class, or by using the corresponding methods provided in TLcyCompositeLayerSelectionTransferHandler.

When using the back-end based TLcyDataTransferManager, obtaining, adding and/or removing ALcyLayerSelectionTransferHandler instances can be achieved on any back-end based TLcyCompositeLayerSelectionTransferHandler, e.g. there is no need to go through this TLcyDataTransferManager. This is illustrated in the code snippets below, which are equivalent:

Obtaining, adding and/or removing an ALcyLayerSelectionTransferHandler through a back-end based TLcyDataTransferManager:


 //Create a new instance whenever you need it
 TLcyDataTransferManager manager = new TLcyDataTransferManager( aLucyEnv );
 //add a handler
 manager.addLayerSelectionTransferHandler( aLayerSelectionTransferHandler );
 //remove a handler
 manager.removeLayerSelectionTransferHandler( anotherLayerSelectionTransferHandler );
 //obtain a handler
 ALcyLayerSelectionTransferHandler handler =
   manager.getLayerSelectionTransferHandler( manager.getLayerSelectionTransferHandlerCount() -1 );
 //There is no need to keep a reference to the composite instance, you can create a new one
 //the next time you would need it
 manager = null;
 

Obtaining, adding and/or removing an ALcyLayerSelectionTransferHandler through a back-end based TLcyCompositeLayerSelectionTransferHandler:


 //Create a new instance whenever you need it
 TLcyCompositeLayerSelectionTransferHandler composite = new TLcyCompositeLayerSelectionTransferHandler( aLucyEnv );
 //add a handler
 composite.addLayerSelectionTransferHandler( aLayerSelectionTransferHandler );
 //remove a handler
 composite.removeLayerSelectionTransferHandler( anotherLayerSelectionTransferHandler );
 //obtain a handler
 ALcyLayerSelectionTransferHandler handler =
   composite.getLayerSelectionTransferHandler( composite.getLayerSelectionTransferHandlerCount() -1 );
 //There is no need to keep a reference to the composite instance, you can create a new one
 //the next time you would need it
 manager = null;
 

Obtaining, adding and/or removing an ALcyLayerSelectionTransferHandler directly from/on the back-end:


 //Suppose we have a reference to the back-end
 ILcyLucyEnv backEnd;
 //add a handler
 backEnd.addService( aLayerSelectionTransferHandler );
 //remove a handler
 backEnd.removeService( anotherLayerSelectionTransferHandler );
 //obtain a handler
 List<ALcyLayerSelectionTransferHandler> handlers =
   backEnd.getServices( ALcyLayerSelectionTransferHandler.class );
 ALcyLayerSelectionTransferHandler handler = handlers.get( handlers.size() -1 );
 

Note: when ALcyLayerSelectionTransferHandler implementations added to this manager or to the TLcyCompositeLayerSelectionTransferHandler can export to a custom DataFlavor, the transfer data associated with this DataFlavor should be an ILcyLayerSubsetList.

See Also: