Interface ISymbol

All Superinterfaces:
Cloneable, org.gvsig.tools.lang.Cloneable, IPrintable, org.gvsig.tools.persistence.Persistent
All Known Subinterfaces:
IMultiLayerSymbol, ISymbol_v2, ITextSymbol, IWarningSymbol
All Known Implementing Classes:
AbstractSymbol

public interface ISymbol extends org.gvsig.tools.persistence.Persistent, IPrintable, org.gvsig.tools.lang.Cloneable
Interface for symbols.It is the most general one which is implemented by other specific symbols.For this reason this interface has a method to obtain the derived version of a common symbol(apart from others). The main purpose is to offer a set of symbols that will be part of the FMap kernel and allow the developer to add new symbols without changes in the initial implementation.
Author:
jaume dominguez faus - jaume.dominguez@iver.es
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Color
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    Used when a symbol is going to be drawn.The method to do it will depend on the derived version of the symbol.
    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, Rectangle r)
     
    void
    Useful to render the symbol inside the TOC, or inside little rectangles.
    Returns the Color to use to render the symbol.
    The description is a human-readable text used to label it when show in a symbol menu or something like that.
    org.gvsig.fmap.dal.feature.Feature
     
    Get the id ob the symbol (the basename of file).This attribute is not persistent.
    Returns the derived version of the symbol that will be used to draw the feature when it is selected.
    getSymbolForSelection(Color selectionColor)
     
    int
    The use of this method -and its mechanism- is being valorated.
    boolean
    Tells whether the shape of the symbol will be drawn or not.
    boolean
    isSuitableFor(org.gvsig.fmap.geom.Geometry geom)
    True if this symbol is ok for the geometry.
    void
    setColor(Color color)
    Sets the Color to use to render the symbol.
    void
    Sets the description of this symbol
    void
    setFeature(org.gvsig.fmap.dal.feature.Feature feature)
     
    void
    Set the id ob the symbol (the basename of file).

    Methods inherited from interface org.gvsig.tools.lang.Cloneable

    clone

    Methods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable

    print

    Methods inherited from interface org.gvsig.tools.persistence.Persistent

    loadFromState, saveToState
  • Field Details

    • SELECTION_COLOR

      static final Color SELECTION_COLOR
  • Method Details

    • getSymbolForSelection

      ISymbol getSymbolForSelection()
      Returns the derived version of the symbol that will be used to draw the feature when it is selected.
      Returns:
      ISymbol applied to a feature when it has been selected.
    • getSymbolForSelection

      ISymbol getSymbolForSelection(Color selectionColor)
    • draw

      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)
      Used when a symbol is going to be drawn.The method to do it will depend on the derived version of the symbol.
      Parameters:
      g -
      affineTransform -
      cancel - TODO
      shp -
    • getDescription

      String getDescription()
      The description is a human-readable text used to label it when show in a symbol menu or something like that.
      Returns:
      description of this symbol.
    • isShapeVisible

      boolean isShapeVisible()
      Tells whether the shape of the symbol will be drawn or not.
      Returns:
      true if Shape must be drawn. Useful if you are labelling
    • setDescription

      void setDescription(String desc)
      Sets the description of this symbol
      Parameters:
      desc - , a string with the description
    • getSymbolType

      int getSymbolType()
      The use of this method -and its mechanism- is being valorated. It probably will be deprecated.
      Returns:
      FSymbol constants. I think it is better to use isSuitableFor
    • isSuitableFor

      boolean isSuitableFor(org.gvsig.fmap.geom.Geometry geom)
      True if this symbol is ok for the geometry. For example, a FillSymbol will be suitable for a Polygon.
      Parameters:
      geom -
      Returns:
    • drawInsideRectangle

      void drawInsideRectangle(Graphics2D g, AffineTransform scaleInstance, Rectangle r) throws SymbolDrawingException
      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.
      Parameters:
      scaleInstance -
      r -
      g2 -
      Throws:
      SymbolDrawingException - TODO
    • getColor

      Color getColor()
      Returns the Color to use to render the symbol.
      Returns:
      the Color to use to render the symbol
    • setColor

      void setColor(Color color)
      Sets the Color to use to render the symbol.
      Parameters:
      color - to render the symbol
    • setID

      void setID(String id)
      Set the id ob the symbol (the basename of file). This attribute is not persistent.
      Parameters:
      id -
    • getID

      String getID()
      Get the id ob the symbol (the basename of file).This attribute is not persistent.
      Returns:
    • getFeature

      org.gvsig.fmap.dal.feature.Feature getFeature()
    • setFeature

      void setFeature(org.gvsig.fmap.dal.feature.Feature feature)
    • draw

      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, Rectangle r)