com.metsci.glimpse.painter.decoration
Class LegendPainter

java.lang.Object
  extended by com.metsci.glimpse.painter.base.GlimpsePainterImpl
      extended by com.metsci.glimpse.painter.base.GlimpsePainter2D
          extended by com.metsci.glimpse.painter.decoration.LegendPainter
All Implemented Interfaces:
GlimpsePainter
Direct Known Subclasses:
LegendPainter.BlockLegendPainter, LegendPainter.LineLegendPainter

public abstract class LegendPainter
extends GlimpsePainter2D

Displays a simple color based legend floating on top of the plot.

Author:
bumgarner

Nested Class Summary
static class LegendPainter.BlockLegendPainter
           
static class LegendPainter.LegendPlacement
           
static class LegendPainter.LineLegendPainter
           
 
Field Summary
 
Fields inherited from class com.metsci.glimpse.painter.base.GlimpsePainterImpl
BYTES_PER_FLOAT, logger
 
Constructor Summary
LegendPainter(LegendPainter.LegendPlacement placement)
           
 
Method Summary
 void addItem(java.lang.String label, float[] rgba)
           
 void addItem(java.lang.String label, float r, float g, float b, float a)
           
 void clear()
           
 void dispose(javax.media.opengl.GLContext context)
           
 void paintTo(GlimpseContext context, GlimpseBounds bounds, Axis2D axis)
           
 void removeItem(java.lang.String label)
           
 void setColor(java.lang.String label, float[] rgba)
           
 void setColor(java.lang.String label, float r, float g, float b, float a)
           
 void setFont(float size, boolean bold)
           
 void setFont(java.awt.Font font)
           
 void setLegendItemWidth(int width)
          Sets the width of the item to the left of the label in the legend.
 void setOffset(int offsetX, int offsetY)
           
 void setOffsetX(int offset)
           
 void setOffsetY(int offset)
           
 void setPlacement(LegendPainter.LegendPlacement placement)
           
 void setSpacing(int spacer)
          Sets the space between elements in the legend.
 void setTextColor(float[] rgba)
           
 void setTextColor(float r, float g, float b, float a)
           
 
Methods inherited from class com.metsci.glimpse.painter.base.GlimpsePainter2D
paintTo
 
Methods inherited from class com.metsci.glimpse.painter.base.GlimpsePainterImpl
dispose, isDisposed, isVisible, paintTo, setErrorHandling, setLookAndFeel, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegendPainter

public LegendPainter(LegendPainter.LegendPlacement placement)
Method Detail

setFont

public void setFont(java.awt.Font font)

setFont

public void setFont(float size,
                    boolean bold)

setTextColor

public void setTextColor(float[] rgba)

setTextColor

public void setTextColor(float r,
                         float g,
                         float b,
                         float a)

addItem

public void addItem(java.lang.String label,
                    float r,
                    float g,
                    float b,
                    float a)

addItem

public void addItem(java.lang.String label,
                    float[] rgba)

removeItem

public void removeItem(java.lang.String label)

clear

public void clear()

setColor

public void setColor(java.lang.String label,
                     float r,
                     float g,
                     float b,
                     float a)

setColor

public void setColor(java.lang.String label,
                     float[] rgba)

setPlacement

public void setPlacement(LegendPainter.LegendPlacement placement)

setOffsetX

public void setOffsetX(int offset)

setOffsetY

public void setOffsetY(int offset)

setOffset

public void setOffset(int offsetX,
                      int offsetY)

setSpacing

public void setSpacing(int spacer)
Sets the space between elements in the legend.

Parameters:
spacer -

setLegendItemWidth

public void setLegendItemWidth(int width)
Sets the width of the item to the left of the label in the legend.

Parameters:
width -

dispose

public void dispose(javax.media.opengl.GLContext context)

paintTo

public void paintTo(GlimpseContext context,
                    GlimpseBounds bounds,
                    Axis2D axis)
Specified by:
paintTo in class GlimpsePainter2D


Copyright © 2012 Metron, Inc.. All Rights Reserved.