|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jtgl.core.JTGLGraphics
public abstract class JTGLGraphics
Graphics context where all drawing operations are performed
Field Summary | |
---|---|
protected JTGLColor |
_currBGColor
Current background color |
protected JTGLColor |
_currColor
Current foreground color |
Constructor Summary | |
---|---|
JTGLGraphics()
Creates a new instance of JTGLGraphics |
Method Summary | |
---|---|
void |
begin()
Signals the begining of usage of this graphics context. |
void |
clear()
|
void |
clear(int x,
int y,
int width,
int height)
|
void |
clear(int x,
int y,
int width,
int height,
JTGLColor color)
|
void |
clear(JTGLColor color)
|
void |
clear(JTGLRect rect)
|
void |
clear(JTGLRect rect,
JTGLColor color)
|
void |
clipReset()
|
abstract void |
copyArea(int x_src,
int y_src,
int width,
int height,
int x_dest,
int y_dest)
|
abstract void |
drawChar(char ch,
int x,
int y)
|
void |
drawChars(char[] chars,
int offset,
int length,
int x,
int y)
|
abstract void |
drawImage(JTGLImage img,
int x,
int y)
|
abstract void |
drawLine(int xf,
int yf,
int xt,
int yt)
|
void |
drawLine(int xf,
int yf,
int xt,
int yt,
JTGLColor color)
|
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
|
void |
drawPolygon(int[] xPoints,
int[] yPoints,
int offset,
int nPoints)
|
void |
drawPolyLine(int[] xPoints,
int[] yPoints,
int nPoints)
|
void |
drawPolyLine(int[] xPoints,
int[] yPoints,
int nPoints,
boolean closePath)
|
void |
drawPolyLine(int[] xPoints,
int[] yPoints,
int offset,
int nPoints,
boolean closePath)
|
void |
drawRect(int x,
int y,
int width,
int height)
|
void |
drawRect(int x,
int y,
int width,
int height,
JTGLColor color)
|
void |
drawRect(JTGLRect rect)
|
void |
drawRect(JTGLRect rect,
JTGLColor color)
|
abstract void |
drawRegion(JTGLImage src,
int x_src,
int y_src,
int width,
int height,
int x_dest,
int y_dest)
|
void |
drawString(java.lang.String str,
int x,
int y)
|
void |
drawTriangle(int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
|
void |
end()
Signals the end of usage of this graphics context. |
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int nPoints)
|
void |
fillPolygon(int[] xPoints,
int[] yPoints,
int offset,
int nPoints)
|
abstract void |
fillRect(int x,
int y,
int width,
int height)
|
void |
fillRect(int x,
int y,
int width,
int height,
JTGLColor color)
|
void |
fillRect(JTGLRect rect)
|
void |
fillRect(JTGLRect rect,
JTGLColor color)
|
void |
fillTriangle(int x1,
int y1,
int x2,
int y2,
int x3,
int y3)
|
abstract void |
flush()
Flush all pending drawing operations to destination such as screen. |
JTGLColor |
getBackgroundColor()
|
abstract JTGLRect |
getClip()
|
int |
getClipHeight()
|
int |
getClipWidth()
|
int |
getClipX()
|
int |
getClipY()
|
JTGLColor |
getColor()
|
abstract JTGLFont |
getDefaultFont()
|
JTGLFont |
getFont()
|
int |
getHeight()
Gets original context height independent of actual clipping height. |
int |
getPixel(int x,
int y)
|
int |
getTranslationX()
|
int |
getTranslationY()
|
int |
getWidth()
Gets original context width independent of actual clipping width. |
void |
init()
Initializes this graphics context. |
boolean |
isFullContextClipped()
|
void |
restoreClip()
|
void |
restoreColor()
|
void |
saveClip()
|
void |
saveColor(JTGLColor color)
|
void |
setBackgroundColor(JTGLColor color)
Background color is used when clearing this context and for auxiliary color. |
JTGLRect |
setClip(int x,
int y,
int width,
int height)
|
JTGLRect |
setClip(int x,
int y,
int width,
int height,
boolean updateInternal)
|
JTGLRect |
setClip(JTGLRect clip)
|
protected abstract void |
setClipInternal(int x,
int y,
int width,
int height)
|
void |
setColor(int r,
int g,
int b)
|
void |
setColor(int a,
int r,
int g,
int b)
|
void |
setColor(JTGLColor color)
|
protected abstract void |
setColorInternal(int argbColor)
Sets the internal foreground color packed in ARGB format |
protected void |
setColorInternal(JTGLColor color)
Sets the internal foregound color Subclases may overide this methof if another color packaging or translation (from JTGLColor) is needed. |
void |
setFont(JTGLFont font)
|
protected abstract void |
setFontInternal(java.lang.Object nativeFont)
|
void |
setFontSize(int sizeIndex)
Changes current font's size to a fixed font size defined by JTGLFont 's constants:
JTGLFont.SIZE_SMALL
JTGLFont.SIZE_MEDIUM
JTGLFont.SIZE_LARGE
Subsclasses of JTGLFont should return a minimun integer array of three predefined sizes. |
protected void |
setNativeGraphics(java.lang.Object nativeGraphics)
Change or wraps a native graphics context (Used whithin a non-double-buffered scenario) |
void |
setOrigin(int x,
int y)
|
void |
setPixel(int x,
int y,
JTGLColor color)
|
void |
translate(int tx,
int ty)
|
protected abstract void |
translateInternal(int tx,
int ty)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JTGLColor _currColor
protected JTGLColor _currBGColor
Constructor Detail |
---|
public JTGLGraphics()
Method Detail |
---|
public void init()
public void begin()
public void end()
public abstract void flush()
public final void setFont(JTGLFont font)
font
- protected abstract void setFontInternal(java.lang.Object nativeFont)
public final JTGLFont getFont()
public final void setFontSize(int sizeIndex)
JTGLFont
's constants:
JTGLFont.SIZE_SMALL
JTGLFont.SIZE_MEDIUM
JTGLFont.SIZE_LARGE
Subsclasses of JTGLFont
should return a minimun integer array of three predefined sizes.
public abstract JTGLFont getDefaultFont()
public abstract void drawChar(char ch, int x, int y)
ch
- x
- y
- public void drawChars(char[] chars, int offset, int length, int x, int y)
chars
- offset
- length
- x
- y
- public void drawString(java.lang.String str, int x, int y)
str
- x
- y
- public final void translate(int tx, int ty)
tx
- ty
- protected abstract void translateInternal(int tx, int ty)
tx
- ty
- public final int getTranslationX()
public final int getTranslationY()
public void setOrigin(int x, int y)
x
- y
- public final int getWidth()
public final int getHeight()
public JTGLRect setClip(JTGLRect clip)
clip
-
public JTGLRect setClip(int x, int y, int width, int height, boolean updateInternal)
x
- y
- width
- height
- updateInternal
-
public JTGLRect setClip(int x, int y, int width, int height)
x
- y
- width
- height
-
protected abstract void setClipInternal(int x, int y, int width, int height)
x
- y
- width
- height
- public abstract JTGLRect getClip()
public final boolean isFullContextClipped()
public final void clipReset()
public final int getClipX()
public final int getClipY()
public final int getClipWidth()
public final int getClipHeight()
public final void saveClip()
public final void restoreClip()
public void setColor(int r, int g, int b)
r
- g
- b
- public void setColor(int a, int r, int g, int b)
a
- r
- g
- b
- public JTGLColor getBackgroundColor()
public void setBackgroundColor(JTGLColor color)
color
- public void setColor(JTGLColor color)
color
- public JTGLColor getColor()
public final void saveColor(JTGLColor color)
color
- public final void restoreColor()
protected void setColorInternal(JTGLColor color)
color
- protected abstract void setColorInternal(int argbColor)
argbColor
- public void clear(int x, int y, int width, int height, JTGLColor color)
x
- y
- width
- height
- color
- public void clear(JTGLRect rect)
rect
- public void clear(JTGLRect rect, JTGLColor color)
rect
- color
- public void clear()
public void clear(JTGLColor color)
color
- public void clear(int x, int y, int width, int height)
x
- y
- width
- height
- public void setPixel(int x, int y, JTGLColor color)
x
- y
- color
- public int getPixel(int x, int y)
x
- y
-
public abstract void drawLine(int xf, int yf, int xt, int yt)
xf
- yf
- xt
- yt
- public void drawLine(int xf, int yf, int xt, int yt, JTGLColor color)
xf
- yf
- xt
- yt
- color
- public void drawPolyLine(int[] xPoints, int[] yPoints, int offset, int nPoints, boolean closePath)
xPoints
- yPoints
- offset
- nPoints
- closePath
- public void drawPolyLine(int[] xPoints, int[] yPoints, int nPoints, boolean closePath)
xPoints
- yPoints
- nPoints
- closePath
- public void drawPolyLine(int[] xPoints, int[] yPoints, int nPoints)
xPoints
- yPoints
- nPoints
- public void drawPolygon(int[] xPoints, int[] yPoints, int offset, int nPoints)
xPoints
- yPoints
- offset
- nPoints
- public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
xPoints
- yPoints
- nPoints
- public void fillPolygon(int[] xPoints, int[] yPoints, int offset, int nPoints)
xPoints
- yPoints
- offset
- nPoints
- public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
xPoints
- yPoints
- nPoints
- public void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
x1
- y1
- x2
- y2
- x3
- y3
- public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
x1
- y1
- x2
- y2
- x3
- y3
- public void drawRect(int x, int y, int width, int height)
x
- y
- width
- height
- public void drawRect(int x, int y, int width, int height, JTGLColor color)
x
- y
- width
- height
- color
- public void drawRect(JTGLRect rect)
rect
- public void drawRect(JTGLRect rect, JTGLColor color)
rect
- color
- public abstract void fillRect(int x, int y, int width, int height)
x
- y
- width
- height
- public void fillRect(int x, int y, int width, int height, JTGLColor color)
x
- y
- width
- height
- color
- public void fillRect(JTGLRect rect)
rect
- public void fillRect(JTGLRect rect, JTGLColor color)
rect
- color
- public abstract void drawImage(JTGLImage img, int x, int y)
img
- x
- y
- public abstract void drawRegion(JTGLImage src, int x_src, int y_src, int width, int height, int x_dest, int y_dest)
src
- x_src
- y_src
- width
- height
- x_dest
- y_dest
- public abstract void copyArea(int x_src, int y_src, int width, int height, int x_dest, int y_dest)
x_src
- y_src
- width
- height
- x_dest
- y_dest
- protected void setNativeGraphics(java.lang.Object nativeGraphics)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |