Class AbstractVectorialLegend

java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractLegend
org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend
All Implemented Interfaces:
Cloneable, org.gvsig.fmap.mapcontext.rendering.legend.DrawingObservable, org.gvsig.fmap.mapcontext.rendering.legend.ILegend, org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend, org.gvsig.fmap.mapcontext.rendering.legend.Legend, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.persistence.Persistent
Direct Known Subclasses:
AbstractClassifiedVectorLegend, DefaultDynamicVectorLegend, SingleSymbolLegend

public abstract class AbstractVectorialLegend extends AbstractLegend implements org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend
Base implementation for Vectorial data Legends. Provides a draw method implementation which loads the Features and uses the ISymbol objects to draw the Geometry objects.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final org.slf4j.Logger
     
    static final String
     
    protected org.gvsig.fmap.mapcontext.rendering.legend.ZSort
     

    Fields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractLegend

    LEGEND_PERSISTENCE_DEFINITION_NAME
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore)
     
    void
    draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery)
     
    protected void
    draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi)
    Draws the features from the FeatureStore, filtered with the scale and the query parameters, with the symbols of the legend.
    protected void
    drawFeatures(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, double dpi, DefaultFeatureDrawnNotification drawnNotification, org.gvsig.fmap.dal.feature.FeatureSet featureSet, org.gvsig.fmap.dal.feature.FeatureSelection selection)
    Draws the features from the FeatureSet, with the symbols of the legend.
    protected abstract String[]
    getRequiredFeatureAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore featureStore)
    Returns the names of the Feature attributes required for the ILegend to operate.
    org.gvsig.fmap.mapcontext.rendering.legend.ZSort
     
    protected void
    internalDraw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi, org.gvsig.tools.task.SimpleTaskStatus taskStatus)
     
    boolean
     
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    print(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.compat.print.PrintAttributes properties)
     
    void
    print(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery fquery, org.gvsig.compat.print.PrintAttributes properties)
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    setDrawSymbolInEeachPrimitive(boolean drawSymbolInEeachPrimitive)
     
    void
    setZSort(org.gvsig.fmap.mapcontext.rendering.legend.ZSort zSort)
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gvsig.fmap.mapcontext.rendering.legend.DrawingObservable

    addDrawingObserver, deleteDrawingObserver, deleteDrawingObservers

    Methods inherited from interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend

    addLegendListener, cloneLegend, fireDefaultSymbolChangedEvent, getListeners, removeLegendListener

    Methods inherited from interface org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend

    getDefaultSymbol, getShapeType, getSymbolByFeature, isSuitableForShapeType, isUseDefaultSymbol, setDefaultSymbol, setShapeType, useDefaultSymbol
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
    • VECTORIAL_LEGEND_PERSISTENCE_DEFINITION_NAME

      public static final String VECTORIAL_LEGEND_PERSISTENCE_DEFINITION_NAME
      See Also:
    • zSort

      protected org.gvsig.fmap.mapcontext.rendering.legend.ZSort zSort
  • Constructor Details

    • AbstractVectorialLegend

      protected AbstractVectorialLegend()
  • Method Details

    • getZSort

      public org.gvsig.fmap.mapcontext.rendering.legend.ZSort getZSort()
    • setZSort

      public void setZSort(org.gvsig.fmap.mapcontext.rendering.legend.ZSort zSort)
    • draw

      public void draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException
      Specified by:
      draw in interface org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend
      Throws:
      org.gvsig.fmap.mapcontext.rendering.legend.LegendException
    • draw

      public void draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException
      Specified by:
      draw in interface org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend
      Throws:
      org.gvsig.fmap.mapcontext.rendering.legend.LegendException
    • print

      public void print(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.compat.print.PrintAttributes properties) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException
      Specified by:
      print in interface org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend
      Throws:
      org.gvsig.fmap.mapcontext.rendering.legend.LegendException
    • print

      public void print(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery fquery, org.gvsig.compat.print.PrintAttributes properties) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException
      Specified by:
      print in interface org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend
      Throws:
      org.gvsig.fmap.mapcontext.rendering.legend.LegendException
    • draw

      protected void draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException
      Draws the features from the FeatureStore, filtered with the scale and the query parameters, with the symbols of the legend.
      Parameters:
      image -
      g -
      viewPort -
      cancel -
      scale -
      queryParameters -
      coordTrans -
      featureStore -
      featureQuery -
      dpi -
      Throws:
      org.gvsig.fmap.mapcontext.rendering.legend.LegendException
    • internalDraw

      protected void internalDraw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws LegendDrawingException
      Throws:
      LegendDrawingException
    • drawFeatures

      protected void drawFeatures(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, double dpi, DefaultFeatureDrawnNotification drawnNotification, org.gvsig.fmap.dal.feature.FeatureSet featureSet, org.gvsig.fmap.dal.feature.FeatureSelection selection) throws org.gvsig.tools.exception.BaseException
      Draws the features from the FeatureSet, with the symbols of the legend.
      Throws:
      org.gvsig.tools.exception.BaseException
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class AbstractLegend
      Throws:
      CloneNotSupportedException
    • loadFromState

      public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Overrides:
      loadFromState in class AbstractLegend
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      saveToState in interface org.gvsig.tools.persistence.Persistent
      Overrides:
      saveToState in class AbstractLegend
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • getRequiredFeatureAttributeNames

      protected abstract String[] getRequiredFeatureAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore featureStore) throws org.gvsig.fmap.dal.exception.DataException
      Returns the names of the Feature attributes required for the ILegend to operate.
      Parameters:
      featureStore - the store where the Features belong to
      Returns:
      the names of required Feature attribute names
      Throws:
      org.gvsig.fmap.dal.exception.DataException - if there is an error getting the attribute names
    • isDrawSymbolInEeachPrimitive

      public boolean isDrawSymbolInEeachPrimitive()
      Returns:
      the drawSymbolInEeachPrimitive
    • setDrawSymbolInEeachPrimitive

      public void setDrawSymbolInEeachPrimitive(boolean drawSymbolInEeachPrimitive)
      Parameters:
      drawSymbolInEeachPrimitive - the drawSymbolInEeachPrimitive to set