17 package com.generalrobotix.ui.view.graph;
19 import java.util.StringTokenizer;
20 import java.text.DecimalFormat;
21 import javax.vecmath.*;
29 value_ =
new Vector3d();
30 df_ =
new DecimalFormat(
"0.####");
34 value_ =
new Vector3d();
36 df_ =
new DecimalFormat(
"0.####");
40 value_ =
new Vector3d();
42 df_ =
new DecimalFormat(
"0.####");
46 value_ =
new Vector3d();
48 df_ =
new DecimalFormat(
"0.####");
52 value_ =
new Vector3d();
54 df_ =
new DecimalFormat(
"0.####");
58 value_ =
new Vector3d();
60 df_ =
new DecimalFormat(
"0.####");
64 value_ =
new Vector3d();
66 df_ =
new DecimalFormat(
"0.####");
71 value_ =
new Vector3d();
77 for (
int i = 0;
i < 3;
i ++) {
80 }
else if (value[
i].isInfinite()) {
86 value[0].doubleValue(),
87 value[1].doubleValue(),
88 value[2].doubleValue()
95 for (
int i = 0;
i < 3;
i ++) {
96 if (Double.isNaN(value[
i])) {
98 }
else if (Double.isInfinite(value[i])) {
109 for (
int i = 0;
i < 3;
i ++) {
110 if (Double.isNaN(value[
i])) {
112 }
else if (Double.isInfinite(value[i])) {
116 value_.set((
double)value[0], (
double)value[1], (
double)value[2]);
120 if (Double.isNaN(x) || Double.isNaN(y) || Double.isNaN(z)){
129 if (isNaN_) {
return ""; }
130 StringBuffer strBuf =
new StringBuffer();
132 strBuf.append(df_.format(value_.x));
134 strBuf.append(df_.format(value_.y));
136 strBuf.append(df_.format(value_.z));
138 return strBuf.toString();
142 if (str.equals(
"")) {
147 StringTokenizer token =
new StringTokenizer(str);
149 Double[] doubleArray =
new Double[3];
152 for (
int i = 0;
i < 3;
i ++) {
153 if (token.hasMoreTokens()) {
154 String
value = token.nextToken();
155 if (value.equals(
"NaN")) {
157 doubleArray[
i] =
new Double(Double.NaN);
160 doubleArray[
i] =
new Double(value);
161 }
catch (NumberFormatException ex) {
164 if (doubleArray[
i].
isNaN()) {
166 }
else if (doubleArray[
i].isInfinite()) {
175 if (token.hasMoreTokens()) {
180 doubleArray[0].doubleValue(),
181 doubleArray[1].doubleValue(),
182 doubleArray[2].doubleValue()
185 return (Object)value_;
189 value_.set((Vector3d)value);
201 return (Object)value_;
216 public boolean isNaN() {
return isNaN_; }
SETranslation(double x, double y, double z)
#define null
our own NULL pointer
Object fromString(String str)
void setValue(String str)
SETranslation(String value)
void setValue(float value[])
void setValue(Double value[])
void setValue(Object value)
SETranslation(DecimalFormat df)
void setValue(double x, double y, double z)
void setValue(Vector3d value)
SETranslation(double[] value)
SETranslation(Double[] value)
SETranslation(float[] value)
void setValue(double value[])
SETranslation(Vector3d value)