org.opensourcephysics.tools
Class DataToolTab

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.opensourcephysics.tools.DataToolTab
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.rmi.Remote, java.util.EventListener, javax.accessibility.Accessible, Tool

public class DataToolTab
extends javax.swing.JPanel
implements Tool, java.beans.PropertyChangeListener

This tab displays and analyzes a single Data object in a DataTool.

Version:
1.0
Author:
Douglas Brown
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JButton analyzeButton
           
protected  javax.swing.JCheckBoxMenuItem areaCheckbox
           
protected  boolean areaVisible
           
protected  int colorIndex
           
protected  java.lang.Object[][] constantsLoadedFromXML
           
protected static java.text.NumberFormat correlationFormat
           
protected  DatasetCurveFitter curveFitter
           
protected  FunctionTool dataBuilder
           
protected  javax.swing.JButton dataBuilderButton
           
protected  DatasetManager dataManager
           
protected  javax.swing.JScrollPane dataScroller
           
protected  DataToolTable dataTable
           
protected  DataTool dataTool
           
protected  javax.swing.JLabel editableLabel
           
protected  java.lang.String fileName
           
protected  javax.swing.Action fitterAction
           
protected  javax.swing.JCheckBoxMenuItem fitterCheckbox
           
protected  javax.swing.JCheckBoxMenuItem fourierCheckbox
           
protected  javax.swing.JDialog fourierDialog
           
protected  FourierPanel fourierPanel
           
protected  javax.swing.JButton helpButton
           
protected static java.lang.String helpName
           
protected  boolean isHorzVarPopup
           
protected  boolean isInitialized
           
protected  JobManager jobManager
           
protected  javax.swing.JButton measureButton
           
protected  javax.swing.JButton newColumnButton
           
protected  int originatorID
           
protected  java.util.Map<java.lang.String,java.lang.String[]> ownedColumns
           
protected  java.lang.String ownerName
           
protected  org.opensourcephysics.tools.DataToolTab.DataToolPlotter plot
           
protected  CartesianInteractive plotAxes
           
protected  boolean positionVisible
           
protected  javax.swing.Action propsAndStatsAction
           
protected  javax.swing.JCheckBoxMenuItem propsCheckbox
           
protected  javax.swing.JScrollPane propsScroller
           
protected  DataToolPropsTable propsTable
           
protected  javax.swing.JButton refreshDataButton
           
protected  boolean replaceColumnsWithMatchingNames
           
protected  javax.swing.Action setVarAction
           
protected  javax.swing.JCheckBoxMenuItem slopeCheckbox
           
protected  boolean slopeVisible
           
protected  javax.swing.JSplitPane[] splitPanes
           
protected  javax.swing.JCheckBoxMenuItem statsCheckbox
           
protected  javax.swing.JScrollPane statsScroller
           
protected  DataToolStatsTable statsTable
           
protected  javax.swing.JLabel statusLabel
           
protected  boolean tabChanged
           
protected  javax.swing.JScrollPane tableScroller
           
protected  javax.swing.JToolBar toolbar
           
protected  javax.swing.undo.UndoManager undoManager
           
protected  javax.swing.undo.UndoableEditSupport undoSupport
           
protected  boolean userEditable
           
protected  javax.swing.JCheckBoxMenuItem valueCheckbox
           
protected  javax.swing.JPopupMenu varPopup
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DataToolTab(Data data, DataTool tool)
          Constructs a DataToolTab for the specified Data.
 
Method Summary
protected  void addColumn(DataColumn column)
          Adds a DataColumn to this tab.
protected  void addColumns(java.util.ArrayList<DataColumn> columns, boolean deletable, boolean addDuplicates, boolean postEdit)
          Adds DataColumns to this tab.
 void addColumns(Data source, boolean deletable, boolean addDuplicates, boolean postEdit)
          Adds new dataColumns to this tab.
 void addFitFunction(KnownFunction f, boolean addToFitBuilder)
          Adds a fit function.
 void clearData()
          Clears all data.
protected  void columnNameChanged(java.lang.String oldName, java.lang.String newName)
          Responds to a changed column name.
protected  boolean containsOperators(java.lang.String name)
          Determines if the name contains any FunctionTool.parserOperators.
protected  void copyTableDataToClipboard()
          Copies the selected table data to the clipboard.
protected  DataColumn createDataColumn()
          Creates a new empty DataColumn.
protected  void createGUI()
          Creates the GUI.
protected  java.util.Map<DataColumn,Dataset> getColumnMatchesByID(Data data)
          Gets datasets matching columns by ID in this tab.
protected  java.util.Map<DataColumn,Dataset> getColumnMatchesByName(java.util.Set<java.lang.String> columnNames, Data data)
          Gets datasets matching columns by name in this tab.
 java.lang.String getColumnName(int ID)
          Gets the column name for the first DataColumn with a given ID.
 FunctionTool getDataBuilder()
          Gets the data builder for defining custom data functions.
static XML.ObjectLoader getLoader()
          Returns an ObjectLoader to save and load data for this class.
protected  Dataset getMatchByID(DataColumn column, java.util.ArrayList<Dataset> datasets)
          Gets a matching Dataset by ID.
protected  Dataset getMatchByName(DataColumn column, java.util.ArrayList<Dataset> datasets)
          Gets a matching Dataset by name.
 java.lang.String getOwnerName()
          Gets the name of the owner of this tab.
protected  java.lang.String getSelectedTableData()
          Gets the table cells selected by the user.
protected  java.lang.String getUniqueYColumnName(Dataset d, java.lang.String proposed, boolean askUser)
          Returns a column name that is unique to this tab, contains no spaces, and is not reserved by the OSP parser.
protected  org.opensourcephysics.tools.DataToolTable.WorkingDataset getWorkingData()
          Gets the working dataset.
protected  boolean isDeletable(Dataset data)
          Determines if a dataset is deletable.
protected  boolean isDuplicateColumn(java.lang.String name, double[] data)
          Returns true if the name and data duplicate an existing column.
protected  boolean isDuplicateName(Dataset d, java.lang.String name)
          Returns true if name is a duplicate of an existing dataset.
 boolean isInterestedIn(Data data)
          Returns true if this tab is interested in a Data object.
 boolean isOwnedBy(Data data)
          Returns true if (a) the Data ID is this tab owner's ID or (b) the Data name is this tab's name.
protected  boolean isReservedName(java.lang.String name)
          Returns true if name is reserved by the OSP parser.
 java.util.ArrayList<DataColumn> loadData(Data data, boolean replaceIfSameName)
          Loads data into this tab.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Listens for property change "function".
 void refreshData()
          Refreshes the data by sending a request to the source.
protected  void refreshDataBuilder()
          Refreshes the data builder.
protected  void refreshGUI()
          Refreshes the GUI.
protected  void refreshPlot()
          Refreshes the plot.
protected  void refreshStatusBar()
          Refreshes the status bar.
protected  java.lang.String replaceSpacesWithUnderscores(java.lang.String name)
          Replaces spaces with underscores in a name.
 void saveOwnedColumnNames(java.lang.String columnOwnerName, Data data)
          Saves DataColumn names with associated column owner and Data object.
protected  java.lang.String saveTableDataToFile()
          Saves the selected table data to a file.
 void send(Job job, Tool replyTo)
          Sends a job to this tool and specifies a tool to reply to.
protected  void setFontLevel(int level)
          Sets the font level.
 void setName(java.lang.String name)
          Overrides Component.setName();
 boolean setOwnedColumnIDs(java.lang.String columnOwnerName, Data data)
          Sets DataColumn IDs to corresponding column owner IDs based on saved names.
 void setOwner(java.lang.String name, Data data)
          Sets the owner of this tab.
 void setReplaceColumnsWithMatchingNames(boolean replace)
          Sets the replaceColumnsWithMatchingNames flag.
protected  void setSelectedData(Dataset selectedData)
          Sets the selected data in the curve fitter and fourier panel.
 void setUserEditable(boolean editable)
          Sets the userEditable flag.
 void setWorkingColumns(java.lang.String xColName, java.lang.String yColName)
          Sets the x and y columns by name.
protected  void tabChanged(boolean changed)
          Sets the tabChanged flag.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

helpName

protected static java.lang.String helpName

correlationFormat

protected static java.text.NumberFormat correlationFormat

dataTool

protected DataTool dataTool

originatorID

protected int originatorID

dataManager

protected DatasetManager dataManager

splitPanes

protected javax.swing.JSplitPane[] splitPanes

plot

protected org.opensourcephysics.tools.DataToolTab.DataToolPlotter plot

dataTable

protected DataToolTable dataTable

statsTable

protected DataToolStatsTable statsTable

propsTable

protected DataToolPropsTable propsTable

dataScroller

protected javax.swing.JScrollPane dataScroller

statsScroller

protected javax.swing.JScrollPane statsScroller

propsScroller

protected javax.swing.JScrollPane propsScroller

tableScroller

protected javax.swing.JScrollPane tableScroller

toolbar

protected javax.swing.JToolBar toolbar

statsCheckbox

protected javax.swing.JCheckBoxMenuItem statsCheckbox

fitterCheckbox

protected javax.swing.JCheckBoxMenuItem fitterCheckbox

propsCheckbox

protected javax.swing.JCheckBoxMenuItem propsCheckbox

fourierCheckbox

protected javax.swing.JCheckBoxMenuItem fourierCheckbox

curveFitter

protected DatasetCurveFitter curveFitter

fourierPanel

protected FourierPanel fourierPanel

fourierDialog

protected javax.swing.JDialog fourierDialog

measureButton

protected javax.swing.JButton measureButton

analyzeButton

protected javax.swing.JButton analyzeButton

dataBuilderButton

protected javax.swing.JButton dataBuilderButton

newColumnButton

protected javax.swing.JButton newColumnButton

refreshDataButton

protected javax.swing.JButton refreshDataButton

valueCheckbox

protected javax.swing.JCheckBoxMenuItem valueCheckbox

slopeCheckbox

protected javax.swing.JCheckBoxMenuItem slopeCheckbox

areaCheckbox

protected javax.swing.JCheckBoxMenuItem areaCheckbox

fitterAction

protected javax.swing.Action fitterAction

propsAndStatsAction

protected javax.swing.Action propsAndStatsAction

fileName

protected java.lang.String fileName

ownerName

protected java.lang.String ownerName

ownedColumns

protected java.util.Map<java.lang.String,java.lang.String[]> ownedColumns

helpButton

protected javax.swing.JButton helpButton

colorIndex

protected int colorIndex

tabChanged

protected boolean tabChanged

userEditable

protected boolean userEditable

undoSupport

protected javax.swing.undo.UndoableEditSupport undoSupport

undoManager

protected javax.swing.undo.UndoManager undoManager

dataBuilder

protected FunctionTool dataBuilder

jobManager

protected JobManager jobManager

statusLabel

protected javax.swing.JLabel statusLabel

editableLabel

protected javax.swing.JLabel editableLabel

plotAxes

protected CartesianInteractive plotAxes

positionVisible

protected boolean positionVisible

slopeVisible

protected boolean slopeVisible

areaVisible

protected boolean areaVisible

varPopup

protected javax.swing.JPopupMenu varPopup

isHorzVarPopup

protected boolean isHorzVarPopup

setVarAction

protected javax.swing.Action setVarAction

isInitialized

protected boolean isInitialized

constantsLoadedFromXML

protected java.lang.Object[][] constantsLoadedFromXML

replaceColumnsWithMatchingNames

protected boolean replaceColumnsWithMatchingNames
Constructor Detail

DataToolTab

public DataToolTab(Data data,
                   DataTool tool)
Constructs a DataToolTab for the specified Data.

Parameters:
data - the Data object
tool - the DataTool
Method Detail

loadData

public java.util.ArrayList<DataColumn> loadData(Data data,
                                                boolean replaceIfSameName)
Loads data into this tab.

Parameters:
data - the data to load
replaceIfSameName - true to replace existing data, if any
Returns:
true if loaded

addColumns

public void addColumns(Data source,
                       boolean deletable,
                       boolean addDuplicates,
                       boolean postEdit)
Adds new dataColumns to this tab.

Parameters:
source - the Data source of the columns
deletable - true to allow added columns to be deleted
addDuplicates - true to add duplicate IDs
postEdit - true to post an undoable edit

addColumns

protected void addColumns(java.util.ArrayList<DataColumn> columns,
                          boolean deletable,
                          boolean addDuplicates,
                          boolean postEdit)
Adds DataColumns to this tab.

Parameters:
columns - the columns to add
deletable - true to allow added columns to be deleted
addDuplicates - true to add duplicate IDs
postEdit - true to post an undoable edit

addColumn

protected void addColumn(DataColumn column)
Adds a DataColumn to this tab.

Parameters:
column - the column to add

setWorkingColumns

public void setWorkingColumns(java.lang.String xColName,
                              java.lang.String yColName)
Sets the x and y columns by name.

Parameters:
xColName - the name of the horizontal axis variable
yColName - the name of the vertical axis variable

setName

public void setName(java.lang.String name)
Overrides Component.setName();

Overrides:
setName in class java.awt.Component
Parameters:
name - the name

setUserEditable

public void setUserEditable(boolean editable)
Sets the userEditable flag.

Parameters:
editable - true to enable user editing

isDeletable

protected boolean isDeletable(Dataset data)
Determines if a dataset is deletable.

Parameters:
data - the dataset
Returns:
true if deletable

getDataBuilder

public FunctionTool getDataBuilder()
Gets the data builder for defining custom data functions.

Returns:
the data builder

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Listens for property change "function".

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
e - the event

send

public void send(Job job,
                 Tool replyTo)
          throws java.rmi.RemoteException
Sends a job to this tool and specifies a tool to reply to.

Specified by:
send in interface Tool
Parameters:
job - the Job
replyTo - the tool to notify when the job is complete (may be null)
Throws:
java.rmi.RemoteException

addFitFunction

public void addFitFunction(KnownFunction f,
                           boolean addToFitBuilder)
Adds a fit function. UserFunctions can optionally be added to the fit builder.

Parameters:
f - the fit function to add
addToFitBuilder - true to add a UserFunction to the fit builder

clearData

public void clearData()
Clears all data.


setReplaceColumnsWithMatchingNames

public void setReplaceColumnsWithMatchingNames(boolean replace)
Sets the replaceColumnsWithMatchingNames flag.

Parameters:
replace - true to replace columns with same name but different ID

replaceSpacesWithUnderscores

protected java.lang.String replaceSpacesWithUnderscores(java.lang.String name)
Replaces spaces with underscores in a name.

Parameters:
name - the name with spaces
Returns:
the name with underscores

refreshDataBuilder

protected void refreshDataBuilder()
Refreshes the data builder.


setFontLevel

protected void setFontLevel(int level)
Sets the font level.

Parameters:
level - the level

tabChanged

protected void tabChanged(boolean changed)
Sets the tabChanged flag.

Parameters:
changed - true if tab is changed

getWorkingData

protected org.opensourcephysics.tools.DataToolTable.WorkingDataset getWorkingData()
Gets the working dataset.

Returns:
the first two data columns in the datatable (x-y order)

getUniqueYColumnName

protected java.lang.String getUniqueYColumnName(Dataset d,
                                                java.lang.String proposed,
                                                boolean askUser)
Returns a column name that is unique to this tab, contains no spaces, and is not reserved by the OSP parser.

Parameters:
d - the dataset
proposed - the proposed name for the column
askUser - true to ask user to approve changes
Returns:
unique name

isDuplicateName

protected boolean isDuplicateName(Dataset d,
                                  java.lang.String name)
Returns true if name is a duplicate of an existing dataset.

Parameters:
d - the dataset
name - the proposed name for the dataset
Returns:
true if duplicate

isReservedName

protected boolean isReservedName(java.lang.String name)
Returns true if name is reserved by the OSP parser.

Parameters:
name - the proposed name
Returns:
true if reserved

containsOperators

protected boolean containsOperators(java.lang.String name)
Determines if the name contains any FunctionTool.parserOperators.

Parameters:
name - the name
Returns:
true if the name contains one or more operators

columnNameChanged

protected void columnNameChanged(java.lang.String oldName,
                                 java.lang.String newName)
Responds to a changed column name.

Parameters:
oldName - the previous name
newName - the new name

createDataColumn

protected DataColumn createDataColumn()
Creates a new empty DataColumn.

Returns:
the column

saveTableDataToFile

protected java.lang.String saveTableDataToFile()
Saves the selected table data to a file.

Returns:
the path of the saved file or null if failed

copyTableDataToClipboard

protected void copyTableDataToClipboard()
Copies the selected table data to the clipboard.


getSelectedTableData

protected java.lang.String getSelectedTableData()
Gets the table cells selected by the user. The tab name and column names precede the data. Data rows are delimited by new lines ("\n"), columns by tabs.

Returns:
a String containing the data.

createGUI

protected void createGUI()
Creates the GUI.


refreshGUI

protected void refreshGUI()
Refreshes the GUI.


isDuplicateColumn

protected boolean isDuplicateColumn(java.lang.String name,
                                    double[] data)
Returns true if the name and data duplicate an existing column.

Parameters:
name - the name
data - the data array
Returns:
true if a duplicate is found

isInterestedIn

public boolean isInterestedIn(Data data)
Returns true if this tab is interested in a Data object.

Parameters:
data - the Data object
Returns:
true if data is of interest

setOwnedColumnIDs

public boolean setOwnedColumnIDs(java.lang.String columnOwnerName,
                                 Data data)
Sets DataColumn IDs to corresponding column owner IDs based on saved names. Call this after loading this tab from XML to set column IDs to column owner IDs.

Parameters:
columnOwnerName - the guest name
data - the guest Data
Returns:
true if any column IDs were changed

saveOwnedColumnNames

public void saveOwnedColumnNames(java.lang.String columnOwnerName,
                                 Data data)
Saves DataColumn names with associated column owner and Data object. Call this before saving this tab so owned columns will be saved in XML.

Parameters:
columnOwnerName - the guest name
data - the guest Data

getColumnName

public java.lang.String getColumnName(int ID)
Gets the column name for the first DataColumn with a given ID.

Parameters:
ID - the ID number of the desired column
Returns:
the tab column name, or null if not found

isOwnedBy

public boolean isOwnedBy(Data data)
Returns true if (a) the Data ID is this tab owner's ID or (b) the Data name is this tab's name.

Parameters:
data - the Data object
Returns:
true if data owns this tab

setOwner

public void setOwner(java.lang.String name,
                     Data data)
Sets the owner of this tab. This method is used before saving and after loading this tab so the tab can refresh its data from a new owner.

Parameters:
name - the owner name
data - the owner Data

getOwnerName

public java.lang.String getOwnerName()
Gets the name of the owner of this tab. May return null, even if an owner exists.

Returns:
the name of the owner

getColumnMatchesByID

protected java.util.Map<DataColumn,Dataset> getColumnMatchesByID(Data data)
Gets datasets matching columns by ID in this tab.

Parameters:
data - Data object with datasets to match
columnNames - optional set of column names
Returns:
map of column to dataset

getColumnMatchesByName

protected java.util.Map<DataColumn,Dataset> getColumnMatchesByName(java.util.Set<java.lang.String> columnNames,
                                                                   Data data)
Gets datasets matching columns by name in this tab.

Parameters:
columnNames - set of column names
data - Data object with datasets to match
Returns:
map of column to dataset

getMatchByName

protected Dataset getMatchByName(DataColumn column,
                                 java.util.ArrayList<Dataset> datasets)
Gets a matching Dataset by name.

Parameters:
column - the DataColumn to match
datasets - the Datasets to search
Returns:
the matching DAtaset

getMatchByID

protected Dataset getMatchByID(DataColumn column,
                               java.util.ArrayList<Dataset> datasets)
Gets a matching Dataset by ID.

Parameters:
column - the DataColumn to match
datasets - the Datasets to search
Returns:
the matching Dataset

setSelectedData

protected void setSelectedData(Dataset selectedData)
Sets the selected data in the curve fitter and fourier panel.

Parameters:
selectedData - the Dataset to pass to the fitter and fourier panel

refreshPlot

protected void refreshPlot()
Refreshes the plot.


refreshData

public void refreshData()
Refreshes the data by sending a request to the source. Note that this only works if the data was received from a DataRefreshTool.


refreshStatusBar

protected void refreshStatusBar()
Refreshes the status bar.


getLoader

public static XML.ObjectLoader getLoader()
Returns an ObjectLoader to save and load data for this class.

Returns:
the object loader