|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.datatypes.Image
public abstract class Image
Abstract super class of images in MillScript, intended to abstract the different types of image. In particular we want to abstract the difference between raster and vector graphics, so that they can be treated in the same way.
| Constructor Summary | |
|---|---|
Image()
|
|
| Method Summary | |
|---|---|
protected java.lang.Object |
clone()
|
abstract void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line in the current colour, between the points ( x1, y1 ) and ( x2, y2 ). |
abstract void |
drawOval(int x,
int y,
int width,
int height)
Draws the outline of an oval in the current color. |
abstract void |
drawRect(int x,
int y,
int width,
int height)
Draws the outline of a rectangle in the current color. |
abstract void |
drawString(java.lang.String s,
int x,
int y)
Draws the text using the current font, in the current color, at the specified position. |
abstract void |
fillOval(int x,
int y,
int width,
int height)
Draws a filled oval in the current color. |
abstract void |
fillRect(int x,
int y,
int width,
int height)
Draws a filled rectangle in the current color. |
abstract java.awt.Graphics2D |
getGraphics2D()
Returns a Graphics2D object to draw on this image. |
abstract int |
height()
Returns the height of this image, in pixels. |
abstract void |
renderAsRasterToStream(java.io.OutputStream ostream,
ImageRender render)
Renders this image to the specified stream as a raster image. |
abstract void |
setColor(java.awt.Color color)
Sets the current color to the specified value. |
void |
showImage()
Entry point for showing an image. |
abstract int |
width()
Returns the width of this image, in pixels. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Image()
| Method Detail |
|---|
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionObject.clone()
public abstract void drawLine(int x1,
int y1,
int x2,
int y2)
x1 - the first point's x coordinatey1 - the first point's y coordinatex2 - the second point's x coordinatey2 - the second point's y coordinate
public abstract void drawOval(int x,
int y,
int width,
int height)
width and height.
x - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangle the oval fits inheight - the height of the rectangle the oval fits in
public abstract void drawRect(int x,
int y,
int width,
int height)
width and height.
x - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangleheight - the height of the rectangle
public abstract void drawString(java.lang.String s,
int x,
int y)
s - the string to drawx - the starting point x coordinatey - the starting point y coordinate
public abstract void fillOval(int x,
int y,
int width,
int height)
width and height.
x - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangle the oval fits inheight - the height of the rectangle the oval fits in
public abstract void fillRect(int x,
int y,
int width,
int height)
width and height.
x - the starting point x coordinatey - the starting point y coordinatewidth - the width of the rectangleheight - the height of the rectanglepublic abstract java.awt.Graphics2D getGraphics2D()
public abstract int height()
public abstract void renderAsRasterToStream(java.io.OutputStream ostream,
ImageRender render)
throws java.io.IOException
ostream - the stream to render torender - the image renderer to use for rasterising the image
java.io.IOException - thrown if problems occur with the streampublic abstract void setColor(java.awt.Color color)
color - the new color to draw inpublic void showImage()
public abstract int width()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||