All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ChartStyle.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/charts/ChartStyle.cpp
22 
23  \brief A class used to define a chart's style
24 */
25 
26 //Terralib
27 #include "../../../se/Fill.h"
28 #include "../../../se/Stroke.h"
29 #include "ChartStyle.h"
30 
31 //QT
32 #include "qcolor.h"
33 
35 {
36  m_title = "Chart";
37  m_titleFont = QFont("Arial", 16, QFont::Bold);
38  m_axisX = "Property X";
39  m_axisY = "Property Y";
40  m_axisFont = QFont("Arial", 14);
41  m_fill = new te::se::Fill();
42  m_stroke = new te::se::Stroke();
43  m_gridChecked = false;
44  m_backColor = QColor( Qt::white);
45 }
46 
47 te::qt::widgets::ChartStyle::ChartStyle(QString title, QFont titleFont, QString axisX, QString axisY, QFont axisFont, te::se::Fill* fill, te::se::Stroke* stroke, bool gridChecked, QColor color)
48 :m_title(title),
49  m_titleFont(titleFont),
50  m_axisX(axisX),
51  m_axisY(axisY),
52  m_axisFont(axisFont),
53  m_gridChecked(gridChecked),
54  m_fill(fill),
55  m_stroke(stroke),
56  m_backColor(color)
57 {
58 }
59 
61 {
62  delete m_fill;
63  delete m_stroke;
64 }
65 
67 {
68  return m_title;
69 }
70 
72 {
73  m_title = newTitle;
74 }
75 
77 {
78  return m_titleFont;
79 }
80 
82 {
83  m_titleFont = newTitleFont;
84 }
85 
87 {
88  return m_axisX;
89 }
90 
92 {
93  m_axisX = newAxisX;
94 }
95 
97 {
98  return m_axisY;
99 }
100 
102 {
103  m_axisY = newAxisY;
104 }
105 
107 {
108  return m_axisFont;
109 }
110 
112 {
113  m_axisFont = newAxisFont;
114 }
115 
116 
118 {
119  return m_fill;
120 }
121 
122 
124 {
125  delete m_fill;
126  m_fill = newFill;
127 }
128 
130 {
131  return m_stroke;
132 }
133 
135 {
136  delete m_stroke;
137  m_stroke = newStroke;
138 }
139 
141 {
142  return m_backColor;
143 }
144 
146 {
147  m_backColor = newColor;
148 }
149 
151 {
152  return m_gridChecked;
153 }
154 
156 {
157  m_gridChecked = newGridChecked;
158 }
void setFill(te::se::Fill *newFill)
It sets the style's fill.
Definition: ChartStyle.cpp:123
void setAxisFont(QFont newAxisFont)
It sets the axis' font.
Definition: ChartStyle.cpp:111
QString & getAxisX()
Returns a reference to the style's x axis label.
Definition: ChartStyle.cpp:86
QFont m_axisFont
The axis' font.
Definition: ChartStyle.h:220
QFont & getAxisFont()
Returns a reference to the axis' font.
Definition: ChartStyle.cpp:106
te::se::Stroke * getStroke()
Returns a pointer to the style's stroke.
Definition: ChartStyle.cpp:129
void setColor(QColor newColor)
It sets the style's color.
Definition: ChartStyle.cpp:145
QString & getAxisY()
Returns a reference to the style's y axis label.
Definition: ChartStyle.cpp:96
void setGridChecked(bool newGridChecked)
It sets the boolean used to decided weather to display the grid or not.
Definition: ChartStyle.cpp:155
void setTitle(QString newTitle)
It sets the style's title.
Definition: ChartStyle.cpp:71
QString & getTitle()
Returns a reference to the style's Title.
Definition: ChartStyle.cpp:66
te::se::Fill * m_fill
The chart's fill.
Definition: ChartStyle.h:222
QString m_axisY
The chart Y axis' label.
Definition: ChartStyle.h:219
void setStroke(te::se::Stroke *newStroke)
It sets the style's stroke.
Definition: ChartStyle.cpp:134
QString m_title
The chart's title.
Definition: ChartStyle.h:216
void setAxisY(QString newAxisY)
It sets the style's y axis label.
Definition: ChartStyle.cpp:101
QString m_axisX
The chart X axis' label.
Definition: ChartStyle.h:218
te::se::Fill * getFill()
Returns a pointer to the style's fill.
Definition: ChartStyle.cpp:117
void setAxisX(QString newAxisX)
It sets the style's x axis label.
Definition: ChartStyle.cpp:91
QColor & getColor()
Returns a reference to the style's color.
Definition: ChartStyle.cpp:140
A Fill specifies the pattern for filling an area geometry.
Definition: Fill.h:59
QFont & getTitleFont()
Returns a reference to the title's font.
Definition: ChartStyle.cpp:76
bool m_gridChecked
The boolean used to decide if the chart will have a background grid .
Definition: ChartStyle.h:221
void setTitleFont(QFont newTitleFont)
It sets the title's font.
Definition: ChartStyle.cpp:81
QFont m_titleFont
The title's font.
Definition: ChartStyle.h:217
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
bool getGridChecked()
Returns true if the grid is to be displayed, otherwise returns false.
Definition: ChartStyle.cpp:150
A class used to define a chartDisplay's style.
QColor m_backColor
The chart's background color.
Definition: ChartStyle.h:224
te::se::Stroke * m_stroke
The chart's stroke.
Definition: ChartStyle.h:223