public class ImageAnnotation extends ScreenAnnotation
AbstractAnnotation.TextCacheKey
Modifier and Type | Field and Description |
---|---|
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 |
position, screenPoint
alwaysOnTop, attributes, childList, delegateOwner, layoutManager, maxActiveAltitude, minActiveAltitude, pickEnabled, pickSupport, text, textBoundsMap, vertexBuffer, wrappedTextMap
ANTIALIAS_DONT_CARE, ANTIALIAS_FASTEST, ANTIALIAS_NICEST
Constructor and Description |
---|
ImageAnnotation() |
ImageAnnotation(Object imageSource) |
ImageAnnotation(Object imageSource,
int imageWidth,
int imageHeight) |
Modifier and Type | Method and Description |
---|---|
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.
|
computeAnnotationPosition, computeBounds, computeOffset, computeSize, doRenderNow, getPosition, getRestorableState, getScreenPoint, getScreenPoint, restoreState, setPosition, setScreenPoint
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
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
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
public ImageAnnotation()
public ImageAnnotation(Object imageSource)
public ImageAnnotation(Object imageSource, int imageWidth, int imageHeight)
protected void applyBackgroundTextureState(DrawContext dc, int width, int height, double opacity, WWTexture texture)
applyBackgroundTextureState
in class AbstractAnnotation
protected void doDrawToolTip(DrawContext dc, String text, int x, int y)
public void drawContent(DrawContext dc, int width, int height, double opacity, Position pickPosition)
drawContent
in class AbstractAnnotation
protected void drawToolTip(DrawContext dc)
public Dimension getImageDimension()
protected Dimension getImageSize(DrawContext dc)
public Object getImageSource()
public Dimension getPreferredSize(DrawContext dc)
getPreferredSize
in interface Annotation
getPreferredSize
in class AbstractAnnotation
public WWTexture getTexture(DrawContext dc)
public Point getToolTipPoint()
public String getToolTipText()
public boolean isEnableSmoothing()
public boolean isFitSizeToImage()
public boolean isShowToolTip()
public boolean isUseImageAspectRatio()
public boolean isUseMipmaps()
public void setEnableSmoothing(boolean enable)
public void setFitSizeToImage(boolean fitSizeToImage)
public void setImageSource(Object source)
public void setImageSource(Object source, int imageWidth, int imageHeight)
public void setShowToolTip(boolean show)
public void setToolTipPoint(Point toolTipPoint)
public void setToolTipText(String toolTipText)
protected void setupAnnotationAttributes(Annotation annotation)
public void setUseImageAspectRatio(boolean useImageAspectRatio)
public void setUseMipmaps(boolean useMipmaps)
protected void transformBackgroundImageCoordsToAnnotationCoords(DrawContext dc, int width, int height, WWTexture texture)
AbstractAnnotation
(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
.transformBackgroundImageCoordsToAnnotationCoords
in class AbstractAnnotation
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.