Package table

Class DomainsEditor

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Runnable, Accessible, RootPaneContainer, WindowConstants

public class DomainsEditor extends JFrame implements Runnable
Class for a domain editor.
Since:
2007.06.07
See Also:
  • Field Details

  • Constructor Details

    • DomainsEditor

      public DomainsEditor(int mode)
      Create a domain editor.
      Parameters:
      mode - the mode flags
      Since:
      2007.06.07 (Christian Borgelt)
    • DomainsEditor

      public DomainsEditor(Component owner, int mode)
      Create a domain editor.
      Parameters:
      owner - the component that is to own this viewer
      mode - the mode flags
      Since:
      2004.05.10 (Christian Borgelt)
  • Method Details

    • addTypeEditor

      public static boolean addTypeEditor(String name, Class<?> cls)
      Add a type editor, that is, register it.
      Parameters:
      name - the name of the type to edit
      cls - the class of the type to edit
      Returns:
      whether the type was registered
      Since:
      2007.07.17 (Christian Borgelt)
    • getTypeEditor

      public static TypeEditor getTypeEditor(ColType type)
      Get a type editor.
      Parameters:
      type - the type for which to get an editor
      Returns:
      the editor for the given type
      Since:
      2007.07.17 (Christian Borgelt)
    • getTypeEditor

      public static TypeEditor getTypeEditor(String name)
      Get a type editor.
      Parameters:
      name - the name of the type
      Returns:
      the editor for the given type name
      Since:
      2007.07.17 (Christian Borgelt)
    • run

      public void run()
      Create the user interface.

      Following the recommendations in the Java tutorial, the user interface is created in the "run" method, which is invoked from the event queue, in order to avoid problems with threads.

      Specified by:
      run in interface Runnable
      Since:
      2006.07.20 (Christian Borgelt)
    • setMessage

      public void setMessage(String msg)
      Set the message to display in the status line.
      Parameters:
      msg - the message to display in the status line
      Since:
      2007.06.07 (Christian Borgelt)
    • setAtt

      public void setAtt(int id)
      Set the attribute to edit.
      Parameters:
      id - the identifier of the attribute to edit
      Since:
      2007.07.21 (Christian Borgelt)
    • setDomains

      public void setDomains(Table atts)
      Set the attribute domains to edit.
      Parameters:
      atts - the attribute domains to edit as a table
      Since:
      2007.06.07 (Christian Borgelt)
    • getDomains

      public Table getDomains()
      Get the edited attribute domains.
      Returns:
      the edited attribute domains as a table
      Since:
      2007.06.07 (Christian Borgelt)
    • loadDomains

      public boolean loadDomains(File file)
      Load the attribute domains to edit.
      Parameters:
      file - the file to load the domains from
      Returns:
      whether the file was successfully loaded
      Since:
      2005.05.10 (Christian Borgelt)
    • saveDomains

      public boolean saveDomains(File file)
      Save the displayed attribute domains.
      Parameters:
      file - the file to save the domains to
      Returns:
      whether the file was successfully written
      Since:
      2005.05.10 (Christian Borgelt)
    • main

      public static void main(String[] args)
      Main function for testing basic functionality.
      Parameters:
      args - the command line arguments
      Since:
      2007.06.07 (Christian Borgelt)