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

TrashElement Class Reference

Inheritance diagram for TrashElement::

MachineElement AnimatedMachine List of all members.

Public Methods

 TrashElement ()
void keyPressed ()
void animationStep ()
boolean continueAnimation ()

Constructor & Destructor Documentation

TrashElement::TrashElement   [inline]
 

00018 {
00019     int marginLF = 0;
00020     int marginUP = ImageElement.componentSize().height / 2;
00021     int marginRG = KeyComponent.componentSize().width  / 2;
00022     int marginDW = 0;
00023     int machineW = 81;
00024     int machineH = 65;
00025 
00026     setSize(marginLF+machineW+marginRG, marginUP+machineH+marginDW);
00027     setMachineImage(Images.trash, marginLF, marginUP, machineW, machineH);
00028 
00029     _input = createInputSocket(marginLF+26, 0);
00030     _key = createKeyComponent(marginLF+machineW-marginRG-2, marginUP + 5);
00031 }


Member Function Documentation

void TrashElement::keyPressed   [inline, virtual]
 

Reimplemented from AnimatedMachine.

00035 {
00036     if(_working) return;
00037 
00038     if(_input.empty()) return;
00039 
00040     _working = true;
00041     _nSteps = 0;
00042     _key.startAnimation();
00043 }

void TrashElement::animationStep   [inline, virtual]
 

Reimplemented from AnimatedMachine.

00047 {
00048     Point p = _input.getLocation();
00049     p.translate(0, 5);
00050     _nSteps++;
00051     _input.setLocation(p);
00052     repaint();
00053 
00054     if(_nSteps >= 4) {
00055         _input.removeElement();
00056         p.translate(0, -5 * _nSteps);
00057         _input.setLocation(p);
00058         _working = false;
00059     }
00060 }

boolean TrashElement::continueAnimation   [inline, virtual]
 

Reimplemented from AnimatedMachine.

00064 {
00065     return _working;
00066 }


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