Class AbstractVectorialLegend
java.lang.Object
org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractLegend
org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend
- All Implemented Interfaces:
Cloneable,org.gvsig.fmap.mapcontext.rendering.legend.DrawingObservable,org.gvsig.fmap.mapcontext.rendering.legend.ILegend,org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend,org.gvsig.fmap.mapcontext.rendering.legend.Legend,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.persistence.Persistent
- Direct Known Subclasses:
AbstractClassifiedVectorLegend,DefaultDynamicVectorLegend,SingleSymbolLegend
public abstract class AbstractVectorialLegend
extends AbstractLegend
implements org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend
Base implementation for Vectorial data Legends.
Provides a draw method implementation which loads the
Features and
uses the ISymbol objects to draw the Geometry objects.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.Loggerstatic final Stringprotected org.gvsig.fmap.mapcontext.rendering.legend.ZSortFields inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractLegend
LEGEND_PERSISTENCE_DEFINITION_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddraw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore) voiddraw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery) protected voiddraw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi) Draws the features from theFeatureStore, filtered with the scale and the query parameters, with the symbols of the legend.protected voiddrawFeatures(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, double dpi, DefaultFeatureDrawnNotification drawnNotification, org.gvsig.fmap.dal.feature.FeatureSet featureSet, org.gvsig.fmap.dal.feature.FeatureSelection selection) Draws the features from theFeatureSet, with the symbols of the legend.protected abstract String[]getRequiredFeatureAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore featureStore) Returns the names of theFeatureattributes required for theILegendto operate.org.gvsig.fmap.mapcontext.rendering.legend.ZSortgetZSort()protected voidinternalDraw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi, org.gvsig.tools.task.SimpleTaskStatus taskStatus) booleanvoidloadFromState(org.gvsig.tools.persistence.PersistentState state) voidprint(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.compat.print.PrintAttributes properties) voidprint(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery fquery, org.gvsig.compat.print.PrintAttributes properties) voidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetDrawSymbolInEeachPrimitive(boolean drawSymbolInEeachPrimitive) voidsetZSort(org.gvsig.fmap.mapcontext.rendering.legend.ZSort zSort) Methods inherited from class org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractLegend
addDrawingObserver, addLegendListener, addObserver, beginComplexNotification, cloneLegend, countObservers, deleteDrawingObserver, deleteDrawingObservers, deleteObserver, disableNotifications, enableNotifications, endComplexNotification, fireDefaultSymbolChangedEvent, getListeners, getManager, getSymbolManager, inComplex, isEnabledNotifications, notifyObservers, notifyObservers, removeLegendListenerMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.legend.DrawingObservable
addDrawingObserver, deleteDrawingObserver, deleteDrawingObserversMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.legend.ILegend
addLegendListener, cloneLegend, fireDefaultSymbolChangedEvent, getListeners, removeLegendListenerMethods inherited from interface org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend
getDefaultSymbol, getShapeType, getSymbolByFeature, isSuitableForShapeType, isUseDefaultSymbol, setDefaultSymbol, setShapeType, useDefaultSymbol
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
VECTORIAL_LEGEND_PERSISTENCE_DEFINITION_NAME
- See Also:
-
zSort
protected org.gvsig.fmap.mapcontext.rendering.legend.ZSort zSort
-
-
Constructor Details
-
AbstractVectorialLegend
protected AbstractVectorialLegend()
-
-
Method Details
-
getZSort
public org.gvsig.fmap.mapcontext.rendering.legend.ZSort getZSort() -
setZSort
public void setZSort(org.gvsig.fmap.mapcontext.rendering.legend.ZSort zSort) -
draw
public void draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException - Specified by:
drawin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend- Throws:
org.gvsig.fmap.mapcontext.rendering.legend.LegendException
-
draw
public void draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException - Specified by:
drawin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend- Throws:
org.gvsig.fmap.mapcontext.rendering.legend.LegendException
-
print
public void print(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.compat.print.PrintAttributes properties) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException - Specified by:
printin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend- Throws:
org.gvsig.fmap.mapcontext.rendering.legend.LegendException
-
print
public void print(Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery fquery, org.gvsig.compat.print.PrintAttributes properties) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException - Specified by:
printin interfaceorg.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend- Throws:
org.gvsig.fmap.mapcontext.rendering.legend.LegendException
-
draw
protected void draw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi) throws org.gvsig.fmap.mapcontext.rendering.legend.LegendException Draws the features from theFeatureStore, filtered with the scale and the query parameters, with the symbols of the legend.- Parameters:
image-g-viewPort-cancel-scale-queryParameters-coordTrans-featureStore-featureQuery-dpi-- Throws:
org.gvsig.fmap.mapcontext.rendering.legend.LegendException
-
internalDraw
protected void internalDraw(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, double scale, Map queryParameters, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, double dpi, org.gvsig.tools.task.SimpleTaskStatus taskStatus) throws LegendDrawingException - Throws:
LegendDrawingException
-
drawFeatures
protected void drawFeatures(BufferedImage image, Graphics2D g, org.gvsig.fmap.mapcontext.ViewPort viewPort, org.gvsig.tools.task.Cancellable cancel, org.gvsig.crs.projection.lib.CoordinateTransformation coordTrans, double dpi, DefaultFeatureDrawnNotification drawnNotification, org.gvsig.fmap.dal.feature.FeatureSet featureSet, org.gvsig.fmap.dal.feature.FeatureSelection selection) throws org.gvsig.tools.exception.BaseException Draws the features from theFeatureSet, with the symbols of the legend.- Throws:
org.gvsig.tools.exception.BaseException
-
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classAbstractLegend- 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 classAbstractLegend- 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 classAbstractLegend- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
getRequiredFeatureAttributeNames
protected abstract String[] getRequiredFeatureAttributeNames(org.gvsig.fmap.dal.feature.FeatureStore featureStore) throws org.gvsig.fmap.dal.exception.DataException Returns the names of theFeatureattributes required for theILegendto operate.- Parameters:
featureStore- the store where theFeatures belong to- Returns:
- the names of required
Featureattribute names - Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error getting the attribute names
-
isDrawSymbolInEeachPrimitive
public boolean isDrawSymbolInEeachPrimitive()- Returns:
- the drawSymbolInEeachPrimitive
-
setDrawSymbolInEeachPrimitive
public void setDrawSymbolInEeachPrimitive(boolean drawSymbolInEeachPrimitive) - Parameters:
drawSymbolInEeachPrimitive- the drawSymbolInEeachPrimitive to set
-