NASA World Wind

gov.nasa.worldwind.render
Class ScreenImage

java.lang.Object
  extended by gov.nasa.worldwind.render.ScreenImage
All Implemented Interfaces:
Pickable, Renderable
Direct Known Subclasses:
ScreenCreditImage

public class ScreenImage
extends java.lang.Object
implements Renderable, Pickable

Draws an image parallel to the screen at a specified screen location relative to the World Window.


Field Summary
protected  BasicWWTexture texture
           
 
Constructor Summary
ScreenImage()
           
 
Method Summary
protected  void doRender(DrawContext dc)
           
 Layer getClientLayer()
          Returns the layer to be associated with the screen image when the image is picked.
 int getImageHeight(DrawContext dc)
          Returns the height of the source image, or null if no source image has been specified.
 java.lang.Object getImageSource()
          Returns the current image source.
 int getImageWidth(DrawContext dc)
          Returns the width of the source image, or 0 if no source image has been specified.
 double getOpacity()
          Returns the opacity of the surface.
 java.awt.Point getScreenLocation()
          Returns the location of the image on the screen.
protected  BasicWWTexture getTexture()
           
 void pick(DrawContext dc, java.awt.Point pickPoint)
           
 void render(DrawContext dc)
          Causes this Renderable to render itself using the DrawContext provided.
 void setClientLayer(Layer client)
          Specifies the layer to be associated with the screen image when the image is picked.
 void setImageSource(java.lang.Object imageSource)
          Specifies the image source, which may be either a file path Stringor a BufferedImage.
 void setOpacity(double opacity)
          Sets the opacity of the surface.
 void setScreenLocation(java.awt.Point screenLocation)
          Specifies the location of the image on the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

texture

protected BasicWWTexture texture
Constructor Detail

ScreenImage

public ScreenImage()
Method Detail

doRender

protected void doRender(DrawContext dc)

getClientLayer

public Layer getClientLayer()
Returns the layer to be associated with the screen image when the image is picked.

Returns:
the layer to associate with the screen image when the image is picked.

getImageHeight

public int getImageHeight(DrawContext dc)
Returns the height of the source image, or null if no source image has been specified.

Parameters:
dc - the current draw context.
Returns:
the source image height.

getImageSource

public java.lang.Object getImageSource()
Returns the current image source.

Returns:
the current image source.
See Also:
getImageSource()

getImageWidth

public int getImageWidth(DrawContext dc)
Returns the width of the source image, or 0 if no source image has been specified.

Parameters:
dc - the current draw context.
Returns:
the source image width.

getOpacity

public double getOpacity()
Returns the opacity of the surface. A value of 1 or greater means the surface is fully opaque, a value of 0 means that the surface is fully transparent.

Returns:
the surface opacity.

getScreenLocation

public java.awt.Point getScreenLocation()
Returns the location of the image on the screen. The position is relative to the upper-left corner of the World Window. The image is centered on this position.

Returns:
the current screen position.

getTexture

protected BasicWWTexture getTexture()

pick

public void pick(DrawContext dc,
                 java.awt.Point pickPoint)
Specified by:
pick in interface Pickable

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 client)
Specifies the layer to be associated with the screen image when the image is picked.

Parameters:
client - the layer to associate with the screen image when the image is picked. May be null.

setImageSource

public void setImageSource(java.lang.Object imageSource)
Specifies the image source, which may be either a file path Stringor a BufferedImage.

Parameters:
imageSource - the image source, either a file path Stringor a BufferedImage.
Throws:
java.lang.IllegalArgumentException - if the imageSource is null.

setOpacity

public void setOpacity(double opacity)
Sets the opacity of the surface. A value of 1 or greater means the surface is fully opaque, a value of 0 means that the surface is fully transparent.

Parameters:
opacity - a positive value indicating the opacity of the surface.
Throws:
java.lang.IllegalArgumentException - if the specified opacity is less than zero.

setScreenLocation

public void setScreenLocation(java.awt.Point screenLocation)
Specifies the location of the image on the screen. The position is relative to the upper-left corner of the World Window. The image is centered on this position.

Parameters:
screenLocation - the screen location on which to center the image. May be null, in which case the image is not displayed.

NASA World Wind