Class LayerManager


  • public class LayerManager
    extends Object
    Registry of Layers in a Task.
    See Also:
    Task, Layer
    • Constructor Detail

      • LayerManager

        public LayerManager()
    • Method Detail

      • deferFiringEvents

        public void deferFiringEvents​(Runnable r)
      • generateLayerFillColor

        public Color generateLayerFillColor()
      • addLayerable

        public void addLayerable​(String categoryName,
                                 Layerable layerable)
      • addCategory

        public void addCategory​(String categoryName)
      • addCategory

        public void addCategory​(String categoryName,
                                int index)
      • getCategories

        public List getCategories()
      • addLayer

        public Layer addLayer​(String categoryName,
                              String layerName,
                              FeatureCollection featureCollection)
        Parameters:
        name - the name of the layer. A number will be appended if a layer with the same name already exists. Set to null to automatically generate a new name.
      • uniqueLayerName

        public String uniqueLayerName​(String name)
        Returns:
        a unique layer name based on the given name
      • remove

        public void remove​(Layerable layerable)
      • removeIfEmpty

        public void removeIfEmpty​(Category category)
      • indexOf

        public int indexOf​(Category category)
      • fireGeometryModified

        public void fireGeometryModified​(Collection features,
                                         Layer layer,
                                         Collection oldFeatureClones)
      • setFiringEvents

        public void setFiringEvents​(boolean firingEvents)
      • isFiringEvents

        public boolean isFiringEvents()
      • reverseIterator

        public Iterator reverseIterator​(Class layerableClass)
        Returns:
        an iterator over the layers, from bottom to top. Layers with #drawingLast = true appear last.
      • iterator

        public Iterator iterator()
        Returns:
        Layers, not all Layerables
      • getLayer

        public Layer getLayer​(String name)
        Returns:
        null if there is no such layer
      • addLayerListener

        public void addLayerListener​(LayerListener layerListener)
      • removeLayerListener

        public void removeLayerListener​(LayerListener layerListener)
      • getLayer

        public Layer getLayer​(int index)
      • size

        public int size()
      • getEnvelopeOfAllLayers

        public org.locationtech.jts.geom.Envelope getEnvelopeOfAllLayers()
      • indexOf

        public int indexOf​(Layer layer)
        Returns:
        -1 if the layer does not exist
      • getLayers

        public List getLayers()
      • getLayerables

        public List getLayerables​(Class layerableClass)
        To get all Layerables, set layerableClass to Layerable.class.
      • getVisibleLayers

        public List getVisibleLayers​(boolean includeFence)
      • dispose

        public void dispose()
      • layerManagerCount

        public static int layerManagerCount()
      • getEditableLayers

        public Collection getEditableLayers()
        Editability is not enforced; all parties are responsible for heeding the editability of a layer.
      • getBlackboard

        public Blackboard getBlackboard()
      • getLayersWithModifiedFeatureCollections

        public Collection getLayersWithModifiedFeatureCollections()
      • setCoordinateSystem

        public void setCoordinateSystem​(CoordinateSystem coordinateSystem)
      • main

        public static void main​(String[] args)
                         throws org.locationtech.jts.io.ParseException
        Throws:
        org.locationtech.jts.io.ParseException