Package dialog

Class FormatDialog

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

public class FormatDialog extends JDialog
Convenience class for a data format dialog box.
Since:
2007.02.09
See Also:
  • Field Details

    • WEIGHT

      public static final int WEIGHT
      mode: show check box for tuple weight
      See Also:
    • NULLCHS

      public static final int NULLCHS
      mode: show null value characters input
      See Also:
    • NONULLS

      public static final int NONULLS
      mode: show message about null values
      See Also:
    • TAWGT

      public static final int TAWGT
      mode: show check box for transaction weight
      See Also:
    • TRAIN

      public static final int TRAIN
      mode: show combo box for train record contents
      See Also:
    • ALL

      public static final int ALL
      mode: show all optional fields
      See Also:
  • Constructor Details

    • FormatDialog

      public FormatDialog()
      Create a data format dialog.
      Since:
      2007.02.09 (Christian Borgelt)
    • FormatDialog

      public FormatDialog(Frame owner)
      Create a data format dialog.
      Parameters:
      owner - the component that is to own the dialog box
      Since:
      2007.02.09 (Christian Borgelt)
    • FormatDialog

      public FormatDialog(Frame owner, String title)
      Create a data format dialog.
      Parameters:
      owner - the component that is to own the dialog box
      title - the title of the dialog box
      Since:
      2007.02.09 (Christian Borgelt)
    • FormatDialog

      public FormatDialog(Frame owner, String title, int mode)
      Create a data format dialog.
      Parameters:
      owner - the component that is to own the dialog box
      title - the title of the dialog box
      mode - the mode (additional input selector)
      Since:
      2007.02.09 (Christian Borgelt)
  • Method Details

    • addActionListener

      public void addActionListener(ActionListener listener)
      Add an action listener for pressing the 'ok' button.
      Parameters:
      listener - the listener to add
      Since:
      2007.07.24 (Christian Borgelt)
    • getPanel

      public FormatPanel getPanel()
      Get the data format panel.
      Returns:
      the data format panel
      Since:
      2007.07.24 (Christian Borgelt)
    • getRecSeps

      public String getRecSeps()
      Get the record separators.
      Returns:
      the record separators
      Since:
      2007.05.17 (Christian Borgelt)
    • setRecSeps

      public void setRecSeps(String s)
      Set the record separators.
      Parameters:
      s - the record separators
      Since:
      2007.05.21 (Christian Borgelt)
    • getFldSeps

      public String getFldSeps()
      Get the field separators.
      Returns:
      the field separators
      Since:
      2007.05.17 (Christian Borgelt)
    • setFldSeps

      public void setFldSeps(String s)
      Set the field separators.
      Parameters:
      s - the field separators
      Since:
      2007.05.21 (Christian Borgelt)
    • getBlanks

      public String getBlanks()
      Get the blank characters.
      Returns:
      the blank characters
      Since:
      2007.05.17 (Christian Borgelt)
    • setBlanks

      public void setBlanks(String s)
      Set the blank characters.
      Parameters:
      s - the blank characters
      Since:
      2007.05.21 (Christian Borgelt)
    • getNullChars

      public String getNullChars()
      Get the null value characters.
      Returns:
      the null value characters
      Since:
      2007.05.17 (Christian Borgelt)
    • setNullChars

      public void setNullChars(String s)
      Set the null value characters.
      Parameters:
      s - the null value characters
      Since:
      2007.05.21 (Christian Borgelt)
    • getComment

      public String getComment()
      Get the comment characters.
      Returns:
      the comment characters
      Since:
      2007.05.17 (Christian Borgelt)
    • setComment

      public void setComment(String s)
      Set the comment characters.
      Parameters:
      s - the comment characters
      Since:
      2007.05.21 (Christian Borgelt)
    • getTableMode

      public int getTableMode()
      Get the read/write mode for tables.

      In the returned value the flags Table.NOHEADER and/or Table.WEIGHT may be set, depending on the selection in the dialog panel.

      Returns:
      the read/write mode with Table flags
      Since:
      2011.08.01 (Christian Borgelt)
    • getTrainMode

      public int getTrainMode()
      Get the record contents mode for trains.
      Returns:
      the record contents mode
      Since:
      2013.11.29 (Christian Borgelt)
    • getMode

      public int getMode()
      Get the read/write 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 box.

      Returns:
      the read mode
      Since:
      2007.02.09 (Christian Borgelt)
    • setMode

      public void setMode(int mode)
      Set the read/write mode.
      Parameters:
      mode - the read mode to set
      Since:
      2007.02.09 (Christian Borgelt)
    • createReader

      public util.TableReader createReader(File file) throws IOException
      Create a table reader configured for the current format.
      Parameters:
      file - the file to create the reader for
      Returns:
      the created table reader
      Throws:
      IOException - if a read error occurs
      Since:
      2007.06.07 (Christian Borgelt)
    • createReader

      public util.TableReader createReader(Reader reader)
      Create a table reader configured for the current format.
      Parameters:
      reader - the reader to create the reader from
      Returns:
      the created table reader
      Since:
      2007.05.08 (Christian Borgelt)
    • createWriter

      public util.TableWriter createWriter(File file) throws IOException
      Create a table writer configured for the current format.
      Parameters:
      file - the file to create the table writer for
      Returns:
      the created table writer
      Throws:
      IOException - if a write error occurs
      Since:
      2007.06.07 (Christian Borgelt)
    • createWriter

      public util.TableWriter createWriter(Writer writer)
      Create a table writer configured for the current format.
      Parameters:
      writer - the writer to create the table writer from
      Returns:
      the created table writer
      Since:
      2007.05.20 (Christian Borgelt)
    • addFormatArgs

      public int addFormatArgs(String[] cmd)
      Add format arguments to a command array.
      Parameters:
      cmd - the command array to add to
      Returns:
      the number of arguments (assumed to be 1 before)
      Since:
      2007.02.16 (Christian Borgelt)
    • addFormatArgs

      public int addFormatArgs(String[] cmd, int mode)
      Add format arguments to a command array.
      Parameters:
      cmd - the command array to add to
      mode - the mode (whether to add null value characters etc.)
      Returns:
      the number of arguments (assumed to be 1 before)
      Since:
      2007.02.16 (Christian Borgelt)