annotate Android/java/org/madbutterfly/shape.java @ 880:ac3e8492ad74 abs_n_rel_center

Formalize path data for MadButterfly. Inkscape and other editors would omit 'l' or 'L' after 'm' or 'M'. MadButterfly can not handle it, now. So, we work around it at SVG parser.
author Thinker K.F. Li <thinker@codemud.net>
date Sat, 25 Sep 2010 18:46:37 +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
2d7df44e6299 Make classes public
Thinker K.F. Li <thinker@branda.to>
parents: 493
diff changeset
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 }