Package org.geotools.renderer.lite
Class SynchronizedLabelCache
Object
SynchronizedLabelCache
- All Implemented Interfaces:
LabelCache
Allow multiple thread to modify LabelCache.
- Author:
- Jesse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the cache completelyvoid
Clears the cache of all information relating to the layer identified.void
disableLayer
(String layerId) Leaves the label information in the cache but ignores it when calculating what labels are drawn.void
enableLayer
(String layerId) Enable a layer after being disabled.void
end
(Graphics2D graphics, Rectangle displayArea) Called to indicate that the map is done rendering.void
endLayer
(String layerId, Graphics2D graphics, Rectangle displayArea) Called to indicate that a layer is done rendering.Return a list with all the values in priority order.void
put
(Rectangle2D area) Reserve the provided geometry prior to sorting out where labels can go.void
put
(String layerId, TextSymbolizer symbolizer, Feature feature, LiteShape2 shape, NumberRange<Double> scaleRange) Puts a Label in the cache.void
start()
Called by renderer to indicate that the rendering process is starting.void
startLayer
(String layerId) Called by renderer to indication the start of rendering a layer.void
stop()
Tells the cache to stop labelling.
-
Constructor Details
-
SynchronizedLabelCache
public SynchronizedLabelCache() -
SynchronizedLabelCache
-
-
Method Details
-
start
public void start()Description copied from interface:LabelCache
Called by renderer to indicate that the rendering process is starting.- Specified by:
start
in interfaceLabelCache
-
clear
public void clear()Description copied from interface:LabelCache
Clears the cache completely- Specified by:
clear
in interfaceLabelCache
-
clear
Description copied from interface:LabelCache
Clears the cache of all information relating to the layer identified.- Specified by:
clear
in interfaceLabelCache
- Parameters:
layerId
- id of the layer
-
enableLayer
Description copied from interface:LabelCache
Enable a layer after being disabled. If startLayer is called this does not need to be called as start layer implicitely activates the layer.- Specified by:
enableLayer
in interfaceLabelCache
- Parameters:
layerId
- layer to activate.
-
end
Description copied from interface:LabelCache
Called to indicate that the map is done rendering. The method may draw labels if appropriate for the labeling algorithm- Specified by:
end
in interfaceLabelCache
- Parameters:
graphics
- the graphics to draw on.displayArea
- The size of the display area.
-
endLayer
Description copied from interface:LabelCache
Called to indicate that a layer is done rendering. The method may draw labels if appropriate for the labeling algorithm- Specified by:
endLayer
in interfaceLabelCache
- Parameters:
layerId
- an id for the layergraphics
- the graphics to draw on.displayArea
- The size of the display area
-
put
public void put(String layerId, TextSymbolizer symbolizer, Feature feature, LiteShape2 shape, NumberRange<Double> scaleRange) Description copied from interface:LabelCache
Puts a Label in the cache.- Specified by:
put
in interfaceLabelCache
- Parameters:
layerId
- id indicating the layer the feature is part ofsymbolizer
- The symbolizer containing the style informationfeature
- the feature that has the information required for the symbolizer to calculate the required render information.shape
- the shape to be labeled. This is in screen coordinates.scaleRange
- the scaleRange that the symbolizer is legal
-
put
Description copied from interface:LabelCache
Reserve the provided geometry prior to sorting out where labels can go.This facility is used to reserve an area so that labels do not end up overlapping on screen constructs like scalebars or north arrows etc...
- Specified by:
put
in interfaceLabelCache
- Parameters:
area
- The Area of the screen to reserve (in screen coordinates)
-
startLayer
Description copied from interface:LabelCache
Called by renderer to indication the start of rendering a layer. Will add the layer to the set of active layers.- Specified by:
startLayer
in interfaceLabelCache
- Parameters:
layerId
- an id for the layer
-
stop
public void stop()Description copied from interface:LabelCache
Tells the cache to stop labelling.- Specified by:
stop
in interfaceLabelCache
-
disableLayer
Description copied from interface:LabelCache
Leaves the label information in the cache but ignores it when calculating what labels are drawn.- Specified by:
disableLayer
in interfaceLabelCache
- Parameters:
layerId
- id of the layer to disable.
-
orderedLabels
Description copied from interface:LabelCache
Return a list with all the values in priority order. Both grouped and non-grouped- Specified by:
orderedLabels
in interfaceLabelCache
- Returns:
- list with all values in priority order
-