QtiPlot
0.9.8.2
|
#include <FrameWidget.h>
Public Types | |
enum | AttachPolicy { Page, Scales } |
The attach to policy. More... | |
enum | FrameStyle { None = 0, Line = 1, Shadow = 2 } |
The kinds of frame a FrameWidget can draw around. More... | |
enum | Unit { Inch, Millimeter, Centimeter, Point, Pixel, Scale } |
Length units. More... | |
Signals | |
void | changedCoordinates (const QRectF &) |
void | showDialog () |
void | showMenu () |
Public Member Functions | |
int | angle () |
AttachPolicy | attachPolicy () |
QColor | backgroundColor () |
double | bottom () |
QRectF | boundingRect () const |
Return bounding rectangle in plot coordinates. | |
QBrush | brush () |
QColor | frameColor () |
Qt::PenStyle | frameLineStyle () |
QPen | framePen () |
int | frameStyle () |
FrameWidget (Graph *) | |
double | frameWidth () |
bool | isOnTop () |
void | mousePressEvent (QMouseEvent *) |
void | move (const QPoint &pos) |
Graph * | plot () |
virtual void | print (QPainter *p, const QwtScaleMap map[QwtPlot::axisCnt]) |
void | resetCoordinates () |
void | resetOrigin () |
double | right () |
virtual QString | saveToString () |
void | setAngle (int ang) |
void | setAttachPolicy (AttachPolicy attachTo) |
void | setBackgroundColor (const QColor &c) |
void | setBrush (const QBrush &b) |
void | setCoordinates (double left, double top, double right, double bottom) |
Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates. | |
void | setFrameColor (const QColor &c) |
void | setFrameLineStyle (const Qt::PenStyle &s) |
void | setFramePen (const QPen &p) |
void | setFrameStyle (int style) |
void | setFrameWidth (double w) |
void | setOnTop (bool on=true) |
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 | setRect (int x, int y, int w, int h) |
Set geometry, giving everything in paint coordinates. | |
void | setSize (int w, int h) |
Set size in paint coordinates (pixels). | |
void | setSize (const QSize &newSize) |
Set size in paint coordinates. | |
void | showContextMenu () |
void | showPropertiesDialog () |
virtual 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. | |
Static Public Member Functions | |
static double | heightIn (QWidget *w, Unit unit) |
static void | setRect (QWidget *, double x, double y, double w, double h, Unit unit=Pixel) |
Set geometry of a widget in arbitrary units. | |
static double | widthIn (QWidget *w, Unit unit) |
static double | xIn (QWidget *w, Unit unit) |
static double | yIn (QWidget *w, Unit unit) |
Protected Member Functions | |
double | calculateBottomValue () |
Returns the y axis coordinate of the bottom right corner based on the pixel value. | |
double | calculateRightValue () |
Returns the x axis coordinate of the bottom right corner based on the pixel value. | |
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 *) |
virtual void | drawFrame (QPainter *p, const QRect &rect) |
virtual void | paintEvent (QPaintEvent *e) |
Protected Attributes | |
int | d_angle |
Rotation angle: not implemented yet. | |
AttachPolicy | d_attach_policy |
The attach to policy. | |
QBrush | d_brush |
Background brush. | |
int | d_frame |
Frame type. | |
QPen | d_frame_pen |
Pen used to draw the frame. | |
bool | d_on_top |
Graph * | d_plot |
Parent plot. | |
int | d_shadow_width |
Frame width in pixels. | |
double | d_x |
X axis coordinate of the top left corner. | |
double | d_x_right |
The right side position in scale coordinates. | |
double | d_y |
Y axis coordinate of the top left corner. | |
double | d_y_bottom |
The bottom side position in scale coordinates. |
The kinds of frame a FrameWidget can draw around.
enum FrameWidget::Unit |
FrameWidget::FrameWidget | ( | Graph * | plot | ) |
References d_plot, move(), Graph::multiLayer(), Graph::raiseEnrichements(), showDialog(), and showMenu().
int FrameWidget::angle | ( | ) | [inline] |
Reimplemented in LegendWidget.
References d_angle.
AttachPolicy FrameWidget::attachPolicy | ( | ) | [inline] |
References d_attach_policy.
Referenced by Graph::add(), LegendWidget::clone(), Graph::resizeEvent(), EnrichmentDialog::setWidget(), and Graph::updateMarkersBoundingRect().
QColor FrameWidget::backgroundColor | ( | ) | [inline] |
Referenced by EllipseWidget::clone(), RectangleWidget::clone(), LegendWidget::clone(), EllipseWidget::restore(), RectangleWidget::restore(), LegendWidget::restore(), PieLabel::restore(), RectangleWidget::saveToString(), EllipseWidget::saveToString(), LegendWidget::saveToString(), PieLabel::saveToString(), and EnrichmentDialog::setWidget().
double FrameWidget::bottom | ( | ) | [inline] |
QRectF FrameWidget::boundingRect | ( | ) | const |
Return bounding rectangle in plot coordinates.
References d_x, d_x_right, d_y, and d_y_bottom.
Referenced by LegendWidget::textSize(), RectangleWidget::updateCoordinates(), and ApplicationWindow::zoomRectanglePlot().
QBrush FrameWidget::brush | ( | ) | [inline] |
References d_brush.
Referenced by EllipseWidget::clone(), RectangleWidget::clone(), RectangleWidget::restore(), EllipseWidget::restore(), and EnrichmentDialog::setWidget().
double FrameWidget::calculateBottomValue | ( | ) | [protected] |
Returns the y axis coordinate of the bottom right corner based on the pixel value.
References MultiLayer::canvas(), d_plot, and Graph::multiLayer().
Referenced by TexWidget::print(), ImageWidget::print(), print(), setFrameStyle(), setSize(), and updateCoordinates().
double FrameWidget::calculateRightValue | ( | ) | [protected] |
Returns the x axis coordinate of the bottom right corner based on the pixel value.
References MultiLayer::canvas(), d_plot, and Graph::multiLayer().
Referenced by TexWidget::print(), ImageWidget::print(), print(), setFrameStyle(), setSize(), and updateCoordinates().
double FrameWidget::calculateXValue | ( | ) | [protected] |
Returns the x axis coordinate of the top left corner based on the pixel value.
References MultiLayer::canvas(), d_plot, and Graph::multiLayer().
Referenced by TexWidget::print(), ImageWidget::print(), LegendWidget::print(), print(), and updateCoordinates().
double FrameWidget::calculateYValue | ( | ) | [protected] |
Returns the y axis coordinate of the top left corner based on the pixel value.
References MultiLayer::canvas(), d_plot, and Graph::multiLayer().
Referenced by TexWidget::print(), ImageWidget::print(), LegendWidget::print(), print(), and updateCoordinates().
void FrameWidget::changedCoordinates | ( | const QRectF & | ) | [signal] |
Referenced by RectangleWidget::setLinkedLayer(), and RectangleWidget::updateCoordinates().
void FrameWidget::contextMenuEvent | ( | QContextMenuEvent * | ) | [inline, protected] |
void FrameWidget::drawFrame | ( | QPainter * | p, |
const QRect & | rect | ||
) | [protected, virtual] |
Reimplemented in EllipseWidget.
References d_brush, d_frame, d_frame_pen, d_shadow_width, Line, plot(), and Shadow.
Referenced by ImageWidget::draw(), TexWidget::paintEvent(), LegendWidget::paintEvent(), paintEvent(), TexWidget::print(), LegendWidget::print(), and print().
QColor FrameWidget::frameColor | ( | ) | [inline] |
References d_frame_pen.
Referenced by EnrichmentDialog::setWidget().
Qt::PenStyle FrameWidget::frameLineStyle | ( | ) | [inline] |
References d_frame_pen.
QPen FrameWidget::framePen | ( | ) | [inline] |
References d_frame_pen.
Referenced by EllipseWidget::clone(), RectangleWidget::clone(), LegendWidget::clone(), TexWidget::clone(), ImageWidget::clone(), PieLabel::restore(), and EnrichmentDialog::setWidget().
int FrameWidget::frameStyle | ( | ) | [inline] |
double FrameWidget::frameWidth | ( | ) | [inline] |
References d_frame_pen.
Referenced by LegendWidget::itemsHeight().
double FrameWidget::heightIn | ( | QWidget * | w, |
Unit | unit | ||
) | [static] |
References bottom(), Centimeter, Inch, Millimeter, Pixel, Point, Scale, and yValue().
Referenced by EnrichmentDialog::displayCoordinates(), PlotDialog::displayCoordinates(), and PlotDialog::displayPlotCoordinates().
bool FrameWidget::isOnTop | ( | ) | [inline] |
References d_on_top.
Referenced by Graph::add(), SelectionMoveResizer::keyPressEvent(), Graph::print(), Graph::raiseEnrichements(), and SelectionMoveResizer::removeAll().
void FrameWidget::mousePressEvent | ( | QMouseEvent * | ) |
References Graph::activateGraph(), d_plot, Graph::deselectMarker(), and Graph::select().
Referenced by CanvasPicker::eventFilter().
void FrameWidget::move | ( | const QPoint & | pos | ) |
References updateCoordinates().
Referenced by AddWidgetTool::addEllipse(), AddWidgetTool::addEquation(), AddWidgetTool::addRectangle(), AddWidgetTool::addText(), Graph::addTimeStamp(), SelectionMoveResizer::alignTargetsBottom(), SelectionMoveResizer::alignTargetsLeft(), SelectionMoveResizer::alignTargetsRight(), SelectionMoveResizer::alignTargetsTop(), FrameWidget(), ImageWidget::ImageWidget(), Graph::insertText(), LegendWidget::LegendWidget(), SelectionMoveResizer::operateOnTargets(), ApplicationWindow::pasteSelection(), setCoordinates(), setOrigin(), setOriginCoord(), setRect(), and ApplicationWindow::waterfallPlot().
void FrameWidget::paintEvent | ( | QPaintEvent * | e | ) | [protected, virtual] |
Reimplemented in LegendWidget, ImageWidget, and TexWidget.
References drawFrame().
Graph* FrameWidget::plot | ( | ) | [inline] |
References d_plot.
Referenced by SelectionMoveResizer::alignTargetsBottom(), SelectionMoveResizer::alignTargetsLeft(), SelectionMoveResizer::alignTargetsRight(), SelectionMoveResizer::alignTargetsTop(), drawFrame(), LegendWidget::itemsHeight(), ImageWidget::load(), SelectionMoveResizer::mousePressEvent(), SelectionMoveResizer::operateOnTargets(), ImageWidget::paintEvent(), LegendWidget::parse(), TexWidget::print(), LegendWidget::print(), RectangleWidget::setLinkedLayer(), setOnTop(), and Graph::stackingOrderEnrichmentsList().
void FrameWidget::print | ( | QPainter * | p, |
const QwtScaleMap | map[QwtPlot::axisCnt] | ||
) | [virtual] |
Reimplemented in LegendWidget, ImageWidget, and TexWidget.
References bottom(), calculateBottomValue(), calculateRightValue(), calculateXValue(), calculateYValue(), drawFrame(), and right().
Referenced by Graph::print().
void FrameWidget::resetCoordinates | ( | ) | [inline] |
References d_x, d_x_right, d_y, d_y_bottom, and setCoordinates().
Referenced by Graph::resizeEvent(), and Graph::updateMarkersBoundingRect().
void FrameWidget::resetOrigin | ( | ) | [inline] |
References d_x, d_y, and setOriginCoord().
Referenced by Graph::resizeEvent(), Graph::scaleFonts(), and Graph::updateMarkersBoundingRect().
double FrameWidget::right | ( | ) | [inline] |
QString FrameWidget::saveToString | ( | ) | [virtual] |
Reimplemented in PieLabel, LegendWidget, ImageWidget, TexWidget, EllipseWidget, and RectangleWidget.
References d_attach_policy, d_frame, d_frame_pen, d_on_top, d_x, d_x_right, d_y, d_y_bottom, and PenStyleBox::styleIndex().
Referenced by Graph::saveMarkers().
void FrameWidget::setAngle | ( | int | ang | ) | [inline] |
Reimplemented in LegendWidget.
References d_angle.
void FrameWidget::setAttachPolicy | ( | AttachPolicy | attachTo | ) |
void FrameWidget::setBackgroundColor | ( | const QColor & | c | ) | [inline] |
Referenced by AddWidgetTool::addText(), EllipseWidget::clone(), RectangleWidget::clone(), LegendWidget::clone(), AddWidgetTool::eventFilter(), Graph::insertText(), Graph::newLegend(), PieLabel::PieLabel(), EllipseWidget::restore(), RectangleWidget::restore(), LegendWidget::restore(), PieLabel::restore(), EnrichmentDialog::setPatternTo(), EnrichmentDialog::setTextFormatTo(), and ApplicationWindow::zoomRectanglePlot().
void FrameWidget::setBrush | ( | const QBrush & | b | ) | [inline] |
References d_brush.
Referenced by EllipseWidget::clone(), RectangleWidget::clone(), AddWidgetTool::eventFilter(), RectangleWidget::restore(), EllipseWidget::restore(), and EnrichmentDialog::setPatternTo().
void FrameWidget::setCoordinates | ( | double | left, |
double | top, | ||
double | right, | ||
double | bottom | ||
) |
Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates.
References bottom(), d_plot, d_x, d_x_right, d_y, d_y_bottom, move(), and right().
Referenced by Graph::addImage(), RectangleWidget::clone(), EllipseWidget::clone(), ImageWidget::clone(), resetCoordinates(), RectangleWidget::restore(), EllipseWidget::restore(), TexWidget::restore(), ImageWidget::restore(), EnrichmentDialog::setCoordinates(), and setRect().
void FrameWidget::setFrameColor | ( | const QColor & | c | ) | [inline] |
void FrameWidget::setFrameLineStyle | ( | const Qt::PenStyle & | s | ) | [inline] |
References d_frame_pen.
Referenced by EllipseWidget::restore(), RectangleWidget::restore(), and LegendWidget::restore().
void FrameWidget::setFramePen | ( | const QPen & | p | ) | [inline] |
References d_frame_pen.
Referenced by AddWidgetTool::addEquation(), AddWidgetTool::addText(), EllipseWidget::clone(), RectangleWidget::clone(), LegendWidget::clone(), TexWidget::clone(), ImageWidget::clone(), AddWidgetTool::eventFilter(), TexWidget::restore(), ImageWidget::restore(), PieLabel::restore(), and EnrichmentDialog::setFrameTo().
void FrameWidget::setFrameStyle | ( | int | style | ) |
References calculateBottomValue(), calculateRightValue(), d_frame, d_shadow_width, d_x_right, d_y_bottom, and Shadow.
Referenced by AddWidgetTool::addEquation(), AddWidgetTool::addText(), EllipseWidget::EllipseWidget(), AddWidgetTool::eventFilter(), Graph::insertText(), Graph::newLegend(), DataPickerTool::pasteSelectionAsLayerText(), PieLabel::PieLabel(), RectangleWidget::RectangleWidget(), RectangleWidget::restore(), EllipseWidget::restore(), TexWidget::restore(), ImageWidget::restore(), LegendWidget::restore(), PieLabel::restore(), and EnrichmentDialog::setFrameTo().
void FrameWidget::setFrameWidth | ( | double | w | ) | [inline] |
References d_frame_pen.
Referenced by EllipseWidget::restore(), RectangleWidget::restore(), and LegendWidget::restore().
void FrameWidget::setOnTop | ( | bool | on = true | ) |
References d_on_top, Graph::notifyChanges(), and plot().
Referenced by Graph::add(), SelectionMoveResizer::raiseTargets(), EllipseWidget::restore(), RectangleWidget::restore(), TexWidget::restore(), ImageWidget::restore(), and LegendWidget::restore().
void FrameWidget::setOrigin | ( | int | x, |
int | y | ||
) | [inline] |
Sets the position of the top left corner in paint coordinates.
References move().
Referenced by Graph::insertImageMarker().
void FrameWidget::setOriginCoord | ( | double | x, |
double | y | ||
) |
Sets the position of the top left corner in axis coordinates.
References MultiLayer::canvas(), d_plot, d_x, d_y, move(), and Graph::multiLayer().
Referenced by LegendWidget::clone(), TexWidget::clone(), PieCurve::drawDisk(), PieCurve::drawSlices(), Graph::insertText(), DataPickerTool::pasteSelectionAsLayerText(), resetOrigin(), LegendWidget::restore(), and PieLabel::restore().
void FrameWidget::setRect | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Set geometry, giving everything in paint coordinates.
References move().
Referenced by PlotDialog::acceptParams(), EnrichmentDialog::setCoordinates(), setRect(), and ApplicationWindow::zoomRectanglePlot().
void FrameWidget::setRect | ( | QWidget * | widget, |
double | x, | ||
double | y, | ||
double | w, | ||
double | h, | ||
Unit | unit = Pixel |
||
) | [static] |
Set geometry of a widget in arbitrary units.
References Centimeter, Inch, Millimeter, Pixel, Point, Scale, setCoordinates(), and setRect().
void FrameWidget::setSize | ( | int | w, |
int | h | ||
) | [inline] |
Set size in paint coordinates (pixels).
References setSize().
Referenced by AddWidgetTool::addEllipse(), AddWidgetTool::addRectangle(), TexWidget::clone(), ImageWidget::ImageWidget(), RectangleWidget::RectangleWidget(), TexWidget::setBestSize(), EnrichmentDialog::setBestSize(), TexWidget::setPixmap(), setSize(), and TexWidget::TexWidget().
void FrameWidget::setSize | ( | const QSize & | newSize | ) |
Set size in paint coordinates.
References calculateBottomValue(), calculateRightValue(), d_x_right, and d_y_bottom.
void FrameWidget::showContextMenu | ( | ) | [inline] |
References showMenu().
Referenced by SelectionMoveResizer::mousePressEvent().
void FrameWidget::showDialog | ( | ) | [signal] |
Referenced by FrameWidget(), showPropertiesDialog(), and LegendWidget::showTextEditor().
void FrameWidget::showMenu | ( | ) | [signal] |
Referenced by FrameWidget(), and showContextMenu().
void FrameWidget::showPropertiesDialog | ( | ) | [inline] |
References showDialog().
Referenced by AddWidgetTool::addEquation(), AddWidgetTool::addText(), SelectionMoveResizer::keyPressEvent(), and SelectionMoveResizer::mouseDoubleClickEvent().
void FrameWidget::updateCoordinates | ( | ) | [virtual] |
Reimplemented in RectangleWidget.
References calculateBottomValue(), calculateRightValue(), calculateXValue(), calculateYValue(), d_x, d_x_right, d_y, and d_y_bottom.
Referenced by AddWidgetTool::eventFilter(), move(), SelectionMoveResizer::operateOnTargets(), Graph::resizeEvent(), and Graph::updateMarkersBoundingRect().
double FrameWidget::widthIn | ( | QWidget * | w, |
Unit | unit | ||
) | [static] |
References Centimeter, Inch, Millimeter, Pixel, Point, right(), Scale, and xValue().
Referenced by EnrichmentDialog::displayCoordinates(), PlotDialog::displayCoordinates(), and PlotDialog::displayPlotCoordinates().
double FrameWidget::xIn | ( | QWidget * | w, |
Unit | unit | ||
) | [static] |
References Centimeter, Inch, Millimeter, Pixel, Point, Scale, and xValue().
Referenced by EnrichmentDialog::displayCoordinates(), PlotDialog::displayCoordinates(), and PlotDialog::displayPlotCoordinates().
double FrameWidget::xValue | ( | ) | [inline] |
Returns the x axis coordiante of the top left corner.
References d_x.
Referenced by Graph::addImage(), EllipseWidget::clone(), RectangleWidget::clone(), LegendWidget::clone(), TexWidget::clone(), ImageWidget::clone(), widthIn(), and xIn().
double FrameWidget::yIn | ( | QWidget * | w, |
Unit | unit | ||
) | [static] |
References Centimeter, Inch, Millimeter, Pixel, Point, Scale, and yValue().
Referenced by EnrichmentDialog::displayCoordinates(), PlotDialog::displayCoordinates(), and PlotDialog::displayPlotCoordinates().
double FrameWidget::yValue | ( | ) | [inline] |
Returns the y axis coordiante of the top left corner.
References d_y.
Referenced by Graph::addImage(), EllipseWidget::clone(), RectangleWidget::clone(), LegendWidget::clone(), TexWidget::clone(), ImageWidget::clone(), heightIn(), and yIn().
int FrameWidget::d_angle [protected] |
Rotation angle: not implemented yet.
Reimplemented in LegendWidget.
Referenced by angle(), and setAngle().
AttachPolicy FrameWidget::d_attach_policy [protected] |
The attach to policy.
Referenced by attachPolicy(), saveToString(), and setAttachPolicy().
QBrush FrameWidget::d_brush [protected] |
Background brush.
Referenced by brush(), EllipseWidget::drawFrame(), drawFrame(), EllipseWidget::saveToString(), RectangleWidget::saveToString(), and setBrush().
int FrameWidget::d_frame [protected] |
Frame type.
Referenced by EllipseWidget::clone(), RectangleWidget::clone(), LegendWidget::clone(), TexWidget::clone(), ImageWidget::clone(), ImageWidget::draw(), EllipseWidget::drawFrame(), drawFrame(), frameStyle(), LegendWidget::itemsHeight(), TexWidget::paintEvent(), TexWidget::print(), saveToString(), TexWidget::setBestSize(), setFrameStyle(), TexWidget::setPixmap(), and ImageWidget::setPixmap().
QPen FrameWidget::d_frame_pen [protected] |
Pen used to draw the frame.
Referenced by ImageWidget::draw(), EllipseWidget::drawFrame(), drawFrame(), LegendWidget::drawText(), frameColor(), frameLineStyle(), framePen(), frameWidth(), TexWidget::paintEvent(), LegendWidget::paintEvent(), TexWidget::print(), LegendWidget::print(), saveToString(), TexWidget::setBestSize(), setFrameColor(), setFrameLineStyle(), setFramePen(), setFrameWidth(), and TexWidget::setPixmap().
bool FrameWidget::d_on_top [protected] |
Referenced by isOnTop(), saveToString(), and setOnTop().
Graph* FrameWidget::d_plot [protected] |
Parent plot.
Referenced by calculateBottomValue(), calculateRightValue(), calculateXValue(), calculateYValue(), EllipseWidget::drawFrame(), LegendWidget::drawText(), LegendWidget::drawVector(), FrameWidget(), LegendWidget::getCurve(), mousePressEvent(), LegendWidget::parse(), plot(), setCoordinates(), setOriginCoord(), LegendWidget::showTextEditor(), and LegendWidget::symbolsMaxWidth().
int FrameWidget::d_shadow_width [protected] |
Frame width in pixels.
Referenced by ImageWidget::draw(), drawFrame(), LegendWidget::itemsHeight(), setFrameStyle(), and ImageWidget::setPixmap().
double FrameWidget::d_x [protected] |
X axis coordinate of the top left corner.
Referenced by boundingRect(), resetCoordinates(), resetOrigin(), saveToString(), setCoordinates(), setOriginCoord(), updateCoordinates(), and xValue().
double FrameWidget::d_x_right [protected] |
The right side position in scale coordinates.
Referenced by boundingRect(), resetCoordinates(), right(), saveToString(), setCoordinates(), setFrameStyle(), setSize(), and updateCoordinates().
double FrameWidget::d_y [protected] |
Y axis coordinate of the top left corner.
Referenced by boundingRect(), resetCoordinates(), resetOrigin(), saveToString(), setCoordinates(), setOriginCoord(), updateCoordinates(), and yValue().
double FrameWidget::d_y_bottom [protected] |
The bottom side position in scale coordinates.
Referenced by bottom(), boundingRect(), resetCoordinates(), saveToString(), setCoordinates(), setFrameStyle(), setSize(), and updateCoordinates().