|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjcontrol.io.AbstractGraphics
jcontrol.graphics.BufferGraphics
public class BufferGraphics
The BufferGraphics class offers an implementation of the XGraphics interface
which can draw on a BufferedImage. Note that not all methods are supported.
| Field Summary |
|---|
| Fields inherited from class jcontrol.io.AbstractGraphics |
|---|
NEGATIVE, OFF, ON, SYSTEMFONT |
| Fields inherited from interface jcontrol.graphics.XGraphics |
|---|
ANCHOR_BASELINE, ANCHOR_BOTTOM, ANCHOR_HCENTER, ANCHOR_LEFT, ANCHOR_RIGHT, ANCHOR_TOP, ANCHOR_VCENTER, DRAWMODE_AND, DRAWMODE_INVERSE, DRAWMODE_MASK, DRAWMODE_NORMAL, DRAWMODE_OR, DRAWMODE_XOR, MAX_BRIGHTNESS, MAX_CONTRAST, MIN_BRIGHTNESS, MIN_CONTRAST, STROKEMODE_DOTTED, STROKEMODE_SOLID |
| Fields inherited from interface jcontrol.io.Graphics |
|---|
AND, INVERSE, NORMAL, OR, XOR |
| Constructor Summary | |
|---|---|
protected |
BufferGraphics(BufferedImage bufferedImage)
Constructor |
| Method Summary | |
|---|---|
boolean |
clipRect(int nx,
int ny,
int nw,
int nh)
Intersects the stored ClipRect with another represented by the given values. |
XGraphics |
cloneXGraphics()
Creates a clone of this XGraphics object that has the same settings as this one, but acts independently. |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
NOTE: not supported Copies an area within the framebuffer. |
void |
drawArc(int x,
int y,
int width,
int height,
int startangle,
int arcangle)
NOTE: not supported Draws an elliptic arc. |
int |
drawChar(char c,
int x,
int y,
int anchor)
NOTE: not supported Draws a single character with the currently set font. |
void |
drawImage(Object drawable,
int x,
int y)
Draws an image to the specified coordinates. |
void |
drawImage(Object drawable,
int x,
int y,
int anchor)
NOTE: not supported Draws an image. |
void |
drawImage(Object drawable,
int x,
int y,
int width,
int height,
int xoff,
int yoff)
Draws a subimage to the specified coordinates. |
void |
drawOval(int x,
int y,
int width,
int height)
Draws an ellipse. |
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
NOTE: not supported Draws a closed polyline. |
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
NOTE: not supported Draws a polyline. |
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draws a rounded rectangle. |
void |
drawString(String s,
int x,
int y,
int anchor)
NOTE: not supported Draws a text string with the currently set font. |
void |
fillArc(int x,
int y,
int width,
int height,
int startangle,
int arcangle)
NOTE: not supported Draws a filled elliptic arc, which is similar to a pie charts element. |
void |
fillOval(int x,
int y,
int width,
int height)
Draws a filled ellipse. |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
NOTE: not supported Draws a polygon. |
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
Draws a filled rounded rectangle. |
protected void |
finalize()
free internal data structures used by this buffergraphics object. |
int |
getBackground()
Returns the ARGB value of the current background color. |
int |
getClipHeight()
Returns the height of the clipping rectangle |
int |
getClipWidth()
Returns the width of the clipping rectangle |
int |
getClipX()
Returns the relative x-location of the clipping rectangle |
int |
getClipY()
Returns the relative y-location of the clipping rectangle |
int |
getColor()
Returns the ARGB value of the current drawing color. |
Object |
getFont()
Returns the currently set font. |
int |
getStrokeMode()
NOTE: not supported Returns the current stroke mode. |
int |
getTranslateX()
Returns the absolute x-location of the origin |
int |
getTranslateY()
Returns the absolute y-location of the origin |
boolean |
isClipRectEmpty()
Checks, if the current clipping rectangle is empty (i.e. doesn't cover any pixel). |
boolean |
isOverlapping(int x,
int y,
int width,
int height)
Checks, if the given rectangle overlaps (or - mathematically spoken - intersects) with the current clipping rectangle. |
void |
setBackground(Color color)
Sets the background color. |
void |
setClip(int nx,
int ny,
int nw,
int nh)
Sets the clipping rectangle. |
void |
setColor(Color color)
Sets the drawing color. |
void |
setFont(Object newfont)
Sets the font to use. |
void |
setStrokeMode(int mode)
NOTE: not supported Sets the stroke mode. |
void |
swapColors()
Swaps drawing and background color. |
void |
translate(int dx,
int dy)
Moves the translation (origin) point. |
| Methods inherited from class jcontrol.io.AbstractGraphics |
|---|
clearDisplay, clearRect, drawChar, drawLine, drawRect, drawString, drawString, fillRect, getDrawMode, getFontHeight, getPixel, getTextWidth, scroll, setBackground, setColor, setDisplayMode, setDrawMode, setPixel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, notifyAll, toString, wait |
| Methods inherited from interface jcontrol.graphics.XGraphics |
|---|
drawChar, scroll, setBackground, setColor |
| Methods inherited from interface jcontrol.io.Graphics |
|---|
clearRect, drawLine, drawRect, drawString, drawString, fillRect, getDrawMode, getFontHeight, getPixel, getTextWidth, setDrawMode, setPixel |
| Constructor Detail |
|---|
protected BufferGraphics(BufferedImage bufferedImage)
| Method Detail |
|---|
public XGraphics cloneXGraphics()
protected void finalize()
public void setColor(Color color)
setColor in interface XGraphicsc - new drawing colorpublic int getColor()
getColor in interface XGraphicspublic void setBackground(Color color)
setBackground in interface XGraphicsc - new background colorpublic int getBackground()
getBackground in interface XGraphicspublic void swapColors()
swapColors in interface XGraphicspublic void setFont(Object newfont)
setFont in interface GraphicssetFont in class AbstractGraphicsnewfont - the font to use, possible values: SYSTEMFONT (default) or
a instance of Resource specifying the font, the resource has to be
in JCFD format (use FontEdit of the JControl toolware to generate).AbstractGraphics.drawString(java.lang.String s, int x, int y),
AbstractGraphics.SYSTEMFONTpublic Object getFont()
getFont in interface XGraphics
public void translate(int dx,
int dy)
translate in interface XGraphicsdx - horizontal translationdy - vertical translation
public boolean clipRect(int nx,
int ny,
int nw,
int nh)
clipRect in interface XGraphicsnx - new ClipRect xny - new ClipRect ynw - new ClipRect widthnh - new ClipRect height
public void setClip(int nx,
int ny,
int nw,
int nh)
setClip in interface XGraphicsx - new x-location of the clipping rectangley - new x-location of the clipping rectanglewidth - new width of the clipping rectangleheight - new height of the clipping rectanglepublic int getTranslateX()
getTranslateX in interface XGraphicspublic int getTranslateY()
getTranslateY in interface XGraphicspublic int getClipX()
getClipX in interface XGraphicspublic int getClipY()
getClipY in interface XGraphicspublic int getClipWidth()
getClipWidth in interface XGraphicspublic int getClipHeight()
getClipHeight in interface XGraphics
public boolean isOverlapping(int x,
int y,
int width,
int height)
isOverlapping in interface XGraphicsx - x-location of rectangle to testy - y-location of rectangle to testwidth - width of rectangle to testheight - height of rectangle to test
public boolean isClipRectEmpty()
isClipRectEmpty in interface XGraphics
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
drawRoundRect in interface XGraphicsx - x-locationy - y-locationwidth - widthheight - heightarcWidth - arcHeight -
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
fillRoundRect in interface XGraphicsx - x-locationy - y-locationwidth - widthheight - heightarcWidth - arcHeight -
public void drawOval(int x,
int y,
int width,
int height)
drawOval in interface XGraphicsx - x-locationy - y-locationwidth - widthheight - height
public void fillOval(int x,
int y,
int width,
int height)
fillOval in interface XGraphicsx - x-locationy - y-locationwidth - widthheight - height
public void drawImage(Object drawable,
int x,
int y)
Resource pointing to a JCIF file (use JIFEditor to create)Drawable specifiying what to draw
drawImage in interface GraphicsdrawImage in class AbstractGraphicsdrawable - the image to drawx - the horizontal coordinatey - the vertical coordinate
public void drawImage(Object drawable,
int x,
int y,
int width,
int height,
int xoff,
int yoff)
drawImage in interface GraphicsdrawImage in class AbstractGraphicsdrawable - the image to drawx - the horizontal coordinatey - the vertical coordinatewidth - the width of the sub image within the source imageheight - the height of the sub image within the source imagexoff - horizontal offset of the sub image within the source imageyoff - vertical offset of the sub image within the source imagedrawImage(Object, int, int)public void setStrokeMode(int mode)
setStrokeMode in interface XGraphicsstroke - mode (STROKEMODE_SOLID or STROKEMODE_DOTTED)public int getStrokeMode()
getStrokeMode in interface XGraphics
public void drawArc(int x,
int y,
int width,
int height,
int startangle,
int arcangle)
drawArc in interface XGraphicsx - x-location of the underlying ellipsey - y-location of the underlying ellipsewidth - width of the underlying ellipseheight - height of the underlying ellipsestartAngle - angle from where to start drawing (in degrees)arcAngle - angle along which the arc has to be drawn (in degrees)
public void fillArc(int x,
int y,
int width,
int height,
int startangle,
int arcangle)
fillArc in interface XGraphicsx - x-location of the underlying ellipsey - y-location of the underlying ellipsewidth - width of the underlying ellipseheight - height of the underlying ellipsestartAngle - angle from where to start drawing (in degrees)arcAngle - angle along which the arc has to be drawn (in degrees)
public void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolygon in interface XGraphicsxPoints - x-locations of the polyline's pointsyPoints - y-locations of the polyline's pointsnPoints - number of pointsdrawPolyline(int[], int[], int)
public void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
drawPolyline in interface XGraphicsxPoints - x-locations of the polyline's pointsyPoints - y-locations of the polyline's pointsnPoints - number of pointsdrawPolygon(int[], int[], int)
public void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
fillPolygon in interface XGraphicsxPoints - x-locations of the polygon's pointsyPoints - y-locations of the polygon's pointsnPoints - number of points
public int drawChar(char c,
int x,
int y,
int anchor)
drawChar in interface XGraphicsc - character to drawx - x-locationy - y-locationanchor - character alignment (e.g. ANCHOR_HCENTER or ANCHOR_BASELINE, ...)
public void drawString(String s,
int x,
int y,
int anchor)
drawString in interface XGraphicss - text to drawx - x-locationy - y-locationanchor - text alignment (e.g. ANCHOR_HCENTER or ANCHOR_BASELINE, ...)
public void drawImage(Object drawable,
int x,
int y,
int anchor)
drawImage in interface XGraphicsdrawable - drawable object (e.g. Image or a Resource containing
a bitmap image)x - x-locationy - y-locationanchor - image alignment (e.g. ANCHOR_HCENTER or ANCHOR_TOP, ...)
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
copyArea in interface XGraphicsx - x-location of area to copyy - y-location of area to copywidth - width of area to copyheight - height of area to copydx - destination x-locationdy - destination y-location
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||