casa
$Rev:20696$
|
#include <Annotation.h>
Public Member Functions | |
Annotation (QWidget *parent=NULL) | |
void | setDimensionsPosition (int locationX, int locationY) |
Changes the size of the annotation. | |
void | setDimensions (int width, int height) |
void | move (int positionX, int positionY) |
Moves the top left corner of the annotation to (positionX, positionY);. | |
bool | registerMousePosition (int mouseX, int mouseY) |
Stores the passed in values as reference points so that they can be later used to calculate how much to move the annotation. | |
void | mousePositionMoved (int mouseX, int mouseY) |
(mouseX,mouseY) are the new position of the mouse. | |
void | draw (QPainter *painter) |
void | setSelected (bool selected) |
bool | isSelected () const |
bool | contains (int posX, int posY) const |
virtual void | drawAnnotation (QPainter *painter)=0 |
void | showEditor () |
virtual | ~Annotation () |
void | propertiesChanged () |
Protected Member Functions | |
void | init () |
Protected Attributes | |
AnnotationEditor | annotationEditor |
int | pixelX |
Top left corner of the annotation. | |
int | pixelY |
int | width |
int | height |
int | mouseDownX |
Stored reference point for later calculation move amounts. | |
int | mouseDownY |
Private Types | |
enum | MouseLocation { TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT, INTERIOR } |
Private Member Functions | |
bool | isInCorner (int cornerX, int cornerY, int mouseX, int mouseY) const |
void | drawCorner (MouseLocation cornerLocation, QPainter *painter, int cornerX, int cornerY) |
Private Attributes | |
bool | selected |
QColor | foregroundColor |
const int | CORNER_SIZE |
const int | MIN_WIDTH |
const int | MIN_HEIGHT |
MouseLocation | mouseLocation |
Definition at line 18 of file Annotation.h.
enum casa::Annotation::MouseLocation [private] |
Definition at line 71 of file Annotation.h.
casa::Annotation::Annotation | ( | QWidget * | parent = NULL | ) |
virtual casa::Annotation::~Annotation | ( | ) | [virtual] |
bool casa::Annotation::contains | ( | int | posX, |
int | posY | ||
) | const |
void casa::Annotation::draw | ( | QPainter * | painter | ) |
virtual void casa::Annotation::drawAnnotation | ( | QPainter * | painter | ) | [pure virtual] |
Implemented in casa::AnnotationText.
void casa::Annotation::drawCorner | ( | MouseLocation | cornerLocation, |
QPainter * | painter, | ||
int | cornerX, | ||
int | cornerY | ||
) | [private] |
void casa::Annotation::init | ( | ) | [protected] |
bool casa::Annotation::isInCorner | ( | int | cornerX, |
int | cornerY, | ||
int | mouseX, | ||
int | mouseY | ||
) | const [private] |
bool casa::Annotation::isSelected | ( | ) | const |
void casa::Annotation::mousePositionMoved | ( | int | mouseX, |
int | mouseY | ||
) |
(mouseX,mouseY) are the new position of the mouse.
The difference between the stored position and the new position is used to calculate how much to move the top left corner of the annotation.
void casa::Annotation::move | ( | int | positionX, |
int | positionY | ||
) |
Moves the top left corner of the annotation to (positionX, positionY);.
void casa::Annotation::propertiesChanged | ( | ) | [virtual] |
Implements casa::PropertyListener.
Reimplemented in casa::AnnotationText.
bool casa::Annotation::registerMousePosition | ( | int | mouseX, |
int | mouseY | ||
) |
Stores the passed in values as reference points so that they can be later used to calculate how much to move the annotation.
Returns true if the mouse location has changed, say from a top right corner to the interior region of the annotation.
void casa::Annotation::setDimensions | ( | int | width, |
int | height | ||
) |
void casa::Annotation::setDimensionsPosition | ( | int | locationX, |
int | locationY | ||
) |
Changes the size of the annotation.
(locationX, locationY) are assumed to be the newer bottom right corner of the annotation.
void casa::Annotation::setSelected | ( | bool | selected | ) |
void casa::Annotation::showEditor | ( | ) |
AnnotationEditor casa::Annotation::annotationEditor [protected] |
Definition at line 58 of file Annotation.h.
const int casa::Annotation::CORNER_SIZE [private] |
Definition at line 77 of file Annotation.h.
QColor casa::Annotation::foregroundColor [private] |
Definition at line 76 of file Annotation.h.
int casa::Annotation::height [protected] |
Definition at line 64 of file Annotation.h.
const int casa::Annotation::MIN_HEIGHT [private] |
Definition at line 79 of file Annotation.h.
const int casa::Annotation::MIN_WIDTH [private] |
Definition at line 78 of file Annotation.h.
int casa::Annotation::mouseDownX [protected] |
Stored reference point for later calculation move amounts.
Definition at line 67 of file Annotation.h.
int casa::Annotation::mouseDownY [protected] |
Definition at line 68 of file Annotation.h.
MouseLocation casa::Annotation::mouseLocation [private] |
Definition at line 80 of file Annotation.h.
int casa::Annotation::pixelX [protected] |
Top left corner of the annotation.
Definition at line 61 of file Annotation.h.
int casa::Annotation::pixelY [protected] |
Definition at line 62 of file Annotation.h.
bool casa::Annotation::selected [private] |
Definition at line 75 of file Annotation.h.
int casa::Annotation::width [protected] |
Definition at line 63 of file Annotation.h.