umbrello API Documentation

WidgetBase Class Reference

Common base class for UMLWidget and AssociationWidget. More...

#include <widgetbase.h>

Inheritance diagram for WidgetBase:

AssociationWidget UMLWidget ActivityWidget ActorWidget ArtifactWidget BoxWidget ClassifierWidget ComponentWidget DatatypeWidget EntityWidget EnumWidget FloatingTextWidget MessageWidget NodeWidget NoteWidget ObjectWidget PackageWidget StateWidget UseCaseWidget List of all members.

Public Member Functions

 WidgetBase (UMLView *view)
 Creates a WidgetBase object.
virtual ~WidgetBase ()
 Standard deconstructor.
void setBaseType (Uml::Widget_Type type)
 Write property of m_Type.
Uml::Widget_Type getBaseType () const
 Read property of m_Type.
UMLObjectgetUMLObject ()
 Returns the UMLObject set to represent.
const UMLViewgetUMLView () const
 Deliver a const pointer to the connected UMLView ( needed esp.
virtual void setUMLObject (UMLObject *o)
 Sets the UMLObject to represent.
virtual QString getDoc () const
 Used by some child classes to get documentation.
virtual void setDoc (const QString &doc)
 Used by some child classes to set documentation.
virtual void setLineColor (const QColor &colour)
 Sets the line colour.
virtual void setLineWidth (uint width)
 Sets the line width.
QColor getLineColor () const
 Read property of m_LineColour.
uint getLineWidth () const
 Read property of m_LineWidth.
bool getUsesDiagramLineColour () const
 Returns m_bUsesDiagramLineColour.
bool getUsesDiagramLineWidth () const
 Returns m_bUsesDiagramLineWidth.
void setUsesDiagramLineColour (bool usesDiagramLineColour)
 Sets m_bUsesDiagramLineColour.
void setUsesDiagramLineWidth (bool usesDiagramLineWidth)
 Sets m_bUsesDiagramLineWidth.
void setID (Uml::IDType id)
 Write property of m_nId.
Uml::IDType getID () const
 Read property of m_nId.
virtual void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
virtual bool loadFromXMI (QDomElement &qElement)

Protected Member Functions

void init (UMLView *view, Uml::Widget_Type type=Uml::wt_UMLWidget)
 Initialize members.

Protected Attributes

Uml::Widget_Type m_Type
 Type of widget.
UMLViewm_pView
UMLObjectm_pObject
QString m_Doc
 Only used if m_pObject is not set.
Uml::IDType m_nId
 This ID is only used when the widget does not have a corresponding UMLObject (i.e.
QColor m_LineColour
 Color of the lines of the widget.
uint m_LineWidth
 Width of the lines of the widget.
bool m_bUsesDiagramLineColour
 true by default, false if the colours have been explicitly set for this widget.
bool m_bUsesDiagramLineWidth
 true by default, false if the colours have been explicitly set for this widget.

Detailed Description

Common base class for UMLWidget and AssociationWidget.

Author:
Oliver Kellogg <okellogg@users.sourceforge.net> Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 30 of file widgetbase.h.


Constructor & Destructor Documentation

WidgetBase::WidgetBase UMLView view  ) 
 

Creates a WidgetBase object.

Parameters:
view The view to be displayed on.

Definition at line 19 of file widgetbase.cpp.

References init().

virtual WidgetBase::~WidgetBase  )  [inline, virtual]
 

Standard deconstructor.

Definition at line 43 of file widgetbase.h.


Member Function Documentation

void WidgetBase::setBaseType Uml::Widget_Type  type  ) 
 

Write property of m_Type.

Definition at line 42 of file widgetbase.cpp.

References m_Type.

Referenced by ActivityWidget::ActivityWidget(), ActorWidget::ActorWidget(), BoxWidget::BoxWidget(), ClassifierWidget::changeToClass(), ClassifierWidget::changeToInterface(), ClassifierWidget::ClassifierWidget(), MessageWidget::init(), EnumWidget::init(), EntityWidget::init(), ClassifierWidget::init(), NodeWidget::NodeWidget(), StateWidget::StateWidget(), and UseCaseWidget::UseCaseWidget().

Uml::Widget_Type WidgetBase::getBaseType  )  const
 

Read property of m_Type.

Definition at line 46 of file widgetbase.cpp.

References m_Type.

Referenced by UMLWidget::activate(), UMLView::activate(), UMLView::addWidget(), UMLView::checkUniqueSelection(), UMLView::contentsDropEvent(), Widget_Factory::createWidget(), Widget_Utils::findWidget(), UMLView::getSelectCount(), UMLView::getSelectedWidgets(), UMLView::getUMLObjects(), AssocRules::isGeneralisationOrRealisation(), AssociationWidget::mouseMoveEvent(), ToolBarStateAssociation::mouseReleaseAssociation(), AssociationWidget::mouseReleaseEvent(), ToolBarStateMessages::mouseReleaseWidget(), AssociationWidget::operator==(), UMLView::removeWidget(), UMLView::saveToXMI(), UMLView::selectionToggleShow(), AssociationWidget::setAssocType(), UMLView::setClassWidgetOptions(), ClassOptionsPage::setupPage(), ClassOptionsPage::updateWidget(), and AssociationWidget::widgetMoved().

UMLObject * WidgetBase::getUMLObject  ) 
 

Returns the UMLObject set to represent.

Returns:
the UMLObject to represent.

Definition at line 50 of file widgetbase.cpp.

Referenced by MessageWidget::activate(), ClassPropDlg::ClassPropDlg(), UMLView::createAutoAssociations(), UMLView::createAutoAttributeAssociations(), MessageWidget::getOperationOwner(), AssociationWidget::getOperationOwner(), MessageWidget::getSeqNumAndOp(), AssociationWidget::getSeqNumAndOp(), UMLView::getUMLObjects(), UMLView::getWidgetAssocs(), AssociationWidget::loadFromXMI(), UMLWidget::showProperties(), DocWindow::slotAssociationRemoved(), DocWindow::slotWidgetRemoved(), UMLView::updateContainment(), and ClassGenPage::updateObject().

const UMLView* WidgetBase::getUMLView  )  const [inline]
 

Deliver a const pointer to the connected UMLView ( needed esp.

by event handling of LinePath )

Definition at line 66 of file widgetbase.h.

Referenced by LinePath::getCanvas(), LinePath::slotLineColorChanged(), and LinePath::slotLineWidthChanged().

void WidgetBase::setUMLObject UMLObject o  )  [virtual]
 

Sets the UMLObject to represent.

Parameters:
o The object to represent.

Reimplemented in AssociationWidget.

Definition at line 54 of file widgetbase.cpp.

Referenced by AssociationWidget::setUMLObject().

QString WidgetBase::getDoc  )  const [virtual]
 

Used by some child classes to get documentation.

Returns:
The documentation from the UMLObject (if m_pObject is set.)

Reimplemented in NoteWidget.

Definition at line 75 of file widgetbase.cpp.

References UMLObject::getDoc(), and m_Doc.

Referenced by AssociationWidget::showDialog().

void WidgetBase::setDoc const QString &  doc  )  [virtual]
 

Used by some child classes to set documentation.

Parameters:
doc The documentation to be set in the UMLObject (if m_pObject is set.)

Reimplemented in NoteWidget.

Definition at line 81 of file widgetbase.cpp.

References m_Doc, and UMLObject::setDoc().

Referenced by AssociationWidget::loadFromXMI(), AssociationWidget::showDialog(), ClassGenPage::updateObject(), and AssocGenPage::updateObject().

void WidgetBase::setLineColor const QColor &  colour  )  [virtual]
 

Sets the line colour.

Parameters:
colour the new line colour

Reimplemented in AssociationWidget, and UMLWidget.

Definition at line 88 of file widgetbase.cpp.

References m_bUsesDiagramLineColour, and m_LineColour.

Referenced by UMLWidget::setLineColor(), and AssociationWidget::setLineColor().

void WidgetBase::setLineWidth uint  width  )  [virtual]
 

Sets the line width.

Parameters:
width the new line width

Reimplemented in AssociationWidget, and UMLWidget.

Definition at line 93 of file widgetbase.cpp.

References m_bUsesDiagramLineWidth, and m_LineWidth.

Referenced by UMLWidget::setLineWidth(), and AssociationWidget::setLineWidth().

QColor WidgetBase::getLineColor  )  const [inline]
 

Read property of m_LineColour.

Definition at line 107 of file widgetbase.h.

References m_LineColour.

Referenced by AssociationWidget::createAssocClassLine(), SeqLineWidget::SeqLineWidget(), SeqLineWidget::setupDestructionBox(), and UMLWidget::slotMenuSelection().

uint WidgetBase::getLineWidth  )  const [inline]
 

Read property of m_LineWidth.

Definition at line 114 of file widgetbase.h.

References m_LineWidth.

Referenced by AssociationWidget::createAssocClassLine().

bool WidgetBase::getUsesDiagramLineColour  )  const [inline]
 

Returns m_bUsesDiagramLineColour.

Definition at line 121 of file widgetbase.h.

References m_bUsesDiagramLineColour.

bool WidgetBase::getUsesDiagramLineWidth  )  const [inline]
 

Returns m_bUsesDiagramLineWidth.

Definition at line 128 of file widgetbase.h.

References m_bUsesDiagramLineWidth.

void WidgetBase::setUsesDiagramLineColour bool  usesDiagramLineColour  )  [inline]
 

Sets m_bUsesDiagramLineColour.

Definition at line 135 of file widgetbase.h.

References m_bUsesDiagramLineColour.

Referenced by UMLView::selectionSetLineColor().

void WidgetBase::setUsesDiagramLineWidth bool  usesDiagramLineWidth  )  [inline]
 

Sets m_bUsesDiagramLineWidth.

Definition at line 142 of file widgetbase.h.

References m_bUsesDiagramLineWidth.

Referenced by UMLView::selectionSetLineWidth().

void WidgetBase::setID Uml::IDType  id  ) 
 

Write property of m_nId.

Definition at line 58 of file widgetbase.cpp.

References UMLObject::getID(), m_nId, and UMLObject::setID().

Referenced by UMLView::addWidget(), and UMLView::slotMenuSelection().

Uml::IDType WidgetBase::getID  )  const
 

Read property of m_nId.

Definition at line 69 of file widgetbase.cpp.

References UMLObject::getID(), and m_nId.

Referenced by UMLView::addWidget(), UMLView::createAutoAssociations(), UMLView::findAssocWidget(), Widget_Utils::findWidget(), UMLWidget::operator==(), MessageWidget::saveToXMI(), and AssociationWidget::saveToXMI().

void WidgetBase::init UMLView view,
Uml::Widget_Type  type = Uml::wt_UMLWidget
[protected]
 

Initialize members.

Definition at line 23 of file widgetbase.cpp.

References UMLView::getOptionState(), m_bUsesDiagramLineColour, m_bUsesDiagramLineWidth, m_LineColour, m_LineWidth, and m_Type.

Referenced by AssociationWidget::AssociationWidget(), and WidgetBase().


Member Data Documentation

Uml::Widget_Type WidgetBase::m_Type [protected]
 

Type of widget.

Definition at line 169 of file widgetbase.h.

Referenced by getBaseType(), init(), UMLWidget::operator=(), and setBaseType().

QString WidgetBase::m_Doc [protected]
 

Only used if m_pObject is not set.

Definition at line 173 of file widgetbase.h.

Referenced by getDoc(), and setDoc().

Uml::IDType WidgetBase::m_nId [protected]
 

This ID is only used when the widget does not have a corresponding UMLObject (i.e.

the m_pObject pointer is NULL.) For UMLObjects, the ID from the UMLObject is used.

Definition at line 180 of file widgetbase.h.

Referenced by getID(), UMLWidget::operator=(), and setID().

QColor WidgetBase::m_LineColour [protected]
 

Color of the lines of the widget.

Is saved to XMI.

Definition at line 185 of file widgetbase.h.

Referenced by getLineColor(), init(), UMLWidget::operator=(), and setLineColor().

uint WidgetBase::m_LineWidth [protected]
 

Width of the lines of the widget.

Is saved to XMI.

Definition at line 190 of file widgetbase.h.

Referenced by getLineWidth(), init(), UMLWidget::operator=(), and setLineWidth().

bool WidgetBase::m_bUsesDiagramLineColour [protected]
 

true by default, false if the colours have been explicitly set for this widget.

These are saved to XMI.

Definition at line 197 of file widgetbase.h.

Referenced by getUsesDiagramLineColour(), init(), UMLWidget::operator=(), setLineColor(), and setUsesDiagramLineColour().

bool WidgetBase::m_bUsesDiagramLineWidth [protected]
 

true by default, false if the colours have been explicitly set for this widget.

These are saved to XMI.

Definition at line 197 of file widgetbase.h.

Referenced by getUsesDiagramLineWidth(), init(), UMLWidget::operator=(), setLineWidth(), and setUsesDiagramLineWidth().


The documentation for this class was generated from the following files:
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:08:08 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003