All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BuildGraphicsOutside.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 BuildGraphicsOutside.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "BuildGraphicsOutside.h"
30 #include "../../core/enum/Enums.h"
31 #include "../../outside/GridSettingsModel.h"
32 #include "../../outside/GridSettingsController.h"
33 #include "../../core/pattern/mvc/OutsideObserver.h"
34 #include "../outside/GridSettingsOutside.h"
35 #include "../../outside/ToolbarModel.h"
36 #include "../../outside/ToolbarController.h"
37 #include "../outside/ToolbarOutside.h"
38 #include "../../outside/PropertiesModel.h"
39 #include "../../outside/PropertiesController.h"
40 #include "../outside/PropertiesOutside.h"
41 #include "../../outside/ObjectInspectorModel.h"
42 #include "../../outside/ObjectInspectorController.h"
43 #include "../outside/ObjectInspectorOutside.h"
44 #include "../../outside/PageSetupModel.h"
45 #include "../../outside/PageSetupController.h"
46 #include "../outside/PageSetupOutside.h"
47 #include "../../outside/SystematicScaleModel.h"
48 #include "../../outside/SystematicScaleController.h"
49 #include "../outside/SystematicScaleOutside.h"
50 #include "../../outside/EditTemplateModel.h"
51 #include "../../outside/EditTemplateController.h"
52 #include "../outside/EditTemplateOutside.h"
53 #include "../../outside/TextGridSettingsModel.h"
54 #include "../../outside/TextGridSettingsController.h"
55 #include "../outside/TextGridSettingsOutside.h"
56 #include "../outside/MapLayerChoiceOutside.h"
57 #include "../../outside/MapLayerChoiceModel.h"
58 #include "../../outside/MapLayerChoiceController.h"
59 
60 // Qt
61 #include <QWidget>
62 
63 // STL
64 #include <sstream>
65 #include <string>
66 
68 {
69 
70 }
71 
73 {
74 
75 }
76 
78 {
79  QWidget* widget = 0;
80 
82 
83  if (type == enumObj->getGridSettings())
84  {
85  widget = createGridSettings();
86  }
87  if (type == enumObj->getToolbar())
88  {
89  widget = createToolbar();
90  }
91  if (type == enumObj->getPropertiesWindow())
92  {
93  widget = createProperties();
94  }
95  if (type == enumObj->getObjectInspectorWindow())
96  {
97  widget = createObjectInspector();
98  }
99  if (type == enumObj->getPageSetup())
100  {
101  widget = createPageSetup();
102  }
103  if (type == enumObj->getSystematicScale())
104  {
105  widget = createSystematicScale();
106  }
107  if (type == enumObj->getEditTemplate())
108  {
109  widget = createEditTemplate();
110  }
111  if (type == enumObj->getTextGridSettings())
112  {
113  widget = createTextGridSettingss();
114  }
115  if (type == enumObj->getMapLayerChoice())
116  {
117  widget = createMapLayerChoice();
118  }
119 
120  return widget;
121 }
122 
124 {
125  GridSettingsModel* model = new GridSettingsModel();
126 
127  GridSettingsController* controller = new GridSettingsController(model);
128  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
129 
130  GridSettingsOutside* view = dynamic_cast<GridSettingsOutside*>(itemObs);
131 
132  return view;
133 }
134 
136 {
137  ToolbarModel* model = new ToolbarModel();
138 
139  ToolbarController* controller = new ToolbarController(model);
140  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
141 
142  ToolbarOutside* view = dynamic_cast<ToolbarOutside*>(itemObs);
143 
144  return view;
145 }
146 
148 {
149  PropertiesModel* model = new PropertiesModel();
150 
151  PropertiesController* controller = new PropertiesController(model);
152  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
153 
154  PropertiesOutside* view = dynamic_cast<PropertiesOutside*>(itemObs);
155 
156  return view;
157 }
158 
160 {
162 
163  ObjectInspectorController* controller = new ObjectInspectorController(model);
164  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
165 
166  ObjectInspectorOutside* view = dynamic_cast<ObjectInspectorOutside*>(itemObs);
167 
168  return view;
169 }
170 
172 {
173  PageSetupModel* model = new PageSetupModel();
174 
175  PageSetupController* controller = new PageSetupController(model);
176  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
177 
178  PageSetupOutside* view = dynamic_cast<PageSetupOutside*>(itemObs);
179 
180  return view;
181 }
182 
184 {
186 
187  SystematicScaleController* controller = new SystematicScaleController(model);
188  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
189 
190  SystematicScaleOutside* view = dynamic_cast<SystematicScaleOutside*>(itemObs);
191 
192  return view;
193 }
194 
196 {
197  EditTemplateModel* model = new EditTemplateModel();
198 
199  EditTemplateController* controller = new EditTemplateController(model);
200  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
201 
202  EditTemplateOutside* view = dynamic_cast<EditTemplateOutside*>(itemObs);
203 
204  return view;
205 }
206 
208 {
210 
212  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
213 
214  TextGridSettingsOutside* view = dynamic_cast<TextGridSettingsOutside*>(itemObs);
215 
216  return view;
217 }
218 
220 {
222 
223  MapLayerChoiceController* controller = new MapLayerChoiceController(model);
224  OutsideObserver* itemObs = (OutsideObserver*)controller->getView();
225 
226  MapLayerChoiceOutside* view = dynamic_cast<MapLayerChoiceOutside*>(itemObs);
227 
228  return view;
229 }
230 
231 
232 
virtual EnumType * getTextGridSettings() const
Returns value that represents text grid settings (MVC widget) type belonging to enumeration.
Class to represent a graphic object (MVC component) and widget object (MVC widget) type enumeration...
virtual EnumType * getObjectInspectorWindow() const
Returns value that represents object inspector widget (MVC widget) type belonging to enumeration...
virtual EnumType * getGridSettings() const
Returns value that represents GridSettings window (MVC dialog) type belonging to enumeration.
QWidget * createOuside(te::layout::EnumType *type)
Method to create a widget from the type.
Properties tree for any item, MVC component, using Qt for presentation and editing.
virtual EnumType * getPageSetup() const
Returns value that represents page setup window (MVC dialog) type belonging to enumeration.
Abstract class to represent an observer. "View" part of MVC widget. All classes representing the grap...
virtual EnumObjectType * getEnumObjectType()
Returns graphic object (MVC component) and widget object (MVC widget) type enumeration.
Definition: Enums.cpp:62
Tree of names of all the items entered on the scene, MVC components, using Qt to present the name of ...
static Enums & getInstance()
It returns a reference to the singleton instance.
QWidget * createProperties()
Create a widget of Properties Browser type.
Class responsible for creating or building widgets. All objects are children of Qwidget and OutsideOb...
Window (QDialog) map grid setting (MapItem).
const Observer * getView()
Returns the "View" part of the MVC widget.
virtual EnumType * getToolbar() const
Returns value that represents toolbar widget (MVC widget) type belonging to enumeration.
virtual EnumType * getEditTemplate() const
Returns value that represents edit template widget (MVC widget) type belonging to enumeration...
virtual EnumType * getMapLayerChoice() const
Returns value that represents map layer choice (MVC Component) type belonging to enumeration.
virtual EnumType * getSystematicScale() const
Returns value that represents systematic scale window (MVC dialog) type belonging to enumeration...
QWidget * createObjectInspector()
Create a widget of Object Inspector type.
QWidget * createToolbar()
Create a widget of Toolbar type.
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
Definition: EnumType.h:48
Standard Toolbar for Layout. Includes Qt components for interaction between the user and the plugin/a...
QWidget * createSystematicScale()
Create a widget of Systematic Scale type.
QWidget * createTextGridSettingss()
Create a widget of Text Grid Settings type.
QWidget * createGridSettings()
Create a widget of GridSettings type.
virtual ~BuildGraphicsOutside()
Destructor.
virtual EnumType * getPropertiesWindow() const
Returns value that represents properties widget (MVC widget) type belonging to enumeration.
QWidget * createPageSetup()
Create a widget of Page Setup type.
QWidget * createMapLayerChoice()
Create a widget of Map Layer Choice type.
QWidget * createEditTemplate()
Create a widget of EditTemplate type.