|
|||||||||
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected javax.swing.JMenuItem |
aboutItem
|
protected javax.swing.JMenu |
addMenu
|
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 |
copyDataItem
|
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 |
divideMenu
|
protected javax.swing.JMenu |
editMenu
|
protected javax.swing.JMenuItem |
exitItem
|
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.JMenu |
multiplyMenu
|
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 javax.swing.JMenu |
subtractMenu
|
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. |
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. |
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. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Listens for property changes "function" and "visible" |
protected void |
refreshFunctionTool()
Refreshes the function tool. |
protected void |
refreshGUI()
Refreshes the GUI. |
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. |
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, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, 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, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, 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, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, 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 javax.swing.JMenu addMenu
protected javax.swing.JMenu subtractMenu
protected javax.swing.JMenu multiplyMenu
protected javax.swing.JMenu divideMenu
protected javax.swing.JMenu fileMenu
protected javax.swing.JMenuItem openItem
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 copyDataItem
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 datapublic DataTool(Data data, java.lang.String name)
data
- the dataname
- the tab nameprotected 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 Tool
job
- the JobreplyTo
- the tool to notify when the job is complete (may be null)
java.rmi.RemoteException
public 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.PropertyChangeListener
e
- the eventprotected 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()
protected 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 FunctionTool getDataFunctionTool()
protected void refreshFunctionTool()
protected void createGUI()
protected void refreshGUI()
refreshGUI
in class OSPFrame
protected 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 |