Ejemplo n.º 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;
    }
}
Ejemplo n.º 2
0
/**
 * Show a properties dialog for a BoxWidget.
 */
void BoxWidget::showPropertiesDialog()
{
    QColor newColor = QColorDialog::getColor(lineColor()); // krazy:exclude=qclasses
    if (newColor != lineColor()) {
        setLineColor(newColor);
        setUsesDiagramLineColor(false);
        umlDoc()->setModified(true);
    }
}
Ejemplo n.º 3
0
/**
 * Set the ID of the diagram hyperlinked to this note.
 * To switch off the hyperlink, set this to Uml::id_None.
 *
 * @param sceneID ID of an UMLScene.
 * @todo Fix the display of diagram link.
 */
void NoteWidget::setDiagramLink(Uml::IDType sceneID)
{
    UMLView *view = umlDoc()->findView(sceneID);
    if (view == 0) {
        uError() << "no view found for viewID " << ID2STR(sceneID);
        return;
    }

    QString linkText("Diagram: " + view->umlScene()->name());
    m_diagramLink = sceneID;
}
Ejemplo n.º 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;
}
Ejemplo n.º 5
0
/**
 * Extends base method to adjust also the association of a class
 * association.  Executes the base method and then, if file isn't
 * loading and the classifier acts as a class association, the
 * association position is updated.
 *
 * @param x The x-coordinate.
 * @param y The y-coordinate.
 *
 * @todo Implement this properly after implementing AssociationWidget.
 */
void ClassifierWidget::adjustAssociations(bool userAdjustChange)
{
    UMLWidget::adjustAssociations(userAdjustChange);

    if (umlDoc()->loading() || m_classAssociationWidget == 0) {
        return;
    }

    //TODO: Push undo command
    if (userAdjustChange) {
        m_classAssociationWidget->setUserChange(AssocAdjustChange, true);
    }
    m_classAssociationWidget->associationLine()->calculateAssociationClassLine();
    if (userAdjustChange) {
        m_classAssociationWidget->setUserChange(AssocAdjustChange, false);
    }
}