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

High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS. More...

#include <PlotMSPlotter.qo.h>

Inheritance diagram for casa::PlotMSPlotter:
casa::PlotDrawWatcher

List of all members.

Public Slots

void showError (const String &message, const String &title, bool isWarning)
 Shows the given error/warning message in a GUI window.
void showMessage (const String &message, const String &title)
 Shows the given informational message in a GUI window.
void showAbout ()
 Slot for showing an "about" dialog.
void prepareForPlotting ()
 Take any clean-up actions before a Plot is made 1) unclick any zoom, pan, etc buttons to avoid bug in zoom stack 2) ...

Public Member Functions

 PlotMSPlotter (PlotMSApp *parent, Plotter::Implementation impl=Plotter::DEFAULT)
 Non-Static //.
 ~PlotMSPlotter ()
 Destructor.
PlotMSAppgetParent ()
 Accessor methods.
PlotFactoryPtr getFactory ()
PlotterPtr getPlotter ()
QtProgressWidgetgetProgressWidget ()
PlotMSPlotTabgetPlotTab ()
PlotMSToolsTabgetToolsTab ()
PlotMSOptionsTabgetOptionsTab ()
PlotMSFlaggingTabgetFlaggingTab ()
PlotMSAnnotatorgetAnnotator ()
bool isDrawing () const
 
     

bool isClosed () const
void showGUI (bool show=true)
 Execution Methods //.
bool guiShown () const
 Returns true if the GUI is currently visible, false otherwise.
int execLoop ()
 Enters the plotter's execution loop, and returns its return value.
int showAndExec (bool show=true)
 See showGUI() and execLoop().
void doThreadedOperation (PlotMSThread *thread)
 Runs the given operation thread, keeping GUI and progress information synchronized as necessary.
bool canvasDrawBeginning (PlotOperationPtr drawOperation, bool drawingIsThreaded, int drawnLayersFlag)
 Implements PlotDrawWatcher::canvasDrawBeginning().
void showIterationButtons (bool show)
 GUI Methods //.
bool showQuestion (const String &message, const String &title)
 Pops up a dialog to ask the user the given question with the given window title.
void holdDrawing ()
 Holds/Releases drawing on all visible plot canvases.
void releaseDrawing ()
bool allDrawingHeld () const
 Returns true if drawing is being held on ALL visible plot canvases, false otherwise.
vector< PlotCanvasPtrcurrentCanvases ()
 Returns all currently shown canvases in the plotter.
void setWindowTitle (const String &windowTitle)
 Plotter Customization Methods //.
void setStatusText (const String &statusText)
 Sets the status bar text to the given.
void clearStatusText ()
 Clears the status bar text.
void setToolButtonStyle (Qt::ToolButtonStyle style)
 Overrides QMainWindow::setToolButtonStyle().
const QMap< PlotMSAction::Type,
QAction * > & 
plotActionMap () const
 Action Methods //.
void synchronizeAction (PlotMSAction::Type action, QAbstractButton *button)
 Synchronizes the given button with the given action type.
String actionText (PlotMSAction::Type type)
 Gets/Sets the text for the QAction associated with the given PlotMSApp action.
void setActionText (PlotMSAction::Type type, const String &text)
bool actionIsChecked (PlotMSAction::Type type) const
 Gets/Sets whether the QAction associated with the given PlotMSApp action is checked.
void setActionIsChecked (PlotMSAction::Type type, bool checked, bool alsoTriggerAction=false)
bool exportPlot (const PlotExportFormat &format, const bool interactive, const bool async)
 export a plot to a file

Static Public Member Functions

static String aboutText (Plotter::Implementation implementation, bool useHTML=true)
 Static //.

Protected Member Functions

void closeEvent (QCloseEvent *event)
 Overrides QWidget::closeEvent(), in case we're dealing with a plotter that isn't Qt and thus is in its own window (and possibly its own execution loop).

Private Slots

void action_ ()
 Method for when an action has been triggered.
void action (QAction *which)
 Method for when the given action has been triggered.
void currentThreadFinished ()
 Slot for when the currently running thread is finished.

Private Member Functions

bool _triggerAction (PlotMSAction &action)
void initialize (Plotter::Implementation impl)
 Initializes the plotter with the given implementation.

Private Attributes

PlotMSAppitsParent_
 PlotMSApp parent.
bool isQt_
 Flag for whether the underlying Plotter is Qt-based or not.
bool isClosed_
 Flag for whether the widget is open or not.
PlotFactoryPtr itsFactory_
 Plot factory.
PlotterPtr itsPlotter_
 Plotter.
QList< QWidget * > itsEnableWidgets_
 Widgets to be enabled/disabled during threading.
PlotMSPlotTabitsPlotTab_
 Plot tab.
PlotMSFlaggingTabitsFlaggingTab_
 Flagging tab (on the plot tab).
PlotMSToolsTabitsToolsTab_
 Tools tab.
PlotMSAnnotatorTabitsAnnotatorTab_
 Annotator tab.
PlotMSOptionsTabitsOptionsTab_
 Options tab.
QList< QToolButton * > itsToolButtons_
 Tool buttons on the tabs.
QtProgressWidgetitsThreadProgress_
 Widget for displaying thread progress.
PlotMSThreaditsCurrentThread_
 Current thread (or NULL for none).
vector< PlotMSThread * > itsWaitingThreads_
 Waiting threads.
QMap< PlotMSAction::Type,
QAction * > 
itsActionMap_
 Map between PlotMSApp actions and QActions.
QtActionSynchronizer itsActionSynchronizer_
 Action synchronizer.
PlotMSAnnotator itsAnnotator_
 Annotator tool.
QString itsAboutString_
 "About" string.

Detailed Description

High(ish)-level plotter class that manages the GUI (semi-) transparently to the rest of PlotMS.

Definition at line 57 of file PlotMSPlotter.qo.h.


Constructor & Destructor Documentation

Non-Static //.

Constructor that creates a plotter with the given parent using the given implementation.

Destructor.


Member Function Documentation

bool casa::PlotMSPlotter::_triggerAction ( PlotMSAction action) [private]
static String casa::PlotMSPlotter::aboutText ( Plotter::Implementation  implementation,
bool  useHTML = true 
) [static]

Static //.

Returns "about" text for the given implementation, using HTML or not.

void casa::PlotMSPlotter::action ( QAction *  which) [private, slot]

Method for when the given action has been triggered.

Referenced by action_().

void casa::PlotMSPlotter::action_ ( ) [inline, private, slot]

Method for when an action has been triggered.

Definition at line 284 of file PlotMSPlotter.qo.h.

References action().

Gets/Sets whether the QAction associated with the given PlotMSApp action is checked.

Has no effect on actions that are not checkable.

Gets/Sets the text for the QAction associated with the given PlotMSApp action.

Returns true if drawing is being held on ALL visible plot canvases, false otherwise.

bool casa::PlotMSPlotter::canvasDrawBeginning ( PlotOperationPtr  drawOperation,
bool  drawingIsThreaded,
int  drawnLayersFlag 
) [virtual]

Clears the status bar text.

Definition at line 160 of file PlotMSPlotter.qo.h.

References setStatusText().

void casa::PlotMSPlotter::closeEvent ( QCloseEvent *  event) [protected]

Overrides QWidget::closeEvent(), in case we're dealing with a plotter that isn't Qt and thus is in its own window (and possibly its own execution loop).

Returns all currently shown canvases in the plotter.

Slot for when the currently running thread is finished.

Performs cleanup and starts next waiting thread if applicable.

Runs the given operation thread, keeping GUI and progress information synchronized as necessary.

The given thread will be deleted upon completion.

Enters the plotter's execution loop, and returns its return value.

Only during this execution loops will GUI windows be shown and GUI events be handled. The execution loop ends when the user clicks the "close" or "quit" buttons. This method can be called multiple times.

Referenced by showAndExec().

bool casa::PlotMSPlotter::exportPlot ( const PlotExportFormat format,
const bool  interactive,
const bool  async 
)

export a plot to a file

Definition at line 90 of file PlotMSPlotter.qo.h.

References itsAnnotator_.

Definition at line 83 of file PlotMSPlotter.qo.h.

References itsFactory_.

Definition at line 89 of file PlotMSPlotter.qo.h.

References itsFlaggingTab_.

Definition at line 88 of file PlotMSPlotter.qo.h.

References itsOptionsTab_.

Accessor methods.

Definition at line 82 of file PlotMSPlotter.qo.h.

References itsParent_.

Definition at line 86 of file PlotMSPlotter.qo.h.

References itsPlotTab_.

Definition at line 84 of file PlotMSPlotter.qo.h.

References itsPlotter_.

Definition at line 85 of file PlotMSPlotter.qo.h.

References itsThreadProgress_.

Definition at line 87 of file PlotMSPlotter.qo.h.

References itsToolsTab_.

Returns true if the GUI is currently visible, false otherwise.

Holds/Releases drawing on all visible plot canvases.

Initializes the plotter with the given implementation.

MUST be called from constructors.

     

const QMap<PlotMSAction::Type, QAction*>& casa::PlotMSPlotter::plotActionMap ( ) const

Action Methods //.

Returns a map between PlotMSApp actions and the QActions associated with them in the GUI. Triggering the QActions will trigger the proper PlotMSApp action, and the QAction will be kept properly checked as needed.

Take any clean-up actions before a Plot is made 1) unclick any zoom, pan, etc buttons to avoid bug in zoom stack 2) ...

anything else needed in the future ...

void casa::PlotMSPlotter::setActionIsChecked ( PlotMSAction::Type  type,
bool  checked,
bool  alsoTriggerAction = false 
)
void casa::PlotMSPlotter::setStatusText ( const String statusText)

Sets the status bar text to the given.

Referenced by clearStatusText().

void casa::PlotMSPlotter::setToolButtonStyle ( Qt::ToolButtonStyle  style)

Overrides QMainWindow::setToolButtonStyle().

void casa::PlotMSPlotter::setWindowTitle ( const String windowTitle)

Plotter Customization Methods //.

Sets the window title to the given.

Slot for showing an "about" dialog.

int casa::PlotMSPlotter::showAndExec ( bool  show = true) [inline]

See showGUI() and execLoop().

Definition at line 112 of file PlotMSPlotter.qo.h.

References execLoop(), casa::dbus::show(), and showGUI().

void casa::PlotMSPlotter::showError ( const String message,
const String title,
bool  isWarning 
) [slot]

Shows the given error/warning message in a GUI window.

void casa::PlotMSPlotter::showGUI ( bool  show = true)

Execution Methods //.

Shows/hides the GUI.

Referenced by showAndExec().

GUI Methods //.

Shows/Hides the "iteration" widgets and actions on the GUI.

void casa::PlotMSPlotter::showMessage ( const String message,
const String title 
) [slot]

Shows the given informational message in a GUI window.

bool casa::PlotMSPlotter::showQuestion ( const String message,
const String title 
)

Pops up a dialog to ask the user the given question with the given window title.

Returns true if the user says "Yes"; false for "No" or otherwise rejecting the dialog.

void casa::PlotMSPlotter::synchronizeAction ( PlotMSAction::Type  action,
QAbstractButton *  button 
)

Synchronizes the given button with the given action type.

(See QtActionSynchronizer class.)


Member Data Documentation

Flag for whether the widget is open or not.

Definition at line 225 of file PlotMSPlotter.qo.h.

Flag for whether the underlying Plotter is Qt-based or not.

Definition at line 222 of file PlotMSPlotter.qo.h.

"About" string.

Definition at line 273 of file PlotMSPlotter.qo.h.

Map between PlotMSApp actions and QActions.

Definition at line 264 of file PlotMSPlotter.qo.h.

Action synchronizer.

Definition at line 267 of file PlotMSPlotter.qo.h.

Annotator tool.

Definition at line 270 of file PlotMSPlotter.qo.h.

Referenced by getAnnotator().

Annotator tab.

Definition at line 246 of file PlotMSPlotter.qo.h.

Current thread (or NULL for none).

Definition at line 258 of file PlotMSPlotter.qo.h.

QList<QWidget*> casa::PlotMSPlotter::itsEnableWidgets_ [private]

Widgets to be enabled/disabled during threading.

Definition at line 234 of file PlotMSPlotter.qo.h.

Plot factory.

Definition at line 228 of file PlotMSPlotter.qo.h.

Referenced by getFactory().

Flagging tab (on the plot tab).

Definition at line 240 of file PlotMSPlotter.qo.h.

Referenced by getFlaggingTab().

Options tab.

Definition at line 249 of file PlotMSPlotter.qo.h.

Referenced by getOptionsTab().

PlotMSApp parent.

Definition at line 219 of file PlotMSPlotter.qo.h.

Referenced by getParent().

Plot tab.

Definition at line 237 of file PlotMSPlotter.qo.h.

Referenced by getPlotTab().

Plotter.

Definition at line 231 of file PlotMSPlotter.qo.h.

Referenced by getPlotter().

Widget for displaying thread progress.

Definition at line 255 of file PlotMSPlotter.qo.h.

Referenced by getProgressWidget().

QList<QToolButton*> casa::PlotMSPlotter::itsToolButtons_ [private]

Tool buttons on the tabs.

Definition at line 252 of file PlotMSPlotter.qo.h.

Tools tab.

Definition at line 243 of file PlotMSPlotter.qo.h.

Referenced by getToolsTab().

Waiting threads.

Definition at line 261 of file PlotMSPlotter.qo.h.


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