umbrello API Documentation

boxwidget.cpp

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2003-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 // own header
00013 #include "boxwidget.h"
00014 // qt/kde includes
00015 #include <qevent.h>
00016 #include <kdebug.h>
00017 
00018 BoxWidget::BoxWidget(UMLView * view, Uml::IDType id)
00019         : UMLWidget(view, id) {
00020     setSize(100,80);
00021     UMLWidget::setBaseType( Uml::wt_Box );
00022     WidgetBase::m_bUsesDiagramLineColour = false;  // boxes be black
00023     WidgetBase::m_LineColour = QColor("black");
00024     setZ(m_origZ = 0);
00025 }
00026 
00027 BoxWidget::~BoxWidget() {
00028 }
00029 
00030 void BoxWidget::draw(QPainter& p, int offsetX, int offsetY) {
00031     UMLWidget::setPen(p);
00032     p.drawRect( offsetX, offsetY, width(), height() );
00033 
00034     if (m_bSelected) {
00035         drawSelected(&p, offsetX, offsetY);
00036     }
00037 }
00038 
00039 void BoxWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) {
00040     QDomElement boxElement = qDoc.createElement("boxwidget");
00041     UMLWidget::saveToXMI(qDoc, boxElement);
00042     qElement.appendChild(boxElement);
00043 }
00044 
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:54 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003