annotate Android/java/org/madbutterfly/coord.java @ 528:d687d3395264 Android_Skia

Clear variables and draw root coord. Although root coord is never in zeroing list, now, it still need to be redrawed after redrawing other zeroed coords.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 23 Dec 2009 10:33:51 +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
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
2d7df44e6299 Make classes public
Thinker K.F. Li <thinker@branda.to>
parents: 493
diff changeset
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;
505
c468e397614d Fix issue of initialize rdman and add shape::stroke_width().
Thinker K.F. Li <thinker@branda.to>
parents: 499
diff changeset
31 _jni.rdman_coord_changed(rdman._rdman_addr, addr);
c468e397614d Fix issue of initialize rdman and add shape::stroke_width().
Thinker K.F. Li <thinker@branda.to>
parents: 499
diff changeset
32 _jni.rdman_shape_changed(rdman._rdman_addr, member.addr);
493
1b6228092a57 Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
33 }
1b6228092a57 Java code for MadButterfly JNI.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
34 }