ur_rna.StructureEditor.windows

## Class NewFileWindow

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - javax.swing.JComponent
      - - javax.swing.JInternalFrame
        - - ur_rna.Utilities.swing.MdiChildFrame
          - - ur_rna.StructureEditor.windows.ChildFrame
            - - ur_rna.StructureEditor.windows.NewFileWindow

- All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

      public class NewFileWindow
      extends ChildFrame

  Displays a dialog that allows a user to enter a sequence and structure information for a new drawing.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private static class` | `NewFileWindow.IgnoreStylesUndoManager`
    `private static class` | `NewFileWindow.JWrapTextPane`
    `private static class` | `NewFileWindow.StructItem`

    - ### Nested classes/interfaces inherited from class javax.swing.JInternalFrame

      `javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon`

    - ### Nested classes/interfaces inherited from class javax.swing.JComponent

      `javax.swing.JComponent.AccessibleJComponent`

    - ### Nested classes/interfaces inherited from class java.awt.Container

      `java.awt.Container.AccessibleAWTContainer`

    - ### Nested classes/interfaces inherited from class java.awt.Component

      `java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private javax.swing.JTextPane` | `_lastActivePane`
    `private static int[]` | `_textRegions`
    `private static char[]` | `bracketChars`
    `private javax.swing.JButton` | `btnCancel`
    `private javax.swing.JButton` | `btnOK`
    `private javax.swing.JButton` | `btnSequenceHelp`
    `private javax.swing.JButton` | `btnStructureHelp`
    `private javax.swing.JCheckBox` | `chkWrapSequence`
    `private javax.swing.JCheckBox` | `chkWrapStructure`
    `private java.awt.Font` | `defaultFont`
    `private javax.swing.text.StyledDocument` | `docSeq`
    `private javax.swing.text.StyledDocument` | `docStr`
    `private TextDocListener` | `docUpdateListener`
    `private static java.util.regex.Pattern` | `helixH3`
    `private static java.util.regex.Pattern` | `helixInvalid`
    `private static java.util.regex.Pattern` | `helixPair`
    `private static java.util.regex.Pattern[]` | `helixParsePatterns`
    `private static java.util.regex.Pattern` | `helixSep`
    `private javax.swing.JLabel` | `lblLocation`
    `private javax.swing.JPanel` | `pnlMain`
    `private int[]` | `revSeqLookup`
    `private int` | `selectedBase`
    `private int` | `selectedHelixLen`
    `private int` | `selectedPair`
    `private NewFileWindow.StructItem` | `selectedStructItem`
    `private int` | `seqLen`
    `private int[]` | `seqLookup`
    `private java.lang.String` | `seqText`
    `private java.lang.String` | `strText`
    `private java.util.ArrayList<NewFileWindow.StructItem>` | `structure`
    `private javax.swing.text.Style` | `styleSeqDefault`
    `private javax.swing.text.Style` | `styleSeqPaired`
    `private javax.swing.text.Style` | `styleStrDefault`
    `private javax.swing.text.Style` | `styleStrInvalid`
    `private javax.swing.text.Style` | `styleStrSel`
    `private javax.swing.Timer` | `tmrUpdate`
    `private javax.swing.JTextPane` | `txtDebug`
    `private javax.swing.JTextPane` | `txtSequence`
    `private javax.swing.JTextPane` | `txtStructure`
    `private javax.swing.JTextField` | `txtTitle`
    `private javax.swing.undo.UndoManager` | `undoSeq`
    `private javax.swing.undo.UndoManager` | `undoStr`

    - ### Fields inherited from class javax.swing.JInternalFrame

      `closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY`

    - ### Fields inherited from class javax.swing.JComponent

      `listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

    - ### Fields inherited from class java.awt.Component

      `accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

    - ### Fields inherited from interface javax.swing.WindowConstants

      `DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE`

    - ### Fields inherited from interface java.awt.image.ImageObserver

      `ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NewFileWindow()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.swing.JComponent` | `$$$getRootComponent$$$()`
    `private void` | `$$$setupUI$$$()` Method generated by IntelliJ IDEA GUI Designer DO NOT edit this method OR call it in your code!
    `void` | `actionPerformed(java.awt.event.ActionEvent e)`
    `private void` | `applyStyleToStructure(NewFileWindow.StructItem si, javax.swing.text.Style style)`
    `private int` | `bounded(int value, int min, int max)`
    `private boolean` | `checkErrors()`
    `private boolean` | `createDrawing()`
    `private javax.swing.text.StyleContext` | `createStyleContext()`
    `private void` | `createUIComponents()`
    `private void` | `doRedo(java.awt.event.ActionEvent event)`
    `private void` | `doUndo(java.awt.event.ActionEvent event)`
    `javax.swing.undo.UndoManager` | `getActiveUndoManager()`
    `private void` | `handleTextSelection(javax.swing.JTextPane txt)`
    `private boolean` | `isDotBracket(java.lang.String text)`
    `private boolean` | `isStructureError(NewFileWindow.StructItem h)`
    `private void` | `itemSelected(java.awt.event.ItemEvent e)`
    `private void` | `parseSequence(java.lang.String text)`
    `private void` | `parseStructure(java.lang.String text)`
    `private void` | `restyleSequence()`
    `private void` | `restyleStructure()`
    `private void` | `setCharStyle(javax.swing.text.StyledDocument doc, int offset, int len, javax.swing.text.Style s)`
    `private void` | `showDebug()`
    `private void` | `textCaretEvent(javax.swing.event.CaretEvent e)`
    `private static int` | `toInt(java.lang.String s)`
    `private static int` | `toInt(java.lang.String s, int valueIfEmpty)`
    `private void` | `updateTextUI()`
    `private void` | `updateTimerElapsed(java.awt.event.ActionEvent event)`

    - ### Methods inherited from class ur_rna.StructureEditor.windows.ChildFrame

      `close, getMenus, getToolbarButtons, programSettingsUpdated`

    - ### Methods inherited from class ur_rna.Utilities.swing.MdiChildFrame

      `addAction, addKeyBinding, addKeyBinding, getParentFrame, setParentFrame`

    - ### Methods inherited from class javax.swing.JInternalFrame

      `addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, updateUI`

    - ### Methods inherited from class javax.swing.JComponent

      `addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

    - ### Methods inherited from class java.awt.Container

      `add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree`

    - ### Methods inherited from class java.awt.Component

      `action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle`

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

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

- - ### Field Detail

    - #### _lastActivePane

          private javax.swing.JTextPane _lastActivePane

    - #### _textRegions

          private static int[] _textRegions

    - #### bracketChars

          private static final char[] bracketChars

    - #### btnCancel

          private javax.swing.JButton btnCancel

    - #### btnOK

          private javax.swing.JButton btnOK

    - #### btnSequenceHelp

          private javax.swing.JButton btnSequenceHelp

    - #### btnStructureHelp

          private javax.swing.JButton btnStructureHelp

    - #### chkWrapSequence

          private javax.swing.JCheckBox chkWrapSequence

    - #### chkWrapStructure

          private javax.swing.JCheckBox chkWrapStructure

    - #### defaultFont

          private java.awt.Font defaultFont

    - #### docSeq

          private javax.swing.text.StyledDocument docSeq

    - #### docStr

          private javax.swing.text.StyledDocument docStr

    - #### docUpdateListener

          private final TextDocListener docUpdateListener

    - #### helixH3

          private static final java.util.regex.Pattern helixH3

    - #### helixInvalid

          private static final java.util.regex.Pattern helixInvalid

    - #### helixPair

          private static final java.util.regex.Pattern helixPair

    - #### helixParsePatterns

          private static final java.util.regex.Pattern[] helixParsePatterns

    - #### helixSep

          private static final java.util.regex.Pattern helixSep

    - #### lblLocation

          private javax.swing.JLabel lblLocation

    - #### pnlMain

          private javax.swing.JPanel pnlMain

    - #### revSeqLookup

          private int[] revSeqLookup

    - #### selectedBase

          private int selectedBase

    - #### selectedHelixLen

          private int selectedHelixLen

    - #### selectedPair

          private int selectedPair

    - #### selectedStructItem

          private NewFileWindow.StructItem selectedStructItem

    - #### seqLen

          private int seqLen

    - #### seqLookup

          private int[] seqLookup

    - #### seqText

          private java.lang.String seqText

    - #### strText

          private java.lang.String strText

    - #### structure

          private java.util.ArrayList<NewFileWindow.StructItem> structure

    - #### styleSeqDefault

          private javax.swing.text.Style styleSeqDefault

    - #### styleSeqPaired

          private javax.swing.text.Style styleSeqPaired

    - #### styleStrDefault

          private javax.swing.text.Style styleStrDefault

    - #### styleStrInvalid

          private javax.swing.text.Style styleStrInvalid

    - #### styleStrSel

          private javax.swing.text.Style styleStrSel

    - #### tmrUpdate

          private javax.swing.Timer tmrUpdate

    - #### txtDebug

          private javax.swing.JTextPane txtDebug

    - #### txtSequence

          private javax.swing.JTextPane txtSequence

    - #### txtStructure

          private javax.swing.JTextPane txtStructure

    - #### txtTitle

          private javax.swing.JTextField txtTitle

    - #### undoSeq

          private javax.swing.undo.UndoManager undoSeq

    - #### undoStr

          private javax.swing.undo.UndoManager undoStr

  - ### Constructor Detail

    - #### NewFileWindow

          public NewFileWindow()

  - ### Method Detail

    - #### $$$getRootComponent$$$

          public javax.swing.JComponent $$$getRootComponent$$$()

      No IDE Inspections
        ALL

    - #### $$$setupUI$$$

          private void $$$setupUI$$$()

      Method generated by IntelliJ IDEA GUI Designer DO NOT edit this method OR call it in your code!
      No IDE Inspections
        ALL

    - #### actionPerformed

          public void actionPerformed(java.awt.event.ActionEvent e)

    - #### applyStyleToStructure

          private void applyStyleToStructure(NewFileWindow.StructItem si,
                                             javax.swing.text.Style style)

    - #### bounded

          private int bounded(int value,
                              int min,
                              int max)

    - #### checkErrors

          private boolean checkErrors()

    - #### createDrawing

          private boolean createDrawing()

    - #### createStyleContext

          private javax.swing.text.StyleContext createStyleContext()

    - #### createUIComponents

          private void createUIComponents()

    - #### doRedo

          private void doRedo(java.awt.event.ActionEvent event)

    - #### doUndo

          private void doUndo(java.awt.event.ActionEvent event)

    - #### getActiveUndoManager

          public javax.swing.undo.UndoManager getActiveUndoManager()

    - #### handleTextSelection

          private void handleTextSelection(javax.swing.JTextPane txt)

    - #### isDotBracket

          private boolean isDotBracket(java.lang.String text)

    - #### isStructureError

          private boolean isStructureError(NewFileWindow.StructItem h)

    - #### itemSelected

          private void itemSelected(java.awt.event.ItemEvent e)

    - #### parseSequence

          private void parseSequence(java.lang.String text)

    - #### parseStructure

          private void parseStructure(java.lang.String text)

    - #### restyleSequence

          private void restyleSequence()

    - #### restyleStructure

          private void restyleStructure()

    - #### setCharStyle

          private void setCharStyle(javax.swing.text.StyledDocument doc,
                                    int offset,
                                    int len,
                                    javax.swing.text.Style s)

    - #### showDebug

          private void showDebug()

    - #### textCaretEvent

          private void textCaretEvent(javax.swing.event.CaretEvent e)

    - #### toInt

          private static int toInt(java.lang.String s)

    - #### toInt

          private static int toInt(java.lang.String s,
                                   int valueIfEmpty)

    - #### updateTextUI

          private void updateTextUI()

    - #### updateTimerElapsed

          private void updateTimerElapsed(java.awt.event.ActionEvent event)