Class ReportBugBuilder

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class ReportBugBuilder extends JDialogBase implements WindowListener
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • frame

      private JFrame frame
      Frame for the GUI in which the form is presented
    • attachedImages

      private final JTextArea attachedImages
      Text are for displaying the attached images
    • descriptionField

      private final JTextPane descriptionField
      Text pane for user inputed bug description
    • summaryField

      private final JTextField summaryField
      Text area for user inputed bug title
    • nameField

      private final JTextField nameField
      Text field for user inputed name
    • emailField

      private final JTextField emailField
      Text field for user inputed email
    • standardOS

      private final JTextField standardOS
      Text field for the user inputed operating system.
    • standardVersion

      private final JTextField standardVersion
      Text field for the user inputed mipav version.
    • standardUrgency

      private final JTextField standardUrgency
      Text field for the user inputed urgency of the bug
    • bugTypeComboBox

      private JComboBox bugTypeComboBox
    • attachmentName

      private String attachmentName
      Name of the image being attached.
    • fileNames

      private final ArrayList<String> fileNames
      ArrayList of all file names of report attachments
    • directory

      private JTextField directory
      Text field for the directory of a file being attached from the user's computer
    • browser

      private JFileChooser browser
      File chooser for the user to select an existing file for attachment
    • filePaths

      private final ArrayList<String> filePaths
      ArrayList of all file paths of report attachments
    • screenCap

      public JButton screenCap
      Button to launch the create new image dialog
    • image

      private File image
      Image file used to store images created through the screen capture function
    • screenCapture

      private JDialogCaptureScreen screenCapture
      Dialog used for taking screen captures
    • isScreenCapAttached

      private boolean isScreenCapAttached
      Hack-ish boolean to avoid double adding screen captures to the attachment list.
    • BUG_MAIL_URL

      private static final String BUG_MAIL_URL
      URL of the page we use to actually send the bug report email.
      See Also:
  • Constructor Details

    • ReportBugBuilder

      public ReportBugBuilder()
      Initializes the GUI and then deletes the created files once the program has finished running
  • Method Details

    • init

      private void init()
      Creates a JFrame asking if the user is a developer and then runs the method displayReportForm, which displays the appropriate form for the selected type.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Performs the following actions based on the command:
      • OK - Initializes pertinent fields, checking that all fields are filled out correctly, before sending the information to be processed for an email
      • Cancel - cleans up and disposes the dialog
      • Other - sends event to secondary method that looks for combobox events
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - Event that triggered this function.
    • compileReport

      public static final String compileReport(String summary, String name, String email, String version, String os, String urgency, String description)
      Pulls system specifications from the user's computer and then compiles all appropriate fields together into a text document
    • sendReportWeb

      public static final void sendReportWeb(String summary, String name, String email, String version, String os, String urgency, String description, ReportBugBuilder.BugType bugType, ArrayList<String> filePaths, ArrayList<String> fileNames)
    • displayReportForm

      private void displayReportForm()
      Initializes GUI. Contains two sections, one for information on the system and the user, the other containing fields for describing the bug itself.
    • windowClosed

      public void windowClosed(WindowEvent event)
      Performs the following actions based on the command:
      • OK - creates a file using the currently selected image and the given file name and then attaches it to email
      • Insert - inserts the image into the description area and if a name is provided, attaches the image as a file as well
      Specified by:
      windowClosed in interface WindowListener
      Overrides:
      windowClosed in class JDialogBase
      Parameters:
      event - Event that triggered this function.
    • loadFieldDefaults

      private void loadFieldDefaults()
      Tries to set the bug report field defaults based on system properties or last-entered data.
    • getNameDefault

      public static final String getNameDefault()
    • getEmailDefault

      public static final String getEmailDefault()
    • getUrgencyDefault

      public static final String getUrgencyDefault()
    • saveFieldDefaults

      private void saveFieldDefaults()
      Saves the last-entered bug report field text for loading the next time the dialog is used.