/**
*
*/
package de.axxeed.animosy.gui;
import java.awt.BorderLayout;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JTextArea;
import org.apache.log4j.Logger;
import de.axxeed.animosy.model.Constants;
/**
* OptionsDialog.java
* Created 12.12.2007 11:13:23
* @author Markus J. Luzius
*
*/
public class AboutDialog extends JDialog implements Constants {
private static final long serialVersionUID = -1574694043263550395L;
private static Logger log = Logger.getLogger(AboutDialog.class);
private JTextArea about = new JTextArea();
public AboutDialog() {
log.debug("new about dialog, root pane: "+this.getRootPane().getWidth());
this.setSize(440,320);
this.setResizable(false);
this.setTitle("About AnImOSY");
this.setModal(true);
this.setLayout(new BorderLayout());
Point loc = PanelRepository.get(PanelRepository.MAIN_WINDOW).getLocation();
loc.translate((PanelRepository.get(PanelRepository.MAIN_WINDOW).getWidth()-300)/2, 50);
this.setLocation( loc );
StringBuilder aboutMsg = new StringBuilder();
aboutMsg.append("\n");
aboutMsg.append(" This game was inspired by two projects from sourceforge.net:\n");
aboutMsg.append(" - http://sourceforge.net/projects/scotland-yard (very much)\n");
aboutMsg.append(" - http://sourceforge.net/projects/scotlandyard (to a lesser extent)\n");
aboutMsg.append("\n");
aboutMsg.append(" It was then almost completely rewritten, especially regarding the GUI. \n");
aboutMsg.append("\n");
aboutMsg.append(" (c) 2007-2008, 2012-2013 Markus J. Luzius\n");
about.setText(aboutMsg.toString());
about.setEditable(false);
this.add(about, BorderLayout.CENTER);
JButton ok = new JButton("OK");
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
log.debug("ok "+arg0.getActionCommand());
setVisible(false);
}
});
this.add(ok, BorderLayout.SOUTH);
}
}