public class Drawing extends ImageObject implements ImageData
Modifier and Type | Field and Description |
---|---|
static int |
AlwaysOnTop
A property bit - The image is always on top.
|
static int |
CompletelyIn
A property bit - Another image must be completely within this image to be considered "within"
this image.
|
boolean |
freeImageWithDrawing
If this is true then a call to free() will also free the image.
|
static int |
HasBorder
A property bit - The image has a border.
|
static int |
HasChanged
A property bit - The image has changed, this is normally set and cleared automatically.
|
static int |
HasMoved
A property bit - The image has moved, this is normally set and cleared automatically.
|
Area |
hotArea
This Area must update itself as the image moves.
|
Polygon |
hotPolygon
This polygon must be relative to the top-left of the image.
|
protected IImage |
image |
static int |
InUse
A property bit - Used by MosaicPanel
|
static int |
IsAnimated
A property bit - indicates that this image will be animated and so the ImageRefresher
should be set if it is being placed into a Control.
|
static int |
IsEmpty
A property bit - The image is empty.
|
static int |
IsInvisible
A property bit - The image is invisible
|
static int |
IsLocked
A property bit - The image is locked - not used yet.
|
static int |
IsMoveable
A property bit - The image is moveable (draggable).
|
static int |
IsNotHot
A property bit - The image has no hot area.
|
static int |
IsNotStill
A property bit - The image is not still, it is animated.
|
static int |
IsPrepared
A property bit - The image is fully prepared.
|
static int |
IsPreparing
A property bit - The image is being prepared.
|
static int |
KeepOnScreen
A property bit - When refreshing this image, the associated Mosaic will scroll itself to keep the image fully visible (if possible).
|
Rect |
lastDrawn |
Rect |
location |
static int |
MouseMustBeOver
A property bit - In order for a "drag over" event to be recognized, the mouse pointer must be over the image.
|
int |
properties |
static int |
RelativeToOrigin
A property bit - The image stays on the same spot on the screen, even if the mosaic scrolls.
|
background, height, width
CREATE_OPTION_DONT_SCALE_UP, CREATE_OPTION_IGNORE_ALPHA, CREATE_OPTION_KEEP_ASPECT_RATIO, CREATE_OPTION_ROUGH_SCALING, SCAN_LINE_BYTE_ARRAY, SCAN_LINE_INT_ARRAY, TYPE_ARGB, TYPE_GRAY_SCALE_16, TYPE_GRAY_SCALE_2, TYPE_GRAY_SCALE_256, TYPE_GRAY_SCALE_4, TYPE_INDEXED_16, TYPE_INDEXED_2, TYPE_INDEXED_256, TYPE_INDEXED_4, TYPE_MASK, TYPE_MONO, TYPE_RGB, TYPE_UNKNOWN
Constructor and Description |
---|
Drawing() |
Drawing(ImageData image,
Object maskObject) |
Drawing(String imageName,
Object maskObject) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object other) |
void |
copyFrom(Object other) |
void |
doDraw(Graphics g,
int options)
Bottom level draw.
|
void |
draw(Graphics g)
Draws itself on the graphic g at the point specified by the variable "location".
|
void |
draw(Graphics g,
int x,
int y,
int options)
Draws itself on the graphic g at a specfied co-ordinate.
|
void |
drawBorder(Graphics g,
int x,
int y,
int options)
Draws the border of the image.
|
void |
drawn(Rect where) |
void |
free() |
Color |
getBackground()
This returns a background color if one is set for the image.
|
Object |
getCopy() |
Rect |
getDim(Rect dest) |
Area |
getHotArea()
The area returned here is not relative to the top left of the image.
|
IImage |
getImage() |
void |
getImageScanLines(int startLine,
int numLines,
Object destArray,
int offset,
int destScanLineLength)
Place a set of scan lines into a destination array.
|
Point |
getLocation(Point dest)
Get the X,Y location of the Drawing.
|
Object |
getNew() |
int[] |
getPixels(int[] dest,
int offset,
int x,
int y,
int width,
int height,
int rowStride)
Retrieve the pixels from the Image in encoded ARGB values.
|
Dimension |
getSize(Dimension dest)
Get the width and height of the Drawing.
|
protected Color |
getUnusedColor() |
boolean |
isWriteableImage()
Returns if you can write data to the ImageData.
|
boolean |
onHotArea(int x,
int y)
Returns if the point is on the hot area of the image.
|
void |
setHotAreaInImage(Area inImage) |
void |
setImage(ImageData image) |
void |
setImageScanLines(int startLine,
int numLines,
Object sourceArray,
int offset,
int sourceScanLineLength)
Place a set of scan lines from a source Array into the ImageData.
|
void |
setLocation(int x,
int y) |
boolean |
setPixels(int[] src,
int offset,
int x,
int y,
int width,
int height,
int rowStride)
Set the pixels in the IImage in encoded ARGB values.
|
void |
setRect(int x,
int y,
int width,
int height) |
void |
setSize(int width,
int height) |
boolean |
usesAlpha()
Returns whether the image uses the Alpha channel.
|
createImageFor, draw, draw, freeImage, getCompatibleImagePoints, getDPI, getHeight, getImageColorTable, getImageData, getImageHeight, getImageScanLineLength, getImageScanLineType, getImageType, getImageWidth, getNativeDrawable, getPixelsUsingScanLines, getScanLinesUsingPixels, getWidth, isReadableImage, scanLinesComplete, setPixelsUsingScanLines, setScanLinePixels, setScanLinesUsingPixels
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
freeImage, getImageColorTable, getImageHeight, getImageScanLineLength, getImageScanLineType, getImageType, getImageWidth, isReadableImage
public int properties
protected IImage image
public boolean freeImageWithDrawing
public static final int IsPreparing
public static final int IsPrepared
public static final int IsInvisible
public static final int HasBorder
public static final int IsEmpty
public static final int AlwaysOnTop
public static final int InUse
public static final int IsNotHot
public static final int IsMoveable
public static final int IsLocked
public static final int CompletelyIn
public static final int HasMoved
public static final int HasChanged
public static final int IsNotStill
public static final int RelativeToOrigin
public static final int MouseMustBeOver
public static final int KeepOnScreen
public static final int IsAnimated
public Rect location
public Rect lastDrawn
public Area hotArea
public Polygon hotPolygon
public boolean isWriteableImage()
ImageData
isWriteableImage
in interface ImageData
public Point getLocation(Point dest)
dest
- An optional destination Point object.public Dimension getSize(Dimension dest)
dest
- An optional destination Dimension object.public Color getBackground()
IImage
getBackground
in interface IImage
getBackground
in class ImageObject
public void free()
free
in interface Drawable
free
in class ImageObject
protected Color getUnusedColor()
public int[] getPixels(int[] dest, int offset, int x, int y, int width, int height, int rowStride)
ImageData
getPixels
in interface ImageData
dest
- The destination int array. If this is null then a new array should be created.offset
- The offset into the array to start placing pixels.x
- the x co-ordinate within the image.y
- the y co-ordinate within the image.width
- the width of the pixel block to get.height
- the height of the pixel block to get.rowStride
- the number of int values between each row in the destination int array. If this is 0 it
will be assumed to be equal to width.public boolean usesAlpha()
IImage
public void drawBorder(Graphics g, int x, int y, int options)
public void doDraw(Graphics g, int options)
public void draw(Graphics g, int x, int y, int options)
public void draw(Graphics g)
public void setHotAreaInImage(Area inImage)
public void setImage(ImageData image)
public void setRect(int x, int y, int width, int height)
public void setSize(int width, int height)
public void setLocation(int x, int y)
public Area getHotArea()
public boolean onHotArea(int x, int y)
public int compareTo(Object other)
public Object getNew()
public void copyFrom(Object other)
public Object getCopy()
public void drawn(Rect where)
public void getImageScanLines(int startLine, int numLines, Object destArray, int offset, int destScanLineLength) throws IllegalStateException
ImageData
getImageScanLines
in interface ImageData
IllegalStateException
public void setImageScanLines(int startLine, int numLines, Object sourceArray, int offset, int sourceScanLineLength) throws IllegalStateException
ImageData
setImageScanLines
in interface ImageData
IllegalStateException
public boolean setPixels(int[] src, int offset, int x, int y, int width, int height, int rowStride)
ImageData
setPixels
in interface ImageData
src
- The source int array.offset
- The offset into the array to start retrieving pixels.x
- the x co-ordinate within the image.y
- the y co-ordinate within the image.width
- the width of the pixel block to get.height
- the height of the pixel block to get.rowStride
- the number of int values between each row in the source int array. If this is 0 it
will be assumed to be equal to width.public IImage getImage()