ur_rna.StructureEditor.ui

## Class DrawPanel

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - javax.swing.JComponent
      - - javax.swing.JPanel
        - - ur_rna.StructureEditor.ui.DrawPanel

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

      public class DrawPanel
      extends javax.swing.JPanel
      implements ICanvas

  A double-buffered canvas on which the RNA scene can be drawn, implemented on top of a JPanel
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `javax.swing.JPanel.AccessibleJPanel`

    - ### 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 View2D` | `drawnView`
    `(package private) View2D` | `IDENTITY_VIEW`
    `private int` | `MARGIN`
    `private java.awt.geom.Point2D.Float` | `offset`
    `private java.awt.Rectangle` | `prevBounds`
    `private SceneRenderer` | `renderer`
    `private float` | `scale`
    `(package private) java.awt.geom.Point2D` | `scrollTargetModel`
    `(package private) java.awt.Point` | `scrollTargetView`
    `private java.awt.geom.AffineTransform` | `tr`
    `private View2D` | `view`
    `EventSource.NoArg` | `viewChanged`
    `private static int` | `ZOOM_MASK`

    - ### 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 java.awt.image.ImageObserver

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DrawPanel()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `autoScale(java.awt.Dimension preferredSize)`
    `private java.awt.Rectangle` | `calcPureRender()` Renders the scene with no applied transform and no output to the device (because it is clipped).
    `private void` | `controllerHistoryUpdate(HistoryUpdateEvent event)`
    `private void` | `delegateToParent(java.awt.event.MouseWheelEvent e)` bubble the mouse wheel event up to the parent JScrollPane
    `private static java.lang.String` | `fmt(java.awt.geom.Dimension2D d)`
    `private static java.lang.String` | `fmt(java.awt.geom.Point2D p)`
    `private static java.lang.String` | `fmt(java.awt.geom.Rectangle2D rc)`
    `private java.awt.Rectangle` | `getBounds(java.lang.Iterable<IScreenObject> objs)`
    `java.awt.Component` | `getComponent()`
    `java.awt.geom.Point2D` | `getOffset()`
    `SceneRenderer` | `getRenderer()`
    `float` | `getScale()`
    `View2D` | `getView()`
    `private java.awt.Point` | `getZoomScroll(java.awt.Dimension contentBounds, java.awt.Dimension viewRect)`
    `private static void` | `log(boolean useError, java.lang.String format, java.lang.Object... args)`
    `private static void` | `log(java.lang.String format, java.lang.Object... args)`
    `private static void` | `loge(java.lang.String format, java.lang.Object... args)`
    `protected void` | `paintComponent(java.awt.Graphics gg)`
    `void` | `repaintRequired()`
    `void` | `resetOffset()`
    `void` | `scrollToPoint(java.awt.Point p)`
    `void` | `setOffset(float dx, float dy)`
    `void` | `setOffset(java.awt.geom.Point2D offset)`
    `void` | `setRenderer(SceneRenderer renderer)`
    `void` | `setScale(float newScale)`
    `void` | `setView(float scale, float offsetX, float offsetY)`
    `void` | `setView(float scale, java.awt.geom.Point2D offset)`
    `private void` | `setZoomScroll(java.awt.Point screenLocation)`
    `private void` | `updateContentSize(java.awt.Rectangle bounds)`
    `private void` | `updateTransform()`
    `void` | `updateView()`
    `void` | `zoom(int steps)`

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

      `getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, 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, reshape, 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, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, getFocusCycleRootAncestor, 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, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, 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

    - #### drawnView

          private View2D drawnView

    - #### IDENTITY_VIEW

          final View2D IDENTITY_VIEW

    - #### MARGIN

          private final int MARGIN

      See Also:
        Constant Field Values

    - #### offset

          private java.awt.geom.Point2D.Float offset

    - #### prevBounds

          private java.awt.Rectangle prevBounds

    - #### renderer

          private SceneRenderer renderer

    - #### scale

          private float scale

    - #### scrollTargetModel

          java.awt.geom.Point2D scrollTargetModel

    - #### scrollTargetView

          java.awt.Point scrollTargetView

    - #### tr

          private java.awt.geom.AffineTransform tr

    - #### view

          private View2D view

    - #### viewChanged

          public final EventSource.NoArg viewChanged

    - #### ZOOM_MASK

          private static final int ZOOM_MASK

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DrawPanel

          public DrawPanel()

  - ### Method Detail

    - #### autoScale

          public void autoScale(java.awt.Dimension preferredSize)

    - #### calcPureRender

          private java.awt.Rectangle calcPureRender()

      Renders the scene with no applied transform and no output to the device (because it is clipped).

    - #### controllerHistoryUpdate

          private void controllerHistoryUpdate(HistoryUpdateEvent event)

    - #### delegateToParent

          private void delegateToParent(java.awt.event.MouseWheelEvent e)

      bubble the mouse wheel event up to the parent JScrollPane

    - #### fmt

          private static java.lang.String fmt(java.awt.geom.Dimension2D d)

    - #### fmt

          private static java.lang.String fmt(java.awt.geom.Point2D p)

    - #### fmt

          private static java.lang.String fmt(java.awt.geom.Rectangle2D rc)

    - #### getBounds

          @Nullable
          private java.awt.Rectangle getBounds(java.lang.Iterable<IScreenObject> objs)

    - #### getComponent

          public java.awt.Component getComponent()

      Specified by:
        `getComponent` in interface `ICanvas`

    - #### getOffset

          public java.awt.geom.Point2D getOffset()

    - #### getRenderer

          public SceneRenderer getRenderer()

    - #### getScale

          public float getScale()

    - #### getView

          public View2D getView()

      Specified by:
        `getView` in interface `ICanvas`

    - #### getZoomScroll

          private java.awt.Point getZoomScroll(java.awt.Dimension contentBounds,
                                               java.awt.Dimension viewRect)

    - #### log

          private static void log(boolean useError,
                                  java.lang.String format,
                                  java.lang.Object... args)

    - #### log

          private static void log(java.lang.String format,
                                  java.lang.Object... args)

    - #### loge

          private static void loge(java.lang.String format,
                                   java.lang.Object... args)

    - #### paintComponent

          protected void paintComponent(java.awt.Graphics gg)

      Overrides:
        `paintComponent` in class `javax.swing.JComponent`

    - #### repaintRequired

          public void repaintRequired()

      Specified by:
        `repaintRequired` in interface `ICanvas`

    - #### resetOffset

          public void resetOffset()

    - #### scrollToPoint

          public void scrollToPoint(java.awt.Point p)

    - #### setOffset

          public void setOffset(float dx,
                                float dy)

    - #### setOffset

          public void setOffset(java.awt.geom.Point2D offset)

    - #### setRenderer

          public void setRenderer(SceneRenderer renderer)

    - #### setScale

          public void setScale(float newScale)

    - #### setView

          public void setView(float scale,
                              float offsetX,
                              float offsetY)

    - #### setView

          public void setView(float scale,
                              java.awt.geom.Point2D offset)

    - #### setZoomScroll

          private void setZoomScroll(java.awt.Point screenLocation)

    - #### updateContentSize

          private void updateContentSize(java.awt.Rectangle bounds)

    - #### updateTransform

          private void updateTransform()

    - #### updateView

          public void updateView()

    - #### zoom

          public void zoom(int steps)