java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
All Implemented Interfaces:
Cloneable, CartographicSupport, IPrintable, ISymbol, ISymbol_v2, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.persistence.Persistent

public abstract class AbstractSymbol extends AbstractCartographicSupport implements ISymbol_v2, CartographicSupport
Abstract class that implements the interface the interface for symbols.It is considered as the father of all XXXSymbols and will implement all the methods that these classes had not developed (and correspond with one of the methods of AbstractSymbol class)
Author:
gvSIG Team
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
    • SYMBOL_PERSISTENCE_DEFINITION_NAME

      public static final String SYMBOL_PERSISTENCE_DEFINITION_NAME
      See Also:
  • Constructor Details

    • AbstractSymbol

      public AbstractSymbol()
  • Method Details

    • getFeature

      public org.gvsig.fmap.dal.feature.Feature getFeature()
      Specified by:
      getFeature in interface ISymbol
    • setFeature

      public void setFeature(org.gvsig.fmap.dal.feature.Feature feature)
      Specified by:
      setFeature in interface ISymbol
    • setDescription

      public final void setDescription(String desc)
      Description copied from interface: ISymbol
      Sets the description of this symbol
      Specified by:
      setDescription in interface ISymbol
      Parameters:
      desc - , a string with the description
    • getDescription

      public final String getDescription()
      Description copied from interface: ISymbol
      The description is a human-readable text used to label it when show in a symbol menu or something like that.
      Specified by:
      getDescription in interface ISymbol
      Returns:
      description of this symbol.
    • setID

      public final void setID(String id)
      Description copied from interface: ISymbol
      Set the id ob the symbol (the basename of file). This attribute is not persistent.
      Specified by:
      setID in interface ISymbol
      Parameters:
      id -
    • getID

      public final String getID()
      Description copied from interface: ISymbol
      Get the id ob the symbol (the basename of file).This attribute is not persistent.
      Specified by:
      getID in interface ISymbol
      Returns:
    • isShapeVisible

      public boolean isShapeVisible()
      Description copied from interface: ISymbol
      Tells whether the shape of the symbol will be drawn or not.
      Specified by:
      isShapeVisible in interface ISymbol
      Returns:
      true if Shape must be drawn. Useful if you are labelling
    • setIsShapeVisible

      public final void setIsShapeVisible(boolean isShapeVisible)
      Sets this symbol to visible
      Parameters:
      isShapeVisible -
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • clone

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

      protected ISymbol cloneForSelection()
    • cloneForSelection

      protected ISymbol cloneForSelection(Color selectionColor)
    • 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
      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
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • getRequiredFeatureAttributeNames

      public String[] getRequiredFeatureAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore featureStore) throws org.gvsig.fmap.dal.exception.DataException
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • draw

      public void draw(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.fmap.dal.feature.Feature f, org.gvsig.tools.task.Cancellable cancel)
      Description copied from interface: ISymbol
      Used when a symbol is going to be drawn.The method to do it will depend on the derived version of the symbol.
      Specified by:
      draw in interface ISymbol
      Parameters:
      g -
      affineTransform -
      cancel - TODO
    • drawInsideRectangle

      public void drawInsideRectangle(Graphics2D g, AffineTransform affineTransform, Rectangle r) throws SymbolDrawingException
      Description copied from interface: ISymbol
      Useful to render the symbol inside the TOC, or inside little rectangles. For example, think about rendering a Label with size in meters => You will need to specify a size in pixels. Of course, you can also to choose to render a prepared image, etc.
      Specified by:
      drawInsideRectangle in interface ISymbol
      Parameters:
      affineTransform -
      r -
      Throws:
      SymbolDrawingException - TODO
    • print

      public void print(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties)
      Specified by:
      print in interface IPrintable
    • getSymbolForSelection

      public ISymbol getSymbolForSelection()
      Description copied from interface: ISymbol
      Returns the derived version of the symbol that will be used to draw the feature when it is selected.
      Specified by:
      getSymbolForSelection in interface ISymbol
      Returns:
      ISymbol applied to a feature when it has been selected.
    • getSymbolForSelection

      public ISymbol getSymbolForSelection(Color selectionColor)
      Specified by:
      getSymbolForSelection in interface ISymbol