7 #include "CurveStyle.h" 8 #include "DocumentSerialize.h" 10 #include <QTextStream> 11 #include <QXmlStreamReader> 12 #include <QXmlStreamWriter> 21 m_pointStyle (pointStyle),
22 m_lineStyle (lineStyle)
33 LOG4CPP_INFO_S ((*mainCat)) <<
"CurveStyle::loadXml";
38 QXmlStreamAttributes attributes = reader.attributes();
40 if (attributes.hasAttribute(DOCUMENT_SERIALIZE_CURVE_NAME)) {
42 curveName = attributes.value (DOCUMENT_SERIALIZE_CURVE_NAME).toString();
45 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
46 (reader.name() != DOCUMENT_SERIALIZE_POINT_STYLE)){
47 loadNextFromReader(reader);
54 if ((reader.tokenType() == QXmlStreamReader::StartElement) &&
55 (reader.name() == DOCUMENT_SERIALIZE_LINE_STYLE)) {
59 }
else if ((reader.tokenType() == QXmlStreamReader::StartElement) &
60 (reader.name() == DOCUMENT_SERIALIZE_POINT_STYLE)) {
69 reader.raiseError (QObject::tr (
"Cannot read curve style data"));
81 QTextStream &str)
const 83 str << indentation <<
"CurveStyle\n";
85 indentation += INDENTATION_DELTA;
94 const QString &curveName)
const 96 LOG4CPP_INFO_S ((*mainCat)) <<
"CurveStyle::saveXml";
98 writer.writeStartElement(DOCUMENT_SERIALIZE_CURVE_STYLE);
99 writer.writeAttribute (DOCUMENT_SERIALIZE_CURVE_NAME, curveName);
102 writer.writeEndElement();
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
CurveStyle()
Default constructor.
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
PointStyle pointStyle() const
Get method for PointStyle.
void setPointShape(PointShape shape)
Set method for curve point shape in specified curve.
void setLineConnectAs(CurveConnectAs curveConnectAs)
Set method for connect as method for lines in specified curve.
void setLineStyle(const LineStyle &lineStyle)
Set method for LineStyle.
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
void setPointRadius(int radius)
Set method for curve point radius.
void setPointLineWidth(int width)
Set method for curve point perimeter line width.
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
void setShape(PointShape shape)
Set method for point shape.
Details for a specific Point.
QString loadXml(QXmlStreamReader &reader)
Load from serialized xml. Returns the curve name.
LineStyle lineStyle() const
Get method for LineStyle.
void setPaletteColor(ColorPalette paletteColor)
Set method for point color.
Details for a specific Line.
void setLineColor(ColorPalette lineColor)
Set method for line color in specified curve.
void saveXml(QXmlStreamWriter &writer, const QString &curveName) const
Serialize to xml.
void setPointColor(ColorPalette curveColor)
Set method curve point color in specified curve.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setCurveConnectAs(CurveConnectAs curveConnectAs)
Set connect as.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setPaletteColor(ColorPalette paletteColor)
Set method for line color.
void setLineWidth(int width)
Set method for line width in specified curve.
void setWidth(int width)
Set width of line.
void setPointStyle(const PointStyle &pointStyle)
Set method for PointStyle.
void setLineWidth(int width)
Set method for line width.
void setRadius(int radius)
Set method for point radius.