Fixed CEL fix table inheritance not working properly

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@317 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
Jared Gould 2006-10-30 20:40:09 +00:00
parent 9363146600
commit 20f84bdc69
2 changed files with 20 additions and 2 deletions

View File

@ -79,6 +79,15 @@ public class TableSwitch extends Table {
}
}
public String getOnValues() {
StringBuffer values = new StringBuffer();
for (int i = 0; i < on.length; i++) {
values.append(on[i]);
if (i < on.length) values.append(" ");
}
return values+"";
}
public void setOffValues(String input) {
StringTokenizer tokens = new StringTokenizer(input);
for (int i = 0; i < off.length; i++) {
@ -86,6 +95,15 @@ public class TableSwitch extends Table {
}
}
public String getOffValues() {
StringBuffer values = new StringBuffer();
for (int i = 0; i < off.length; i++) {
values.append(off[i]);
if (i < off.length) values.append(" ");
}
return values+"";
}
public Dimension getFrameSize() {
int height = verticalOverhead + 75;
int width = horizontalOverhead;

View File

@ -445,10 +445,10 @@ public final class DOMRomUnmarshaller {
} else if (n.getNodeName().equalsIgnoreCase("state")) {
// set on/off values for switch type
if (unmarshallAttribute(n, "name", "").equalsIgnoreCase("on")) {
((TableSwitch) table).setOnValues(unmarshallAttribute(n, "data", "0"));
((TableSwitch) table).setOnValues(unmarshallAttribute(n, "data", ((TableSwitch)table).getOnValues()));
} else if (unmarshallAttribute(n, "name", "").equalsIgnoreCase("off")) {
((TableSwitch) table).setOffValues(unmarshallAttribute(n, "data", "0"));
((TableSwitch) table).setOffValues(unmarshallAttribute(n, "data", ((TableSwitch)table).getOffValues()));
}