Mercurial > MadButterfly
annotate Android/java/org/madbutterfly/coord.java @ 502:a53fc3eff8f1 Android_Skia
Every static native method has the 2rd argument as class object.
Second argument of a static native method is passed as the class
object that the method belong to.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 01 Dec 2009 22:55:26 +0800 |
parents | 2d7df44e6299 |
children | c468e397614d |
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 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
4 |
499 | 5 public class coord { |
493
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
6 protected int addr; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
7 redraw_man rdman; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
8 public ArrayList children; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
9 public ArrayList members; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
10 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
11 public coord(redraw_man rdman, int addr) { |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
12 this.addr = addr; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
13 this.rdman = rdman; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
14 children = new ArrayList(); |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
15 members = new ArrayList(); |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
16 } |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
17 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
18 protected void invalid() { |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
19 addr = 0; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
20 } |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
21 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
22 protected void finalize() { |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
23 if(addr != 0) |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
24 _jni.rdman_coord_free(rdman._rdman_addr, addr); |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
25 } |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
26 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
27 public void add_shape(shape member) { |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
28 _jni.rdman_add_shape(rdman._rdman_addr, member.addr, addr); |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
29 members.add(member); |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
30 member.parent = this; |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
31 } |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
32 } |