summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Clipping.inc
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Reference Architectures and Patterns/hjp5/examples/Clipping.inc')
-rw-r--r--Master/Reference Architectures and Patterns/hjp5/examples/Clipping.inc20
1 files changed, 20 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/hjp5/examples/Clipping.inc b/Master/Reference Architectures and Patterns/hjp5/examples/Clipping.inc
new file mode 100644
index 0000000..85e6f36
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/hjp5/examples/Clipping.inc
@@ -0,0 +1,20 @@
+/* Clipping.inc */
+
+public void paint(Graphics g)
+{
+ int[] arx = {150,175,200,150};
+ int[] ary = {100,150,100,100};
+
+ g.setClip(50,50,150,80);
+ //---J
+ g.fillRect(70,40,20,80);
+ g.fillArc(30,90,60,60,225,180);
+ //---a
+ g.fillOval(100,100,40,50);
+ g.fillRect(120,100,20,50);
+ //---v
+ g.fillPolygon(arx,ary,arx.length);
+ //---a
+ g.fillOval(210,100,40,50);
+ g.fillRect(230,100,20,50);
+} \ No newline at end of file