HiRISE

HiRISE.HiPlan.SPICE
Class SPICE_Menu

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.AbstractButton
                  extended by javax.swing.JMenuItem
                      extended by javax.swing.JMenu
                          extended by HiRISE.HiPlan.SPICE.SPICE_Menu
All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants

public class SPICE_Menu
extends JMenu

A menu for managing the SPICE kernel pool. Menu items that alter the state of the kernel pool fire KernelPoolEvents when the contents of the pool change; classes interested in processing these events should implement the KernelPoolListener interface and register with the menu's addKernelPoolListener(KernelPoolListener) method.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JMenu
JMenu.AccessibleJMenu, JMenu.WinListener
 
Nested classes/interfaces inherited from class javax.swing.JMenuItem
JMenuItem.AccessibleJMenuItem
 
Nested classes/interfaces inherited from class javax.swing.AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
 
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
static String DEFAULT_MENU_NAME
          The default menu name.
static String ID
          Class identification name with source code version and date.
 
Fields inherited from class javax.swing.JMenu
popupListener
 
Fields inherited from class javax.swing.AbstractButton
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SPICE_Menu()
          Creates a new SPICE menu.
SPICE_Menu(boolean isLimited)
          Creates a new SPICE menu.
SPICE_Menu(Component dialogParent, boolean isLimited)
          Creates a new SPICE menu.
 
Method Summary
 void addKernelPoolListener(KernelPoolListener listener)
          Adds a kernel pool listener to this SPICE menu.
protected  void firePoolChanged()
          Send a KernelPoolEvent to each registered listener.
 JMenuItem getClearKernelsMenuItem()
          Gets the "Clear Kernels" menu item.
 Component getDialogParent()
           
 KernelPoolListener[] getKernelPoolListeners()
          Returns an array of all the KernelPoolListeners registered to this SPICE menu.
 JMenuItem getListKernelsMenuItem()
          Gets the "List Kernels" menu item.
 JMenuItem getLoadFromStateFileMenuItem()
          Gets the "Load Kernels From State File" menu item.
 JMenuItem getLoadKernelMenuItem()
          Gets the "Load Kernel" menu item.
 JMenuItem getSpiceVersionMenuItem()
          Gets the "SPICE Toolkit Version" menu item.
 void removeKernelPoolListener(KernelPoolListener listener)
          Removes a kernel pool listener from this SPICE menu.
 void setDialogParent(Component dialogParent)
           
 
Methods inherited from class javax.swing.JMenu
add, add, add, add, add, addMenuListener, addSeparator, applyComponentOrientation, createActionChangeListener, createActionComponent, createWinListener, doClick, fireMenuCanceled, fireMenuDeselected, fireMenuSelected, getAccessibleContext, getComponent, getDelay, getItem, getItemCount, getMenuComponent, getMenuComponentCount, getMenuComponents, getMenuListeners, getPopupMenu, getPopupMenuOrigin, getSubElements, getUIClassID, insert, insert, insert, insertSeparator, isMenuComponent, isPopupMenuVisible, isSelected, isTearOff, isTopLevelMenu, menuSelectionChanged, paramString, processKeyEvent, remove, remove, remove, removeAll, removeMenuListener, setAccelerator, setComponentOrientation, setDelay, setMenuLocation, setModel, setPopupMenuVisible, setSelected, updateUI
 
Methods inherited from class javax.swing.JMenuItem
actionPropertyChanged, addMenuDragMouseListener, addMenuKeyListener, configurePropertiesFromAction, fireMenuDragMouseDragged, fireMenuDragMouseEntered, fireMenuDragMouseExited, fireMenuDragMouseReleased, fireMenuKeyPressed, fireMenuKeyReleased, fireMenuKeyTyped, getAccelerator, getMenuDragMouseListeners, getMenuKeyListeners, init, isArmed, processKeyEvent, processMenuDragMouseEvent, processMenuKeyEvent, processMouseEvent, removeMenuDragMouseListener, removeMenuKeyListener, setArmed, setEnabled, setUI
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, paintBorder, removeActionListener, removeChangeListener, removeItemListener, removeNotify, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
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, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, 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, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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, 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
 
Methods inherited from interface javax.swing.MenuElement
processKeyEvent, processMouseEvent
 

Field Detail

ID

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

See Also:
Constant Field Values

DEFAULT_MENU_NAME

public static final String DEFAULT_MENU_NAME
The default menu name.

See Also:
Constant Field Values
Constructor Detail

SPICE_Menu

public SPICE_Menu(boolean isLimited)
Creates a new SPICE menu. Alerts are generated with this menu's frame as their dialogParent and location source. If isLimited is true, the menu includes only a subset of its normal functionality, for reporting the status of the kernel pool and the SPICE toolkit only; items that alter the pool are not available in this case.

Parameters:
isLimited - indicates whether the menu should be limited to information-only items.

SPICE_Menu

public SPICE_Menu(Component dialogParent,
                  boolean isLimited)
Creates a new SPICE menu. Alerts are generated with dialogParent as their dialogParent and location source. If isLimited is true, the menu includes only a subset of its normal functionality, for reporting the status of the kernel pool and the SPICE toolkit only; items that alter the pool are not available in this case.

Parameters:
dialogParent - the dialogParent component.
isLimited - indicates whether the menu should be limited to information-only items.

SPICE_Menu

public SPICE_Menu()
Creates a new SPICE menu. Alerts are generated with this menu's frame as their dialogParent and location source. The menu includes all items.

See Also:
SPICE_Menu(boolean)
Method Detail

getDialogParent

public Component getDialogParent()

setDialogParent

public void setDialogParent(Component dialogParent)

getLoadKernelMenuItem

public JMenuItem getLoadKernelMenuItem()
Gets the "Load Kernel" menu item. This item pops a file chooser from which the user can pick a SPICE kernel to load into the kernel pool.

This menu item is null (and not displayed) in the limited menu configuration.

Returns:
the "Load Kernel" menu item.

getLoadFromStateFileMenuItem

public JMenuItem getLoadFromStateFileMenuItem()
Gets the "Load Kernels From State File" menu item. This item pops a file chooser from which the user can pick an MTT state file from which to load SPICE kernels into the kernel pool.

This menu item is null (and not displayed) in the limited menu configuration.

Returns:
the "Load Kernels From State File" menu item.

getListKernelsMenuItem

public JMenuItem getListKernelsMenuItem()
Gets the "List Kernels" menu item. This item shows the contents of the SPICE kernel pool.

Returns:
the "List Kernels" menu item.

getClearKernelsMenuItem

public JMenuItem getClearKernelsMenuItem()
Gets the "Clear Kernels" menu item. This item clears the kernel pool.

This menu item is null (and not displayed) in the limited menu configuration.

Returns:
the "Clear Kernels" menu item.

getSpiceVersionMenuItem

public JMenuItem getSpiceVersionMenuItem()
Gets the "SPICE Toolkit Version" menu item. This item displays the SPICE toolkit version. If the SPICE system is not available for any reason, the menu item text is "SPICE Toolkit Unavailable."

Returns:
the "SPICE Toolkit Version" menu item.

addKernelPoolListener

public void addKernelPoolListener(KernelPoolListener listener)
Adds a kernel pool listener to this SPICE menu. A KernelPoolEvent is fired whenever the menu items alter the state of the kernel pool.

Parameters:
listener - the kernel pool listener to add.

removeKernelPoolListener

public void removeKernelPoolListener(KernelPoolListener listener)
Removes a kernel pool listener from this SPICE menu.

Parameters:
listener - the kernel pool listener to remove.

getKernelPoolListeners

public KernelPoolListener[] getKernelPoolListeners()
Returns an array of all the KernelPoolListeners registered to this SPICE menu.

Returns:
all of the KernelPoolListeners added or an empty array if no listeners have been added.

firePoolChanged

protected void firePoolChanged()
Send a KernelPoolEvent to each registered listener. The source is this SPICE menu.


HiRISE

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