org.geotools.legend
Class Glyph

Object
  extended by Glyph

public class Glyph
extends Object

Renderers a small Glyph used to represent a Map Layer in a legend.

Because GeoTools is used both with Swing and SWT applications this class is set up to produce BufferedImage.

Author:
Johann Sorel (AlterSIG)

Constructor Summary
Glyph()
           
 
Method Summary
static BufferedImage geometry(Color color, Color fill)
          Icon for generic Geometry or Geometry Collection.
static BufferedImage geometry(Rule rule)
          Complex render of Geometry allowing presentation of point, line and polygon styles.
static BufferedImage grid(Color a, Color b, Color c, Color d)
          Icon for grid data, small grid made up of provided colors.
static BufferedImage icon(SimpleFeatureType ft)
           
static BufferedImage image()
          Create a transparent image, this is a *real* resource against the provided display.
static BufferedImage line(Color color, int width)
          Icon for linestring in the provided color and width.
static BufferedImage line(Rule rule)
          Complex render of Geometry allowing presentation of point, line and polygon styles.
static BufferedImage palette(Color[] c)
          Icon for grid data, small grid made up of provided colors.
static BufferedImage point(Color color, Color fill)
          Icon for point data in the provided color XXX: Suggest point( SLD style ) at a later time.
static BufferedImage point(Rule rule)
          Render a icon based on the current style.
static BufferedImage polygon(Color color, Color fill, int width)
          Icon for polygon in provided border, fill and width
static BufferedImage Polygon(Rule rule)
          Render of a polygon allowing style.
static BufferedImage swatch(Color c)
          Render of a color swatch allowing style.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Glyph

public Glyph()
Method Detail

image

public static BufferedImage image()
Create a transparent image, this is a *real* resource against the provided display.

Returns:

point

public static BufferedImage point(Rule rule)
Render a icon based on the current style.

Simple render of point in the center of the screen.

Parameters:
style -
Returns:
Icon representing style applyed to an image

point

public static BufferedImage point(Color color,
                                  Color fill)
Icon for point data in the provided color

XXX: Suggest point( SLD style ) at a later time.

Parameters:
color -
fill -
Returns:
ImageDescriptor

line

public static BufferedImage line(Rule rule)
Complex render of Geometry allowing presentation of point, line and polygon styles.

Layout:


    1 2 3 4 5 6 7 8 9101112131415
   0
  1          LL                 L
  2          L L                L
  3         L  L               L
  4        L    L             L
  5        L     L            L
  6       L      L           L
  7      L        L         L
  8      L         L        L
  9     L          L       L
 10    L            L     L
 11    L             L    L
 12   L              L   L
 13  L                L L
 14  L                 LL
 15
 
 

Parameters:
style -
Returns:
Icon representing geometry style

line

public static BufferedImage line(Color color,
                                 int width)
Icon for linestring in the provided color and width.

XXX: Suggest line( SLD style ) at a later time.

Parameters:
black -
Returns:
Icon

geometry

public static BufferedImage geometry(Rule rule)
Complex render of Geometry allowing presentation of point, line and polygon styles.

Layout:


    1 2 3 4 5 6 7 8 9101112131415
   0
  1
  2
  3           L                 L
  4       p  L L           PPPPPP
  5         L   L     PPPPP   L p
  6        L     LPPPP       L  p
  7       L    PPPL         L   p
  8      L   PP    L       L    p
  9     L   P       L     L     P
 10    L   P         L   L      P
 11   L   P           L L       P
 12  L   P             L        P
 13      p                      P
 14      PPPPPPPPPPPPPPPPPPPPPPPP
 15
 
 

Parameters:
style -
Returns:
Icon representing geometry style

geometry

public static BufferedImage geometry(Color color,
                                     Color fill)
Icon for generic Geometry or Geometry Collection.

Parameters:
color -
fill -
Returns:
Icon

Polygon

public static BufferedImage Polygon(Rule rule)
Render of a polygon allowing style.

Layout:


    1 2 3 4 5 6 7 8 9101112131415
   0
  1
  2                      PPPPPPPP
  3                PPPPPP       P
  4           PPPPPP            P
  5        PPP                  p
  6      PP                     p
  7     P                       p
  8    P                        p
  9   P                         P
 10   P                         P
 11  P                          P
 12  P                          P
 13  P                          P
 14  PPPPPPPPPPPPPPPPPPPPPPPPPPPP
 15
 
 

Parameters:
style -
Returns:
Icon representing geometry style

polygon

public static BufferedImage polygon(Color color,
                                    Color fill,
                                    int width)
Icon for polygon in provided border, fill and width

Parameters:
black -
gray -
i -
Returns:

grid

public static BufferedImage grid(Color a,
                                 Color b,
                                 Color c,
                                 Color d)
Icon for grid data, small grid made up of provided colors.

Layout:


    0 1 2 3 4 5 6 7 8 9 101112131415
  0
  1   AAAAAAAAAAAAABBBBBBBBBBBBBB
  2   AAAAAAAAAAAAABBBBBBBBBBBBBB
  3   AAAAAAAAAAAAABBBBBBBBBBBBBB
  4   AAAAAAAAAAAAABBBBBBBBBBBBBB
  5   AAAAAAAAAAAAABBBBBBBBBBBBBB
  6   AAAAAAAAAAAAABBBBBBBBBBBBBB
  7   AAAAAAAAAAAAABBBBBBBBBBBBBB
  8   CCCCCCCCCCCCCDDDDDDDDDDDDDD
  9   CCCCCCCCCCCCCDDDDDDDDDDDDDD
 10   CCCCCCCCCCCCCDDDDDDDDDDDDDD
 11   CCCCCCCCCCCCCDDDDDDDDDDDDDD
 12   CCCCCCCCCCCCCDDDDDDDDDDDDDD
 13   CCCCCCCCCCCCCDDDDDDDDDDDDDD
 14   CCCCCCCCCCCCCDDDDDDDDDDDDDD
 15
 
 

Parameters:
a -
b -
c -
d1 -
Returns:
Icon representing a grid

swatch

public static BufferedImage swatch(Color c)
Render of a color swatch allowing style.

Layout:


    0 1 2 3 4 5 6 7 8 9 101112131415
  0
  1  dddddddddddddddddddddddddddd
  2 dCCCCCCCCCCCCCCCCCCCCCcCCCCCCd
  3 dCCCCCCCCCCCCCCCCCCCCCCcCCCCCd
  4 dCCCCCCCCCCCCCCCCCCCCCCCcCCCCd
  5 dCCCCCCCCCCCCCCCCCCCCCCCCcCCCd
  6 dCCCCCCCCCCCCCCCCCCCCCCCCCcCCd
  7 dCCCCCCCCCCCCCCCCCCCCCCCCCCcCd
  8 dCcCCCCCCCCCCCCCCCCCCCCCCCCCCd
  9 dCCcCCCCCCCCCCCCCCCCCCCCCCCCCd
 10 dCCCcCCCCCCCCCCCCCCCCCCCCCCCCd
 11 dCCCCcCCCCCCCCCCCCCCCCCCCCCCCd
 12 dCCCCCcCCCCCCCCCCCCCCCCCCCCCCd
 13 ddCCCCCcCCCCCCCCCCCCCCCCCCCCdd
 14  ddddddddddddddddddddddddddd
 15
 
 

Parameters:
style -
Returns:
Icon representing geometry style

palette

public static BufferedImage palette(Color[] c)
Icon for grid data, small grid made up of provided colors. Layout:

    0 1 2 3 4 5 6 7 8 9 101112131415
  0
  1 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  2 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  3 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  4 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  5 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  6 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  7 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  8 AABBCDEEFfGgHhIiJjKkllmmnnoopp
  9 AABBCDEEFfGgHhIiJjKkllmmnnoopp
 10 AABBCDEEFfGgHhIiJjKkllmmnnoopp
 11 AABBCDEEFfGgHhIiJjKkllmmnnoopp
 12 AABBCDEEFfGgHhIiJjKkllmmnnoopp
 14 AABBCDEEFfGgHhIiJjKkllmmnnoopp
 15
 
 

Parameters:
c - palette of colors
Returns:
Icon representing a palette

icon

public static BufferedImage icon(SimpleFeatureType ft)


Copyright © 1996-2014 Geotools. All Rights Reserved.