~ubuntu-branches/ubuntu/vivid/kdesdk/vivid

« back to all changes in this revision

Viewing changes to umbrello/umbrello/widgets/artifactwidget.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-06 11:49:54 UTC
  • mfrom: (0.4.21)
  • Revision ID: package-import@ubuntu.com-20120606114954-rdls73fzlpzxglbx
Tags: 4:4.8.80-0ubuntu1
* New uptream beta release
* Update dont_export_private_classes.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
/**
20
20
 * Constructs a ArtifactWidget.
21
21
 *
22
 
 * @param scene              The parent of this ArtifactWidget.
 
22
 * @param scene     The parent of this ArtifactWidget.
23
23
 * @param a         The Artifact this widget will be representing.
24
24
 */
25
25
ArtifactWidget::ArtifactWidget(UMLScene *scene, UMLArtifact *a)
45
45
    if ( UMLWidget::useFillColor() ) {
46
46
        p.setBrush( UMLWidget::fillColor() );
47
47
    } else {
48
 
        p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) );
49
 
    }
50
 
 
51
 
    UMLArtifact *umlart = static_cast<UMLArtifact*>(m_pObject);
52
 
    UMLArtifact::Draw_Type drawType = umlart->getDrawAsType();
53
 
    switch (drawType) {
54
 
    case UMLArtifact::defaultDraw:
55
 
        return drawAsNormal(p, offsetX, offsetY);
56
 
        break;
57
 
    case UMLArtifact::file:
58
 
        return drawAsFile(p, offsetX, offsetY);
59
 
        break;
60
 
    case UMLArtifact::library:
61
 
        return drawAsLibrary(p, offsetX, offsetY);
62
 
        break;
63
 
    case UMLArtifact::table:
64
 
        return drawAsTable(p, offsetX, offsetY);
65
 
        break;
66
 
 
67
 
    default:
68
 
        uWarning() << "Artifact drawn as unknown type";
69
 
        break;
 
48
        p.setBrush( m_scene->view()->viewport()->palette().color(QPalette::Background) );
 
49
    }
 
50
 
 
51
    if (umlObject()) {
 
52
        UMLArtifact *umlart = static_cast<UMLArtifact*>(m_pObject);
 
53
        UMLArtifact::Draw_Type drawType = umlart->getDrawAsType();
 
54
        switch (drawType) {
 
55
        case UMLArtifact::defaultDraw:
 
56
            drawAsNormal(p, offsetX, offsetY);
 
57
            break;
 
58
        case UMLArtifact::file:
 
59
            drawAsFile(p, offsetX, offsetY);
 
60
            break;
 
61
        case UMLArtifact::library:
 
62
            drawAsLibrary(p, offsetX, offsetY);
 
63
            break;
 
64
        case UMLArtifact::table:
 
65
            drawAsTable(p, offsetX, offsetY);
 
66
            break;
 
67
        default:
 
68
            uWarning() << "Artifact drawn as unknown type";
 
69
            break;
 
70
        }
 
71
    }
 
72
    else {
 
73
        uWarning() << "Cannot draw as there is no UMLArtifact for this widget.";
70
74
    }
71
75
}
72
76
 
161
165
    p.drawLine(startX + 40, offsetY + 10, startX + 50, offsetY + 10);
162
166
    p.drawLine(startX + 40, offsetY, startX + 50, offsetY + 10);
163
167
 
164
 
    p.setPen( QPen(Qt::black) );
 
168
    p.setPen(textColor());
165
169
    p.setFont(font);
166
170
 
167
171
    p.drawText(offsetX, offsetY + h - fontHeight,
198
202
    p.drawLine(startX + 40, offsetY + 10, startX + 50, offsetY + 10);
199
203
    p.drawLine(startX + 40, offsetY, startX + 50, offsetY + 10);
200
204
 
201
 
    p.setPen( QPen(Qt::black) );
 
205
    p.setPen(textColor());
202
206
    p.setFont(font);
203
207
 
204
208
    p.drawText(offsetX, offsetY + h - fontHeight,
237
241
    p.drawLine(startX + 10, offsetY, startX + 10, offsetY + iconHeight);
238
242
    p.drawLine(startX, offsetY + (iconHeight/4), startX + 50, offsetY + (iconHeight/4));
239
243
 
240
 
    p.setPen( QPen(Qt::black) );
 
244
    p.setPen(textColor());
241
245
    p.setFont(font);
242
246
 
243
247
    p.drawText(offsetX, offsetY + h - fontHeight,
263
267
 
264
268
    p.drawRect(offsetX, offsetY, w, h);
265
269
 
266
 
    p.setPen( QPen(Qt::black) );
 
270
    p.setPen(textColor());
267
271
    p.setFont(font);
268
272
 
269
273
    if (!stereotype.isEmpty()) {