Class PictureFillSymbol
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 ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport.CartographicContext -
Field Summary
FieldsFields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.impl.AbstractFillSymbol
FILL_SYMBOL_PERSISTENCE_DEFINITION_NAMEFields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
LOGGER, SYMBOL_PERSISTENCE_DEFINITION_NAMEFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
PAPER, WORLDFields inherited from interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol
SYMBOL_NAMEFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
SELECTION_COLOR -
Constructor Summary
ConstructorsConstructorDescriptionConstructor methodPictureFillSymbol(URL imageURL, URL selImageURL) Constructor method -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddraw(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) doublegetAngle()Defines the angle for the rotation of the image when it is added to create the paddingorg.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyleorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.IMarkerFillPropertiesStyleReturns 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.IBackgroundFileStyleReturns the URL of the image used when the polygon is selectedReturns the URL of the image that is used to create the padding to fill the polygonorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbolgetSymbolForSelection(Color selectionColor) intdoubleDefines the scale for the x axis of the image when it is added to create the paddingdoubleDefines the scale for the y axis of the image when it is added to create the paddingvoidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetAngle(double angle) Sets the angle for the rotation of the image when it is added to create the paddingfinal voidDefines the URL from where the picture to fill the polygon is taken.voidsetMarkerFillProperties(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 voidsetSelImage(URL selImageUrl) Sets the URL for the image to be used as a picture fill symbol (when it is selected in the map)voidsetXScale(double xScale) Returns the scale for the x axis of the image when it is added to create the paddingvoidsetYScale(double yScale) Returns the scale for the y axis of the image when it is added to create the paddingdoubletoCartographicSize(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.fill.impl.AbstractFillSymbol
getCartographicSize, getColor, getFillAlpha, getFillColor, getOutline, getSampleGeometry, hasFill, hasOutline, isSuitableFor, setCartographicSize, setColor, setFillColor, setHasFill, setHasOutline, setOutline, setUnitMethods 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, setIsShapeVisibleMethods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, toCartographicUnitsMethods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.CartographicSupport
copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, toCartographicUnitsMethods inherited from interface org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol
getFillAlpha, getFillColor, getOutline, hasFill, hasOutline, isSuitableFor, setFillColor, setHasFill, setHasOutline, setOutlineMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.IPrintable
printMethods 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
- See Also:
-
-
Constructor Details
-
PictureFillSymbol
public PictureFillSymbol()Constructor method -
PictureFillSymbol
Constructor method- Parameters:
imageURL- , URL of the normal imageselImageURL- , 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:
drawin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
setSelImage
Sets the URL for the image to be used as a picture fill symbol (when it is selected in the map)- Specified by:
setSelImagein interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol- Parameters:
imageFile- , File- Throws:
IOException
-
setImage
Defines the URL from where the picture to fill the polygon is taken.- Specified by:
setImagein interfaceorg.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:
getSymbolForSelectionin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol- Overrides:
getSymbolForSelectionin classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
-
getSymbolType
public int getSymbolType()- Specified by:
getSymbolTypein interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
-
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:
getMarkerFillPropertiesin interfaceorg.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:
setMarkerFillPropertiesin interfaceorg.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:
getAnglein interfaceorg.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:
setAnglein interfaceorg.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:
getXScalein interfaceorg.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:
setXScalein interfaceorg.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:
getYScalein interfaceorg.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:
setYScalein interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol- Parameters:
yScale-
-
getSource
Returns the URL of the image that is used to create the padding to fill the polygon- Specified by:
getSourcein interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol- Returns:
- imagePath
-
getSelectedSource
Returns the URL of the image used when the polygon is selected- Specified by:
getSelectedSourcein interfaceorg.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:
toCartographicSizein classAbstractFillSymbol
-
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classAbstractFillSymbol- Throws:
CloneNotSupportedException
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Overrides:
loadFromStatein classAbstractFillSymbol- 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:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Overrides:
saveToStatein classAbstractFillSymbol- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
getBackgroundFileStyle
public org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle getBackgroundFileStyle()- Specified by:
getBackgroundFileStylein interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
-
getSelectedBackgroundFileStyle
public org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle getSelectedBackgroundFileStyle()- Specified by:
getSelectedBackgroundFileStylein interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IPictureFillSymbol
-