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.fill.impl.AbstractFillSymbol
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.PictureFillSymbol
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.fill.IFillSymbol, org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.persistence.Persistent

public class PictureFillSymbol extends AbstractFillSymbol implements org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
PictureFillSymbol allows to use an image file suported by gvSIG as a padding for the polygons.This image can be modified using methods to scale or rotate it.
Author:
jaume dominguez faus - jaume.dominguez@iver.es
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
    static class 
     

    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.fill.impl.AbstractFillSymbol

    FILL_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.fill.IFillSymbol

    SYMBOL_NAME

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

    SELECTION_COLOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor method
    PictureFillSymbol(URL imageURL, URL selImageURL)
    Constructor method
  • 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, Rectangle r)
     
    double
    Defines the angle for the rotation of the image when it is added to create the padding
    org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle
     
     
    org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IMarkerFillPropertiesStyle
    Returns the IMarkerFillProperties that allows this class to treat the picture as a marker in order to scale it, rotate it and so on.
    org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle
     
    Returns the URL of the image used when the polygon is selected
    Returns the URL of the image that is used to create the padding to fill the polygon
    org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    getSymbolForSelection(Color selectionColor)
     
    int
     
    double
    Defines the scale for the x axis of the image when it is added to create the padding
    double
    Defines the scale for the y axis of the image when it is added to create the padding
    void
    loadFromState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    saveToState(org.gvsig.tools.persistence.PersistentState state)
     
    void
    setAngle(double angle)
    Sets the angle for the rotation of the image when it is added to create the padding
    final void
    setImage(URL imageUrl)
    Defines the URL from where the picture to fill the polygon is taken.
    void
    setMarkerFillProperties(org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IMarkerFillPropertiesStyle prop)
    Sets the MarkerFillProperties in order to allow the user to modify the picture as a marker (it is possible to scale it, rotate it and so on)
    final void
    setSelImage(URL selImageUrl)
    Sets the URL for the image to be used as a picture fill symbol (when it is selected in the map)
    void
    setXScale(double xScale)
    Returns the scale for the x axis of the image when it is added to create the padding
    void
    setYScale(double yScale)
    Returns the scale for the y axis of the image when it is added to create the padding
    double
    toCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom)
     

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

    cloneForSelection, cloneForSelection, draw, drawInsideRectangle, equals, getDescription, getFeature, getID, getRequiredFeatureAttributeNames, getSymbolForSelection, isShapeVisible, print, 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, 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.fill.IFillSymbol

    getFillAlpha, getFillColor, getOutline, hasFill, hasOutline, isSuitableFor, setFillColor, setHasFill, setHasOutline, setOutline

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

    print

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

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

    • PICTURE_FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME

      public static final String PICTURE_FILL_SYMBOL_PERSISTENCE_DEFINITION_NAME
      See Also:
  • Constructor Details

    • PictureFillSymbol

      public PictureFillSymbol()
      Constructor method
    • PictureFillSymbol

      public PictureFillSymbol(URL imageURL, URL selImageURL) throws IOException
      Constructor method
      Parameters:
      imageURL - , URL of the normal image
      selImageURL - , URL of the image when it is selected in the map
      Throws:
      IOException
  • Method Details

    • 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, Rectangle r)
      Specified by:
      draw in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • setSelImage

      public final void setSelImage(URL selImageUrl) throws IOException
      Sets the URL for the image to be used as a picture fill symbol (when it is selected in the map)
      Specified by:
      setSelImage in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Parameters:
      imageFile - , File
      Throws:
      IOException
    • setImage

      public final void setImage(URL imageUrl) throws IOException
      Defines the URL from where the picture to fill the polygon is taken.
      Specified by:
      setImage in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Parameters:
      imageFile -
      Throws:
      IOException
    • 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
    • getSymbolType

      public int getSymbolType()
      Specified by:
      getSymbolType in interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
    • getClassName

      public String getClassName()
    • getMarkerFillProperties

      public org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IMarkerFillPropertiesStyle getMarkerFillProperties()
      Returns the IMarkerFillProperties that allows this class to treat the picture as a marker in order to scale it, rotate it and so on.
      Specified by:
      getMarkerFillProperties in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Returns:
      markerFillProperties,IMarkerFillPropertiesStyle
    • setMarkerFillProperties

      public void setMarkerFillProperties(org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IMarkerFillPropertiesStyle prop)
      Sets the MarkerFillProperties in order to allow the user to modify the picture as a marker (it is possible to scale it, rotate it and so on)
      Specified by:
      setMarkerFillProperties in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Parameters:
      prop -
    • getAngle

      public double getAngle()
      Defines the angle for the rotation of the image when it is added to create the padding
      Specified by:
      getAngle in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Returns:
      angle
    • setAngle

      public void setAngle(double angle)
      Sets the angle for the rotation of the image when it is added to create the padding
      Specified by:
      setAngle in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Parameters:
      angle -
    • getXScale

      public double getXScale()
      Defines the scale for the x axis of the image when it is added to create the padding
      Specified by:
      getXScale in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Returns:
      xScale
    • setXScale

      public void setXScale(double xScale)
      Returns the scale for the x axis of the image when it is added to create the padding
      Specified by:
      setXScale in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Parameters:
      xScale -
    • getYScale

      public double getYScale()
      Defines the scale for the y axis of the image when it is added to create the padding
      Specified by:
      getYScale in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Returns:
      yScale
    • setYScale

      public void setYScale(double yScale)
      Returns the scale for the y axis of the image when it is added to create the padding
      Specified by:
      setYScale in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Parameters:
      yScale -
    • getSource

      public URL getSource()
      Returns the URL of the image that is used to create the padding to fill the polygon
      Specified by:
      getSource in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Returns:
      imagePath
    • getSelectedSource

      public URL getSelectedSource()
      Returns the URL of the image used when the polygon is selected
      Specified by:
      getSelectedSource in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
      Returns:
    • toCartographicSize

      public double toCartographicSize(org.gvsig.fmap.mapcontext.ViewPort viewPort, double dpi, org.gvsig.fmap.geom.Geometry geom)
      Overrides:
      toCartographicSize in class AbstractFillSymbol
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class AbstractFillSymbol
      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 AbstractFillSymbol
      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 AbstractFillSymbol
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • getBackgroundFileStyle

      public org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle getBackgroundFileStyle()
      Specified by:
      getBackgroundFileStyle in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
    • getSelectedBackgroundFileStyle

      public org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle getSelectedBackgroundFileStyle()
      Specified by:
      getSelectedBackgroundFileStyle in interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol