edu.ucsb.nceas.metaedit
Class ElementChoice

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JInternalFrame
                          |
                          +--edu.ucsb.nceas.metaedit.ElementChoice

public class ElementChoice
extends javax.swing.JInternalFrame
implements javax.swing.event.ListSelectionListener, java.awt.event.ComponentListener

Internal window dialog for choosing an element from a list of appendable types or from a list of insertable types.

Version:
0.9Beta
Author:
Matthew Jones, Rudolf Nottrott, Zheng Wang
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_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
 
Constructor Summary
ElementChoice()
          Construct a new ElementChoice dialog in the containing frame.
 
Method Summary
 void clearAppendablesList()
           
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
          Reset the preferred size of the element choice frame whenever the user resizes the frame.
 void componentShown(java.awt.event.ComponentEvent e)
           
 java.lang.String getChosenElementToAppend()
          Determine the currently selected element name from the list.
 java.lang.String getChosenElementToInsert()
          Determine the currently selected element name from the insertables list.
 void removeActiveDoc(MetaDoc currentDoc)
          Tell the active document to stop listening to the append/insert buttons.
 void setActiveDoc(MetaDoc currentDoc)
          Tell the append/insert buttons, when they are pressed to pass their ActionEvent to the actionPerformed method in the current document.
 void setAppendablesList(java.util.Vector v)
          Fill the list of appendable elements with the element names from the given Vector.
 void setInsertablesList(java.util.Vector v)
          Fill the list of insertable elements with the element names from the given Vector.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Record the selected value whenever the user changes it.
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFrameIcon, getGlassPane, getJMenuBar, getLayer, getLayeredPane, getMenuBar, getRootPane, getTitle, getUI, getUIClassID, getWarningString, isClosable, isClosed, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, setClosable, setClosed, setContentPane, setDefaultCloseOperation, setDesktopIcon, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, setVisible, show, toBack, toFront, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementChoice

public ElementChoice()
Construct a new ElementChoice dialog in the containing frame.
Parameters:
f - the frame containing the new dialog
Method Detail

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Record the selected value whenever the user changes it.
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
Parameters:
e - the event generated by user action

getChosenElementToAppend

public java.lang.String getChosenElementToAppend()
Determine the currently selected element name from the list.
Returns:
a String containing the selected element name

getChosenElementToInsert

public java.lang.String getChosenElementToInsert()
Determine the currently selected element name from the insertables list.
Returns:
a String containing the selected element name

setAppendablesList

public void setAppendablesList(java.util.Vector v)
Fill the list of appendable elements with the element names from the given Vector.
Parameters:
v - the Vector of element names allowed in this context

clearAppendablesList

public void clearAppendablesList()

setInsertablesList

public void setInsertablesList(java.util.Vector v)
Fill the list of insertable elements with the element names from the given Vector.
Parameters:
v - the Vector of element names allowed in this context

setActiveDoc

public void setActiveDoc(MetaDoc currentDoc)
Tell the append/insert buttons, when they are pressed to pass their ActionEvent to the actionPerformed method in the current document. (Or, conversely, tell the active document to listen to those buttons.)
Parameters:
currentDoc - the currently active document

removeActiveDoc

public void removeActiveDoc(MetaDoc currentDoc)
Tell the active document to stop listening to the append/insert buttons.
Parameters:
currentDoc - the currently active document

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Reset the preferred size of the element choice frame whenever the user resizes the frame.
Specified by:
componentResized in interface java.awt.event.ComponentListener
Parameters:
e - the event generated on resizing the frame

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.