## visad.ss
Class SpreadSheet

    java.lang.Object
      java.awt.Component
          java.awt.Container
              java.awt.Window
                  java.awt.Frame
                      javax.swing.JFrame
                          visad.util.GUIFrame
                              visad.ss.SpreadSheet

All Implemented Interfaces:
  Accessible, ActionListener, AdjustmentListener, DisplayListener, EventListener, ImageObserver, ItemListener, KeyListener, MenuContainer, MouseListener, MouseMotionListener, RootPaneContainer, Serializable, SSCellListener, WindowConstants

public class SpreadSheet
extends GUIFrame
implements AdjustmentListener, DisplayListener, KeyListener, ItemListener, MouseListener, MouseMotionListener, SSCellListener

SpreadSheet is a user interface for VisAD that supports multiple 3-D displays (FancySSCells).

See Also:
  Serialized Form

Nested Class Summary
`class` `SpreadSheet.SSOptions` Inner class for use with getOptions().

Nested classes inherited from class javax.swing.JFrame
`JFrame.AccessibleJFrame`

Nested classes inherited from class java.awt.Frame
`Frame.AccessibleAWTFrame`

Nested classes inherited from class java.awt.Window
`Window.AccessibleAWTWindow`

Nested classes inherited from class java.awt.Container
`Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy`

Field Summary
`protected boolean` `AutoDetect` Flag marking whether spreadsheet's cells automatically detect mappings.
`protected JCheckBoxMenuItem` `AutoDetectBox` Checkbox menu items.
`protected JCheckBoxMenuItem` `AutoShowBox` Checkbox menu items.
`protected boolean` `AutoShowControls` Flag marking whether spreadsheet's cells automatically show controls.
`protected boolean` `AutoSwitch` Flag marking whether spreadsheet's cells automatically switch dimensions when needed.
`protected JCheckBoxMenuItem` `AutoSwitchBox` Checkbox menu items.
`protected String` `bTitle` Base title.
`protected static boolean` `BugFix` Whether spreadsheet should have toolbar buttons.
`protected static boolean` `CanDo3D` Whether Java3D is enabled on this JVM.
`protected static boolean` `CanDoHDF5` Whether the HDF-5 native library is present on this JVM.
`protected static boolean` `CanDoJPEG` Whether this JVM supports saving JPEG images with JPEGImageEncoder.
`protected static boolean` `CanDoPython` Whether this JVM supports JPython scripting.
`protected static Class[]` `cellArgs` Argument classes for constructing an SSCell.
`protected static Constructor` `cellConstructor` Constructor used to create SSCells for SpreadSheets.
`protected JMenuItem` `CellDel` Menu items.
`protected JCheckBoxMenuItem` `CellDim2D2D` Checkbox menu items.
`protected JCheckBoxMenuItem` `CellDim2D3D` Checkbox menu items.
`protected JCheckBoxMenuItem` `CellDim3D3D` Checkbox menu items.
`protected JMenuItem` `CellEdit` Menu items.
`protected JMenuItem` `CellPrint` Menu items.
`protected JMenuItem` `CellReset` Menu items.
`protected JMenuItem` `CellShow` Menu items.
`protected String` `Clipboard` Contents of clipboard.
`protected String` `cloneAddress` Server address for a cloned sheet, if any.
`protected double` `CollabID` ID number for this collaborative spreadsheet.
`protected File` `CurrentFile` Current spreadsheet file.
`protected int` `CurX` Column of currently selected cell.
`protected int` `CurY` Row of currently selected cell.
`protected static int` `DEFAULT_VIS_HEIGHT` Default VisAD display height.
`protected static int` `DEFAULT_VIS_WIDTH` Default VisAD display width.
`protected FancySSCell[][]` `DisplayCells` Array of spreadsheet cells.
`protected Panel` `DisplayPanel` Panel that contains actual VisAD displays.
`protected JMenuItem` `EditClear` Menu items.
`protected JMenuItem` `EditPaste` Menu items.
`protected JMenu` `FileExport` Submenus.
`protected JMenuItem` `FileSave1` Menu items.
`protected JMenuItem` `FileSave2` Menu items.
`protected JMenuItem` `FileSave3` Menu items.
`protected JMenuItem` `FileSave4` Menu items.
`protected JMenuItem` `FileSave5` Menu items.
`protected JMenuItem` `FileSnap` Menu items.
`protected FormulaManager` `fm` Formula manager.
`protected JButton` `FormulaAdd` Toolbar buttons.
`protected JComboBox` `FormulaBox` Formula bar.
`protected JButton` `FormulaDel` Toolbar buttons.
`protected ComboBoxEditor` `FormulaEditor` Formula editor.
`protected ActionListener` `FormulaListener` Formula action listener.
`protected JTextField` `FormulaText` Formula text field.
`protected static int` `HEIGHT_PERCENT` Starting width of the application, in percentage of screen size.
`protected JComponent[]` `HorizDrag` Array of horizontal yellow sizing boxes.
`protected JPanel[]` `HorizLabel` Array of panels for horizontal labels.
`protected JViewport` `HorizLabels` View port for horizontal cell labels.
`protected JPanel` `HorizPanel` Panel containing horizontal labels and sizing boxes.
`protected boolean` `IsRemote` Whether spreadsheet is a clone of another spreadsheet.
`protected boolean` `IsSlave` Whether spreadsheet is a slaved clone of another spreadsheet.
`protected static int` `LABEL_HEIGHT` Horizontal cell label's height.
`protected static int` `LABEL_WIDTH` Vertical cell label's width.
`protected JMenuItem` `LayAddCol` Menu items.
`protected JMenuItem` `LayDelCol` Menu items.
`protected JMenuItem` `LayDelRow` Menu items.
`protected static String` `Letters` Spreadsheet cell letter order.
`protected Object` `Lock` Object for preventing simultaneous GUI manipulation.
`protected static int` `MIN_VIS_HEIGHT` Minimum VisAD display height, including display border.
`protected static int` `MIN_VIS_WIDTH` Minimum VisAD display width, including display border.
`protected int` `NumVisX` Number of display columns.
`protected int` `NumVisY` Number of display rows.
`protected static boolean` `Possible3D` Whether Java3D is possible on this JVM.
`protected RemoteDataReference` `RemoteCanDo3D` Remote clone's copy of CanDo3D.
`protected RemoteDataReference` `RemoteColRow` Row and column information needed for spreadsheet cloning.
`protected RemoteServerImpl` `rsi` Server for spreadsheet cells, if any.
`protected ScrollPane` `SCPane` Scrolling pane, in case sheet gets too small.
`protected JPanel` `ScrollPanel` Panel containing the scrolling pane.
`protected String` `serverName` Server name, if any.
`protected static boolean` `SHOW_CONNECT_MESSAGES` Whether connection status messages are printed about clones.
`protected JFileChooser` `SSFileDialog` File dialog.
`protected static String` `SSFileHeader` Header for first line of spreadsheet files.
`protected JButton` `Tool2D` Toolbar buttons.
`protected JButton` `Tool3D` Toolbar buttons.
`protected JToolBar` `Toolbar` Tool bar.
`protected JButton` `ToolJ2D` Toolbar buttons.
`protected JButton` `ToolMap` Toolbar buttons.
`protected JButton` `ToolPaste` Toolbar buttons.
`protected JButton` `ToolReset` Toolbar buttons.
`protected JButton` `ToolSave` Toolbar buttons.
`protected JButton` `ToolShow` Toolbar buttons.
`protected JComponent[]` `VertDrag` Array of vertical yellow sizing boxes.
`protected JPanel[]` `VertLabel` Array of panels for vertical labels.
`protected JViewport` `VertLabels` View port for vertical cell labels.
`protected JPanel` `VertPanel` Panel containing vertical labels and sizing boxes.
`protected static int` `WIDTH_PERCENT` Starting width of the application, in percentage of screen size.

Fields inherited from class visad.util.GUIFrame
`hash, heavy, menubar`

Fields inherited from class javax.swing.JFrame
`accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled`

Fields inherited from class java.awt.Frame
`CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR`

Fields inherited from class java.awt.Window
``

Fields inherited from class java.awt.Container
``

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, HIDE_ON_CLOSE`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`SpreadSheet()` Constructor with option selection dialog at default values.
`SpreadSheet(int sWidth, int sHeight, int cols, int rows, String server, String clone, String sTitle)` Constructor with default formula manager and no option selection dialog.
`SpreadSheet(int sWidth, int sHeight, int cols, int rows, String server, String clone, String sTitle, FormulaManager fm)` Constructor with no option selection dialog.
`SpreadSheet(int sWidth, int sHeight, int cols, int rows, String server, String clone, String sTitle, FormulaManager fm, boolean chooseOptions)` Main constructor.

Method Summary
`void` `addColumn()` Adds a column to the spreadsheet.
`void` `addRow()` Adds a row to the spreadsheet.
`protected JButton` `addToolbarButton(String file, String tooltip, String command, boolean enabled, JComponent parent)` Adds a button to a toolbar.
`void` `adjustmentValueChanged(AdjustmentEvent e)` Handles scrollbar changes.
`static void` `adjustTextField(JTextField field)` Deprecated. Use Util.adjustTextField(JTextField) instead.
`void` `captureImageJPEG()` Captures the display of the current cell and saves it as a JPEG image.
`static void` `centerWindow(Window window)` Deprecated. Use Util.centerWindow(Window) instead.
`void` `clearCell()` Clears the mappings and formula of the current cell if it is safe to do so, or if the user confirms the clear.
`protected void` `clearCell(boolean checkSafe)` Clears the mappings and formula of the current cell.
`void` `copyCell()` Copies a cell from the screen to the clipboard.
`protected FancySSCell` `createCell(String name, RemoteServer rs)` Returns a new instance of a spreadsheet cell (which must extend FancySSCell), used when a spreadsheet row or column is added.
`void` `createMappings()` Specifies mappings from Data to Display.
`void` `cutCell()` Moves a cell from the screen to the clipboard.
`boolean` `deleteColumn()` Deletes a column from the spreadsheet.
`boolean` `deleteRow()` Deletes a row from the spreadsheet.
`void` `displayChanged(DisplayEvent e)` Handles display changes.
`protected void` `displayErrorMessage(Component parent, String msg, Exception exc, String title)` Displays an error in a message dialog.
`protected void` `displayErrorMessage(String msg, Exception exc, String title)` Displays an error in a message dialog.
`void` `exportDataSet(Form form)` Exports a data set using the given form.
`void` `exportDataSetBinary()` Exports a data set to VisAD binary data format.
`void` `exportDataSetHDF5()` Exports a data set to HDF-5 format.
`void` `exportDataSetNetcdf()` Exports a data set to netCDF format.
`void` `exportDataSetSerial()` Exports a data set to serialized data format.
`void` `exportDataSetTIFF()` Exports a data set to TIFF format.
`void` `formulaAdd()` Prompts the user to type a source for a new data object for the current cell.
`void` `formulaDel()` Deletes the selected data object from the current cell.
`protected boolean` `getOptions(int cols, int rows, String server, String clone, boolean slave)` Pops up an option selection dialog for choosing SpreadSheet options.
`JToolBar` `getToolbar()` Returns the JToolBar object for other programs to use (e.g., add buttons).
`void` `itemStateChanged(ItemEvent e)` Handles checkbox menu item changes (dimension checkboxes).
`void` `keyPressed(KeyEvent e)` BIG HAMMER HACK.
`void` `keyReleased(KeyEvent e)` BIG HAMMER HACK.
`void` `keyTyped(KeyEvent e)` BIG HAMMER HACK.
`void` `loadDataSet()` Imports a data set.
`static void` `main(String[] argv)` Gateway into VisAD Visualization SpreadSheet user interface.
`void` `mouseClicked(MouseEvent e)` Unused MouseListener method.
`void` `mouseDragged(MouseEvent e)` Handles cell label resizing.
`void` `mouseEntered(MouseEvent e)` Unused MouseListener method.
`void` `mouseExited(MouseEvent e)` Unused MouseListener method.
`void` `mouseMoved(MouseEvent e)` Unused MouseMotionListener method.
`void` `mousePressed(MouseEvent e)` Handles mouse presses.
`void` `mouseReleased(MouseEvent e)` Handles cell resizing.
`boolean` `newFile()` Creates a new spreadsheet file, asking user to confirm first.
`protected boolean` `newFile(boolean safe)` Creates a new spreadsheet file.
`void` `openFile()` Opens an existing spreadsheet file chosen by the user.
`void` `openFile(String file)` Opens the specified spreadsheet file.
`void` `optionsDetect()` Sets mapping auto-detection to match Auto-detect menu item state.
`void` `optionsDisplay()` Sets auto-display of controls to match Auto-display menu item state.
`void` `optionsSwitch()` Sets auto-dimension switching to match Auto-switch menu item state.
`void` `pasteCell()` Copies a cell from the clipboard to the screen.
`void` `printCurrentCell()` Creates a hardcopy of the current spreadsheet cell.
`void` `quitProgram()` Does any necessary clean-up, then quits the program.
`protected void` `reconstructSpreadsheet(String[][] cellNames, int[] w, int[] h, RemoteServer rs)`
`protected void` `refreshCells()` Refreshes spreadsheet cells.
`protected void` `refreshDisplayMenuItems()` Updates dimension checkbox menu items and toolbar buttons.
`protected void` `refreshFormulaBar()` Makes sure the formula bar is displaying up-to-date info.
`protected void` `refreshMenuCommands()` Enables or disables certain menu items depending on whether this cell has data.
`protected void` `refreshOptions()` Refreshes check box items in the Options menu.
`protected void` `refreshShowControls()` Refreshes the "Show controls" menu option and toolbar button.
`void` `resetOrientation()` Resets the display projection to its original value.
`void` `saveAsFile()` Saves a spreadsheet file under a new name.
`void` `saveFile()` Saves a spreadsheet file under its current name.
`void` `selectCell(int x, int y)` Selects the specified cell and updates screen info.
`protected void` `setAutoDetect(boolean b)` Toggles mapping auto-detection.
`protected void` `setAutoShowControls(boolean b)` Toggles auto-display of controls.
`protected void` `setAutoSwitch(boolean b)` Toggles auto-dimension switching.
`protected void` `setDim(int dim)` Sets the dimension of the current cell.
`void` `setDim2D()` Sets the dimension of the current cell to 2-D (Java3D).
`void` `setDim3D()` Sets the dimension of the current cell to 3-D (Java3D).
`void` `setDimJ2D()` Sets the dimension of the current cell to 2-D (Java2D).
`static void` `setSSCellClass(Class c)` Sets the SpreadSheet cell class to the given class (which must extend FancySSCell), used for creating SpreadSheet cells.
`void` `showControls()` Displays the controls for the currently selected cell.
`static void` `snooze(long ms)` Waits the specified number of milliseconds.
`void` `ssCellChanged(SSCellChangeEvent e)` Handles changes in a cell's data.
`void` `tileCells()` Resizes all cells to exactly fill the entire pane, if possible.

Methods inherited from class visad.util.GUIFrame
`actionPerformed, addMenuItem, addMenuItem, addMenuItem, addMenuSeparator, addSubMenu, addSubMenu, addSubMenu, getMenu, getMenuItem`

Methods inherited from class javax.swing.JFrame

`addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update`

Methods inherited from class java.awt.Frame
`addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated`

Methods inherited from class java.awt.Window

`addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.awt.MenuContainer
`getFont, postEvent`

Field Detail

### WIDTH_PERCENT

    protected static final int WIDTH_PERCENT

  Starting width of the application, in percentage of screen size.

  See Also:
    Constant Field Values

### HEIGHT_PERCENT

    protected static final int HEIGHT_PERCENT

  Starting width of the application, in percentage of screen size.

  See Also:
    Constant Field Values

### MIN_VIS_WIDTH

    protected static final int MIN_VIS_WIDTH

  Minimum VisAD display width, including display border.

  See Also:
    Constant Field Values

### MIN_VIS_HEIGHT

    protected static final int MIN_VIS_HEIGHT

  Minimum VisAD display height, including display border.

  See Also:
    Constant Field Values

### DEFAULT_VIS_WIDTH

    protected static final int DEFAULT_VIS_WIDTH

  Default VisAD display width.

  See Also:
    Constant Field Values

### DEFAULT_VIS_HEIGHT

    protected static final int DEFAULT_VIS_HEIGHT

  Default VisAD display height.

  See Also:
    Constant Field Values

### Letters

    protected static final String Letters

  Spreadsheet cell letter order.

  See Also:
    Constant Field Values

### LABEL_WIDTH

    protected static final int LABEL_WIDTH

  Vertical cell label's width.

  See Also:
    Constant Field Values

### LABEL_HEIGHT

    protected static final int LABEL_HEIGHT

  Horizontal cell label's height.

  See Also:
    Constant Field Values

### SHOW_CONNECT_MESSAGES

    protected static final boolean SHOW_CONNECT_MESSAGES

  Whether connection status messages are printed about clones.

  See Also:
    Constant Field Values

### SSFileHeader

    protected static final String SSFileHeader

  Header for first line of spreadsheet files.

  See Also:
    Constant Field Values

### cellArgs

    protected static final Class[] cellArgs

  Argument classes for constructing an SSCell.

### cellConstructor

    protected static Constructor cellConstructor

  Constructor used to create SSCells for SpreadSheets.

### Possible3D

    protected static boolean Possible3D

  Whether Java3D is possible on this JVM.

### CanDo3D

    protected static boolean CanDo3D

  Whether Java3D is enabled on this JVM.

### CanDoHDF5

    protected static boolean CanDoHDF5

  Whether the HDF-5 native library is present on this JVM.

### CanDoJPEG

    protected static boolean CanDoJPEG

  Whether this JVM supports saving JPEG images with JPEGImageEncoder.

### CanDoPython

    protected static boolean CanDoPython

  Whether this JVM supports JPython scripting.

### BugFix

    protected static boolean BugFix

  Whether spreadsheet should have toolbar buttons.

### SSFileDialog

    protected JFileChooser SSFileDialog

  File dialog.

### bTitle

    protected String bTitle

  Base title.

### NumVisX

    protected int NumVisX

  Number of display columns.

### NumVisY

    protected int NumVisY

  Number of display rows.

### fm

    protected FormulaManager fm

  Formula manager.

### serverName

    protected String serverName

  Server name, if any.

### cloneAddress

    protected String cloneAddress

  Server address for a cloned sheet, if any.

### rsi

    protected RemoteServerImpl rsi

  Server for spreadsheet cells, if any.

### IsRemote

    protected boolean IsRemote

  Whether spreadsheet is a clone of another spreadsheet.

### IsSlave

    protected boolean IsSlave

  Whether spreadsheet is a slaved clone of another spreadsheet.

### CollabID

    protected double CollabID

  ID number for this collaborative spreadsheet.

### RemoteColRow

    protected RemoteDataReference RemoteColRow

  Row and column information needed for spreadsheet cloning.

### RemoteCanDo3D

    protected RemoteDataReference RemoteCanDo3D

  Remote clone's copy of CanDo3D.

### AutoSwitch

    protected boolean AutoSwitch

  Flag marking whether spreadsheet's cells automatically switch dimensions when needed.

### AutoDetect

    protected boolean AutoDetect

  Flag marking whether spreadsheet's cells automatically detect mappings.

### AutoShowControls

    protected boolean AutoShowControls

  Flag marking whether spreadsheet's cells automatically show controls.

### DisplayPanel

    protected Panel DisplayPanel

  Panel that contains actual VisAD displays.

### ScrollPanel

    protected JPanel ScrollPanel

  Panel containing the scrolling pane.

### SCPane

    protected ScrollPane SCPane

  Scrolling pane, in case sheet gets too small.

### HorizLabels

    protected JViewport HorizLabels

  View port for horizontal cell labels.

### VertLabels

    protected JViewport VertLabels

  View port for vertical cell labels.

### HorizLabel

    protected JPanel[] HorizLabel

  Array of panels for horizontal labels.

### VertLabel

    protected JPanel[] VertLabel

  Array of panels for vertical labels.

### HorizDrag

    protected JComponent[] HorizDrag

  Array of horizontal yellow sizing boxes.

### VertDrag

    protected JComponent[] VertDrag

  Array of vertical yellow sizing boxes.

### HorizPanel

    protected JPanel HorizPanel

  Panel containing horizontal labels and sizing boxes.

### VertPanel

    protected JPanel VertPanel

  Panel containing vertical labels and sizing boxes.

### DisplayCells

    protected FancySSCell[][] DisplayCells

  Array of spreadsheet cells.

### FormulaBox

    protected JComboBox FormulaBox

  Formula bar.

### FormulaEditor

    protected ComboBoxEditor FormulaEditor

  Formula editor.

### FormulaText

    protected JTextField FormulaText

  Formula text field.

### FormulaListener

    protected ActionListener FormulaListener

  Formula action listener.

### Toolbar

    protected JToolBar Toolbar

  Tool bar.

### FileExport

    protected JMenu FileExport

  Submenus.

### FileSave1

    protected JMenuItem FileSave1

  Menu items.

### FileSave2

    protected JMenuItem FileSave2

  Menu items.

### FileSave3

    protected JMenuItem FileSave3

  Menu items.

### FileSave4

    protected JMenuItem FileSave4

  Menu items.

### FileSave5

    protected JMenuItem FileSave5

  Menu items.

### FileSnap

    protected JMenuItem FileSnap

  Menu items.

### EditPaste

    protected JMenuItem EditPaste

  Menu items.

### EditClear

    protected JMenuItem EditClear

  Menu items.

### CellDel

    protected JMenuItem CellDel

  Menu items.

### CellPrint

    protected JMenuItem CellPrint

  Menu items.

### CellEdit

    protected JMenuItem CellEdit

  Menu items.

### CellReset

    protected JMenuItem CellReset

  Menu items.

### CellShow

    protected JMenuItem CellShow

  Menu items.

### LayAddCol

    protected JMenuItem LayAddCol

  Menu items.

### LayDelCol

    protected JMenuItem LayDelCol

  Menu items.

### LayDelRow

    protected JMenuItem LayDelRow

  Menu items.

### CellDim3D3D

    protected JCheckBoxMenuItem CellDim3D3D

  Checkbox menu items.

### CellDim2D2D

    protected JCheckBoxMenuItem CellDim2D2D

  Checkbox menu items.

### CellDim2D3D

    protected JCheckBoxMenuItem CellDim2D3D

  Checkbox menu items.

### AutoSwitchBox

    protected JCheckBoxMenuItem AutoSwitchBox

  Checkbox menu items.

### AutoDetectBox

    protected JCheckBoxMenuItem AutoDetectBox

  Checkbox menu items.

### AutoShowBox

    protected JCheckBoxMenuItem AutoShowBox

  Checkbox menu items.

### ToolSave

    protected JButton ToolSave

  Toolbar buttons.

### ToolPaste

    protected JButton ToolPaste

  Toolbar buttons.

### Tool3D

    protected JButton Tool3D

  Toolbar buttons.

### Tool2D

    protected JButton Tool2D

  Toolbar buttons.

### ToolJ2D

    protected JButton ToolJ2D

  Toolbar buttons.

### ToolMap

    protected JButton ToolMap

  Toolbar buttons.

### ToolShow

    protected JButton ToolShow

  Toolbar buttons.

### ToolReset

    protected JButton ToolReset

  Toolbar buttons.

### FormulaAdd

    protected JButton FormulaAdd

  Toolbar buttons.

### FormulaDel

    protected JButton FormulaDel

  Toolbar buttons.

### CurX

    protected int CurX

  Column of currently selected cell.

### CurY

    protected int CurY

  Row of currently selected cell.

### Clipboard

    protected String Clipboard

  Contents of clipboard.

### CurrentFile

    protected File CurrentFile

  Current spreadsheet file.

### Lock

    protected Object Lock

  Object for preventing simultaneous GUI manipulation.

Constructor Detail

### SpreadSheet

    public SpreadSheet()

  Constructor with option selection dialog at default values.

### SpreadSheet

    public SpreadSheet(int sWidth,
                       int sHeight,
                       int cols,
                       int rows,
                       String server,
                       String clone,
                       String sTitle)

  Constructor with default formula manager and no option selection dialog.

### SpreadSheet

    public SpreadSheet(int sWidth,
                       int sHeight,
                       int cols,
                       int rows,
                       String server,
                       String clone,
                       String sTitle,
                       FormulaManager fm)

  Constructor with no option selection dialog.

### SpreadSheet

    public SpreadSheet(int sWidth,
                       int sHeight,
                       int cols,
                       int rows,
                       String server,
                       String clone,
                       String sTitle,
                       FormulaManager fm,
                       boolean chooseOptions)

  Main constructor.

Method Detail

### snooze

    public static void snooze(long ms)

  Waits the specified number of milliseconds.

### main

    public static void main(String[] argv)

  Gateway into VisAD Visualization SpreadSheet user interface.

### loadDataSet

    public void loadDataSet()

  Imports a data set.

### exportDataSetNetcdf

    public void exportDataSetNetcdf()

  Exports a data set to netCDF format.

### exportDataSetSerial

    public void exportDataSetSerial()

  Exports a data set to serialized data format.

### exportDataSetHDF5

    public void exportDataSetHDF5()

  Exports a data set to HDF-5 format.

### exportDataSetTIFF

    public void exportDataSetTIFF()

  Exports a data set to TIFF format.

### exportDataSetBinary

    public void exportDataSetBinary()

  Exports a data set to VisAD binary data format.

### exportDataSet

    public void exportDataSet(Form form)

  Exports a data set using the given form.

### captureImageJPEG

    public void captureImageJPEG()

  Captures the display of the current cell and saves it as a JPEG image.

### quitProgram

    public void quitProgram()

  Does any necessary clean-up, then quits the program.

### cutCell

    public void cutCell()

  Moves a cell from the screen to the clipboard.

### copyCell

    public void copyCell()

  Copies a cell from the screen to the clipboard.

### pasteCell

    public void pasteCell()

  Copies a cell from the clipboard to the screen.

### clearCell

    public void clearCell()

  Clears the mappings and formula of the current cell if it is safe to do so, or if the user confirms the clear.

### clearCell

    protected void clearCell(boolean checkSafe)

  Clears the mappings and formula of the current cell.

### newFile

    public boolean newFile()

  Creates a new spreadsheet file, asking user to confirm first.

  Returns:
    true if successful.

### newFile

    protected boolean newFile(boolean safe)

  Creates a new spreadsheet file.

  Returns:
    true if successful.

### openFile

    public void openFile()

  Opens an existing spreadsheet file chosen by the user.

### openFile

    public void openFile(String file)

  Opens the specified spreadsheet file.

### saveFile

    public void saveFile()

  Saves a spreadsheet file under its current name.

### saveAsFile

    public void saveAsFile()

  Saves a spreadsheet file under a new name.

### setDim3D

    public void setDim3D()

  Sets the dimension of the current cell to 3-D (Java3D).

### setDimJ2D

    public void setDimJ2D()

  Sets the dimension of the current cell to 2-D (Java2D).

### setDim2D

    public void setDim2D()

  Sets the dimension of the current cell to 2-D (Java3D).

### setDim

    protected void setDim(int dim)

  Sets the dimension of the current cell.

### printCurrentCell

    public void printCurrentCell()

  Creates a hardcopy of the current spreadsheet cell.

### createMappings

    public void createMappings()

  Specifies mappings from Data to Display.

### resetOrientation

    public void resetOrientation()

  Resets the display projection to its original value.

### showControls

    public void showControls()

  Displays the controls for the currently selected cell.

### addColumn

    public void addColumn()

  Adds a column to the spreadsheet.

### addRow

    public void addRow()

  Adds a row to the spreadsheet.

### deleteColumn

    public boolean deleteColumn()

  Deletes a column from the spreadsheet.

### deleteRow

    public boolean deleteRow()

  Deletes a row from the spreadsheet.

### tileCells

    public void tileCells()

  Resizes all cells to exactly fill the entire pane, if possible.

### optionsSwitch

    public void optionsSwitch()

  Sets auto-dimension switching to match Auto-switch menu item state.

### optionsDetect

    public void optionsDetect()

  Sets mapping auto-detection to match Auto-detect menu item state.

### optionsDisplay

    public void optionsDisplay()

  Sets auto-display of controls to match Auto-display menu item state.

### setAutoSwitch

    protected void setAutoSwitch(boolean b)

  Toggles auto-dimension switching.

### setAutoDetect

    protected void setAutoDetect(boolean b)

  Toggles mapping auto-detection.

### setAutoShowControls

    protected void setAutoShowControls(boolean b)

  Toggles auto-display of controls.

### formulaAdd

    public void formulaAdd()

  Prompts the user to type a source for a new data object for the current cell.

### formulaDel

    public void formulaDel()

  Deletes the selected data object from the current cell.

### refreshCells

    protected void refreshCells()

  Refreshes spreadsheet cells.

### refreshOptions

    protected void refreshOptions()

  Refreshes check box items in the Options menu.

### refreshShowControls

    protected void refreshShowControls()

  Refreshes the "Show controls" menu option and toolbar button.

### refreshMenuCommands

    protected void refreshMenuCommands()

  Enables or disables certain menu items depending on whether this cell has data.

### refreshFormulaBar

    protected void refreshFormulaBar()

  Makes sure the formula bar is displaying up-to-date info.

### refreshDisplayMenuItems

    protected void refreshDisplayMenuItems()

  Updates dimension checkbox menu items and toolbar buttons.

### reconstructSpreadsheet

    protected void reconstructSpreadsheet(String[][] cellNames,
                                          int[] w,
                                          int[] h,
                                          RemoteServer rs)

### itemStateChanged

    public void itemStateChanged(ItemEvent e)

  Handles checkbox menu item changes (dimension checkboxes).

  Specified by:
    `itemStateChanged` in interface `ItemListener`

### adjustmentValueChanged

    public void adjustmentValueChanged(AdjustmentEvent e)

  Handles scrollbar changes.

  Specified by:
    `adjustmentValueChanged` in interface `AdjustmentListener`

### displayChanged

    public void displayChanged(DisplayEvent e)

  Handles display changes.

  Specified by:
    `displayChanged` in interface `DisplayListener`
  Parameters:
    `e` - DisplayEvent to send

### keyPressed

    public void keyPressed(KeyEvent e)

  BIG HAMMER HACK.

  Specified by:
    `keyPressed` in interface `KeyListener`

### keyReleased

    public void keyReleased(KeyEvent e)

  BIG HAMMER HACK.

  Specified by:
    `keyReleased` in interface `KeyListener`

### keyTyped

    public void keyTyped(KeyEvent e)

  BIG HAMMER HACK.

  Specified by:
    `keyTyped` in interface `KeyListener`

### mousePressed

    public void mousePressed(MouseEvent e)

  Handles mouse presses.

  Specified by:
    `mousePressed` in interface `MouseListener`

### mouseReleased

    public void mouseReleased(MouseEvent e)

  Handles cell resizing.

  Specified by:
    `mouseReleased` in interface `MouseListener`

### mouseDragged

    public void mouseDragged(MouseEvent e)

  Handles cell label resizing.

  Specified by:
    `mouseDragged` in interface `MouseMotionListener`

### mouseClicked

    public void mouseClicked(MouseEvent e)

  Unused MouseListener method.

  Specified by:
    `mouseClicked` in interface `MouseListener`

### mouseEntered

    public void mouseEntered(MouseEvent e)

  Unused MouseListener method.

  Specified by:
    `mouseEntered` in interface `MouseListener`

### mouseExited

    public void mouseExited(MouseEvent e)

  Unused MouseListener method.

  Specified by:
    `mouseExited` in interface `MouseListener`

### mouseMoved

    public void mouseMoved(MouseEvent e)

  Unused MouseMotionListener method.

  Specified by:
    `mouseMoved` in interface `MouseMotionListener`

### ssCellChanged

    public void ssCellChanged(SSCellChangeEvent e)

  Handles changes in a cell's data.

  Specified by:
    `ssCellChanged` in interface `SSCellListener`

### setSSCellClass

    public static void setSSCellClass(Class c)

  Sets the SpreadSheet cell class to the given class (which must extend FancySSCell), used for creating SpreadSheet cells.

### selectCell

    public void selectCell(int x,
                           int y)

  Selects the specified cell and updates screen info.

### getOptions

    protected boolean getOptions(int cols,
                                 int rows,
                                 String server,
                                 String clone,
                                 boolean slave)

  Pops up an option selection dialog for choosing SpreadSheet options.

### getToolbar

    public JToolBar getToolbar()

  Returns the JToolBar object for other programs to use (e.g., add buttons).

### createCell

    protected FancySSCell createCell(String name,
                                     RemoteServer rs)
                              throws VisADException,
                                     RemoteException

  Returns a new instance of a spreadsheet cell (which must extend FancySSCell), used when a spreadsheet row or column is added.

  Throws:
    `VisADException`
    `RemoteException`

### displayErrorMessage

    protected void displayErrorMessage(String msg,
                                       Exception exc,
                                       String title)

  Displays an error in a message dialog.

### displayErrorMessage

    protected void displayErrorMessage(Component parent,
                                       String msg,
                                       Exception exc,
                                       String title)

  Displays an error in a message dialog.

### addToolbarButton

    protected JButton addToolbarButton(String file,
                                       String tooltip,
                                       String command,
                                       boolean enabled,
                                       JComponent parent)

  Adds a button to a toolbar.

### adjustTextField

    public static void adjustTextField(JTextField field)

  Deprecated. Use Util.adjustTextField(JTextField) instead.

### centerWindow

    public static void centerWindow(Window window)

  Deprecated. Use Util.centerWindow(Window) instead.