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

Subclass of PlotMouseTool for drawing/managing annotations on the plot canvases of PlotMSApp. More...

#include <PlotMSAnnotator.h>

Inheritance diagram for casa::PlotMSAnnotator:
casa::PlotMouseTool casa::PlotMSPlotManagerWatcher casa::PlotWheelEventHandler casa::PlotMouseMoveEventHandler casa::PlotMouseDragEventHandler casa::PlotMouseReleaseEventHandler casa::PlotMousePressEventHandler casa::PlotClickEventHandler casa::PlotSelectEventHandler casa::PlotTool

List of all members.

Public Types

enum  Mode {
  TEXT,
  RECTANGLE
}
 Static //. More...

Public Member Functions

 PlotMSAnnotator (PlotMSApp *parent, Mode startingMode=TEXT)
 Non-Static //.
 ~PlotMSAnnotator ()
 Destructor.
Mode drawingMode () const
 Gets/Sets the current drawing mode.
void setDrawingMode (Mode mode)
PlotFontPtr textFont () const
 Gets/Sets the current text properties (null means default for PlotAnnotation object).
void setTextFont (const PlotFontPtr font)
PlotLinePtr textOutline () const
void setTextOutline (const PlotLinePtr outline)
PlotAreaFillPtr textBackground () const
void setTextBackground (const PlotAreaFillPtr background)
PlotLinePtr rectangleLine () const
 Gets/Sets the current rectangle properties (null means default for PlotShapeRectangle object).
void setRectangleLine (const PlotLinePtr line)
PlotAreaFillPtr rectangleAreaFill () const
void setRectangleAreaFill (const PlotAreaFillPtr fill)
void clearText (PlotCanvas *canvas=NULL)
 Clears all text/rectangle annotations off the given canvas.
void clearRectangles (PlotCanvas *canvas=NULL)
void clearAll (PlotCanvas *canvas=NULL)
void setActive (bool isActive=true)
 Overrides PlotTool::setActive().
void handleMouseEvent (const PlotEvent &event)
 Implements PlotMouseTool::handleMouseEvent().
void plotsChanged (const PlotMSPlotManager &manager)
 Implements PlotMSPlotManagerWatcher::plotChanged().

Protected Member Functions

void setActions (QAction *annotateAction, const QMap< PlotMSAction::Type, QAction * > &actionMap, PlotFactoryPtr factory)
 Sets the annotate and mode actions and the factory to the given.
void attach (PlotCanvas *canvas)
 Overrides PlotTool::attach().
void detach ()
 Overrides PlotTool::detach().

Private Member Functions

void setDefaults ()
 Sets properties to their defaults.

Private Attributes

PlotMSAppitsParent_
 Parent.
PlotFactoryPtr itsFactory_
 Factory for generating plot objects.
Mode itsMode_
 Current drawing mode.
QAction * itsAnnotateAction_
 Actions to keep updated.
QMap< Mode, QAction * > itsModeActions_
QMultiMap< PlotCanvas
*, PlotAnnotationPtr > 
itsAText_
 Text annotations.
PlotFontPtr itsTextFont_
 Current text properties.
PlotLinePtr itsTextOutline_
PlotAreaFillPtr itsTextFill_
QMultiMap< PlotCanvas
*, PlotShapeRectanglePtr > 
itsARect_
 Rectangle annotations.
PlotLinePtr itsRectLine_
 Current rectangle properties.
PlotAreaFillPtr itsRectFill_

Friends

class PlotMSPlotter

Detailed Description

Subclass of PlotMouseTool for drawing/managing annotations on the plot canvases of PlotMSApp.

Definition at line 46 of file PlotMSAnnotator.h.


Member Enumeration Documentation

Static //.

Drawing mode for the annotator.

Enumerator:
TEXT 
RECTANGLE 

Definition at line 55 of file PlotMSAnnotator.h.


Constructor & Destructor Documentation

casa::PlotMSAnnotator::PlotMSAnnotator ( PlotMSApp parent,
Mode  startingMode = TEXT 
)

Non-Static //.

Constructor which takes the PlotMS parent and optional starting mode.

Destructor.


Member Function Documentation

void casa::PlotMSAnnotator::attach ( PlotCanvas canvas) [protected, virtual]

Overrides PlotTool::attach().

Reimplemented from casa::PlotTool.

void casa::PlotMSAnnotator::clearAll ( PlotCanvas canvas = NULL)
void casa::PlotMSAnnotator::clearText ( PlotCanvas canvas = NULL)

Clears all text/rectangle annotations off the given canvas.

If the given canvas is NULL, then it clears them from all canvases.

void casa::PlotMSAnnotator::detach ( ) [protected, virtual]

Overrides PlotTool::detach().

Reimplemented from casa::PlotTool.

Gets/Sets the current drawing mode.

void casa::PlotMSAnnotator::handleMouseEvent ( const PlotEvent event) [virtual]
void casa::PlotMSAnnotator::plotsChanged ( const PlotMSPlotManager manager) [virtual]

Implements PlotMSPlotManagerWatcher::plotChanged().

Removes annotations that are attached to canvases that no longer exist.

Implements casa::PlotMSPlotManagerWatcher.

Gets/Sets the current rectangle properties (null means default for PlotShapeRectangle object).

Only applies to future rectangle annotations.

void casa::PlotMSAnnotator::setActions ( QAction *  annotateAction,
const QMap< PlotMSAction::Type, QAction * > &  actionMap,
PlotFactoryPtr  factory 
) [protected]

Sets the annotate and mode actions and the factory to the given.

MUST be called before the annotator is used.

void casa::PlotMSAnnotator::setActive ( bool  isActive = true) [virtual]

Overrides PlotTool::setActive().

Reimplemented from casa::PlotTool.

Sets properties to their defaults.

Gets/Sets the current text properties (null means default for PlotAnnotation object).

Only applies to future text annotations.


Friends And Related Function Documentation

friend class PlotMSPlotter [friend]

Definition at line 49 of file PlotMSAnnotator.h.


Member Data Documentation

Actions to keep updated.

Definition at line 141 of file PlotMSAnnotator.h.

QMultiMap<PlotCanvas*, PlotShapeRectanglePtr> casa::PlotMSAnnotator::itsARect_ [private]

Rectangle annotations.

Definition at line 156 of file PlotMSAnnotator.h.

QMultiMap<PlotCanvas*, PlotAnnotationPtr> casa::PlotMSAnnotator::itsAText_ [private]

Text annotations.

Definition at line 146 of file PlotMSAnnotator.h.

Factory for generating plot objects.

Definition at line 134 of file PlotMSAnnotator.h.

Current drawing mode.

Definition at line 137 of file PlotMSAnnotator.h.

QMap<Mode, QAction*> casa::PlotMSAnnotator::itsModeActions_ [private]

Definition at line 142 of file PlotMSAnnotator.h.

Parent.

Definition at line 131 of file PlotMSAnnotator.h.

Definition at line 161 of file PlotMSAnnotator.h.

Current rectangle properties.

Definition at line 160 of file PlotMSAnnotator.h.

Definition at line 152 of file PlotMSAnnotator.h.

Current text properties.

Definition at line 150 of file PlotMSAnnotator.h.

Definition at line 151 of file PlotMSAnnotator.h.


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