Package org.geotools.renderer.lite
Class SynchronizedLabelCache
- Object
- 
- SynchronizedLabelCache
 
- 
- All Implemented Interfaces:
- LabelCache
 
 public class SynchronizedLabelCache extends Object implements LabelCache Allow multiple thread to modify LabelCache.- Author:
- Jesse
 
- 
- 
Constructor SummaryConstructors Constructor Description SynchronizedLabelCache()SynchronizedLabelCache(LabelCache cache)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the cache completelyvoidclear(String layerId)Clears the cache of all information relating to the layer identified.voiddisableLayer(String layerId)Leaves the label information in the cache but ignores it when calculating what labels are drawn.voidenableLayer(String layerId)Enable a layer after being disabled.voidend(Graphics2D graphics, Rectangle displayArea)Called to indicate that the map is done rendering.voidendLayer(String layerId, Graphics2D graphics, Rectangle displayArea)Called to indicate that a layer is done rendering.ListorderedLabels()Return a list with all the values in priority order.voidput(Rectangle2D area)Reserve the provided geometry prior to sorting out where labels can go.voidput(String layerId, TextSymbolizer symbolizer, Feature feature, LiteShape2 shape, NumberRange<Double> scaleRange)Puts a Label in the cache.voidstart()Called by renderer to indicate that the rendering process is starting.voidstartLayer(String layerId)Called by renderer to indication the start of rendering a layer.voidstop()Tells the cache to stop labelling.
 
- 
- 
- 
Constructor Detail- 
SynchronizedLabelCachepublic SynchronizedLabelCache() 
 - 
SynchronizedLabelCachepublic SynchronizedLabelCache(LabelCache cache) 
 
- 
 - 
Method Detail- 
startpublic void start() Description copied from interface:LabelCacheCalled by renderer to indicate that the rendering process is starting.- Specified by:
- startin interface- LabelCache
 
 - 
clearpublic void clear() Description copied from interface:LabelCacheClears the cache completely- Specified by:
- clearin interface- LabelCache
 
 - 
clearpublic void clear(String layerId) Description copied from interface:LabelCacheClears the cache of all information relating to the layer identified.- Specified by:
- clearin interface- LabelCache
- Parameters:
- layerId- id of the layer
 
 - 
enableLayerpublic void enableLayer(String layerId) Description copied from interface:LabelCacheEnable 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:
- enableLayerin interface- LabelCache
- Parameters:
- layerId- layer to activate.
 
 - 
endpublic void end(Graphics2D graphics, Rectangle displayArea) Description copied from interface:LabelCacheCalled to indicate that the map is done rendering. The method may draw labels if appropriate for the labeling algorithm- Specified by:
- endin interface- LabelCache
- Parameters:
- graphics- the graphics to draw on.
- displayArea- The size of the display area.
 
 - 
endLayerpublic void endLayer(String layerId, Graphics2D graphics, Rectangle displayArea) Description copied from interface:LabelCacheCalled to indicate that a layer is done rendering. The method may draw labels if appropriate for the labeling algorithm- Specified by:
- endLayerin interface- LabelCache
- Parameters:
- layerId- an id for the layer
- graphics- the graphics to draw on.
- displayArea- The size of the display area
 
 - 
putpublic void put(String layerId, TextSymbolizer symbolizer, Feature feature, LiteShape2 shape, NumberRange<Double> scaleRange) Description copied from interface:LabelCachePuts a Label in the cache.- Specified by:
- putin interface- LabelCache
- Parameters:
- layerId- id indicating the layer the feature is part of
- symbolizer- The symbolizer containing the style information
- feature- 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
 
 - 
putpublic void put(Rectangle2D area) Description copied from interface:LabelCacheReserve 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:
- putin interface- LabelCache
- Parameters:
- area- The Area of the screen to reserve (in screen coordinates)
 
 - 
startLayerpublic void startLayer(String layerId) Description copied from interface:LabelCacheCalled by renderer to indication the start of rendering a layer. Will add the layer to the set of active layers.- Specified by:
- startLayerin interface- LabelCache
- Parameters:
- layerId- an id for the layer
 
 - 
stoppublic void stop() Description copied from interface:LabelCacheTells the cache to stop labelling.- Specified by:
- stopin interface- LabelCache
 
 - 
disableLayerpublic void disableLayer(String layerId) Description copied from interface:LabelCacheLeaves the label information in the cache but ignores it when calculating what labels are drawn.- Specified by:
- disableLayerin interface- LabelCache
- Parameters:
- layerId- id of the layer to disable.
 
 - 
orderedLabelspublic List orderedLabels() Description copied from interface:LabelCacheReturn a list with all the values in priority order. Both grouped and non-grouped- Specified by:
- orderedLabelsin interface- LabelCache
- Returns:
- list with all values in priority order
 
 
- 
 
-