NASA World Wind

gov.nasa.worldwindx.examples.analytics
Class AnalyticSurfaceLegend

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

public class AnalyticSurfaceLegend
extends Object
implements Renderable


Nested Class Summary
static interface AnalyticSurfaceLegend.LabelAttributes
           
protected static class AnalyticSurfaceLegend.LabelRenderable
           
protected static class AnalyticSurfaceLegend.OrderedLabel
           
 
Field Summary
protected static Color DEFAULT_COLOR
           
protected static Font DEFAULT_FONT
           
protected static int DEFAULT_HEIGHT
           
protected static int DEFAULT_WIDTH
           
protected  Iterable<? extends Renderable> labels
           
protected  ScreenImage screenImage
           
protected  boolean visible
           
 
Constructor Summary
protected AnalyticSurfaceLegend()
           
 
Method Summary
protected  BufferedImage createColorGradientLegendImage(int width, int height, double minHue, double maxHue, Color borderColor)
           
protected  Iterable<? extends Renderable> createColorGradientLegendLabels(int width, int height, double minValue, double maxValue, Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels, AnalyticSurfaceLegend.LabelAttributes titleLabel)
           
static Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> createDefaultColorGradientLabels(double minValue, double maxValue, Format format)
           
static AnalyticSurfaceLegend.LabelAttributes createDefaultTitle(String text)
           
static AnalyticSurfaceLegend.LabelAttributes createLegendLabelAttributes(double value, String text, Font font, Color color, double xOffset, double yOffset)
           
protected  void doRender(DrawContext dc)
           
protected  void drawLabel(DrawContext dc, AnalyticSurfaceLegend.LabelAttributes attr, double x, double y, String halign, String valign)
           
static AnalyticSurfaceLegend fromColorGradient(double minValue, double maxValue, double minHue, double maxHue, Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels, AnalyticSurfaceLegend.LabelAttributes titleLabel)
           
static AnalyticSurfaceLegend fromColorGradient(int width, int height, double minValue, double maxValue, double minHue, double maxHue, Color borderColor, Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels, AnalyticSurfaceLegend.LabelAttributes titleLabel)
           
 int getHeight(DrawContext dc)
           
 double getOpacity()
           
 Point getScreenLocation(DrawContext dc)
           
 int getWidth(DrawContext dc)
           
 boolean isVisible()
           
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
 void setOpacity(double opacity)
           
 void setScreenLocation(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 Color DEFAULT_COLOR

DEFAULT_FONT

protected static final 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 Iterable<? extends Renderable> labels

screenImage

protected ScreenImage screenImage

visible

protected boolean visible
Constructor Detail

AnalyticSurfaceLegend

protected AnalyticSurfaceLegend()
Method Detail

createColorGradientLegendImage

protected BufferedImage createColorGradientLegendImage(int width,
                                                       int height,
                                                       double minHue,
                                                       double maxHue,
                                                       Color borderColor)

createColorGradientLegendLabels

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

createDefaultColorGradientLabels

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

createDefaultTitle

public static AnalyticSurfaceLegend.LabelAttributes createDefaultTitle(String text)

createLegendLabelAttributes

public static AnalyticSurfaceLegend.LabelAttributes createLegendLabelAttributes(double value,
                                                                                String text,
                                                                                Font font,
                                                                                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,
                         String halign,
                         String valign)

fromColorGradient

public static AnalyticSurfaceLegend fromColorGradient(double minValue,
                                                      double maxValue,
                                                      double minHue,
                                                      double maxHue,
                                                      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,
                                                      Color borderColor,
                                                      Iterable<? extends AnalyticSurfaceLegend.LabelAttributes> labels,
                                                      AnalyticSurfaceLegend.LabelAttributes titleLabel)

getHeight

public int getHeight(DrawContext dc)

getOpacity

public double getOpacity()

getScreenLocation

public Point getScreenLocation(DrawContext dc)

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 provided draw context.

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

setOpacity

public void setOpacity(double opacity)

setScreenLocation

public void setScreenLocation(Point point)

setVisible

public void setVisible(boolean visible)

NASA World Wind