#include <LegendWidget.h>
Signals | |
void | enableEditor () |
Public Member Functions | |
int | angle () |
void | clone (LegendWidget *t) |
QFont | font () |
bool | isAutoUpdateEnabled () |
LegendWidget (Graph *) | |
void | print (QPainter *p, const QwtScaleMap map[QwtPlot::axisCnt]) |
QString | saveToString () |
void | setAngle (int angle) |
void | setAutoUpdate (bool on=true) |
void | setFont (const QFont &font) |
void | setText (const QString &s) |
void | setTextColor (const QColor &c) |
void | showTextEditor () |
QString | text () |
QColor | textColor () |
~LegendWidget () | |
Static Public Member Functions | |
static void | restore (Graph *g, const QStringList &lst) |
Private Member Functions | |
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) |
PlotCurve * | getCurve (const QString &s, int &point) |
QwtArray< long > | itemsHeight (int symbolLineLength, int &width, int &height, int &textWidth, int &textHeight) |
virtual void | paintEvent (QPaintEvent *e) |
QString | parse (const QString &str) |
int | symbolsMaxWidth () |
Private Attributes | |
int | d_angle |
Rotation angle. | |
bool | d_auto_update |
Flag telling if the legend should be updated each time a curve is added/removed from the parent plot. | |
QwtText * | d_text |
Pointer to the QwtText object. | |
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 |
LegendWidget::LegendWidget | ( | Graph * | plot | ) |
References d_text, enableEditor(), and FrameWidget::move().
Referenced by restore().
LegendWidget::~LegendWidget | ( | ) |
References d_text.
int LegendWidget::angle | ( | ) | [inline] |
Reimplemented from FrameWidget.
References d_angle.
Referenced by clone(), itemsHeight(), PieLabel::restore(), PieLabel::saveToString(), and EnrichmentDialog::setWidget().
void LegendWidget::clone | ( | LegendWidget * | t | ) |
References angle(), FrameWidget::backgroundColor(), d_angle, d_auto_update, FrameWidget::d_frame, font(), FrameWidget::framePen(), FrameWidget::frameStyle(), isAutoUpdateEnabled(), FrameWidget::setBackgroundColor(), setFont(), FrameWidget::setFramePen(), FrameWidget::setOriginCoord(), setText(), setTextColor(), text(), textColor(), FrameWidget::xValue(), and FrameWidget::yValue().
Referenced by QwtPieCurve::addLabel(), and Graph::addText().
void LegendWidget::drawSymbol | ( | PlotCurve * | c, | |
int | point, | |||
QPainter * | p, | |||
int | x, | |||
int | y, | |||
int | l | |||
) | [private] |
References Graph::Box, QwtPieCurve::color(), drawVector(), QwtPieCurve::pattern(), Graph::Pie, PlotCurve::type(), Graph::VectXYAM, and Graph::VectXYXY.
Referenced by drawText().
void LegendWidget::drawText | ( | QPainter * | p, | |
const QRect & | rect, | |||
QwtArray< long > | height, | |||
int | symbolLineLength | |||
) | [private] |
References Graph::antialiasing(), Graph::curve(), d_angle, FrameWidget::d_frame_pen, FrameWidget::d_plot, d_text, drawSymbol(), getCurve(), h_space, left_margin, M_PI, parse(), and text().
Referenced by paintEvent(), and print().
void LegendWidget::drawVector | ( | PlotCurve * | c, | |
QPainter * | p, | |||
int | x, | |||
int | y, | |||
int | l | |||
) | [private] |
References Graph::antialiasing(), VectorCurve::color(), FrameWidget::d_plot, VectorCurve::filledArrowHead(), VectorCurve::headAngle(), VectorCurve::headLength(), and VectorCurve::width().
Referenced by drawSymbol().
void LegendWidget::enableEditor | ( | ) | [signal] |
Referenced by LegendWidget(), and showTextEditor().
QFont LegendWidget::font | ( | ) | [inline] |
References d_text.
Referenced by clone(), SelectionMoveResizer::operateOnTargets(), PieLabel::saveToString(), and EnrichmentDialog::setWidget().
PlotCurve * LegendWidget::getCurve | ( | const QString & | s, | |
int & | point | |||
) | [private] |
References Graph::curve(), FrameWidget::d_plot, MultiLayer::layer(), and Graph::multiLayer().
Referenced by drawText(), and itemsHeight().
bool LegendWidget::isAutoUpdateEnabled | ( | ) | [inline] |
References d_auto_update.
Referenced by Graph::addLegendItem(), clone(), Graph::legend(), Graph::modifyFunctionCurve(), Graph::plotBoxDiagram(), Graph::removeLegendItem(), EnrichmentDialog::setWidget(), and Filter::showLegend().
QwtArray< long > LegendWidget::itemsHeight | ( | int | symbolLineLength, | |
int & | width, | |||
int & | height, | |||
int & | textWidth, | |||
int & | textHeight | |||
) | [private] |
References angle(), d_angle, FrameWidget::d_frame, FrameWidget::d_frame_pen, FrameWidget::d_shadow_width, d_text, getCurve(), h_space, left_margin, M_PI, parse(), FrameWidget::Shadow, text(), and top_margin.
Referenced by paintEvent(), and print().
void LegendWidget::paintEvent | ( | QPaintEvent * | e | ) | [private, virtual] |
Reimplemented from FrameWidget.
References FrameWidget::drawFrame(), drawText(), itemsHeight(), line_length, and symbolsMaxWidth().
QString LegendWidget::parse | ( | const QString & | str | ) | [private] |
References Table::colIndex(), Graph::curve(), FrameWidget::d_plot, Graph::Pie, Table::text(), and PlotCurve::type().
Referenced by drawText(), and itemsHeight().
void LegendWidget::print | ( | QPainter * | p, | |
const QwtScaleMap | map[QwtPlot::axisCnt] | |||
) | [virtual] |
Reimplemented from FrameWidget.
References FrameWidget::calculateXValue(), FrameWidget::calculateYValue(), FrameWidget::drawFrame(), drawText(), itemsHeight(), line_length, and symbolsMaxWidth().
void LegendWidget::restore | ( | Graph * | g, | |
const QStringList & | lst | |||
) | [static] |
Reimplemented in PieLabel.
References Graph::add(), FrameWidget::backgroundColor(), LegendWidget(), PenStyleBox::penStyle(), setAngle(), setAutoUpdate(), FrameWidget::setBackgroundColor(), setFont(), FrameWidget::setFrameColor(), FrameWidget::setFrameLineStyle(), FrameWidget::setFrameStyle(), FrameWidget::setFrameWidth(), FrameWidget::setOriginCoord(), setText(), and setTextColor().
Referenced by ApplicationWindow::openGraph().
QString LegendWidget::saveToString | ( | ) | [virtual] |
Reimplemented from FrameWidget.
Reimplemented in PieLabel.
References FrameWidget::backgroundColor(), d_angle, d_auto_update, and d_text.
void LegendWidget::setAngle | ( | int | angle | ) |
Reimplemented from FrameWidget.
References d_angle.
Referenced by AddWidgetTool::addText(), ImportOPJ::addText(), Graph::insertText(), PieLabel::restore(), restore(), and EnrichmentDialog::setTextFormatTo().
void LegendWidget::setAutoUpdate | ( | bool | on = true |
) | [inline] |
References d_auto_update.
Referenced by Graph::addTimeStamp(), Graph::insertLegend(), Graph::newLegend(), restore(), and EnrichmentDialog::setTextFormatTo().
void LegendWidget::setFont | ( | const QFont & | font | ) |
void LegendWidget::setText | ( | const QString & | s | ) |
References d_text.
Referenced by Graph::addLegendItem(), AddWidgetTool::addText(), EnrichmentDialog::apply(), clone(), PieLabel::closeEvent(), QwtPieCurve::drawDisk(), QwtPieCurve::drawSlices(), ImportOPJ::importGraphs(), QwtPieCurve::initLabels(), Graph::insertText(), Graph::modifyFunctionCurve(), Graph::newLegend(), Graph::plotBoxDiagram(), Graph::removeLegendItem(), PieLabel::restore(), restore(), Graph::setLegend(), and Filter::showLegend().
void LegendWidget::setTextColor | ( | const QColor & | c | ) |
References d_text.
Referenced by AddWidgetTool::addText(), ImportOPJ::addText(), clone(), Graph::insertText(), Graph::newLegend(), PieLabel::restore(), restore(), and EnrichmentDialog::setTextFormatTo().
void LegendWidget::showTextEditor | ( | ) |
int LegendWidget::symbolsMaxWidth | ( | ) | [private] |
References Graph::curve(), Graph::curveCount(), FrameWidget::d_plot, d_text, and text().
Referenced by paintEvent(), and print().
QString LegendWidget::text | ( | ) | [inline] |
References d_text.
Referenced by QwtPieCurve::addLabel(), Graph::addLegendItem(), clone(), Graph::createTable(), PieLabel::customText(), drawText(), itemsHeight(), Graph::modifyFunctionCurve(), SelectionMoveResizer::operateOnTargets(), Graph::removeLegendItem(), PieLabel::restore(), PieLabel::saveToString(), EnrichmentDialog::setWidget(), Filter::showLegend(), symbolsMaxWidth(), and TextEditor::TextEditor().
QColor LegendWidget::textColor | ( | ) | [inline] |
References d_text.
Referenced by clone(), PieLabel::restore(), PieLabel::saveToString(), and EnrichmentDialog::setWidget().
int LegendWidget::d_angle [private] |
Rotation angle.
Reimplemented from FrameWidget.
Referenced by angle(), clone(), drawText(), itemsHeight(), saveToString(), and setAngle().
bool LegendWidget::d_auto_update [private] |
Flag telling if the legend should be updated each time a curve is added/removed from the parent plot.
Referenced by clone(), isAutoUpdateEnabled(), saveToString(), and setAutoUpdate().
QwtText* LegendWidget::d_text [private] |
Pointer to the QwtText object.
Referenced by drawText(), font(), itemsHeight(), LegendWidget(), saveToString(), setFont(), setText(), setTextColor(), symbolsMaxWidth(), text(), textColor(), and ~LegendWidget().
int LegendWidget::h_space [private] |
Distance between symbols and legend text.
Referenced by drawText(), and itemsHeight().
int LegendWidget::left_margin [private] |
Distance between frame and content.
Referenced by drawText(), and itemsHeight().
int LegendWidget::line_length [private] |
Length of the symbol line.
Referenced by paintEvent(), and print().
int LegendWidget::top_margin [private] |
Referenced by itemsHeight().