NASA World Wind

gov.nasa.worldwind.examples.analytics
Class AnalyticSurfaceLegend

java.lang.Object
  extended by gov.nasa.worldwind.examples.analytics.AnalyticSurfaceLegend
All Implemented Interfaces:
Renderable

public class AnalyticSurfaceLegend
extends java.lang.Object
implements Renderable


Nested Class Summary
static interface AnalyticSurfaceLegend.LabelAttributes
           
protected static class AnalyticSurfaceLegend.LabelRenderable
           
protected static class AnalyticSurfaceLegend.OrderedLabel
           
 
Field Summary
protected static java.awt.Color DEFAULT_COLOR
           
protected static java.awt.Font DEFAULT_FONT
           
protected static int DEFAULT_HEIGHT
           
protected static int DEFAULT_WIDTH
           
protected  java.lang.Iterable<? extends Renderable> labels
           
protected  ScreenImage screenImage
           
protected  boolean visible
           
 
Constructor Summary
protected AnalyticSurfaceLegend()
           
 
Method Summary
protected  java.awt.image.BufferedImage createColorGradientLegendImage(int width, int height, double minHue, double maxHue, java.awt.Color borderColor)
           
protected  java.lang.Iterable<? extends Renderable> createColorGradientLegendLabels(int width, int height, double minValue, double maxValue, java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels, AnalyticSurfaceLegend.LabelAttributes titleLabel)
           
static java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> createDefaultColorGradientLabels(double minValue, double maxValue, java.text.Format format)
           
static AnalyticSurfaceLegend.LabelAttributes createDefaultTitle(java.lang.String text)
           
static AnalyticSurfaceLegend.LabelAttributes createLegendLabelAttributes(double value, java.lang.String text, java.awt.Font font, java.awt.Color color, double xOffset, double yOffset)
           
protected  void doRender(DrawContext dc)
           
protected  void drawLabel(DrawContext dc, AnalyticSurfaceLegend.LabelAttributes attr, double x, double y, java.lang.String halign, java.lang.String valign)
           
static AnalyticSurfaceLegend fromColorGradient(double minValue, double maxValue, double minHue, double maxHue, java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels, AnalyticSurfaceLegend.LabelAttributes titleLabel)
           
static AnalyticSurfaceLegend fromColorGradient(int width, int height, double minValue, double maxValue, double minHue, double maxHue, java.awt.Color borderColor, java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels, AnalyticSurfaceLegend.LabelAttributes titleLabel)
           
 Layer getClientLayer()
           
 int getHeight(DrawContext dc)
           
 double getOpacity()
           
 java.awt.Point getScreenLocation()
           
 int getWidth(DrawContext dc)
           
 boolean isVisible()
           
 void render(DrawContext dc)
          Causes this Renderable to render itself using the DrawContext provided.
 void setClientLayer(Layer layer)
           
 void setOpacity(double opacity)
           
 void setScreenLocation(java.awt.Point point)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_COLOR

protected static final java.awt.Color DEFAULT_COLOR

DEFAULT_FONT

protected static final java.awt.Font DEFAULT_FONT

DEFAULT_HEIGHT

protected static final int DEFAULT_HEIGHT
See Also:
Constant Field Values

DEFAULT_WIDTH

protected static final int DEFAULT_WIDTH
See Also:
Constant Field Values

labels

protected java.lang.Iterable<? extends Renderable> labels

screenImage

protected ScreenImage screenImage

visible

protected boolean visible
Constructor Detail

AnalyticSurfaceLegend

protected AnalyticSurfaceLegend()
Method Detail

createColorGradientLegendImage

protected java.awt.image.BufferedImage createColorGradientLegendImage(int width,
                                                                      int height,
                                                                      double minHue,
                                                                      double maxHue,
                                                                      java.awt.Color borderColor)

createColorGradientLegendLabels

protected java.lang.Iterable<? extends Renderable> createColorGradientLegendLabels(int width,
                                                                                   int height,
                                                                                   double minValue,
                                                                                   double maxValue,
                                                                                   java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels,
                                                                                   AnalyticSurfaceLegend.LabelAttributes titleLabel)

createDefaultColorGradientLabels

public static java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> createDefaultColorGradientLabels(double minValue,
                                                                                                                   double maxValue,
                                                                                                                   java.text.Format format)

createDefaultTitle

public static AnalyticSurfaceLegend.LabelAttributes createDefaultTitle(java.lang.String text)

createLegendLabelAttributes

public static AnalyticSurfaceLegend.LabelAttributes createLegendLabelAttributes(double value,
                                                                                java.lang.String text,
                                                                                java.awt.Font font,
                                                                                java.awt.Color color,
                                                                                double xOffset,
                                                                                double yOffset)

doRender

protected void doRender(DrawContext dc)

drawLabel

protected void drawLabel(DrawContext dc,
                         AnalyticSurfaceLegend.LabelAttributes attr,
                         double x,
                         double y,
                         java.lang.String halign,
                         java.lang.String valign)

fromColorGradient

public static AnalyticSurfaceLegend fromColorGradient(double minValue,
                                                      double maxValue,
                                                      double minHue,
                                                      double maxHue,
                                                      java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels,
                                                      AnalyticSurfaceLegend.LabelAttributes titleLabel)

fromColorGradient

public static AnalyticSurfaceLegend fromColorGradient(int width,
                                                      int height,
                                                      double minValue,
                                                      double maxValue,
                                                      double minHue,
                                                      double maxHue,
                                                      java.awt.Color borderColor,
                                                      java.lang.Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels,
                                                      AnalyticSurfaceLegend.LabelAttributes titleLabel)

getClientLayer

public Layer getClientLayer()

getHeight

public int getHeight(DrawContext dc)

getOpacity

public double getOpacity()

getScreenLocation

public java.awt.Point getScreenLocation()

getWidth

public int getWidth(DrawContext dc)

isVisible

public boolean isVisible()

render

public void render(DrawContext dc)
Description copied from interface: Renderable
Causes this Renderable to render itself using the DrawContext provided. The DrawContext provides the elevation model, openGl instance, globe and other information required for drawing. It is recommended that the DrawContext is non-null as most implementations do not support null DrawContexts.

Specified by:
render in interface Renderable
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

setClientLayer

public void setClientLayer(Layer layer)

setOpacity

public void setOpacity(double opacity)

setScreenLocation

public void setScreenLocation(java.awt.Point point)

setVisible

public void setVisible(boolean visible)

NASA World Wind