ur_rna.StructureEditor.services.fileIO

## Class DrawingFileIO

- java.lang.Object
- - ur_rna.StructureEditor.services.fileIO.DrawingFileIO

-     public class DrawingFileIO
      extends java.lang.Object

  There are two types of native drawing file formats. CTE "Extended CT File" - Similar to CT, but with additional columns. NSD "Nucleotide Structure Drawing" - Hierarchical Structured Object-based format that stores Nucleotides, Bonds, and Styles in a format that is richer and more extensible than CTE

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static interface` | `DrawingFileIO.CTE` Constants for CTE File IO
    `private static class` | `DrawingFileIO.CTEWriter`
    `private static interface` | `DrawingFileIO.NSD` Constants for Nucleotide Structure Drawing (NSD) File IO
    `private static class` | `DrawingFileIO.SimpleScanner` This replacement for Scanner automatically skips whitespace, but does NOT skip over newlines unless `DrawingFileIO.SimpleScanner.nextLine()` is called.
    `static class` | `DrawingFileIO.TextWriter` Simplifies writing tabular text data in which the table formatting is achieved by padding values with spaces.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.text.DecimalFormat` | `_dblFormat`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DrawingFileIO()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private static java.awt.Color` | `decodeColor(java.lang.Object oColor, java.awt.Color defaultValue)`
    `private static java.awt.Font` | `decodeFont(java.lang.Object oFont, java.awt.Font defaultValue)`
    `private static SimpleDataSerializer.SSONList` | `expectList(java.lang.Object o, java.lang.String errorMessage)`
    `private static SimpleDataSerializer.SSONMap` | `expectMap(java.lang.Object o, java.lang.String errorMessage)`
    `private static java.lang.String` | `fmtNumber(double value)`
    `private static java.io.Writer` | `newUTF8Writer(java.lang.String path, boolean append)` Simplified version of `Files.newBufferedWriter(Path, Charset, OpenOption...)` that uses `StandardCharsets.UTF_8` as the charset and accepts a boolean "append" instead of an `OpenOption` argument list.
    `private static SyntaxErrorException` | `parseError(DrawingFileIO.SimpleScanner scanner, java.lang.String message, java.lang.Object... args)`
    `private static SyntaxErrorException` | `parseError(int line, int column, java.lang.String message, java.lang.Object... args)`
    `static RnaSceneGroup` | `readCteDrawingFile(java.io.Reader input)`
    `static RnaSceneGroup` | `readCteDrawingFile(java.lang.String path)`
    `private static RnaSceneGroup` | `readNsdDrawingFile(java.lang.Object parsedNSDData)`
    `static RnaSceneGroup` | `readNsdDrawingFile(java.io.Reader input)`
    `static RnaSceneGroup` | `readNsdDrawingFile(java.lang.String path)`
    `private static float` | `roundLoc(float value)` round locations to the nearest 0.1
    `static void` | `writeCteDrawingFile(RnaSceneGroup scenes, java.lang.String path, boolean append)` Write an Extended CT (CTE) Drawing files.
    `static void` | `writeCteDrawingFile(RnaSceneGroup scenes, java.io.Writer output, boolean includeExtendedProperties)` Write an Extended CT (CTE) Drawing files.
    `static void` | `writeCtFile(RnaSceneGroup scenes, java.lang.String path, boolean append)`
    `static void` | `writeNsdDrawingFile(RnaSceneGroup scenes, java.lang.String path, boolean append)`
    `static void` | `writeNsdDrawingFile(RnaSceneGroup scenes, java.lang.String path, boolean append, int indent, boolean strict)`
    `static void` | `writeNsdDrawingFile(RnaSceneGroup scenes, java.io.Writer out, int indent, boolean strict)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _dblFormat

          private static final java.text.DecimalFormat _dblFormat

  - ### Constructor Detail

    - #### DrawingFileIO

          public DrawingFileIO()

  - ### Method Detail

    - #### decodeColor

          private static java.awt.Color decodeColor(java.lang.Object oColor,
                                                    java.awt.Color defaultValue)

    - #### decodeFont

          private static java.awt.Font decodeFont(java.lang.Object oFont,
                                                  java.awt.Font defaultValue)

    - #### expectList

          private static SimpleDataSerializer.SSONList expectList(java.lang.Object o,
                                                                  java.lang.String errorMessage)

    - #### expectMap

          private static SimpleDataSerializer.SSONMap expectMap(java.lang.Object o,
                                                                java.lang.String errorMessage)

    - #### fmtNumber

          private static java.lang.String fmtNumber(double value)

    - #### newUTF8Writer

          private static java.io.Writer newUTF8Writer(java.lang.String path,
                                                      boolean append)
                                               throws java.io.IOException

      Simplified version of `Files.newBufferedWriter(Path, Charset, OpenOption...)` that uses `StandardCharsets.UTF_8` as the charset and accepts a boolean "append" instead of an `OpenOption` argument list.
      Throws:
        `java.io.IOException`

    - #### parseError

          private static SyntaxErrorException parseError(DrawingFileIO.SimpleScanner scanner,
                                                         java.lang.String message,
                                                         java.lang.Object... args)

    - #### parseError

          private static SyntaxErrorException parseError(int line,
                                                         int column,
                                                         java.lang.String message,
                                                         java.lang.Object... args)

    - #### readCteDrawingFile

          public static RnaSceneGroup readCteDrawingFile(java.io.Reader input)
                                                  throws SyntaxErrorException

      Throws:
        `SyntaxErrorException`

    - #### readCteDrawingFile

          public static RnaSceneGroup readCteDrawingFile(java.lang.String path)
                                                  throws java.io.IOException,
                                                         SyntaxErrorException

      Throws:
        `java.io.IOException`
        `SyntaxErrorException`

    - #### readNsdDrawingFile

          private static RnaSceneGroup readNsdDrawingFile(java.lang.Object parsedNSDData)
                                                   throws SyntaxErrorException

      Throws:
        `SyntaxErrorException`

    - #### readNsdDrawingFile

          public static RnaSceneGroup readNsdDrawingFile(java.io.Reader input)
                                                  throws SyntaxErrorException,
                                                         java.io.IOException

      Throws:
        `SyntaxErrorException`
        `java.io.IOException`

    - #### readNsdDrawingFile

          public static RnaSceneGroup readNsdDrawingFile(java.lang.String path)
                                                  throws SyntaxErrorException,
                                                         java.io.IOException

      Throws:
        `SyntaxErrorException`
        `java.io.IOException`

    - #### roundLoc

          private static float roundLoc(float value)

      round locations to the nearest 0.1

    - #### writeCteDrawingFile

          public static void writeCteDrawingFile(RnaSceneGroup scenes,
                                                 java.lang.String path,
                                                 boolean append)
                                          throws java.io.IOException

      Write an Extended CT (CTE) Drawing files. A CTE is a CT file with additional information encoded in the columns past those in a normal CT.
      Throws:
        `java.io.IOException`

    - #### writeCteDrawingFile

          public static void writeCteDrawingFile(RnaSceneGroup scenes,
                                                 java.io.Writer output,
                                                 boolean includeExtendedProperties)

      Write an Extended CT (CTE) Drawing files. A CTE is a CT file with additional information encoded in the columns past those in a normal CT.

    - #### writeCtFile

          public static void writeCtFile(RnaSceneGroup scenes,
                                         java.lang.String path,
                                         boolean append)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeNsdDrawingFile

          public static void writeNsdDrawingFile(RnaSceneGroup scenes,
                                                 java.lang.String path,
                                                 boolean append)
                                          throws java.io.IOException,
                                                 FormatterException

      Throws:
        `java.io.IOException`
        `FormatterException`

    - #### writeNsdDrawingFile

          public static void writeNsdDrawingFile(RnaSceneGroup scenes,
                                                 java.lang.String path,
                                                 boolean append,
                                                 int indent,
                                                 boolean strict)
                                          throws java.io.IOException,
                                                 FormatterException

      Throws:
        `java.io.IOException`
        `FormatterException`

    - #### writeNsdDrawingFile

          public static void writeNsdDrawingFile(RnaSceneGroup scenes,
                                                 java.io.Writer out,
                                                 int indent,
                                                 boolean strict)
                                          throws java.io.IOException,
                                                 FormatterException

      Throws:
        `java.io.IOException`
        `FormatterException`