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

TextElement Class Reference

Inheritance diagram for TextElement::

MachineElement List of all members.

Public Methods

 TextElement ()
void paintMachine (Graphics g, ImageObserver o)
void runMachine ()
void run ()
boolean animationStep ()

Constructor & Destructor Documentation

TextElement::TextElement   [inline]
 

00022     {
00023         super(0,0);
00024 
00025         MARGIN_LF = 0;
00026         MARGIN_UP = 0;
00027         MARGIN_RG = rectangleKeyPos(0,0).width / 2;
00028         MARGIN_DW = 0;
00029 
00030         WIDTH = 123;
00031         HEIGHT = 84;
00032 
00033         keyPos = rectangleKeyPos(MARGIN_LF+WIDTH-MARGIN_RG, MARGIN_UP + 15);
00034         flagPos = new Point(MARGIN_LF+18, MARGIN_UP+28);
00035 
00036         //try {
00037         //    org.omg.CORBA.Object obj =
00038         //        orb.resolve_initial_references("NameJan");
00039         //    ns = NamingContextHelper.narrow(obj);
00040         //}catch(Exception e) {
00041             ns = null;
00042         //}
00043         if(ns == null) off = true;
00044     }


Member Function Documentation

void TextElement::paintMachine Graphics    g,
ImageObserver    o
[inline]
 

00047     {
00048         if(flag != null)
00049             g.drawImage(flag, flagPos.x, flagPos.y, o);
00050         if(newFlag != null)
00051             g.drawImage(newFlag, flagPos.x, flagPos.y-height, o);
00052         g.drawImage(Images.text, MARGIN_LF, MARGIN_UP, o);
00053     }

void TextElement::runMachine   [inline]
 

00057     {
00058         TextProp dlg = new TextProp();
00059         dlg.show();
00060         if(dlg.text != null) {
00061             text = dlg.text;
00062             busy = true;
00063             startAnimation();
00064             Thread t = new Thread(this);
00065             t.start();
00066         }
00067     }

void TextElement::run   [inline]
 

00071     {
00072         //String[] names = {"fr", "it", "en", "nl", "de"};
00073 
00074         NameComponent[] path = { new NameComponent("languageID", "") };
00075         try {
00076             org.omg.CORBA.Object obj = ns.resolve(path);
00077             //Lid.Classify cls = Lid.ClassifyHelper.narrow(obj);
00078             //String out = cls.ClassifyLanguage(text);
00079             //WorldApp.message(out);
00080             //out = out.substring(0,2);
00081             //height = 25;
00082             //flag = newFlag;
00083             //newFlag = Images.flag(out);
00084         }catch(NotFound err){
00085             WorldApp.message("Can not find Language Classifier");
00086         }catch(Exception err){
00087             WorldApp.message("Error! "+err+"\n");
00088             err.printStackTrace();
00089         }
00090 
00091         busy = false;
00092     }

boolean TextElement::animationStep   [inline]
 

00095     {
00096         height = Math.max(height-5, 0);
00097         return busy || (height > 0);
00098     }


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