Class CopyPasteLayersUtils
java.lang.Object
org.gvsig.app.project.documents.view.toc.actions.CopyPasteLayersUtils
This class provides utility methods to manage the TOC clipboard
which will contain one or more layers for copy/cut/paste
operations. It is currently implemented using a persistence
file where an instance of FLayers is stored.
- Author:
- jldominguez
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddLayers(org.gvsig.fmap.mapcontext.layers.FLayers clipboard_root, org.gvsig.fmap.mapcontext.layers.FLayers target_root) Adds layers to targetFLayersstatic voidstatic org.gvsig.tools.persistence.PersistentStategetAsFLayersPersistentState(org.gvsig.fmap.mapcontext.layers.FLayer[] actives, org.gvsig.fmap.mapcontext.MapContext ctxt) Gets an array of layers as aPersistentStateof an instance of FLayersstatic org.gvsig.fmap.mapcontext.layers.FLayersReturns the content of the clipboard as an instance of FLayers or null if clipboard is empty or does not contain instance of FLayersstatic booleanstatic booleanremoveLayers(org.gvsig.fmap.mapcontext.layers.FLayer[] actives, org.gvsig.fmap.mapcontext.MapContext mc) Remosves the layers from the their parentstatic voidsaveToClipboard(org.gvsig.tools.persistence.PersistentState st) Stores the givenPersistentStateto clipboard
-
Method Details
-
clearClipboard
- Throws:
IOException
-
isClipboardEmpty
public static boolean isClipboardEmpty() -
getClipboardAsFLayers
public static org.gvsig.fmap.mapcontext.layers.FLayers getClipboardAsFLayers() throws org.gvsig.tools.persistence.exception.PersistenceExceptionReturns the content of the clipboard as an instance of FLayers or null if clipboard is empty or does not contain instance of FLayers- Returns:
- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
saveToClipboard
public static void saveToClipboard(org.gvsig.tools.persistence.PersistentState st) throws org.gvsig.tools.persistence.exception.PersistenceException Stores the givenPersistentStateto clipboard- Parameters:
st-- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
getAsFLayersPersistentState
public static org.gvsig.tools.persistence.PersistentState getAsFLayersPersistentState(org.gvsig.fmap.mapcontext.layers.FLayer[] actives, org.gvsig.fmap.mapcontext.MapContext ctxt) throws org.gvsig.tools.persistence.exception.PersistenceException Gets an array of layers as aPersistentStateof an instance of FLayers- Parameters:
actives-ctxt-- Returns:
- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
removeLayers
public static boolean removeLayers(org.gvsig.fmap.mapcontext.layers.FLayer[] actives, org.gvsig.fmap.mapcontext.MapContext mc) Remosves the layers from the their parent- Parameters:
actives-mc-- Returns:
-
addLayers
public static boolean addLayers(org.gvsig.fmap.mapcontext.layers.FLayers clipboard_root, org.gvsig.fmap.mapcontext.layers.FLayers target_root) Adds layers to targetFLayers- Parameters:
clipboard_root-target_root-- Returns:
-