Inheritance diagram for SizesChoice::
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... |
|
00023 { 00024 super(tc); 00025 } |
|
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 } |
|
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 } |