HiRISE

HiRISE.HiPlan.HiWeb
Class SuggestionEditorPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by HiRISE.HiPlan.HiWeb.SuggestionEditorPanel
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, DocumentListener
Direct Known Subclasses:
SuggestionBackfillPanel

public class SuggestionEditorPanel
extends JPanel
implements ActionListener, DocumentListener

Base class of suggestion editors. By default, this is an "advanced" editor which can edit nearly every field of a Suggestion.

Version:
1.75
Author:
Guy McArthur - UA/PIRL
See Also:
Serialized Form

Nested Class Summary
static class SuggestionEditorPanel.SuggesterCache
           
static class SuggestionEditorPanel.Validation_Exception
          An exception for reporting problems with the validation of a suggestion's fields.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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
protected  Alerts alerts
          The alert manager.
static String APPLICATION_GROUP
          The application-specific parameter group for the suggestion editor.
protected static Color ATTENTION_COLOR
           
protected  String catalog
          Catalog name to use for database connection.
protected  Configuration configuration
          Reference to config parameters.
protected  Database database
          Source of DB connections.
static Double DEFAULT_FOOTPRINT_HEIGHT
          The default value for the footprint height.
static Double DEFAULT_FOOTPRINT_WIDTH
          The default value for the footprint width.
static Double DEFAULT_MAXIMUM_EMISSION_ANGLE
          The default value for the maximum emission angle.
static Double DEFAULT_MAXIMUM_INCIDENCE_ANGLE
          The default value for the maximum incidence angle.
static Double DEFAULT_MAXIMUM_L_SUB_S
          The default value for the maximum L sub S.
static Double DEFAULT_MAXIMUM_PHASE_ANGLE
          The default value for the maximum phase angle.
static Double DEFAULT_MINIMUM_EMISSION_ANGLE
          The default value for the minimum emission angle.
static Double DEFAULT_MINIMUM_INCIDENCE_ANGLE
          The default value for the minimum incidence angle.
static Double DEFAULT_MINIMUM_L_SUB_S
          The default value for the minimum L sub S.
static Double DEFAULT_MINIMUM_PHASE_ANGLE
          The default value for the minimum phase angle.
static String FOOTPRINT_HEIGHT
          The configuration parameter holding the maximum footprint width in km.
static String FOOTPRINT_WIDTH
          The configuration parameter holding the minimum footprint width in km.
static String ID
          Class identification name with source code version and date.
protected  SuggestedObservation initialSuggestion
          The suggestion prior to modification by the panel.
static String KEY_ID
          Name of the primary key field.
protected static int MAX_DESCRIPTION_LENGTH
          The maximum length of the description and STL description field.
static String MAXIMUM_EMISSION_ANGLE
          The configuration parameter holding the maximum emission angle in degrees.
static String MAXIMUM_INCIDENCE_ANGLE
          The configuration parameter holding the maximum incidence angle in degrees.
static String MAXIMUM_L_SUB_S
          The configuration parameter holding the maximum L sub S in degrees.
static String MAXIMUM_PHASE_ANGLE
          The configuration parameter holding the maximum phase angle in degrees.
static String MINIMUM_EMISSION_ANGLE
          The configuration parameter holding the minimum emission angle in degrees.
static String MINIMUM_INCIDENCE_ANGLE
          The configuration parameter holding the minimum incidence angle in degrees.
static String MINIMUM_L_SUB_S
          The configuration parameter holding the minimum L sub S in degrees.
static String MINIMUM_PHASE_ANGLE
          The configuration parameter holding the minimum phase angle in degrees.
protected  Suggestion_Panel.Mode mode
          The suggestion editor mode of operation.
protected static Color OUT_OF_LIMITS_COLOR
           
protected static Color OUT_OF_LIMITS_TEXT_COLOR
           
protected static int STRUT_SIZE
           
protected  SuggestionEditorPanel.SuggesterCache suggesterCache
          A cache of suggeter usernames and user IDs.
protected  SuggestedObservation suggestion
          The suggestion currently represented by the panel.
static String TABLE_PEOPLE
          Name of table that stores suggesters.
static String TABLE_PEOPLE_MAP
          Name of table that stores science theme mappings.
static String TABLE_SCIENCE_THEMES
          Name of table that stores science themes.
static String TABLE_SCIENCE_THEMES_MAP
          Name of table that stores science theme mappings
static String TABLE_SUGGESTIONS
          Name of table that stores suggested observations.
protected  String username
          The operator's HiWeb username.
static String USERNAME
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected SuggestionEditorPanel()
          Constructs a new editor panel.
protected SuggestionEditorPanel(Configuration configuration, String catalog)
          Creates a new editor panel.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addActionListener(ActionListener listener)
           
 Alerts alerts()
          Gets the suggestion editor's alerts manager.
 void alerts(Alerts alerts)
          Sets the suggestion editor's alerts manager.
 void backfillSuggestion(Observation_Record observationRecord)
          Fills values in the suggestion record with those derived from the input observation record.
protected  void calculateVertices()
          Sets the ROI vertices based up the min/max latitude and longitude (if available) or the center latitude and longitude.
protected  void change(boolean update)
          Does an update or an insert.
 void changedUpdate(DocumentEvent e)
           
protected  void configure()
           
 void copyFrom(SuggestionEditorPanel editor)
          Propagates values from another instance of a suggestion editor to this instance.
 void enableEditorFields(boolean enabled)
           
 void enableOwnerFields(boolean enabled)
           
 void enableOwnerHitsFields(boolean enabled)
           
 void enableStlFields(boolean enabled)
           
protected  void fireActionPerformed(ActionEvent e)
           
 ActionListener[] getActionListeners()
           
protected  JPanel getBoundedConstraintsPanel()
           
protected  JPanel getColorPanel()
          Returns a panel for editing color and color priority fields.
protected  JPanel getCoordinatesPanel()
          Returns a panel for editing latitude, longitude and ROI Vertices.
protected  JPanel getCoordinationPanel()
          Returns a panel for editing CRISM coordination and STL CRISM coordination.
 String getDefaultSuggester()
          Gets the suggestion editor's default suggester.
 String getID()
          Gets the ID of the suggestion.
protected  JPanel getNotesPanel()
          Returns a panel for editing science rationale and special notes.
protected  JPanel getPhotometryPanel()
          Returns a panel for editing photometric fields.
protected  JPanel getPointingPanel()
          Returns a panel for editing pointing and stability fields.
protected  JPanel getPriorityPanel()
          Returns a panel for editing priority fields.
protected  JPanel getStereoPanel()
          Returns a panel for editing stereo and stereo priority fields.
protected  JPanel getStlBoundedConstraintsPanel()
           
 Double getStlMaxEmissionAngle()
           
 Double getStlMaxIncidenceAngle()
           
 Double getStlMaxLsubS()
           
 Double getStlMaxPhaseAngle()
           
 Double getStlMinEmissionAngle()
           
 Double getStlMinIncidenceAngle()
           
 Double getStlMinLsubS()
           
 Double getStlMinPhaseAngle()
           
protected  JPanel getSuggestionPanel()
          Creates a panel for Suggestion fields ID, Version, Date, STL Must Have, Description, STL Description, # of observations, STL # of observations, Science Theme, Approval Status, Target Name, and Submitter.
 void init()
          Initializes the interface and resets all values to their defauls.
 SuggestedObservation initialSuggestion()
          Gets the editor's suggestion prior to modification.
 void insert()
          Inserts the current suggestion into the database as a new record.
 void insertUpdate(DocumentEvent e)
           
 void removeActionListener(ActionListener listener)
           
 void removeUpdate(DocumentEvent e)
           
 void select(int id)
          Load a suggested observation by its ID number.
 void setDefaultSuggester(String suggester)
          Sets the suggestion editor's default suggester.
 void setEmissionAngles(double min, double max)
          Sets the minimum and maximum emission angles.
 void setIncidenceAngles(double min, double max)
          Sets the minimum and maximum incidence angles.
 void setLsubS(double min, double max)
          Sets the minimum and maximum LS.
 void setPhaseAngles(double min, double max)
          Sets the minimum and maximum phase angles.
 SuggestedObservation suggestion()
          Gets the editor's suggestion as defined by the current state of its controls.
 void update()
          Updates the suggestion's database record.
protected  void updateDescription(JTextField field, JLabel label, Color attentionColor)
          Updates a label associated with a text field.
 void updateObservationFields(Observation_Record observation)
           
 void validateSuggestion()
          Validates the suggestion's fields in the editor.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, 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

TABLE_SUGGESTIONS

public static final String TABLE_SUGGESTIONS
Name of table that stores suggested observations.

See Also:
Constant Field Values

TABLE_SCIENCE_THEMES

public static final String TABLE_SCIENCE_THEMES
Name of table that stores science themes.

See Also:
Constant Field Values

TABLE_SCIENCE_THEMES_MAP

public static final String TABLE_SCIENCE_THEMES_MAP
Name of table that stores science theme mappings

See Also:
Constant Field Values

TABLE_PEOPLE

public static final String TABLE_PEOPLE
Name of table that stores suggesters.

See Also:
Constant Field Values

USERNAME

public static final String USERNAME
See Also:
Constant Field Values

TABLE_PEOPLE_MAP

public static final String TABLE_PEOPLE_MAP
Name of table that stores science theme mappings.

See Also:
Constant Field Values

KEY_ID

public static final String KEY_ID
Name of the primary key field.

See Also:
Constant Field Values

MAX_DESCRIPTION_LENGTH

protected static final int MAX_DESCRIPTION_LENGTH
The maximum length of the description and STL description field. This length is enforced by the database.

See Also:
Constant Field Values

ATTENTION_COLOR

protected static final Color ATTENTION_COLOR

OUT_OF_LIMITS_COLOR

protected static final Color OUT_OF_LIMITS_COLOR

OUT_OF_LIMITS_TEXT_COLOR

protected static final Color OUT_OF_LIMITS_TEXT_COLOR

STRUT_SIZE

protected static final int STRUT_SIZE
See Also:
Constant Field Values

APPLICATION_GROUP

public static final String APPLICATION_GROUP
The application-specific parameter group for the suggestion editor.

See Also:
Constant Field Values

MINIMUM_EMISSION_ANGLE

public static final String MINIMUM_EMISSION_ANGLE
The configuration parameter holding the minimum emission angle in degrees. Default value: DEFAULT_MINIMUM_EMISSION_ANGLE.

See Also:
Constant Field Values

DEFAULT_MINIMUM_EMISSION_ANGLE

public static final Double DEFAULT_MINIMUM_EMISSION_ANGLE
The default value for the minimum emission angle.


MAXIMUM_EMISSION_ANGLE

public static final String MAXIMUM_EMISSION_ANGLE
The configuration parameter holding the maximum emission angle in degrees. Default value: DEFAULT_MAXIMUM_EMISSION_ANGLE.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_EMISSION_ANGLE

public static final Double DEFAULT_MAXIMUM_EMISSION_ANGLE
The default value for the maximum emission angle.


MINIMUM_INCIDENCE_ANGLE

public static final String MINIMUM_INCIDENCE_ANGLE
The configuration parameter holding the minimum incidence angle in degrees. Default value: DEFAULT_MINIMUM_INCIDENCE_ANGLE.

See Also:
Constant Field Values

DEFAULT_MINIMUM_INCIDENCE_ANGLE

public static final Double DEFAULT_MINIMUM_INCIDENCE_ANGLE
The default value for the minimum incidence angle.


MAXIMUM_INCIDENCE_ANGLE

public static final String MAXIMUM_INCIDENCE_ANGLE
The configuration parameter holding the maximum incidence angle in degrees. Default value: DEFAULT_MAXIMUM_INCIDENCE_ANGLE.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_INCIDENCE_ANGLE

public static final Double DEFAULT_MAXIMUM_INCIDENCE_ANGLE
The default value for the maximum incidence angle.


MINIMUM_PHASE_ANGLE

public static final String MINIMUM_PHASE_ANGLE
The configuration parameter holding the minimum phase angle in degrees. Default value: DEFAULT_MINIMUM_PHASE_ANGLE.

See Also:
Constant Field Values

DEFAULT_MINIMUM_PHASE_ANGLE

public static final Double DEFAULT_MINIMUM_PHASE_ANGLE
The default value for the minimum phase angle.


MAXIMUM_PHASE_ANGLE

public static final String MAXIMUM_PHASE_ANGLE
The configuration parameter holding the maximum phase angle in degrees. Default value: DEFAULT_MAXIMUM_PHASE_ANGLE.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_PHASE_ANGLE

public static final Double DEFAULT_MAXIMUM_PHASE_ANGLE
The default value for the maximum phase angle.


MINIMUM_L_SUB_S

public static final String MINIMUM_L_SUB_S
The configuration parameter holding the minimum L sub S in degrees. Default value: DEFAULT_MINIMUM_L_SUB_S.

See Also:
Constant Field Values

DEFAULT_MINIMUM_L_SUB_S

public static final Double DEFAULT_MINIMUM_L_SUB_S
The default value for the minimum L sub S.


MAXIMUM_L_SUB_S

public static final String MAXIMUM_L_SUB_S
The configuration parameter holding the maximum L sub S in degrees. Default value: DEFAULT_MAXIMUM_L_SUB_S.

See Also:
Constant Field Values

DEFAULT_MAXIMUM_L_SUB_S

public static final Double DEFAULT_MAXIMUM_L_SUB_S
The default value for the maximum L sub S.


FOOTPRINT_WIDTH

public static final String FOOTPRINT_WIDTH
The configuration parameter holding the minimum footprint width in km. Default value: DEFAULT_FOOTPRINT_WIDTH.

See Also:
Constant Field Values

DEFAULT_FOOTPRINT_WIDTH

public static final Double DEFAULT_FOOTPRINT_WIDTH
The default value for the footprint width.


FOOTPRINT_HEIGHT

public static final String FOOTPRINT_HEIGHT
The configuration parameter holding the maximum footprint width in km. Default value: DEFAULT_FOOTPRINT_HEIGHT.

See Also:
Constant Field Values

DEFAULT_FOOTPRINT_HEIGHT

public static final Double DEFAULT_FOOTPRINT_HEIGHT
The default value for the footprint height.


username

protected String username
The operator's HiWeb username. This value is taken from the configuration's HOGG.HIWEB_USERNAME parameter. If no such parameter is found, or if the configuration is null, the value is taken from the operator's system username.


mode

protected Suggestion_Panel.Mode mode
The suggestion editor mode of operation. The parameter name is Mode; the default value is READ_ONLY.

This panel and its principal subclass, SuggestionBackfillPanel, do not use the Suggestion_Panel.Mode.DISABLED mode; it is presumed that if the suggestion mechanism is disabled, these panels are not even instantiated.


suggestion

protected SuggestedObservation suggestion
The suggestion currently represented by the panel.


initialSuggestion

protected SuggestedObservation initialSuggestion
The suggestion prior to modification by the panel.


configuration

protected Configuration configuration
Reference to config parameters.


catalog

protected String catalog
Catalog name to use for database connection.


database

protected Database database
Source of DB connections.


suggesterCache

protected SuggestionEditorPanel.SuggesterCache suggesterCache
A cache of suggeter usernames and user IDs.


alerts

protected Alerts alerts
The alert manager.

Constructor Detail

SuggestionEditorPanel

protected SuggestionEditorPanel()
Constructs a new editor panel. This method is suitable for subclasses that build their own UIs.


SuggestionEditorPanel

protected SuggestionEditorPanel(Configuration configuration,
                                String catalog)
                         throws Invalid_Argument_Exception
Creates a new editor panel.

Parameters:
configuration - the configuration file.
catalog - the catalog from which to retrieve suggestion info.
Throws:
Invalid_Argument_Exception - if the configuration does not specify a valid database connection.
Method Detail

configure

protected void configure()

getSuggestionPanel

protected JPanel getSuggestionPanel()
Creates a panel for Suggestion fields ID, Version, Date, STL Must Have, Description, STL Description, # of observations, STL # of observations, Science Theme, Approval Status, Target Name, and Submitter.

Returns:
UI Panel

getCoordinatesPanel

protected JPanel getCoordinatesPanel()
Returns a panel for editing latitude, longitude and ROI Vertices.

Returns:
UI Panel

getCoordinationPanel

protected JPanel getCoordinationPanel()
Returns a panel for editing CRISM coordination and STL CRISM coordination.

Returns:
UI panel

getPhotometryPanel

protected JPanel getPhotometryPanel()
Returns a panel for editing photometric fields.

Returns:
UI panel

getBoundedConstraintsPanel

protected JPanel getBoundedConstraintsPanel()

getStlBoundedConstraintsPanel

protected JPanel getStlBoundedConstraintsPanel()

getStereoPanel

protected JPanel getStereoPanel()
Returns a panel for editing stereo and stereo priority fields.

Returns:
UI panel

getColorPanel

protected JPanel getColorPanel()
Returns a panel for editing color and color priority fields.

Returns:
UI panel

getPriorityPanel

protected JPanel getPriorityPanel()
Returns a panel for editing priority fields.

Returns:
UI panel

getPointingPanel

protected JPanel getPointingPanel()
Returns a panel for editing pointing and stability fields.

Returns:
UI panel

getNotesPanel

protected JPanel getNotesPanel()
Returns a panel for editing science rationale and special notes.

Returns:
UI panel

addActionListener

public void addActionListener(ActionListener listener)

removeActionListener

public void removeActionListener(ActionListener listener)

getActionListeners

public ActionListener[] getActionListeners()

fireActionPerformed

protected void fireActionPerformed(ActionEvent e)

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

changedUpdate

public void changedUpdate(DocumentEvent e)
Specified by:
changedUpdate in interface DocumentListener

insertUpdate

public void insertUpdate(DocumentEvent e)
Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent e)
Specified by:
removeUpdate in interface DocumentListener

updateDescription

protected void updateDescription(JTextField field,
                                 JLabel label,
                                 Color attentionColor)
Updates a label associated with a text field. The label is set to the current character count of the text field's text; leading and trailing whitespace are excluded from the count. If the count is greater than MAX_DESCRIPTION_LENGTH, the label's foreground color is changed to the attentionColor; otherwise it is set to the null, so that it inherits from its parent component.

Parameters:
field - the text field in question, assumed to be one of the suggestion panel's description fields.
label - the label to update.
attentionColor - the label's foreground color when the character count is larger than allowed.

updateObservationFields

public void updateObservationFields(Observation_Record observation)

init

public void init()
          throws Database_Exception
Initializes the interface and resets all values to their defauls.

Throws:
Database_Exception - if there is a problem with the database connection.

copyFrom

public void copyFrom(SuggestionEditorPanel editor)
              throws ParseException
Propagates values from another instance of a suggestion editor to this instance.

Parameters:
editor - another instance or subclassed instance of a suggestion editor.
Throws:
ParseException - if invalid values are found.

setLsubS

public void setLsubS(double min,
                     double max)
Sets the minimum and maximum LS.

Parameters:
min - the minimum value in degrees.
max - the maximum value in degrees.

setEmissionAngles

public void setEmissionAngles(double min,
                              double max)
Sets the minimum and maximum emission angles.

Parameters:
min - the minimum value in degrees.
max - the maximum value in degrees.

setIncidenceAngles

public void setIncidenceAngles(double min,
                               double max)
Sets the minimum and maximum incidence angles.

Parameters:
min - the minimum value in degrees.
max - the maximum value in degrees.

setPhaseAngles

public void setPhaseAngles(double min,
                           double max)
Sets the minimum and maximum phase angles.

Parameters:
min - the minimum value in degrees.
max - the maximum value in degrees.

calculateVertices

protected void calculateVertices()
                          throws Invalid_Argument_Exception
Sets the ROI vertices based up the min/max latitude and longitude (if available) or the center latitude and longitude.

Throws:
Invalid_Argument_Exception - if the coordinates are invalid.

select

public void select(int id)
            throws Database_Exception,
                   Invalid_Argument_Exception,
                   ParseException
Load a suggested observation by its ID number.

Parameters:
id - the suggestion ID number.
Throws:
Database_Exception - if the data could not be loaded from the database.
Invalid_Argument_Exception - if id could not be found.
ParseException - if the database form of the suggestion has invalid data.

insert

public void insert()
            throws Database_Exception,
                   SuggestionEditorPanel.Validation_Exception
Inserts the current suggestion into the database as a new record. Upon so doing, the suggestion's target is set to that of the observation, if the suggestion panel is associated with a HOGG. (If so, NOOP and CALC_CRC observations have their suggestions set to CAL; note that these observations do not map to suggested observations, so this action is somewhat spurious.)

Prior to the insert, the suggestion fields are validated.

Throws:
Database_Exception - if there is a problem with the update.
SuggestionEditorPanel.Validation_Exception - if the suggestion fields are not valid.

update

public void update()
            throws Database_Exception,
                   SuggestionEditorPanel.Validation_Exception
Updates the suggestion's database record. Prior to the update, the suggestion fields are validated.

Throws:
Database_Exception - if there is a problem with the update.
SuggestionEditorPanel.Validation_Exception - if the suggestion fields are not valid.

change

protected void change(boolean update)
               throws Database_Exception,
                      SuggestionEditorPanel.Validation_Exception
Does an update or an insert. The validateSuggestion() method is called first, to ensure the fields are valid. If they are not valid, an exception is thrown and the update never takes place.

Parameters:
update - true if the record already exists.
Throws:
Database_Exception - if the update failed.
SuggestionEditorPanel.Validation_Exception - if the suggestion fields are not valid.

getID

public String getID()
Gets the ID of the suggestion.

Returns:
the suggestion's ID, which might be null or the empty string.

backfillSuggestion

public void backfillSuggestion(Observation_Record observationRecord)
Fills values in the suggestion record with those derived from the input observation record. This process is referred to as "backfilling."

Parameters:
observationRecord - the observation record containing the planned observation parameters.

suggestion

public SuggestedObservation suggestion()
Gets the editor's suggestion as defined by the current state of its controls.

Returns:
the suggestion.

initialSuggestion

public SuggestedObservation initialSuggestion()
Gets the editor's suggestion prior to modification. This suggestion changes whenever the suggestion is changed, so it represents the most recently saved version of the suggestions.

Returns:
the initial suggestion.

getDefaultSuggester

public String getDefaultSuggester()
Gets the suggestion editor's default suggester. This value is the value for new suggestions, including backfill suggestions.

Returns:
the default suggester.

setDefaultSuggester

public void setDefaultSuggester(String suggester)
Sets the suggestion editor's default suggester.

Parameters:
suggester - the new suggester for the editor.

alerts

public Alerts alerts()
Gets the suggestion editor's alerts manager.

Returns:
the alert manager.

alerts

public void alerts(Alerts alerts)
Sets the suggestion editor's alerts manager.

Parameters:
alerts - the new alerts manager.

getStlMinIncidenceAngle

public Double getStlMinIncidenceAngle()

getStlMaxIncidenceAngle

public Double getStlMaxIncidenceAngle()

getStlMinEmissionAngle

public Double getStlMinEmissionAngle()

getStlMaxEmissionAngle

public Double getStlMaxEmissionAngle()

getStlMinPhaseAngle

public Double getStlMinPhaseAngle()

getStlMaxPhaseAngle

public Double getStlMaxPhaseAngle()

getStlMinLsubS

public Double getStlMinLsubS()

getStlMaxLsubS

public Double getStlMaxLsubS()

validateSuggestion

public void validateSuggestion()
                        throws SuggestionEditorPanel.Validation_Exception
Validates the suggestion's fields in the editor. If a field is not valid, a SuggestionEditorPanel.Validation_Exception will be thrown.

Fields Checked

STL_DESCRIPTION - This field cannot be empty.

SCIENCE_RATIONALE - This field cannot be empty.

Throws:
SuggestionEditorPanel.Validation_Exception

enableOwnerFields

public void enableOwnerFields(boolean enabled)

enableOwnerHitsFields

public void enableOwnerHitsFields(boolean enabled)

enableStlFields

public void enableStlFields(boolean enabled)

enableEditorFields

public void enableEditorFields(boolean enabled)

HiRISE

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