NASA World Wind

gov.nasa.worldwindx.examples.util
Class ImageAnnotation

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.render.AbstractAnnotation
          extended by gov.nasa.worldwind.render.ScreenAnnotation
              extended by gov.nasa.worldwindx.examples.util.ImageAnnotation
All Implemented Interfaces:
AVList, Disposable, Annotation, Renderable, Restorable
Direct Known Subclasses:
ButtonAnnotation, DialogAnnotation.BusyImage

public class ImageAnnotation
extends ScreenAnnotation


Nested Class Summary
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.AbstractAnnotation
AbstractAnnotation.TextCacheKey
 
Field Summary
protected  boolean enableSmoothing
           
protected  boolean fitSizeToImage
           
protected  int imageHeight
           
protected  int imageWidth
           
protected  boolean showToolTip
           
protected  Point toolTipPoint
           
protected  String toolTipText
           
protected  boolean useImageAspectRatio
           
protected  boolean useMipmaps
           
 
Fields inherited from class gov.nasa.worldwind.render.AbstractAnnotation
alwaysOnTop, attributes, childList, delegateOwner, layoutManager, maxActiveAltitude, minActiveAltitude, pickEnabled, pickSupport, text, textBoundsMap, vertexBuffer, wrappedTextMap
 
Fields inherited from interface gov.nasa.worldwind.render.Annotation
ANTIALIAS_DONT_CARE, ANTIALIAS_FASTEST, ANTIALIAS_NICEST
 
Constructor Summary
ImageAnnotation()
           
ImageAnnotation(Object imageSource)
           
ImageAnnotation(Object imageSource, int imageWidth, int imageHeight)
           
 
Method Summary
protected  void applyBackgroundTextureState(DrawContext dc, int width, int height, double opacity, WWTexture texture)
           
protected  void doDrawToolTip(DrawContext dc, String text, int x, int y)
           
 void drawContent(DrawContext dc, int width, int height, double opacity, Position pickPosition)
           
protected  void drawToolTip(DrawContext dc)
           
 Dimension getImageDimension()
           
protected  Dimension getImageSize(DrawContext dc)
           
 Object getImageSource()
           
 Dimension getPreferredSize(DrawContext dc)
           
 WWTexture getTexture(DrawContext dc)
           
 Point getToolTipPoint()
           
 String getToolTipText()
           
 boolean isEnableSmoothing()
           
 boolean isFitSizeToImage()
           
 boolean isShowToolTip()
           
 boolean isUseImageAspectRatio()
           
 boolean isUseMipmaps()
           
 void setEnableSmoothing(boolean enable)
           
 void setFitSizeToImage(boolean fitSizeToImage)
           
 void setImageSource(Object source)
           
 void setImageSource(Object source, int imageWidth, int imageHeight)
           
 void setShowToolTip(boolean show)
           
 void setToolTipPoint(Point toolTipPoint)
           
 void setToolTipText(String toolTipText)
           
protected  void setupAnnotationAttributes(Annotation annotation)
           
 void setUseImageAspectRatio(boolean useImageAspectRatio)
           
 void setUseMipmaps(boolean useMipmaps)
           
protected  void transformBackgroundImageCoordsToAnnotationCoords(DrawContext dc, int width, int height, WWTexture texture)
          Transforms texture coordinates from Annotation background image coordinates to Annotation geometry coordinates (in screen pixels), and applies the Annotation's image scale and image offset attributes.
 
Methods inherited from class gov.nasa.worldwind.render.ScreenAnnotation
computeBounds, computeOffset, computeSize, doRenderNow, getRestorableState, getScreenPoint, getScreenPoint, restoreState, setScreenPoint
 
Methods inherited from class gov.nasa.worldwind.render.AbstractAnnotation
addChild, adjustSizeToChildren, adjustSizeToText, applyColor, applyScreenTransform, beginDraw, beginDrawChildren, bindPickableObject, computeBoundingRectangle, computeFreeBounds, computeInsetBounds, computeOpacity, computeScale, computeTextBounds, dispose, doDraw, doDrawBackgroundTexture, doDrawChildren, draw, drawBackground, drawBackgroundImage, drawBorder, drawCallout, drawChildren, drawHTML, drawPlainText, drawText, drawText, drawTopLevelAnnotation, endDraw, endDrawChildren, getAttributes, getBounds, getChildren, getDelegateOwner, getLayout, getMaxActiveAltitude, getMinActiveAltitude, getMultiLineTextRenderer, getPickSupport, getText, getTextBounds, getTextRenderer, getWrappedText, glPointFromAWTPoint, isAlwaysOnTop, isPickEnabled, modulateColorOpacity, pick, removeAllChildren, removeChild, render, renderNow, setAlwaysOnTop, setAttributes, setDelegateOwner, setLayout, setMaxActiveAltitude, setMinActiveAltitude, setPickEnabled, setPickSupport, setText, transformByModelview, transformImageCoordsToBackgroundImageCoords, wrapText
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enableSmoothing

protected boolean enableSmoothing

fitSizeToImage

protected boolean fitSizeToImage

imageHeight

protected int imageHeight

imageWidth

protected int imageWidth

showToolTip

protected boolean showToolTip

toolTipPoint

protected Point toolTipPoint

toolTipText

protected String toolTipText

useImageAspectRatio

protected boolean useImageAspectRatio

useMipmaps

protected boolean useMipmaps
Constructor Detail

ImageAnnotation

public ImageAnnotation()

ImageAnnotation

public ImageAnnotation(Object imageSource)

ImageAnnotation

public ImageAnnotation(Object imageSource,
                       int imageWidth,
                       int imageHeight)
Method Detail

applyBackgroundTextureState

protected void applyBackgroundTextureState(DrawContext dc,
                                           int width,
                                           int height,
                                           double opacity,
                                           WWTexture texture)
Overrides:
applyBackgroundTextureState in class AbstractAnnotation

doDrawToolTip

protected void doDrawToolTip(DrawContext dc,
                             String text,
                             int x,
                             int y)

drawContent

public void drawContent(DrawContext dc,
                        int width,
                        int height,
                        double opacity,
                        Position pickPosition)
Overrides:
drawContent in class AbstractAnnotation

drawToolTip

protected void drawToolTip(DrawContext dc)

getImageDimension

public Dimension getImageDimension()

getImageSize

protected Dimension getImageSize(DrawContext dc)

getImageSource

public Object getImageSource()

getPreferredSize

public Dimension getPreferredSize(DrawContext dc)
Specified by:
getPreferredSize in interface Annotation
Overrides:
getPreferredSize in class AbstractAnnotation

getTexture

public WWTexture getTexture(DrawContext dc)

getToolTipPoint

public Point getToolTipPoint()

getToolTipText

public String getToolTipText()

isEnableSmoothing

public boolean isEnableSmoothing()

isFitSizeToImage

public boolean isFitSizeToImage()

isShowToolTip

public boolean isShowToolTip()

isUseImageAspectRatio

public boolean isUseImageAspectRatio()

isUseMipmaps

public boolean isUseMipmaps()

setEnableSmoothing

public void setEnableSmoothing(boolean enable)

setFitSizeToImage

public void setFitSizeToImage(boolean fitSizeToImage)

setImageSource

public void setImageSource(Object source)

setImageSource

public void setImageSource(Object source,
                           int imageWidth,
                           int imageHeight)

setShowToolTip

public void setShowToolTip(boolean show)

setToolTipPoint

public void setToolTipPoint(Point toolTipPoint)

setToolTipText

public void setToolTipText(String toolTipText)

setupAnnotationAttributes

protected void setupAnnotationAttributes(Annotation annotation)

setUseImageAspectRatio

public void setUseImageAspectRatio(boolean useImageAspectRatio)

setUseMipmaps

public void setUseMipmaps(boolean useMipmaps)

transformBackgroundImageCoordsToAnnotationCoords

protected void transformBackgroundImageCoordsToAnnotationCoords(DrawContext dc,
                                                                int width,
                                                                int height,
                                                                WWTexture texture)
Description copied from class: AbstractAnnotation
Transforms texture coordinates from Annotation background image coordinates to Annotation geometry coordinates (in screen pixels), and applies the Annotation's image scale and image offset attributes. In Annotation background image coordinates (0, 0) maps to the image's upper left corner, and (imageWidth, imageHeight) maps to the image's lower right corner. In Annotation geometry coordinates (0, 0) maps to the Annotation geometry's lower left corner (ignoring any leader geometry), and (width, height) maps to the Annotation's upper right corner in window coordinates (screen pixels). This assumes the current OGL matrix mode is GL_TEXTURE.

Overrides:
transformBackgroundImageCoordsToAnnotationCoords in class AbstractAnnotation
Parameters:
dc - the DrawContext to receive the texture coordinate transform.
width - the Annotation's width, in window coordinates (screen pixels).
height - the Annotation's height, in window coordinates (screen pixels).
texture - the texture to transform from Annotation background image coordinates to Annotation geometry coordinates.

NASA World Wind