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

InquiryElement Class Reference

Inheritance diagram for InquiryElement::

MachineElement AnimatedMachine List of all members.

Public Methods

 InquiryElement ()
void keyPressed ()
void animationStep ()
boolean continueAnimation ()
void run ()

Static Public Methods

String getImageSignature (HxCorba.ImageRep image)
String getImageSize (HxCorba.ImageRep image)
String getPixelType (HxCorba.ImageRep image)
String getPixelValue (HxCorba.PixValue val)

Constructor & Destructor Documentation

InquiryElement::InquiryElement   [inline]
 

00021 {
00022     int marginLF = ImageElement.componentSize().height / 2;
00023     int marginUP = 0;
00024     int marginRG = KeyComponent.componentSize().width  / 2;
00025     int marginDW = 0;
00026     int machineW = 94;
00027     int machineH = 55;
00028 
00029     setSize(marginLF+machineW+marginRG, marginUP+machineH+marginDW);
00030 
00031     _props = new InquiryProperties();
00032     _props.reduceOp = "";
00033 
00034     _input = createInputSocket(0, marginUP + 5);
00035     //_input.addContainerListener(this);
00036     _key = createKeyComponent(marginLF+machineW-marginRG-2, marginUP + 5);
00037 
00038     setMachineImage(Images.inquiry, marginLF, marginUP, machineW, machineH);
00039 }


Member Function Documentation

void InquiryElement::keyPressed   [inline, virtual]
 

Reimplemented from AnimatedMachine.

00043 {
00044     if(_working) return;
00045 
00046     if(_input.empty()) return;
00047 
00048     _working = true;
00049     _key.startAnimation();
00050     new Thread(this).start();
00051 }

void InquiryElement::animationStep   [inline, virtual]
 

Reimplemented from AnimatedMachine.

00054 {}

boolean InquiryElement::continueAnimation   [inline, virtual]
 

Reimplemented from AnimatedMachine.

00058 {
00059     return _working;
00060 }

void InquiryElement::run   [inline]
 

00063 {
00064     HxCorba.ImageRep image = _input.getImageRep();
00065 
00066     if(image == null) {
00067         _working = false;
00068         return;
00069     }
00070 
00071     _props.signature = getImageSignature(image);
00072     _props.size = getImageSize(image);
00073     _props.pixType = getPixelType(image);
00074     _props.pixDim = image.pixelDimensionality();
00075     _props.pixPrec = image.pixelPrecision();
00076 
00077     StubInfo info = StubRepository.getStubInfo(image);
00078 
00079     _props.host = info.getItem("Host");
00080     _props.port = info.getItem("Port");
00081 
00082     _working = false;
00083     _props.show();
00084 }

String InquiryElement::getImageSignature HxCorba.ImageRep    image [inline, static]
 

00122 {
00123     String[] members = new String[15];
00124     members[0] = "SIG2DBYTE";
00125     members[1] = "SIG2DSHORT";
00126     members[2] = "SIG2DINT";
00127     members[3] = "SIG2DFLOAT";
00128     members[4] = "SIG2DDOUBLE";
00129     members[5] = "SIG2DVEC2BYTE";
00130     members[6] = "SIG2DVEC2SHORT";
00131     members[7] = "SIG2DVEC2INT";
00132     members[8] = "SIG2DVEC2FLOAT";
00133     members[9] = "SIG2DVEC2DOUBLE";
00134     members[10] = "SIG2DVEC3BYTE";
00135     members[11] = "SIG2DVEC3SHORT";
00136     members[12] = "SIG2DVEC3INT";
00137     members[13] = "SIG2DVEC3FLOAT";
00138     members[14] = "SIG2DVEC3DOUBLE";
00139 
00140     HxCorba.ImageSignature sig = image.signature();
00141     return members[sig.value()];
00142 }

String InquiryElement::getImageSize HxCorba.ImageRep    image [inline, static]
 

00145 {
00146     int d = image.dimensionality();
00147     String res = "";
00148     String sep = "";
00149     for(int i=0; i<d; i++) {
00150         res = res + sep + image.dimensionSize(i+1);
00151         sep = " x ";
00152     }
00153     return res;
00154 }

String InquiryElement::getPixelType HxCorba.ImageRep    image [inline, static]
 

00157 {
00158     String[] members = new String[2];
00159     members[0] = "INT_VALUE";
00160     members[1] = "REAL_VALUE";
00161 
00162     HxCorba.PixelT type = image.pixelType();
00163     return members[type.value()];
00164 }

String InquiryElement::getPixelValue HxCorba.PixValue    val [inline, static]
 

00167 {
00168     String result = "";
00169 
00170     if(val.discriminator() == HxCorba.PixValueTag.SI) {
00171         int res = val.scalarInt();
00172         result = ""+res;
00173     }
00174     else if(val.discriminator() == HxCorba.PixValueTag.SD) {
00175         double res = val.scalarDouble();
00176         result = ""+res;
00177     }
00178     else if(val.discriminator() == HxCorba.PixValueTag.V2I) {
00179         HxCorba.Vec2I res = val.vect2Int();
00180         result = "{"+res.x+", "+res.y+"}";
00181     }
00182     else if(val.discriminator() == HxCorba.PixValueTag.V2D) {
00183         HxCorba.Vec2D res = val.vect2Double();
00184         result = "{"+res.x+", "+res.y+"}";
00185     }
00186     else if(val.discriminator() == HxCorba.PixValueTag.V3I) {
00187         HxCorba.Vec3I res = val.vect3Int();
00188         result = "{"+res.x+", "+res.y+", "+res.z+"}";
00189     }
00190     else if(val.discriminator() == HxCorba.PixValueTag.V3D) {
00191         HxCorba.Vec3D res = val.vect3Double();
00192         result = "{"+res.x+", "+res.y+", "+res.z+"}";
00193     }
00194     else if(val.discriminator() == HxCorba.PixValueTag.CPL) {
00195         HxCorba.Complex res = val.cplx();
00196         result = "{"+res.x+(res.y>=0?"+":"")+res.y+"i}";
00197     }
00198 
00199     return result;
00200 }


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