net.refractions.udig.ui.graphics
Class Glyph

java.lang.Object
  extended by net.refractions.udig.ui.graphics.Glyph

public class Glyph
extends java.lang.Object

Utility methods to create common ImageDescriptors.

Since:
0.7.0
Author:
jgarnett

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

Field Detail

WHITE

public static final int WHITE
See Also:
Constant Field Values
Constructor Detail

Glyph

public Glyph()
Method Detail

push

public static ImageDescriptor push(ImageDescriptor icon)

image

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

Parameters:
display -
rgb -
Returns:

point

public static ImageDescriptor 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 ImageDescriptor point(java.awt.Color color,
                                    java.awt.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 ImageDescriptor 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 ImageDescriptor line(java.awt.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 ImageDescriptor 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 ImageDescriptor geometry(java.awt.Color color,
                                       java.awt.Color fill)
Icon for generic Geometry or Geometry Collection.

Parameters:
color -
fill -
Returns:
Icon

polygon

public static ImageDescriptor 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 ImageDescriptor polygon(java.awt.Color color,
                                      java.awt.Color fill,
                                      int width)
Icon for polygon in provided border, fill and width

Parameters:
black -
gray -
i -
Returns:

grid

public static ImageDescriptor grid(java.awt.Color a,
                                   java.awt.Color b,
                                   java.awt.Color c,
                                   java.awt.Color d1)
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 ImageDescriptor swatch(java.awt.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 ImageDescriptor palette(java.awt.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 ImageDescriptor icon(SimpleFeatureType ft)