Пример #1
0
// id is an old ident in case of an import
ColDiagramWindow::ColDiagramWindow(const QString & s, BrowserColDiagram * b, int id)
    : DiagramWindow(b, s), view(0)
{
    QToolBar * toolbar = new QToolBar("communication diagram operations", this);
    toolbar->setMinimumHeight(50);
    toolbar->setOrientation(Qt::Horizontal);
    addToolBar(Qt::TopToolBarArea, toolbar);

    add_edit_button(toolbar);

    select =
        ToolBarFactory::createToolButton(*selectButton, TR("Select"), QString(),
                        this, SLOT(hit_select()), toolbar, "select");
    select->setCheckable(TRUE);
    select->setChecked(TRUE);
    current_button = UmlSelect;

    addPackage
        = ToolBarFactory::createToolButton(*packageButton, TR("Add Package"), QString(),
                          this, SLOT(hit_package()), toolbar, "add package");
    addPackage->setCheckable(TRUE);
    addPackage->setWhatsThis(addpackageText());

    addFragment
        = ToolBarFactory::createToolButton(*fragmentButton, TR("Add Fragment"), QString(),
                          this, SLOT(hit_fragment()), toolbar, "add fragment");
    addFragment->setCheckable(TRUE);
    addFragment->setWhatsThis(addfragmentText());

    addClassInstance
        = ToolBarFactory::createToolButton(*classinstanceButton, TR("Add modeled Class instance"), QString(),
                          this, SLOT(hit_classinstance()), toolbar, "add modeled class instance");
    addClassInstance->setCheckable(TRUE);
    addClassInstance->setWhatsThis(addmodeledclassinstanceText());

    addClass
        = ToolBarFactory::createToolButton(*classButton, TR("Add Class instance"), QString(),
                          this, SLOT(hit_class()), toolbar, "add class instance");
    addClass->setCheckable(TRUE);
    addClass->setWhatsThis(addclassinstanceText());

    addLink =
        ToolBarFactory::createToolButton(*associationButton, TR("Add Link"), QString(),
                        this, SLOT(hit_link()), toolbar, "add link");
    addLink->setCheckable(TRUE);
    addLink->setWhatsThis(linkText());

    addSelfLink =
        ToolBarFactory::createToolButton(*selflinkButton, TR("Add Self Link"), QString(),
                        this, SLOT(hit_selflink()), toolbar, "add self link");
    addSelfLink->setCheckable(TRUE);
    addSelfLink->setWhatsThis(selflinkText());

    note =
        ToolBarFactory::createToolButton(*noteButton, TR("Note"), QString(),
                        this, SLOT(hit_note()), toolbar, "note");
    note->setCheckable(TRUE);
    note->setWhatsThis(noteText());

    anchor =
        ToolBarFactory::createToolButton(*anchorButton, TR("Anchor"), QString(),
                        this, SLOT(hit_anchor()), toolbar, "anchor");
    anchor->setCheckable(TRUE);
    anchor->setWhatsThis(anchorText());

    text =
        ToolBarFactory::createToolButton(*textButton, TR("Text"), QString(),
                        this, SLOT(hit_text()), toolbar, "text");
    text->setCheckable(TRUE);
    text->setWhatsThis(textText());

    image =
        ToolBarFactory::createToolButton(*imageButton, TR("Image"), QString(),
                        this, SLOT(hit_image()), toolbar, "image");
    image->setCheckable(TRUE);
    image->setWhatsThis(imageText());

    toolbar->addSeparator();

    add_scale_cmd(toolbar);

    //

    view = new ColDiagramView(this, canvas, (id != -1) ? id : b->get_ident());
    setFocusProxy(view);
    setCentralWidget(view);

    //qApp->setMainWidget(this);

    QMdiArea * w = UmlWindow::get_workspace();

    m_containingSubWindow->resize((w->width() * 4) / 5, (w->height() * 4) / 5);

    /*if (w->windowList().isEmpty())
      showMaximized();
    else*/
    show();

    view->preferred_size_zoom();

    //qApp->setMainWidget(0);
}
Пример #2
0
void LunarMainWindow::initActions()
{
    m_actionImport          = new QAction(tr("Import"), this);
    m_actionExport          = new QAction(tr("Export"), this);
    m_actionQuit            = new QAction(tr("Quit"), this);

    m_actionNewGame         = new QAction(tr("New game"), this);
    m_actionEditGame        = new QAction(tr("Edit game"), this);
    m_actionDeleteGame      = new QAction(tr("Delete game"), this);
    m_actionLaunchGame      = new QAction(tr("Launch game"), this);
    //m_actionUninstallGame   = new QAction(tr("Uninstall game"), this);
    m_actionShowEmulators = new QAction(tr("Show Emulators"), this);

    m_actionProcessManager  = new QAction(tr("Process manager"), this);
    m_actionPlugins         = new QAction(tr("Plugins"), this);
    m_actionOptions         = new QAction(tr("Options"), this);

    m_actionAboutLunar      = new QAction(tr("About Lunar"), this);
    m_actionAboutQt         = new QAction(tr("About Qt"), this);

    m_actionQuit->setIcon(QIcon(QPixmap("resources/imgs/quit.png")));

    m_actionNewGame->setIcon(QIcon(QPixmap("resources/imgs/add_game.png")));

    m_actionEditGame->setDisabled(true);
    m_actionEditGame->setIcon(QIcon(QPixmap("resources/imgs/edit_game.png")));

    m_actionDeleteGame->setDisabled(true);
    m_actionDeleteGame->setIcon(QIcon(QPixmap("resources/imgs/delete_game.png")));

    m_actionLaunchGame->setDisabled(true);
    m_actionLaunchGame->setIcon(QIcon(QPixmap("resources/imgs/launch.png")));
    m_actionLaunchGame->setToolTip(tr("Start selected game"));

    m_actionShowEmulators->setIcon(QIcon(QPixmap("resources/imgs/emulators.png")));

    /*m_actionUninstallGame->setDisabled(true);
    m_actionUninstallGame->setIcon(QIcon(QPixmap("resources/imgs/uninstall.png")));
    m_actionUninstallGame->setToolTip(tr("Uninstall selected game if the option was previously set"));*/

    m_actionImport->setIcon(QIcon(QPixmap("resources/imgs/import.png")));
    m_actionExport->setIcon(QIcon(QPixmap("resources/imgs/export.png")));

    m_actionOptions->setIcon(QIcon(QPixmap("resources/imgs/settings.png")));
    m_actionProcessManager->setIcon(QIcon(QPixmap("resources/imgs/process.png")));
    m_actionPlugins->setIcon(QIcon(QPixmap("resources/imgs/plugin.png")));

    QToolBar *toolbar = addToolBar("Main");
    toolbar->setMinimumHeight(48);
    toolbar->setIconSize(QSize(32, 32));
    toolbar->setMovable(false);

    toolbar->addAction(m_actionNewGame);
    toolbar->addAction(m_actionEditGame);
    toolbar->addAction(m_actionDeleteGame);

    toolbar->addSeparator();
    toolbar->addAction(m_actionShowEmulators);
    /*toolbar->addAction(m_actionUninstallGame);*/

    toolbar->addSeparator();
    toolbar->addAction(m_actionProcessManager);
    toolbar->addSeparator();

    toolbar->addAction(m_actionLaunchGame);
}
// id is an old ident in case of an import
DeploymentDiagramWindow::DeploymentDiagramWindow(const QString & s, BrowserDeploymentDiagram * b, int id)
    : DiagramWindow(b, s), view(0)
{
    QToolBar * toolbar = new QToolBar("deployment operations", this);
    toolbar->setMinimumHeight(50);
    toolbar->setOrientation(Qt::Horizontal);
    addToolBar(Qt::TopToolBarArea, toolbar);

    add_edit_button(toolbar);

    select =
        ToolBarFactory::createToolButton(*selectButton, tr("Select"), QString(),
                        this, SLOT(hit_select()), toolbar, "select");
    select->setCheckable(TRUE);
    select->setChecked(TRUE);
    current_button = UmlSelect;

    addPackage
        = ToolBarFactory::createToolButton(*packageButton, tr("Add Package"), QString(),
                          this, SLOT(hit_package()), toolbar, "add package");
    addPackage->setCheckable(TRUE);
    addPackage->setWhatsThis(addpackageText());

    addFragment
        = ToolBarFactory::createToolButton(*fragmentButton, tr("Add Fragment"), QString(),
                          this, SLOT(hit_fragment()), toolbar, "add fragment");
    addFragment->setCheckable(TRUE);
    addFragment->setWhatsThis(addfragmentText());

    addDeploymentNode =
        ToolBarFactory::createToolButton(*deploymentNodeButton, tr("Add Deployment Node"), QString(),
                        this, SLOT(hit_deploymentnode()), toolbar, "add deployment node");
    addDeploymentNode->setCheckable(TRUE);
    addDeploymentNode->setWhatsThis(adddeploymentnodeText());

    addArtifact =
        ToolBarFactory::createToolButton(*artifactButton, tr("Add Artifact"), QString(),
                        this, SLOT(hit_artifact()), toolbar, "add artifact");
    addArtifact->setCheckable(TRUE);
    addArtifact->setWhatsThis(addartifactText());

    addComponent =
        ToolBarFactory::createToolButton(*componentButton, tr("Add Component"), QString(),
                        this, SLOT(hit_component()), toolbar, "add component");
    addComponent->setCheckable(TRUE);
    addComponent->setWhatsThis(addcomponentText());

    hub =
        ToolBarFactory::createToolButton(*hubButton, tr("Network connexion/ending"), QString(),
                        this, SLOT(hit_hub()), toolbar, "network connexion/ending");
    hub->setCheckable(TRUE);
    hub->setWhatsThis(hubText());

    network =
        ToolBarFactory::createToolButton(*associationButton, tr("Network"), QString(),
                        this, SLOT(hit_network()), toolbar, "network");
    network->setCheckable(TRUE);
    network->setWhatsThis(networkText());

    inherit =
        ToolBarFactory::createToolButton(*generalisationButton, tr("Inheritance"), QString(),
                        this, SLOT(hit_inherit()), toolbar, "inheritance");
    inherit->setCheckable(TRUE);
    inherit->setWhatsThis(inheritText());

    association =
        ToolBarFactory::createToolButton(*directionalAssociationButton, tr("Association"), QString(),
                        this, SLOT(hit_association()), toolbar, "association");
    association->setCheckable(TRUE);
    association->setWhatsThis(associationText());

    dependency =
        ToolBarFactory::createToolButton(*dependencyButton, tr("Dependency"), QString(),
                        this, SLOT(hit_dependency()), toolbar, "dependency");
    dependency->setCheckable(TRUE);
    dependency->setWhatsThis(dependencyText());

    note =
        ToolBarFactory::createToolButton(*noteButton, tr("Note"), QString(),
                        this, SLOT(hit_note()), toolbar, "note");
    note->setCheckable(TRUE);
    note->setWhatsThis(noteText());

    anchor =
        ToolBarFactory::createToolButton(*anchorButton, tr("Anchor"), QString(),
                        this, SLOT(hit_anchor()), toolbar, "anchor");
    anchor->setCheckable(TRUE);
    anchor->setWhatsThis(anchorText());

    text =
        ToolBarFactory::createToolButton(*textButton, tr("Text"), QString(),
                        this, SLOT(hit_text()), toolbar, "text");
    text->setCheckable(TRUE);
    text->setWhatsThis(textText());

    image =
        ToolBarFactory::createToolButton(*imageButton, tr("Image"), QString(),
                        this, SLOT(hit_image()), toolbar, "image");
    image->setCheckable(TRUE);
    image->setWhatsThis(imageText());

    toolbar->addSeparator();

    add_scale_cmd(toolbar);

    //

    view = new DeploymentDiagramView(this, canvas, (id != -1) ? id : b->get_ident());
    setFocusProxy(view);
    setCentralWidget(view);

    //qApp->setMainWidget(this);

    QMdiArea * w = UmlWindow::get_workspace();

    m_containingSubWindow->resize((w->width() * 4) / 5, (w->height() * 4) / 5);

    /*if (w->windowList().isEmpty())
      showMaximized();
    else*/
    show();

    view->preferred_size_zoom();

    //qApp->setMainWidget(0);
}