View Javadoc
1   /*
2    * Copyright 2013-2023 Medical Information Systems Research Group (https://medical.zcu.cz),
3    * Department of Computer Science and Engineering, University of West Bohemia.
4    * Address: Univerzitni 8, 306 14 Plzen, Czech Republic.
5    *
6    * This file is part of Sparkle project.
7    *
8    * Sparkle is free software: you can redistribute it and/or modify
9    * it under the terms of the GNU General Public License as published by
10   * the Free Software Foundation, either version 3 of the License.
11   *
12   * Sparkle is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with Sparkle. If not, see <http://www.gnu.org/licenses/>.
19   */
20  package cz.zcu.mre.sparkle.gui.mainForm.mainMenu;
21  
22  import cz.zcu.mre.sparkle.gui.mainForm.MainForm;
23  import cz.zcu.mre.sparkle.gui.tools.Components;
24  import javafx.fxml.FXML;
25  import javafx.scene.control.Button;
26  import javafx.scene.control.ToolBar;
27  import java.util.logging.Logger;
28  
29  /**
30   * Panel s tlacitky pod hlavnim menu.
31   *
32   * @author Jan Smucr
33   * @author Klara Hlavacova
34   * @author Petr Vcelak (vcelak@kiv.zcu.cz)
35   */
36  public class MainToolBar
37          extends ToolBar {
38  
39      private static final Logger LOG = Logger.getLogger(MainToolBar.class.getName());
40  
41      @FXML
42      private Button evaluateButton;
43      @FXML
44      private Button stopButton;
45      @FXML
46      private Button saveButton;
47      @FXML
48      private Button saveAllButton;
49      @FXML
50      private Button openButton;
51      @FXML
52      private Button switchStorageButton;
53  
54      private MainForm mainForm;
55  
56      public MainToolBar() {
57          Components.load(this);
58      }
59  
60      public void initialize(MainForm mainForm) {
61          this.mainForm = mainForm;
62      }
63  
64      @FXML
65      @SuppressWarnings("unused")
66      private void saveOnAction() {
67          MainMenuAction.save(mainForm.getMainTabPane());
68      }
69  
70      @FXML
71      @SuppressWarnings("unused")
72      public void saveAllOnAction() {
73          MainMenuAction.saveAll(mainForm.getMainTabPane());
74      }
75  
76      @FXML
77      @SuppressWarnings("unused")
78      private void export() {
79          MainMenuAction.export(mainForm.getMainTabPane());
80      }
81  
82      @FXML
83      @SuppressWarnings("unused")
84      private void openOnAction() {
85          MainMenuAction.open(mainForm);
86      }
87  
88      @FXML
89      @SuppressWarnings("unused")
90      private void evaluateOnAction() {
91          MainMenuAction.evaluate(mainForm.getMainTabPane(), mainForm.getDataAgent());
92      }
93  
94      @FXML
95      @SuppressWarnings("unused")
96      private void stopEvaluationOnAction() {
97          MainMenuAction.stopEvaluation(mainForm.getMainTabPane());
98      }
99  
100     @FXML
101     @SuppressWarnings("unused")
102     private void switchStorageOnAction() {
103         MainMenuAction.switchStorage(mainForm);
104     }
105 
106     public Button getEvaluateButton() {
107         return evaluateButton;
108     }
109 
110     public Button getStopButton() {
111         return stopButton;
112     }
113 
114     public Button getSaveButton() {
115         return saveButton;
116     }
117 
118     public Button getSaveAllButton() {
119         return saveAllButton;
120     }
121 
122     public Button getOpenButton() {
123         return openButton;
124     }
125 
126     /*public ComboBox<String> getLangComboBox() {
127         return langComboBox;
128     }*/
129     public Button getSwitchStorageButton() {
130         return switchStorageButton;
131     }
132 
133 }