~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to backend/wbpublic/objimpl/model/model_Diagram.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "stdafx.h"
 
2
 
 
3
#include <grts/structs.model.h>
 
4
 
 
5
#include <grtpp_util.h>
 
6
 
 
7
#include "wbcanvas/model_diagram_impl.h"
 
8
#include "wbcanvas/model_layer_impl.h"
 
9
 
 
10
//================================================================================
 
11
// model_Diagram
 
12
 
 
13
 
 
14
void model_Diagram::init()
 
15
{
 
16
}
 
17
 
 
18
void model_Diagram::set_data(ImplData *data)
 
19
{
 
20
  _data= data;
 
21
}
 
22
 
 
23
model_Diagram::~model_Diagram()
 
24
{
 
25
}
 
26
 
 
27
 
 
28
void model_Diagram::rootLayer(const model_LayerRef &value)
 
29
{
 
30
  grt::ValueRef ovalue(_rootLayer);
 
31
  // this member is owned by this object
 
32
  if (_rootLayer.is_valid())
 
33
    _rootLayer->get_data()->set_in_view(false);
 
34
  _rootLayer= value;
 
35
  if (_rootLayer.is_valid())
 
36
    _rootLayer->get_data()->set_in_view(true);
 
37
  owned_member_changed("rootLayer", ovalue, value);
 
38
}
 
39
 
 
40
 
 
41
void model_Diagram::addConnection(const model_ConnectionRef &connection)
 
42
{
 
43
  _data->add_connection(connection);
 
44
}
 
45
 
 
46
 
 
47
void model_Diagram::addFigure(const model_FigureRef &figure)
 
48
{
 
49
  _data->add_figure(figure);
 
50
}
 
51
 
 
52
 
 
53
void model_Diagram::deleteLayer(const model_LayerRef &layer)
 
54
{
 
55
  _data->delete_layer(layer);
 
56
}
 
57
 
 
58
 
 
59
void model_Diagram::removeConnection(const model_ConnectionRef &connection)
 
60
{
 
61
  _data->remove_connection(connection);
 
62
}
 
63
 
 
64
 
 
65
void model_Diagram::removeFigure(const model_FigureRef &figure)
 
66
{
 
67
  _data->remove_figure(figure);
 
68
}
 
69
 
 
70
 
 
71
void model_Diagram::blockUpdates(long flag)
 
72
{
 
73
  _data->block_updates(flag != 0);
 
74
}
 
75
 
 
76
 
 
77
void model_Diagram::selectObject(const model_ObjectRef &object)
 
78
{
 
79
  _data->select_object(object);
 
80
}
 
81
 
 
82
 
 
83
void model_Diagram::setPageCounts(long xpages, long ypages)
 
84
{
 
85
  _data->set_page_counts(xpages, ypages);
 
86
}
 
87
 
 
88
 
 
89
void model_Diagram::unselectAll()
 
90
{
 
91
  _data->unselect_all();
 
92
}
 
93
 
 
94
 
 
95
void model_Diagram::unselectObject(const model_ObjectRef &object)
 
96
{
 
97
  _data->unselect_object(object);
 
98
}
 
99