Mercurial > MadButterfly
annotate Android/java/org/madbutterfly/shape.java @ 1461:31189b5d832a
Add document
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Sun, 17 Apr 2011 01:08:26 +0800 |
parents | c468e397614d |
children |
rev | line source |
---|---|
493
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
1 package org.madbutterfly; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
2 |
499 | 3 public class shape { |
493
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
4 protected int addr; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
5 redraw_man rdman; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
6 protected coord parent; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
7 protected paint stroke, fill; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
8 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
9 public shape(redraw_man rdman, int addr) { |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
10 this.addr = addr; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
11 this.rdman = rdman; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
12 this.parent = null; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
13 stroke = fill = null; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
14 } |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
15 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
16 protected void invalid() { |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
17 addr = 0; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
18 } |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
19 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
20 protected void finalize() { |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
21 if(addr != 0) |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
22 _jni.rdman_shape_free(rdman._rdman_addr, addr); |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
23 } |
505
c468e397614d
Fix issue of initialize rdman and add shape::stroke_width().
Thinker K.F. Li <thinker@branda.to>
parents:
499
diff
changeset
|
24 |
c468e397614d
Fix issue of initialize rdman and add shape::stroke_width().
Thinker K.F. Li <thinker@branda.to>
parents:
499
diff
changeset
|
25 public void set_stroke_width(float w) { |
c468e397614d
Fix issue of initialize rdman and add shape::stroke_width().
Thinker K.F. Li <thinker@branda.to>
parents:
499
diff
changeset
|
26 _jni.sh_set_stroke_width(addr, w); |
c468e397614d
Fix issue of initialize rdman and add shape::stroke_width().
Thinker K.F. Li <thinker@branda.to>
parents:
499
diff
changeset
|
27 } |
493
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
28 } |