Horus Doc || Java GUI Reference || Doxygen's quick Index  

DoubleChoice Class Reference

A CorbaObjectChoice for double's. More...

Inheritance diagram for DoubleChoice::

CorbaObjectChoice List of all members.

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...


Detailed Description

A CorbaObjectChoice for double's.


Constructor & Destructor Documentation

DoubleChoice::DoubleChoice TypeCode    tc [inline]
 

00023 {
00024     super(tc);
00025 }


Member Function Documentation

String DoubleChoice::name   [inline, virtual]
 

Name of the type.

Reimplemented from CorbaObjectChoice.

00028 {
00029     return "double";
00030 }

JComponent DoubleChoice::inputRes   [inline, virtual]
 

Dialog component where the user specifies the parameter.

Reimplemented from CorbaObjectChoice.

00033 {
00034     return null;
00035 }

JComponent DoubleChoice::inputArg   [inline, virtual]
 

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 }

String DoubleChoice::getResult Any    resAny [inline, virtual]
 

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 }

void DoubleChoice::setArgument Any    argsAny [inline, virtual]
 

Request management: add argument to Any.

Reimplemented from CorbaObjectChoice.

00054 {
00055     Double d = (Double)asObject();
00056     argsAny.insert_double(d.doubleValue());
00057 }

void DoubleChoice::setInitialValue Any    argsAny [inline]
 

Used to show default parameters.

Reimplemented from CorbaObjectChoice.

00060 {
00061     double result = argsAny.extract_double();
00062     _input.setText(""+result);
00063 }

java.lang.Object DoubleChoice::asObject String    inText [inline, virtual]
 

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 }


The documentation for this class was generated from the following file:
Generated on Tue Feb 3 14:19:43 2004 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001