Class GPLAboutDialog

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byGPLAboutDialog
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable

public class GPLAboutDialog
extends javax.swing.AbstractAction

GPLAboutDialog is an extension of AbstractAction which will display an "About" dialog and/or the GPL when actionPerformed is invoked. GPLAboutDialog assumes the GPL is kept in the current folder and called license.txt

If the file cannot be read, the user will be asked if the program should try and download a new copy of the GPL from the internet.

The icon for the dialog that displays the GPL defaults to the local file gnu-logo.jpeg

The source and class files can be found at http://www.eldritch.org/erskin/GPLAboutDialog/GPLAboutDialog.java and http://www.eldritch.org/erskin/GPLAboutDialog/GPLAboutDialog.class

Naturally, this program is licensed under the GPL as well. Which is availble at http://www.fsf.org/copyleft/gpl.txt or from the GPLAboutDialog site.

The java source, the class file, the default gnu-logo, and the GNU license can be downloaded in one file from http://www.eldritch.org/erskin/GPLAboutDialog/GPLAboutDialog.tar.gz (~22k)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
GPLAboutDialog(java.awt.Component parent, java.lang.String name, java.lang.String version, java.lang.String blurb, java.lang.String copyright)
          Constructs a new GPLAboutDialog with the default gnu_logo, default program icon, and the assumption that we are not using internal frames.
GPLAboutDialog(java.awt.Component parent, java.lang.String name, java.lang.String version, java.lang.String blurb, java.lang.String copyright, boolean internalFrames)
          Constructs a new GPLAboutDialog with the default gnu_logo and the default program icon.
GPLAboutDialog(java.awt.Component parent, java.lang.String name, java.lang.String version, java.lang.String blurb, java.lang.String copyright, javax.swing.Icon programLogo)
          Constructs a new GPLAboutDialog with default gnu_logo and assumes we are not using internal frames.
GPLAboutDialog(java.awt.Component parent, java.lang.String name, java.lang.String version, java.lang.String blurb, java.lang.String copyright, javax.swing.Icon programLogo, boolean internalFrames)
          Constructs a new GPLAboutDialog with default gnu_logo.jpeg.
GPLAboutDialog(java.awt.Component parent, java.lang.String name, java.lang.String version, java.lang.String blurb, java.lang.String copyright, javax.swing.Icon programLogo, javax.swing.Icon gnuLogo, boolean internalFrames)
          Constructs a new GPLAboutDialog with absolutely all options.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Displays and about dialog box, regardless of the event, and offers to display the GNU GPL, offering to download it if it is not found locally.
 java.lang.String getBlurb()
          Returns the current program purpose blurb the about dialog will display.
 java.lang.String getCopyright()
          Returns the current author/copyright string the about dialog will display.
 javax.swing.Icon getGnuLogo()
          Returns the current Icon that will be displayed on the GPL dialog if requested.
 java.lang.String getName()
          Returns the current program name the about dialog will display.
 java.awt.Component getParent()
          Returns the current parent Component the dialog will use when displayed.
 javax.swing.Icon getProgramLogo()
          Returns the current Icon that will be displayed on the about dialog for the program.
 java.lang.String getVersion()
          Returns the current version number the about dialog will display.
 boolean isInternalFrames()
          Returns true if the about dialog will open internal frames.
 void setBlurb(java.lang.Object blurb)
          Assigns the program purpose blurb the about dialog will display.
 void setCopyright(java.lang.Object copyright)
          Assigns the author/copyright string the about dialog will display.
 void setGnuLogo(javax.swing.Icon gnuLogo)
          Assigns the Icon that will be displayed on the GPL dialog if requested.
 void setInternalFrames(boolean newInternalFrames)
          Determines if the about diaog should be displayed using internal frames.
 void setName(java.lang.Object name)
          Assigns the program name the about dialog will display.
 void setParent(java.awt.Component parent)
          Assigns the parent Component the dialog will use when displayed.
 void setProgramLogo(javax.swing.Icon programLogo)
          Assigns the Icon that will be displayed on the about dialog for the program.
 void setVersion(java.lang.Object version)
          Assigns the version number the about dialog will display.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GPLAboutDialog

public GPLAboutDialog(java.awt.Component parent,
                      java.lang.String name,
                      java.lang.String version,
                      java.lang.String blurb,
                      java.lang.String copyright,
                      javax.swing.Icon programLogo,
                      javax.swing.Icon gnuLogo,
                      boolean internalFrames)
Constructs a new GPLAboutDialog with absolutely all options.

Parameters:
parent - the parent Component for the dialog
name - the program name
version - the program version number
blurb - the program purpose text
copyright - the author/copyright text
programLogo - the Icon for the about dialog
gnuLogo - the Icon for the GPL dialog
internalFrames - true if internal frames should be used

GPLAboutDialog

public GPLAboutDialog(java.awt.Component parent,
                      java.lang.String name,
                      java.lang.String version,
                      java.lang.String blurb,
                      java.lang.String copyright,
                      javax.swing.Icon programLogo,
                      boolean internalFrames)
Constructs a new GPLAboutDialog with default gnu_logo.jpeg.

Parameters:
parent - the parent Component for the dialog
name - the program name
version - the program version number
blurb - the program purpose text
copyright - the author/copyright text
programLogo - the Icon for the about dialog
internalFrames - true if internal frames should be used

GPLAboutDialog

public GPLAboutDialog(java.awt.Component parent,
                      java.lang.String name,
                      java.lang.String version,
                      java.lang.String blurb,
                      java.lang.String copyright,
                      javax.swing.Icon programLogo)
Constructs a new GPLAboutDialog with default gnu_logo and assumes we are not using internal frames.

Parameters:
parent - the parent Component for the dialog
name - the program name
version - the program version number
blurb - the program purpose text
copyright - the author/copyright text
programLogo - the Icon for the about dialog

GPLAboutDialog

public GPLAboutDialog(java.awt.Component parent,
                      java.lang.String name,
                      java.lang.String version,
                      java.lang.String blurb,
                      java.lang.String copyright,
                      boolean internalFrames)
Constructs a new GPLAboutDialog with the default gnu_logo and the default program icon.

Parameters:
parent - the parent Component for the dialog
name - the program name
version - the program version number
blurb - the program purpose text
copyright - the author/copyright text
internalFrames - true if internal frames should be used

GPLAboutDialog

public GPLAboutDialog(java.awt.Component parent,
                      java.lang.String name,
                      java.lang.String version,
                      java.lang.String blurb,
                      java.lang.String copyright)
Constructs a new GPLAboutDialog with the default gnu_logo, default program icon, and the assumption that we are not using internal frames.

Parameters:
parent - the parent Component for the dialog
name - the program name
version - the program version number
blurb - the program purpose text
copyright - the author/copyright text
Method Detail

getParent

public java.awt.Component getParent()
Returns the current parent Component the dialog will use when displayed.

Returns:
the parent Component the dialog will be attached to

setParent

public void setParent(java.awt.Component parent)
Assigns the parent Component the dialog will use when displayed.

Parameters:
parent - the new parent objects

getName

public java.lang.String getName()
Returns the current program name the about dialog will display.

Returns:
the program name that will be displayed

setName

public void setName(java.lang.Object name)
Assigns the program name the about dialog will display.

Parameters:
name - the new program name that will be displayed

getVersion

public java.lang.String getVersion()
Returns the current version number the about dialog will display.

Returns:
the version number that will be displayed

setVersion

public void setVersion(java.lang.Object version)
Assigns the version number the about dialog will display.

Parameters:
version - the new version number that will be displayed

getBlurb

public java.lang.String getBlurb()
Returns the current program purpose blurb the about dialog will display.

Returns:
the program blurb that will be displayed

setBlurb

public void setBlurb(java.lang.Object blurb)
Assigns the program purpose blurb the about dialog will display.

Parameters:
blurb - the new that will be displayed

getCopyright

public java.lang.String getCopyright()
Returns the current author/copyright string the about dialog will display.

Returns:
the copyright string that will be displayed

setCopyright

public void setCopyright(java.lang.Object copyright)
Assigns the author/copyright string the about dialog will display. Generally of the form "by John Doe\nCopyright 1999 John Doe"

Parameters:
copyright - the new author/copyright that will be displayed

isInternalFrames

public boolean isInternalFrames()
Returns true if the about dialog will open internal frames.

Returns:
true if internal frames will be displayed

setInternalFrames

public void setInternalFrames(boolean newInternalFrames)
Determines if the about diaog should be displayed using internal frames.


getGnuLogo

public javax.swing.Icon getGnuLogo()
Returns the current Icon that will be displayed on the GPL dialog if requested. The internal default is the local file "gnu-logo.jpeg"

Returns:
the Icon that will be displayed on the GPL dialog

setGnuLogo

public void setGnuLogo(javax.swing.Icon gnuLogo)
Assigns the Icon that will be displayed on the GPL dialog if requested.

Parameters:
gnuLogo - the new Icon for the GPL dialog

getProgramLogo

public javax.swing.Icon getProgramLogo()
Returns the current Icon that will be displayed on the about dialog for the program. The default is null which should result in JOptionPane using it's internal information icon

Returns:
the Icon that will be displayed on the GPL dialog

setProgramLogo

public void setProgramLogo(javax.swing.Icon programLogo)
Assigns the Icon that will be displayed on the about dialog for the program.

Parameters:
programLogo - the new program Icon for the about dialog

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Displays and about dialog box, regardless of the event, and offers to display the GNU GPL, offering to download it if it is not found locally.

Parameters:
e - ignored action event