ur_rna.StructureEditor.services.drawing

## Class LoopResizer

- java.lang.Object
- - ur_rna.StructureEditor.services.drawing.DrawHandle
  - - ur_rna.StructureEditor.services.drawing.LoopResizer

-     public class LoopResizer
      extends DrawHandle

  A DrawHandle that allows a user to resize an RNA Loop (a single stranded region) in a uniform way.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.awt.geom.Point2D.Float` | `_ptModel`
    `private java.awt.image.BufferedImage[]` | `directionalIcons`
    `private Vec2D` | `handleOffsetDir`
    `private Motif.Loop` | `loop`
    `private Motif.MultiLoop` | `multiLoop`
    `private static double` | `radToDeg`
    `private static SceneUpdateInfo` | `ResizeLoop`
    `private java.awt.image.BufferedImage` | `resizeMultiLoopIcon`
    `private java.awt.image.BufferedImage` | `resizeSegmentIcon`
    `private Motif.Loop.LoopType` | `type`

    - ### Fields inherited from class ur_rna.StructureEditor.services.drawing.DrawHandle

      `_tmpPt, _tmpTr, allNucs, boxSize, cachedBounds, controller, customCursor, defaultBgColor, defaultLineColor, defaultOutline, icon, location, SNAP_DISTANCE, startLocation, targetNuc, view`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoopResizer(SceneController controller)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `calculateOffset()`
    `private void` | `createDirectionalIcons(java.awt.image.BufferedImage northIcon)`
    `void` | `dragComplete(boolean success)` Called when the user has completed dragging (e.g.
    `static void` | `expandMultiLoop(SceneController ctrl, Motif.MultiLoop mloop, java.awt.geom.Point2D.Float ptFrom, java.awt.geom.Point2D.Float ptDest, Ellipses.Circle loopCircle, SceneController.DragOpts options)`
    `private static void` | `expandPointAboutCenter(Vec2D ray, java.awt.geom.Point2D pt, java.awt.geom.Point2D oldCenter, java.awt.geom.Point2D newCenter, double dR)`
    `private double` | `getChordHeight(double arcLength, double chordLength, double radius)`
    `SceneUpdateInfo` | `getCompletionEvent()`
    `private java.awt.image.BufferedImage` | `getDirectionalIcon(double screenAngle)`
    `boolean` | `isValid()`
    `protected void` | `nucPositionsChanged()` Called when any nucleotides in the scene changed position, EXCEPT when THIS DrawHandle is in the middle of a performDrag operation (because any nucleotide changes then are likely due to its own drag operation).
    `protected void` | `performDrag(java.awt.Point start, java.awt.Point prev, java.awt.Point current, SceneController.DragOpts options)` Called when this handle has been dragged by the user.
    `(package private) void` | `positionLinear(Nuc nStart, Nuc nEnd, boolean boldHint)`
    `(package private) void` | `positionLinear(Nuc nStart, Nuc nEnd, java.awt.geom.Point2D p1, java.awt.geom.Point2D p2, boolean gapAtStart, boolean gapAtEnd, boolean boldHint)`
    `private void` | `positionLoopBetweenHelices(java.awt.geom.Point2D.Float ptNew, Nuc nBase1, Nuc nBase2, boolean enableSnap)`
    `private void` | `positionNucs(java.awt.geom.Point2D.Float newPos, SceneController.DragOpts options)`
    `private void` | `positionTerminalEndPoint(java.awt.geom.Point2D.Float ptNew, Nuc nMoved, Nuc nFixed, int dir, boolean enableSnap)`
    `private void` | `positionTerminalLoop(java.awt.geom.Point2D.Float ptNew, Nuc nStart, Nuc nEnd, boolean enableSnap)`
    `protected void` | `prepareDraw(boolean isDragging)`
    `protected void` | `selectionChanged()`

    - ### Methods inherited from class ur_rna.StructureEditor.services.drawing.DrawHandle

      `calcBoxPos, drag, dragStarted, draw, drawBox, getBounds, getBoxSize, getModelSpaceDeltaTransform, isEnabled, isUpdating, layoutUpdated, moveLocation, setBoxSize, setEnabled, setIcon, setSelection, settingsChanged`

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

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

- - ### Field Detail

    - #### _ptModel

          private java.awt.geom.Point2D.Float _ptModel

    - #### directionalIcons

          private java.awt.image.BufferedImage[] directionalIcons

    - #### handleOffsetDir

          private Vec2D handleOffsetDir

    - #### loop

          private Motif.Loop loop

    - #### multiLoop

          private Motif.MultiLoop multiLoop

    - #### radToDeg

          private static double radToDeg

    - #### ResizeLoop

          private static final SceneUpdateInfo ResizeLoop

    - #### resizeMultiLoopIcon

          private java.awt.image.BufferedImage resizeMultiLoopIcon

    - #### resizeSegmentIcon

          private java.awt.image.BufferedImage resizeSegmentIcon

    - #### type

          private Motif.Loop.LoopType type

  - ### Constructor Detail

    - #### LoopResizer

          public LoopResizer(SceneController controller)

  - ### Method Detail

    - #### calculateOffset

          private void calculateOffset()

    - #### createDirectionalIcons

          private void createDirectionalIcons(java.awt.image.BufferedImage northIcon)

    - #### dragComplete

          public void dragComplete(boolean success)

      Description copied from class: `DrawHandle`
      Called when the user has completed dragging (e.g. on mouse-button-release.) It is appropriate to add an undo event.
      Overrides:
        `dragComplete` in class `DrawHandle`
      Parameters:
        `success` - Whether the action was successful (and therefore should be stored in the UNDO history).

    - #### expandMultiLoop

          public static void expandMultiLoop(SceneController ctrl,
                                             Motif.MultiLoop mloop,
                                             java.awt.geom.Point2D.Float ptFrom,
                                             java.awt.geom.Point2D.Float ptDest,
                                             @Nullable
                                             Ellipses.Circle loopCircle,
                                             SceneController.DragOpts options)

    - #### expandPointAboutCenter

          private static void expandPointAboutCenter(Vec2D ray,
                                                     java.awt.geom.Point2D pt,
                                                     java.awt.geom.Point2D oldCenter,
                                                     java.awt.geom.Point2D newCenter,
                                                     double dR)

    - #### getChordHeight

          private double getChordHeight(double arcLength,
                                        double chordLength,
                                        double radius)

    - #### getCompletionEvent

          public SceneUpdateInfo getCompletionEvent()

      Specified by:
        `getCompletionEvent` in class `DrawHandle`

    - #### getDirectionalIcon

          private java.awt.image.BufferedImage getDirectionalIcon(double screenAngle)

    - #### isValid

          public boolean isValid()

      Specified by:
        `isValid` in class `DrawHandle`

    - #### nucPositionsChanged

          protected void nucPositionsChanged()

      Description copied from class: `DrawHandle`
      Called when any nucleotides in the scene changed position, EXCEPT when THIS DrawHandle is in the middle of a performDrag operation (because any nucleotide changes then are likely due to its own drag operation).
      Specified by:
        `nucPositionsChanged` in class `DrawHandle`

    - #### performDrag

          protected void performDrag(java.awt.Point start,
                                     java.awt.Point prev,
                                     java.awt.Point current,
                                     SceneController.DragOpts options)

      Called when this handle has been dragged by the user.
      Specified by:
        `performDrag` in class `DrawHandle`

    - #### positionLinear

          void positionLinear(Nuc nStart,
                              Nuc nEnd,
                              boolean boldHint)

    - #### positionLinear

          void positionLinear(Nuc nStart,
                              Nuc nEnd,
                              java.awt.geom.Point2D p1,
                              java.awt.geom.Point2D p2,
                              boolean gapAtStart,
                              boolean gapAtEnd,
                              boolean boldHint)

    - #### positionLoopBetweenHelices

          private void positionLoopBetweenHelices(java.awt.geom.Point2D.Float ptNew,
                                                  Nuc nBase1,
                                                  Nuc nBase2,
                                                  boolean enableSnap)

    - #### positionNucs

          private void positionNucs(java.awt.geom.Point2D.Float newPos,
                                    SceneController.DragOpts options)

    - #### positionTerminalEndPoint

          private void positionTerminalEndPoint(java.awt.geom.Point2D.Float ptNew,
                                                Nuc nMoved,
                                                Nuc nFixed,
                                                int dir,
                                                boolean enableSnap)

    - #### positionTerminalLoop

          private void positionTerminalLoop(java.awt.geom.Point2D.Float ptNew,
                                            Nuc nStart,
                                            Nuc nEnd,
                                            boolean enableSnap)

    - #### prepareDraw

          protected void prepareDraw(boolean isDragging)

      Specified by:
        `prepareDraw` in class `DrawHandle`

    - #### selectionChanged

          protected void selectionChanged()

      Specified by:
        `selectionChanged` in class `DrawHandle`