casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
casa::Annotation Class Reference

#include <Annotation.h>

Inheritance diagram for casa::Annotation:
casa::PropertyListener casa::AnnotationText

List of all members.

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

Detailed Description

Definition at line 18 of file Annotation.h.


Member Enumeration Documentation

Enumerator:
TOP_LEFT 
TOP_RIGHT 
BOTTOM_LEFT 
BOTTOM_RIGHT 
INTERIOR 

Definition at line 71 of file Annotation.h.


Constructor & Destructor Documentation

casa::Annotation::Annotation ( QWidget *  parent = NULL)
virtual casa::Annotation::~Annotation ( ) [virtual]

Member Function Documentation

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]
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);.

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)

Member Data Documentation

Definition at line 58 of file Annotation.h.

const int casa::Annotation::CORNER_SIZE [private]

Definition at line 77 of file Annotation.h.

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.

Stored reference point for later calculation move amounts.

Definition at line 67 of file Annotation.h.

Definition at line 68 of file Annotation.h.

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.

Definition at line 75 of file Annotation.h.

int casa::Annotation::width [protected]

Definition at line 63 of file Annotation.h.


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