/*public*/ EditConnectionPreferencesDialog::EditConnectionPreferencesDialog(QWidget *parent)  : JDialog(parent){
    //super();
    setModal(true);
    setLayout(new QVBoxLayout());
    editConnectionPreferences = new EditConnectionPreferences(this);
    editConnectionPreferences->init();
    layout()->addWidget(editConnectionPreferences);
//        addHelpMenu("package.apps.TabbedPreferences", true); // NOI18N
    setDefaultCloseOperation(JFrame::DO_NOTHING_ON_CLOSE);
    addWindowListener((WindowListener*)this);
}
Пример #2
0
		Settings::Settings(ui::Window *owner)
			:	ui::Dialog(owner,"Settings"),
				gridLayout(2,1)
		{
			mScheme = new ui::theme::defaulttheme::MetalScheme();
			dScheme = new ui::theme::defaulttheme::DefaultScheme();

			contentPane = new ui::Panel(&layout);
			radioGroup = new ui::Panel(&gridLayout);
			controlGroup = new ui::Panel();

			ok = new ui::Button("Ok");
			cancel = new ui::Button("Cancel");

			defaultScheme = new ui::RadioButton("Default scheme");
			metalScheme = new ui::RadioButton("Java Metal Scheme");

			label = new ui::Label("Select a color scheme: ");

			defaultScheme->addItemListener(this);
			metalScheme->addItemListener(this);

			cancel->addMouseListener(this);
			ok->addMouseListener(this);

			controlGroup->add(cancel);
			controlGroup->add(ok);

			radioGroup->add(defaultScheme);
			radioGroup->add(metalScheme);

			group.add(defaultScheme);
			group.add(metalScheme);

			contentPane->add(label,ui::layout::BorderLayout::NORTH);
			contentPane->add(radioGroup,ui::layout::BorderLayout::CENTER);
			contentPane->add(controlGroup,ui::layout::BorderLayout::SOUTH);

			defaultScheme->setSelected(true);

			addWindowListener(this);

			setContentPane(contentPane);
			pack();
		}
Пример #3
0
/*private*/ void ImageIndexEditor::init(Editor* /*editor*/) {
    QMenuBar* menuBar = new QMenuBar();
    QMenu* findIcon = new QMenu(tr("File"));
    menuBar->addMenu(findIcon);
    QAction* storeItem = new QAction(tr("Store Image Index"),this);
    findIcon->addAction(storeItem);
//    storeItem.addActionListener(new ActionListener() {
//            /*public*/ void actionPerformed(ActionEvent event) {
//                storeImageIndex();
//            }
//    });
    connect(storeItem, SIGNAL(triggered()), this, SLOT(storeImageIndex()));

    findIcon->addSeparator();
    QAction* openItem = new QAction(tr("Open a File System Directory"), this);
//    openItem.addActionListener(new ActionListener() {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                DirectorySearcher.instance().openDirectory(false);
//            }
//        });
    findIcon->addAction(openItem);
    connect(openItem, SIGNAL(triggered()), this, SLOT(openItem_triggered()));
    QMenu* editMenu = new QMenu(tr("Edit"));
    menuBar->addMenu(editMenu);
    QAction* addItem = new QAction(tr("Add Node"),this);
//    addItem.addActionListener (new ActionListener () {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                addNode();
//            }
//        });
    connect(addItem, SIGNAL(triggered()), this, SLOT(addNode()));
    editMenu->addAction(addItem);
    QAction* renameItem = new QAction(tr("Rename Node"), this);
//    renameItem.addActionListener (new ActionListener () {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                renameNode();
//            }
//        });
    editMenu->addAction(renameItem);
    connect(renameItem, SIGNAL(triggered()), this, SLOT(renameNode()));
    QAction* deleteItem = new QAction(tr("Delete Node"), this);
//    deleteItem.addActionListener (new ActionListener () {
//            /*public*/ void actionPerformed(ActionEvent e) {
//                deleteNode();
//            }
//        });
    connect(deleteItem, SIGNAL(triggered()), this, SLOT(deleteNode()));
    editMenu->addAction(deleteItem);
    setMenuBar(menuBar);

    addHelpMenu("package.jmri.jmrit.catalog->ImageIndex", true);

    QWidget* mainPanel = new QWidget();
    mainPanel->setLayout(new QVBoxLayout(mainPanel/*, BoxLayout.Y_AXIS*/));
    QWidget* labelPanel = new QWidget();
    labelPanel->setLayout(new QHBoxLayout());
//    QString msg = java.text.MessageFormat.format(
//                       tr("dragIcons"),
//                       new Object[] {tr("defaultCatalog"), tr("ImageIndex")});
    QString msg = tr("Drag icons from the %1 viewing panel to nodes in the %2 tree.").arg("Default Catalogues:").arg("Image Index:");
    labelPanel->layout()->addWidget(new QLabel(msg/*, SwingConstants.LEFT*/));
    mainPanel->layout()->addWidget(labelPanel);
    QWidget* catalogsPanel = new QWidget();
    catalogsPanel->setLayout(new QHBoxLayout(catalogsPanel/*, BoxLayout.X_AXIS*/));
    catalogsPanel->layout()->addWidget(makeCatalogPanel());
//    catalogsPanel->layout()->addWidget(new JSeparator(SwingConstants.VERTICAL));
    QFrame* line = new QFrame(/*centralwidget()*/this);
    line->setObjectName(QString::fromUtf8("line"));
    line->setFrameShape(QFrame::HLine);
    line->setFrameShadow(QFrame::Sunken);
    catalogsPanel->layout()->addWidget(line);
    catalogsPanel->layout()->addWidget(makeIndexPanel());
    mainPanel->layout()->addWidget(catalogsPanel);
    if(centralWidget()== NULL)
    {
        QWidget* centralWidget = new QWidget();
        centralWidget->setLayout(new QVBoxLayout());
        setCentralWidget(centralWidget);
    }
    centralWidget()->layout()->addWidget(mainPanel);

    // when this window closes, check for saving
//    addWindowListener(new java.awt.event.WindowAdapter() {
//        /*public*/ void windowClosing(java.awt.event.WindowEvent e) {
//            DirectorySearcher.instance().close();
//            checkImageIndex();
//        }
//    });
    addWindowListener(new IIEWindowListener(this));
    //setLocation(10, 200);
    pack();
    setVisible(true);
}