Class FitBuilder

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class FitBuilder extends FunctionTool
This is a FunctionTool used by DatasetCurveFitter to build, save and load custom fit functions. Some methods are tailored for use with DataTool since that is its main application.
Author:
Doug Brown
See Also:
  • Field Details

    • newFitButton

      protected JButton newFitButton
    • deleteFitButton

      protected JButton deleteFitButton
    • cloneFitButton

      protected JButton cloneFitButton
    • loadButton

      protected JButton loadButton
    • saveButton

      protected JButton saveButton
    • autoloadButton

      protected JButton autoloadButton
    • myParent

      protected Component myParent
    • addedFits

      protected TreeSet<String> addedFits
    • defaultFitName

      protected String defaultFitName
    • autoloadManager

      protected org.opensourcephysics.tools.FitBuilder.AutoloadManager autoloadManager
  • Constructor Details

    • FitBuilder

      public FitBuilder(Component c)
      Constructor
      Parameters:
      c - a component to determine the dialog owner
    • FitBuilder

      public FitBuilder(Component c, boolean lazyGUI)
  • Method Details

    • createGUI

      protected void createGUI()
      Description copied from class: FunctionTool
      Creates the GUI.
      Overrides:
      createGUI in class FunctionTool
    • getSelectedCurveFitter

      public DatasetCurveFitter getSelectedCurveFitter()
      Gets the DatasetCurveFitter currently selected in the DataTool.
      Returns:
      the selected DataSetCurveFitter
    • refreshDropdown

      public void refreshDropdown(String name)
      Refreshes the dropdown with names of the available fits.
      Overrides:
      refreshDropdown in class FunctionTool
      Parameters:
      name - the selected fit name
    • addFitFunction

      public boolean addFitFunction(KnownFunction f)
      Adds a fit function unless already added or loaded.
      Parameters:
      f - the fit function to add
      Returns:
      true if added now or previously
    • autoloadFits

      protected void autoloadFits()
      Loads fit functions from all initial search paths.
    • eliminateExcludedFunctions

      protected void eliminateExcludedFunctions(XMLControl fitBuilderControl, String filePath)
      Eliminates unwanted function entries from a FitBuilder XMLControl. Typical control: NaturalLog y = ln(x) NaturalLog true x ln(x) true
      Parameters:
      fitBuilderControl - the XMLControl to modify
      filePath - the path to the XML file read by the XMLControl
    • setTitles

      protected void setTitles()
      Overrides:
      setTitles in class FunctionTool
    • refreshGUI

      protected void refreshGUI()
      Refreshes the GUI.
      Overrides:
      refreshGUI in class FunctionTool
    • chooseFitFunctions

      protected void chooseFitFunctions(XMLControl control, String description, ActionListener listener)
      Displays a dialog with a list of fit functions to load or save.
      Parameters:
      control - a FitBuilder XMLControl
      description - a description of the purpose (ie load or save)
    • addFitFunctionPanel

      protected FitFunctionPanel addFitFunctionPanel(UserFunction f)
      Adds a fit function panel.
      Parameters:
      f - the fit function to add
      Returns:
      the fit function panel
    • getAutoloadManager

      protected org.opensourcephysics.tools.FitBuilder.AutoloadManager getAutoloadManager()
      Gets the autoload manager, creating it the first time called.
      Returns:
      the autoload manageer
    • localize

      public static String localize(String functionName)
    • getInitialSearchPaths

      protected static Collection<String> getInitialSearchPaths()
      Gets the autoload search paths.
      Returns:
      the search paths