Package table

Class TableView

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

public class TableView extends JFrame implements Runnable
Class for a simple table viewer.
Since:
2007.02.09
See Also:
  • Field Details

    • VERSION

      public static final String VERSION
      the version string
      See Also:
    • PROGRAM

      public static final int PROGRAM
      mode flag: the table viewer is a stand-alone program
      See Also:
    • LOAD_ITEMS

      public static final int LOAD_ITEMS
      mode flag: add menu items for loading tables
      See Also:
    • SAVE_ITEMS

      public static final int SAVE_ITEMS
      mode flag: add menu items for saving tables
      See Also:
    • FILE_ITEMS

      public static final int FILE_ITEMS
      mode flag: add menu items for loading and saving tables
      See Also:
    • VIEW_ITEMS

      public static final int VIEW_ITEMS
      mode flag: add menu items for visualization
      See Also:
    • ALL_ITEMS

      public static final int ALL_ITEMS
      mode flag: all optional menu items
      See Also:
  • Constructor Details

    • TableView

      public TableView(int mode)
      Create a simple table viewer.
      Parameters:
      mode - the mode flags
      Since:
      2007.02.09 (Christian Borgelt)
    • TableView

      public TableView(Component owner, int mode)
      Create a simple table viewer.
      Parameters:
      owner - the component that is to own this table viewer
      mode - the mode flags
      Since:
      2007.02.09 (Christian Borgelt)
  • Method Details

    • 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:
      2007.02.09 (Christian Borgelt)
    • getFormatDialog

      public dialog.FormatDialog getFormatDialog()
      Get the data format dialog (create if necessary).
      Returns:
      the data format dialog
      Since:
      2007.02.12 (Christian Borgelt)
    • getFormatPanel

      public dialog.FormatPanel getFormatPanel()
      Get the data format panel.
      Returns:
      the data format panel
      Since:
      2007.07.24 (Christian Borgelt)
    • setFormat

      public void setFormat(dialog.FormatPanel fmt)
      Set the data format.
      Parameters:
      fmt - the data format panel from which to copy the format
      Since:
      2007.07.26 (Christian Borgelt)
    • getMode

      public int getMode()
      Get the read mode.

      In the returned value the flags FormatPanel.HEADER and/or FormatPanel.WEIGHT (or FormatPanel.TAWGT) may be set, depending on the selection in the dialog panel.

      Returns:
      the read/write mode
      Since:
      2012.12.13 (Christian Borgelt)
    • setMode

      public void setMode(int mode)
      Set the read mode.
      Parameters:
      mode - the read mode to set
      Since:
      2012.12.13 (Christian Borgelt)
    • setMessage

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

      public void setTable(Table tab)
      Set the table to display.
      Parameters:
      tab - the table to display
      Since:
      2004.06.02 (Christian Borgelt)
    • getTable

      public Table getTable()
      Get the currently displayed table.
      Returns:
      the currently displayed table
      Since:
      2007.02.12 (Christian Borgelt)
    • loadTable

      public boolean loadTable(File file)
      Load the table to display.
      Parameters:
      file - the file to load the table from
      Returns:
      whether the file was successfully loaded
      Since:
      2007.02.07 (Christian Borgelt)
    • saveTable

      public boolean saveTable(File file)
      Save the displayed table.
      Parameters:
      file - the file to save the table to
      Returns:
      whether the file was successfully saved
      Since:
      2007.02.07 (Christian Borgelt)
    • saveDomains

      public boolean saveDomains(File file)
      Save domain descriptions of the displayed table.
      Parameters:
      file - the file to save the domain descriptions to
      Returns:
      whether the file was successfully saved
      Since:
      2007.05.02 (Christian Borgelt)
    • main

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