Fix bug in setBinValue when the value isn't a float.

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@96 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
drees 2006-07-06 08:24:21 +00:00
parent 4b4c773944
commit 7685df0ee2
1 changed files with 13 additions and 14 deletions

View File

@ -85,20 +85,19 @@ public class DataCell extends JLabel implements MouseListener, Serializable {
}
public void setBinValue(double binValue) {
this.binValue = binValue;
// make sure it's in range
if (table.getStorageType() != Table.STORAGE_TYPE_FLOAT) {
if (binValue < 0) {
this.setBinValue(0);
} else if (binValue > Math.pow(256, table.getStorageType()) - 1) {
this.setBinValue((int)(Math.pow(256, table.getStorageType()) - 1));
}
binValue = Math.round(binValue);
}
this.updateDisplayValue();
}
// make sure it's in range
if (table.getStorageType() != Table.STORAGE_TYPE_FLOAT) {
if (binValue < 0) {
this.setBinValue(0);
} else if (binValue > Math.pow(256, table.getStorageType()) - 1) {
this.setBinValue((int)(Math.pow(256, table.getStorageType()) - 1));
}
binValue = Math.round(binValue);
}
this.binValue = binValue;
this.updateDisplayValue();
}
public double getBinValue() {
return binValue;