LegendWidget Class Reference

#include <LegendWidget.h>

Inheritance diagram for LegendWidget:

PieLabel

List of all members.

Public Types

enum  FrameStyle { None = 0, Line = 1, Shadow = 2 }
 The kinds of frame a LegendWidget can draw around the Text. More...

Signals

void enableEditor ()
void showDialog ()
void showMenu ()

Public Member Functions

int angle ()
QColor backgroundColor ()
void clone (LegendWidget *t)
QFont font ()
int frameStyle ()
 LegendWidget (Graph *)
void move (const QPoint &pos)
Graphplot ()
void print (QPainter *p, const QwtScaleMap map[QwtPlot::axisCnt])
void resetOrigin ()
void setAngle (int ang)
void setBackgroundColor (const QColor &c)
void setFont (const QFont &font)
void setFrameStyle (int style)
void setOrigin (int x, int y)
 Sets the position of the top left corner in paint coordinates.
void setOriginCoord (double x, double y)
 Sets the position of the top left corner in axis coordinates.
void setText (const QString &s)
void setTextColor (const QColor &c)
void showContextMenu ()
void showTextDialog ()
void showTextEditor ()
QString text ()
QColor textColor ()
void updateCoordinates ()
double xValue ()
 Returns the x axis coordiante of the top left corner.
double yValue ()
 Returns the y axis coordiante of the top left corner.
 ~LegendWidget ()

Private Member Functions

double calculateXValue ()
 Returns the x axis coordinate of the top left corner based on the pixel value.
double calculateYValue ()
 Returns the y axis coordinate of the top left corner based on the pixel value.
void contextMenuEvent (QContextMenuEvent *)
void drawFrame (QPainter *p, const QRect &rect)
void drawSymbol (PlotCurve *c, int point, QPainter *p, int x, int y, int l)
void drawText (QPainter *, const QRect &, QwtArray< long >, int)
void drawVector (PlotCurve *c, QPainter *p, int x, int y, int l)
PlotCurvegetCurve (const QString &s, int &point)
QwtArray< long > itemsHeight (int y, int symbolLineLength, int &width, int &height)
void mousePressEvent (QMouseEvent *)
virtual void paintEvent (QPaintEvent *e)
QString parse (const QString &str)
int symbolsMaxWidth ()

Private Attributes

int d_angle
 Rotation angle: not implemented yet.
int d_frame
 Frame type.
Graphd_plot
 Parent plot.
QwtText * d_text
 Pointer to the QwtText object.
double d_x
 X axis coordinate of the top left corner.
double d_y
 Y axis coordinate of the top left corner.
int h_space
 Distance between symbols and legend text.
int left_margin
 Distance between frame and content.
int line_length
 Length of the symbol line.
int top_margin


Member Enumeration Documentation

The kinds of frame a LegendWidget can draw around the Text.

Enumerator:
None 
Line 
Shadow 


Constructor & Destructor Documentation

LegendWidget::LegendWidget ( Graph plot  ) 

LegendWidget::~LegendWidget (  ) 

References d_text.


Member Function Documentation

int LegendWidget::angle (  )  [inline]

References d_angle.

Referenced by clone(), and Graph::saveMarkers().

QColor LegendWidget::backgroundColor (  )  [inline]

double LegendWidget::calculateXValue (  )  [private]

Returns the x axis coordinate of the top left corner based on the pixel value.

References d_plot.

Referenced by print(), and updateCoordinates().

double LegendWidget::calculateYValue (  )  [private]

Returns the y axis coordinate of the top left corner based on the pixel value.

References d_plot.

Referenced by print(), and updateCoordinates().

void LegendWidget::clone ( LegendWidget t  ) 

void LegendWidget::contextMenuEvent ( QContextMenuEvent *   )  [inline, private]

void LegendWidget::drawFrame ( QPainter *  p,
const QRect &  rect 
) [private]

References d_frame, d_text, Line, and Shadow.

Referenced by paintEvent(), and print().

void LegendWidget::drawSymbol ( PlotCurve c,
int  point,
QPainter *  p,
int  x,
int  y,
int  l 
) [private]

void LegendWidget::drawText ( QPainter *  p,
const QRect &  rect,
QwtArray< long >  height,
int  symbolLineLength 
) [private]

void LegendWidget::drawVector ( PlotCurve c,
QPainter *  p,
int  x,
int  y,
int  l 
) [private]

void LegendWidget::enableEditor (  )  [signal]

Referenced by LegendWidget(), and showTextEditor().

QFont LegendWidget::font (  )  [inline]

int LegendWidget::frameStyle (  )  [inline]

PlotCurve * LegendWidget::getCurve ( const QString &  s,
int &  point 
) [private]

QwtArray< long > LegendWidget::itemsHeight ( int  y,
int  symbolLineLength,
int &  width,
int &  height 
) [private]

References d_text, getCurve(), h_space, left_margin, parse(), text(), and top_margin.

Referenced by paintEvent(), and print().

void LegendWidget::mousePressEvent ( QMouseEvent *   )  [private]

void LegendWidget::move ( const QPoint &  pos  ) 

void LegendWidget::paintEvent ( QPaintEvent *  e  )  [private, virtual]

QString LegendWidget::parse ( const QString &  str  )  [private]

Graph* LegendWidget::plot (  )  [inline]

References d_plot.

Referenced by TextDialog::setLegendWidget().

void LegendWidget::print ( QPainter *  p,
const QwtScaleMap  map[QwtPlot::axisCnt] 
)

void LegendWidget::resetOrigin (  )  [inline]

References d_x, d_y, and setOriginCoord().

void LegendWidget::setAngle ( int  ang  )  [inline]

References d_angle.

Referenced by ImportOPJ::addText(), and Graph::insertText().

void LegendWidget::setBackgroundColor ( const QColor &  c  ) 

void LegendWidget::setFont ( const QFont &  font  ) 

void LegendWidget::setFrameStyle ( int  style  ) 

void LegendWidget::setOrigin ( int  x,
int  y 
) [inline]

Sets the position of the top left corner in paint coordinates.

References move().

void LegendWidget::setOriginCoord ( double  x,
double  y 
)

Sets the position of the top left corner in axis coordinates.

References d_plot, d_x, and d_y.

Referenced by clone(), QwtPieCurve::drawDisk(), QwtPieCurve::drawSlices(), Graph::insertText(), and resetOrigin().

void LegendWidget::setText ( const QString &  s  ) 

void LegendWidget::setTextColor ( const QColor &  c  ) 

void LegendWidget::showContextMenu (  )  [inline]

void LegendWidget::showDialog (  )  [signal]

void LegendWidget::showMenu (  )  [signal]

Referenced by LegendWidget(), and showContextMenu().

void LegendWidget::showTextDialog (  )  [inline]

References showDialog().

Referenced by CanvasPicker::drawTextMarker().

void LegendWidget::showTextEditor (  ) 

int LegendWidget::symbolsMaxWidth (  )  [private]

References Graph::curve(), Graph::curveCount(), d_plot, d_text, and text().

Referenced by paintEvent(), and print().

QString LegendWidget::text (  )  [inline]

QColor LegendWidget::textColor (  )  [inline]

void LegendWidget::updateCoordinates (  ) 

References calculateXValue(), calculateYValue(), d_x, and d_y.

Referenced by move().

double LegendWidget::xValue (  )  [inline]

Returns the x axis coordiante of the top left corner.

References d_x.

Referenced by clone(), and Graph::saveMarkers().

double LegendWidget::yValue (  )  [inline]

Returns the y axis coordiante of the top left corner.

References d_y.

Referenced by clone(), and Graph::saveMarkers().


Member Data Documentation

int LegendWidget::d_angle [private]

Rotation angle: not implemented yet.

Referenced by angle(), clone(), and setAngle().

int LegendWidget::d_frame [private]

Frame type.

Referenced by clone(), drawFrame(), frameStyle(), paintEvent(), and setFrameStyle().

QwtText* LegendWidget::d_text [private]

double LegendWidget::d_x [private]

X axis coordinate of the top left corner.

Referenced by resetOrigin(), setOriginCoord(), updateCoordinates(), and xValue().

double LegendWidget::d_y [private]

Y axis coordinate of the top left corner.

Referenced by resetOrigin(), setOriginCoord(), updateCoordinates(), and yValue().

int LegendWidget::h_space [private]

Distance between symbols and legend text.

Referenced by drawText(), itemsHeight(), and LegendWidget().

Distance between frame and content.

Referenced by drawText(), itemsHeight(), and LegendWidget().

Length of the symbol line.

Referenced by LegendWidget(), paintEvent(), and print().

int LegendWidget::top_margin [private]

Referenced by itemsHeight(), and LegendWidget().


The documentation for this class was generated from the following files:

Generated on Sun Jun 15 21:32:23 2008 for QtiPlot by  doxygen 1.5.6