QtiPlot  0.9.8.2
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FrameWidget Class Reference

#include <FrameWidget.h>

Inheritance diagram for FrameWidget:
EllipseWidget ImageWidget LegendWidget RectangleWidget TexWidget PieLabel

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. More...
 
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)
 
Graphplot ()
 
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. More...
 
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. More...
 
void setOriginCoord (double x, double y)
 Sets the position of the top left corner in axis coordinates. More...
 
void setRect (int x, int y, int w, int h)
 Set geometry, giving everything in paint coordinates. More...
 
void setSize (int w, int h)
 Set size in paint coordinates (pixels). More...
 
void setSize (const QSize &newSize)
 Set size in paint coordinates. More...
 
void showContextMenu ()
 
void showPropertiesDialog ()
 
virtual void updateCoordinates ()
 
double xValue ()
 Returns the x axis coordiante of the top left corner. More...
 
double yValue ()
 Returns the y axis coordiante of the top left corner. More...
 

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. More...
 
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. More...
 
double calculateRightValue ()
 Returns the x axis coordinate of the bottom right corner based on the pixel value. More...
 
double calculateXValue ()
 Returns the x axis coordinate of the top left corner based on the pixel value. More...
 
double calculateYValue ()
 Returns the y axis coordinate of the top left corner based on the pixel value. More...
 
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. More...
 
AttachPolicy d_attach_policy
 The attach to policy. More...
 
QBrush d_brush
 Background brush. More...
 
int d_frame
 Frame type. More...
 
QPen d_frame_pen
 Pen used to draw the frame. More...
 
bool d_on_top
 
Graphd_plot
 Parent plot. More...
 
int d_shadow_width
 Frame width in pixels. More...
 
double d_x
 X axis coordinate of the top left corner. More...
 
double d_x_right
 The right side position in scale coordinates. More...
 
double d_y
 Y axis coordinate of the top left corner. More...
 
double d_y_bottom
 The bottom side position in scale coordinates. More...
 

Member Enumeration Documentation

The attach to policy.

Enumerator
Page 
Scales 

The kinds of frame a FrameWidget can draw around.

Enumerator
None 
Line 
Shadow 

Length units.

Enumerator
Inch 
Millimeter 
Centimeter 
Point 
Pixel 
Scale 

Constructor & Destructor Documentation

FrameWidget::FrameWidget ( Graph plot)

Member Function Documentation

int FrameWidget::angle ( )
inline

References d_angle.

AttachPolicy FrameWidget::attachPolicy ( )
inline
QColor FrameWidget::backgroundColor ( )
inline
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
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
void FrameWidget::contextMenuEvent ( QContextMenuEvent *  )
inlineprotected
void FrameWidget::drawFrame ( QPainter *  p,
const QRect &  rect 
)
protectedvirtual
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
int FrameWidget::frameStyle ( )
inline
double FrameWidget::frameWidth ( )
inline

References d_frame_pen.

Referenced by LegendWidget::itemsHeight().

double FrameWidget::heightIn ( QWidget *  w,
Unit  unit 
)
static
bool FrameWidget::isOnTop ( )
inline
void FrameWidget::mousePressEvent ( QMouseEvent *  )
void FrameWidget::move ( const QPoint &  pos)
void FrameWidget::paintEvent ( QPaintEvent *  e)
protectedvirtual

Reimplemented in LegendWidget, ImageWidget, and TexWidget.

References drawFrame().

Graph* FrameWidget::plot ( )
inline
void FrameWidget::print ( QPainter *  p,
const QwtScaleMap  map[QwtPlot::axisCnt] 
)
virtual
void FrameWidget::resetCoordinates ( )
inline
void FrameWidget::resetOrigin ( )
inline
double FrameWidget::right ( )
inline
QString FrameWidget::saveToString ( )
virtual
void FrameWidget::setAngle ( int  ang)
inline

References d_angle.

void FrameWidget::setAttachPolicy ( AttachPolicy  attachTo)
void FrameWidget::setBackgroundColor ( const QColor &  c)
inline
void FrameWidget::setBrush ( const QBrush &  b)
inline
void FrameWidget::setCoordinates ( double  left,
double  top,
double  right,
double  bottom 
)
void FrameWidget::setFrameColor ( const QColor &  c)
inline
void FrameWidget::setFrameLineStyle ( const Qt::PenStyle &  s)
inline
void FrameWidget::setFramePen ( const QPen &  p)
inline
void FrameWidget::setFrameStyle ( int  style)
void FrameWidget::setFrameWidth ( double  w)
inline
void FrameWidget::setOnTop ( bool  on = true)
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 
)
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
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
void FrameWidget::showDialog ( )
signal
void FrameWidget::showMenu ( )
signal

Referenced by FrameWidget(), and showContextMenu().

void FrameWidget::showPropertiesDialog ( )
inline
void FrameWidget::updateCoordinates ( )
virtual
double FrameWidget::widthIn ( QWidget *  w,
Unit  unit 
)
static
double FrameWidget::xIn ( QWidget *  w,
Unit  unit 
)
static
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
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().

Member Data Documentation

int FrameWidget::d_angle
protected

Rotation angle: not implemented yet.

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
int FrameWidget::d_frame
protected
QPen FrameWidget::d_frame_pen
protected
bool FrameWidget::d_on_top
protected

Referenced by isOnTop(), saveToString(), and setOnTop().

Graph* FrameWidget::d_plot
protected
int FrameWidget::d_shadow_width
protected
double FrameWidget::d_x
protected
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
double FrameWidget::d_y_bottom
protected

The bottom side position in scale coordinates.

Referenced by bottom(), boundingRect(), resetCoordinates(), saveToString(), setCoordinates(), setFrameStyle(), setSize(), and updateCoordinates().


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