ur_rna.StructureEditor.models

## Class DrawSettings

- java.lang.Object
- - ur_rna.StructureEditor.models.DrawSettings

- All Implemented Interfaces:
    java.lang.Cloneable

      public final class DrawSettings
      extends java.lang.Object
      implements java.lang.Cloneable

  Container for settings related to drawing RNA scenes. The fields in this class are saved and loaded along with program settings, but fields marked as transient are NOT saved or loaded.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.awt.Color` | `backboneColor`
    `java.awt.Stroke` | `backboneStroke`
    `float` | `backboneWidth`
    `java.awt.Color` | `bondColor`
    `java.awt.Color` | `bondColorPseudo`
    `float` | `bondLength`
    `java.awt.Stroke` | `bondStroke`
    `java.awt.Stroke` | `bondStrokePseudo`
    `float` | `bondWidth`
    `double` | `circularStartAngle`
    `private NucStyle` | `defaultStyle`
    `boolean` | `drawBackboneCurved`
    `boolean` | `drawBackboneInHelix`
    `boolean` | `drawBackboneInLoops`
    `boolean` | `drawBondsInHelix`
    `boolean` | `drawNumbers`
    `boolean` | `drawNumbersAtHelix`
    `int` | `drawNumbersInterval`
    `java.awt.Stroke` | `editBondStroke`
    `java.awt.Color` | `hint`
    `java.awt.Color` | `hintEmphasis`
    `float` | `loopSpacing` Spacing between nucs in a loop or hairpin.
    `java.awt.Color` | `nucFillColor`
    `java.awt.Color` | `nucFocusColor`
    `java.awt.Font` | `nucFont`
    `java.awt.Color` | `nucHitColor`
    `java.awt.Color` | `nucOutlineColor`
    `java.awt.Stroke` | `nucOutlineSelStroke`
    `java.awt.Stroke` | `nucOutlineStroke`
    `float` | `nucOutlineWidth`
    `float` | `nucRadius`
    `java.awt.Color` | `nucSelColor`
    `float` | `nucSpacing` Spacing between nucs in a helix.
    `java.awt.Color` | `nucTextColor`
    `float` | `numberDistance`
    `java.awt.Font` | `numberFont`
    `java.awt.Color` | `numberLineColor`
    `float` | `numberLineMargin`
    `java.awt.Stroke` | `numberLineStroke`
    `float` | `numberLineWidth`
    `float` | `pseudoBondWidth`
    `java.awt.Color` | `sceneBgColor`
    `java.awt.Color` | `selBandFillColor`
    `java.awt.Color` | `selBandLineColor`
    `java.awt.Stroke` | `selBandOutline`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DrawSettings()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `float` | `calcBondLength()`
    `float` | `calcOptimalLoopDistance(int nucCount, int endSpacers)` Calculate the optimal circumference for a circle containing the given number of nucleotides.
    `float` | `calcOptimalLoopDistance(Nuc n1, Nuc n2, int endSpacers)` Calculate the optimal circumference for a circle containing nucs in the given region.
    `float` | `calcOptimalNuc2NucDistance(int nucCount)`
    `float` | `calcOptimalNuc2NucDistance(Nuc n1, Nuc n2)` Calculate the optimal distance between nuc midpoints.
    `float` | `calcOptimalOuterDistance(int nucCount, int endSpacers)`
    `float` | `calcOptimalOuterDistance(Nuc n1, Nuc n2, int endSpacers)` Calculate the optimal distance from the outside of one nuc to the outside of another.
    `DrawSettings` | `copy()`
    `void` | `fillStyle(Nuc n, NucStyle fillProperties)`
    `NucStyle` | `getStyle(Nuc n)`
    `float` | `nucDiameter()`
    `float` | `nucleotideRadius(Nuc nuc)`
    `void` | `onSettingsChanged()` Call this to update dependent settings whenever settings have been changed.

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

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

- - ### Field Detail

    - #### backboneColor

          public java.awt.Color backboneColor

    - #### backboneStroke

          public transient java.awt.Stroke backboneStroke

    - #### backboneWidth

          public float backboneWidth

    - #### bondColor

          public java.awt.Color bondColor

    - #### bondColorPseudo

          public java.awt.Color bondColorPseudo

    - #### bondLength

          public transient float bondLength

    - #### bondStroke

          public transient java.awt.Stroke bondStroke

    - #### bondStrokePseudo

          public transient java.awt.Stroke bondStrokePseudo

    - #### bondWidth

          public float bondWidth

    - #### circularStartAngle

          public double circularStartAngle

    - #### defaultStyle

          private transient NucStyle defaultStyle

    - #### drawBackboneCurved

          public boolean drawBackboneCurved

    - #### drawBackboneInHelix

          public boolean drawBackboneInHelix

    - #### drawBackboneInLoops

          public boolean drawBackboneInLoops

    - #### drawBondsInHelix

          public boolean drawBondsInHelix

    - #### drawNumbers

          public boolean drawNumbers

    - #### drawNumbersAtHelix

          public boolean drawNumbersAtHelix

    - #### drawNumbersInterval

          public int drawNumbersInterval

    - #### editBondStroke

          public transient java.awt.Stroke editBondStroke

    - #### hint

          public java.awt.Color hint

    - #### hintEmphasis

          public java.awt.Color hintEmphasis

    - #### loopSpacing

          public float loopSpacing

      Spacing between nucs in a loop or hairpin. Does not include radius, which must be added in to calculate full point-to-point distance. See `calcOptimalLoopDistance(Nuc, Nuc, int)` for details.

    - #### nucFillColor

          public java.awt.Color nucFillColor

    - #### nucFocusColor

          public java.awt.Color nucFocusColor

    - #### nucFont

          public java.awt.Font nucFont

    - #### nucHitColor

          public java.awt.Color nucHitColor

    - #### nucOutlineColor

          public java.awt.Color nucOutlineColor

    - #### nucOutlineSelStroke

          public transient java.awt.Stroke nucOutlineSelStroke

    - #### nucOutlineStroke

          public transient java.awt.Stroke nucOutlineStroke

    - #### nucOutlineWidth

          public float nucOutlineWidth

    - #### nucRadius

          public float nucRadius

    - #### nucSelColor

          public java.awt.Color nucSelColor

    - #### nucSpacing

          public float nucSpacing

      Spacing between nucs in a helix. Does not include radius, which must be added in to calculate full point-to-point distance. See `calcOptimalNuc2NucDistance(Nuc, Nuc)` for details.

    - #### nucTextColor

          public java.awt.Color nucTextColor

    - #### numberDistance

          public float numberDistance

    - #### numberFont

          public java.awt.Font numberFont

    - #### numberLineColor

          public java.awt.Color numberLineColor

    - #### numberLineMargin

          public float numberLineMargin

    - #### numberLineStroke

          public transient java.awt.Stroke numberLineStroke

    - #### numberLineWidth

          public float numberLineWidth

    - #### pseudoBondWidth

          public float pseudoBondWidth

    - #### sceneBgColor

          public java.awt.Color sceneBgColor

    - #### selBandFillColor

          public java.awt.Color selBandFillColor

    - #### selBandLineColor

          public java.awt.Color selBandLineColor

    - #### selBandOutline

          public transient java.awt.Stroke selBandOutline

  - ### Constructor Detail

    - #### DrawSettings

          public DrawSettings()

  - ### Method Detail

    - #### calcBondLength

          public float calcBondLength()

    - #### calcOptimalLoopDistance

          public float calcOptimalLoopDistance(int nucCount,
                                               int endSpacers)

      Calculate the optimal circumference for a circle containing the given number of nucleotides.
      Parameters:
        `nucCount` - the number of nucleotides in the circle
        `endSpacers` - the number of spacers required on the outside of the terminal nucs (n1=first and n2=last) 0 means no space before the center of n1 or the after the center of n2 (e.g. the arc-length of a hairpin loop from the center of n1 to the center of n2) 1 means a single spacer (e.g. connecting n1 to n2 in a circle) 2 means a spacer before n1 and after n2 (e.g. a spacer connecting n1 to a previous nuc and another connecting n2 to a subsequent nuc)

    - #### calcOptimalLoopDistance

          public float calcOptimalLoopDistance(Nuc n1,
                                               Nuc n2,
                                               int endSpacers)

      Calculate the optimal circumference for a circle containing nucs in the given region.
      Parameters:
        `n1` - the nucleotide at the start of the region (inclusive)
        `n2` - the nucleotide at the end of the region (inclusive)
        `endSpacers` - the number of spacers required on the outside of the region. 0 means no space before the center of n1 or the after the center of n2 (e.g. the arc-length of a hairpin loop from the center of n1 to the center of n2) 1 means a single spacer (e.g. connecting n1 to n2 in a circle) 2 means a spacer before n1 and after n2 (e.g. a spacer connecting n1 to a previous nuc and another connecting n2 to a subsequent nuc)

    - #### calcOptimalNuc2NucDistance

          public float calcOptimalNuc2NucDistance(int nucCount)

    - #### calcOptimalNuc2NucDistance

          public float calcOptimalNuc2NucDistance(Nuc n1,
                                                  Nuc n2)

      Calculate the optimal distance between nuc midpoints. Does not include any extra space on the outside ends of the nucs. e.g. For 2 adjacent nucs: N1)-(N2 (two radii + 1 spacer) e.g. For 3 consecutive nucs: N1)-(N2)-(N3 (4 radii + 2 spacers) Let N be ABS(n1.index-n2.index), then distance = N*(2*radius+spacer) See `calcOptimalOuterDistance(Nuc, Nuc, int)` for a calculation that includes the end-to-end distance when the outer ends are included.

    - #### calcOptimalOuterDistance

          public float calcOptimalOuterDistance(int nucCount,
                                                int endSpacers)

    - #### calcOptimalOuterDistance

          public float calcOptimalOuterDistance(Nuc n1,
                                                Nuc n2,
                                                int endSpacers)

      Calculate the optimal distance from the outside of one nuc to the outside of another. This always includes the outer radii and can optionally include 0, 1 or 2 outside spacers. e.g. For 2 adjacent nucs, endSpacers==0: (N1)-(N2) (4 radii + 1 total spacer) e.g. For 2 adjacent nucs, endSpacers==1: -(N1)-(N2) (4 radii + 2 total spacers) e.g. For 2 adjacent nucs, endSpacers==2: -(N1)-(N2)- (4 radii + 3 total spacers) e.g. For 3 consecutive nucs, endSpacers==0: (N1)-(N2)-(N3) (6 radii + 2 total spacers) e.g. For 3 consecutive nucs, endSpacers==1: -(N1)-(N2)-(N3) (6 radii + 3 total spacers) e.g. For 3 consecutive nucs, endSpacers==2: -(N1)-(N2)-(N3)- (6 radii + 4 total spacers)

    - #### copy

          public DrawSettings copy()

    - #### fillStyle

          public void fillStyle(Nuc n,
                                NucStyle fillProperties)

    - #### getStyle

          public NucStyle getStyle(Nuc n)

    - #### nucDiameter

          public float nucDiameter()

    - #### nucleotideRadius

          public float nucleotideRadius(Nuc nuc)

    - #### onSettingsChanged

          public void onSettingsChanged()

      Call this to update dependent settings whenever settings have been changed. E.g. bondStroke needs to be re-created whenever bondWidth is changed.