Package org.tinfour.voronoi
Class BoundedVoronoiStylerAdapter
- java.lang.Object
-
- org.tinfour.voronoi.BoundedVoronoiStylerAdapter
-
- All Implemented Interfaces:
IBoundedVoronoiStyler
public class BoundedVoronoiStylerAdapter extends Object implements IBoundedVoronoiStyler
A base implementation of the styler interface provided as a convenience.
-
-
Constructor Summary
Constructors Constructor Description BoundedVoronoiStylerAdapter()Constructs an instance that implements default behavior.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyStylingForAreaFill(Graphics2D g2d, ThiessenPolygon polygon)Applies styling for area fill operations.voidapplyStylingForLineDrawing(Graphics2D g2d, ThiessenPolygon polygon)Applies styling for line drawing operations.IBoundedVoronoiVertexSymbolgetVertexSymbol(ThiessenPolygon polygon)Tests to see if the polygon is enabled for rendering a symbol at the vertex position and, if it is, returns a vertex symbol that can be used for renderingvoidinitializeRendering(Graphics2D g2d)Called once at the beginning of rendering to set up the Graphics2D surface for rendering.booleanisFeatureTypeEnabled(BoundedVoronoiRenderingType type)Indicates whether features of the specified type are enabled for rendering.booleanisRenderingEnabled(ThiessenPolygon polygon, BoundedVoronoiRenderingType type)Indicates whether the specified type of rendering is enabled for the specified polygon object.voidsetAreaFillEnabled(boolean enabled)Sets the option for enabling area fill operations
-
-
-
Method Detail
-
isFeatureTypeEnabled
public boolean isFeatureTypeEnabled(BoundedVoronoiRenderingType type)
Description copied from interface:IBoundedVoronoiStylerIndicates whether features of the specified type are enabled for rendering.This method is useful in cases where an application is required to control whether broad classes of feature types are rendered. For example, an application might be configured to draw line features, while suppressing area-fill features.
- Specified by:
isFeatureTypeEnabledin interfaceIBoundedVoronoiStyler- Parameters:
type- a valid instance of a feature type enumeration- Returns:
- true if the type is enabled for rendering; otherwise, false.
-
isRenderingEnabled
public boolean isRenderingEnabled(ThiessenPolygon polygon, BoundedVoronoiRenderingType type)
Description copied from interface:IBoundedVoronoiStylerIndicates whether the specified type of rendering is enabled for the specified polygon object.This method is useful in cases where rendering of one type to be enabled for a specific polygon while rendering of another type is not. For example, an application may be configured to draw line features for most polygons while area-filling a specific polygon.
- Specified by:
isRenderingEnabledin interfaceIBoundedVoronoiStyler- Parameters:
polygon- a valid polygontype- a valid instance of a feature type enumeration- Returns:
- true if the polygon is enabled for the specified rendering type; otherwise, false.
-
initializeRendering
public void initializeRendering(Graphics2D g2d)
Description copied from interface:IBoundedVoronoiStylerCalled once at the beginning of rendering to set up the Graphics2D surface for rendering. One common use of this routine is to ensure that anti-aliasing is activated, though other settings may also be applied.- Specified by:
initializeRenderingin interfaceIBoundedVoronoiStyler- Parameters:
g2d- the graphics surface for rendering
-
applyStylingForAreaFill
public void applyStylingForAreaFill(Graphics2D g2d, ThiessenPolygon polygon)
Description copied from interface:IBoundedVoronoiStylerApplies styling for area fill operations. Styling may include setting a Java Color or Paint, a Composite, clipping, etc.- Specified by:
applyStylingForAreaFillin interfaceIBoundedVoronoiStyler- Parameters:
g2d- the graphics surface for renderingpolygon- a valid polygon instance
-
applyStylingForLineDrawing
public void applyStylingForLineDrawing(Graphics2D g2d, ThiessenPolygon polygon)
Description copied from interface:IBoundedVoronoiStylerApplies styling for line drawing operations. Styling may include setting a Java Color or Paint, a Stroke, a Composite, clipping, etc.- Specified by:
applyStylingForLineDrawingin interfaceIBoundedVoronoiStyler- Parameters:
g2d- the graphics surface for renderingpolygon- a valid polygon instance
-
getVertexSymbol
public IBoundedVoronoiVertexSymbol getVertexSymbol(ThiessenPolygon polygon)
Description copied from interface:IBoundedVoronoiStylerTests to see if the polygon is enabled for rendering a symbol at the vertex position and, if it is, returns a vertex symbol that can be used for rendering- Specified by:
getVertexSymbolin interfaceIBoundedVoronoiStyler- Parameters:
polygon- a valid polygon- Returns:
- if rendering is enabled, a valid symbol instance; otherwise, a null.
-
setAreaFillEnabled
public void setAreaFillEnabled(boolean enabled)
Description copied from interface:IBoundedVoronoiStylerSets the option for enabling area fill operations- Specified by:
setAreaFillEnabledin interfaceIBoundedVoronoiStyler- Parameters:
enabled- true if the Theissen polygons (Voronoi cells) are to be area-filled; otherwise, false.
-
-