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

SizesChoice Class Reference

A CorbaObjectChoice for Sizes's. More...

Inheritance diagram for SizesChoice::

StructChoice CorbaObjectChoice List of all members.

Public Methods

 SizesChoice (org.omg.CORBA.TypeCode tc)
JComponent inputArg ()
 Dialog component where the user specifies the result. More...

java.lang.Object asObject (String inText) throws InvalidChoiceException
 Returns the object introduced as that text. More...


Detailed Description

A CorbaObjectChoice for Sizes's.


Constructor & Destructor Documentation

SizesChoice::SizesChoice org.omg.CORBA.TypeCode    tc [inline]
 

00023 {
00024     super(tc);
00025 }


Member Function Documentation

JComponent SizesChoice::inputArg   [inline, virtual]
 

Dialog component where the user specifies the result.

Reimplemented from StructChoice.

00028 {
00029     if(_input == null) {
00030         _input = (JComboBox)super.inputArg();
00031         _input.addItem("0 0");
00032         _input.addItem("1 1");
00033         _input.addItem("255 255");
00034 
00035         _input.setEditable(true);
00036         _input.getEditor().getEditorComponent().addFocusListener(new HxJava.Util.SelectOnFocus());
00037         _input.setSelectedIndex(0);
00038     }
00039     return _input;
00040 }

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

Returns the object introduced as that text.

Useful method to implement setArgument.

Reimplemented from StructChoice.

00043 {
00044     int index = inText.indexOf(" ");
00045     if(index == -1) return super.asObject(inText);
00046 
00047     HxCorba.Sizes res = null;
00048     try {
00049         HxCorba.PixValue val = PixValueChoice.getPixValue(inText);
00050         if(val.discriminator() == HxCorba.PixValueTag.V2I) {
00051             HxCorba.Vec2I val2I = val.vect2Int();
00052             res = new HxCorba.Sizes(val2I.x, val2I.y, 1);
00053         }
00054     }
00055     catch(InvalidChoiceException ex) {}
00056 
00057     if(res == null) {
00058         _input.requestFocus();
00059         throw new InvalidChoiceException("Wrong sizes");
00060     }
00061 
00062     return res;
00063 }


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:26 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001