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

SDAGEdgeViewEl Class Reference

#include <SDAGEdgeViewEl.h>

Inherits SViewEl.

Inheritance diagram for SDAGEdgeViewEl:

Inheritance graph
[legend]
List of all members.

Public Types

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

Public Methods

 SDAGEdgeViewEl (STaskSystem *ts, SDAGViewEl *dagel, QColor edgecolor=QColor("black"), int edgewidth=1, Qt::PenStyle edgestyle=Qt::SolidLine)
 ~SDAGEdgeViewEl ()
void paint (QPaintDevice *pd, QRect rect)
void update ()
void hide ()
void show ()
bool isVisible ()
void appendBend (int x, int y)
void appendBend (QPoint p)
void moveSource (int x, int y)
void moveSource (QPoint p)
void moveTarget (int x, int y)
void moveTarget (QPoint p)
void moveDrag (int x, int y)
void moveDrag (QPoint p)
void moveBends (int x, int y)
void moveBends (QPoint p)
SDAGNodeViewElbeginEdgeDrag (QPoint pos)
void endEdgeDrag (SDAGNodeViewEl *node)
void setColor (QColor c)
void setWidth (int w)
void setStyle (Qt::PenStyle s)
void setSource (SDAGNodeViewEl *node)
void setTarget (SDAGNodeViewEl *node)
bool isSourceNode (SDAGNodeViewEl *node)
bool isTargetNode (SDAGNodeViewEl *node)
SDAGNodeViewElgetSource ()
SDAGNodeViewElgetTarget ()
QRegion getRegion ()
const QRect & getBoundBox () const
bool isDirected ()
void setLEDAEdge (leda_edge e)
leda_list< leda_point > getBends ()
virtual void setView (SView &view)
virtual bool isAffectedBy (QMouseEvent *ev)
virtual bool mouseEvent (QMouseEvent *ev)
virtual void setPos (QPoint p)
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 view element paints a edge ( a line if undirected or a arrow if directed) from one node element to another.


Member Enumeration Documentation

enum SViewEl::SMarkStyles [inherited]
 

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

SDAGEdgeViewEl::SDAGEdgeViewEl STaskSystem   ts,
SDAGViewEl   dagel,
QColor    edgecolor = QColor("black"),
int    edgewidth = 1,
Qt::PenStyle    edgestyle = Qt::SolidLine
 

Constructs a new SDAGEdgeViewEl.

Parameters:
dagel  is the parent SDAGViewEl. Every edge deletes itself from the edge list of its parent SDAGViewEl. That's for what this pointer is for.

SDAGEdgeViewEl::~SDAGEdgeViewEl  
 


Member Function Documentation

void SDAGEdgeViewEl::appendBend QPoint    p [inline]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SDAGEdgeViewEl::appendBend int    x,
int    y
 

Appends a point in _bends. This function can be used to add bends to the edge.

SDAGNodeViewEl * SDAGEdgeViewEl::beginEdgeDrag QPoint    pos
 

This function has to be called if you want to drag the edge. This is the first thing you have to do when dragging a edge. It uses _dragIndex to determine the point to drag.

Parameters:
pos  is the position on the edge/near the edge where you want to drag the edge. This point is used to calculate the real point on the edge that can be dragged.
Returns:
the SDAGVieNode on which the drag started or NULL if a waypoint is to be dragged.

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

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

paint a 3D Rectangle use current Brush as color

void SDAGEdgeViewEl::endEdgeDrag SDAGNodeViewEl   node
 

This function has to be called, when the drag is to be finished. It is the last thing you have to do to finish the drag of the edge.

Parameters:
node  is the new target node of the edge.

leda_list< leda_point > SDAGEdgeViewEl::getBends  
 

Use this function to get a list of points that are the bends of the edge. For now this is only used internally in SDAGEdgeViewEl.

Returns:
a list of points that are the bends of the edge.

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

calculate the bounding box DIRTY!

Reimplemented from SViewEl.

QRegion SDAGEdgeViewEl::getRegion   [virtual]
 

Gets the region that is covered by the edge.

Implements SViewEl.

SDAGNodeViewEl* SDAGEdgeViewEl::getSource   [inline]
 

Returns:
the source node of the edge.

SDAGNodeViewEl* SDAGEdgeViewEl::getTarget   [inline]
 

Returns:
the target node of the edge.

SView& SViewEl::getView   [inline, protected, inherited]
 

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.

void SDAGEdgeViewEl::hide   [inline]
 

Sets _visible to FALSE, so that this edge isn't repainted until _visible is set to TRUE (show() !) again.

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

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.

bool SDAGEdgeViewEl::isDirected  
 

Returns:
TRUE if the edge is directed, FALSE otherwise.

bool SDAGEdgeViewEl::isSourceNode SDAGNodeViewEl   node [inline]
 

Returns:
TRUE if node is the source node of the edge.

bool SDAGEdgeViewEl::isTargetNode SDAGNodeViewEl   node [inline]
 

Returns:
TRUE if node is the target node of the edge.

bool SDAGEdgeViewEl::isVisible   [inline]
 

Returns:
TRUE if the edge is visible, or FALSE if not.

QColor SViewEl::lighterGray   [inline, protected, inherited]
 

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

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.

void SDAGEdgeViewEl::moveBends QPoint    p [inline]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SDAGEdgeViewEl::moveBends int    x,
int    y
 

Translates all waypoints of the edge to a new position. This is useful if you want to place the hole dag to a new position.

Parameters:
x  is the x-coordinate of the new position.
y  is the y-coordinate of the new position.

void SDAGEdgeViewEl::moveDrag QPoint    p [inline]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SDAGEdgeViewEl::moveDrag int    x,
int    y
[inline]
 

If you want to drag the edge, call this function. It uses _dragIndex ( which is set by beginEdgeDrag() ) to determine which point is to be dragged.

Parameters:
x  is the new x-coordinate of the last point.
y  is the new y-coordinate of the last point.

void SDAGEdgeViewEl::moveSource QPoint    p [inline]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SDAGEdgeViewEl::moveSource int    x,
int    y
[inline]
 

Moves the first point of the edge.

Parameters:
x  is the new x-coordinate of the first point.
y  is the new y-coordinate of the first point.

void SDAGEdgeViewEl::moveTarget QPoint    p [inline]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void SDAGEdgeViewEl::moveTarget int    x,
int    y
[inline]
 

Moves the last point of the edge.

Parameters:
x  is the new x-coordinate of the last point.
y  is the new y-coordinate of the last point.

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

Paints the edge to the paintdevice with the visible rect rect.

Implements SViewEl.

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

void SViewEl::requestRepaint   [inline, protected, inherited]
 

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!

void SDAGEdgeViewEl::setColor QColor    c [inline]
 

Sets the color of the edge.

Parameters:
c  is the new QColor of the edge.

void SDAGEdgeViewEl::setLEDAEdge leda_edge    e [inline]
 

Set the LEDA edge that is represented by this edge. For this LEDA edge the SVisPrecDAG coordinates are set.

Parameters:
e  is the LEDA edge that is represented by this edge.

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

Here you can set the position of the view element.

Parameters:
p  the new position of the view element.

Reimplemented in SDAGNodeViewEl, and SDAGViewEl.

void SDAGEdgeViewEl::setSource SDAGNodeViewEl   node
 

Sets the source node of the edge.

Parameters:
node  is the new source node of the edge.

void SDAGEdgeViewEl::setStyle Qt::PenStyle    s [inline]
 

Sets the style (dashed etc. ) of the edge.

Parameters:
s  is the new style of the edge.

void SDAGEdgeViewEl::setTarget SDAGNodeViewEl   node
 

Sets the target node of the edge.

Parameters:
node  is the new target node of the edge.

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

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.

void SDAGEdgeViewEl::setWidth int    w [inline]
 

Sets the width of the edge.

Parameters:
w  is the new width of the edge.

void SDAGEdgeViewEl::show   [inline]
 

Sets _visible to TRUE, so that this edge is repainted.

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, inherited]
 

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

Reimplemented in SDAGNodeViewEl, SDAGViewEl, and SMeshTopViewEl.

void SDAGEdgeViewEl::update  
 

Calculates the first ( the point next to the source node ) and the last point ( the point next to the target node ) of the edge and shows it.


Member Data Documentation

STaskSystem* SViewEl::_pTaskSystem [protected, inherited]
 

@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:43 2003 for Sketch-it! by doxygen1.2.18