Repared the incorrect resetting colour mark index back to 0 in getData() routine.
1.1 --- a/src/com/panayotis/jubler/subs/SubEntry.java Fri Oct 23 11:56:08 2009 +0100
1.2 +++ b/src/com/panayotis/jubler/subs/SubEntry.java Fri Oct 23 19:38:18 2009 +0100
1.3 @@ -97,7 +97,7 @@
1.4 };
1.5 protected Time start, finish, duration;
1.6 protected String subtext;
1.7 - protected int mark;
1.8 + private int mark;
1.9 protected SubStyle style;
1.10 /** The following parameter is lazily used. It is initialized only when data
1.11 * are needed to be added.
1.12 @@ -108,7 +108,7 @@
1.13 this.start = new Time(start);
1.14 this.finish = new Time(finish);
1.15 this.subtext = line;
1.16 - mark = 0;
1.17 + setMark(0);
1.18 style = null;
1.19 }
1.20
1.21 @@ -116,13 +116,13 @@
1.22 this.start = new Time(start);
1.23 this.finish = new Time(finish);
1.24 this.subtext = line;
1.25 - mark = 0;
1.26 + setMark(0);
1.27 style = null;
1.28 }
1.29
1.30 public SubEntry(SubEntry old) {
1.31 this(old.getStartTime(), old.getFinishTime(), new String(old.getText()));
1.32 - mark = old.mark;
1.33 + setMark(old.mark);
1.34 style = old.style;
1.35 if (old.overstyle != null) {
1.36 overstyle = new AbstractStyleover[old.overstyle.length];
1.37 @@ -187,14 +187,6 @@
1.38 return start.compareTo(other.start);
1.39 }
1.40
1.41 - public void setMark(int i) {
1.42 - mark = i;
1.43 - }
1.44 -
1.45 - public int getMark() {
1.46 - return mark;
1.47 - }
1.48 -
1.49 public void setStyle(SubStyle th) {
1.50 style = th;
1.51 }
1.52 @@ -255,9 +247,7 @@
1.53 if (this.hasDuration()) {
1.54 if (this.isDurationSmall()) {
1.55 this.setMark(4); //Orange
1.56 - } else {
1.57 - this.setMark(0); //White
1.58 - }
1.59 + }//end if (this.isDurationSmall())
1.60 return duration.toString();
1.61 } else {
1.62 return "";
1.63 @@ -417,7 +407,7 @@
1.64 setMark(attr.getMaxColor());
1.65 return true;
1.66 }
1.67 - if (mark == attr.getMaxColor()) {
1.68 + if (getMark() == attr.getMaxColor()) {
1.69 setMark(0);
1.70 }
1.71 }
1.72 @@ -445,7 +435,7 @@
1.73 if (subtext != null) {
1.74 new_sub.subtext = new String(subtext);
1.75 }
1.76 - new_sub.mark = mark;
1.77 + new_sub.setMark(getMark());
1.78 new_sub.style = style;
1.79 if (overstyle != null) {
1.80 new_sub.overstyle = new AbstractStyleover[overstyle.length];
1.81 @@ -480,7 +470,7 @@
1.82 if (o.subtext != null) {
1.83 subtext = new String(o.getText());
1.84 }
1.85 - mark = o.mark;
1.86 + setMark(o.getMark());
1.87 style = o.style;
1.88 if (o.overstyle != null) {
1.89 int len = o.overstyle.length;
1.90 @@ -1157,5 +1147,38 @@
1.91 return null;
1.92 }
1.93 }//end public BufferedImage makeSubtitleTextImage()
1.94 +
1.95 + /**
1.96 + * @return the mark
1.97 + */
1.98 + public int getMark() {
1.99 + return mark;
1.100 + }
1.101 +
1.102 + /**
1.103 + * @param mark the mark to set
1.104 + */
1.105 + public void setMark(int mark) {
1.106 + /* debugging code
1.107 + boolean is_low_to_high = false;
1.108 + boolean is_high_to_low = false;
1.109 +
1.110 + int old_mark = this.mark;
1.111 + int new_mark = mark;
1.112 +
1.113 + boolean is_changed = (old_mark != new_mark);
1.114 + if (is_changed){
1.115 + is_low_to_high = (old_mark < new_mark);
1.116 + is_high_to_low = (old_mark > new_mark);
1.117 + }*/
1.118 + this.mark = mark;
1.119 + /* debugging code
1.120 + if (is_changed && is_high_to_low){
1.121 + System.out.println("Mark is changed from high to low");
1.122 + }
1.123 + if (is_changed && is_low_to_high){
1.124 + System.out.println("Mark is changed from low to high");
1.125 + }*/
1.126 + }
1.127 }//end public class SubEntry implements Comparable<SubEntry>, Cloneable, CommonDef
1.128