Class AboutInfo

java.lang.Object
ca.corbett.extras.about.AboutInfo

public final class AboutInfo extends Object
Populate an instance of this class and then hand it to AboutDialog or AboutPanel to very quickly and easily create an "about this app" type of display for the user. Most fields here are optional. If present, they will be included in the resulting About view. It's recommended to include a logo image for your application around 480x90 or so and specify it here. If not supplied, the About code will try to generate one automatically based on the applicationName specified here.
Since:
2018-02-14
Author:
scorbo2
  • Field Details

    • applicationName

      public String applicationName
      The user-friendly name of the application, typically taken from Version.NAME.
    • applicationVersion

      public String applicationVersion
      The user-friendly version of the application, typically in "X.Y" format.
    • license

      public String license
      The license name or url for this application, if there is one. If this starts with http:// or https://, the link will be clickable (assuming clickable links are supported and allowed in this JRE).
    • projectUrl

      public String projectUrl
      The project URL for this project, if there is one. If this starts with http:// or https://, the link will be clickable (assuming clickable links are supported and allowed in this JRE).
    • logoImageLocation

      public String logoImageLocation
      The resource url location of the application logo image. Example: "/application_name/images/logo_wide.jpg". If this is null or non-existent, a logo image will automatically be generated using the contents of applicationName.
    • releaseNotesLocation

      public String releaseNotesLocation
      The resource url location of the release notes text file. Example: "/application_name/ReleaseNotes.txt"
    • releaseNotesText

      public String releaseNotesText
      You can alternatively specify release notes as a String. If both releaseNotesLocation and releaseNotesText are specified, then releaseNotesText will be used.
    • shortDescription

      public String shortDescription
      An optional user-friendly short description of the application. If null or empty, this field will not be shown at all. Will be truncated at 60 chars for space reasons, so keep it brief.
    • logoDisplayMode

      public AboutInfo.LogoDisplayMode logoDisplayMode
      How the application logo image should be displayed on the AboutPanel. See LogoDisplayMode for available options. If not specified, the image will be stretched a bit to fit the width of the form, so horizontally rectangular images work best here.
    • showLogConsole

      public boolean showLogConsole
      Indicates whether or not to add a link to open the LogConsole window. Defaults to false. If true, the application logo will be clickable as a bit of an easter egg thing to open the LogConsole.
  • Constructor Details

    • AboutInfo

      public AboutInfo()
      Creates a new, blank AboutInfo instance.
    • AboutInfo

      public AboutInfo(boolean showLogConsole)
      Creates a new, blank AboutInfo instance with the given showLogConsole option.
      Parameters:
      showLogConsole - If true, the logo image on AboutPanel will be clickable.
  • Method Details

    • addCustomField

      public void addCustomField(String name, String value)
      Adds a custom field value which will be displayed in the AboutPanel or AboutDialog. Note that you must invoke this with your custom field data BEFORE the AboutPanel or AboutDialog is rendered. Invoking this with a new field after rendering will do nothing. If the value of a custom field has changed since the AboutPanel or AboutDialog was rendered, use updateCustomField instead.
      Parameters:
      name - Any String which uniquely identifies this field. Will not be shown.
      value - The String value to display.
    • updateCustomField

      public void updateCustomField(String name, String value)
      Modifies the value of a custom field, identified by "name". This can be invoked after this AboutInfo has been rendered, and will update the containing AboutPanel accordingly.
      Parameters:
      name - The String which identifies the field to update.
      value - The new value for the field.
    • getCustomFieldValue

      public String getCustomFieldValue(String name)
      Returns the current value for the named custom field, if there is one.
      Parameters:
      name - The String which identifies the field in question.
      Returns:
      The String value of the custom field, or null if no such field.
    • clearCustomFields

      public void clearCustomFields()
      Removes all custom fields from this AboutInfo. Note that you must invoke this before the AboutPanel or AboutDialog is rendered, or nothing will happen.
    • getCustomFieldNames

      public Set<String> getCustomFieldNames()
      Returns a list of custom field names.
      Returns:
      A list of custom field names, if any.