Package org.tinfour.voronoi
Interface IBoundedVoronoiStyler
-
- All Known Implementing Classes:
BoundedVoronoiStylerAdapter,BoundedVoronoiStylerDefault
public interface IBoundedVoronoiStylerDefines methods that supply style information for rendering. The choice of methods for this interface reflects a set of options that are broadly used in rendering applications, but is not exhaustive. In general, the design of this interface attempts to keep the overall number of methods small. However, the rendering of vertices does require a small number of special methods. Methods are provided to allow the application to control whether vertices are labeled, drawn with symbols, or both. A getter method is also supplied for getting the label symbol size.This interface is under development. It is not yet ready for use and may be subject to changes.
-
-
Method Summary
All Methods Instance Methods Abstract 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
boolean isFeatureTypeEnabled(BoundedVoronoiRenderingType type)
Indicates 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.
- Parameters:
type- a valid instance of a feature type enumeration- Returns:
- true if the type is enabled for rendering; otherwise, false.
-
isRenderingEnabled
boolean isRenderingEnabled(ThiessenPolygon polygon, BoundedVoronoiRenderingType type)
Indicates 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.
- 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.
-
getVertexSymbol
IBoundedVoronoiVertexSymbol getVertexSymbol(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 rendering- Parameters:
polygon- a valid polygon- Returns:
- if rendering is enabled, a valid symbol instance; otherwise, a null.
-
initializeRendering
void initializeRendering(Graphics2D g2d)
Called 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.- Parameters:
g2d- the graphics surface for rendering
-
applyStylingForAreaFill
void applyStylingForAreaFill(Graphics2D g2d, ThiessenPolygon polygon)
Applies styling for area fill operations. Styling may include setting a Java Color or Paint, a Composite, clipping, etc.- Parameters:
g2d- the graphics surface for renderingpolygon- a valid polygon instance
-
applyStylingForLineDrawing
void applyStylingForLineDrawing(Graphics2D g2d, ThiessenPolygon polygon)
Applies styling for line drawing operations. Styling may include setting a Java Color or Paint, a Stroke, a Composite, clipping, etc.- Parameters:
g2d- the graphics surface for renderingpolygon- a valid polygon instance
-
setAreaFillEnabled
void setAreaFillEnabled(boolean enabled)
Sets the option for enabling area fill operations- Parameters:
enabled- true if the Theissen polygons (Voronoi cells) are to be area-filled; otherwise, false.
-
-