Class CopyPasteLayersUtils

java.lang.Object
org.gvsig.app.project.documents.view.toc.actions.CopyPasteLayersUtils

public class CopyPasteLayersUtils extends Object
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 Type
    Method
    Description
    static boolean
    addLayers(org.gvsig.fmap.mapcontext.layers.FLayers clipboard_root, org.gvsig.fmap.mapcontext.layers.FLayers target_root)
    Adds layers to target FLayers
    static void
     
    static org.gvsig.tools.persistence.PersistentState
    getAsFLayersPersistentState(org.gvsig.fmap.mapcontext.layers.FLayer[] actives, org.gvsig.fmap.mapcontext.MapContext ctxt)
    Gets an array of layers as a PersistentState of an instance of FLayers
    static org.gvsig.fmap.mapcontext.layers.FLayers
    Returns the content of the clipboard as an instance of FLayers or null if clipboard is empty or does not contain instance of FLayers
    static boolean
     
    static boolean
    removeLayers(org.gvsig.fmap.mapcontext.layers.FLayer[] actives, org.gvsig.fmap.mapcontext.MapContext mc)
    Remosves the layers from the their parent
    static void
    saveToClipboard(org.gvsig.tools.persistence.PersistentState st)
    Stores the given PersistentState to clipboard

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • clearClipboard

      public static void clearClipboard() throws IOException
      Throws:
      IOException
    • isClipboardEmpty

      public static boolean isClipboardEmpty()
    • getClipboardAsFLayers

      public static org.gvsig.fmap.mapcontext.layers.FLayers getClipboardAsFLayers() throws org.gvsig.tools.persistence.exception.PersistenceException
      Returns 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 given PersistentState to 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 a PersistentState of 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 target FLayers
      Parameters:
      clipboard_root -
      target_root -
      Returns: