Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

visualization/SDAGNodeViewEl.h

Go to the documentation of this file.
00001 /* #start# ***********************************************************
00002 
00003                              Scheduling Simulator
00004                     Lehrstuhl f"ur Effiziente Algorithmen
00005                        Technische Universit"at M"unchen
00006 
00007  File    : $Id: SDAGNodeViewEl.h,v 1.4 2003/01/08 18:57:14 meierb Exp $
00008 
00009  Purpose : This view element paints a node ( i.e. a nice little picture with
00010            some job information ) on its paintdevice. It is used by the 
00011      SDAGViewEl.
00012 
00013  RCS-Log:
00014  $Log: SDAGNodeViewEl.h,v $
00015  Revision 1.4  2003/01/08 18:57:14  meierb
00016  added randomized release times
00017 
00018  Revision 1.1.1.1  2002/12/02 22:26:19  meierb
00019  my_schedule
00020 
00021  Revision 1.2  2002/11/11 16:19:36  taeubig
00022  changes in header inclusion
00023 
00024  Revision 1.1  2002/08/29 12:59:59  taeubig
00025  Added the sources
00026 
00027  Revision 1.11  2000/08/21 23:04:15  hall
00028  more "intelligent" repaint (moved to SViewEl.cpp),
00029  fixes/workarounds for crazy bugs
00030 
00031  Revision 1.10  2000/06/15 13:42:40  taeubig
00032  Added rejected state support
00033 
00034  Revision 1.9  2000/05/29 20:00:53  taeubig
00035  Updated #includes for new subdirectories
00036 
00037  Revision 1.8  2000/01/24 10:53:54  kern
00038  cosmetic changes
00039 
00040  Revision 1.7  2000/01/17 16:45:29  kern
00041  SVisPrecDAG is fully supported now
00042 
00043  Revision 1.6  2000/01/16 18:42:55  kern
00044  java docs
00045 
00046  Revision 1.5  2000/01/12 09:27:37  kern
00047  added javadocs
00048 
00049  Revision 1.4  1999/12/20 10:44:08  kern
00050  added pref events
00051 
00052  Revision 1.3  1999/12/10 10:31:19  kern
00053  fixed some crash bugs
00054 
00055  Revision 1.2  1999/12/06 14:11:53  kern
00056  added some more preferences
00057 
00058  Revision 1.1  1999/11/29 11:45:03  kern
00059  added design structure
00060 
00061 
00062  * #end# ************************************************************* */   
00063 
00064 #ifndef SDAGVIEWNODE_H
00065 #define SDAGVIEWNODE_H
00066 
00067 // system header files
00068 
00069 // project header files
00070 #include "../model/STaskSystem.h"
00071 #include "../model/jobs/SJob.h"
00072 #include "SViewEl.h"
00073 
00074 // QT header files
00075 #include <qlist.h>
00076 #include <qregion.h>
00077 #include <qpixmap.h>
00078 #include <qpen.h>
00079 #include <qbrush.h>
00080 #include <qstring.h>
00081 
00082 class SDAGEdgeViewEl;
00083 
00089 class SDAGNodeViewEl: public SViewEl
00090 {
00091 public:
00096   SDAGNodeViewEl( STaskSystem *ts, SJob &job );
00097   ~SDAGNodeViewEl();
00103   virtual void paint( QPaintDevice *pd, QRect rect );
00108   void hide() { _visible = FALSE; };
00112   void show() { _visible = TRUE; };
00117   bool isVisible() { return _visible; };
00120   void initPixmap();
00127   void moveTo( int x, int y );
00131   void moveTo( QPoint pos ) { moveTo( pos.x(), pos.y() ); };
00134   void setPos( int x, int y );
00138   void setPos( QPoint p ) { setPos( p.x(), p.y() ); }; 
00141   int getWidth() { return _w; };
00144   int getHeight() { return _h; }; 
00148   QPoint getPos() { return QPoint( _x + _w / 2, _y + _h / 2 ); };
00152   void addEdge( SDAGEdgeViewEl* edge ) { _edges->append( edge ); };
00155   void removeEdge( SDAGEdgeViewEl* edge ) { _edges->removeRef( edge ); };
00158   SJob &getJob() { return *_pJob; };
00161   QRegion getRegion() { return QRegion( _x , _y , _w, _h, _shape ); }; 
00164   const QRect &getBoundBox() const;
00165 
00168   const QRect &fullBoundBox() const;
00169 protected:
00172   void update( const class SEvent & );
00173 
00174 private:
00177   int _x;
00180   int _y;
00183   int _w;
00186   int _h;
00189   SJob *_pJob;
00193   QRegion::RegionType _shape;
00196   bool _visible;
00197   // variables for the layout of the node. 
00198   QPen    _pen;
00199   QBrush  _brush;
00200   QString _text;
00203   QList<SDAGEdgeViewEl> *_edges;
00207   QPixmap _pixmap;
00210   int _curPixIndex;
00218   void drawNodePixmap( int index );
00221   void drawText();
00226   void setCurPixIndex();
00230   void loadPixmap();
00234   void createPixmap();
00235 };
00236 
00237 #endif //SDAGVIEWNODE_H

Generated on Thu May 22 16:48:09 2003 for Sketch-it! by doxygen1.2.18