|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.opensourcephysics.tools.DataToolTab
public class DataToolTab
This tab displays and analyzes a single Data object in a DataTool.
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.JCheckBox |
areaCheckbox
|
protected boolean |
areaVisible
|
protected javax.swing.Action |
bottomPaneAction
|
protected javax.swing.JCheckBox |
bottomPaneCheckbox
|
protected int |
colorIndex
|
protected DatasetCurveFitter |
curveFitter
|
protected FunctionTool |
dataBuilder
|
protected javax.swing.JButton |
dataBuilderButton
|
protected DatasetManager |
dataManager
|
protected DataToolTable |
dataTable
|
protected DataTool |
dataTool
|
protected java.lang.String |
fileName
|
protected int |
fontLevel
|
protected javax.swing.JButton |
helpButton
|
protected static java.lang.String |
helpName
|
protected boolean |
isHorzVarPopup
|
protected boolean |
isInitialized
|
protected JobManager |
jobManager
|
protected javax.swing.JButton |
newColumnButton
|
protected int |
originatorID
|
protected org.opensourcephysics.tools.DataToolTab.DataToolPlotter |
plot
|
protected CartesianInteractive |
plotAxes
|
protected boolean |
positionVisible
|
protected javax.swing.Action |
propsAndStatsAction
|
protected javax.swing.JCheckBox |
propsCheckbox
|
protected javax.swing.JScrollPane |
propsScroller
|
protected DataToolPropsTable |
propsTable
|
protected javax.swing.JButton |
refreshDataButton
|
protected javax.swing.Action |
setVarAction
|
protected javax.swing.JCheckBox |
slopeCheckbox
|
protected boolean |
slopeVisible
|
protected javax.swing.JSplitPane[] |
splitPanes
|
protected javax.swing.JCheckBox |
statsCheckbox
|
protected javax.swing.JScrollPane |
statsScroller
|
protected DataToolStatsTable |
statsTable
|
protected javax.swing.JLabel |
statusLabel
|
protected boolean |
tabChanged
|
protected javax.swing.JToolBar |
toolbar
|
protected javax.swing.undo.UndoManager |
undoManager
|
protected javax.swing.undo.UndoableEditSupport |
undoSupport
|
protected boolean |
userEditable
|
protected javax.swing.JCheckBox |
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)
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()
|
protected void |
columnNameChanged(java.lang.String oldName,
java.lang.String newName)
Responds to a changed column name. |
protected Dataset |
copy(Dataset source,
Dataset target,
boolean includeDataAndID)
Copies a dataset. |
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. |
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 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. |
protected 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)
Loads data into this tab. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Listens for property change "function". |
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. |
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(); |
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 |
---|
protected static java.lang.String helpName
protected DataTool dataTool
protected int originatorID
protected DatasetManager dataManager
protected javax.swing.JSplitPane[] splitPanes
protected org.opensourcephysics.tools.DataToolTab.DataToolPlotter plot
protected DataToolTable dataTable
protected DataToolStatsTable statsTable
protected DataToolPropsTable propsTable
protected javax.swing.JScrollPane statsScroller
protected javax.swing.JScrollPane propsScroller
protected javax.swing.JToolBar toolbar
protected javax.swing.JCheckBox statsCheckbox
protected javax.swing.JCheckBox bottomPaneCheckbox
protected javax.swing.JCheckBox propsCheckbox
protected DatasetCurveFitter curveFitter
protected javax.swing.JButton dataBuilderButton
protected javax.swing.JButton newColumnButton
protected javax.swing.JButton refreshDataButton
protected javax.swing.JCheckBox valueCheckbox
protected javax.swing.JCheckBox slopeCheckbox
protected javax.swing.JCheckBox areaCheckbox
protected javax.swing.Action bottomPaneAction
protected javax.swing.Action propsAndStatsAction
protected java.lang.String fileName
protected javax.swing.JButton helpButton
protected int colorIndex
protected boolean tabChanged
protected boolean userEditable
protected javax.swing.undo.UndoableEditSupport undoSupport
protected javax.swing.undo.UndoManager undoManager
protected FunctionTool dataBuilder
protected int fontLevel
protected JobManager jobManager
protected javax.swing.JLabel statusLabel
protected CartesianInteractive plotAxes
protected boolean positionVisible
protected boolean slopeVisible
protected boolean areaVisible
protected javax.swing.JPopupMenu varPopup
protected boolean isHorzVarPopup
protected javax.swing.Action setVarAction
protected boolean isInitialized
Constructor Detail |
---|
public DataToolTab(Data data)
data
- the Data objectMethod Detail |
---|
public java.util.ArrayList<DataColumn> loadData(Data data)
data
- the data to load
public void addColumns(Data source, boolean deletable, boolean addDuplicates, boolean postEdit)
source
- the Data source of the columnsdeletable
- true to allow added columns to be deletedaddDuplicates
- true to add duplicate IDspostEdit
- true to post an undoable editprotected void addColumns(java.util.ArrayList<DataColumn> columns, boolean deletable, boolean addDuplicates, boolean postEdit)
columns
- the columns to adddeletable
- true to allow added columns to be deletedaddDuplicates
- true to add duplicate IDspostEdit
- true to post an undoable editprotected void addColumn(DataColumn column)
column
- the column to addpublic void setWorkingColumns(java.lang.String xColName, java.lang.String yColName)
xColName
- the name of the horizontal axis variableyColName
- the name of the vertical axis variablepublic void setName(java.lang.String name)
setName
in class java.awt.Component
name
- the namepublic void setUserEditable(boolean editable)
editable
- true to enable user editingprotected boolean isDeletable(Dataset data)
data
- the dataset
public FunctionTool getDataBuilder()
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
e
- the eventpublic void send(Job job, Tool replyTo) throws java.rmi.RemoteException
send
in interface Tool
job
- the JobreplyTo
- the tool to notify when the job is complete (may be null)
java.rmi.RemoteException
public void addFitFunction(KnownFunction f, boolean addToFitBuilder)
f
- the fit function to addaddToFitBuilder
- true to add a UserFunction to the fit builderpublic void clearData()
protected java.lang.String replaceSpacesWithUnderscores(java.lang.String name)
name
- the name with spaces
protected void refreshDataBuilder()
protected void setFontLevel(int level)
level
- the levelprotected void tabChanged(boolean changed)
changed
- true if tab is changedprotected org.opensourcephysics.tools.DataToolTable.WorkingDataset getWorkingData()
protected java.lang.String getUniqueYColumnName(Dataset d, java.lang.String proposed, boolean askUser)
d
- the datasetproposed
- the proposed name for the columnaskUser
- true to ask user to approve changes
protected boolean isDuplicateName(Dataset d, java.lang.String name)
d
- the datasetname
- the proposed name for the dataset
protected boolean isReservedName(java.lang.String name)
name
- the proposed name
protected void columnNameChanged(java.lang.String oldName, java.lang.String newName)
oldName
- the previous namenewName
- the new nameprotected DataColumn createDataColumn()
protected Dataset copy(Dataset source, Dataset target, boolean includeDataAndID)
source
- the source datasettarget
- the target dataset (may be null)includeDataAndID
- true to copy data and ID
protected java.lang.String saveTableDataToFile()
protected void copyTableDataToClipboard()
protected java.lang.String getSelectedTableData()
protected void createGUI()
protected void refreshGUI()
protected boolean isDuplicateColumn(java.lang.String name, double[] data)
name
- the namedata
- the data array
protected boolean isOwnedBy(Data data)
data
- the Data object
protected void refreshPlot()
protected void refreshStatusBar()
public static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |