Class ImageAnnotation
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.render.AbstractAnnotation
-
- gov.nasa.worldwind.render.ScreenAnnotation
-
- 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
Fields Modifier and Type Field Description protected booleanenableSmoothingprotected booleanfitSizeToImageprotected intimageHeightprotected intimageWidthprotected booleanshowToolTipprotected java.awt.PointtoolTipPointprotected java.lang.StringtoolTipTextprotected booleanuseImageAspectRatioprotected booleanuseMipmaps-
Fields inherited from class gov.nasa.worldwind.render.ScreenAnnotation
position, screenPoint
-
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
Constructors Constructor Description ImageAnnotation()ImageAnnotation(java.lang.Object imageSource)ImageAnnotation(java.lang.Object imageSource, int imageWidth, int imageHeight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyBackgroundTextureState(DrawContext dc, int width, int height, double opacity, WWTexture texture)protected voiddoDrawToolTip(DrawContext dc, java.lang.String text, int x, int y)voiddrawContent(DrawContext dc, int width, int height, double opacity, Position pickPosition)protected voiddrawToolTip(DrawContext dc)java.awt.DimensiongetImageDimension()protected java.awt.DimensiongetImageSize(DrawContext dc)java.lang.ObjectgetImageSource()java.awt.DimensiongetPreferredSize(DrawContext dc)WWTexturegetTexture(DrawContext dc)java.awt.PointgetToolTipPoint()java.lang.StringgetToolTipText()booleanisEnableSmoothing()booleanisFitSizeToImage()booleanisShowToolTip()booleanisUseImageAspectRatio()booleanisUseMipmaps()voidsetEnableSmoothing(boolean enable)voidsetFitSizeToImage(boolean fitSizeToImage)voidsetImageSource(java.lang.Object source)voidsetImageSource(java.lang.Object source, int imageWidth, int imageHeight)voidsetShowToolTip(boolean show)voidsetToolTipPoint(java.awt.Point toolTipPoint)voidsetToolTipText(java.lang.String toolTipText)protected voidsetupAnnotationAttributes(Annotation annotation)voidsetUseImageAspectRatio(boolean useImageAspectRatio)voidsetUseMipmaps(boolean useMipmaps)protected voidtransformBackgroundImageCoordsToAnnotationCoords(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
computeAnnotationPosition, computeBounds, computeOffset, computeSize, doRenderNow, getPosition, getRestorableState, getScreenPoint, getScreenPoint, restoreState, setPosition, 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
-
-
-
-
Field Detail
-
imageWidth
protected int imageWidth
-
imageHeight
protected int imageHeight
-
fitSizeToImage
protected boolean fitSizeToImage
-
useImageAspectRatio
protected boolean useImageAspectRatio
-
enableSmoothing
protected boolean enableSmoothing
-
useMipmaps
protected boolean useMipmaps
-
showToolTip
protected boolean showToolTip
-
toolTipText
protected java.lang.String toolTipText
-
toolTipPoint
protected java.awt.Point toolTipPoint
-
-
Method Detail
-
isFitSizeToImage
public boolean isFitSizeToImage()
-
setFitSizeToImage
public void setFitSizeToImage(boolean fitSizeToImage)
-
isUseImageAspectRatio
public boolean isUseImageAspectRatio()
-
setUseImageAspectRatio
public void setUseImageAspectRatio(boolean useImageAspectRatio)
-
isEnableSmoothing
public boolean isEnableSmoothing()
-
setEnableSmoothing
public void setEnableSmoothing(boolean enable)
-
isUseMipmaps
public boolean isUseMipmaps()
-
setUseMipmaps
public void setUseMipmaps(boolean useMipmaps)
-
getImageSource
public java.lang.Object getImageSource()
-
setImageSource
public void setImageSource(java.lang.Object source, int imageWidth, int imageHeight)
-
setImageSource
public void setImageSource(java.lang.Object source)
-
getImageDimension
public java.awt.Dimension getImageDimension()
-
getTexture
public WWTexture getTexture(DrawContext dc)
-
isShowToolTip
public boolean isShowToolTip()
-
setShowToolTip
public void setShowToolTip(boolean show)
-
getToolTipText
public java.lang.String getToolTipText()
-
setToolTipText
public void setToolTipText(java.lang.String toolTipText)
-
getToolTipPoint
public java.awt.Point getToolTipPoint()
-
setToolTipPoint
public void setToolTipPoint(java.awt.Point toolTipPoint)
-
getPreferredSize
public java.awt.Dimension getPreferredSize(DrawContext dc)
- Specified by:
getPreferredSizein interfaceAnnotation- Overrides:
getPreferredSizein classAbstractAnnotation
-
getImageSize
protected java.awt.Dimension getImageSize(DrawContext dc)
-
drawContent
public void drawContent(DrawContext dc, int width, int height, double opacity, Position pickPosition)
- Overrides:
drawContentin classAbstractAnnotation
-
drawToolTip
protected void drawToolTip(DrawContext dc)
-
doDrawToolTip
protected void doDrawToolTip(DrawContext dc, java.lang.String text, int x, int y)
-
applyBackgroundTextureState
protected void applyBackgroundTextureState(DrawContext dc, int width, int height, double opacity, WWTexture texture)
- Overrides:
applyBackgroundTextureStatein classAbstractAnnotation
-
transformBackgroundImageCoordsToAnnotationCoords
protected void transformBackgroundImageCoordsToAnnotationCoords(DrawContext dc, int width, int height, WWTexture texture)
Description copied from class:AbstractAnnotationTransforms 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 isGL_TEXTURE.- Overrides:
transformBackgroundImageCoordsToAnnotationCoordsin classAbstractAnnotation- 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.
-
setupAnnotationAttributes
protected void setupAnnotationAttributes(Annotation annotation)
-
-