|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.opensourcephysics.display.OSPFrame
org.opensourcephysics.tools.DataTool
public class DataTool
This provides a GUI for analyzing OSP Data objects.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
javax.swing.JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
java.awt.Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| 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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected javax.swing.JMenuItem |
aboutItem
|
protected Data |
addableData
|
protected static int |
buttonHeight
|
protected static javax.swing.JFileChooser |
chooser
|
protected javax.swing.JMenuItem |
closeAllItem
|
protected javax.swing.JMenuItem |
closeItem
|
protected javax.swing.JPanel |
contentPane
|
protected XMLControl |
control
|
protected javax.swing.JMenuItem |
copyDataRowsItem
|
protected javax.swing.JMenuItem |
copyDatasetItem
|
protected javax.swing.JMenuItem |
copyImageItem
|
protected javax.swing.JMenu |
copyMenu
|
protected javax.swing.JMenuItem |
copyTabItem
|
protected FunctionTool |
dataFunctionTool
|
protected static java.awt.Dimension |
dim
|
protected javax.swing.JMenu |
editMenu
|
protected javax.swing.JMenu |
emptyEditMenu
|
protected javax.swing.JMenuItem |
emptyExitItem
|
protected javax.swing.JMenu |
emptyFileMenu
|
protected javax.swing.JMenuBar |
emptyMenubar
|
protected javax.swing.JMenuItem |
emptyOpenItem
|
protected javax.swing.JMenuItem |
emptyPasteItem
|
protected javax.swing.JMenuItem |
exitItem
|
protected javax.swing.JMenuItem |
exportItem
|
protected javax.swing.JMenu |
fileMenu
|
protected java.lang.String |
helpBase
|
protected TextFrame |
helpFrame
|
protected javax.swing.JMenuItem |
helpItem
|
protected javax.swing.JLabel |
helpLabel
|
protected javax.swing.JMenu |
helpMenu
|
protected java.lang.String |
helpPath
|
protected JobManager |
jobManager
|
static boolean |
loadClass
|
protected static OSPLog |
log
|
protected javax.swing.JMenuItem |
logItem
|
protected javax.swing.JMenuBar |
menubar
|
protected javax.swing.JMenuItem |
openItem
|
protected javax.swing.JMenuItem |
pasteColumnsItem
|
protected javax.swing.JMenu |
pasteMenu
|
protected javax.swing.JMenuItem |
pasteNewTabItem
|
protected javax.swing.JMenuItem |
printItem
|
protected javax.swing.JMenuItem |
saveAsItem
|
protected javax.swing.JMenuItem |
saveItem
|
protected java.beans.PropertyChangeSupport |
support
|
protected javax.swing.JTabbedPane |
tabbedPane
|
protected boolean |
useChooser
|
| Fields inherited from class org.opensourcephysics.display.OSPFrame |
|---|
animated, autoclear, buttonPanel, childFrames, constructorThreadGroup, customButtons, keepHidden, strategy |
| 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.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 | |
|---|---|
|
DataTool()
Constructs a blank DataTool. |
|
DataTool(Data data)
Constructs a DataTool and loads the specified data object. |
|
DataTool(Data data,
java.lang.String name)
Constructs a DataTool and loads a data object into a named tab. |
|
DataTool(java.lang.String fileName)
Constructs a DataTool and opens the specified xml file. |
protected |
DataTool(java.lang.String title,
java.lang.String name)
Constructs a DataTool with title and name. |
|
DataTool(XMLControl control)
Constructs a DataTool and loads data from an xml control. |
| Method Summary | |
|---|---|
DataToolTab |
addTab(Data data)
Adds a tab for the specified Data object. |
DataToolTab |
addTab(Data data,
java.lang.String name)
Adds a tab for the specified Data object and proposes a name for the tab. |
protected void |
addTab(DataToolTab tab)
Adds a tab. |
DataToolTab |
addTab(XMLControl control)
Adds a tab and loads data from an xml control. |
protected static javax.swing.JButton |
createButton(java.lang.String text)
Creates a button with a specified maximum height. |
protected void |
createGUI()
Creates the GUI. |
protected FunctionTool |
getDataFunctionTool()
Gets the function tool for defining custom data functions. |
protected DataToolTab |
getSelectedTab()
Gets the currently selected DataToolTab, if any. |
protected java.lang.StringBuffer |
getSelectedTableData(java.lang.String name,
DataTable table)
Gets the data rows selected by the user in a datatable. |
DataToolTab |
getTab(Data data)
Returns the tab containing the specified Data object. |
DataToolTab |
getTab(int index)
Returns the tab at the specified index. |
int |
getTabCount()
Returns the tab count. |
protected int |
getTabIndex(Data data)
Returns the index of the tab containing the specified Data object. |
static DataTool |
getTool()
Gets the shared DataTool. |
protected java.lang.String |
getUniqueName(java.lang.String proposed)
Gets a unique name. |
protected DatasetManager |
importCharDelimitedData(java.lang.String dataString,
java.lang.String fileName)
Imports character-delimited data. |
boolean |
isUseChooser()
Gets the useChooser flag. |
protected DataToolTab |
loadData(Data data,
DataToolTab tab)
Loads data into a specified tab. |
protected DataToolTab |
loadData(DataToolTab tab,
XMLControl control,
boolean useChooser)
Loads data from an xml control into a specified tab. |
protected java.lang.String |
open()
Opens an xml file selected with a chooser. |
java.lang.String |
open(java.lang.String fileName)
Opens an xml file specified by name. |
static double[] |
parseDoubles(java.lang.String text,
java.lang.String delimiter)
Parses a String into doubles separated by a specified delimiter. |
static double[][] |
parseDoubles(java.lang.String text,
java.lang.String rowDelimiter,
java.lang.String colDelimiter)
Parses a String into doubles separated by specified row and column delimiters. |
static java.lang.String[] |
parseStrings(java.lang.String text,
java.lang.String delimiter)
Parses a String into tokens separated by a specified delimiter. |
static java.lang.String[][] |
parseStrings(java.lang.String text,
java.lang.String rowDelimiter,
java.lang.String colDelimiter)
Parses a String into tokens separated by specified row and column delimiters. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Listens for property changes "function" and "visible" |
protected java.lang.String |
readFirstLine(java.io.Reader in)
|
protected void |
refreshFunctionTool()
Refreshes the function tool. |
protected void |
refreshGUI()
Refreshes the GUI. |
protected void |
refreshMenubar()
|
protected void |
refreshTabTitles()
|
protected void |
removeAllButTab(int index)
Removes all tabs except the specified index. |
protected void |
removeAllTabs()
Removes all tabs. |
DataToolTab |
removeTab(Data data)
Adds a tab for the specified Data object. |
void |
removeTab(int index)
Removes the tab at the specified index. |
protected java.lang.String |
save(java.lang.String fileName)
Saves the current xml control to the specified file. |
protected java.lang.String |
saveAs()
Saves the currently displayed xml control to a file selected with a chooser. |
void |
send(Job job,
Tool replyTo)
Sends a job to this tool and specifies a tool to reply to. |
protected void |
setSelectedTab(DataToolTab tab)
Selects a DataToolTab. |
void |
setUseChooser(boolean useChooser)
Sets the useChooser flag. |
protected void |
showAboutDialog()
Shows the about dialog. |
void |
update(Data data)
Updates the data. |
java.lang.String |
write(java.lang.String text)
Writes text to a file selected with a chooser. |
java.lang.String |
write(java.lang.String text,
java.lang.String fileName)
Writes text to a file with the specified name. |
void |
write(java.lang.String text,
java.io.Writer out)
Writes text to a Writer. |
| Methods inherited from class org.opensourcephysics.display.OSPFrame |
|---|
addButton, addChildFrame, bufferStrategyShow, clearChildFrames, clearData, clearDataAndRepaint, createBufferStrategy, dispose, getChildFrames, getChooser, getConstructorThreadGroup, getMenu, invalidateImage, isAnimated, isAutoclear, isIconified, isKeepHidden, loadDisplayMenu, loadToolsMenu, parseXMLMenu, parseXMLMenu, removeMenu, removeMenuItem, render, setAnimated, setAutoclear, setDefaultCloseOperation, setFontLevel, setKeepHidden, setSize, setTitle, setVisible, show, wishesToExit |
| Methods inherited from class javax.swing.JFrame |
|---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, 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, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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, isOpaque, isPreferredSizeSet, 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, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, 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 org.opensourcephysics.display.AppFrame |
|---|
getDefaultCloseOperation |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static boolean loadClass
protected static javax.swing.JFileChooser chooser
protected static OSPLog log
protected static java.awt.Dimension dim
protected static int buttonHeight
protected javax.swing.JTabbedPane tabbedPane
protected boolean useChooser
protected javax.swing.JPanel contentPane
protected java.beans.PropertyChangeSupport support
protected XMLControl control
protected JobManager jobManager
protected Data addableData
protected javax.swing.JMenuBar emptyMenubar
protected javax.swing.JMenu emptyFileMenu
protected javax.swing.JMenuItem emptyOpenItem
protected javax.swing.JMenuItem emptyExitItem
protected javax.swing.JMenu emptyEditMenu
protected javax.swing.JMenuItem emptyPasteItem
protected javax.swing.JMenuBar menubar
protected javax.swing.JMenu fileMenu
protected javax.swing.JMenuItem openItem
protected javax.swing.JMenuItem exportItem
protected javax.swing.JMenuItem saveItem
protected javax.swing.JMenuItem saveAsItem
protected javax.swing.JMenuItem closeItem
protected javax.swing.JMenuItem closeAllItem
protected javax.swing.JMenuItem printItem
protected javax.swing.JMenuItem exitItem
protected javax.swing.JMenu editMenu
protected javax.swing.JMenu copyMenu
protected javax.swing.JMenuItem copyImageItem
protected javax.swing.JMenuItem copyTabItem
protected javax.swing.JMenuItem copyDatasetItem
protected javax.swing.JMenuItem copyDataRowsItem
protected javax.swing.JMenu pasteMenu
protected javax.swing.JMenuItem pasteNewTabItem
protected javax.swing.JMenuItem pasteColumnsItem
protected javax.swing.JMenu helpMenu
protected javax.swing.JMenuItem helpItem
protected javax.swing.JMenuItem logItem
protected javax.swing.JMenuItem aboutItem
protected FunctionTool dataFunctionTool
protected javax.swing.JLabel helpLabel
protected TextFrame helpFrame
protected java.lang.String helpPath
protected java.lang.String helpBase
| Constructor Detail |
|---|
public DataTool()
public DataTool(java.lang.String fileName)
fileName - the name of the xml filepublic DataTool(XMLControl control)
control - the xml controlpublic DataTool(Data data)
data - the data
public DataTool(Data data,
java.lang.String name)
data - the dataname - the tab name
protected DataTool(java.lang.String title,
java.lang.String name)
| Method Detail |
|---|
public static DataTool getTool()
public DataToolTab addTab(XMLControl control)
control - the xml control
public DataToolTab addTab(Data data)
data - the Data
public DataToolTab addTab(Data data,
java.lang.String name)
data - the Dataname - a proposed tab name
public DataToolTab removeTab(Data data)
data - the Data
public void removeTab(int index)
index - the tab numberpublic void update(Data data)
data - the Datapublic DataToolTab getTab(Data data)
data - the Dataset
public DataToolTab getTab(int index)
index - the tab index
public int getTabCount()
public java.lang.String open(java.lang.String fileName)
fileName - the file name
public void send(Job job,
Tool replyTo)
throws java.rmi.RemoteException
send in interface Tooljob - the JobreplyTo - the tool to notify when the job is complete (may be null)
java.rmi.RemoteExceptionpublic void setUseChooser(boolean useChooser)
useChooser - true to load datasets with a chooserpublic boolean isUseChooser()
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - the event
public static java.lang.String[] parseStrings(java.lang.String text,
java.lang.String delimiter)
text - the text to parsedelimiter - the delimiter
public static double[] parseDoubles(java.lang.String text,
java.lang.String delimiter)
text - the text to parsedelimiter - the delimiter
public static java.lang.String[][] parseStrings(java.lang.String text,
java.lang.String rowDelimiter,
java.lang.String colDelimiter)
text - the text to parserowDelimiter - the column delimitercolDelimiter - the column delimiter
public static double[][] parseDoubles(java.lang.String text,
java.lang.String rowDelimiter,
java.lang.String colDelimiter)
text - the text to parserowDelimiter - the column delimitercolDelimiter - the column delimiter
protected java.lang.String readFirstLine(java.io.Reader in)
protected DatasetManager importCharDelimitedData(java.lang.String dataString,
java.lang.String fileName)
dataString - the datafileName - name of file being imported (may be null)
protected java.lang.String getUniqueName(java.lang.String proposed)
proposed - the proposed name
protected DataToolTab loadData(DataToolTab tab,
XMLControl control,
boolean useChooser)
tab - the tab to load (may be null)control - the xml control describing the datauseChooser - true to present data choices to user
protected DataToolTab loadData(Data data,
DataToolTab tab)
tab - the tab to load (may be null)
protected void addTab(DataToolTab tab)
tab - a DataToolTabprotected DataToolTab getSelectedTab()
protected void setSelectedTab(DataToolTab tab)
tab - the tab to selectprotected java.lang.String open()
public java.lang.String write(java.lang.String text)
text - the text
public java.lang.String write(java.lang.String text,
java.lang.String fileName)
text - the textfileName - the file name
public void write(java.lang.String text,
java.io.Writer out)
text - the textout - the Writerprotected java.lang.String save(java.lang.String fileName)
fileName - the file name
protected java.lang.String saveAs()
protected int getTabIndex(Data data)
data - the Dataset
protected void removeAllButTab(int index)
index - the tab numberprotected void removeAllTabs()
protected void refreshTabTitles()
protected void refreshMenubar()
protected FunctionTool getDataFunctionTool()
protected void refreshFunctionTool()
protected java.lang.StringBuffer getSelectedTableData(java.lang.String name,
DataTable table)
name - a name for the data (may be null)table - the datatable containing the data
protected void createGUI()
protected void refreshGUI()
refreshGUI in class OSPFrameprotected void showAboutDialog()
protected static javax.swing.JButton createButton(java.lang.String text)
text - the button texth - the button height
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||