Example #1
0
/**
 * Reimplemented from UMLWidget::slotMenuSelection to handle
 * some menu actions.
 */
void NoteWidget::slotMenuSelection(QAction* action)
{
    ListPopupMenu *menu = ListPopupMenu::menuFromAction(action);
    if (!menu) {
        uError() << "Action's data field does not contain ListPopupMenu pointer";
        return;
    }
    ListPopupMenu::MenuType sel = menu->getMenuType(action);
    switch(sel) {
    case ListPopupMenu::mt_Rename:
        {
            umlScene()->updateDocumentation(false);
            NoteDialog * dlg = new NoteDialog(umlScene()->activeView(), this);
            if (dlg->exec()) {
                umlScene()->showDocumentation(this, true);
                umlDoc()->setModified(true);
                update();
            }
            delete dlg;
        }
        break;

    case ListPopupMenu::mt_Clear:
        umlScene()->updateDocumentation(true);
        setDocumentation(QString());
        umlScene()->showDocumentation(this, true);
        umlDoc()->setModified(true);
        update();
        break;

    default:
        UMLWidget::slotMenuSelection(action);
        break;
    }
}
Example #2
0
/**
 * Overrides the standard operation.
 */
void UMLView::showEvent(QShowEvent* se)
{
    UMLApp* theApp = UMLApp::app();
    WorkToolBar* tb = theApp->workToolBar();
    UMLScene *us = umlScene();
    connect(tb, SIGNAL(sigButtonChanged(int)), us, SLOT(slotToolBarChanged(int)));
    connect(us, SIGNAL(sigResetToolBar()), tb, SLOT(slotResetToolBar()));

    umlScene()->showEvent(se);
    us->resetToolbar();
}
/**
 * Reimplemented from UMLWidget::showPropertiesDialog to show a
 * properties dialog for an ActivityWidget.
 */
void ActivityWidget::showPropertiesDialog()
{
    umlScene()->updateDocumentation(false);

    QPointer<ActivityDialog> dialog = new ActivityDialog(umlScene()->activeView(), this);
    if (dialog->exec() && dialog->getChangesMade()) {
        umlScene()->showDocumentation(this, true);
        UMLApp::app()->document()->setModified(true);
    }
    delete dialog;
}
Example #4
0
void NoteWidget::mouseDoubleClickEvent(UMLSceneMouseEvent *event)
{
    Q_UNUSED(event);
    umlScene()->updateDocumentation(false);
    NoteDialog * dlg = new NoteDialog(umlScene()->activeView(), this);
    if (dlg->exec()) {
        umlScene()->showDocumentation(this, true);
        umlDoc()->setModified(true);
        update();
    }
    delete dlg;
}
Example #5
0
/**
 * Load the object widget from m_widgetAId
 *
 * This method is called in loadFromXMI() when loading an XMI file, and called
 * from activate() when activating a widget after pasting.
 */
void PreconditionWidget::loadObjectWidget()
{
    if (m_objectWidget == 0) {
        m_objectWidget = dynamic_cast<ObjectWidget*>(
            umlScene()->findWidget(m_widgetAId)
        );
    }
}
Example #6
0
/**
 * Shows the properties dialog for the view.
 */
bool UMLView::showPropertiesDialog(QWidget *parent)
{
    bool success = false;
    QPointer<UMLViewDialog> dlg = new UMLViewDialog(parent, umlScene());
    if (dlg->exec() == QDialog::Accepted) {
        success = true;
    }
    delete dlg;
    return success;
}
Example #7
0
/**
 * Overrides the standard operation.
 */
void UMLView::hideEvent(QHideEvent* he)
{
    UMLApp* theApp = UMLApp::app();
    WorkToolBar* tb = theApp->workToolBar();
    UMLScene *us = umlScene();
    disconnect(tb, SIGNAL(sigButtonChanged(int)), us, SLOT(slotToolBarChanged(int)));
    disconnect(us, SIGNAL(sigResetToolBar()), tb, SLOT(slotResetToolBar()));

    us->hideEvent(he);
}
/**
 * Changes this classifier from an interface to a class.  Attributes
 * and stereotype visibility is got from the view OptionState.  This
 * widget is also updated.
 */
void ClassifierWidget::changeToClass()
{
    m_baseType = WidgetBase::wt_Class;
    classifier()->setBaseType(UMLObject::ot_Class);

    bool showAtts = true;
    bool showStereotype = false;

    if (umlScene()) {
        const Settings::OptionState& ops = umlScene()->optionState();
        showAtts = ops.classState.showAtts;
        showStereotype = ops.classState.showStereoType;
    }

    setVisualProperty(ShowAttributes, showAtts);
    setVisualProperty(ShowStereotype, showStereotype);

    updateTextItemGroups();
}
/**
 * Show a properties dialog for a NoteWidget.
 */
void NoteWidget::showPropertiesDialog()
{
    NoteDialog * dlg = 0;
    UMLApp::app()->docWindow()->updateDocumentation(false);
    dlg = new NoteDialog(umlScene()->activeView(), this);
    if (dlg->exec()) {
        UMLApp::app()->docWindow()->showDocumentation(this, true);
        UMLApp::app()->document()->setModified(true);
        update();
    }
    delete dlg;
}
Example #10
0
/**
 * Sets the zoom of the diagram.
 */
void UMLView::setZoom(int zoom)
{
    if (zoom < 10) {
        zoom = 10;
    } else if (zoom > 500) {
        zoom = 500;
    }

    QMatrix wm;
    wm.scale(zoom / 100.0, zoom / 100.0);
    setMatrix(wm);

    m_nZoom = currentZoom();
    umlScene()->resizeSceneToItems();
}
Example #11
0
/**
 * Destructor.
 */
UMLView::~UMLView()
{
    delete umlScene();
}
Example #12
0
/**
 * Overrides standard method from QWidget to resize scene when
 * it's shown.
 */
void UMLView::show()
{
    QWidget::show();
    umlScene()->resizeSceneToItems();
}