Package org.gvsig.labeling.symbol
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.RegisterPersistenceNested 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.marker.impl.AbstractMarkerSymbol
MARKER_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.marker.IMarkerSymbol
CIRCLE_STYLE, CROSS_STYLE, DIAMOND_STYLE, HORIZONTAL_LINE_STYLE, SQUARE_STYLE, STAR_STYLE, SYMBOL_NAME, TRIANGLE_STYLE, VERTICAL_LINE_STYLE, X_STYLEFields inherited from interface org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol
SELECTION_COLOR -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of CharacterMarker with default valuesCharacterMarkerSymbol(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 TypeMethodDescriptionclone()voiddraw(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) getFont()Returns the font that will be used to define the symbolintvoidgetPixExtentPlus(org.gvsig.fmap.geom.Geometry geom, float[] distances, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi) org.gvsig.fmap.mapcontext.rendering.symbols.ISymbolgetSymbolForSelection(Color selectionColor) intObtains the unicode for a symbolbooleanisOneDotOrPixel(org.gvsig.fmap.geom.Geometry geom, double[] positionOfDotOrPixel, org.gvsig.fmap.mapcontext.ViewPort viewPort, int dpi) booleanisSuitableFor(org.gvsig.fmap.geom.Geometry geom) booleanReturns 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.voidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidprint(Graphics2D g, AffineTransform at, org.gvsig.fmap.geom.Geometry geom, org.gvsig.compat.print.PrintAttributes properties) static voidvoidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetAlpha(int a) voidSets the font that will be used to define the symbolvoidsetSize(double size) voidsetUnicode(int symbol) Sets the unicode for a symbol represented by a charactervoidsetVisuallyCorrected(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, setSizeExpressionMethods 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, setIsShapeVisibleMethods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractCartographicSupport
copyCartographicContext, getCartographicContext, getReferenceSystem, getUnit, isInPixels, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setCartographicContext, setReferenceSystem, setUnit, 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.marker.IMarkerSymbol
getColor, getMask, getOffset, getRotation, getSize, setColor, setMask, setOffset, setRotationMethods 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, setSizeExpressionMethods 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
- See Also:
-
-
Constructor Details
-
CharacterMarkerSymbol
public CharacterMarkerSymbol()Creates a new instance of CharacterMarker with default values -
CharacterMarkerSymbol
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 FontcharCode- - character code of the symbol for this fontcolor- - color to be used in when rendering.
-
-
Method Details
-
getFont
Returns the font that will be used to define the symbol- Returns:
- font
-
setFont
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:
getSymbolForSelectionin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol- Overrides:
getSymbolForSelectionin classorg.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:
drawin interfaceorg.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:
setSizein interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol- Overrides:
setSizein classorg.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
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classorg.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:
isSuitableForin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.ISymbol- Overrides:
isSuitableForin classorg.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:
printin interfaceorg.gvsig.fmap.mapcontext.rendering.symbols.IPrintable- Overrides:
printin classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.AbstractSymbol
-
setAlpha
public void setAlpha(int a) - Specified by:
setAlphain interfaceorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol- Overrides:
setAlphain classorg.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:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Overrides:
loadFromStatein classorg.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:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Overrides:
saveToStatein classorg.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.impl.AbstractMarkerSymbol- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
registerPersistent
public static void registerPersistent()
-