|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.kcl.cch.jb.pliny.figures.ScalableImageFigure
Manages the scaling of an image. Used within Pliny figures that display a zoomable base image upon which annotations can be attached. The zoom size can be changed after the area is set up -- the code will dispose of the image at the old size and produce a new one at the new size.
Size of the scaled image is given in terms of pixel width and height. Note that scaled image held by this object is disposed of when needed, and when this object itself is disposed. However, the main un-scaled image is not disposed.
Constructor Summary | |
ScalableImageFigure()
constructor for an instance of this data where an image for zooming will be provided later. |
|
ScalableImageFigure(org.eclipse.swt.graphics.Image originalImage)
constructor for an instance of this data where the image to be scaled can be provided at construction time. |
|
ScalableImageFigure(org.eclipse.swt.graphics.Image originalImage,
int width,
int height)
constructor for an instance of this data where the image to be scaled can be provided at construction time, and the zoomed size that is needed is already known too. |
Method Summary | |
void |
dispose()
|
int |
getDisplayHeight()
returns height in pixels of the scaled image. |
int |
getDisplayWidth()
returns width in pixels of the scaled image. |
org.eclipse.draw2d.ImageFigure |
getFigure()
fetches the scaled image as a draw2d ImageFigure according to the scaling information currently stored here. |
int |
getOriginalHeight()
returns height in pixels of the unscaled image. |
int |
getOriginalWidth()
returns width in pixels of the unscaled image. |
void |
setDimensions(org.eclipse.draw2d.geometry.Dimension dim)
sets the width and height the image is to scaled to. |
void |
setDimensions(int width,
int height)
sets the width and height the image is to scaled to. |
void |
setHeight(int height)
sets the height the image is to scaled to. |
void |
setImage(org.eclipse.swt.graphics.Image originalImage)
sets the unscaled image that is to be scaled by this item. |
void |
setWidth(int width)
sets the width the image is to scaled to. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScalableImageFigure()
setImage(Image)
.
public ScalableImageFigure(org.eclipse.swt.graphics.Image originalImage)
public ScalableImageFigure(org.eclipse.swt.graphics.Image originalImage, int width, int height)
Method Detail |
public void setImage(org.eclipse.swt.graphics.Image originalImage)
originalImage
- SWT unscaled Imagepublic int getOriginalWidth()
public int getOriginalHeight()
public int getDisplayWidth()
public int getDisplayHeight()
public void setWidth(int width)
width
- int new width for the scaled image.public void setHeight(int height)
height
- int new height for the scaled image.public void setDimensions(int width, int height)
width
- int new width for the scaled image.height
- int new height for the scaled image.public void setDimensions(org.eclipse.draw2d.geometry.Dimension dim)
dim
- desired Dimension of scaled image.public org.eclipse.draw2d.ImageFigure getFigure()
public void dispose()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |