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,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JTextAreaText are for displaying the attached imagesprivate StringName of the image being attached.private JFileChooserFile chooser for the user to select an existing file for attachmentprivate static final StringURL of the page we use to actually send the bug report email.private JComboBoxprivate final JTextPaneText pane for user inputed bug descriptionprivate JTextFieldText field for the directory of a file being attached from the user's computerprivate final JTextFieldText field for user inputed emailArrayList of all file names of report attachmentsArrayList of all file paths of report attachmentsprivate JFrameFrame for the GUI in which the form is presentedprivate FileImage file used to store images created through the screen capture functionprivate booleanHack-ish boolean to avoid double adding screen captures to the attachment list.private final JTextFieldText field for user inputed nameButton to launch the create new image dialogprivate JDialogCaptureScreenDialog used for taking screen capturesprivate static final longUse serialVersionUID for interoperability.private final JTextFieldText field for the user inputed operating system.private final JTextFieldText field for the user inputed urgency of the bugprivate final JTextFieldText field for the user inputed mipav version.private final JTextFieldText area for user inputed bug titleFields 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, voiManagerFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionInitializes the GUI and then deletes the created files once the program has finished running -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(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 final StringcompileReport(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 documentprivate voidInitializes GUI.static final Stringstatic final Stringstatic final Stringprivate voidinit()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 voidTries to set the bug report field defaults based on system properties or last-entered data.private voidSaves the last-entered bug report field text for loading the next time the dialog is used.static final voidsendReportWeb(String summary, String name, String email, String version, String os, String urgency, String description, ReportBugBuilder.BugType bugType, ArrayList<String> filePaths, ArrayList<String> fileNames) voidwindowClosed(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 wellMethods 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, windowOpenedMethods 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, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, toFrontMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.event.WindowListener
windowActivated, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
frame
Frame for the GUI in which the form is presented -
attachedImages
Text are for displaying the attached images -
descriptionField
Text pane for user inputed bug description -
summaryField
Text area for user inputed bug title -
nameField
Text field for user inputed name -
emailField
Text field for user inputed email -
standardOS
Text field for the user inputed operating system. -
standardVersion
Text field for the user inputed mipav version. -
standardUrgency
Text field for the user inputed urgency of the bug -
bugTypeComboBox
-
attachmentName
Name of the image being attached. -
fileNames
ArrayList of all file names of report attachments -
directory
Text field for the directory of a file being attached from the user's computer -
browser
File chooser for the user to select an existing file for attachment -
filePaths
ArrayList of all file paths of report attachments -
screenCap
Button to launch the create new image dialog -
image
Image file used to store images created through the screen capture function -
screenCapture
Dialog used for taking screen captures -
isScreenCapAttached
private boolean isScreenCapAttachedHack-ish boolean to avoid double adding screen captures to the attachment list. -
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
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:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- 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
-
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
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:
windowClosedin interfaceWindowListener- Overrides:
windowClosedin 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
-
getEmailDefault
-
getUrgencyDefault
-
saveFieldDefaults
private void saveFieldDefaults()Saves the last-entered bug report field text for loading the next time the dialog is used.
-