001package apps.swing; 002 003import java.awt.event.ActionEvent; 004 005import javax.swing.Icon; 006import javax.swing.JFrame; 007 008import jmri.util.swing.*; 009 010/** 011 * 012 * @author Randall Wood Copyright 2020 013 */ 014public class AboutAction extends JmriAbstractAction { 015 016 public AboutAction(String s, WindowInterface wi) { 017 super(s, wi); 018 } 019 020 public AboutAction(String s, Icon i, WindowInterface wi) { 021 super(s, i, wi); 022 } 023 024 public AboutAction() { 025 super("About"); 026 } 027 028 @Override 029 public void actionPerformed(ActionEvent e) { 030 JFrame tmp = null; 031 if ( e != null ) { 032 var x = jmri.util.swing.JmriJOptionPane.findWindowForObject(e.getSource()); 033 if ( x instanceof JFrame ) { 034 tmp = (JFrame)x; 035 } 036 } 037 new AboutDialog(tmp, true).setVisible(true); 038 } 039 040 // never invoked, because we overrode actionPerformed above 041 @Override 042 public JmriPanel makePanel() { 043 throw new IllegalArgumentException("Should not be invoked"); 044 } 045 //private static final Logger log = LoggerFactory.getLogger(AboutAction.class); 046}