|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.pograss.PoGraSS org.rosuda.pograss.PoGraSSgraphics
public class PoGraSSgraphics
Portable Graphics SubSystem - Graphics implementation
Field Summary | |
---|---|
java.awt.Graphics2D |
g
associated graphics context |
Fields inherited from class org.rosuda.pograss.PoGraSS |
---|
FA_Bold, FA_Ital, FA_MASK_Type, FA_Normal, FF_Mono, FF_SansSerif, FF_Serif, localLayerCache, TA_Center, TA_Left, TA_MASK_Or, TA_Right, version, versionString |
Constructor Summary | |
---|---|
PoGraSSgraphics(java.awt.Graphics2D G)
construct an instance of PoGraSS associated with a Graphics , paint all layers |
|
PoGraSSgraphics(java.awt.Graphics2D G,
int layer)
construct an instance of PoGraSS associated with a Graphics . |
Method Summary | |
---|---|
void |
begin()
|
void |
defineColor(java.lang.String nam,
float r,
float g,
float b,
float a)
|
void |
defineColor(java.lang.String nam,
int R,
int G,
int B)
In this defineColor implementation we're bad, because we ignore any colors that exceed our initial 128 colors limit. it would be fairly easy to use Vector for storage instead of fixed arrays, but well, there was no need for bigger color tables (yet). |
void |
drawArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
|
void |
drawImage(PoGraSSimage img,
int x1,
int y1,
int x2,
int y2)
|
void |
drawLine(int x1,
int y1,
int x2,
int y2)
|
void |
drawOval(int x,
int y,
int rx,
int ry)
|
void |
drawPolygon(int[] x,
int[] y,
int pts,
boolean closed)
|
void |
drawRect(int x1,
int y1,
int x2,
int y2)
|
void |
drawRoundRect(int x1,
int y1,
int x2,
int y2,
int dx,
int dy)
|
void |
drawString(java.lang.String txt,
int x,
int y)
|
void |
drawString(java.lang.String txt,
int x,
int y,
double ax,
double ay)
draw string with anchor point x,y where ax and ay translate the anchor relative to text extension. |
void |
drawString(java.lang.String txt,
int x,
int y,
double ax,
double ay,
double rot)
addition: rot specifies rotation angle around the anchor. negative values additionally flip the text on the horizontal axis of the text. |
void |
drawString(java.lang.String txt,
int x,
int y,
int a)
draw string with special attributes set (e.g. alignment etc.) |
void |
end()
|
void |
fillArc(int x,
int y,
int width,
int height,
int startAngle,
int arcAngle)
|
void |
fillOval(int x,
int y,
int rx,
int ry)
|
void |
fillPolygon(int[] x,
int[] y,
int pts)
|
void |
fillRect(int x1,
int y1,
int x2,
int y2)
|
void |
fillRoundRect(int x1,
int y1,
int x2,
int y2,
int dx,
int dy)
|
int |
getHeightEstimate(java.lang.String s)
|
int |
getWidthEstimate(java.lang.String s)
|
void |
lineTo(int x,
int y)
|
void |
moveTo(int x,
int y)
|
void |
nextLayer()
|
void |
resetClip()
|
void |
resetGlobalAlpha()
|
void |
setClip(int x,
int y,
int width,
int height)
|
void |
setColor(float r,
float gr,
float b,
float a)
|
void |
setColor(int R,
int G,
int B)
|
void |
setColor(java.lang.String nam)
|
void |
setColor(java.lang.String nam,
float alpha)
|
void |
setFontFace(int face)
set font face by style |
void |
setFontSize(double pt)
|
void |
setFontStyle(int attr)
|
void |
setGlobalAlpha(float alpha)
|
void |
setLineWidth(float w)
|
void |
setOptionalFace(java.lang.String name)
set optional font face. the underlying system will use the face only if it's available. |
Methods inherited from class org.rosuda.pograss.PoGraSS |
---|
addComment, beginAlphaBlock, drawPolygon, drawPolyline, endAlphaBlock, fallbackAlpha, getBounds, internalSupportsAlpha, nextObject, nextObject, oval, passVersionInfo, polygon, rect, roundRect, setBounds, setBounds, setBrushColor, setBrushColor, setBrushColor, setBrushColor, setColor, setFillStyle, setFontFace, setOutPrintStream, setPenColor, setPenColor, setPenColor, setPenColor, setTitle, useJointColors |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.awt.Graphics2D g
Constructor Detail |
---|
public PoGraSSgraphics(java.awt.Graphics2D G, int layer)
PoGraSS
associated with a Graphics
.
G
- associated Graphicslayer
- layer to paint or -1 if allpublic PoGraSSgraphics(java.awt.Graphics2D G)
PoGraSS
associated with a Graphics
, paint all layers
G
- associated GraphicsMethod Detail |
---|
public void defineColor(java.lang.String nam, int R, int G, int B)
Keep in mind, that the user can use any number of colors by using
setColor(int,int,int)
. the defineColor principle is meant just to
define a fixed set of few colors used frequently throughout the application.
defineColor
in class PoGraSS
public void defineColor(java.lang.String nam, float r, float g, float b, float a)
defineColor
in class PoGraSS
public void setColor(java.lang.String nam, float alpha)
setColor
in class PoGraSS
public void setColor(float r, float gr, float b, float a)
setColor
in class PoGraSS
public void setColor(int R, int G, int B)
setColor
in class PoGraSS
public void setColor(java.lang.String nam)
setColor
in class PoGraSS
public void drawLine(int x1, int y1, int x2, int y2)
drawLine
in class PoGraSS
public void moveTo(int x, int y)
moveTo
in class PoGraSS
public void lineTo(int x, int y)
lineTo
in class PoGraSS
public void drawRect(int x1, int y1, int x2, int y2)
drawRect
in class PoGraSS
public void fillRect(int x1, int y1, int x2, int y2)
fillRect
in class PoGraSS
public void drawImage(PoGraSSimage img, int x1, int y1, int x2, int y2)
drawImage
in class PoGraSS
public void drawRoundRect(int x1, int y1, int x2, int y2, int dx, int dy)
drawRoundRect
in class PoGraSS
public void fillRoundRect(int x1, int y1, int x2, int y2, int dx, int dy)
fillRoundRect
in class PoGraSS
public void drawOval(int x, int y, int rx, int ry)
drawOval
in class PoGraSS
public void fillOval(int x, int y, int rx, int ry)
fillOval
in class PoGraSS
public void drawString(java.lang.String txt, int x, int y)
drawString
in class PoGraSS
public void drawString(java.lang.String txt, int x, int y, int a)
PoGraSS
drawString
in class PoGraSS
public void drawString(java.lang.String txt, int x, int y, double ax, double ay)
PoGraSS
drawString
in class PoGraSS
public void drawString(java.lang.String txt, int x, int y, double ax, double ay, double rot)
PoGraSS
drawString
in class PoGraSS
public void drawPolygon(int[] x, int[] y, int pts, boolean closed)
drawPolygon
in class PoGraSS
public void fillPolygon(int[] x, int[] y, int pts)
fillPolygon
in class PoGraSS
public void setFontFace(int face)
PoGraSS
setFontFace
in class PoGraSS
public void setOptionalFace(java.lang.String name)
PoGraSS
PoGraSS.setFontFace(int)
and refine this selection by
setting optional face. It is not guaranteed that this face will be used, keep it in mind.
example: setFontFace(FF_SansSerif); setOptionalFont("Helvetica"); setOptionalFont("Myriad");
setOptionalFace
in class PoGraSS
public void setFontSize(double pt)
setFontSize
in class PoGraSS
public void setFontStyle(int attr)
setFontStyle
in class PoGraSS
public void nextLayer()
nextLayer
in class PoGraSS
public void begin()
begin
in class PoGraSS
public void end()
end
in class PoGraSS
public int getWidthEstimate(java.lang.String s)
getWidthEstimate
in class PoGraSS
public int getHeightEstimate(java.lang.String s)
getHeightEstimate
in class PoGraSS
public void setGlobalAlpha(float alpha)
setGlobalAlpha
in class PoGraSS
public void resetGlobalAlpha()
resetGlobalAlpha
in class PoGraSS
public void setLineWidth(float w)
setLineWidth
in class PoGraSS
public void resetClip()
resetClip
in class PoGraSS
public void setClip(int x, int y, int width, int height)
setClip
in class PoGraSS
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
drawArc
in class PoGraSS
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
fillArc
in class PoGraSS
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |