public class Suggestion_Panel
extends javax.swing.JPanel
implements java.awt.event.ActionListener
Modifier and Type | Class and Description |
---|---|
static class |
Suggestion_Panel.Mapping_Exception
An exception for reporting problems with the suggestion mapping table.
|
static class |
Suggestion_Panel.Mode
An enumeration describing the possible modes of suggestion editor operation.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_GROUP |
static Suggestion_Panel.Mode |
DEFAULT_MODE |
static java.lang.String |
ID
Class identification name with source code version and date.
|
static java.lang.String |
MODE |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
Suggestion_Panel(PIRL.Database.Database database)
Creates a Suggestion_Panel with a specified database connection
object.
|
Suggestion_Panel(HOGG hogg)
Creates a Suggestion_Panel with a callback reference to a parent
HOGG.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.
|
void |
checkStlConstraints(boolean useHoggStatus) |
java.lang.Integer |
getDisplayedId()
Gets the ID of the suggestion currently displayed by this panel.
|
java.lang.Integer |
getMappedId()
Gets the ID of the suggestion currently mapped in the database to this
panel's observation.
|
java.lang.String |
getObservationId()
Gets the text ID of the observation for which this panel manages the
suggestion ID.
|
java.util.List<java.lang.String> |
getStlConstraintsViolations()
Gets a list of messages describing any STL constraints violations for the
current suggestion.
|
SuggestedObservation |
getSuggestion()
Gets the suggestion editor's suggestion.
|
javax.swing.JMenu |
getSuggestionMenu()
Gets the suggestion panel's menu, which is suitable to adding to an existing
menu bar.
|
void |
init()
Initializes the panel.
|
boolean |
isClean()
Indicates whether the suggestion shown in the suggestion editor is clean.
|
boolean |
isSuggestionReady()
Determines whether the suggestion panel is ready for operation.
|
boolean |
retrieveMappedId()
Retrieves from the database the suggestion ID mapped to this panel's
observation ID.
|
boolean |
retrieveSuggestion(java.lang.Integer suggestionId,
java.lang.String message)
Retrieves from the database the indicated suggestion if possible.
|
boolean |
saveSuggestion(boolean notifyOnSave)
Saves the suggestion displayed in the panel.
|
void |
setObservationId(java.lang.String observationId)
Sets the text ID of the observation for which this panel manages the
suggestion ID.
|
boolean |
submitMappedId()
Submits the currently displayed suggestion's ID to the database for mapping.
|
int |
unmapSuggestion()
Removes the suggestion mapping entry matching the current observation ID.
|
int |
unmapSuggestion(java.lang.String comment)
Removes the suggestion mapping entry matching the current observation ID.
|
void |
updateObservationFields() |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String ID
public static final java.lang.String APPLICATION_GROUP
public static final java.lang.String MODE
public static final Suggestion_Panel.Mode DEFAULT_MODE
public Suggestion_Panel(HOGG hogg)
hogg
- the callback reference to a parent HOGG.public Suggestion_Panel(PIRL.Database.Database database)
database
- the database connection object that retrieves data
from HiCat.public void init()
public boolean isSuggestionReady()
public java.lang.String getObservationId()
Observation_ID
.public void setObservationId(java.lang.String observationId)
Observation_ID
.
When this ID is set, the panel will attempt to find a mapped suggestion ID
from the database. If an ID is found, the suggestion is loaded and the
interface is updated with the data. Both getMappedId()
and getDisplayedId()
are set to the mapped suggestion ID.
If no suggestion ID is mapped to this observation ID or if this observation ID is null, the interface will be initialized with blank fields, ready for a new suggestion to be edited. The mapped ID and the displayed ID will be set to null.
If the observation ID is null, the Load, New, and Reset suggestion buttons will also be disabled.
observationId
- the new text observation ID for this panel.public java.lang.Integer getMappedId()
Note that there is no corresponding setter for the mapped ID; the mapping is entirely managed by this panel.
public java.lang.Integer getDisplayedId()
This ID is not necessarily the ID mapped to the panel's observation ID.
SuggestionEditorPanel.getID()
public javax.swing.JMenu getSuggestionMenu()
public SuggestedObservation getSuggestion()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- the action event.public boolean retrieveSuggestion(java.lang.Integer suggestionId, java.lang.String message)
submitMappedId()
method is called, the mapping
will be changed.suggestionId
- the ID of the suggestion to load.message
- the message to display if the suggestion cannot be found;
if null, no message is displayed.public boolean saveSuggestion(boolean notifyOnSave)
notifyOnSave
- if true, the suggestion editor will alert
the operator that the suggestion has been saved.public boolean retrieveMappedId() throws PIRL.Database.Database_Exception
If a suggestion ID is found, getMappedId()
is set to the value and
the interface is updated to reflect the matching suggestion.
If no suggestion ID is found, or if the observation ID is null, or if the observation ID does not exist in the database, this method does nothing.
PIRL.Database.Database_Exception
- if there was a problem with the database.public boolean submitMappedId() throws PIRL.Database.Database_Exception, Suggestion_Panel.Mapping_Exception
observation ID
,
which results in the mapped ID
being set to the
displayed ID
.
If the panel's observation ID is null, this method does nothing. If the displayed ID is the same as the mapped ID, this method does nothing.
If the displayed ID is null, this method unmaps the observation.
If the panel's observation ID is not a formal HiRISE observation ID, this
method does not map the suggestion. Furthermore, it runs an unmapping
operation to clean up any extraneous suggestion mapping to this ID. The
check for formality in the observation ID is done via the Utilities.isFormalId(java.lang.String)
method.
The return value of this method indicates whether the mapping operation proceeded normally or the operator canceled it. A "normal" mapping includes the cases where there is nothing to map (i.e., the displayed suggestion ID is null or the observation ID is null or the observation ID is not a formal observation ID), or where the suggestion is already mapped (i.e., the mapped ID is the same as the displayed ID). It also includes the case where the suggestion panel has been disabled.
PIRL.Database.Database_Exception
- if there was a problem with the database.Suggestion_Panel.Mapping_Exception
- if there was a problem with the mapping.public int unmapSuggestion(java.lang.String comment) throws PIRL.Database.Database_Exception
comment
- the comment to append to the SPECIAL_NOTES field
of suggestions unretired. May be nullPIRL.Database.Database_Exception
- if there was a problem with the database.Unretire_Suggestions
,
Unretire_Suggestions.Comment(String)
,
Unretire_Suggestions.Unretire_Observation_ID(String)
public int unmapSuggestion() throws PIRL.Database.Database_Exception
PIRL.Database.Database_Exception
- if there was a problem with the database.Unretire_Suggestions
,
Unretire_Suggestions.Unretire_Observation_ID(String)
public void updateObservationFields()
public void checkStlConstraints(boolean useHoggStatus)
public boolean isClean()
public java.util.List<java.lang.String> getStlConstraintsViolations()
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona