OpenMS
|
An abstract class acting as an interface for the different 1D annotation items. More...
#include <OpenMS/VISUAL/ANNOTATION/Annotation1DItem.h>
Public Member Functions | |
virtual | ~Annotation1DItem () |
Destructor. More... | |
const QRectF & | boundingBox () const |
Returns the current bounding box of this item on the canvas where it has last been drawn. More... | |
bool | isSelected () const |
Returns true if this item is currently selected on the canvas, else false. More... | |
void | setSelected (bool selected) |
Sets whether this item is currently selected on the canvas or not. More... | |
void | setText (const QString &text) |
Sets the text of the item. More... | |
const QString & | getText () const |
Returns the text of the item. More... | |
bool | editText () |
virtual void | ensureWithinDataRange (Plot1DCanvas *const canvas, const int layer_index)=0 |
Ensures that the item has coordinates within the visible area of the canvas. More... | |
virtual void | draw (Plot1DCanvas *const canvas, QPainter &painter, bool flipped=false)=0 |
Draws the item on painter . More... | |
virtual void | move (const PointXYType delta, const Gravitator &gr, const DimMapper< 2 > &dim_mapper)=0 |
Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses. More... | |
virtual Annotation1DItem * | clone () const =0 |
Creates a copy of the item on the heap and returns a pointer. More... | |
Protected Member Functions | |
Annotation1DItem (const QString &text) | |
Constructor. More... | |
Annotation1DItem (const Annotation1DItem &rhs) | |
Copy constructor. More... | |
void | drawBoundingBox_ (QPainter &painter) |
Draws the bounding_box_. More... | |
Protected Attributes | |
QRectF | bounding_box_ |
The current bounding box of this item on the canvas where it has last been drawn. More... | |
bool | selected_ |
Determines whether this item is currently selected on the canvas. More... | |
QString | text_ |
The displayed text. More... | |
An abstract class acting as an interface for the different 1D annotation items.
This is an abstract polymorphic class which acts as an interface between its subclasses and all containers and methods that contain or handle Annotation1DItem objects. If you want to add new kinds of annotation items, inherit this class, implement the pure virtual methods, and add everything else the item should have or be capable of.
|
virtual |
Destructor.
|
protected |
Constructor.
|
protected |
Copy constructor.
const QRectF& boundingBox | ( | ) | const |
Returns the current bounding box of this item on the canvas where it has last been drawn.
|
pure virtual |
Creates a copy of the item on the heap and returns a pointer.
Implemented in Annotation1DVerticalLineItem, Annotation1DTextItem, Annotation1DPeakItem< DataPoint >, Annotation1DDistanceItem, and Annotation1DCaret< DataPoint >.
|
pure virtual |
Draws the item on painter
.
Implemented in Annotation1DVerticalLineItem, Annotation1DTextItem, Annotation1DPeakItem< DataPoint >, Annotation1DDistanceItem, and Annotation1DCaret< DataPoint >.
|
protected |
Draws the bounding_box_.
Referenced by Annotation1DCaret< DataPoint >::draw(), and Annotation1DPeakItem< DataPoint >::draw().
bool editText | ( | ) |
open a GUI input field and let the user edit the text If the text was changed, true is returned; otherwise false.
|
pure virtual |
Ensures that the item has coordinates within the visible area of the canvas.
Implemented in Annotation1DVerticalLineItem, Annotation1DTextItem, Annotation1DPeakItem< DataPoint >, Annotation1DDistanceItem, and Annotation1DCaret< DataPoint >.
const QString& getText | ( | ) | const |
Returns the text of the item.
Referenced by Annotation1DPeakItem< DataPoint >::draw(), and Annotation1DPeakItem< DataPoint >::toPeakAnnotation().
bool isSelected | ( | ) | const |
Returns true if this item is currently selected on the canvas, else false.
|
pure virtual |
Moves the item on the drawing canvas; behavior depends on item type and is implemented in the subclasses.
Implemented in Annotation1DVerticalLineItem, Annotation1DTextItem, Annotation1DDistanceItem, Annotation1DPeakItem< DataPoint >, and Annotation1DCaret< DataPoint >.
void setSelected | ( | bool | selected | ) |
Sets whether this item is currently selected on the canvas or not.
void setText | ( | const QString & | text | ) |
Sets the text of the item.
|
protected |
The current bounding box of this item on the canvas where it has last been drawn.
Referenced by Annotation1DCaret< DataPoint >::draw(), and Annotation1DPeakItem< DataPoint >::draw().
|
protected |
Determines whether this item is currently selected on the canvas.
Referenced by Annotation1DCaret< DataPoint >::draw(), and Annotation1DPeakItem< DataPoint >::draw().
|
protected |
The displayed text.
Referenced by Annotation1DPeakItem< DataPoint >::draw(), and Annotation1DCaret< DataPoint >::setRichText().