2 Copyright (c) 2002-2009 Tampere University.
4 This file is part of TTA-Based Codesign Environment (TCE).
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
27 * Inline implementation of EditPart class.
29 * @author Ari Metsähalme 2004 (ari.metsahalme-no.spam-tut.fi)
30 * @note rating: yellow
31 * @note reviewed Jul 13 2004 by vpj, ll, jn, am
34 #include "Application.hh"
37 * Returns the parent of this EditPart.
39 * @return Parent of this EditPart.
42 EditPart::parent() const {
47 * Sets the parent EditPart.
49 * @param parent New parent.
52 EditPart::setParent(EditPart* parent) {
57 * Returns the model object corresponding to this EditPart.
59 * @return The model object corresponding to this EditPart.
61 inline TTAMachine::MachinePart*
62 EditPart::model() const {
67 * Sets the corresponding model object.
69 * @param model New model object.
72 EditPart::setModel(TTAMachine::MachinePart* model) {
77 * Returns the Figure of this EditPart.
79 * @return Figure of this EditPart.
82 EditPart::figure() const {
89 * @param figure New Figure.
92 EditPart::setFigure(Figure* figure) {
97 * Tells whether the EditPart is selectable or not.
99 * @return True if selectable, false otherwise.
102 EditPart::selectable() const {
107 * Tells if the EditPart is selected.
109 * @return True if selected.
112 EditPart::selected() const {
117 * Sets selectability of the EditPart.
119 * @param selectable True if selectable, false otherwise.
122 EditPart::setSelectable(bool selectable) {
123 selectable_ = selectable;
127 * Sets selection status of the EditPart.
129 * @param select True to select, false to unselect.
132 EditPart::setSelected(bool select) {
137 * Returns the number of children.
139 * @return The number of child EditParts.
142 EditPart::childCount() const {
143 return children_.size();
147 * Returns the child corresponding to the given index.
149 * @param index Index of the child EditPart to return
150 * @return The child corresponding to the given index.
153 EditPart::child(unsigned int index) const {
154 assert(index < children_.size());
155 return children_[index];