umbrello API Documentation

NoteWidget Class Reference

Displays a note box to allow multiple lines of text to be displayed. Displays a note box. More...

#include <notewidget.h>

Inheritance diagram for NoteWidget:

UMLWidget WidgetBase List of all members.

Public Slots

void slotMenuSelection (int sel)
void slotViewScrolled (int x, int y)

Public Member Functions

 NoteWidget (UMLView *view, Uml::IDType id=Uml::id_None)
 Constructs a NoteWidget.
virtual ~NoteWidget ()
 destructor
QSize calculateSize ()
 Overrides method from UMLWidget.
QString getDoc () const
 Returns the text in the box.
void setDoc (const QString &newText)
 Sets the note documentation.
void setDiagramLink (Uml::IDType viewID)
 Set the ID of the diagram hyperlinked to this note.
Uml::IDType getDiagramLink () const
 Return the ID of the diagram hyperlinked to this note.
void draw (QPainter &p, int offsetX, int offsetY)
 Override default method.
void setFont (QFont font)
 Override method from UMLWidget.
void setX (int x)
 Override method from UMLWidget.
void setY (int y)
 Override method from UMLWidget.
void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
 Saves to the <notewidget> XMI element.
bool loadFromXMI (QDomElement &qElement)
 Loads a <notewidget> XMI element.

Protected Member Functions

void drawText (QPainter *p=NULL, int offsetX=0, int offsetY=0)
 Draws the text.

Protected Attributes

Uml::IDType m_DiagramLink

Friends

class NoteWidgetController

Detailed Description

Displays a note box to allow multiple lines of text to be displayed. Displays a note box.

These widgets are diagram specific. They will still need a unique id from the UMLDoc class for deletion and other purposes.

Author:
Paul Hensgen <phensgen@techie.com>
See also:
UMLWidget Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 35 of file notewidget.h.


Constructor & Destructor Documentation

NoteWidget::NoteWidget UMLView view,
Uml::IDType  id = Uml::id_None
[explicit]
 

Constructs a NoteWidget.

Parameters:
view The parent to this widget.
id The unique id of the widget. The default (-1) will prompt a new ID.

Definition at line 33 of file notewidget.cpp.

References UMLWidget::init(), UMLWidget::setSize(), and UMLWidget::setZ().

NoteWidget::~NoteWidget  )  [virtual]
 

destructor

Definition at line 58 of file notewidget.cpp.


Member Function Documentation

QSize NoteWidget::calculateSize  )  [virtual]
 

Overrides method from UMLWidget.

Reimplemented from UMLWidget.

Definition at line 169 of file notewidget.cpp.

QString NoteWidget::getDoc  )  const [virtual]
 

Returns the text in the box.

Returns:
The text in the box.

Reimplemented from WidgetBase.

Definition at line 122 of file notewidget.cpp.

Referenced by drawText(), and saveToXMI().

void NoteWidget::setDoc const QString &  newText  )  [virtual]
 

Sets the note documentation.

Parameters:
newText The text to set the documentation to.

Reimplemented from WidgetBase.

Definition at line 130 of file notewidget.cpp.

Referenced by loadFromXMI(), and setDiagramLink().

void NoteWidget::setDiagramLink Uml::IDType  viewID  ) 
 

Set the ID of the diagram hyperlinked to this note.

To switch off the hyperlink, set this to Uml::id_None.

Parameters:
viewID ID of an UMLView.

Definition at line 64 of file notewidget.cpp.

References UMLDoc::findView(), UMLApp::getDocument(), UMLView::getName(), and setDoc().

Referenced by UMLView::contentsDropEvent().

Uml::IDType NoteWidget::getDiagramLink  )  const
 

Return the ID of the diagram hyperlinked to this note.

Returns:
ID of an UMLView, or Uml::id_None if no hyperlink is set.

Definition at line 84 of file notewidget.cpp.

void NoteWidget::draw QPainter &  p,
int  offsetX,
int  offsetY
[virtual]
 

Override default method.

Implements UMLWidget.

Definition at line 138 of file notewidget.cpp.

References UMLWidget::drawSelected(), drawText(), and UMLWidget::setPen().

void NoteWidget::setFont QFont  font  )  [virtual]
 

Override method from UMLWidget.

Reimplemented from UMLWidget.

Definition at line 92 of file notewidget.cpp.

References UMLView::setFont(), and UMLWidget::setFont().

void NoteWidget::setX int  x  )  [virtual]
 

Override method from UMLWidget.

Reimplemented from UMLWidget.

Definition at line 112 of file notewidget.cpp.

References UMLWidget::setX().

void NoteWidget::setY int  y  )  [virtual]
 

Override method from UMLWidget.

Reimplemented from UMLWidget.

Definition at line 117 of file notewidget.cpp.

References UMLWidget::setY().

void NoteWidget::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[virtual]
 

Saves to the <notewidget> XMI element.

Reimplemented from UMLWidget.

Definition at line 294 of file notewidget.cpp.

References getDoc().

bool NoteWidget::loadFromXMI QDomElement &  qElement  )  [virtual]
 

Loads a <notewidget> XMI element.

Reimplemented from UMLWidget.

Definition at line 303 of file notewidget.cpp.

References setDoc(), and UMLWidget::setZ().

void NoteWidget::slotMenuSelection int  sel  )  [virtual, slot]
 

OBSOLETE - remove ListPopupMenu::mt_Link_Docs

Reimplemented from UMLWidget.

Definition at line 173 of file notewidget.cpp.

References UMLApp::getDocument(), and UMLWidget::slotMenuSelection().

Referenced by NoteWidgetController::doMouseDoubleClick().

void NoteWidget::drawText QPainter *  p = NULL,
int  offsetX = 0,
int  offsetY = 0
[protected]
 

Draws the text.

Auxiliary to draw().

Definition at line 200 of file notewidget.cpp.

References getDoc(), UMLWidget::getFont(), and UMLWidget::getFontMetrics().

Referenced by draw(), and NoteWidgetController::mouseReleaseEvent().


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:05 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003