HiRISE

HiRISE.HiPlan.HOGG
Class HiReporter

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by HiRISE.HiPlan.HOGG.HiReporter
All Implemented Interfaces:
edu.asu.jmars.layer.obs.mro.MroCustomEditor, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class HiReporter
extends JDialog
implements edu.asu.jmars.layer.obs.mro.MroCustomEditor, PropertyChangeListener

An implementation of the MRO custom editor interface that opens an observation or a suggestion in HiReport. The HiReporter.Engine inner class provides the means to create Actions for opening HiReport.

Version:
2.14
Author:
Christian Schaller - UA/PIRL
See Also:
Serialized Form

Nested Class Summary
static class HiReporter.Engine
          The core functionality of HiReporter.
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String APPLICATION_GROUP
           
static String BASE_URL
           
static String BUTTON_LABEL
          The button label for the HiReport button as it appears in the MTT focus panel if the browser launcher is available.
static String COORDINATE_SEARCH_RANGE
           
static String COORDINATE_SEARCH_REPORT
           
static String DEFAULT_BASE_URL
           
static double DEFAULT_COORDINATE_SEARCH_RANGE
           
static String DEFAULT_COORDINATE_SEARCH_REPORT
           
static String DEFAULT_OBSERVATION_REPORT
           
static String DEFAULT_SUGGESTION_REPORT
           
static String ID
          Class identification name with source code version and date.
static String OBSERVATION_REPORT
           
static String SUGGESTION_REPORT
           
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HiReporter()
          Creates a new HiReporter.
HiReporter(Component component)
          Creates a new HiReporter with an owner frame derived from the incidcated component.
 
Method Summary
 String getLabel()
          Gets the label for the HiReporter button as it appears in the MTT focus panel.
 boolean isEditable(String ptfRecordText)
          Tests whether a particular PTF record is able to be handled by the HiReporter.
 void propertyChange(PropertyChangeEvent event)
          Responds to a property change event from a registered producer of such changes.
 String showDialog(Component parentComponent, String ptfRecordText)
          Handles a click on the HiReport button in the MTT focus panel.
 
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, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, transferFocusBackward, 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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

BUTTON_LABEL

public static final String BUTTON_LABEL
The button label for the HiReport button as it appears in the MTT focus panel if the browser launcher is available.

See Also:
getLabel(), Constant Field Values

APPLICATION_GROUP

public static final String APPLICATION_GROUP
See Also:
Constant Field Values

BASE_URL

public static final String BASE_URL
See Also:
Constant Field Values

DEFAULT_BASE_URL

public static final String DEFAULT_BASE_URL
See Also:
Constant Field Values

OBSERVATION_REPORT

public static final String OBSERVATION_REPORT
See Also:
Constant Field Values

DEFAULT_OBSERVATION_REPORT

public static final String DEFAULT_OBSERVATION_REPORT
See Also:
Constant Field Values

SUGGESTION_REPORT

public static final String SUGGESTION_REPORT
See Also:
Constant Field Values

DEFAULT_SUGGESTION_REPORT

public static final String DEFAULT_SUGGESTION_REPORT
See Also:
Constant Field Values

COORDINATE_SEARCH_REPORT

public static final String COORDINATE_SEARCH_REPORT
See Also:
Constant Field Values

DEFAULT_COORDINATE_SEARCH_REPORT

public static final String DEFAULT_COORDINATE_SEARCH_REPORT
See Also:
Constant Field Values

COORDINATE_SEARCH_RANGE

public static final String COORDINATE_SEARCH_RANGE
See Also:
Constant Field Values

DEFAULT_COORDINATE_SEARCH_RANGE

public static final double DEFAULT_COORDINATE_SEARCH_RANGE
See Also:
Constant Field Values
Constructor Detail

HiReporter

public HiReporter(Component component)
Creates a new HiReporter with an owner frame derived from the incidcated component. The dialog is not displayed; to do so, use the showDialog(Component,String) method.

If component is null, a shared, hidden frame is set as the owner of the dialog.

The availability of the web browser launcher is tested, and if the test fails, the HiReporter is configured to return a null for the button label, which will prevent the label's display.

See Also:
Utilities.testBrowserLauncher()

HiReporter

public HiReporter()
Creates a new HiReporter. The availability of the web browser launcher is tested, and if the test fails, the HiReporter is configured to return a null for the button label, which will prevent the label's display.

See Also:
Utilities.testBrowserLauncher()
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent event)
Responds to a property change event from a registered producer of such changes.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
event - the property change event.

getLabel

public String getLabel()
Gets the label for the HiReporter button as it appears in the MTT focus panel. If the browser launcher is not available, this method returns a null; this prevents the button from being shown in the focus panel at all.

Specified by:
getLabel in interface edu.asu.jmars.layer.obs.mro.MroCustomEditor
See Also:
BUTTON_LABEL, Utilities.testBrowserLauncher()

showDialog

public String showDialog(Component parentComponent,
                         String ptfRecordText)
Handles a click on the HiReport button in the MTT focus panel. This method is normally used to display a dialog within the MTT application itself, but in the case of the HiReporter, it launches a web browser window with a HiReport report on either an observation or a suggestion.

The HiReporter looks for an observation ID or a suggestion ID in the ptfRecordText in the following order:

  1. an observation ID in the team database ID field
  2. a suggestion ID in the team database ID field
  3. a suggestion ID in the comment field

An observation ID is an ID that can be expressed as text as defined by the Observation_ID class. A suggestion ID is simply an integer.

If no ID can be found, a warning is displayed to the operator.

Note that because this method does not actually modify the PTF text, it returns a null. In an otherwise typical implentation of the MroCustomEditor interface, a null return indicates the operator either canceled the dialog or made no changes; the null prevents the MTT focus panel from updating the PTF record upon return.

Specified by:
showDialog in interface edu.asu.jmars.layer.obs.mro.MroCustomEditor
Parameters:
parentComponent - unused.
ptfRecordText - the text format of the PTF record from which the ID is parsed.
Returns:
null.

isEditable

public boolean isEditable(String ptfRecordText)
Tests whether a particular PTF record is able to be handled by the HiReporter. A record is so able is the browser launcher is availble, the PTF record is not null, and the instrument set field starts with H, indicating it is a HiRISE record.

Specified by:
isEditable in interface edu.asu.jmars.layer.obs.mro.MroCustomEditor
Parameters:
ptfRecordText - the text format of the PTF record.
Returns:
true if the PTF record is appropriate for the HiReporter; false otherwise.
See Also:
Utilities.testBrowserLauncher()

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona