org.geotools.legend
Interface GlyphFactory

All Known Implementing Classes:
DefaultGlyphFactory

public interface GlyphFactory

Used to draw the little pictures that appear in a Legend.

We are making this an interface so that applications can implement their own icons as needed.

Author:
Jody Garnett

Method Summary
 javax.swing.Icon geometry(java.awt.Color color, java.awt.Color fill)
           
 javax.swing.Icon geometry(Rule rule)
           
 javax.swing.Icon grid(java.awt.Color color1, java.awt.Color color2, java.awt.Color color3, java.awt.Color color4)
           
 javax.swing.Icon icon(MapLayer layer)
          Glyph for the provided layer.
 javax.swing.Icon icon(org.opengis.feature.simple.SimpleFeatureType schema)
          Make a basic representation of the provided FeatureType.
 javax.swing.Icon line(java.awt.Color line, int width)
          Produces a simple Icon representing a line.
 javax.swing.Icon line(Rule rule)
          Produce a simple Icon representing a point.
 javax.swing.Icon palette(java.awt.Color[] colors)
           
 javax.swing.Icon point(java.awt.Color point, java.awt.Color fill)
          Produce a simple Icon representing a point.
 javax.swing.Icon point(Rule rule)
          Produce a simple Icon representing a point.
 javax.swing.Icon polygon(java.awt.Color color, java.awt.Color fill, int width)
           
 javax.swing.Icon polygon(Rule rule)
           
 javax.swing.Icon swatch(java.awt.Color color)
           
 

Method Detail

point

javax.swing.Icon point(java.awt.Color point,
                       java.awt.Color fill)
Produce a simple Icon representing a point.

Parameters:
point - Color of the Point
fill - Color inside the Point
Returns:
Icon representing a Point

point

javax.swing.Icon point(Rule rule)
Produce a simple Icon representing a point.

At a minimum this code is the same as:


 PointSymbolizer symbolizer = SLD.pointSymbolizer( rule );
 return glyphFactory.point( SLD.pointColor( symbolizer ), SLD.fillColor( symbolizer ) );
 

Implementations have the option of going into greater detail, picking up on TextSymbolizers and so on.

Parameters:
rule - Rule used to render a Point
Returns:
Icon representing a Point

line

javax.swing.Icon line(java.awt.Color line,
                      int width)
Produces a simple Icon representing a line.

Parameters:
line - Line colour
width - Line width
Returns:

line

javax.swing.Icon line(Rule rule)
Produce a simple Icon representing a point.

At a minimum this code is the same as:


 LineSymbolizer symbolizer = SLD.lineSymbolizer( rule );
 return glyphFactory.point( SLD.lineColor( symbolizer ), SLD.lineWidth( symbolizer ) );
 

Implementations have the option of going into greater detail, picking up on TextSymbolizers and so on.

Parameters:
rule - Rule used to render a Point
Returns:
Icon representing a Point

geometry

javax.swing.Icon geometry(java.awt.Color color,
                          java.awt.Color fill)

geometry

javax.swing.Icon geometry(Rule rule)

polygon

javax.swing.Icon polygon(java.awt.Color color,
                         java.awt.Color fill,
                         int width)

polygon

javax.swing.Icon polygon(Rule rule)

grid

javax.swing.Icon grid(java.awt.Color color1,
                      java.awt.Color color2,
                      java.awt.Color color3,
                      java.awt.Color color4)

swatch

javax.swing.Icon swatch(java.awt.Color color)

palette

javax.swing.Icon palette(java.awt.Color[] colors)

icon

javax.swing.Icon icon(org.opengis.feature.simple.SimpleFeatureType schema)
Make a basic representation of the provided FeatureType.

Parameters:
schema -
Returns:

icon

javax.swing.Icon icon(MapLayer layer)
Glyph for the provided layer.

At a minimum the icon will be based on:

Parameters:
layer -
Returns:
Icon For the provided layer


Copyright © 1996-2010 Geotools. All Rights Reserved.