Added about panel
This commit is contained in:
34
src/uk/co/majenko/audiobookrecorder/AboutPanel.java
Normal file
34
src/uk/co/majenko/audiobookrecorder/AboutPanel.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package uk.co.majenko.audiobookrecorder;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class AboutPanel extends JPanel {
|
||||
|
||||
public AboutPanel() {
|
||||
setLayout(new BorderLayout());
|
||||
JLabel icon = new JLabel(Icons.appIcon);
|
||||
add(icon, BorderLayout.WEST);
|
||||
|
||||
JPanel p = new JPanel();
|
||||
p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));
|
||||
|
||||
p.add(Box.createVerticalGlue());
|
||||
|
||||
JLabel l1 = new JLabel("AudiobookRecorder");
|
||||
JLabel l2 = new JLabel("Version " + AudiobookRecorder.config.getProperty("version"));
|
||||
JLabel l3 = new JLabel("(c) 2018 Majenko Technologies");
|
||||
|
||||
l1.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
l2.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
l3.setAlignmentX(JComponent.CENTER_ALIGNMENT);
|
||||
|
||||
p.add(l1);
|
||||
p.add(Box.createVerticalGlue());
|
||||
p.add(l2);
|
||||
p.add(l3);
|
||||
|
||||
p.add(Box.createVerticalGlue());
|
||||
add(p, BorderLayout.CENTER);
|
||||
}
|
||||
}
|
||||
@@ -19,12 +19,15 @@ import edu.cmu.sphinx.result.*;
|
||||
|
||||
public class AudiobookRecorder extends JFrame {
|
||||
|
||||
static Properties config = new Properties();
|
||||
|
||||
MainToolBar toolBar;
|
||||
|
||||
JMenuBar menuBar;
|
||||
JMenu fileMenu;
|
||||
JMenu bookMenu;
|
||||
JMenu toolsMenu;
|
||||
JMenu helpMenu;
|
||||
|
||||
JMenuItem fileNewBook;
|
||||
JMenuItem fileOpenBook;
|
||||
@@ -35,6 +38,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
JMenuItem toolsOptions;
|
||||
|
||||
JMenuItem helpAbout;
|
||||
|
||||
FlashPanel centralPanel;
|
||||
|
||||
JPanel statusBar;
|
||||
@@ -174,6 +179,19 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
menuBar.add(toolsMenu);
|
||||
|
||||
|
||||
helpMenu = new JMenu("Help");
|
||||
helpAbout = new JMenuItem("About AudiobookRecorder");
|
||||
|
||||
helpAbout.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JOptionPane.showMessageDialog(AudiobookRecorder.this, new AboutPanel(), "About AudiobookRecorder", JOptionPane.PLAIN_MESSAGE);
|
||||
}
|
||||
});
|
||||
|
||||
helpMenu.add(helpAbout);
|
||||
menuBar.add(helpMenu);
|
||||
|
||||
ob.add(menuBar, BorderLayout.NORTH);
|
||||
|
||||
setPreferredSize(new Dimension(700, 500));
|
||||
@@ -536,6 +554,11 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
try {
|
||||
config.load(AudiobookRecorder.class.getResourceAsStream("config.txt"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
AudiobookRecorder frame = new AudiobookRecorder();
|
||||
}
|
||||
|
||||
|
||||
@@ -353,15 +353,15 @@ public class Options extends JDialog {
|
||||
defaultPrefs.put("audio.recording.device", "");
|
||||
}
|
||||
defaultPrefs.put("audio.recording.channels", "2");
|
||||
defaultPrefs.put("audio.recording.samplerate", "48000");
|
||||
defaultPrefs.put("audio.recording.samplerate", "44100");
|
||||
if (playbackMixers.length > 0) {
|
||||
defaultPrefs.put("audio.playback.device", playbackMixers[0].key);
|
||||
} else {
|
||||
defaultPrefs.put("audio.playback.device", "");
|
||||
}
|
||||
|
||||
defaultPrefs.put("catenation.pre-chapter", "2000");
|
||||
defaultPrefs.put("catenation.post-chapter", "2000");
|
||||
defaultPrefs.put("catenation.pre-chapter", "1000");
|
||||
defaultPrefs.put("catenation.post-chapter", "1500");
|
||||
defaultPrefs.put("catenation.post-sentence", "1000");
|
||||
defaultPrefs.put("catenation.post-paragraph", "2000");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user