Class ReportBugBuilder
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- gov.nih.mipav.view.dialogs.JDialogBase
-
- gov.nih.mipav.view.dialogs.reportbug.ReportBugBuilder
-
- All Implemented Interfaces:
DialogDefaultsInterface
,java.awt.event.ActionListener
,java.awt.event.FocusListener
,java.awt.event.ItemListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class ReportBugBuilder extends JDialogBase implements java.awt.event.WindowListener
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReportBugBuilder.BugType
-
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JTextArea
attachedImages
Text are for displaying the attached imagesprivate java.lang.String
attachmentName
Name of the image being attached.private javax.swing.JFileChooser
browser
File chooser for the user to select an existing file for attachmentprivate static java.lang.String
BUG_MAIL_URL
URL of the page we use to actually send the bug report email.private javax.swing.JComboBox
bugTypeComboBox
private javax.swing.JTextPane
descriptionField
Text pane for user inputed bug descriptionprivate javax.swing.JTextField
directory
Text field for the directory of a file being attached from the user's computerprivate javax.swing.JTextField
emailField
Text field for user inputed emailprivate java.util.ArrayList<java.lang.String>
fileNames
ArrayList of all file names of report attachmentsprivate java.util.ArrayList<java.lang.String>
filePaths
ArrayList of all file paths of report attachmentsprivate javax.swing.JFrame
frame
Frame for the GUI in which the form is presentedprivate java.io.File
image
Image file used to store images created through the screen capture functionprivate boolean
isScreenCapAttached
Hack-ish boolean to avoid double adding screen captures to the attachment list.private javax.swing.JTextField
nameField
Text field for user inputed namejavax.swing.JButton
screenCap
Button to launch the create new image dialogprivate JDialogCaptureScreen
screenCapture
Dialog used for taking screen capturesprivate static long
serialVersionUID
Use serialVersionUID for interoperability.private javax.swing.JTextField
standardOS
Text field for the user inputed operating system.private javax.swing.JTextField
standardUrgency
Text field for the user inputed urgency of the bugprivate javax.swing.JTextField
standardVersion
Text field for the user inputed mipav version.private javax.swing.JTextField
summaryField
Text area for user inputed bug title-
Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description ReportBugBuilder()
Initializes the GUI and then deletes the created files once the program has finished running
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.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 eventsstatic java.lang.String
compileReport(java.lang.String summary, java.lang.String name, java.lang.String email, java.lang.String version, java.lang.String os, java.lang.String urgency, java.lang.String description)
Pulls system specifications from the user's computer and then compiles all appropriate fields together into a text documentprivate void
displayReportForm()
Initializes GUI.static java.lang.String
getEmailDefault()
static java.lang.String
getNameDefault()
static java.lang.String
getUrgencyDefault()
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.private void
loadFieldDefaults()
Tries to set the bug report field defaults based on system properties or last-entered data.private void
saveFieldDefaults()
Saves the last-entered bug report field text for loading the next time the dialog is used.static void
sendReportWeb(java.lang.String summary, java.lang.String name, java.lang.String email, java.lang.String version, java.lang.String os, java.lang.String urgency, java.lang.String description, ReportBugBuilder.BugType bugType, java.util.ArrayList<java.lang.String> filePaths, java.util.ArrayList<java.lang.String> fileNames)
void
windowClosed(java.awt.event.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-
Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
frame
private javax.swing.JFrame frame
Frame for the GUI in which the form is presented
-
attachedImages
private final javax.swing.JTextArea attachedImages
Text are for displaying the attached images
-
descriptionField
private final javax.swing.JTextPane descriptionField
Text pane for user inputed bug description
-
summaryField
private final javax.swing.JTextField summaryField
Text area for user inputed bug title
-
nameField
private final javax.swing.JTextField nameField
Text field for user inputed name
-
emailField
private final javax.swing.JTextField emailField
Text field for user inputed email
-
standardOS
private final javax.swing.JTextField standardOS
Text field for the user inputed operating system.
-
standardVersion
private final javax.swing.JTextField standardVersion
Text field for the user inputed mipav version.
-
standardUrgency
private final javax.swing.JTextField standardUrgency
Text field for the user inputed urgency of the bug
-
bugTypeComboBox
private javax.swing.JComboBox bugTypeComboBox
-
attachmentName
private java.lang.String attachmentName
Name of the image being attached.
-
fileNames
private final java.util.ArrayList<java.lang.String> fileNames
ArrayList of all file names of report attachments
-
directory
private javax.swing.JTextField directory
Text field for the directory of a file being attached from the user's computer
-
browser
private javax.swing.JFileChooser browser
File chooser for the user to select an existing file for attachment
-
filePaths
private final java.util.ArrayList<java.lang.String> filePaths
ArrayList of all file paths of report attachments
-
screenCap
public javax.swing.JButton screenCap
Button to launch the create new image dialog
-
image
private java.io.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 java.lang.String BUG_MAIL_URL
URL of the page we use to actually send the bug report email.- See Also:
- Constant Field Values
-
-
Method Detail
-
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(java.awt.event.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 interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJDialogBase
- Parameters:
event
- Event that triggered this function.
-
compileReport
public static final java.lang.String compileReport(java.lang.String summary, java.lang.String name, java.lang.String email, java.lang.String version, java.lang.String os, java.lang.String urgency, java.lang.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(java.lang.String summary, java.lang.String name, java.lang.String email, java.lang.String version, java.lang.String os, java.lang.String urgency, java.lang.String description, ReportBugBuilder.BugType bugType, java.util.ArrayList<java.lang.String> filePaths, java.util.ArrayList<java.lang.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(java.awt.event.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 interfacejava.awt.event.WindowListener
- Overrides:
windowClosed
in classJDialogBase
- 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 java.lang.String getNameDefault()
-
getEmailDefault
public static final java.lang.String getEmailDefault()
-
getUrgencyDefault
public static final java.lang.String getUrgencyDefault()
-
saveFieldDefaults
private void saveFieldDefaults()
Saves the last-entered bug report field text for loading the next time the dialog is used.
-
-