Skip to content

Commit ca1ffb5

Browse files
author
NilsFo
committed
Release Version 1.1
1 parent 01ddaba commit ca1ffb5

4 files changed

Lines changed: 39 additions & 88 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
.idea/libraries/*
1010
/.idea/*
1111

12+
1213
ExperimentExporter.iml
1314
db_credentials.xml
1415
NaN_errors*
-6.82 KB
Binary file not shown.

src/de/rub/bph/CellomicsPuzzleHelper.java

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,25 @@
77
/**
88
* Created by nilfoe on 12/03/2018.
99
*/
10+
1011
public class CellomicsPuzzleHelper {
1112

1213
public static final String NAME = "ThermoFischer SCIENTIFIC ArrayScan Cellomics Image Puzzle-Helper";
13-
public static final String VERSION = "1.0";
14+
public static final String VERSION = "1.1";
1415
public static final String AUTHOR = "Nils Förster";
1516

1617
public static PuzzleHelperGUI helperGUI;
1718

1819
public static void main(String[] args) {
19-
//JFrame frame = new JFrame("Nuls test");
20-
//frame.setContentPane(new PuzzleHelperGUI().basePanel);
21-
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
22-
//frame.setVisible(true);
23-
//frame.pack();
24-
//frame.setLocationRelativeTo(null);
25-
26-
SwingUtilities.invokeLater(new Runnable() {
27-
@Override
28-
public void run() {
29-
try {
30-
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
31-
} catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) {
32-
e.printStackTrace();
33-
}
34-
35-
helperGUI = new PuzzleHelperGUI();
20+
21+
SwingUtilities.invokeLater(() -> {
22+
try {
23+
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
24+
} catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) {
25+
e.printStackTrace();
3626
}
27+
28+
helperGUI = new PuzzleHelperGUI();
3729
});
3830
};
3931

src/de/rub/bph/ui/PuzzleHelperGUI.java

Lines changed: 28 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -96,95 +96,53 @@ public PuzzleHelperGUI() {
9696
menu.add(autoUpdateCB);
9797

9898
item = new JMenuItem("Reset");
99-
item.addActionListener(new ActionListener() {
100-
@Override
101-
public void actionPerformed(ActionEvent actionEvent) {
102-
pack();
103-
setLocationRelativeTo(null);
104-
requestFocus();
105-
}
99+
item.addActionListener(actionEvent -> {
100+
pack();
101+
setLocationRelativeTo(null);
102+
requestFocus();
106103
});
107104
item.setAccelerator(KeyStroke.getKeyStroke('R', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
108105
menu.add(item);
109106
bar.add(menu);
110107

111108
menu = new JMenu("?");
112109
item = new JMenuItem("About");
113-
item.addActionListener(new ActionListener() {
114-
@Override
115-
public void actionPerformed(ActionEvent actionEvent) {
116-
JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "'" + CellomicsPuzzleHelper.NAME + "' by " + CellomicsPuzzleHelper.AUTHOR + ".\nVersion: " + CellomicsPuzzleHelper.VERSION + "\n\nCreated at the 'Ruhr University Bochum' and 'Leibniz Research Institute for environmental medicine'.", "About", JOptionPane.INFORMATION_MESSAGE);
117-
}
118-
});
110+
item.addActionListener(actionEvent -> JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "'" + CellomicsPuzzleHelper.NAME + "' by " + CellomicsPuzzleHelper.AUTHOR + ".\nVersion: " + CellomicsPuzzleHelper.VERSION + "\n\nCreated at the 'Ruhr University Bochum' and 'Leibniz Research Institute for environmental medicine'.", "About", JOptionPane.INFORMATION_MESSAGE));
119111
menu.add(item);
120112

121113
item = new JMenuItem("View on GitHub");
122-
item.addActionListener(new ActionListener() {
123-
@Override
124-
public void actionPerformed(ActionEvent actionEvent) {
125-
try {
126-
browseURL("https://github.com/RUB-Bioinf/CellomicsArrayScanPuzzleHelper");
127-
} catch (Exception e) {
128-
e.printStackTrace();
129-
JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "Failed to browse URL: " + e.getMessage());
130-
}
114+
item.addActionListener(actionEvent -> {
115+
try {
116+
browseURL("https://github.com/RUB-Bioinf/CellomicsArrayScanPuzzleHelper");
117+
} catch (Exception e) {
118+
e.printStackTrace();
119+
JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "Failed to browse URL: " + e.getMessage());
131120
}
132121
});
133122
menu.add(item);
134123
bar.add(menu);
135124

136125
setJMenuBar(bar);
137126

138-
button1.addActionListener(new ActionListener() {
139-
@Override
140-
public void actionPerformed(ActionEvent actionEvent) {
141-
update();
142-
}
143-
});
144-
directionCB.addActionListener(new ActionListener() {
145-
@Override
146-
public void actionPerformed(ActionEvent actionEvent) {
147-
requestUpdate();
148-
}
149-
});
150-
button3.addActionListener(new ActionListener() {
151-
@Override
152-
public void actionPerformed(ActionEvent actionEvent) {
153-
previewPL.incrementFontSize();
154-
}
155-
});
156-
button2.addActionListener(new ActionListener() {
157-
@Override
158-
public void actionPerformed(ActionEvent actionEvent) {
159-
previewPL.decrementFontSize();
160-
}
161-
});
162-
exportInstructionFileButton.addActionListener(new ActionListener() {
163-
@Override
164-
public void actionPerformed(ActionEvent actionEvent) {
165-
try {
166-
exportFile();
167-
} catch (IOException e) {
168-
e.printStackTrace();
169-
JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "Failed to save data to the file:\n" + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
170-
}
171-
}
172-
});
173-
autoReadImageSizesButton.addActionListener(new ActionListener() {
174-
@Override
175-
public void actionPerformed(ActionEvent actionEvent) {
176-
autoReadImageSize();
127+
button1.addActionListener(actionEvent -> update());
128+
directionCB.addActionListener(actionEvent -> requestUpdate());
129+
button3.addActionListener(actionEvent -> previewPL.incrementFontSize());
130+
button2.addActionListener(actionEvent -> previewPL.decrementFontSize());
131+
exportInstructionFileButton.addActionListener(actionEvent -> {
132+
try {
133+
exportFile();
134+
} catch (IOException e) {
135+
e.printStackTrace();
136+
JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "Failed to save data to the file:\n" + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
177137
}
178138
});
179-
importBT.addActionListener(new ActionListener() {
180-
@Override
181-
public void actionPerformed(ActionEvent actionEvent) {
182-
try {
183-
actionImportFile();
184-
} catch (IOException e) {
185-
e.printStackTrace();
186-
JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "Failed to read instruction file:\n" + e.getMessage(), CellomicsPuzzleHelper.NAME, JOptionPane.ERROR_MESSAGE);
187-
}
139+
autoReadImageSizesButton.addActionListener(actionEvent -> autoReadImageSize());
140+
importBT.addActionListener(actionEvent -> {
141+
try {
142+
actionImportFile();
143+
} catch (IOException e) {
144+
e.printStackTrace();
145+
JOptionPane.showMessageDialog(PuzzleHelperGUI.this, "Failed to read instruction file:\n" + e.getMessage(), CellomicsPuzzleHelper.NAME, JOptionPane.ERROR_MESSAGE);
188146
}
189147
});
190148

0 commit comments

Comments
 (0)