All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Static Public Attributes
GeopsyGui::TimeWindow Class Reference

A colored time range. More...

#include <TimeWindow.h>

Inheritance diagram for GeopsyGui::TimeWindow:
GeopsyCore::TimeRange QGpCoreTools::XMLClass

List of all members.

Public Member Functions

const QColor & color () const
void setColor (const QColor &c)
 TimeWindow (double start=0.0, double end=0.0, const QColor &c=Qt::black)
 TimeWindow (const TimeWindow &o)
virtual void xml_attributes (XML_ATTRIBUTES_ARGS) const
virtual bool xml_setAttributes (XML_SETATTRIBUTES_ARGS)
virtual const QString & xml_tagName () const
virtual ~TimeWindow ()

Static Public Attributes

static const QString xmlTimeWindowTag = "TimeWindow"

Detailed Description

A colored time range.


Constructor & Destructor Documentation

GeopsyGui::TimeWindow::TimeWindow ( double  start = 0.0,
double  end = 0.0,
const QColor &  c = Qt::black 
) [inline]
      : TimeRange(start, end), XMLClass() {_color=c;}
      : TimeRange(o), XMLClass() {_color=o._color;}
virtual GeopsyGui::TimeWindow::~TimeWindow ( ) [inline, virtual]
{}

Member Function Documentation

const QColor& GeopsyGui::TimeWindow::color ( ) const [inline]
void GeopsyGui::TimeWindow::setColor ( const QColor &  c) [inline]

Reimplemented from QGpCoreTools::XMLClass.

References GeopsyCore::TimeRange::end(), and GeopsyCore::TimeRange::start().

Referenced by GeopsyGui::TimeWindowList::xml_writeProperties().

  {
    Q_UNUSED(context);
    static const QString keys[]={"start", "end", "color"};
    attributes.add(keys[0], QString::number(start()));
    attributes.add(keys[1], QString::number(end()));
    attributes.add(keys[2], _color.name());
  }

Reimplemented from QGpCoreTools::XMLClass.

References QGpCoreTools::endl(), GeopsyCore::TimeRange::setEnd(), GeopsyCore::TimeRange::setStart(), QGpCoreTools::StringSection::toString(), and QGpCoreTools::tr().

Referenced by GeopsyGui::TimeWindowList::xml_setProperty().

  {
    Q_UNUSED(context);
    XMLRestoreAttributeIterator it;
    for(it=attributes.begin(); it!=attributes.end();it++) {
      const StringSection& att=it.key();
      switch(att[0].unicode()) {
      case 's':
        setStart(it.value().toDouble());
        break;
      case 'e':
        setEnd(it.value().toDouble());
        break;
      case 'c':
        _color.setNamedColor(it.value().toString());
        break;
      default:
        App::stream() << tr("Bad attribute: %1").arg(att.toString()) << endl;
        return false;
      }
    }
    return true;
  }
virtual const QString& GeopsyGui::TimeWindow::xml_tagName ( ) const [inline, virtual]

Member Data Documentation

const QString GeopsyGui::TimeWindow::xmlTimeWindowTag = "TimeWindow" [static]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines