Search in sources :

Example 1 with SettingsView

use of de.unijena.cheminf.mortar.gui.views.SettingsView in project MORTAR by FelixBaensch.

the class SettingsViewController method showSettingsView.

// 
// <editor-fold desc="private methods" defaultstate="collapsed">
/**
 * Initialises and opens settingsView
 */
private void showSettingsView() {
    if (this.settingsView == null)
        this.settingsView = new SettingsView();
    this.settingsViewStage = new Stage();
    Scene tmpScene = new Scene(this.settingsView, GuiDefinitions.GUI_MAIN_VIEW_WIDTH_VALUE, GuiDefinitions.GUI_MAIN_VIEW_HEIGHT_VALUE);
    this.settingsViewStage.setScene(tmpScene);
    this.settingsViewStage.initModality(Modality.WINDOW_MODAL);
    this.settingsViewStage.initOwner(this.mainStage);
    this.settingsViewStage.setTitle(Message.get("FragmentationSettingsView.title"));
    this.settingsViewStage.setMinHeight(GuiDefinitions.GUI_MAIN_VIEW_HEIGHT_VALUE);
    this.settingsViewStage.setMinWidth(GuiDefinitions.GUI_MAIN_VIEW_WIDTH_VALUE);
    Platform.runLater(() -> {
        this.addListeners();
        this.settingsView.addTab(this.settingsViewStage, Message.get("GlobalSettingsView.title"), this.settingsContainer.settingsProperties(), this.settingsContainer.getSettingNameToTooltipTextMap(), this.recentProperties);
    });
    this.settingsViewStage.showAndWait();
}
Also used : Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) SettingsView(de.unijena.cheminf.mortar.gui.views.SettingsView)

Example 2 with SettingsView

use of de.unijena.cheminf.mortar.gui.views.SettingsView in project MORTAR by FelixBaensch.

the class FragmentationSettingsViewController method openFragmentationSettingsView.

// 
/**
 * Initialises and opens a settings view for fragmentationSettings
 */
private void openFragmentationSettingsView() {
    if (this.settingsView == null)
        this.settingsView = new SettingsView();
    this.fragmentationSettingsViewStage = new Stage();
    Scene tmpScene = new Scene(this.settingsView, GuiDefinitions.GUI_MAIN_VIEW_WIDTH_VALUE, GuiDefinitions.GUI_MAIN_VIEW_HEIGHT_VALUE);
    this.fragmentationSettingsViewStage.setScene(tmpScene);
    this.fragmentationSettingsViewStage.initModality(Modality.WINDOW_MODAL);
    this.fragmentationSettingsViewStage.initOwner(this.mainStage);
    this.fragmentationSettingsViewStage.show();
    this.fragmentationSettingsViewStage.setTitle(Message.get("FragmentationSettingsView.title"));
    this.fragmentationSettingsViewStage.setMinHeight(GuiDefinitions.GUI_MAIN_VIEW_HEIGHT_VALUE);
    this.fragmentationSettingsViewStage.setMinWidth(GuiDefinitions.GUI_MAIN_VIEW_WIDTH_VALUE);
    // 
    this.addListener();
    for (IMoleculeFragmenter tmpFragmenter : this.fragmenters) {
        HashMap<String, Object> tmpRecentProperties = new HashMap<>(tmpFragmenter.settingsProperties().size());
        this.recentProperties.put(tmpFragmenter.getFragmentationAlgorithmName(), tmpRecentProperties);
        Tab tmpTab = this.settingsView.addTab(this.fragmentationSettingsViewStage, tmpFragmenter.getFragmentationAlgorithmName(), tmpFragmenter.settingsProperties(), tmpFragmenter.getSettingNameToTooltipTextMap(), tmpRecentProperties);
        if (tmpFragmenter.getFragmentationAlgorithmName().equals(this.selectedFragmenterName)) {
            this.settingsView.getSelectionModel().select(tmpTab);
        }
    }
}
Also used : Tab(javafx.scene.control.Tab) HashMap(java.util.HashMap) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) SettingsView(de.unijena.cheminf.mortar.gui.views.SettingsView) IMoleculeFragmenter(de.unijena.cheminf.mortar.model.fragmentation.algorithm.IMoleculeFragmenter)

Aggregations

SettingsView (de.unijena.cheminf.mortar.gui.views.SettingsView)2 Scene (javafx.scene.Scene)2 Stage (javafx.stage.Stage)2 IMoleculeFragmenter (de.unijena.cheminf.mortar.model.fragmentation.algorithm.IMoleculeFragmenter)1 HashMap (java.util.HashMap)1 Tab (javafx.scene.control.Tab)1