java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
All Implemented Interfaces:
Cloneable, org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport, org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle, org.gvsig.fmap.mapcontext.rendering.symbols.styles.IStyle, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.persistence.Persistent

public class ImageStyle extends BackgroundFileStyle
Controls the style of an image to be correctly painted. This class controls aspects like the source path of the image, creates a rectangle to paint inside the image, draws the outline of the image and so on.
Author:
gvSIG Team
  • Field Details

    • IMAGE_STYLE_PERSISTENCE_DEFINITION_NAME

      public static final String IMAGE_STYLE_PERSISTENCE_DEFINITION_NAME
      See Also:
  • Constructor Details

    • ImageStyle

      public ImageStyle()
  • Method Details

    • setSource

      public void setSource(URL url) throws IOException
      Defines the source (file) from where the buffered image will be taken.
      Specified by:
      setSource in interface org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle
      Specified by:
      setSource in class BackgroundFileStyle
      Parameters:
      url -
      Throws:
      IOException
    • getBounds

      public Rectangle getBounds()
      Creates a rectangle with the dimensions of the buffered image
      Specified by:
      getBounds in interface org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle
      Specified by:
      getBounds in class BackgroundFileStyle
      Returns:
      Rectangle
      See Also:
      • Component.getBounds()
      • invalid reference
        #setBounds(Rectangle)
      • invalid reference
        #setBounds(int, int, int, int)
    • drawInsideRectangle

      public void drawInsideRectangle(Graphics2D g, Rectangle r, boolean keepAspectRatio)
      Specified by:
      drawInsideRectangle in class BackgroundFileStyle
    • isSuitableFor

      public boolean isSuitableFor(org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
    • drawOutline

      public void drawOutline(Graphics2D g, Rectangle r) throws org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
      Throws:
      org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException
    • 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 AbstractStyle
      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 AbstractStyle
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException