All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PropertiesDock.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 PropertiesDock.cpp
22 
23  \brief
24 
25  \ingroup layout
26 */
27 
28 // TerraLib
29 #include "PropertiesDock.h"
30 #include "../../../layout/core/pattern/singleton/Context.h"
31 #include "../../../layout/qt/core/BuildGraphicsOutside.h"
32 #include "../../../layout/core/enum/Enums.h"
33 #include "../../../layout/qt/outside/PropertiesOutside.h"
34 
35 te::qt::plugins::layout::PropertiesDock::PropertiesDock( QWidget * parent, Qt::WindowFlags flags ) :
36  QDockWidget(parent, flags)
37 {
38  setVisible(false);
39  setWindowTitle("Properties");
40  setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
41 
42  create();
43 
44  setWidget(m_properties);
45 }
46 
48 {
49 
50 }
51 
53 {
54  te::layout::AbstractBuildGraphicsOutside* abstractBuildOutside = te::layout::Context::getInstance().getAbstractBuildGraphicsOutside();
55  if(!abstractBuildOutside)
56  {
57  return;
58  }
59 
60  te::layout::BuildGraphicsOutside* buildOutside = dynamic_cast<te::layout::BuildGraphicsOutside*>(abstractBuildOutside);
61  if(!buildOutside)
62  {
63  return;
64  }
65 
66  te::layout::EnumObjectType* objectType = te::layout::Enums::getInstance().getEnumObjectType();
67  if(!objectType)
68  {
69  return;
70  }
71 
72  QWidget* widget = buildOutside->createOuside(objectType->getPropertiesWindow());
73  if(!widget)
74  {
75  return;
76  }
77  m_properties = dynamic_cast<te::layout::PropertiesOutside*>(widget);
78 }
79 
81 {
82  return m_properties;
83 }
84 
85 
PropertiesDock(QWidget *parent=0, Qt::WindowFlags flags=0)
Class to represent a graphic object (MVC component) and widget object (MVC widget) type 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.
te::layout::PropertiesOutside * getPropertiesOutside()
Abstract class for build MVC widgets.
static Context & getInstance()
It returns a reference to the singleton instance.
Class responsible for creating or building widgets. All objects are children of Qwidget and OutsideOb...
te::layout::PropertiesOutside * m_properties
virtual EnumType * getPropertiesWindow() const
Returns value that represents properties widget (MVC widget) type belonging to enumeration.