com.sun.scenario.scenegraph
Class SGImage

java.lang.Object
  extended by com.sun.scenario.scenegraph.SGNode
      extended by com.sun.scenario.scenegraph.SGLeaf
          extended by com.sun.scenario.scenegraph.SGImage

public class SGImage
extends SGLeaf

A scene graph node that renders an Image.


Constructor Summary
SGImage()
           
 
Method Summary
 java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform transform)
          Returns the bounding box of this node relative to the specified coordinate space.
 java.awt.Image getImage()
           
 java.lang.Object getInterpolationHint()
          Returns the KEY_INTERPOLATION rendering hint.
 java.awt.geom.Point2D getLocation()
          This no-arg getter is equivalent to calling getLocation(null) .
 java.awt.geom.Point2D getLocation(java.awt.geom.Point2D rv)
          Defines the image's bound's origin.
 boolean getSmoothTranslation()
          Returns whether the interpolation hint will be honored for non-integral translations.
 boolean hasOverlappingContents()
           
 void paint(java.awt.Graphics2D g)
           
 void setImage(java.awt.Image image)
           
 void setInterpolationHint(java.lang.Object hint)
          Sets the KEY_INTERPOLATION rendering hint.
 void setLocation(java.awt.geom.Point2D location)
           
 void setSmoothTranslation(boolean smooth)
          Sets whether the interpolation hint will be honored for non-integral translations.
 
Methods inherited from class com.sun.scenario.scenegraph.SGLeaf
repaint, repaint
 
Methods inherited from class com.sun.scenario.scenegraph.SGNode
addFocusListener, addKeyListener, addMouseListener, addNodeListener, contains, getAttribute, getBounds, getCursor, getID, getPanel, getParent, globalToLocal, isMouseBlocker, isVisible, localToGlobal, pick, putAttribute, removeFocusListener, removeKeyListener, removeMouseListener, removeNodeListener, render, requestFocus, setCursor, setID, setMouseBlocker, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SGImage

public SGImage()
Method Detail

getImage

public final java.awt.Image getImage()

setImage

public void setImage(java.awt.Image image)

getLocation

public final java.awt.geom.Point2D getLocation(java.awt.geom.Point2D rv)
Defines the image's bound's origin. Assuming the transform is null, this is the location in the parent node where the image will be drawn. If return value rv is non-null, it will be set and returned. Otherwise a new Point will be allocated and returned.

Parameters:
rv - the return value or null
Returns:
the location where the image will be drawn

getLocation

public final java.awt.geom.Point2D getLocation()
This no-arg getter is equivalent to calling getLocation(null) .

Returns:
the location where the text will be drawn
See Also:
getLocation(Point2D)

setLocation

public void setLocation(java.awt.geom.Point2D location)

getInterpolationHint

public final java.lang.Object getInterpolationHint()
Returns the KEY_INTERPOLATION rendering hint. The hint will be one of: RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR, RenderingHints.VALUE_INTERPOLATION_BILINEAR, RenderingHints.VALUE_INTERPOLATION_BICUBIC.

Returns:
the KEY_INTERPOLATION hint
See Also:
RenderingHints

setInterpolationHint

public void setInterpolationHint(java.lang.Object hint)
Sets the KEY_INTERPOLATION rendering hint. The hint must be one of: RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR, RenderingHints.VALUE_INTERPOLATION_BILINEAR, RenderingHints.VALUE_INTERPOLATION_BICUBIC. The default is VALUE_INTERPOLATION_BILINEAR.

See Also:
RenderingHints, Graphics2D

getSmoothTranslation

public final boolean getSmoothTranslation()
Returns whether the interpolation hint will be honored for non-integral translations.

Returns:
true if the interpolation hint should be honored for non-integral translations; false otherwise

setSmoothTranslation

public void setSmoothTranslation(boolean smooth)
Sets whether the interpolation hint will be honored for non-integral translations. The default is false. Setting this to true may improve visual quality of non-integral translations, but may negatively impact performance on some systems.

This setting only has an impact if the current interpolation hint is either RenderingHints.VALUE_INTERPOLATION_BILINEAR or RenderingHints.VALUE_INTERPOLATION_BICUBIC.

Parameters:
smooth - if true, the interpolation hint will be honored for non-integral translations

paint

public void paint(java.awt.Graphics2D g)
Specified by:
paint in class SGLeaf

getBounds

public final java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform transform)
Description copied from class: SGNode
Returns the bounding box of this node relative to the specified coordinate space.

Specified by:
getBounds in class SGNode
Parameters:
transform - the transform applied to the geometry

hasOverlappingContents

public boolean hasOverlappingContents()