Class CharacterMarkerSymbol

java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol
org.gvsig.labeling.symbol.CharacterMarkerSymbol
All Implemented Interfaces:
Cloneable, org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport, org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol_v2, org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol, org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol_v2, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.persistence.Persistent

public class CharacterMarkerSymbol extends org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol implements org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol_v2
Allows to use a source of TrueType characters to define the marker that will substitute the symbol.If the picture is defined in a source, the performance is more agile.
Author:
jaume dominguez faus - jaume.dominguez@iver.es
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol

    org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol.RegisterPersistence

    Nested classes/interfaces inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport

    org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport.CartographicContext
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol

    MARKER_SYMBOL_PERSISTENCE_DEFINITION_NAME

    Fields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol

    LOGGER, SYMBOL_PERSISTENCE_DEFINITION_NAME

    Fields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport

    PAPER, WORLD

    Fields inherited from interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol

    CIRCLE_STYLE, CROSS_STYLE, DIAMOND_STYLE, HORIZONTAL_LINE_STYLE, SQUARE_STYLE, STAR_STYLE, SYMBOL_NAME, TRIANGLE_STYLE, VERTICAL_LINE_STYLE, X_STYLE

    Fields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol

    SELECTION_COLOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of CharacterMarker with default values
    CharacterMarkerSymbol(Font font, int charCode, Color color)
    Creates a new instance of CharacterMarker specifying the marker source font, the character code corresponding to the symbol, and the color that will be used in rendering time.
  • 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 feat, org.gvsig.tools.task.Cancellable cancel, Rectangle r)
     
    Returns the font that will be used to define the symbol
    int
     
    void
    getPixExtentPlus(org.gvsig.fmap.geom.Geometry geom, float[] distances, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi)
     
    org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    getSymbolForSelection(Color selectionColor)
     
    int
    Obtains the unicode for a symbol
    boolean
    isOneDotOrPixel(org.gvsig.fmap.geom.Geometry geom, double[] positionOfDotOrPixel, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi)
     
    boolean
    isSuitableFor(org.gvsig.fmap.geom.Geometry geom)
     
    boolean
    Returns true of false depending if the character marker symbol selected is visually corrected.That is, if the character has been properly scaled to use a specific number of pixels to be represented.
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    print(Graphics2D g, AffineTransform at, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties)
     
    static void
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    setAlpha(int a)
     
    void
    setFont(Font font)
    Sets the font that will be used to define the symbol
    void
    setSize(double size)
     
    void
    setUnicode(int symbol)
    Sets the unicode for a symbol represented by a character
    void
    setVisuallyCorrected(boolean visuallyCorrected)
    Sets the visual correction for a character in order to scale it if it is necessary.

    Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol

    getAdjustedSize, getCartographicSize, getColor, getEfectiveLineToOffsetColor, getEfectiveOffset, getEfectiveRotationInDegres, getEfectiveRotationInRadians, getEfectiveSize, getLineToOffsetColor, getLineToOffsetColorExpression, getMask, getOffset, getOffsetXExpression, getOffsetYExpression, getPoint, getRotation, getRotationExpression, getRotationInDegrees, getRotationInRadians, getSampleGeometry, getSize, getSizeExpression, getSymbolTable, getSymbolType, isDrawLineToOffset, setColor, setDrawLineToOffset, setLineToOffsetColor, setLineToOffsetColorExpression, setMask, setOffset, setOffsetXExpression, setOffsetYExpression, setRotation, setRotationExpression, setRotationInDegrees, setRotationInRadians, setSizeExpression

    Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol

    cloneForSelection, cloneForSelection, draw, drawInsideRectangle, equals, getDescription, getFeature, getID, getRequiredFeatureAttributeNames, getSymbolForSelection, isShapeVisible, setDescription, setFeature, setID, setIsShapeVisible

    Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport

    copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnits

    Methods inherited from class java.lang.Object

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

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

    copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnits

    Methods inherited from interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol

    getColor, getMask, getOffset, getRotation, getSize, setColor, setMask, setOffset, setRotation

    Methods inherited from interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol_v2

    getEfectiveLineToOffsetColor, getEfectiveOffset, getEfectiveRotationInDegres, getEfectiveRotationInRadians, getEfectiveSize, getLineToOffsetColor, getLineToOffsetColorExpression, getOffsetXExpression, getOffsetYExpression, getRotationExpression, getSizeExpression, isDrawLineToOffset, setDrawLineToOffset, setLineToOffsetColor, setLineToOffsetColorExpression, setOffsetXExpression, setOffsetYExpression, setRotationExpression, setSizeExpression

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

    draw, drawInsideRectangle, getDescription, getFeature, getID, getSymbolForSelection, getSymbolType, isShapeVisible, setDescription, setFeature, setID
  • Field Details

    • CHARACTER_MARKER_SYMBOL_PERSISTENCE_NAME

      public static final String CHARACTER_MARKER_SYMBOL_PERSISTENCE_NAME
      See Also:
  • Constructor Details

    • CharacterMarkerSymbol

      public CharacterMarkerSymbol()
      Creates a new instance of CharacterMarker with default values
    • CharacterMarkerSymbol

      public CharacterMarkerSymbol(Font font, int charCode, Color color)
      Creates a new instance of CharacterMarker specifying the marker source font, the character code corresponding to the symbol, and the color that will be used in rendering time.
      Parameters:
      font - - src Font
      charCode - - character code of the symbol for this font
      color - - color to be used in when rendering.
  • Method Details

    • getFont

      public Font getFont()
      Returns the font that will be used to define the symbol
      Returns:
      font
    • setFont

      public void setFont(Font font)
      Sets the font that will be used to define the symbol
    • getSymbolForSelection

      public org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol getSymbolForSelection(Color selectionColor)
      Specified by:
      getSymbolForSelection in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
      Overrides:
      getSymbolForSelection in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
    • draw

      public void draw(Graphics2D g, AffineTransform affineTransform, org.gvsig.fmap.geom.Geometry geom, org.gvsig.fmap.dal.feature.Feature feat, org.gvsig.tools.task.Cancellable cancel, Rectangle r)
      Specified by:
      draw in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • setUnicode

      public void setUnicode(int symbol)
      Sets the unicode for a symbol represented by a character
      Parameters:
      symbol - , int
    • getUnicode

      public int getUnicode()
      Obtains the unicode for a symbol
      Returns:
      unicode, int
    • setSize

      public void setSize(double size)
      Specified by:
      setSize in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol
      Overrides:
      setSize in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol
    • isVisuallyCorrected

      public boolean isVisuallyCorrected()
      Returns true of false depending if the character marker symbol selected is visually corrected.That is, if the character has been properly scaled to use a specific number of pixels to be represented.
      Returns:
      boolean
    • setVisuallyCorrected

      public void setVisuallyCorrected(boolean visuallyCorrected)
      Sets the visual correction for a character in order to scale it if it is necessary.
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol
      Throws:
      CloneNotSupportedException
    • getPixExtentPlus

      public void getPixExtentPlus(org.gvsig.fmap.geom.Geometry geom, float[] distances, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi)
    • isOneDotOrPixel

      public boolean isOneDotOrPixel(org.gvsig.fmap.geom.Geometry geom, double[] positionOfDotOrPixel, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi)
    • getOnePointRgb

      public int getOnePointRgb()
    • isSuitableFor

      public boolean isSuitableFor(org.gvsig.fmap.geom.Geometry geom)
      Specified by:
      isSuitableFor in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
      Overrides:
      isSuitableFor in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol
    • print

      public void print(Graphics2D g, AffineTransform at, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties)
      Specified by:
      print in interface org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable
      Overrides:
      print in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
    • setAlpha

      public void setAlpha(int a)
      Specified by:
      setAlpha in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol
      Overrides:
      setAlpha in class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol
    • 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 org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol
      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 org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • registerPersistent

      public static void registerPersistent()