|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Graphics
|
+--com.eteks.awt.PJAGraphics
Pure Java AWT Graphics class implementation. This class enables to draw
in an off screen image, on a system that has no display available.
All drawings are done in the buffer of an image of class PJAImage.
All the methods are the implementation of the abstract ones of java.awt.Graphics
class. See java.awt.Graphics for more information.
This class uses only int and longnumber type (no float
or double).
This class can work even if the classes Rectangle, Color, Font
and FontMetrics aren't accessible for security reasons.
PJAImage,
Graphics,
PJAGraphicsManager| Constructor Summary | |
protected |
PJAGraphics(PJAImage image)
|
| Method Summary | |
void |
clearRect(int x,
int y,
int width,
int height)
java.awt.Graphics implementation. |
void |
clipRect(int x,
int y,
int width,
int height)
java.awt.Graphics implementation. |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
java.awt.Graphics implementation. |
Graphics |
create()
java.awt.Graphics implementation. |
void |
dispose()
java.awt.Graphics implementation. |
void |
draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
Same implementation as in the class java.awtGraphics except
it doesn't use Color class. |
void |
drawArc(int x,
int y,
int width,
int height,
int start,
int arcAngle)
java.awt.Graphics implementation. |
boolean |
drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer)
java.awt.Graphics implementation. |
boolean |
drawImage(Image img,
int x,
int y,
ImageObserver observer)
java.awt.Graphics implementation. |
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer)
java.awt.Graphics implementation. |
boolean |
drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
java.awt.Graphics implementation. |
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
java.awt.Graphics implementation. |
boolean |
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
java.awt.Graphics implementation. |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
|
void |
drawOval(int x,
int y,
int width,
int height)
java.awt.Graphics implementation. |
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
java.awt.Graphics implementation. |
void |
drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
java.awt.Graphics implementation. |
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
java.awt.Graphics implementation. |
void |
drawString(AttributedCharacterIterator iterator,
int x,
int y)
java.awt.Graphics implementation. |
void |
drawString(String str,
int x,
int y)
java.awt.Graphics implementation. |
void |
fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
Same implementation as in the class java.awtGraphics except
it doesn't use Color class. |
void |
fillArc(int x,
int y,
int width,
int height,
int start,
int arcAngle)
java.awt.Graphics implementation. |
void |
fillOval(int x,
int y,
int width,
int height)
java.awt.Graphics implementation. |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
java.awt.Graphics implementation. |
void |
fillRect(int x,
int y,
int width,
int height)
java.awt.Graphics implementation. |
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
java.awt.Graphics implementation. |
int |
getCharWidth(char ch)
Returns the advance width of the specified character of the current font. |
Shape |
getClip()
java.awt.Graphics implementation. |
Rectangle |
getClipBounds()
java.awt.Graphics implementation. |
Color |
getColor()
java.awt.Graphics implementation. |
int |
getColorRGB()
Returns the graphics current color RGB. |
Font |
getFont()
java.awt.Graphics implementation. |
int |
getFontAscent()
Determines the font ascent of the current font. |
int |
getFontDescent()
Determines the font descent of the current font. |
int |
getFontLeading()
Determines the standard leading of the current font. |
int |
getFontMaxAdvance()
Gets the maximum advance width of any character of the current Font. |
int |
getFontMaxAscent()
Determines the maximum ascent of the current font. |
int |
getFontMaxDescent()
Determines the maximum descent of the current font. |
FontMetrics |
getFontMetrics()
java.awt.Graphics implementation. |
FontMetrics |
getFontMetrics(Font font)
java.awt.Graphics implementation. |
String |
getFontName()
Returns the graphics current font name. |
int |
getFontSize()
Returns the graphics current font size. |
int |
getFontStyle()
Returns the graphics current font style. |
int |
getStringWidth(String str)
Returns the total advance width for showing the specified String of the current Font. |
static int |
roundDiv(int dividend,
int divisor)
Returns the rounded result of dividend / divisor, avoiding the use of floating
point operation (returns the same as Math.round((float)dividend / divisor)). |
static long |
roundDiv(long dividend,
long divisor)
Returns the rounded result of dividend / divisor, avoiding the use of floating
point operation (returns the same as Math.round((double)dividend / divisor)). |
void |
setClip(int x,
int y,
int width,
int height)
java.awt.Graphics implementation. |
void |
setClip(Shape clip)
java.awt.Graphics implementation. |
void |
setColor(Color color)
java.awt.Graphics implementation. |
void |
setColor(int red,
int green,
int blue)
Sets this graphics context's color. |
void |
setFont(Font font)
java.awt.Graphics implementation. |
void |
setFont(String fontName,
int fontStyle,
int fontSize)
Sets this graphics context's font to the specified font specified by its name, style and size. |
void |
setPaintMode()
java.awt.Graphics implementation. |
void |
setXORMode(Color c1)
java.awt.Graphics implementation. |
void |
setXORMode(int red,
int green,
int blue)
Sets this graphics context's XOR color. |
void |
translate(int x,
int y)
java.awt.Graphics implementation. |
| Methods inherited from class java.awt.Graphics |
create, drawBytes, drawChars, drawPolygon, drawRect, fillPolygon, finalize, getClipBounds, getClipRect, hitClip, toString |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected PJAGraphics(PJAImage image)
| Method Detail |
public Graphics create()
java.awt.Graphics implementation.create in class GraphicsGraphics
public void translate(int x,
int y)
java.awt.Graphics implementation.translate in class GraphicsGraphicspublic Color getColor()
java.awt.Graphics implementation.getColor in class GraphicsGraphicspublic void setColor(Color color)
java.awt.Graphics implementation.setColor in class GraphicsGraphicspublic int getColorRGB()
PJAGraphicsExtension implementation.getColorRGB in interface PJAGraphicsExtensionPJAGraphicsExtension
public void setColor(int red,
int green,
int blue)
PJAGraphicsExtension implementation.setColor in interface PJAGraphicsExtensionred - the red component.green - the green component.blue - the blue component.PJAGraphicsExtensionpublic void setPaintMode()
java.awt.Graphics implementation.setPaintMode in class GraphicsGraphicspublic void setXORMode(Color c1)
java.awt.Graphics implementation.setXORMode in class GraphicsGraphics
public void setXORMode(int red,
int green,
int blue)
PJAGraphicsExtension implementation.setXORMode in interface PJAGraphicsExtensionred - the red component.green - the green component.blue - the blue component.PJAGraphicsExtensionpublic FontMetrics getFontMetrics()
java.awt.Graphics implementation.getFontMetrics in class GraphicsGraphicspublic FontMetrics getFontMetrics(Font font)
java.awt.Graphics implementation.getFontMetrics in class GraphicsGraphicspublic int getFontLeading()
PJAGraphicsExtension implementation.getFontLeading in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getFontAscent()
PJAGraphicsExtension implementation.getFontAscent in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getFontDescent()
PJAGraphicsExtension implementation.getFontDescent in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getFontMaxAscent()
PJAGraphicsExtension implementation.getFontMaxAscent in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getFontMaxDescent()
PJAGraphicsExtension implementation.getFontMaxDescent in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getFontMaxAdvance()
PJAGraphicsExtension implementation.getFontMaxAdvance in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getCharWidth(char ch)
PJAGraphicsExtension implementation.getCharWidth in interface PJAGraphicsExtensionch - the character to be measuredchar
in the font described by this font metric.PJAGraphicsExtensionpublic int getStringWidth(String str)
PJAGraphicsExtension implementation.getStringWidth in interface PJAGraphicsExtensionstr - the String to be measuredPJAGraphicsExtensionpublic Font getFont()
java.awt.Graphics implementation.getFont in class GraphicsGraphicspublic String getFontName()
null if no font
could be loaded from .pjaf font files.
PJAGraphicsExtension implementation.getFontName in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getFontStyle()
PJAGraphicsExtension implementation.getFontStyle in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic int getFontSize()
PJAGraphicsExtension implementation.getFontSize in interface PJAGraphicsExtensionPJAGraphicsExtensionpublic void setFont(Font font)
java.awt.Graphics implementation.setFont in class GraphicsGraphics
public void setFont(String fontName,
int fontStyle,
int fontSize)
PJAGraphicsExtension implementation.setFont in interface PJAGraphicsExtensionfontName - the font name.fontStyle - the font style.fontSize - the font size.PJAGraphicsExtension,
Graphics.setFont(Font)public Rectangle getClipBounds()
java.awt.Graphics implementation.getClipBounds in class GraphicsGraphics
public void clipRect(int x,
int y,
int width,
int height)
java.awt.Graphics implementation.clipRect in class GraphicsGraphics
public void setClip(int x,
int y,
int width,
int height)
java.awt.Graphics implementation.setClip in class GraphicsGraphicspublic Shape getClip()
java.awt.Graphics implementation.getClip in class GraphicsGraphicspublic void setClip(Shape clip)
java.awt.Graphics implementation.setClip in class GraphicsGraphics
public void copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
java.awt.Graphics implementation.copyArea in class GraphicsGraphics
public void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in class Graphics
public void fillRect(int x,
int y,
int width,
int height)
java.awt.Graphics implementation.fillRect in class GraphicsGraphics
public void clearRect(int x,
int y,
int width,
int height)
java.awt.Graphics implementation.clearRect in class GraphicsGraphics
public void drawRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
java.awt.Graphics implementation.drawRoundRect in class GraphicsGraphics
public void fillRoundRect(int x,
int y,
int width,
int height,
int arcWidth,
int arcHeight)
java.awt.Graphics implementation.fillRoundRect in class GraphicsGraphics
public void draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
java.awtGraphics except
it doesn't use Color class.draw3DRect in class Graphics
public void fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
java.awtGraphics except
it doesn't use Color class.fill3DRect in class Graphics
public void drawOval(int x,
int y,
int width,
int height)
java.awt.Graphics implementation.drawOval in class GraphicsGraphics
public void fillOval(int x,
int y,
int width,
int height)
java.awt.Graphics implementation.fillOval in class GraphicsGraphics
public void drawArc(int x,
int y,
int width,
int height,
int start,
int arcAngle)
java.awt.Graphics implementation.drawArc in class GraphicsGraphics
public void fillArc(int x,
int y,
int width,
int height,
int start,
int arcAngle)
java.awt.Graphics implementation.fillArc in class GraphicsGraphics
public static int roundDiv(int dividend,
int divisor)
dividend / divisor, avoiding the use of floating
point operation (returns the same as Math.round((float)dividend / divisor)).dividend - A int number to divide.divisor - A int divisor.int integer.
public static long roundDiv(long dividend,
long divisor)
dividend / divisor, avoiding the use of floating
point operation (returns the same as Math.round((double)dividend / divisor)).dividend - A long number to divide.divisor - A long divisor.long integer.
public void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)
java.awt.Graphics implementation.drawPolyline in class GraphicsGraphics
public void drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
java.awt.Graphics implementation.drawPolygon in class GraphicsGraphics
public void fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
java.awt.Graphics implementation.fillPolygon in class GraphicsGraphics
public void drawString(String str,
int x,
int y)
java.awt.Graphics implementation.
Strings are drawn using .pjaf font files read in PJAFontData objects by
PJAGraphicsManager.drawString in class GraphicsPJAGraphicsManager,
PJAFontData,
Graphics
public void drawString(AttributedCharacterIterator iterator,
int x,
int y)
java.awt.Graphics implementation.drawString in class GraphicsGraphics
public boolean drawImage(Image img,
int x,
int y,
ImageObserver observer)
java.awt.Graphics implementation.drawImage in class GraphicsGraphics
public boolean drawImage(Image img,
int x,
int y,
Color bgcolor,
ImageObserver observer)
java.awt.Graphics implementation.drawImage in class GraphicsGraphics
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
ImageObserver observer)
java.awt.Graphics implementation.drawImage in class GraphicsGraphics
public boolean drawImage(Image img,
int x,
int y,
int width,
int height,
Color bgcolor,
ImageObserver observer)
java.awt.Graphics implementation.drawImage in class GraphicsGraphics
public boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
ImageObserver observer)
java.awt.Graphics implementation.drawImage in class GraphicsGraphics
public boolean drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
java.awt.Graphics implementation.drawImage in class GraphicsGraphicspublic void dispose()
java.awt.Graphics implementation.dispose in class GraphicsGraphics
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||