-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathgraphics.txt
More file actions
120 lines (108 loc) · 6.13 KB
/
graphics.txt
File metadata and controls
120 lines (108 loc) · 6.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Classes requiring implementation for Graphics2D
Panels and Canvases will be passed a Graphics2D object in their paint method.
Other JComponents, such as buttons, must explicitly declare a request for a
transparent foreground graphics to write into. Without that, the paint method's
Graphics object will be null.
/**
* @j2sNative
*
* SwingJS.createGraphics(this);
*
*/
{}
Fonts will be backed by a hidden canvas that will be part of their FontMetrics and
will allow checking of string width and height characteristics.
The implemented Graphics2D will include an HTML5 canvas along with its 2D context.
Some of these methods may not be fully implemented.
Mouse events will be delivered the same as in Java.
public abstract class Graphics2D extends Graphics {
public abstract AffineTransform getTransform();
public abstract boolean drawImage(Image img, AffineTransform xform, ImageObserver obs);
public abstract boolean hit(Rectangle rect, Shape s, boolean onStroke);
public abstract Color getBackground();
public abstract FontRenderContext getFontRenderContext();
public abstract GraphicsConfiguration getDeviceConfiguration();
public abstract Object getRenderingHint(RenderingHints.Key hintKey);
public abstract Paint getPaint();
public abstract RenderingHints getRenderingHints();
public abstract Stroke getStroke();
public abstract void addRenderingHints(Map<?, ?> hints);
public abstract void clip(Shape s);
public abstract void draw(Shape s);
public abstract void drawImage(BufferedImage img, BufferedImageOp op, int x, int y);
public abstract void drawRenderableImage(RenderableImage img, AffineTransform xform);
public abstract void drawRenderedImage(RenderedImage img, AffineTransform xform);
public abstract void drawString(AttributedCharacterIterator iterator, float x, float y);
public abstract void drawString(AttributedCharacterIterator iterator, int x, int y);
public abstract void drawString(String str, float x, float y);
public abstract void drawString(String str, int x, int y);
public abstract void fill(Shape s);
public abstract void rotate(double theta);
public abstract void rotate(double theta, double x, double y);
public abstract void scale(double sx, double sy);
public abstract void setBackground(Color color);
public abstract void setPaint(Paint paint);
public abstract void setRenderingHint(Key hintKey, Object hintValue);
public abstract void setRenderingHints(Map<?, ?> hints);
public abstract void setStroke(Stroke s);
public abstract void setTransform(AffineTransform Tx);
public abstract void shear(double shx, double shy);
public abstract void transform(AffineTransform Tx);
public abstract void translate(double tx, double ty);
public abstract void translate(int x, int y);
public void draw3DRect(int x, int y, int width, int height, boolean raised)
public void fill3DRect(int x, int y, int width, int height, boolean raised)
}
public abstract class Graphics {
public abstract boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor,
ImageObserver observer);
public abstract boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer);
public abstract boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer);
public abstract boolean drawImage(Image img, int x, int y, ImageObserver observer);
public abstract boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer);
public abstract boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer);
public abstract Color getColor();
public abstract Font getFont();
public abstract FontMetrics getFontMetrics(Font f);
public abstract Graphics create();
public abstract Rectangle getClipBounds();
public abstract Shape getClip();
public abstract void clearRect(int x, int y, int width, int height);
public abstract void clipRect(int x, int y, int width, int height);
public abstract void copyArea(int x, int y, int width, int height, int dx, int dy);
public abstract void dispose();
public abstract void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle);
public abstract void drawLine(int x1, int y1, int x2, int y2);
public abstract void drawOval(int x, int y, int width, int height);
public abstract void drawPolygon(int xPoints[], int yPoints[], int nPoints);
public abstract void drawPolyline(int xPoints[], int yPoints[], int nPoints);
public abstract void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight);
public abstract void drawString(AttributedCharacterIterator iterator, int x, int y);
public abstract void drawString(String str, int x, int y);
public abstract void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle);
public abstract void fillOval(int x, int y, int width, int height);
public abstract void fillPolygon(int xPoints[], int yPoints[], int nPoints);
public abstract void fillRect(int x, int y, int width, int height);
public abstract void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight);
public abstract void setClip(int x, int y, int width, int height);
public abstract void setClip(Shape clip);
public abstract void setColor(Color c);
public abstract void setFont(Font font);
public abstract void setPaintMode();
public abstract void setXORMode(Color c1);
public abstract void translate(int x, int y);
public boolean hitClip(int x, int y, int width, int height)
public FontMetrics getFontMetrics()
public Graphics create(int x, int y, int width, int height)
public Rectangle getClipBounds(Rectangle r)
public Rectangle getClipRect()
public String toString()
public void draw3DRect(int x, int y, int width, int height, boolean raised)
public void drawBytes(byte data[], int offset, int length, int x, int y)
public void drawChars(char data[], int offset, int length, int x, int y)
public void drawPolygon(Polygon p)
public void drawRect(int x, int y, int width, int height)
public void fill3DRect(int x, int y, int width, int height, boolean raised)
public void fillPolygon(Polygon p)
public void finalize()
}