Class DefaultGraphicLayer

java.lang.Object
org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.fmap.mapcontext.layers.FLyrDefault
org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect
org.gvsig.fmap.mapcontext.layers.vectorial.impl.DefaultGraphicLayer
All Implemented Interfaces:
org.gvsig.fmap.dal.HasDataStore, ExtendedPropertiesSupport, FLayer, FLayerHidesArea, LayerListener, Classifiable, ClassifiableVectorial, InfoByPoint, SingleLayer, GraphicLayer, VectorLayer, Projected, LegendContentsChangedListener, ILabelable, org.gvsig.metadata.Metadata, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.dynobject.DynObject, org.gvsig.tools.observer.Observer, org.gvsig.tools.persistence.Persistent

public class DefaultGraphicLayer extends FLyrVect implements GraphicLayer
Default GraphicLayer implementation.
Author:
gvSIG Team
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
  • Constructor Details

    • DefaultGraphicLayer

      public DefaultGraphicLayer()
  • Method Details

    • initialize

      public void initialize(org.gvsig.crs.projection.lib.Projection projection) throws org.gvsig.fmap.dal.exception.ValidateDataParametersException, org.gvsig.fmap.dal.exception.DataException, LoadLayerException
      Throws:
      org.gvsig.fmap.dal.exception.ValidateDataParametersException
      org.gvsig.fmap.dal.exception.DataException
      LoadLayerException
    • addGraphic

      public void addGraphic(String groupId, org.gvsig.fmap.geom.Geometry geom, int idsym)
      Description copied from interface: GraphicLayer
      Adds a new Geometry to be rendered into the layer.
      Specified by:
      addGraphic in interface GraphicLayer
      Parameters:
      groupId - group identifier. Allows to identify a group of Geometry added to the layer
      geom - the Geometry to add
      idsym - the ISymbol identifier to apply to render the Geometry
    • addGraphic

      public void addGraphic(org.gvsig.fmap.geom.Geometry geom, int idsym)
      Specified by:
      addGraphic in interface GraphicLayer
    • addGraphic

      public void addGraphic(org.gvsig.fmap.geom.Geometry geom, int idsym, String label)
      Specified by:
      addGraphic in interface GraphicLayer
    • addGraphic

      public void addGraphic(String groupId, org.gvsig.fmap.geom.Geometry geom, int idsym, String label)
      Description copied from interface: GraphicLayer
      Adds a new Geometry to be rendered into the layer.
      Specified by:
      addGraphic in interface GraphicLayer
      Parameters:
      groupId - group identifier. Allows to identify a group of Geometry added to the layer
      geom - the Geometry to add
      idsym - the ISymbol identifier to apply to render the Geometry
      label - the text to show if the ISymbol is a ITextSymbol. Set null otherwise.
    • addGraphic

      public void addGraphic(String groupId, org.gvsig.fmap.geom.Geometry geom, int idsym, String label, Object tag, int priority)
      Description copied from interface: GraphicLayer
      Adds a new Geometry to be rendered into the layer.
      Specified by:
      addGraphic in interface GraphicLayer
      Parameters:
      groupId - group identifier. Allows to identify a group of Geometry added to the layer
      geom - the Geometry to add
      idsym - the ISymbol identifier to apply to render the Geometry
      label - the text to show if the ISymbol is a ITextSymbol. Set null otherwise.
      tag - an object to classify, identify or add related information to the Geometry
      priority - to apply while rendering the Geometry. Values with lower priority will be rendered first.
    • addGraphics

      public void addGraphics(String groupId, Iterator geoms, int idsym)
      Description copied from interface: GraphicLayer
      Adds a new Geometry to be rendered into the layer.
      Specified by:
      addGraphics in interface GraphicLayer
      Parameters:
      groupId - group identifier. Allows to identify a group of Geometry added to the layer
      geoms - the Geometrys to add
      idsym - the ISymbol identifier to apply to render the Geometry
    • addGraphics

      public void addGraphics(String groupId, Iterator geoms, int idsym, String label)
      Description copied from interface: GraphicLayer
      Adds a new Geometry to be rendered into the layer.
      Specified by:
      addGraphics in interface GraphicLayer
      Parameters:
      groupId - group identifier. Allows to identify a group of Geometry added to the layer
      geoms - the Geometrys to add
      idsym - the ISymbol identifier to apply to render the Geometry
      label - the text to show if the ISymbol is a ITextSymbol. Set null otherwise.
    • addGraphics

      public void addGraphics(String groupId, Iterator geoms, int idsym, String label, Object tag, int priority)
      Description copied from interface: GraphicLayer
      Adds a new Geometry to be rendered into the layer.
      Specified by:
      addGraphics in interface GraphicLayer
      Parameters:
      groupId - group identifier. Allows to identify a group of Geometry added to the layer
      geoms - the Geometrys to add
      idsym - the ISymbol identifier to apply to render the Geometry
      label - the text to show if the ISymbol is a ITextSymbol. Set null otherwise.
      tag - an object to classify, identify or add related information to the Geometry
      priority - to apply while rendering the Geometry. Values with lower priority will be rendered first.
    • addSymbol

      public int addSymbol(ISymbol newSymbol)
      Description copied from interface: GraphicLayer
      Adds a new ISymbol to the layer to be used to render the Geometry objects. The symbol will be added to the legend of the layer.
      Specified by:
      addSymbol in interface GraphicLayer
      Parameters:
      newSymbol - the ISymbol to add
      Returns:
      an identifier of the symbol to be used when adding geometries
    • getSymbol

      public ISymbol getSymbol(int symbolPos)
      Description copied from interface: GraphicLayer
      Returns the ISymbol of the layer with the given identifier.
      Specified by:
      getSymbol in interface GraphicLayer
      Parameters:
      symbolPos - the symbol identifier
      Returns:
      the symbol with the given id or null if there is not any symbol registered with that id
    • getSymbolId

      public int getSymbolId(ISymbol symbol)
      Description copied from interface: GraphicLayer
      Returns the identifier of the symbol into the layer.
      Specified by:
      getSymbolId in interface GraphicLayer
      Parameters:
      symbol - the symbol to look for
      Returns:
      the symbol identifier or -1 if it is not registered into the layer
    • clearAllGraphics

      public void clearAllGraphics()
      Description copied from interface: GraphicLayer
      Removes all registered Geometry objects.
      Specified by:
      clearAllGraphics in interface GraphicLayer
    • clearAllSymbols

      public int clearAllSymbols()
      Description copied from interface: GraphicLayer
      Removes all registered ISymbol objects.
      Specified by:
      clearAllSymbols in interface GraphicLayer
    • removeGraphics

      public boolean removeGraphics(String groupId)
      Description copied from interface: GraphicLayer
      Removes all previously registered Geometry objects from the layer with the given groupId.
      Specified by:
      removeGraphics in interface GraphicLayer
      Parameters:
      groupId - of the geometries to remove
    • doDispose

      protected void doDispose() throws org.gvsig.tools.exception.BaseException
      Overrides:
      doDispose in class FLyrVect
      Throws:
      org.gvsig.tools.exception.BaseException
    • setLegend

      public void setLegend(IVectorLegend legend) throws LegendLayerException
      Description copied from interface: ClassifiableVectorial

      Sets the layer's legend as a vector legend.

      Specified by:
      setLegend in interface ClassifiableVectorial
      Overrides:
      setLegend in class FLyrVect
      Parameters:
      legend - the legend with vector data
      Throws:
      LegendLayerException - if fails setting the legend to this layer.
    • getFullEnvelope

      public org.gvsig.fmap.geom.primitive.Envelope getFullEnvelope() throws org.gvsig.fmap.dal.exception.ReadException
      Description copied from interface: FLayer
      Returns the full extension of the layer node.
      Specified by:
      getFullEnvelope in interface FLayer
      Overrides:
      getFullEnvelope in class FLyrVect
      Returns:
      location and dimension of this layer node
      Throws:
      org.gvsig.fmap.dal.exception.ReadException - if fails the driver used in this method.