public class DatasetCurveFitter
extends javax.swing.JPanel
| Modifier and Type | Class | Description |
|---|---|---|
class |
DatasetCurveFitter.MinimizeMultiVarFunction |
A function whose value is the total deviation squared
between a multivariable function and a set of data points.
|
class |
DatasetCurveFitter.MinimizeUserFunction |
A function whose value is the total deviation squared
between a user function and a set of data points.
|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategyjava.awt.Container.AccessibleAWTContaineraccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor | Description |
|---|---|
DatasetCurveFitter(Dataset data,
FitBuilder builder) |
Constructs a DatasetCurveFitter for the specified Dataset.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addFitFunction(KnownFunction f,
boolean addToFitBuilder) |
Adds a fit function.
|
protected UserFunction |
createClone(KnownFunction f,
java.lang.String name) |
|
protected void |
createGUI() |
Creates the GUI.
|
void |
doLinearRegression(double[] xd,
double[] yd,
boolean isLinearFit) |
Determines the Pearson correlation and linear fit parameter SEs.
|
double |
fit(KnownFunction fit) |
Fits a fit function to the current data.
|
protected javax.swing.JDialog |
getColorDialog() |
Gets a color dialog for the plotted curve fit drawer
|
Dataset |
getData() |
Gets the data.
|
FunctionDrawer |
getDrawer() |
Gets the function drawer.
|
KnownFunction |
getFitFunction(java.lang.String name) |
Gets a fit function by name.
|
protected java.lang.String |
getLineFitName() |
Gets the name of the line fit function.
|
java.awt.Dimension |
getMinimumSize() |
|
java.util.Map<java.lang.String,java.lang.Double> |
getSelectedFitParameters() |
Gets the selected fit parameters.
|
double |
getUncertainty(int paramIndex) |
Gets the estimated uncertainty (standard error or other) of a best fit parameter.
|
java.lang.String |
getUncertaintyString(int paramIndex) |
Returns a string of the uncertainty with appropriate formatting.
|
protected void |
refreshFitDropDown() |
Refreshes the fitDropDown.
|
protected void |
refreshFitMap() |
Refreshes the fit map with localized names.
|
protected void |
refreshGUI() |
Refreshes the GUI.
|
void |
refreshStatusBar() |
Refreshes the parent tab's status bar
|
protected void |
replaceFit(java.lang.String oldName,
java.lang.String newName,
KnownFunction newFit) |
Replaces an existing fit function with a new one.
|
protected void |
selectFit(java.lang.String name) |
Selects a named fit.
|
void |
setActive(boolean active) |
Sets the active flag.
|
void |
setAutofit(boolean auto) |
Sets the autofit flag.
|
void |
setColor(java.awt.Color newColor) |
Sets the color.
|
void |
setData(Dataset data) |
Sets the dataset.
|
protected void |
setDataToolTab(DataToolTab tab) |
|
static void |
setDefaultFitFunctions(java.util.ArrayList<KnownFunction> functions) |
Sets the default fit functions.
|
protected void |
setFontLevel(int level) |
Sets the font level.
|
protected void |
setParameterValue(int row,
double value) |
Sets the value of a parameter.
|
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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleadd, 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, transferFocusDownCycle, validate, validateTreeaddAncestorListener, 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, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, updatepublic DatasetCurveFitter(Dataset data, FitBuilder builder)
data - the datasetbuilder - the FitBuilder used for constructing custom fitspublic FunctionDrawer getDrawer()
public Dataset getData()
public void setData(Dataset data)
data - the datasetpublic void setColor(java.awt.Color newColor)
newColor - the colorpublic void setAutofit(boolean auto)
auto - true to autofitpublic void setActive(boolean active)
active - truepublic double fit(KnownFunction fit)
fit - the function to fitpublic void addFitFunction(KnownFunction f, boolean addToFitBuilder)
f - the fit function to addaddToFitBuilder - ignored--all fits are added to the fit builderpublic void refreshStatusBar()
public double getUncertainty(int paramIndex)
paramIndex - the parameter indexpublic java.lang.String getUncertaintyString(int paramIndex)
paramIndex - the parameter indexpublic KnownFunction getFitFunction(java.lang.String name)
name - the namepublic java.util.Map<java.lang.String,java.lang.Double> getSelectedFitParameters()
public java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentprotected void createGUI()
protected void refreshGUI()
protected void refreshFitDropDown()
protected void refreshFitMap()
protected java.lang.String getLineFitName()
protected void setDataToolTab(DataToolTab tab)
protected void setFontLevel(int level)
level - the levelprotected void setParameterValue(int row,
double value)
row - the row numbervalue - the valueprotected void selectFit(java.lang.String name)
name - the name of the fit functionprotected UserFunction createClone(KnownFunction f, java.lang.String name)
public void doLinearRegression(double[] xd,
double[] yd,
boolean isLinearFit)
xd - double[]yd - double[]isLinearFit - true if linear fit (sets uncertainties to slope and intercept SE)protected void replaceFit(java.lang.String oldName,
java.lang.String newName,
KnownFunction newFit)
oldName - the (localized) name of the existing fit functionnewName - the (localized) new name of the functionnewFit - the new fit functionprotected javax.swing.JDialog getColorDialog()
public static void setDefaultFitFunctions(java.util.ArrayList<KnownFunction> functions)
functions - the fit functions