bpp-phyl
2.1.0
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Friends
Pages
TreeDrawingListener.h
Go to the documentation of this file.
1
//
2
// File: TreeDrawingListener.h
3
// Created by: Julien Dutheil
4
// Created on: Tue May 18 10:33 2010
5
//
6
7
/*
8
Copyright or © or Copr. Bio++ Development Team, (2010)
9
10
This software is a computer program whose purpose is to provide
11
graphic components to develop bioinformatics applications.
12
13
This software is governed by the CeCILL license under French law and
14
abiding by the rules of distribution of free software. You can use,
15
modify and/ or redistribute the software under the terms of the CeCILL
16
license as circulated by CEA, CNRS and INRIA at the following URL
17
"http://www.cecill.info".
18
19
As a counterpart to the access to the source code and rights to copy,
20
modify and redistribute granted by the license, users are provided only
21
with a limited warranty and the software's author, the holder of the
22
economic rights, and the successive licensors have only limited
23
liability.
24
25
In this respect, the user's attention is drawn to the risks associated
26
with loading, using, modifying and/or developing or reproducing the
27
software by the user in light of its specific status of free software,
28
that may mean that it is complicated to manipulate, and that also
29
therefore means that it is reserved for developers and experienced
30
professionals having in-depth computer knowledge. Users are therefore
31
encouraged to load and test the software's suitability as regards their
32
requirements in conditions enabling the security of their systems and/or
33
data to be ensured and, more generally, to use and operate it in the
34
same conditions as regards security.
35
36
The fact that you are presently reading this means that you have had
37
knowledge of the CeCILL license and that you accept its terms.
38
*/
39
40
#ifndef _TREEDRAWINGLISTENER_H_
41
#define _TREEDRAWINGLISTENER_H_
42
43
#include "
TreeDrawing.h
"
44
45
#include <
Bpp/Clonable.h
>
46
47
namespace
bpp {
48
55
class
TreeDrawingListener
:
56
public
virtual
Clonable
57
{
58
public
:
59
#ifndef NO_VIRTUAL_COV
60
TreeDrawingListener
*
61
#else
62
Clonable
*
63
#endif
64
clone
()
const
= 0;
65
66
virtual
void
beforeDrawTree
(
const
DrawTreeEvent
& event) = 0;
67
virtual
void
afterDrawTree
(
const
DrawTreeEvent
& event) = 0;
68
virtual
void
beforeDrawNode
(
const
DrawNodeEvent
& event) = 0;
69
virtual
void
afterDrawNode
(
const
DrawNodeEvent
& event) = 0;
70
virtual
void
beforeDrawBranch
(
const
DrawBranchEvent
& event) = 0;
71
virtual
void
afterDrawBranch
(
const
DrawBranchEvent
& event) = 0;
72
77
virtual
bool
isAutonomous
()
const
= 0;
78
79
virtual
bool
isEnabled
()
const
= 0;
80
virtual
void
enable
(
bool
tf) = 0;
81
};
82
83
87
class
TreeDrawingListenerAdapter
:
88
public
virtual
TreeDrawingListener
89
{
90
private
:
91
bool
autonomous_
;
92
bool
enabled_
;
93
94
public
:
95
TreeDrawingListenerAdapter
(
bool
autonomous) :
autonomous_
(autonomous),
enabled_
(true) {}
96
97
public
:
98
void
beforeDrawTree
(
const
DrawTreeEvent
& event) {}
99
void
afterDrawTree
(
const
DrawTreeEvent
& event) {}
100
void
beforeDrawNode
(
const
DrawNodeEvent
& event) {}
101
void
afterDrawNode
(
const
DrawNodeEvent
& event) {}
102
void
beforeDrawBranch
(
const
DrawBranchEvent
& event) {}
103
void
afterDrawBranch
(
const
DrawBranchEvent
& event) {}
104
bool
isAutonomous
()
const
{
return
autonomous_
; }
105
bool
isEnabled
()
const
{
return
enabled_
; }
106
void
enable
(
bool
tf) {
enabled_
= tf; }
107
};
108
109
110
114
class
NodesIdTreeDrawingListener
:
115
public
TreeDrawingListenerAdapter
116
{
117
private
:
118
const
TreeDrawingSettings
*
settings_
;
119
120
public
:
121
NodesIdTreeDrawingListener
(
const
TreeDrawingSettings
* settings,
bool
autonomous =
false
) :
122
TreeDrawingListenerAdapter
(autonomous),
123
settings_
(settings)
124
{}
125
126
NodesIdTreeDrawingListener
(
const
NodesIdTreeDrawingListener
& lntdl) :
127
TreeDrawingListenerAdapter
(lntdl),
128
settings_
(lntdl.
settings_
) {}
129
130
NodesIdTreeDrawingListener
&
operator=
(
const
NodesIdTreeDrawingListener
& lntdl)
131
{
132
TreeDrawingListenerAdapter::operator=(lntdl);
133
settings_
= lntdl.
settings_
;
134
return
*
this
;
135
}
136
137
NodesIdTreeDrawingListener
*
clone
()
const
{
return
new
NodesIdTreeDrawingListener
(*
this
); }
138
139
public
:
140
void
afterDrawNode
(
const
DrawNodeEvent
& event);
141
142
};
143
144
148
class
LeafNamesTreeDrawingListener
:
149
public
TreeDrawingListenerAdapter
150
{
151
private
:
152
const
TreeDrawingSettings
*
settings_
;
153
154
public
:
155
LeafNamesTreeDrawingListener
(
const
TreeDrawingSettings
* settings,
bool
autonomous =
false
) :
156
TreeDrawingListenerAdapter
(autonomous),
157
settings_
(settings)
158
{}
159
160
LeafNamesTreeDrawingListener
(
const
LeafNamesTreeDrawingListener
& lntdl) :
161
TreeDrawingListenerAdapter
(lntdl),
162
settings_
(lntdl.
settings_
)
163
{}
164
165
LeafNamesTreeDrawingListener
&
operator=
(
const
LeafNamesTreeDrawingListener
& lntdl)
166
{
167
TreeDrawingListenerAdapter::operator=(lntdl);
168
settings_
= lntdl.
settings_
;
169
return
*
this
;
170
}
171
172
LeafNamesTreeDrawingListener
*
clone
()
const
{
return
new
LeafNamesTreeDrawingListener
(*
this
); }
173
174
public
:
175
void
afterDrawNode
(
const
DrawNodeEvent
& event);
176
177
};
178
179
187
class
BranchLengthsTreeDrawingListener
:
188
public
TreeDrawingListenerAdapter
189
{
190
private
:
191
const
TreeDrawingSettings
*
settings_
;
192
193
public
:
194
BranchLengthsTreeDrawingListener
(
const
TreeDrawingSettings
* settings,
bool
autonomous =
false
) :
195
TreeDrawingListenerAdapter
(autonomous),
196
settings_
(settings)
197
{}
198
199
BranchLengthsTreeDrawingListener
(
const
BranchLengthsTreeDrawingListener
& lntdl) :
200
TreeDrawingListenerAdapter
(lntdl),
201
settings_
(lntdl.
settings_
)
202
{}
203
204
BranchLengthsTreeDrawingListener
&
operator=
(
const
BranchLengthsTreeDrawingListener
& lntdl)
205
{
206
TreeDrawingListenerAdapter::operator=(lntdl);
207
settings_
= lntdl.
settings_
;
208
return
*
this
;
209
}
210
211
BranchLengthsTreeDrawingListener
*
clone
()
const
{
return
new
BranchLengthsTreeDrawingListener
(*
this
); }
212
213
public
:
214
void
afterDrawBranch
(
const
DrawBranchEvent
& event);
215
216
};
217
218
226
class
BootstrapValuesTreeDrawingListener
:
227
public
TreeDrawingListenerAdapter
228
{
229
private
:
230
const
TreeDrawingSettings
*
settings_
;
231
232
public
:
233
BootstrapValuesTreeDrawingListener
(
const
TreeDrawingSettings
* settings,
bool
autonomous =
false
) :
234
TreeDrawingListenerAdapter
(autonomous),
235
settings_
(settings)
236
{}
237
238
BootstrapValuesTreeDrawingListener
(
const
BootstrapValuesTreeDrawingListener
& lntdl) :
239
TreeDrawingListenerAdapter
(lntdl),
240
settings_
(lntdl.
settings_
) {}
241
242
BootstrapValuesTreeDrawingListener
&
operator=
(
const
BootstrapValuesTreeDrawingListener
& lntdl)
243
{
244
TreeDrawingListenerAdapter::operator=(lntdl);
245
settings_
= lntdl.
settings_
;
246
return
*
this
;
247
}
248
249
BootstrapValuesTreeDrawingListener
*
clone
()
const
{
return
new
BootstrapValuesTreeDrawingListener
(*
this
); }
250
251
public
:
252
void
afterDrawBranch
(
const
DrawBranchEvent
& event);
253
254
};
255
256
264
class
LabelInnerNodesTreeDrawingListener
:
265
public
TreeDrawingListenerAdapter
266
{
267
268
public
:
269
LabelInnerNodesTreeDrawingListener
(
bool
autonomous =
false
) :
270
TreeDrawingListenerAdapter
(autonomous) {}
271
272
LabelInnerNodesTreeDrawingListener
*
clone
()
const
{
return
new
LabelInnerNodesTreeDrawingListener
(*
this
); }
273
274
public
:
275
void
afterDrawNode
(
const
DrawNodeEvent
& event);
276
277
};
278
279
280
286
class
LabelCollapsedNodesTreeDrawingListener
:
287
public
TreeDrawingListenerAdapter
288
{
289
public
:
290
LabelCollapsedNodesTreeDrawingListener
(
bool
autonomous =
false
) :
291
TreeDrawingListenerAdapter
(autonomous) {}
292
293
LabelCollapsedNodesTreeDrawingListener
*
clone
()
const
{
return
new
LabelCollapsedNodesTreeDrawingListener
(*
this
); }
294
295
public
:
296
void
afterDrawNode
(
const
DrawNodeEvent
& event);
297
298
};
299
300
}
//end of namespace bpp
301
302
#endif //_TREEDRAWINGLISTENER_H_
303
Bpp
Phyl
Graphics
TreeDrawingListener.h
Generated on Thu Mar 14 2013 16:39:08 for bpp-phyl by
1.8.3.1-20130209