21import java.awt.BorderLayout;
23import java.awt.Cursor;
24import java.awt.Desktop;
25import java.awt.FlowLayout;
27import java.awt.GridLayout;
28import java.awt.event.ActionEvent;
29import java.awt.event.ActionListener;
30import java.awt.event.MouseAdapter;
31import java.awt.event.MouseEvent;
33import java.io.IOException;
35import java.net.URISyntaxException;
38import javax.swing.GroupLayout;
39import javax.swing.ImageIcon;
40import javax.swing.JButton;
41import javax.swing.JLabel;
42import javax.swing.JPanel;
43import javax.swing.JTextPane;
44import javax.swing.UIManager;
45import javax.swing.text.SimpleAttributeSet;
46import javax.swing.text.StyleConstants;
76 this.setLayout(
new BorderLayout(0, 0));
79 JPanel centralPanel =
new JPanel();
80 this.add(centralPanel, BorderLayout.CENTER);
83 JPanel figurePanel =
new JPanel();
84 centralPanel.add(figurePanel);
86 JLabel show_image =
new JLabel(
"");
90 URL url = ClassLoader.getSystemResource(
91 "images/DENOPTIM_extended_logo.png");
92 show_image.setIcon(
new ImageIcon(
new ImageIcon(url).getImage()));
97 figurePanel.add(show_image);
100 JPanel buttonsPanel =
new JPanel();
101 buttonsPanel.setLayout(
new FlowLayout());
102 centralPanel.add(buttonsPanel);
104 JButton btnNewGA =
new JButton(
"New Evolutionary De Novo Design");
105 btnNewGA.addActionListener(
new ActionListener() {
106 public void actionPerformed(ActionEvent e) {
111 JButton btnNewVirtualScreening =
new JButton(
"New Virtual Screening");
112 btnNewVirtualScreening.addActionListener(
new ActionListener() {
113 public void actionPerformed(ActionEvent e) {
120 JButton btnNewFragments =
new JButton(
"Make Fragments");
121 btnNewFragments.addActionListener(
new ActionListener() {
122 public void actionPerformed(ActionEvent e) {
127 JButton btnNewGraph =
new JButton(
"Make Graphs");
128 btnNewGraph.addActionListener(
new ActionListener() {
129 public void actionPerformed(ActionEvent e) {
134 JButton btnReadGAOutput =
new JButton(
"Inspect Evolutionary Run");
135 btnReadGAOutput.setToolTipText(
"Analyzes the output folder of an "
136 +
"evolutionary experiment (i.e., folder named RUN...)");
137 btnReadGAOutput.addActionListener(
new ActionListener() {
138 public void actionPerformed(ActionEvent e) {
144 mainPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
150 JButton btnReadFSEOutput =
new JButton(
"Inspect Combinatorial Run");
151 btnReadFSEOutput.setToolTipText(
"Analyzes the output folder of an "
152 +
"combinatorial experiment (i.e., folder named FSE...)");
153 btnReadFSEOutput.addActionListener(
new ActionListener() {
154 public void actionPerformed(ActionEvent e) {
160 mainPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
167 JButton btnTestFitness =
new JButton(
"Test Fitness Provider");
168 btnTestFitness.addActionListener(
new ActionListener() {
169 public void actionPerformed(ActionEvent e) {
176 JPanel creditsPanel =
new JPanel();
177 this.add(creditsPanel, BorderLayout.SOUTH);
178 creditsPanel.setLayout(
new GridLayout(0, 1, 0, 0));
180 JTextPane txtpnCredits =
new JTextPane();
181 txtpnCredits.setFont(
new Font(
"Lucida Grande", Font.PLAIN, 10));
182 txtpnCredits.setBackground(UIManager.getColor(
"Button.background"));
183 SimpleAttributeSet attribs =
new SimpleAttributeSet();
184 StyleConstants.setAlignment(attribs , StyleConstants.ALIGN_CENTER);
185 txtpnCredits.setParagraphAttributes(attribs,
false);
186 txtpnCredits.setText(
"The DENOPTIM project"+System.getProperty(
"line.separator")+
"University of Bergen and Norwegian University of Science and Technology");
187 creditsPanel.add(txtpnCredits);
190 JTextPane email =
new JTextPane();
191 email.setForeground(Color.BLUE.darker());
192 email.setFont(
new Font(
"Lucida Grande", Font.PLAIN, 10));
193 email.setBackground(UIManager.getColor(
"Button.background"));
194 email.setText(
"denoptim.project@gmail.com");
195 email.setParagraphAttributes(attribs,
false);
196 email.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
197 email.addMouseListener(
new MouseAdapter() {
199 public void mouseClicked(MouseEvent e) {
201 Desktop.getDesktop().mail(
new URI(
"mailto:denoptim.project@gmail.com"));
202 }
catch (IOException | URISyntaxException e1) {
203 e1.printStackTrace();
207 creditsPanel.add(email);
209 JLabel labShortcuts =
new JLabel(
"Shortcuts:");
211 JLabel labEmpty =
new JLabel(
"<html><br><br><br><br><br><br></html>");
214 GroupLayout lyoCentralPanel =
new GroupLayout(centralPanel);
215 centralPanel.setLayout(lyoCentralPanel);
216 lyoCentralPanel.setAutoCreateGaps(
true);
217 lyoCentralPanel.setAutoCreateContainerGaps(
true);
218 lyoCentralPanel.setHorizontalGroup(lyoCentralPanel.createParallelGroup(
219 GroupLayout.Alignment.CENTER)
220 .addComponent(figurePanel)
221 .addComponent(labShortcuts)
222 .addGroup(lyoCentralPanel.createSequentialGroup()
223 .addComponent(btnNewFragments)
224 .addComponent(btnNewGraph))
225 .addGroup(lyoCentralPanel.createSequentialGroup()
226 .addComponent(btnNewGA)
227 .addComponent(btnNewVirtualScreening))
228 .addGroup(lyoCentralPanel.createSequentialGroup()
229 .addComponent(btnTestFitness))
230 .addGroup(lyoCentralPanel.createSequentialGroup()
231 .addComponent(btnReadGAOutput)
232 .addComponent(btnReadFSEOutput))
233 .addComponent(labEmpty));
234 lyoCentralPanel.setVerticalGroup(lyoCentralPanel.createSequentialGroup()
235 .addComponent(figurePanel)
236 .addComponent(labShortcuts)
237 .addGroup(lyoCentralPanel.createParallelGroup(GroupLayout.Alignment.CENTER)
238 .addComponent(btnNewFragments)
239 .addComponent(btnNewGraph))
240 .addGroup(lyoCentralPanel.createParallelGroup(GroupLayout.Alignment.CENTER)
241 .addComponent(btnNewGA)
242 .addComponent(btnNewVirtualScreening))
243 .addGroup(lyoCentralPanel.createParallelGroup(GroupLayout.Alignment.CENTER)
244 .addComponent(btnTestFitness))
245 .addGroup(lyoCentralPanel.createParallelGroup(GroupLayout.Alignment.CENTER)
246 .addComponent(btnReadGAOutput)
247 .addComponent(btnReadFSEOutput))
248 .addComponent(labEmpty));
Class of GUI panels meant to occupy one card in the deck-of-cards layout of the main panel.
GUIMainPanel mainPanel
The main panel (cards deck)
File opener for DENOPTIM GUI.
static File pickFolder(Component parent)
A panel that understands DENOPTIM graphs and allows to create and edit them.
A panel that allows to inspect the output of an combinatorial experiment exploring a fragment space.
void importFSERunData(File folder)
A panel that allows to inspect the output of an artificial evolution experiment.
void importGARunData(File file, JComponent parent)
The main panel is a deck of cards that occupies all the GUI frame.
Component add(Component comp)
Add a component and a reference to such component in the main tool bar.
Master form containing all sub-forms that need to be filled to define the input parameters for FragSp...
Form that allows to test the configuration of a fitness provider.
Master form containing all sub-forms that need to be filled to define the input parameters for Denopt...
A panel with a viewer capable of visualising DENOPTIM fragments and allows to create and edit fragmen...
The home panel contains shortcuts buttons to perform the most common tasks.
void initialize()
Initialize the panel with figure and shortcuts and credit panels.
HomePanel(GUIMainPanel mainPanel)
Constructor.
static final long serialVersionUID
Version.