7 private static int ROWS = 3;
14 public void getValue(
float[] value)
throws ArrayIndexOutOfBoundsException {
17 StringTokenizer tokens;
19 if (value.length < ROWS) {
20 throw new ArrayIndexOutOfBoundsException(
"SFColor getValue passed array of insufficient length");
24 rep = browser.SendEventOut(nodePtr, offset, datasize, dataType,
command);
25 tokens =
new StringTokenizer(rep);
27 tokens =
new StringTokenizer(RLreturn);
30 for (count = 0; count < ROWS; count++) {
31 value[count] = Float.valueOf(tokens.nextToken()).floatValue();
35 public void setValue(
float[] value)
throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
37 if (value.length < ROWS) {
38 throw new ArrayIndexOutOfBoundsException(
"SFColor setValue passed degenerate colour value");
40 for (count = 0; count < ROWS; count++) {
41 if ((value[count] < 0) || (value[count] > 1)) {
42 throw new IllegalArgumentException(
"SFColor setValue passed invalid colour value");
45 browser.newSendEvent(
this,
"" + value[0] +
" " + value[1] +
" " + value[2]);