3 /***************************************************************************
4 * Copyright (C) 2007, 2008 by Carsten Niehaus *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the *
19 * Free Software Foundation, Inc., *
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
21 ***************************************************************************/
23 #include <QGraphicsScene>
24 #include <QGraphicsSceneMouseEvent>
25 #include <QGraphicsRectItem>
30 #include "ui_isotopedialog.h"
35 class InformationItem
;
37 class QGraphicsSceneMouseEvent
;
38 class QGraphicsTextItem
;
41 * This class is the drawing widget for the whole table
43 * @author Pino Toscano
44 * @author Carsten Niehaus
46 class IsotopeTableDialog
: public KDialog
51 explicit IsotopeTableDialog( QWidget
* parent
= 0 );
57 void updateDockWidget( IsotopeItem
* );
61 * The class represtens the items which is drawn on the QGraphicsScene. Each such item represents on
63 * @author Carsten Niehaus
65 class IsotopeItem
: public QGraphicsRectItem
69 * there are several types of decay for an isotope.
71 enum IsotopeType
{ alpha
, ec
, multiple
, bplus
, bminus
, stable
};
73 enum { Type
= UserType
+ 1 };
76 * @param isotope The Isotope represented
78 IsotopeItem(Isotope
* isotope
, qreal x
, qreal y
, qreal width
, qreal height
, QGraphicsItem
*parent
= 0);
81 * @return the Isotope the item represents
83 Isotope
* isotope() const{
88 * @return the Type of the item
100 * @return the IsotopeType of the Isotope
102 IsotopeType
getType( Isotope
* );
105 void mousePressEvent(QGraphicsSceneMouseEvent
*event
);
108 class InformationItem
: public QGraphicsRectItem
111 enum { Type
= UserType
+ 2 };
114 * @param isotope The Isotope represented
116 InformationItem( qreal x
, qreal y
, qreal width
, qreal height
, QGraphicsItem
*parent
= 0);
119 * @return the Type of the item
125 void setIsotope( IsotopeItem
* item
);
128 QGraphicsTextItem
*m_textitem
;
132 class IsotopeScene
: public QGraphicsScene
137 IsotopeScene( QObject
* parent
= 0);
139 void updateContextHelp( IsotopeItem
* item
);
144 //the size of each item
147 ///this group stores all IsotopeItems
148 QGraphicsItemGroup
*m_isotopeGroup
;
151 void itemSelected(IsotopeItem
*item
);
155 #endif // NUCLIDEBOARD_H