Package dialog

Class FormatPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FormatPanel extends DialogPanel
Class for a data format panel for graphical user interfaces.
Since:
2007.02.11
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:
    • recseps

      protected JTextField recseps
      the record separators
    • fldseps

      protected JTextField fldseps
      the field separators
    • blanks

      protected JTextField blanks
      the blank characters
    • nullchs

      protected JTextField nullchs
      the null value characters
    • comment

      protected JTextField comment
      the comment characters
    • weight

      protected JCheckBox weight
      whether the last column contains tuple weights
    • tawgt

      protected JCheckBox tawgt
      whether the last column contains transaction weights
    • recfmt

      protected JComboBox<String> recfmt
      the format of each input record
  • Constructor Details

    • FormatPanel

      public FormatPanel()
      Create a data format panel.
      Since:
      2007.02.11 (Christian Borgelt)
    • FormatPanel

      public FormatPanel(int mode)
      Create a data format panel.
      Parameters:
      mode - the mode (additional input selector)
      Since:
      2007.02.24 (Christian Borgelt)
  • Method Details

    • 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)
    • getMode

      public int getMode()
      Get the read/write mode.

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

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

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

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

      In the returned value the flags Table.HEADER 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)
    • copyFrom

      public void copyFrom(FormatPanel fmt)
      Copy settings from another data format panel.
      Parameters:
      fmt - the data format panel to copy from
      Since:
      2007.07.24 (Christian Borgelt)
    • copyTo

      public void copyTo(FormatPanel fmt)
      Copy settings to another data format panel.
      Parameters:
      fmt - the data format panel to copy to
      Since:
      2007.07.24 (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)
    • loadConfig

      public void loadConfig(FileReader reader) throws IOException
      Load format arguments from a configuration file.
      Parameters:
      reader - file reader to read from
      Throws:
      IOException - if a read error occurs
      Since:
      2013.11.26 (Christian Borgelt)
    • saveConfig

      public void saveConfig(FileWriter writer) throws IOException
      Save format arguments to a configuration file.
      Parameters:
      writer - file writer to write to
      Throws:
      IOException - if a write error occurs
      Since:
      2013.11.26 (Christian Borgelt)