134 lines
3.4 KiB
C++
134 lines
3.4 KiB
C++
//## begin module.cm preserve=no
|
|
|
|
// %X% %Q% %Z% %W%
|
|
|
|
//## end module.cm
|
|
|
|
|
|
|
|
//## begin module.cp preserve=no
|
|
|
|
//## end module.cp
|
|
|
|
|
|
|
|
//## Module: Component; Pseudo Package specification
|
|
|
|
//## Subsystem: lab7
|
|
|
|
//## Source file: H:\kurs\avC++\lab7\Compnent.h
|
|
|
|
|
|
|
|
#ifndef Compnent_h
|
|
|
|
#define Compnent_h 1
|
|
|
|
|
|
|
|
//## begin module.additionalIncludes preserve=no
|
|
|
|
//## end module.additionalIncludes
|
|
|
|
|
|
|
|
//## begin module.includes preserve=yes
|
|
|
|
//## end module.includes
|
|
|
|
|
|
|
|
// Event
|
|
|
|
#include "Event.h"
|
|
|
|
// Graphics
|
|
|
|
#include "Graphics.h"
|
|
|
|
// Rectangle
|
|
|
|
#include "Rectngle.h"
|
|
|
|
//## begin module.additionalDeclarations preserve=yes
|
|
|
|
class Panel;
|
|
|
|
//## end module.additionalDeclarations
|
|
|
|
|
|
|
|
|
|
|
|
//## Class: Component; Abstract
|
|
|
|
//## Category: lab7
|
|
|
|
//## Subsystem: lab7
|
|
|
|
//## Persistence: Transient
|
|
|
|
//## Cardinality/Multiplicity: n
|
|
|
|
|
|
|
|
//## Uses: <unnamed>; Event { -> }
|
|
|
|
//## Uses: <unnamed>; Graphics { -> }
|
|
|
|
//## Uses: <unnamed>; Rectangle { -> }
|
|
|
|
|
|
|
|
class Component
|
|
|
|
{
|
|
|
|
//## begin Component.initialDeclarations preserve=yes
|
|
|
|
//## end Component.initialDeclarations
|
|
|
|
|
|
|
|
public:
|
|
|
|
//## Constructors (generated)
|
|
|
|
Component();
|
|
|
|
|
|
|
|
//## Destructor (generated)
|
|
|
|
~Component();
|
|
|
|
|
|
|
|
|
|
|
|
//## Other Operations (specified)
|
|
|
|
//## Operation: draw%940929791
|
|
|
|
virtual void draw (Graphics& g) = 0;
|
|
|
|
|
|
|
|
//## Operation: getPpp%940945811
|
|
|
|
Panel* getPpp ();
|
|
|
|
|
|
|
|
//## Operation: setPpp%940945812
|
|
|
|
void setPpp (Panel* p);
|
|
|
|
|
|
|
|
//## Operation: handleMouseEvent%941013993
|
|
|
|
virtual void handleMouseEvent (Event e) = 0;
|
|
|
|
|
|
|
|
//## Operation: handleKeyEvent%941013994
|
|
|
|
virtual void handleKeyEvent (Event e) = 0;
|
|
|
|
|
|
|
|
//## Operation: isHit%941013996
|
|
|
|
virtual bool isHit (int x, int y) = 0;
|
|
|
|
|
|
|
|
// Additional Public Declarations
|
|
|
|
//## begin Component.public preserve=yes
|
|
|
|
//## end Component.public
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Data Members for Class Attributes
|
|
|
|
|
|
|
|
//## Attribute: xpos
|
|
|
|
//## begin Component::xpos.attr preserve=no protected: int {U}
|
|
|
|
int xpos;
|
|
|
|
//## end Component::xpos.attr
|
|
|
|
|
|
|
|
//## Attribute: ypos
|
|
|
|
//## begin Component::ypos.attr preserve=no protected: int {U}
|
|
|
|
int ypos;
|
|
|
|
//## end Component::ypos.attr
|
|
|
|
|
|
|
|
//## Attribute: width
|
|
|
|
//## begin Component::width.attr preserve=no protected: int {U}
|
|
|
|
int width;
|
|
|
|
//## end Component::width.attr
|
|
|
|
|
|
|
|
//## Attribute: height
|
|
|
|
//## begin Component::height.attr preserve=no protected: int {U}
|
|
|
|
int height;
|
|
|
|
//## end Component::height.attr
|
|
|
|
|
|
|
|
//## Attribute: ppp
|
|
|
|
//## begin Component::ppp.attr preserve=no protected: Panel* {U}
|
|
|
|
Panel* ppp;
|
|
|
|
//## end Component::ppp.attr
|
|
|
|
|
|
|
|
// Additional Protected Declarations
|
|
|
|
//## begin Component.protected preserve=yes
|
|
|
|
//## end Component.protected
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Additional Private Declarations
|
|
|
|
//## begin Component.private preserve=yes
|
|
|
|
//## end Component.private
|
|
|
|
|
|
|
|
private: //## implementation
|
|
|
|
// Additional Implementation Declarations
|
|
|
|
//## begin Component.implementation preserve=yes
|
|
|
|
//## end Component.implementation
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//## begin Component.postscript preserve=yes
|
|
|
|
//## end Component.postscript
|
|
|
|
|
|
|
|
// Class Component
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//## begin module.epilog preserve=yes
|
|
|
|
//## end module.epilog
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|