Mercurial > MadButterfly
annotate Android/java/org/madbutterfly/coord.java @ 493:1b6228092a57 Android_Skia
Java code for MadButterfly JNI.
This is Java code that access MadButterfly JNI interface.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 26 Nov 2009 15:02:51 +0800 |
parents | |
children | 2d7df44e6299 |
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 |
1b6228092a57
Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
5 class coord { |
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 } |