|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.draw.item.DrawingItem
edu.rit.draw.item.Image
public class Image
Class Image provides a DrawingItem containing an image. The image is read from a file or input stream. Image formats supported by the javax.imageio package are supported; this typically includes GIF, JPEG, and PNG images.
| Field Summary | |
|---|---|
static double |
NORMAL_SCALE
The normal scale factor (1). |
| Constructor Summary | |
|---|---|
Image()
Construct a new image item. |
|
Image(Image theItem)
Construct a new image item with the same image and attributes as the given image item. |
|
| Method Summary | |
|---|---|
Image |
add()
Add this image item to the end of the default drawing's sequence of drawing items. |
Image |
add(Drawing theDrawing)
Add this image item to the end of the given drawing's sequence of drawing items. |
Image |
addFirst()
Add this image item to the beginning of the default drawing's sequence of drawing items. |
Image |
addFirst(Drawing theDrawing)
Add this image item to the beginning of the given drawing's sequence of drawing items. |
Image |
c(double x,
double y)
Set the center point of this image item's bounding box. |
Image |
c(Point thePoint)
Set the center point of this image item's bounding box. |
static double |
defaultScale()
Returns the default scale factor. |
static void |
defaultScale(double theScale)
Set the default scale factor. |
void |
draw(Graphics2D g2d)
Draw this image item in the given graphics context. |
Image |
e(double x,
double y)
Set the east middle point of this image item's bounding box. |
Image |
e(Point thePoint)
Set the east middle point of this image item's bounding box. |
double |
height()
Returns the height of this image item's bounding box. |
BufferedImage |
image()
Returns this image item's image. |
Image |
image(File theFile)
Read this image item's image from the given file. |
Image |
image(InputStream in)
Read this image item's image from the given input stream. |
Image |
image(String theFileName)
Read this image item's image from the file with the given name. |
Image |
n(double x,
double y)
Set the north middle point of this image item's bounding box. |
Image |
n(Point thePoint)
Set the north middle point of this image item's bounding box. |
Image |
ne(double x,
double y)
Set the northeast corner point of this image item's bounding box. |
Image |
ne(Point thePoint)
Set the northeast corner point of this image item's bounding box. |
Point |
nw()
Returns the northwest corner point of this image item's bounding box. |
Image |
nw(double x,
double y)
Set the northwest corner point of this image item's bounding box. |
Image |
nw(Point thePoint)
Set the northwest corner point of this image item's bounding box. |
void |
readExternal(ObjectInput in)
Read this image item from the given object input stream. |
Image |
s(double x,
double y)
Set the south middle point of this image item's bounding box. |
Image |
s(Point thePoint)
Set the south middle point of this image item's bounding box. |
double |
scale()
Returns this image item's scale factor. |
Image |
scale(double theScale)
Set this image item's scale factor. |
Image |
se(double x,
double y)
Set the southeast corner point of this image item's bounding box. |
Image |
se(Point thePoint)
Set the southeast corner point of this image item's bounding box. |
Image |
sw(double x,
double y)
Set the southwest corner point of this image item's bounding box. |
Image |
sw(Point thePoint)
Set the southwest corner point of this image item's bounding box. |
Image |
w(double x,
double y)
Set the west middle point of this image item's bounding box. |
Image |
w(Point thePoint)
Set the west middle point of this image item's bounding box. |
double |
width()
Returns the width of this image item's bounding box. |
void |
writeExternal(ObjectOutput out)
Write this image item to the given object output stream. |
| Methods inherited from class edu.rit.draw.item.DrawingItem |
|---|
boundingBox, c, e, n, ne, s, se, size, sw, w |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double NORMAL_SCALE
| Constructor Detail |
|---|
public Image()
public Image(Image theItem)
theItem - Image item.
NullPointerException - (unchecked exception) Thrown if theItem is null.| Method Detail |
|---|
public static double defaultScale()
public static void defaultScale(double theScale)
theScale - Default scale factor.
IllegalArgumentException - (unchecked exception) Thrown if theScale is less than 0.public BufferedImage image()
public Image image(String theFileName)
throws IOException
theFileName - File name.
IOException - Thrown if an I/O error occurred.
public Image image(File theFile)
throws IOException
theFile - File.
IOException - Thrown if an I/O error occurred.
public Image image(InputStream in)
throws IOException
in - Input stream.
IOException - Thrown if an I/O error occurred.public double scale()
public Image scale(double theScale)
theScale - Scale factor.
IllegalArgumentException - (unchecked exception) Thrown if theScale is less than 0.public double width()
width in class DrawingItempublic double height()
height in class DrawingItempublic Point nw()
nw in class DrawingItem
public Image nw(double x,
double y)
x - X coordinate of northwest corner point.y - Y coordinate of northwest corner point.
public Image nw(Point thePoint)
thePoint - Northwest corner point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image n(double x,
double y)
x - X coordinate of north middle point.y - Y coordinate of north middle point.
public Image n(Point thePoint)
thePoint - North middle point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image ne(double x,
double y)
x - X coordinate of northeast corner point.y - Y coordinate of northeast corner point.
public Image ne(Point thePoint)
thePoint - Northeast corner point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image w(double x,
double y)
x - X coordinate of west middle point.y - Y coordinate of west middle point.
public Image w(Point thePoint)
thePoint - West middle point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image c(double x,
double y)
x - X coordinate of center point.y - Y coordinate of center point.
public Image c(Point thePoint)
thePoint - Center point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image e(double x,
double y)
x - X coordinate of east middle point.y - Y coordinate of east middle point.
public Image e(Point thePoint)
thePoint - East middle point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image sw(double x,
double y)
x - X coordinate of southwest corner point.y - Y coordinate of southwest corner point.
public Image sw(Point thePoint)
thePoint - Southwest corner point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image s(double x,
double y)
x - X coordinate of south middle point.y - Y coordinate of south middle point.
public Image s(Point thePoint)
thePoint - South middle point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.
public Image se(double x,
double y)
x - X coordinate of southeast corner point.y - Y coordinate of southeast corner point.
public Image se(Point thePoint)
thePoint - Southeast corner point.
NullPointerException - (unchecked exception) Thrown if thePoint is null.public Image add()
add in class DrawingItemNullPointerException - (unchecked exception) Thrown if there is no default drawing.Drawing.defaultDrawing()public Image add(Drawing theDrawing)
add in class DrawingItemtheDrawing - Drawing.
NullPointerException - (unchecked exception) Thrown if theDrawing is null.public Image addFirst()
addFirst in class DrawingItemNullPointerException - (unchecked exception) Thrown if there is no default drawing.Drawing.defaultDrawing()public Image addFirst(Drawing theDrawing)
addFirst in class DrawingItemtheDrawing - Drawing.
NullPointerException - (unchecked exception) Thrown if theDrawing is null.
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class DrawingItemout - Object output stream.
IOException - Thrown if an I/O error occurred.
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class DrawingItemin - Object input stream.
IOException - Thrown if an I/O error occurred.
ClassNotFoundException - Thrown if any class needed to deserialize this image item cannot be
found.public void draw(Graphics2D g2d)
draw in class DrawingItemg2d - 2-D graphics context.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||