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

SViewEl Class Reference

#include <SViewEl.h>

Inherits QObject, and SObserver.

Inherited by SDAGEdgeViewEl, SDAGNodeViewEl, SDAGViewEl, SJobViewEl, and STopViewEl.

Inheritance diagram for SViewEl:

Inheritance graph
[legend]
List of all members.

Public Types

enum  SMarkStyles {
  STANDARD, MARKED, MARKED1, MARKED2,
  MARKED3, MARKED4
}

Public Methods

 SViewEl ()
 SViewEl (STaskSystem *ts)
virtual void setView (SView &view)
virtual void paint (QPaintDevice *pd, QRect rect)=0
virtual bool isAffectedBy (QMouseEvent *ev)
virtual bool mouseEvent (QMouseEvent *ev)
virtual void setPos (QPoint p)
virtual const QRect & getBoundBox () const
virtual QRegion getRegion ()=0
virtual void update (const SEvent &event)=0

Protected Methods

QColor lighterGray ()
void draw3DRect (QPainter &p, int x, int y, int w, int h)
void draw3DRect (QPainter &p, const QRect &r)
SViewgetView ()
void requestRepaint ()
void requestRepaint (const QRect &rect)
virtual void update (const class SEvent &)

Protected Attributes

STaskSystem_pTaskSystem

Detailed Description

This is the base class for small building blocks which can be combined to a graphical display. This can be single machines, jobs, etc. View elements do only paint themselves. They are not responsible for setting up the graphical context and for communicating with the window system.


Member Enumeration Documentation

enum SViewEl::SMarkStyles
 

Mark styles influence the style how the ViewEl is displayed. The styles are stored in SVis...-objects. Identical mark styles should produce similar (NOT HARDCODED) effects in different ViewEls.

Enumeration values:
STANDARD 
MARKED 
MARKED1 
MARKED2 
MARKED3 
MARKED4 


Constructor & Destructor Documentation

SViewEl::SViewEl   [inline]
 

Constructs a new SViewEl. It initializes the pointer to the tasksystem. The corresponding view is set by the public member setView( SView &view ). ts SHOULD BE TAKEN OUT OF HERE EVENTUALLY! (AH)

SViewEl::SViewEl STaskSystem   ts [inline]
 


Member Function Documentation

void SViewEl::draw3DRect QPainter &    p,
const QRect &    r
[inline, protected]
 

void SViewEl::draw3DRect QPainter &    p,
int    x,
int    y,
int    w,
int    h
[protected]
 

paint a 3D Rectangle use current Brush as color

virtual const QRect& SViewEl::getBoundBox   const [inline, virtual]
 

Reimplemented in SDAGEdgeViewEl, SDAGNodeViewEl, and SDAGViewEl.

virtual QRegion SViewEl::getRegion   [pure virtual]
 

Returns:
the region which is covered by this view element. DEPRECATED (AH): use getBoundBox() instead

Implemented in SDAGEdgeViewEl, SDAGNodeViewEl, SDAGViewEl, and SMeshTopViewEl.

SView& SViewEl::getView   [inline, protected]
 

Get the view which is responsible for this view element. This is useful for setting new cursors etc. .

Returns:
the view for this view element.

virtual bool SViewEl::isAffectedBy QMouseEvent *    ev [inline, virtual]
 

The isAffectedBy function checks if an element is affected by a particular mouse event.

Parameters:
ev  the mouse event we are talking about.
Returns:
true if event is handled directly by this object (in particular not only by a child).

Reimplemented in SDAGViewEl.

QColor SViewEl::lighterGray   [inline, protected]
 

virtual bool SViewEl::mouseEvent QMouseEvent *    ev [inline, virtual]
 

This virtual function handles the mouse event. You can feed it with the captured mouse event from your view.

Returns:
true if the mouse event was handled succesfully.

Reimplemented in SDAGViewEl.

virtual void SViewEl::paint QPaintDevice *    pd,
QRect    rect
[pure virtual]
 

The paint function paints the element in the paintdevice.

Parameters:
pd  This is the paintdevice the element is painted in. Normally paintDev comes from the _pView, but it might also be printer or almost anything else.
rect  This QRect is the area where the painting takes place.

Implemented in SDAGEdgeViewEl, SDAGNodeViewEl, SDAGViewEl, and SMeshTopViewEl.

void SViewEl::requestRepaint const QRect &    rect [inline, protected]
 

void SViewEl::requestRepaint   [inline, protected]
 

If something in the view element has changed and you want to make the changes visible, then request a repaint for the view element. CAUTION: repaints everything!

virtual void SViewEl::setPos QPoint    p [inline, virtual]
 

Here you can set the position of the view element.

Parameters:
p  the new position of the view element.

Reimplemented in SDAGNodeViewEl, and SDAGViewEl.

virtual void SViewEl::setView SView   view [inline, virtual]
 

Set the view which accepts the repaint-requests.

Parameters:
view  This paramter is a reference to the parent view ( the view which accepts the repaint-requests.

Reimplemented in SDAGViewEl.

virtual void SObserver::update const SEvent   event [pure virtual, inherited]
 

Here the class is informed of an event, when an observed component has sent an event by SObservable::notifyObservers()

Parameters:
event  event sent by an observed component (the reference is not guaranteed to be valid after the termination of the call to update()
See also:
SObservable::notifyObservers()

Implemented in SGanttLog, SLogger, SJobArray, and STaskSystem.

virtual void SViewEl::update const class SEvent   [inline, protected, virtual]
 

This update function gets the project specific events for updating the view element.

Reimplemented in SDAGNodeViewEl, SDAGViewEl, and SMeshTopViewEl.


Member Data Documentation

STaskSystem* SViewEl::_pTaskSystem [protected]
 

@supplierCardinality 1 @label displays part of

SHOULDN'T BE USED!! WILL BE REMOVED (AH)


The documentation for this class was generated from the following files:
Generated on Thu May 22 16:50:56 2003 for Sketch-it! by doxygen1.2.18