All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EditTemplateOutside.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 EditTemplateOutside.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "EditTemplateOutside.h"
30 #include "ui_EditTemplate.h"
31 #include "../../core/pattern/mvc/OutsideObserver.h"
32 #include "../../core/pattern/mvc/OutsideController.h"
33 #include "../../core/pattern/singleton/Context.h"
34 
35 // STL
36 #include <string>
37 #include <sstream>
38 
40  QWidget(0),
41  OutsideObserver(controller, o),
42  m_ui(new Ui::EditTemplate)
43 {
44  m_ui->setupUi(this);
45 
46  init();
47 }
48 
50 {
51 
52 }
53 
55 {
56 
57 }
58 
60 {
61  setVisible(context.isShow());
62  if(context.isShow() == true)
63  show();
64  else
65  hide();
66 }
67 
68 void te::layout::EditTemplateOutside::setPosition( const double& x, const double& y )
69 {
70  move(x,y);
71  refresh();
72 }
73 
75 {
76  QPointF posF = pos();
77  qreal valuex = posF.x();
78  qreal valuey = posF.y();
79 
80  te::gm::Coord2D coordinate;
81  coordinate.x = valuex;
82  coordinate.y = valuey;
83 
84  return coordinate;
85 }
86 
88 {
89 
90 }
91 
93 {
94 
95 }
Abstract class to represent an observable. "Model" part of MVC component.
Definition: Observable.h:56
Class responsible for maintaining the drawing context of a MVC component. It is always used by the "M...
Definition: ContextItem.h:49
virtual void updateObserver(ContextItem context)
Reimplemented from Observer.
double y
y-coordinate.
Definition: Coord2D.h:114
double x
x-coordinate.
Definition: Coord2D.h:113
std::auto_ptr< Ui::EditTemplate > m_ui
Abstract class to represent an observer. "View" part of MVC widget. All classes representing the grap...
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
virtual void setPosition(const double &x, const double &y)
Change coordinate llx,lly of the MVC widget. Reimplement this function in a ItemController subclass t...
virtual te::gm::Coord2D getPosition()
Method that returns the position llx, lly Reimplement this function in a ItemObserver subclass to pro...
Abstract class to represent a controller. "Controller" part of MVC widget. All classes representing t...
EditTemplateOutside(OutsideController *controller, Observable *o)