Inheritance diagram for DoubleChoice::

Public Methods | |
| DoubleChoice (TypeCode tc) | |
| String | name () |
| Name of the type. More... | |
| JComponent | inputRes () |
| Dialog component where the user specifies the parameter. More... | |
| JComponent | inputArg () |
| Dialog component where the user specifies the result. More... | |
| String | getResult (Any resAny) |
| Request management: extract result from Any (and convert it to String). More... | |
| void | setArgument (Any argsAny) throws InvalidChoiceException |
| Request management: add argument to Any. More... | |
| void | setInitialValue (Any argsAny) |
| Used to show default parameters. More... | |
| java.lang.Object | asObject (String inText) throws InvalidChoiceException |
| Returns the object introduced as that text. More... | |
|
|
00023 {
00024 super(tc);
00025 }
|
|
|
Name of the type.
Reimplemented from CorbaObjectChoice.
00028 {
00029 return "double";
00030 }
|
|
|
Dialog component where the user specifies the parameter.
Reimplemented from CorbaObjectChoice.
00033 {
00034 return null;
00035 }
|
|
|
Dialog component where the user specifies the result.
Reimplemented from CorbaObjectChoice.
00038 {
00039 if(_input == null) {
00040 _input = new JTextField("");
00041 _input.addFocusListener(new HxJava.Util.SelectOnFocus());
00042 }
00043 return _input;
00044 }
|
|
|
Request management: extract result from Any (and convert it to String).
Reimplemented from CorbaObjectChoice.
00047 {
00048 double result;
00049 result = resAny.extract_double();
00050 return ""+result;
00051 }
|
|
|
Request management: add argument to Any.
Reimplemented from CorbaObjectChoice.
00054 {
00055 Double d = (Double)asObject();
00056 argsAny.insert_double(d.doubleValue());
00057 }
|
|
|
Used to show default parameters.
Reimplemented from CorbaObjectChoice.
00060 {
00061 double result = argsAny.extract_double();
00062 _input.setText(""+result);
00063 }
|
|
|
Returns the object introduced as that text. Useful method to implement setArgument. Reimplemented from CorbaObjectChoice.
00066 {
00067 Double res = new Double(0.0);
00068 try {
00069 res = new Double(inText);
00070 }catch(NumberFormatException e) {
00071 _input.requestFocus();
00072 throw new InvalidChoiceException("Not a floating number");
00073 }
00074
00075 return res;
00076 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001