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:
- java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, DisplayListener, SSCellListener
public class SpreadSheet extends GUIFrame implements java.awt.event.AdjustmentListener, DisplayListener, java.awt.event.KeyListener, java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, SSCellListener
SpreadSheet is a user interface for VisAD that supports multiple 3-D displays (FancySSCells).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classSpreadSheet.SSOptionsInner class for use with getOptions().
-
Field Summary
-
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.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor and Description SpreadSheet()Constructor with option selection dialog at default values.SpreadSheet(int sWidth, int sHeight, int cols, int rows, java.lang.String server, java.lang.String clone, java.lang.String sTitle)Constructor with default formula manager and no option selection dialog.SpreadSheet(int sWidth, int sHeight, int cols, int rows, java.lang.String server, java.lang.String clone, java.lang.String sTitle, FormulaManager fm)Constructor with no option selection dialog.SpreadSheet(int sWidth, int sHeight, int cols, int rows, java.lang.String server, java.lang.String clone, java.lang.String sTitle, FormulaManager fm, boolean chooseOptions)Main constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidaddColumn()Adds a column to the spreadsheet.voidaddRow()Adds a row to the spreadsheet.voidadjustmentValueChanged(java.awt.event.AdjustmentEvent e)Handles scrollbar changes.static voidadjustTextField(javax.swing.JTextField field)Deprecated.Use Util.adjustTextField(JTextField) instead.voidcaptureImageJPEG()Captures the display of the current cell and saves it as a JPEG image.static voidcenterWindow(java.awt.Window window)Deprecated.Use Util.centerWindow(Window) instead.voidclearCell()Clears the mappings and formula of the current cell if it is safe to do so, or if the user confirms the clear.voidcopyCell()Copies a cell from the screen to the clipboard.voidcreateMappings()Specifies mappings from Data to Display.voidcutCell()Moves a cell from the screen to the clipboard.booleandeleteColumn()Deletes a column from the spreadsheet.booleandeleteRow()Deletes a row from the spreadsheet.voiddisplayChanged(DisplayEvent e)Handles display changes.voidexportDataSet(Form form)Exports a data set using the given form.voidexportDataSetBinary()Exports a data set to VisAD binary data format.voidexportDataSetHDF5()Exports a data set to HDF-5 format.voidexportDataSetNetcdf()Exports a data set to netCDF format.voidexportDataSetSerial()Exports a data set to serialized data format.voidexportDataSetTIFF()Exports a data set to TIFF format.voidformulaAdd()Prompts the user to type a source for a new data object for the current cell.voidformulaDel()Deletes the selected data object from the current cell.javax.swing.JToolBargetToolbar()Returns the JToolBar object for other programs to use (e.g., add buttons).voiditemStateChanged(java.awt.event.ItemEvent e)Handles checkbox menu item changes (dimension checkboxes).voidkeyPressed(java.awt.event.KeyEvent e)BIG HAMMER HACK.voidkeyReleased(java.awt.event.KeyEvent e)BIG HAMMER HACK.voidkeyTyped(java.awt.event.KeyEvent e)BIG HAMMER HACK.voidloadDataSet()Imports a data set.static voidmain(java.lang.String[] argv)Gateway into VisAD Visualization SpreadSheet user interface.voidmouseClicked(java.awt.event.MouseEvent e)Unused MouseListener method.voidmouseDragged(java.awt.event.MouseEvent e)Handles cell label resizing.voidmouseEntered(java.awt.event.MouseEvent e)Unused MouseListener method.voidmouseExited(java.awt.event.MouseEvent e)Unused MouseListener method.voidmouseMoved(java.awt.event.MouseEvent e)Unused MouseMotionListener method.voidmousePressed(java.awt.event.MouseEvent e)Handles mouse presses.voidmouseReleased(java.awt.event.MouseEvent e)Handles cell resizing.booleannewFile()Creates a new spreadsheet file, asking user to confirm first.voidopenFile()Opens an existing spreadsheet file chosen by the user.voidopenFile(java.lang.String file)Opens the specified spreadsheet file.voidoptionsDetect()Sets mapping auto-detection to match Auto-detect menu item state.voidoptionsDisplay()Sets auto-display of controls to match Auto-display menu item state.voidoptionsSwitch()Sets auto-dimension switching to match Auto-switch menu item state.voidpasteCell()Copies a cell from the clipboard to the screen.voidprintCurrentCell()Creates a hardcopy of the current spreadsheet cell.voidquitProgram()Does any necessary clean-up, then quits the program.voidresetOrientation()Resets the display projection to its original value.voidsaveAsFile()Saves a spreadsheet file under a new name.voidsaveFile()Saves a spreadsheet file under its current name.voidselectCell(int x, int y)Selects the specified cell and updates screen info.voidsetDim2D()Sets the dimension of the current cell to 2-D (Java3D).voidsetDim3D()Sets the dimension of the current cell to 3-D (Java3D).voidsetDimJ2D()Sets the dimension of the current cell to 2-D (Java2D).static voidsetSSCellClass(java.lang.Class c)Sets the SpreadSheet cell class to the given class (which must extend FancySSCell), used for creating SpreadSheet cells.voidshowControls()Displays the controls for the currently selected cell.static voidsnooze(long ms)Waits the specified number of milliseconds.voidssCellChanged(SSCellChangeEvent e)Handles changes in a cell's data.voidtileCells()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, setMenuShortcut
-
Methods inherited from class javax.swing.JFrame
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Constructor Detail
-
SpreadSheet
public SpreadSheet()
Constructor with option selection dialog at default values.
-
SpreadSheet
public SpreadSheet(int sWidth, int sHeight, int cols, int rows, java.lang.String server, java.lang.String clone, java.lang.String sTitle)Constructor with default formula manager and no option selection dialog.
-
SpreadSheet
public SpreadSheet(int sWidth, int sHeight, int cols, int rows, java.lang.String server, java.lang.String clone, java.lang.String sTitle, FormulaManager fm)Constructor with no option selection dialog.
-
SpreadSheet
public SpreadSheet(int sWidth, int sHeight, int cols, int rows, java.lang.String server, java.lang.String clone, java.lang.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(java.lang.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.
-
newFile
public boolean newFile()
Creates a new spreadsheet file, asking user to confirm first.- Returns:
- true if successful.
-
openFile
public void openFile()
Opens an existing spreadsheet file chosen by the user.
-
openFile
public void openFile(java.lang.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).
-
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.
-
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.
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent e)
Handles checkbox menu item changes (dimension checkboxes).- Specified by:
itemStateChangedin interfacejava.awt.event.ItemListener
-
adjustmentValueChanged
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Handles scrollbar changes.- Specified by:
adjustmentValueChangedin interfacejava.awt.event.AdjustmentListener
-
displayChanged
public void displayChanged(DisplayEvent e)
Handles display changes.- Specified by:
displayChangedin interfaceDisplayListener- Parameters:
e- DisplayEvent to send
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
BIG HAMMER HACK.- Specified by:
keyPressedin interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
BIG HAMMER HACK.- Specified by:
keyReleasedin interfacejava.awt.event.KeyListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
BIG HAMMER HACK.- Specified by:
keyTypedin interfacejava.awt.event.KeyListener
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
Handles mouse presses.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
Handles cell resizing.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
Handles cell label resizing.- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
Unused MouseListener method.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
Unused MouseListener method.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
Unused MouseListener method.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
Unused MouseMotionListener method.- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
ssCellChanged
public void ssCellChanged(SSCellChangeEvent e)
Handles changes in a cell's data.- Specified by:
ssCellChangedin interfaceSSCellListener
-
setSSCellClass
public static void setSSCellClass(java.lang.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.
-
getToolbar
public javax.swing.JToolBar getToolbar()
Returns the JToolBar object for other programs to use (e.g., add buttons).
-
adjustTextField
public static void adjustTextField(javax.swing.JTextField field)
Deprecated. Use Util.adjustTextField(JTextField) instead.
-
centerWindow
public static void centerWindow(java.awt.Window window)
Deprecated. Use Util.centerWindow(Window) instead.
-
-
DMelt 3.0 © DataMelt by jWork.ORG