Inheritance diagram for LoadElement::

Public Methods | |
| LoadElement () | |
| void | keyPressed () |
| void | animationStep () |
| boolean | continueAnimation () |
| void | run () |
Protected Methods | |
| void | doInit () |
|
|
00026 {
00027 int marginLF = 0;
00028 int marginUP = 0;
00029 int marginRG = Math.max(KeyComponent.componentSize().width / 2,
00030 ImageElement.componentSize().width / 2);
00031 int marginDW = 0;
00032 int machineW = 101;
00033 int machineH = 122;
00034
00035 setSize(marginLF+machineW+marginRG, marginUP+machineH+marginDW);
00036 setMachineImage(Images.loader, marginLF, marginUP, machineW, machineH);
00037
00038 _output = createOutputSocket(
00039 marginLF+machineW-ImageElement.componentSize().width/2,
00040 marginUP + 66);
00041 _key = createKeyComponent(
00042 marginLF+machineW-KeyComponent.componentSize().width/2 - 2,
00043 marginUP + 8);
00044
00045 _key.setVisible(false);
00046 }
|
|
|
Reimplemented from AnimatedMachine.
00050 {
00051 if(_working) return;
00052
00053 if(!_output.empty()) return;
00054
00055 LoadProperties dlg = new LoadProperties();
00056 dlg.show();
00057 if(dlg.name != null) {
00058 //_imageMgr = getManager(dlg.server);
00059 _imageName = dlg.name;
00060
00061 _working = true;
00062 _key.startAnimation();
00063 new Thread(this).start();
00064 }
00065 }
|
|
|
Reimplemented from AnimatedMachine.
00069 {
00070 }
|
|
|
Reimplemented from AnimatedMachine.
00074 {
00075 return _working;
00076 }
|
|
|
00079 {
00080 try {
00081 ImageElement result = null;
00082 if(_imageName.startsWith("http://")) {
00083 URL url = new URL(_imageName);
00084 HxCorba.ImageRep img = _imageMgr.loadWebImage(url);
00085 String name = new File(url.getFile()).getName();
00086 result = new ImageElement(img, name);
00087 }else {
00088 HxCorba.ImageRep img = _imageMgr.loadServerImage(_imageName);
00089 result = new ImageElement(img, _imageName);
00090 }
00091 if(result != null) _output.setElement(result);
00092
00093 }catch(MalformedURLException e) {
00094 ErrorStreamArea.println("Malformed URL");
00095 }catch(org.omg.CORBA.OBJECT_NOT_EXIST e) {
00096 ErrorStreamArea.println("Image "+_imageName+" is sold out");
00097 }catch(Exception e) {
00098 ErrorStreamArea.println(""+e);
00099 e.printStackTrace();
00100 }
00101 _working = false;
00102 }
|
|
|
Reimplemented from MachineElement.
00111 {
00112 _imageMgr = ImageManager.defaultImageMgr();
00113 if(_imageMgr != null)
00114 _key.setVisible(true);
00115 else
00116 turnOff("No servers available");
00117
00118 repaint();
00119 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001