[Uml-devel] [Bug 104637] export class diagramm to eps draws interfaces too small
Oliver Kellogg
okellogg at users.sourceforge.net
Wed May 11 23:15:07 UTC 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=104637
okellogg users sourceforge net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From okellogg users sourceforge net 2005-05-12 08:13 -------
SVN commit 412607 by okellogg:
drawAsConcept(): Use UMLWidget::getFontMetrics() for fontHeight determination.
BUG:104637
M +1 -1 trunk/KDE/kdesdk/umbrello/ChangeLog
M +20 -21 trunk/KDE/kdesdk/umbrello/umbrello/interfacewidget.cpp
--- trunk/KDE/kdesdk/umbrello/ChangeLog #412606:412607
@ -13,7 +13,7 @
* Crash in UMLView::createAutoAttributeAssociations()
* Bugs from http://bugs.kde.org :
53376 57667 57875 70924 80924 89691 95353 100290 100307 101148
-103123 103133 103728 101541
+103123 103133 103728 101541 104637
Version 1.4
--- trunk/KDE/kdesdk/umbrello/umbrello/interfacewidget.cpp #412606:412607
@ -92,53 +92,52 @
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void InterfaceWidget::drawAsConcept(QPainter& p, int offsetX, int offsetY) {
- ClassifierWidget::draw(p, offsetX, offsetY);
+ ClassifierWidget::draw(p, offsetX, offsetY); // draw templates
QFont font = UMLWidget::getFont();
font.setItalic(false);
font.setUnderline(false);
font.setBold(false);
- QFontMetrics fontMetrics(font);
- int fontHeight = fontMetrics.lineSpacing();
- QString name;
- if ( m_bShowPackage ) {
- name = m_pObject -> getPackage() + "." + this -> getName();
- } else {
- name = this -> getName();
- }
+ QFontMetrics fontMetrics = UMLWidget::getFontMetrics(UMLWidget::FT_NORMAL);
+ const int fontHeight = fontMetrics.lineSpacing();
+ const int w = m_w - ClassifierWidget::MARGIN * 2;
+ const int x = offsetX + ClassifierWidget::MARGIN;
+ int y = m_bodyOffsetY;
p.setPen(QPen(black));
+ // draw stereotype
font.setBold(true);
p.setFont(font);
- p.drawText(offsetX + ClassifierWidget::MARGIN, m_bodyOffsetY,
- m_w - ClassifierWidget::MARGIN * 2,fontHeight,
- AlignCenter, m_pObject->getStereotype());
+ p.drawText(x, y, w, fontHeight, AlignCenter, m_pObject->getStereotype());
+ y += fontHeight;
+ // draw name
+ QString name;
+ if ( m_bShowPackage ) {
+ name = m_pObject -> getPackage() + "." + this -> getName();
+ } else {
+ name = this -> getName();
+ }
font.setItalic( m_pObject -> getAbstract() );
//FIXME why is underline sometimes true
font.setUnderline( false );
p.setFont(font);
- p.drawText(offsetX + ClassifierWidget::MARGIN, m_bodyOffsetY + fontHeight,
- m_w - ClassifierWidget::MARGIN * 2, fontHeight, AlignCenter, name);
+ p.drawText(x, y, w, fontHeight, AlignCenter, name);
font.setBold(false);
font.setItalic(false);
p.setFont(font);
+ y += fontHeight;
if ( m_bShowOperations ) {
QFont font = UMLWidget::getFont();
font.setItalic(false);
font.setUnderline(false);
font.setBold(false);
-
- UMLWidget::draw(p, offsetX, m_bodyOffsetY);
-
- const int operationsStart = fontHeight * 2;
- const int y = m_bodyOffsetY + operationsStart;
+ UMLWidget::draw(p, offsetX, m_bodyOffsetY); // sets the pen
p.drawLine(offsetX, y, offsetX + m_w - 1, y);
p.setPen( QPen(black) );
- drawMembers(p, Uml::ot_Operation, m_ShowOpSigs,
- offsetX + ClassifierWidget::MARGIN, y, fontHeight);
+ drawMembers(p, Uml::ot_Operation, m_ShowOpSigs, x, y, fontHeight);
}//end if op
if (m_bSelected) {
More information about the umbrello-devel
mailing list