edu.uci.ics.jung.visualization.swt.graphics
Class SWTImageImpl

java.lang.Object
  extended by edu.uci.ics.jung.visualization.graphics.Image
      extended by edu.uci.ics.jung.visualization.swt.graphics.SWTImageImpl
All Implemented Interfaces:
ShapeProducer

public class SWTImageImpl
extends Image
implements ShapeProducer


Field Summary
 
Fields inherited from class edu.uci.ics.jung.visualization.graphics.Image
SCALE_DEFAULT, SCALE_FAST, SCALE_SMOOTH
 
Constructor Summary
SWTImageImpl(org.eclipse.swt.graphics.Device dev, int width, int height)
           
SWTImageImpl(org.eclipse.swt.graphics.Image image)
           
 
Method Summary
 GraphicsContext getGraphicsContext()
           
 int getHeight()
           
 Image getScaledInstance(int width, int height, int hints)
          Creates a scaled version of this image.
 Shape getShape()
           
 org.eclipse.swt.graphics.Image getSWTImage()
           
 int getWidth()
           
 
Methods inherited from class edu.uci.ics.jung.visualization.graphics.Image
draw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWTImageImpl

public SWTImageImpl(org.eclipse.swt.graphics.Device dev,
                    int width,
                    int height)

SWTImageImpl

public SWTImageImpl(org.eclipse.swt.graphics.Image image)
Method Detail

getSWTImage

public org.eclipse.swt.graphics.Image getSWTImage()

getGraphicsContext

public GraphicsContext getGraphicsContext()
Specified by:
getGraphicsContext in class Image

getWidth

public int getWidth()
Specified by:
getWidth in class Image

getHeight

public int getHeight()
Specified by:
getHeight in class Image

getScaledInstance

public Image getScaledInstance(int width,
                               int height,
                               int hints)
Description copied from class: Image
Creates a scaled version of this image. A new Image object is returned which will render the image at the specified width and height by default. The new Image object may be loaded asynchronously even if the original source image has already been loaded completely.

If either width or height is a negative number then a value is substituted to maintain the aspect ratio of the original image dimensions. If both width and height are negative, then the original image dimensions are used.

Specified by:
getScaledInstance in class Image
Parameters:
width - the width to which to scale the image.
height - the height to which to scale the image.
hints - flags to indicate the type of algorithm to use for image resampling.
Returns:
a scaled version of the image.
See Also:
Image.SCALE_DEFAULT, Image.SCALE_FAST, Image.SCALE_SMOOTH, Image.SCALE_REPLICATE, Image.SCALE_AREA_AVERAGING

getShape

public Shape getShape()
Specified by:
getShape in interface ShapeProducer


Copyright © 2007. All Rights Reserved.