package saccubus;
+import java.net.URISyntaxException;
import static javax.swing.WindowConstants.*;
import java.awt.Color;
+import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import java.net.URI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
+import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingUtilities;
/**
*/
public class MainFrame_AboutBox extends JDialog implements ActionListener {
- private static final String VERSION = "いんきゅばす 2.0.0";
+ public static final String VERSION = "いんきゅばす 2.1.0";
private static final long serialVersionUID = -4256413309312729840L;
- private static final Logger logger = Logger.getLogger(MainFrame_AboutBox.class.getName());
+ private static final Logger logger = LoggerFactory.getLogger(MainFrame_AboutBox.class);
private static final String LINE_FEED = System.getProperty("line.separator");
- private final JButton okButton = new JButton();
+ private final JButton btnOk = new JButton();
public MainFrame_AboutBox(Frame parent) {
super(parent);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
jbInit();
} catch (Exception exception) {
- logger.log(Level.SEVERE, null, exception);
+ logger.error(null, exception);
}
}
fldProduct.setBorder(BorderFactory.createEmptyBorder());
fldProduct.setBackground(new Color(0, 0, 0, 0));
- final JScrollPane pnlLicense = createLicensePane();
+ final JButton btnInqubus = new JButton("いんきゅばすホームページへ...");
+ btnInqubus.addActionListener(new ActionListener() {
- okButton.setText("OK");
- okButton.addActionListener(this);
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (Desktop.isDesktopSupported()) {
+ try {
+ Desktop.getDesktop().browse(new URI("http://sourceforge.jp/projects/coroid/wiki/InqubusV2"));
+ } catch (IOException | URISyntaxException ex) {
+ logger.error(null, ex);
+ }
+ }
+ }
+ });
+ final JButton btnSaccubus = new JButton("さきゅばすホームページへ...");
+ btnSaccubus.addActionListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (Desktop.isDesktopSupported()) {
+ try {
+ Desktop.getDesktop().browse(new URI("http://saccubus.sourceforge.jp/"));
+ } catch (IOException | URISyntaxException ex) {
+ logger.error(null, ex);
+ }
+ }
+ }
+ });
final JPanel pnlAbout = new JPanel();
GroupLayout glAbout = new GroupLayout(pnlAbout);
pnlAbout.setLayout(glAbout);
+ glAbout.setAutoCreateContainerGaps(true);
+ glAbout.setAutoCreateGaps(true);
glAbout.setHorizontalGroup(glAbout.createParallelGroup(GroupLayout.Alignment.CENTER)
.addGroup(glAbout.createSequentialGroup()
- .addGap(15).addComponent(lblImage).addGap(30).addComponent(fldProduct).addGap(30))
+ .addComponent(lblImage)
+ .addPreferredGap(ComponentPlacement.UNRELATED)
+ .addComponent(fldProduct)
+ )
+ .addGroup(glAbout.createSequentialGroup()
+ .addComponent(btnInqubus)
+ .addComponent(btnSaccubus)
+ )
);
glAbout.setVerticalGroup(glAbout.createSequentialGroup()
- .addGap(15)
.addGroup(glAbout.createParallelGroup()
- .addComponent(lblImage).addComponent(fldProduct))
- .addGap(15)
+ .addComponent(lblImage)
+ .addComponent(fldProduct, 0, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
+ )
+ .addGroup(glAbout.createParallelGroup()
+ .addComponent(btnInqubus)
+ .addComponent(btnSaccubus)
+ )
);
tab.add("About", pnlAbout);
+
+ final JScrollPane pnlLicense = createLicensePane();
tab.add("License", pnlLicense);
+ btnOk.setText("OK");
+ btnOk.addActionListener(this);
+
final JPanel pnlBase = new JPanel();
final GroupLayout glBase = new GroupLayout(pnlBase);
pnlBase.setLayout(glBase);
glBase.setHorizontalGroup(glBase.createParallelGroup(Alignment.CENTER)
.addComponent(tab)
- .addComponent(okButton)
+ .addComponent(btnOk)
);
glBase.setVerticalGroup(glBase.createSequentialGroup()
.addComponent(tab)
- .addComponent(okButton)
+ .addComponent(btnOk)
);
area.append(LINE_FEED);
}
} catch (IOException ex) {
- logger.log(Level.SEVERE, null, ex);
+ logger.error(null, ex);
}
area.setEditable(false);
licenseField.append(LINE_FEED);
}
} catch (IOException ex) {
- logger.log(Level.SEVERE, null, ex);
+ logger.error(null, ex);
}
licenseField.setCaretPosition(0);
*/
@Override
public void actionPerformed(ActionEvent actionEvent) {
- if (actionEvent.getSource() == okButton) {
+ if (actionEvent.getSource() == btnOk) {
dispose();
}
}