org.geotools.renderer.event
Interface FeatureModifier

All Known Implementing Classes:
FeatureModifier.Adapter

public interface FeatureModifier

Defines methods for modifying the appearance of features on the map (for example when highlighting). Users should typically create instances of this class by extending FeatureModifier.Adapter and overriding the required methods. As an example, the following code creates a FeatureModifier that will render map features in blue:

  new FeatureModifier.Adapter() {
      public Paint getPaint(Paint paint, RenderingContext context) { 
        return Color.BLUE; 
      }
  }
 
The interface currently deals with all fields contained in LineStyle2D, PolygonStyle2D, MarkStyle2D and GraphicStyle2D.

Version:
$Id: FeatureModifier.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Julian Elliott

Nested Class Summary
static class FeatureModifier.Adapter
          A base (identity) implementation of the FeatureModifier interface.
 
Method Summary
 float getOpacity(float opacity, RenderingContext context)
          Returns a modified opacity (for graphic features).
 java.awt.Paint getPaint(java.awt.Paint paint, RenderingContext context)
          Returns a modified paint object for a particular feature.
 java.awt.image.RenderedImage getRenderedImage(java.awt.image.RenderedImage image, RenderingContext context)
          Returns a modified rendered image (for graphic features).
 float getRotation(float rotation, RenderingContext context)
          Returns a modified rotation (for mark, graphic and text features).
 java.awt.Shape getShape(java.awt.Shape shape, RenderingContext context)
          Returns a modified shape object for a particular feature.
 int getSize(int size, RenderingContext context)
          Returns a modified size (for graphic features).
 java.awt.Stroke getStroke(java.awt.Stroke stroke, RenderingContext context)
          Returns a modified awt stroke object for a particular feature.
 

Method Detail

getShape

public java.awt.Shape getShape(java.awt.Shape shape,
                               RenderingContext context)
Returns a modified shape object for a particular feature.

Parameters:
shape - The default Shape for the current feature.
context - The rendering context, which contains the current map scale.
Returns:
The Shape object to use for the current feature.

getPaint

public java.awt.Paint getPaint(java.awt.Paint paint,
                               RenderingContext context)
Returns a modified paint object for a particular feature.

Parameters:
paint - The default Paint for the current feature.
context - The rendering context, which contains the current map scale.
Returns:
The Paint object to use for the current feature.

getStroke

public java.awt.Stroke getStroke(java.awt.Stroke stroke,
                                 RenderingContext context)
Returns a modified awt stroke object for a particular feature.

Parameters:
stroke - The default Stroke for the current feature.
context - The rendering context, which contains the current map scale.
Returns:
The new Stroke object to use for the current feature.

getRotation

public float getRotation(float rotation,
                         RenderingContext context)
Returns a modified rotation (for mark, graphic and text features).

Parameters:
rotation - The default rotation for the current feature.
context - The rendering context, which contains the current map scale.
Returns:
The rotation to use for the current feature.

getOpacity

public float getOpacity(float opacity,
                        RenderingContext context)
Returns a modified opacity (for graphic features).

Parameters:
opacity - The default opacity for the current feature.
context - The rendering context, which contains the current map scale.
Returns:
The opacity to use for the current feature.

getSize

public int getSize(int size,
                   RenderingContext context)
Returns a modified size (for graphic features).

Parameters:
size - The original size of graphic images
context - The rendering context, which contains the current map scale.
Returns:
The size of graphic images to use for the current feature.

getRenderedImage

public java.awt.image.RenderedImage getRenderedImage(java.awt.image.RenderedImage image,
                                                     RenderingContext context)
Returns a modified rendered image (for graphic features).

Parameters:
image - The default rendered image for the current feature.
context - The rendering context, which contains the current map scale.
Returns:
Tthe rendered image to use for the current feature.


Copyright © GeoTools. All Rights Reserved.