visad.ss
Class BasicSSCell

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--visad.ss.BasicSSCell
Direct Known Subclasses:
FancySSCell

public class BasicSSCell
extends JPanel
implements DisplayListener, MessageListener

BasicSSCell represents a single spreadsheet display cell. BasicSSCells can be added to a VisAD user interface to provide some of the capabilities presented in the VisAD SpreadSheet. Other capabilities, like the file loader and data mapping dialog boxes, are available only with a FancySSCell.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent, JComponent.IntVector, JComponent.KeyboardBinding, JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Component
Component.AWTTreeLock
 
Field Summary
static int ADD_DATA
          Message ID indicating a data object has been added.
static int ADD_SOURCE
          Message ID indicating a source has been added.
protected static boolean CanDo3D
          Whether Java3D is enabled for this JVM.
protected  Vector CellData
          List of this cell's data.
protected  int CollabID
          ID number for this collaborative cell.
static boolean DEBUG
          Debugging flag.
static int DEBUG_LEVEL
          Debugging level.
protected static FormulaManager defaultFM
          Default FormulaManager object used by SSCells.
protected  int Dim
          The dimensionality of the display: JAVA3D_3D, JAVA2D_2D, or JAVA3D_2D.
static int DIRECT_SOURCE
          Indicates that the data was added to this cell directly using addData() or addReference().
protected  boolean DisplayEnabled
          Whether display updates are enabled.
protected  Vector DListen
          List of DisplayListeners.
protected  String[] Errors
          Global errors currently being displayed in this cell, if any.
protected  FormulaManager fm
          Formula manager for this cell.
static int FORMULA_SOURCE
          Indicates that the data was computed from a formula.
protected  boolean HasDisplay
          Whether a valid VisAD display currently exists.
protected  boolean HasMappings
          Whether this cell has mappings from Data to Display.
protected  boolean IsRemote
          Whether this display is remote.
protected  boolean IsSlave
          Whether this display is slaved.
static int JAVA2D_2D
          Constant for 2-D (Java2D) dimensionality.
static int JAVA3D_2D
          Constant for 2-D (Java3D) dimensionality.
static int JAVA3D_3D
          Constant for 3-D (Java3D) dimensionality.
protected  int Loading
          The number of data objects this cell is currently loading.
protected  Object Lock
          Prevents simultaneous GUI manipulation.
static int MAX_ID
          No message ID should have a value greater than or equal to this number.
protected  DisplayImpl MDisplay
          Associated DisplayImpl for sending and receiving messages.
static String[] messages
          Message ID strings, for debugging.
protected  String Name
          Name of this cell.
protected  boolean NewClient
          Whether this display is still a new client (hasn't been initialized).
protected static int POLLING_INTERVAL
          Interval at which to check for status changes while waiting.
protected static boolean Possible3D
          Whether Java3D is possible for this JVM.
static int REMOTE_SOURCE
          Indicates that the data came from a remotely linked cell.
protected  RemoteDisplay RemoteMDisplay
          Associated RemoteDisplay for sending and receiving messages.
protected  RemoteDisplay RemoteVDisplay
          Associated VisAD RemoteDisplay.
protected  RemoteServer RemoteVServer
          Associated VisAD RemoteServer, if any.
protected  RemoteSlaveDisplayImpl RemoteVSlave
          Associated VisAD RemoteSlaveDisplay, if any.
static int REMOVE_DATA
          Message ID indicating a data object has been removed.
static int RMI_SOURCE
          Indicates that the data came from an RMI server.
protected static int Saving
          The number of SSCells currently saving data.
protected  Vector Servers
          List of servers to which this cell has been added.
static int SET_DIM
          Message ID indicating dimension has changed.
static int SET_ERRORS
          Message ID indicating errors have changed.
static int SET_MAPS
          Message ID indicating mappings have changed.
protected  Vector SListen
          List of SSCellListeners.
protected static Vector SSCellVector
          List of SSCells on this JVM.
static int STATUS
          Message ID indicating a cell's status information is being requested or reported.
static int UNKNOWN_SOURCE
          Indicates that the source of the data is unknown.
static int UPDATE_DATA
          Message ID indicating a data object has changed.
static int UPDATE_DEPENDENCIES
          Message ID indicating a data object's dependencies have changed.
static int URL_SOURCE
          Indicates that the data came from a file or URL.
protected  DisplayImpl VDisplay
          Associated VisAD Display.
protected  Component VDPanel
          Associated VisAD Display component.
 
Fields inherited from class javax.swing.JComponent
_bounds, 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.Container
component, containerListener, layoutMgr, ncomponents
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
BasicSSCell(String name)
          Constructs a new BasicSSCell with the given name.
BasicSSCell(String name, FormulaManager fman)
          Constructs a new BasicSSCell with the given name and non-default formula manager, to allow for custom formulas.
BasicSSCell(String name, FormulaManager fman, RemoteServer rs, boolean slave, String save)
          Constructs a new, possibly slaved, BasicSSCell with the given name, formula manager, and remote server.
BasicSSCell(String name, FormulaManager fman, RemoteServer rs, String save)
          Constructs a new BasicSSCell with the given name, formula manager, and remote server.
BasicSSCell(String name, RemoteServer rs)
          Constructs a new BasicSSCell with the given name, that gets its information from the given RemoteServer.
BasicSSCell(String name, String save)
          Constructs a new BasicSSCell with the given name and save string, used to reconstruct this cell's configuration.
 
Method Summary
 String addData(Data data)
          Adds a Data object to this cell, creating an associated DataReference for it.
 String addData(Data data, ConstantMap[] cmaps)
          Adds a Data object to this cell, creating an associated DataReference with the specified ConstantMaps for it.
protected  String addData(int id, Data data, ConstantMap[] cmaps, String source, int type, boolean notify)
          Adds a Data object to this cell from the given source of the specified type, creating an associated DataReference for it.
(package private)  String addDataSource(int id, String source, int type, boolean notify)
          Obtains a Data object from the given source of the specified type, and adds it to this cell, assigning it the specified id.
 String addDataSource(String source)
          Obtains a Data object from the given source of unknown type, and adds it to this cell.
 String addDataSource(String source, int type)
          Obtains a Data object from the given source of the specified type, and adds it to this cell.
 void addDisplayListener(DisplayListener d)
          Adds a DisplayListener.
 String addReference(DataReferenceImpl ref)
          Adds the given DataReference to this cell.
 String addReference(DataReferenceImpl ref, ConstantMap[] cmaps)
          Adds the given DataReference to this cell with the specified ConstantMaps.
protected  SSCellData addReferenceImpl(int id, DataReferenceImpl ref, ConstantMap[] cmaps, String source, int type, boolean notify, boolean checkErrors)
          Does the work of adding the given DataReference, from the given source of the specified type.
 void addSSCellChangeListener(SSCellListener l)
          Deprecated. Use addSSCellListener(SSCellListener) instead.
 void addSSCellListener(SSCellListener l)
          Adds an SSCellListener.
 void addToRemoteServer(RemoteServerImpl rs)
          Adds this cell to the given RemoteServer.
 void addVar(String name, ThingReference tr)
          Adds a variable to this cell's formula manager.
static boolean arraysEqual(Object[] o1, Object[] o2)
          Deprecated. Use visad.Util.arraysEqual(Object[], Object[]) instead.
static boolean canDo3D()
          Returns true if Java3D is enabled for this JVM.
 void captureImage(File f)
          Captures an image and saves it to a given file name, in JPEG format.
 void clearCell()
          Clears this cell completely.
 void clearDisplay()
          Clears this cell's display.
 void clearMaps()
          Clears this cell's mappings.
 boolean constructDisplay()
          Reconstructs this cell's display.
static void createVar(String name, ThingReference tr)
          Deprecated. Use addVar(String, ThingReference) instead.
 void destroyCell()
          Clears this cell completely and destroys it, removing it from the list of created cells.
static void disable3D()
          Disables Java3D for this JVM.
 void displayChanged(DisplayEvent e)
          Handles display changes.
static boolean enable3D()
          Attempts to enable Java3D for this JVM, returning true if successful.
protected  SSCellData getCellDataByName(String varName)
          Obtains the cell data entry corresponding to the given variable name.
 Data[] getData()
          Gets this cell's Data objects.
 Data getData(String varName)
          Gets this cell's Data object with the specified variable name.
 int getDataCount()
          Gets the number of Data object this cell has.
 DataReferenceImpl getDataRef()
          Deprecated. Use getReference(String) instead.
 String getDataSource(String varName)
          Gets this cell's data source string for data with the specified variable name.
 String[] getDataSources()
          Gets this cell's data source strings.
 int getDataSourceType(String varName)
          Gets this cell's data source type for data with the specified variable name.
 int[] getDataSourceTypes()
          Gets this cell's data source types.
 int getDimension()
          Gets this cell's dimension.
 DisplayImpl getDisplay()
          Gets this cell's VisAD Display.
 String getFilename()
          Deprecated. Use getDataSource(String) instead.
 URL getFileURL()
          Deprecated. Use getDataSource(String) instead.
protected  int getFirstFreeId()
          Gets the first free cell data ID number.
 String getFirstVariableName()
          Gets the variable name of this cell's first Data object.
 String getFormula()
          Deprecated. Use getDataSource(String) instead.
 FormulaManager getFormulaManager()
          Gets this cell's formula manager.
 String getLastVariableName()
          Gets the variable name of this cell's last Data object.
 ScalarMap[] getMaps()
          Gets this cell's mappings.
 String getName()
          Gets this cell's name.
 String getPartialSaveString()
          Gets a string for reconstructing ScalarMap range and Control information.
 DataReference getReference()
          Deprecated. Use getReference(String) instead.
 DataReference getReference(String varName)
          Gets this cell's DataReference with the specified variable name.
 DataReferenceImpl[] getReferences()
          Gets this cell's DataReferences.
 RemoteDataReferenceImpl getRemoteDataRef()
          Deprecated. Use getRemoteReference(String) instead.
 RemoteDisplay getRemoteDisplay()
          Gets this cell's VisAD RemoteDisplay.
 int getRemoteId()
          Gets the id number this cell uses for remote collaboration.
 RemoteDataReference getRemoteReference(String varName)
          Gets this cell's remote DataReference for data with the specified variable name.
 RemoteDataReference[] getRemoteReferences()
          Gets this cell's remote DataReferences.
 String getRMIAddress()
          Deprecated. Use getDataSource(String) instead.
 String getSaveString()
          Gets the save string necessary to reconstruct this cell.
static BasicSSCell getSSCellByName(String name)
          Gets the SSCell with the specified name.
 String getSSCellString()
          Deprecated. Use getSaveString() instead.
 String[] getVariableNames()
          Gets the variable names of this cell's Data objects.
 boolean hasData()
          Whether this cell has any data.
 boolean hasDisplay()
          Whether this cell has a valid display on-screen.
 boolean hasFormula()
          Deprecated. Use getDataSourceType(String) instead.
 boolean hasMappings()
          Whether this cell has any mappings.
static void invoke(boolean wait, Runnable r)
          Deprecated. Use visad.Util.invoke(boolean, Runnable) instead.
 boolean isRemote()
          Gets whether this cell is a cloned display cell.
static boolean isSaving()
          Returns true if any SSCell is currently saving data.
 boolean isSlave()
          Gets whether this cell is a slaved display cell.
 void loadData(String s)
          Deprecated. Use addDataSource(String, URL_SOURCE) instead.
 void loadData(URL u)
          Deprecated. Use addDataSource(String, URL_SOURCE) instead.
 void loadRMI(String s)
          Deprecated. Use addDataSource(String, RMI_SOURCE) instead.
static DataImpl makeLocal(Data data)
          Deprecated. Use visad.DataUtility.makeLocal(data) instead.
(package private)  void notifySSCellListeners(int changeType)
          Informs all SSCellListeners of cell change.
(package private)  void notifySSCellListeners(int changeType, String varName)
          Informs all SSCellListeners of a cell change.
 boolean othersDepend()
          Whether other cells are dependent on any of this cell's Data objects.
 boolean othersDepend(String varName)
          Whether other cells are dependent on this cell's Data object with the specified variable name.
static boolean possible3D()
          Returns true if Java3D is possible for this JVM.
 void receiveMessage(MessageEvent msg)
          Handles VisAD messages.
(package private)  void refresh()
          Refreshes this cell's display.
 void removeAllListeners()
          Deprecated. Use removeAllSSCellListeners() instead.
 void removeAllReferences()
          Removes all Data objects from this cell.
protected  void removeAllReferences(boolean notify)
          Removes all Data objects from this cell, notifying listeners if the notify flag is set.
protected  void removeAllReferences(boolean notify, boolean display)
          Removes all Data objects from this cell, notifying listeners if the notify flag is set, and updating the display if the display flag is set.
 void removeAllSSCellListeners()
          Removes all SSCellListeners.
 void removeData(Data data)
          Removes the given Data object from this cell.
 void removeData(String varName)
          Removes the Data object corresponding to the given variable name from this cell.
protected  void removeDataImpl(SSCellData cellData, boolean notify, boolean display)
          Does the work of removing the Data object at the specified index.
 void removeDisplayListener(DisplayListener d)
          Removes a DisplayListener from this cell.
 void removeFromRemoteServer(RemoteServerImpl rs)
          Removes this cell from the given RemoteServer.
 void removeListener(SSCellListener l)
          Deprecated. Use removeSSCellListener(SSCellListener) instead.
 void removeReference(DataReferenceImpl ref)
          Removes the given DataReference's associated Data object from this cell.
 void removeSSCellListener(SSCellListener l)
          Removes an SSCellListener.
 void saveData(File f, boolean netcdf)
          Deprecated. Use saveData(String, Form) instead.
 void saveData(File f, Form form)
          Deprecated. Use saveData(String, Form) instead.
 void saveData(String varName, String location, Form form)
          Exports a Data object to the given location, using the given Data form.
(package private)  void sendMessage(int id, String msg, Data data)
          Sends a message of type id to server and all clients of this cell.
 void setData(Data data)
          Deprecated. Use addData(Data) instead.
 void setDimension(boolean twoD, boolean java2d)
          Deprecated. Use setDimension(int) instead.
 void setDimension(int dim)
          Sets this cell's dimensionality.
protected  void setErrors(String[] errors, boolean notify)
          Displays global errors in this cell, notifying linked cells if notify flag is set.
 void setFormula(String f)
          Deprecated. Use addDataSource(String, FORMULA_SOURCE) instead.
 void setMaps(ScalarMap[] maps)
          Maps RealTypes to the display according to the specified ScalarMaps.
 void setPartialSaveString(String save, boolean preserveMaps)
          Reconstructs parts of this cell using the specified save string.
 void setSaveString(String save)
          Reconstructs this cell using the specified save string.
 void setSSCellString(String save)
          Deprecated. Use setSaveString(String) instead.
protected  void setupClient()
          Sets up data needed for this cell to be a client.
protected  void setupServer()
          Sets up data needed for this cell to be a server.
static Tuple stringsToTuple(String[] s)
          Deprecated. Use visad.DataUtility.stringsToTuple(String[]) instead.
static String[] tupleToStrings(Tuple t)
          Deprecated. Use visad.DataUtility.tupleToStrings(Tuple) instead.
(package private) static void updateDependencies()
          Broadcasts updated cell dependencies to all clients.
(package private)  void updateDisplay()
          Display the data for this cell if hasDisplay flag is set.
(package private)  void updateDisplay(boolean hasDisplay)
          Display the data for this cell, or all relevant errors if there are any.
 void waitForData()
          Blocks until all of this cell's Data objects finish loading.
 void waitForData(String varName)
          Blocks until the Data object with the given variable name finishes loading.
 void waitForFormula()
          Deprecated. Use waitForData(String) instead.
 
Methods inherited from class javax.swing.JPanel
, getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, bindingForKeyStroke, computeVisibleRect, computeVisibleRect, contains, createToolTip, enableSerialization, 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, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, nextFocus, paintComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, constructComponentName, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, 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, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finaliz