fr.orsay.lri.varna
Class VARNAPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by fr.orsay.lri.varna.VARNAPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class VARNAPanel
extends JPanel

The RNA 2D Panel is a lightweight component that allows for an automatic basic drawing of an RNA secondary structures. The drawing algorithms do not ensure a non-overlapping drawing of helices, thus it is possible to "spin the helices" through a click-and-drag approach. A typical usage of the class from within the constructor of a JFrame would be the following:
  VARNAPanel _rna = new VARNAPanel("CCCCAUAUGGGGACC","((((....))))...");
  this.getContentPane().add(_rna);

Version:
3.4
Author:
Yann Ponty & Kevin Darty
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  ArrayList<ModeleBase> _backupSelection
           
private  fr.orsay.lri.varna.controlers.ControleurBlinkingThread _blink
           
private  Dimension _border
           
private  VARNAConfig _conf
           
private  boolean _debug
           
private  boolean _drawBBox
           
private  boolean _drawBorder
           
private  boolean _highlightAnnotation
           
private  boolean _horsCadre
           
 ModeleBase _hoveredBase
           
private  fr.orsay.lri.varna.controlers.ControleurInterpolator _interpolator
           
private  Point2D.Double _lastSelectedCoord
           
private  Point2D.Double _linkDestination
           
private  Point2D.Double _linkOrigin
           
(package private)  UndoManager _manager
           
private  Integer _nearestBase
           
private  Point2D.Double _offsetPanel
           
private  Point2D.Double _offsetRNA
           
private  double _offX
           
private  double _offY
           
private  VueMenu _popup
          If comparison mode is TRUE (ON), then the application will be used to display a super-structure resulting on an RNA secondary structure comparison.
private  boolean _premierAffichage
           
private  Point2D.Double[] _realCenters
           
private  Point2D.Double[] _realCoords
           
private  RNA _RNA
           
private  ArrayList<InterfaceVARNARNAListener> _RNAListeners
           
private  double _scaleFactor
           
private  TextAnnotation _selectedAnnotation
           
private  BaseList _selectedBases
           
private  ArrayList<InterfaceVARNASelectionListener> _selectionListeners
           
private  Rectangle _selectionRectangle
           
private  int _titleHeight
           
private  Point _translation
           
private  VueUI _UI
           
private  ArrayList<InterfaceVARNAListener> _VARNAListeners
           
private static long serialVersionUID
           
static String VARNA_SESSION_EXTENSION
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
VARNAPanel()
          Creates an RNA 2D panel with initially displays the empty structure.
VARNAPanel(Reader r)
           
VARNAPanel(Reader r, int drawMode)
           
VARNAPanel(Reader r, int drawMode, String title)
           
VARNAPanel(RNA r)
          Creates a VARNAPanel instance, and displays an RNA.
VARNAPanel(String seq, String str)
          Creates an RNA 2D panel, and creates and displays an RNA coupled with its secondary structure formatted as a well-balanced parenthesis with dots word (DBN format).
VARNAPanel(String seq, String str, int drawMode)
          Creates a VARNAPanel instance, and creates and displays an RNA coupled with its secondary structure formatted as a well-balanced parenthesis with dots word (DBN format).
VARNAPanel(String seq, String str, int drawMode, String title)
          Creates a VARNAPanel instance, and creates and displays an RNA coupled with its secondary structure formatted as a well-balanced parenthesis with dots word (DBN format).
VARNAPanel(String seq1, String struct1, String seq2, String struct2, int drawMode, String title)
           
 
Method Summary
 void addAnnotation(TextAnnotation textAnnotation)
           
 void addHighlightRegion(HighlightRegionAnnotation n)
           
 void addHighlightRegion(int i, int j)
           
 void addHighlightRegion(int i, int j, Color fill, Color outline, double radius)
           
 void addRNAListener(InterfaceVARNARNAListener v)
           
 void addSelectionListener(InterfaceVARNASelectionListener v)
           
 void addToSelection(Collection<? extends Integer> indices)
           
 void addToSelection(int i)
           
 void addVARNAListener(InterfaceVARNAListener v)
           
(package private)  Point2D.Double buildCaptionPosition(ModeleBase mb, double scaleFactor, double heightEstimate)
           
 void checkTranslation()
          Checks if the current translation doesn't "kick" the whole RNA out of the panel, and corrects the situation if necessary.
 void clearSelection()
          Stops highlighting bases
private  Point2D.Double computeExcentricUnitVector(int i, Point2D.Double[] points, Point2D.Double[] centers)
           
 void drawBackbone(VueVARNAGraphics g2D, Point2D.Double[] newCoords, double newRadius)
           
private  void drawBase(VueVARNAGraphics g2D, int i, Point2D.Double[] points, Point2D.Double[] centers, double newRadius)
           
private  void drawBasePair(VueVARNAGraphics g2D, Point2D.Double orig, Point2D.Double dest, ModeleBP style, double newRadius)
           
 void drawBBox(boolean on)
          Toggles on/off a rectangular outline of the bounding box.
 void drawBorder(boolean on)
          Toggles on/off a rectangular outline of the border.
(package private)  void drawChemProbAnnotation(VueVARNAGraphics g2D, ChemProbAnnotation cpa, Point2D.Double anchor, double scaleFactor)
           
 void drawColorMap(boolean draw)
           
private  void drawColorMap(VueVARNAGraphics g2D, double scaleFactor, Rectangle2D.Double rnabbox)
           
 void drawRegionHighlightsAnnotation(VueVARNAGraphics g2D, Point2D.Double[] realCoords, Point2D.Double[] realCenters, double scaleFactor)
           
 void drawRNA()
          Redraws the current RNA.
 void drawRNA(Reader r, int drawMode)
           
 void drawRNA(RNA r)
          Sets the RNA secondary structure to be drawn in this panel, using the current drawing algorithm.
 void drawRNA(RNA r, int drawMode)
          Sets the RNA secondary structure to be drawn in this panel, using a given layout algorithm.
 void drawRNA(String seq, String str)
          Sets the RNA secondary structure to be drawn in this panel, using the default layout algorithm.
 void drawRNA(String seq, String str, int drawMode)
          Sets the RNA secondary structure to be drawn in this panel, using a given layout algorithm.
 void drawRNA(String firstSeq, String firstStruct, String secondSeq, String secondStruct, int drawMode)
          When comparison mode is ON, sets the two RNA secondary structure to be drawn in this panel, using a given layout algorithm.
 void drawRNAInterpolated(RNA target)
          Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one.
 void drawRNAInterpolated(RNA target, int drawMode, Mapping m)
          Draws a secondary structure of RNA using a given drawing algorithm and displays it, using an interpolated transition between the previous one and the new one.
 void drawRNAInterpolated(RNA target, Mapping m)
          Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one.
 void drawRNAInterpolated(String seq, String str)
          Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one.
 void drawRNAInterpolated(String seq, String str, int drawMode)
          Draws a secondary structure of RNA using a given algorithm and displays it, using an interpolated transition between the previous one and the new one.
 void drawRNAInterpolated(String seq, String str, int drawMode, Mapping m)
          Draws a secondary structure of RNA using a given drawing algorithm and displays it, using an interpolated transition between the previous one and the new one.
 void drawRNAInterpolated(String seq, String str, Mapping m)
          Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one.
private  void drawStringOutline(VueVARNAGraphics g2D, String res, double x, double y, double margin)
           
private  void drawSymbol(VueVARNAGraphics g2D, double posx, double posy, double normx, double normy, double radius, boolean isCIS, ModeleBP.Edge e)
           
 void emitWarning(String warning)
          Displays a warning message through a modal dialog if warnings are set to be displayed.
 void eraseSequence()
           
 void errorDialog(Exception error)
          Pops up an error Dialog displaying an exception in an human-readable way.
 void errorDialog(Exception error, Component c)
          Pops up an error Dialog displaying an exception in an human-readable way if errors are set to be displayed.
static void errorDialogStatic(Exception error, Component c)
          Pops up an error Dialog displaying an exception in an human-readable way.
 void fireHoverChanged(ModeleBase mold, ModeleBase mnew)
           
 void fireLayoutChanged()
           
 void fireLayoutChanged(Hashtable<Integer,Point2D.Double> movedPositions)
           
 void fireSelectionChanged(BaseList mold, BaseList mnew)
           
 void fireSequenceChanged(int index, String oldseq, String newseq)
           
 void fireStructureChanged(Set<ModeleBP> current, Set<ModeleBP> addedBasePairs, Set<ModeleBP> removedBasePairs)
           
 void fireUINewStructure()
           
 TextAnnotation get_selectedAnnotation()
           
 Color getBackboneColor()
          Returns the color used to draw backbone bounds.
 ModeleBase getBaseAt(Point2D.Double po)
           
 ArrayList<Integer> getBasesInRectangle(Rectangle rec)
           
 ArrayList<Integer> getBasesInRectangleDiff(Rectangle recIn, Rectangle recOut)
           
 Color getBondColor()
          Returns the color used to display hydrogen bonds (base pairings)
 Dimension getBorderSize()
          Returns the size of the border, i.e.
 double getBPHeightIncrement()
          For the LINE_MODE drawing algorithm, sets the base pair height increment, i.e.
 VARNAConfig.BP_STYLE getBPStyle()
          Returns the base-pair representation style
private  Rectangle2D.Double getClip()
           
 boolean getColorGapsBases()
          Returns true if a special color is used for drawing "Gaps" bases in comparison mode
 ModeleColorMap getColorMap()
           
 String getColorMapCaption()
           
private  double getColorMapHeight()
           
 boolean getColorMapVisible()
           
 boolean getColorSpecialBases()
          Returns true if a special color is used as inner color for non-standard base
 VARNAConfig getConfig()
          Returns the current VARNA Panel configuration.
 boolean getDrawBackbone()
           
 int getDrawMode()
          Returns the current algorithm used for drawing the structure
 Rectangle2D.Double getExtendedRNABBox()
           
 boolean getFlatExteriorLoop()
           
 Color getGapsBasesColor()
          Returns the color used to draw 'Gaps' bases in comparison mode
private  Color getHighlightedVersion(Color c1, Color c2)
           
 int getInnerHeight()
          Returns the "real pixels" height of the drawing surface for our RNA.
 int getInnerWidth()
          Returns the "real pixels" width of the drawing surface for our RNA.
 Point2D.Double getLastSelectedPosition()
           
 int getLeftOffset()
          Returns the "real pixels" x-coordinate of the RNA.
 ArrayList<TextAnnotation> getListeAnnotations()
           
 Integer getNearestBase()
          Returns the index of the currently selected base, defaulting to the closest base to the last mouse-click.
 Color getNonStandardBasesColor()
          Returns the color used to draw non-standard bases
 int getNumPeriod()
          Returns the current numbering period.
 Point2D.Double getOffsetPanel()
          Returns the shifting of the origin of the Panel in zoom mode
 double getOrientation()
           
 VueMenu getPopup()
          Returns the popup menu used for user mouse iteractions
 VueMenu getPopupMenu()
          Returns this panel's UI menu
 Point2D.Double[] getRealCoords()
          Returns the coordinates of the currently displayed RNA
 RNA getRNA()
          Returns the current RNA model
 Point2D.Double getRNAOffset()
          Returns the vector bringing the logical coordinate of left-top-most point in the panel to the left-top-most point of the RNA.
 double getScaleFactor()
          Gets the scale factor used by the autofitting function
 BaseList getSelection()
           
 ArrayList<Integer> getSelectionIndices()
           
 boolean getShowNonCanonicalBP()
          Return the current display status for non-canonical base-pairs
 boolean getShowNonPlanarBP()
          Return the current display status for non-planar base-pairs
 boolean getShowWarnings()
          Get current warning display status
 String getTitle()
          Returns the title of this panel
 Color getTitleColor()
          Returns the color used to draw the title
 Font getTitleFont()
          Returns the font currently used for rendering the title.
private  int getTitleHeight()
          Returns the height taken by the title
 int getTopOffset()
          Returns the "real pixels" y-coordinate of the RNA.
 Point getTranslation()
          Returns the translation used for zooming in and out
 boolean getUseBaseColorsForBPs()
          Returns true if current base color is used as inner color for drawing base-pairs
 VueUI getVARNAUI()
          Returns the view associated with user interactions
 double getZoom()
          Returns the current zoom factor
 double getZoomIncrement()
          Returns the atomic zoom factor step, or increment.
 void globalRotation(Double angleDegres)
          Rotates the RNA coordinates by a certain angle
private  Color highlightFilter(int index, Color initialColor, Color c1, Color c2)
           
 void highlightSelectedAnnotation()
           
 void highlightSelectedBase(ModeleBase m)
          Starts highlighting the selected base.
 void highlightSelectedStem(ModeleBase m)
          Starts highlighting the selected base.
static FullBackup importSession(InputStream fis, String path)
           
static FullBackup importSession(String path)
           
private  void imprimer()
           
private  void init()
           
 boolean isAutoCentered()
          Returns the current state of auto centering mode.
 boolean isComparisonMode()
          Checks if the current mode is the "comparison" mode
 boolean isErrorsOn()
          Checks whether errors are to be displayed
 boolean isInSelection(int i)
           
 boolean isInterpolationInProgress()
          Checks whether an interpolated transition bewteen two RNAs is occurring.
 boolean isModifiable()
          Returns current modification status
 boolean isOutOfFrame()
          Checks whether the drawn RNA is too large to be displayed, allowing for shifting mouse interactions.
 void loadFile(String path)
           
 void loadFile(String path, boolean interpolate)
           
 FullBackup loadSession(String path)
           
 void lockScrolling()
           
 Point2D.Double logicToPanel(Point2D.Double logicPoint)
           
 void paintComponent(Graphics g)
           
 void paintComponent(Graphics g, boolean transparentBackground)
           
 Point2D.Double panelToLogicPoint(Point2D.Double p)
           
 void readValues(Reader r)
           
 void redo()
           
 boolean removeAnnotation(TextAnnotation textAnnotation)
           
 void removeColorMap()
           
 void removeFromSelection(int i)
           
 void removeHighlightRegion(HighlightRegionAnnotation n)
           
 void removeLink()
           
 void removeSelectedAnnotation()
           
 void removeSelectionRectangle()
           
private  void renderAnnotations(VueVARNAGraphics g2D, double offX, double offY, double rnaBBoxX, double rnaBBoxY, double scaleFactor)
           
 void renderComponent(VueVARNAGraphics g2D, boolean transparentBackground)
          Draws current RNA structure in a given Graphics "device".
private  void renderRNA(VueVARNAGraphics g2D, Rectangle2D.Double bbox)
           
 void reset()
          Resets the visual aspects (Zoom factor, shift) for the Panel.
 void resetAnnotationHighlight()
          Stops highlighting bases
 void resetListeAnnotations()
           
 void restoreSelection()
           
 void saveSelection()
           
 void saveSession(String path)
           
 void set_selectedAnnotation(TextAnnotation annotation)
           
 void setAutoCenter(boolean center)
          Sets the current state of auto centering mode.
private  void setAutoFit(boolean fit)
           
 void setBackboneColor(Color backbone_color)
          Sets the color to be used for drawing backbone interactions.
 void setBackground(Color c)
          Sets the background color
 void setBaseFontSize(Float size)
          Sets the font size for displaying bases
 void setBaseFontStyle(int style)
          Sets the font style for displaying bases
 void setBaseInnerColor(Color c)
           
 void setBaseNameColor(Color c)
           
 void setBaseNumbersColor(Color c)
           
 void setBaseOutlineColor(Color c)
           
 void setBondColor(Color bond_color)
          Sets the color used to display hydrogen bonds (base pairings)
 void setBorderSize(Dimension b)
          Sets the size of the border, i.e.
 void setBPHeightIncrement(double inc)
          Sets the base pair height increment, i.e.
 void setBPStyle(VARNAConfig.BP_STYLE st)
          Sets the base-pair representation style
 void setColorGapsBases(boolean on)
          Toggles on/off using a special color used for drawing "Gaps" bases in comparison mode
 void setColorMap(ModeleColorMap cm)
           
 void setColorMapCaption(String caption)
           
 void setColorMapMaxValue(double d)
           
 void setColorMapMinValue(double d)
           
 void setColorMapValues(Double[] values)
           
 void setColorMapVisible(boolean b)
           
 void setColorNonStandardBases(boolean on)
          Toggles on/off using a special color used for drawing "non-standard" bases
 void setConfig(VARNAConfig cfg)
           
 void setDefaultBPColor(Color bond_color)
          Sets the new color to be used for hydrogen bonds (base pairings)
 void setDestinationLink(Point2D.Double p)
           
 void setDrawBackbone(boolean b)
           
 void setErrorsOn(boolean on)
          Sets whether errors are to be displayed
 void setFlatExteriorLoop(boolean on)
           
 void setGapsBasesColor(Color c)
          Sets the color to use for 'Gaps' bases in comparison mode
 void setHoverBase(ModeleBase m)
           
 void setLastSelectedPosition(Point2D.Double p)
           
 void setModifiable(boolean modifiable)
          Toggles modifications on and off
 void setNearestBase(Integer base)
          Sets the index of the currently selected base.
 void setNonStandardBasesColor(Color basesColor)
          Sets the color used to draw non-standard bases
 void setNumbersFontSize(Float size)
          Sets the font size for displaying base numbers
 void setNumPeriod(int n)
          Sets the distance between consecutive base numbers.
 void setOriginLink(Point2D.Double p)
           
 void setRealCoords(Point2D.Double[] coords)
          Sets the coordinates of the currently displayed RNA
 void setScaleFactor(double factor)
          Sets the scale factor used by the autofitting function
 void setSelection(ArrayList<Integer> indices)
           
 void setSelection(Collection<? extends ModeleBase> mbs)
           
 void setSelectionRectangle(Rectangle rec)
           
 void setSequence(String s)
           
 void setShowNonCanonicalBP(boolean on)
          Toggles on/off displaying non-canonical base-pairs
 void setShowNonPlanarBP(boolean on)
          Toggles on/off displaying "non-planar" base-pairs
 void setShowWarnings(boolean on)
          Toggles on/off displaying warnings
 void setTitle(String title)
          Sets the panel's title, giving a short description of the RNA secondary structure.
 void setTitleColor(Color title_color)
          Sets the color used to draw the title
 void setTitleFont(Font font)
          Sets the font used for rendering the title.
 void setTitleFontColor(Color newColor)
          Sets the color to be used for the title.
 void setTitleFontFamily(String newFamily)
          Sets the new font family to be used for the title.
 void setTitleFontSize(float newSize)
          Sets the new size of the title font.
 void setTitleFontStyle(int newStyle)
          Sets the new style of the title font.
private  void setTitleHeight(int title_height)
          Sets the height taken by the title
 void setTranslation(Point trans)
          Sets the translation used for zooming in and out
 void setUseBaseColorsForBPs(boolean on)
          Toggles on/off using base inner color for drawing base-pairs
 void setZoom(Object _zoom)
          Sets the current zoom factor
 void setZoomIncrement(double amount)
          Sets the atomic zoom factor step, or increment.
 void setZoomIncrement(Object amount)
          Sets the atomic zoom factor step, or increment.
 void showRNA(RNA r)
          Sets the RNA to be displayed within this Panel.
 void showRNA(RNA t, VARNAConfig cfg)
           
 void showRNAInterpolated(RNA target)
          Simply displays (does not redraw) a secondary structure , using an interpolated transition between the previous one and the new one.
 void showRNAInterpolated(RNA target, Mapping m)
          Simply displays (does not redraw) a secondary structure , using an interpolated transition between the previous one and the new one.
 void showRNAInterpolated(RNA target, VARNAConfig cfg, Mapping m)
           
 void toggleDrawOutlineBase()
           
 void toggleFillBase()
           
 void toggleSelection(Collection<? extends Integer> indices)
           
 void toggleSelection(int i)
           
 Point2D.Double transformCoord(Point2D.Double coordDebut)
           
 Point2D.Double transformCoord(Point2D.Double coordDebut, double offX, double offY, double rnaBBoxX, double rnaBBoxY, double scaleFactor)
           
 void undo()
           
 void unlockScrolling()
           
private  void updateTitleHeight()
           
 
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, transferFocusBackward, 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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

_RNA

private RNA _RNA

_debug

private boolean _debug

_conf

private VARNAConfig _conf

_VARNAListeners

private ArrayList<InterfaceVARNAListener> _VARNAListeners

_selectionListeners

private ArrayList<InterfaceVARNASelectionListener> _selectionListeners

_RNAListeners

private ArrayList<InterfaceVARNARNAListener> _RNAListeners

_manager

UndoManager _manager

_realCoords

private Point2D.Double[] _realCoords

_realCenters

private Point2D.Double[] _realCenters

_scaleFactor

private double _scaleFactor

_offsetPanel

private Point2D.Double _offsetPanel

_offsetRNA

private Point2D.Double _offsetRNA

_offX

private double _offX

_offY

private double _offY

_blink

private fr.orsay.lri.varna.controlers.ControleurBlinkingThread _blink

_selectedBases

private BaseList _selectedBases

_backupSelection

private ArrayList<ModeleBase> _backupSelection

_nearestBase

private Integer _nearestBase

_lastSelectedCoord

private Point2D.Double _lastSelectedCoord

_linkOrigin

private Point2D.Double _linkOrigin

_linkDestination

private Point2D.Double _linkDestination

_selectionRectangle

private Rectangle _selectionRectangle

_highlightAnnotation

private boolean _highlightAnnotation

_titleHeight

private int _titleHeight

_border

private Dimension _border

_drawBBox

private boolean _drawBBox

_drawBorder

private boolean _drawBorder

_translation

private Point _translation

_horsCadre

private boolean _horsCadre

_premierAffichage

private boolean _premierAffichage

_interpolator

private fr.orsay.lri.varna.controlers.ControleurInterpolator _interpolator

_popup

private VueMenu _popup
If comparison mode is TRUE (ON), then the application will be used to display a super-structure resulting on an RNA secondary structure comparison. Else, the application is used by default.


_UI

private VueUI _UI

_selectedAnnotation

private TextAnnotation _selectedAnnotation

VARNA_SESSION_EXTENSION

public static String VARNA_SESSION_EXTENSION

_hoveredBase

public ModeleBase _hoveredBase
Constructor Detail

VARNAPanel

public VARNAPanel()
           throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
Creates an RNA 2D panel with initially displays the empty structure.

Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength

VARNAPanel

public VARNAPanel(String seq,
                  String str)
           throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
Creates an RNA 2D panel, and creates and displays an RNA coupled with its secondary structure formatted as a well-balanced parenthesis with dots word (DBN format).

Parameters:
seq - The raw nucleotide sequence
str - The secondary structure in DBN format
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength

VARNAPanel

public VARNAPanel(String seq,
                  String str,
                  int drawMode)
           throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
Creates a VARNAPanel instance, and creates and displays an RNA coupled with its secondary structure formatted as a well-balanced parenthesis with dots word (DBN format). Allows the user to choose the drawing algorithm to be used.

Parameters:
seq - The raw nucleotide sequence
str - The secondary structure in DBN format
drawMode - The drawing mode
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
See Also:
RNA.DRAW_MODE_RADIATE, RNA.DRAW_MODE_CIRCULAR, RNA.DRAW_MODE_NAVIEW

VARNAPanel

public VARNAPanel(Reader r)
           throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength,
                  fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax

VARNAPanel

public VARNAPanel(Reader r,
                  int drawMode)
           throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength,
                  fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax

VARNAPanel

public VARNAPanel(Reader r,
                  int drawMode,
                  String title)
           throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength,
                  fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax

VARNAPanel

public VARNAPanel(RNA r)
Creates a VARNAPanel instance, and displays an RNA.

Parameters:
r - The RNA to be displayed within this panel

VARNAPanel

public VARNAPanel(String seq,
                  String str,
                  int drawMode,
                  String title)
           throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
Creates a VARNAPanel instance, and creates and displays an RNA coupled with its secondary structure formatted as a well-balanced parenthesis with dots word (DBN format). Allows the user to choose the drawing algorithm to be used. Additionally, sets the panel's title.

Parameters:
seq - The raw nucleotide sequence
str - The secondary structure in DBN format
drawMode - The drawing mode
title - The panel title
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
See Also:
RNA.DRAW_MODE_CIRCULAR, RNA.DRAW_MODE_RADIATE, RNA.DRAW_MODE_NAVIEW

VARNAPanel

public VARNAPanel(String seq1,
                  String struct1,
                  String seq2,
                  String struct2,
                  int drawMode,
                  String title)
Method Detail

setOriginLink

public void setOriginLink(Point2D.Double p)

setDestinationLink

public void setDestinationLink(Point2D.Double p)

removeLink

public void removeLink()

init

private void init()

undo

public void undo()

redo

public void redo()

setTitleFontStyle

public void setTitleFontStyle(int newStyle)
Sets the new style of the title font.

Parameters:
newStyle - An int that describes the new font style ("PLAIN","BOLD", "BOLDITALIC", or "ITALIC")

setTitleFontSize

public void setTitleFontSize(float newSize)
Sets the new size of the title font.

Parameters:
newSize - The new size of the title font

setTitleFontFamily

public void setTitleFontFamily(String newFamily)
Sets the new font family to be used for the title. Available fonts are system-specific, yet it seems that "Arial", "Dialog", and "MonoSpaced" are almost always available.

Parameters:
newFamily - New font family used for the title

setTitleFontColor

public void setTitleFontColor(Color newColor)
Sets the color to be used for the title.

Parameters:
newColor - A color used to draw the title

setBaseFontSize

public void setBaseFontSize(Float size)
Sets the font size for displaying bases

Parameters:
size - Font size for base caption

setNumbersFontSize

public void setNumbersFontSize(Float size)
Sets the font size for displaying base numbers

Parameters:
size - Font size for base caption

setBaseFontStyle

public void setBaseFontStyle(int style)
Sets the font style for displaying bases

Parameters:
style - An int that describes the new font style ("PLAIN","BOLD", "BOLDITALIC", or "ITALIC")

updateTitleHeight

private void updateTitleHeight()

setTitle

public void setTitle(String title)
Sets the panel's title, giving a short description of the RNA secondary structure.

Parameters:
title - The new title

setNumPeriod

public void setNumPeriod(int n)
Sets the distance between consecutive base numbers. Please notice that :

Parameters:
n - New numbering period

getNumPeriod

public int getNumPeriod()
Returns the current numbering period. Please notice that :

Returns:
Current numbering period

setAutoFit

private void setAutoFit(boolean fit)

lockScrolling

public void lockScrolling()

unlockScrolling

public void unlockScrolling()

drawStringOutline

private void drawStringOutline(VueVARNAGraphics g2D,
                               String res,
                               double x,
                               double y,
                               double margin)

drawSymbol

private void drawSymbol(VueVARNAGraphics g2D,
                        double posx,
                        double posy,
                        double normx,
                        double normy,
                        double radius,
                        boolean isCIS,
                        ModeleBP.Edge e)

drawBasePair

private void drawBasePair(VueVARNAGraphics g2D,
                          Point2D.Double orig,
                          Point2D.Double dest,
                          ModeleBP style,
                          double newRadius)

getHighlightedVersion

private Color getHighlightedVersion(Color c1,
                                    Color c2)

highlightFilter

private Color highlightFilter(int index,
                              Color initialColor,
                              Color c1,
                              Color c2)

computeExcentricUnitVector

private Point2D.Double computeExcentricUnitVector(int i,
                                                  Point2D.Double[] points,
                                                  Point2D.Double[] centers)

drawBase

private void drawBase(VueVARNAGraphics g2D,
                      int i,
                      Point2D.Double[] points,
                      Point2D.Double[] centers,
                      double newRadius)

drawChemProbAnnotation

void drawChemProbAnnotation(VueVARNAGraphics g2D,
                            ChemProbAnnotation cpa,
                            Point2D.Double anchor,
                            double scaleFactor)

buildCaptionPosition

Point2D.Double buildCaptionPosition(ModeleBase mb,
                                    double scaleFactor,
                                    double heightEstimate)

renderAnnotations

private void renderAnnotations(VueVARNAGraphics g2D,
                               double offX,
                               double offY,
                               double rnaBBoxX,
                               double rnaBBoxY,
                               double scaleFactor)

getExtendedRNABBox

public Rectangle2D.Double getExtendedRNABBox()

drawBackbone

public void drawBackbone(VueVARNAGraphics g2D,
                         Point2D.Double[] newCoords,
                         double newRadius)

logicToPanel

public Point2D.Double logicToPanel(Point2D.Double logicPoint)

renderRNA

private void renderRNA(VueVARNAGraphics g2D,
                       Rectangle2D.Double bbox)

getBaseAt

public ModeleBase getBaseAt(Point2D.Double po)

setColorMapValues

public void setColorMapValues(Double[] values)

setColorMapMaxValue

public void setColorMapMaxValue(double d)

setColorMapMinValue

public void setColorMapMinValue(double d)

getColorMap

public ModeleColorMap getColorMap()

setColorMap

public void setColorMap(ModeleColorMap cm)

setColorMapCaption

public void setColorMapCaption(String caption)

getColorMapCaption

public String getColorMapCaption()

drawColorMap

public void drawColorMap(boolean draw)

getColorMapHeight

private double getColorMapHeight()

drawColorMap

private void drawColorMap(VueVARNAGraphics g2D,
                          double scaleFactor,
                          Rectangle2D.Double rnabbox)

panelToLogicPoint

public Point2D.Double panelToLogicPoint(Point2D.Double p)

transformCoord

public Point2D.Double transformCoord(Point2D.Double coordDebut,
                                     double offX,
                                     double offY,
                                     double rnaBBoxX,
                                     double rnaBBoxY,
                                     double scaleFactor)

eraseSequence

public void eraseSequence()

transformCoord

public Point2D.Double transformCoord(Point2D.Double coordDebut)

paintComponent

public void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

paintComponent

public void paintComponent(Graphics g,
                           boolean transparentBackground)

renderComponent

public void renderComponent(VueVARNAGraphics g2D,
                            boolean transparentBackground)
Draws current RNA structure in a given Graphics "device".

Parameters:
g2D - A graphical device
transparentBackground - Whether the background should be transparent, or drawn.

drawRegionHighlightsAnnotation

public void drawRegionHighlightsAnnotation(VueVARNAGraphics g2D,
                                           Point2D.Double[] realCoords,
                                           Point2D.Double[] realCenters,
                                           double scaleFactor)

getClip

private Rectangle2D.Double getClip()

getBackboneColor

public Color getBackboneColor()
Returns the color used to draw backbone bounds.

Returns:
The color used to draw backbone bounds

setBackboneColor

public void setBackboneColor(Color backbone_color)
Sets the color to be used for drawing backbone interactions.

Parameters:
backbone_color - The new color for the backbone bounds

getBondColor

public Color getBondColor()
Returns the color used to display hydrogen bonds (base pairings)

Returns:
The color of hydrogen bonds

getTitle

public String getTitle()
Returns the title of this panel

Returns:
The title

setDefaultBPColor

public void setDefaultBPColor(Color bond_color)
Sets the new color to be used for hydrogen bonds (base pairings)

Parameters:
bond_color - The new color for hydrogen bonds

setBorderSize

public void setBorderSize(Dimension b)
Sets the size of the border, i.e. the empty space between the end of the drawing area and the actual border.

Parameters:
b - The new border size

getBorderSize

public Dimension getBorderSize()
Returns the size of the border, i.e. the empty space between the end of the drawing area

Returns:
The border size

showRNA

public void showRNA(RNA r)
Sets the RNA to be displayed within this Panel. This method does not use a drawing algorithm to reassigns base coordinates, rather assuming that the RNA was previously drawn.

Parameters:
r - An already drawn RNA to display in this panel

drawRNA

public void drawRNA(String seq,
                    String str)
             throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
Sets the RNA secondary structure to be drawn in this panel, using the default layout algorithm. In addition to the raw nucleotides sequence, the secondary structure is given in the so-called "Dot-bracket notation" (DBN) format. This format is a well-parenthesized word over the alphabet '(',')','.'.
Ex:((((((((....))))..(((((...))).))))))
Returns true if the sequence/structure couple could be parsed into a valid secondary structure, and false otherwise.

Parameters:
seq - The raw nucleotides sequence
str - The secondary structure
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength

drawRNA

public void drawRNA(RNA r,
                    int drawMode)
Sets the RNA secondary structure to be drawn in this panel, using a given layout algorithm.

Parameters:
r - The new secondary structure
drawMode - The drawing algorithm

drawRNA

public void drawRNA()
Redraws the current RNA. This reassigns base coordinates to their default value using the current drawing algorithm.


drawRNA

public void drawRNA(RNA r)
Sets the RNA secondary structure to be drawn in this panel, using the current drawing algorithm.

Parameters:
r - The new secondary structure

drawRNA

public void drawRNA(String seq,
                    String str,
                    int drawMode)
             throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
Sets the RNA secondary structure to be drawn in this panel, using a given layout algorithm. In addition to the raw nucleotides sequence, the secondary structure is given in the so-called "Dot-bracket notation" (DBN) format. This format is a well-parenthesized word over the alphabet '(',')','.'.
Ex: ((((((((....))))..(((((...))).))))))
Returns true if the sequence/structure couple could be parsed into a valid secondary structure, and false otherwise.

Parameters:
seq - The raw nucleotides sequence
str - The secondary structure
drawMode - The drawing algorithm
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength

drawRNA

public void drawRNA(Reader r,
                    int drawMode)
             throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength,
                    fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax

drawRNAInterpolated

public void drawRNAInterpolated(String seq,
                                String str)
                         throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one. Extra bases, resulting from a size difference between the two successive RNAs, are assumed to initiate from the middle of the sequence. In other words, both prefixes and suffixes of the RNAs are assumed to match, and what remains is an insertion.

Parameters:
seq - Sequence
str - Structure in dot bracket notation
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength - If len(seq)!=len(str)

drawRNAInterpolated

public void drawRNAInterpolated(String seq,
                                String str,
                                int drawMode)
Draws a secondary structure of RNA using a given algorithm and displays it, using an interpolated transition between the previous one and the new one. Extra bases, resulting from a size difference between the two successive RNAs, are assumed to initiate from the middle of the sequence. In other words, both prefixes and suffixes of the RNAs are assumed to match, and what remains is an insertion.

Parameters:
seq - Sequence
str - Structure in dot bracket notation
drawMode - The drawing algorithm to be used for the initial placement
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength - If len(seq)!=len(str)

drawRNAInterpolated

public void drawRNAInterpolated(String seq,
                                String str,
                                Mapping m)
Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one. Here, a mapping between those bases of the new structure and the previous one is explicitly provided.

Parameters:
seq - Sequence
str - Structure in dot bracket notation
m - A mapping between the currently rendered structure and its successor (seq,str)
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength - If len(seq)!=len(str)

drawRNAInterpolated

public void drawRNAInterpolated(String seq,
                                String str,
                                int drawMode,
                                Mapping m)
Draws a secondary structure of RNA using a given drawing algorithm and displays it, using an interpolated transition between the previous one and the new one. Here, a mapping between those bases of the new structure and the previous one is provided.

Parameters:
seq - Sequence
str - Structure in dot bracket notation
drawMode - The drawing algorithm to be used for the initial placement
m - A mapping between the currently rendered structure and its successor (seq,str)

drawRNAInterpolated

public void drawRNAInterpolated(RNA target)
Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one. Here, a mapping between those bases of the new structure and the previous one is explicitly provided.

Parameters:
target - Secondary structure

drawRNAInterpolated

public void drawRNAInterpolated(RNA target,
                                Mapping m)
Draws a secondary structure of RNA using the default drawing algorithm and displays it, using an interpolated transition between the previous one and the new one. Here, a mapping between those bases of the new structure and the previous one is explicitly provided.

Parameters:
target - Secondary structure
m - A mapping between the currently rendered structure and its successor (seq,str)

drawRNAInterpolated

public void drawRNAInterpolated(RNA target,
                                int drawMode,
                                Mapping m)
Draws a secondary structure of RNA using a given drawing algorithm and displays it, using an interpolated transition between the previous one and the new one. Here, a mapping between those bases of the new structure and the previous one is provided.

Parameters:
target - Secondary structure of RNA
drawMode - The drawing algorithm to be used for the initial placement
m - A mapping between the currently rendered structure and its successor (seq,str)

getDrawMode

public int getDrawMode()
Returns the current algorithm used for drawing the structure

Returns:
The current drawing algorithm

showRNA

public void showRNA(RNA t,
                    VARNAConfig cfg)

isInterpolationInProgress

public boolean isInterpolationInProgress()
Checks whether an interpolated transition bewteen two RNAs is occurring.

Returns:
True if an interpolated transition is occurring, false otherwise

showRNAInterpolated

public void showRNAInterpolated(RNA target)
Simply displays (does not redraw) a secondary structure , using an interpolated transition between the previous one and the new one. A default mapping between those bases of the new structure and the previous one is used.

Parameters:
target - Secondary structure of RNA

showRNAInterpolated

public void showRNAInterpolated(RNA target,
                                Mapping m)
Simply displays (does not redraw) a secondary structure , using an interpolated transition between the previous one and the new one. Here, a mapping between bases of the new structure and the previous one is given.

Parameters:
target - Secondary structure of RNA
m - A mapping between the currently rendered structure and its successor (seq,str)
Throws:
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength - If len(seq)!=len(str)

showRNAInterpolated

public void showRNAInterpolated(RNA target,
                                VARNAConfig cfg,
                                Mapping m)

drawRNA

public void drawRNA(String firstSeq,
                    String firstStruct,
                    String secondSeq,
                    String secondStruct,
                    int drawMode)
When comparison mode is ON, sets the two RNA secondary structure to be drawn in this panel, using a given layout algorithm. In addition to the raw nucleotides sequence, the secondary structure is given in the so-called "Dot-bracket notation" (DBN) format. This format is a well-parenthesized word over the alphabet '(',')','.'.
Ex: ((((((((....))))..(((((...))).))))))

Parameters:
firstSeq - The first RNA raw nucleotides sequence
firstStruct - The first RNA secondary structure
secondSeq - The second RNA raw nucleotides sequence
secondStruct - The second RNA secondary structure
drawMode - The drawing algorithm

getRealCoords

public Point2D.Double[] getRealCoords()
Returns the coordinates of the currently displayed RNA

Returns:
Coordinates array

setRealCoords

public void setRealCoords(Point2D.Double[] coords)
Sets the coordinates of the currently displayed RNA

Parameters:
coords - New coordinates

getPopup

public VueMenu getPopup()
Returns the popup menu used for user mouse iteractions

Returns:
Popup menu

setBondColor

public void setBondColor(Color bond_color)
Sets the color used to display hydrogen bonds (base pairings)

Parameters:
bond_color - The color of hydrogen bonds

getTitleColor

public Color getTitleColor()
Returns the color used to draw the title

Returns:
The color used to draw the title

setTitleColor

public void setTitleColor(Color title_color)
Sets the color used to draw the title

Parameters:
title_color - The new color used to draw the title

getTitleHeight

private int getTitleHeight()
Returns the height taken by the title

Returns:
The height taken by the title

setTitleHeight

private void setTitleHeight(int title_height)
Sets the height taken by the title

Parameters:
title_height - The height taken by the title

isAutoCentered

public boolean isAutoCentered()
Returns the current state of auto centering mode.

Returns:
True if autocentered, false otherwise

setAutoCenter

public void setAutoCenter(boolean center)
Sets the current state of auto centering mode.

Parameters:
center - New auto-centered state

getTitleFont

public Font getTitleFont()
Returns the font currently used for rendering the title.

Returns:
Current title font

setTitleFont

public void setTitleFont(Font font)
Sets the font used for rendering the title.

Parameters:
font - New title font

getBPHeightIncrement

public double getBPHeightIncrement()
For the LINE_MODE drawing algorithm, sets the base pair height increment, i.e. the vertical distance between two nested arcs.

Returns:
The current base pair increment

setBPHeightIncrement

public void setBPHeightIncrement(double inc)
Sets the base pair height increment, i.e. the vertical distance between two arcs to be used in LINE_MODE.

Parameters:
inc - New height increment

getScaleFactor

public double getScaleFactor()
Gets the scale factor used by the autofitting function

Returns:
Current scale factor

setScaleFactor

public void setScaleFactor(double factor)
Sets the scale factor used by the autofitting function

Parameters:
factor - New scale factor

getOffsetPanel

public Point2D.Double getOffsetPanel()
Returns the shifting of the origin of the Panel in zoom mode

Returns:
The logical coordinate of the top-left panel point

getRNAOffset

public Point2D.Double getRNAOffset()
Returns the vector bringing the logical coordinate of left-top-most point in the panel to the left-top-most point of the RNA.

Returns:
The logical coordinate of the top-left panel point

getPopupMenu

public VueMenu getPopupMenu()
Returns this panel's UI menu

Returns:
Applet's UI popupmenu

getZoomIncrement

public double getZoomIncrement()
Returns the atomic zoom factor step, or increment.

Returns:
Atomic zoom factor increment

setZoomIncrement

public void setZoomIncrement(Object amount)
Sets the atomic zoom factor step, or increment.

Parameters:
amount - Atomic zoom factor increment

setZoomIncrement

public void setZoomIncrement(double amount)
Sets the atomic zoom factor step, or increment.

Parameters:
amount - Atomic zoom factor increment

getZoom

public double getZoom()
Returns the current zoom factor

Returns:
Current zoom factor

setZoom

public void setZoom(Object _zoom)
Sets the current zoom factor

Parameters:
_zoom - New zoom factor

getTranslation

public Point getTranslation()
Returns the translation used for zooming in and out

Returns:
A vector describing the translation

setTranslation

public void setTranslation(Point trans)
Sets the translation used for zooming in and out

Parameters:
trans - A vector describing the new translation

getRNA

public RNA getRNA()
Returns the current RNA model

Returns:
Current RNA model

isOutOfFrame

public boolean isOutOfFrame()
Checks whether the drawn RNA is too large to be displayed, allowing for shifting mouse interactions.

Returns:
true if the RNA is too large to be displayed, false otherwise

errorDialog

public void errorDialog(Exception error)
Pops up an error Dialog displaying an exception in an human-readable way.

Parameters:
error - The exception to display within the Dialog

errorDialog

public void errorDialog(Exception error,
                        Component c)
Pops up an error Dialog displaying an exception in an human-readable way if errors are set to be displayed.

Parameters:
error - The exception to display within the Dialog
c - Parent component for the dialog box
See Also:
setErrorsOn(boolean)

errorDialogStatic

public static void errorDialogStatic(Exception error,
                                     Component c)
Pops up an error Dialog displaying an exception in an human-readable way.

Parameters:
error - The exception to display within the Dialog
c - Parent component for the dialog box

emitWarning

public void emitWarning(String warning)
Displays a warning message through a modal dialog if warnings are set to be displayed.

Parameters:
warning - A message expliciting the warning
See Also:
setShowWarnings(boolean)

setModifiable

public void setModifiable(boolean modifiable)
Toggles modifications on and off

Parameters:
modifiable - Modification status

isModifiable

public boolean isModifiable()
Returns current modification status

Returns:
current modification status

reset

public void reset()
Resets the visual aspects (Zoom factor, shift) for the Panel.


getNonStandardBasesColor

public Color getNonStandardBasesColor()
Returns the color used to draw non-standard bases

Returns:
The color used to draw non-standard bases

setNonStandardBasesColor

public void setNonStandardBasesColor(Color basesColor)
Sets the color used to draw non-standard bases

Parameters:
basesColor - The color used to draw non-standard bases

checkTranslation

public void checkTranslation()
Checks if the current translation doesn't "kick" the whole RNA out of the panel, and corrects the situation if necessary.


getLeftOffset

public int getLeftOffset()
Returns the "real pixels" x-coordinate of the RNA.

Returns:
X-coordinate of the translation

getInnerWidth

public int getInnerWidth()
Returns the "real pixels" width of the drawing surface for our RNA.

Returns:
Width of the drawing surface for our RNA

getTopOffset

public int getTopOffset()
Returns the "real pixels" y-coordinate of the RNA.

Returns:
Y-coordinate of the translation

getInnerHeight

public int getInnerHeight()
Returns the "real pixels" height of the drawing surface for our RNA.

Returns:
Height of the drawing surface for our RNA

isComparisonMode

public boolean isComparisonMode()
Checks if the current mode is the "comparison" mode

Returns:
True if comparison, false otherwise

globalRotation

public void globalRotation(Double angleDegres)
Rotates the RNA coordinates by a certain angle

Parameters:
angleDegres - Rotation angle, in degrees

getNearestBase

public Integer getNearestBase()
Returns the index of the currently selected base, defaulting to the closest base to the last mouse-click.

Returns:
Index of the currently selected base

setNearestBase

public void setNearestBase(Integer base)
Sets the index of the currently selected base.

Parameters:
base - Index of the new selected base

getGapsBasesColor

public Color getGapsBasesColor()
Returns the color used to draw 'Gaps' bases in comparison mode

Returns:
Color used for 'Gaps'

setGapsBasesColor

public void setGapsBasesColor(Color c)
Sets the color to use for 'Gaps' bases in comparison mode

Parameters:
c - Color used for 'Gaps'

imprimer

private void imprimer()

isErrorsOn

public boolean isErrorsOn()
Checks whether errors are to be displayed

Returns:
Error display status

setErrorsOn

public void setErrorsOn(boolean on)
Sets whether errors are to be displayed

Parameters:
on - New error display status

getVARNAUI

public VueUI getVARNAUI()
Returns the view associated with user interactions

Returns:
A view associated with user interactions

setUseBaseColorsForBPs

public void setUseBaseColorsForBPs(boolean on)
Toggles on/off using base inner color for drawing base-pairs

Parameters:
on - True for using base inner color for drawing base-pairs, false for classic mode

getUseBaseColorsForBPs

public boolean getUseBaseColorsForBPs()
Returns true if current base color is used as inner color for drawing base-pairs

Returns:
True for using base inner color for drawing base-pairs, false for classic mode

setColorNonStandardBases

public void setColorNonStandardBases(boolean on)
Toggles on/off using a special color used for drawing "non-standard" bases

Parameters:
on - True for using a special color used for drawing "non-standard" bases, false for classic mode

getColorSpecialBases

public boolean getColorSpecialBases()
Returns true if a special color is used as inner color for non-standard base

Returns:
True for using a special color used for drawing "non-standard" bases, false for classic mode

setColorGapsBases

public void setColorGapsBases(boolean on)
Toggles on/off using a special color used for drawing "Gaps" bases in comparison mode

Parameters:
on - True for using a special color used for drawing "Gaps" bases in comparison mode, false for classic mode

getColorGapsBases

public boolean getColorGapsBases()
Returns true if a special color is used for drawing "Gaps" bases in comparison mode

Returns:
True for using a special color used for drawing "Gaps" bases in comparison mode, false for classic mode

setShowWarnings

public void setShowWarnings(boolean on)
Toggles on/off displaying warnings

Parameters:
on - True to display warnings, false otherwise

getShowWarnings

public boolean getShowWarnings()
Get current warning display status

Returns:
True to display warnings, false otherwise

setShowNonCanonicalBP

public void setShowNonCanonicalBP(boolean on)
Toggles on/off displaying non-canonical base-pairs

Parameters:
on - True to display NC base-pairs, false otherwise

getShowNonCanonicalBP

public boolean getShowNonCanonicalBP()
Return the current display status for non-canonical base-pairs

Returns:
True if NC base-pairs are displayed, false otherwise

setShowNonPlanarBP

public void setShowNonPlanarBP(boolean on)
Toggles on/off displaying "non-planar" base-pairs

Parameters:
on - True to display "non-planar" base-pairs, false otherwise

getShowNonPlanarBP

public boolean getShowNonPlanarBP()
Return the current display status for non-planar base-pairs

Returns:
True if non-planars base-pairs are displayed, false otherwise

setBPStyle

public void setBPStyle(VARNAConfig.BP_STYLE st)
Sets the base-pair representation style

Parameters:
st - The new base-pair style

getBPStyle

public VARNAConfig.BP_STYLE getBPStyle()
Returns the base-pair representation style

Returns:
The current base-pair style

getConfig

public VARNAConfig getConfig()
Returns the current VARNA Panel configuration. The returned instance should not be modified directly, but rather through the getters/setters from the VARNAPanel class.

Returns:
Current configuration

setBackground

public void setBackground(Color c)
Sets the background color

Overrides:
setBackground in class JComponent
Parameters:
c - New background color

highlightSelectedBase

public void highlightSelectedBase(ModeleBase m)
Starts highlighting the selected base.


highlightSelectedStem

public void highlightSelectedStem(ModeleBase m)
Starts highlighting the selected base.


getSelection

public BaseList getSelection()

getSelectionIndices

public ArrayList<Integer> getSelectionIndices()

setSelection

public void setSelection(ArrayList<Integer> indices)

setSelection

public void setSelection(Collection<? extends ModeleBase> mbs)

getBasesInRectangleDiff

public ArrayList<Integer> getBasesInRectangleDiff(Rectangle recIn,
                                                  Rectangle recOut)

getBasesInRectangle

public ArrayList<Integer> getBasesInRectangle(Rectangle rec)

setSelectionRectangle

public void setSelectionRectangle(Rectangle rec)

removeSelectionRectangle

public void removeSelectionRectangle()

addToSelection

public void addToSelection(Collection<? extends Integer> indices)

addToSelection

public void addToSelection(int i)

removeFromSelection

public void removeFromSelection(int i)

isInSelection

public boolean isInSelection(int i)

toggleSelection

public void toggleSelection(int i)

toggleSelection

public void toggleSelection(Collection<? extends Integer> indices)

clearSelection

public void clearSelection()
Stops highlighting bases


saveSelection

public void saveSelection()

restoreSelection

public void restoreSelection()

resetAnnotationHighlight

public void resetAnnotationHighlight()
Stops highlighting bases


drawBBox

public void drawBBox(boolean on)
Toggles on/off a rectangular outline of the bounding box.

Parameters:
on - True to draw the bounding box, false otherwise

drawBorder

public void drawBorder(boolean on)
Toggles on/off a rectangular outline of the border.

Parameters:
on - True to draw the bounding box, false otherwise

setBaseInnerColor

public void setBaseInnerColor(Color c)

setBaseNumbersColor

public void setBaseNumbersColor(Color c)

setBaseNameColor

public void setBaseNameColor(Color c)

setBaseOutlineColor

public void setBaseOutlineColor(Color c)

getListeAnnotations

public ArrayList<TextAnnotation> getListeAnnotations()

resetListeAnnotations

public void resetListeAnnotations()

addAnnotation

public void addAnnotation(TextAnnotation textAnnotation)

removeAnnotation

public boolean removeAnnotation(TextAnnotation textAnnotation)

get_selectedAnnotation

public TextAnnotation get_selectedAnnotation()

set_selectedAnnotation

public void set_selectedAnnotation(TextAnnotation annotation)

removeSelectedAnnotation

public void removeSelectedAnnotation()

highlightSelectedAnnotation

public void highlightSelectedAnnotation()

getFlatExteriorLoop

public boolean getFlatExteriorLoop()

setFlatExteriorLoop

public void setFlatExteriorLoop(boolean on)

setLastSelectedPosition

public void setLastSelectedPosition(Point2D.Double p)

getLastSelectedPosition

public Point2D.Double getLastSelectedPosition()

setSequence

public void setSequence(String s)

setColorMapVisible

public void setColorMapVisible(boolean b)

getColorMapVisible

public boolean getColorMapVisible()

removeColorMap

public void removeColorMap()

saveSession

public void saveSession(String path)

loadSession

public FullBackup loadSession(String path)
                       throws fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
Throws:
fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed

importSession

public static FullBackup importSession(String path)
                                throws fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
Throws:
fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed

importSession

public static FullBackup importSession(InputStream fis,
                                       String path)
                                throws fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
Throws:
fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed

loadFile

public void loadFile(String path)

getDrawBackbone

public boolean getDrawBackbone()

setDrawBackbone

public void setDrawBackbone(boolean b)

addHighlightRegion

public void addHighlightRegion(HighlightRegionAnnotation n)

removeHighlightRegion

public void removeHighlightRegion(HighlightRegionAnnotation n)

addHighlightRegion

public void addHighlightRegion(int i,
                               int j)

addHighlightRegion

public void addHighlightRegion(int i,
                               int j,
                               Color fill,
                               Color outline,
                               double radius)

loadFile

public void loadFile(String path,
                     boolean interpolate)

setConfig

public void setConfig(VARNAConfig cfg)

toggleDrawOutlineBase

public void toggleDrawOutlineBase()

toggleFillBase

public void toggleFillBase()

readValues

public void readValues(Reader r)

addVARNAListener

public void addVARNAListener(InterfaceVARNAListener v)

fireLayoutChanged

public void fireLayoutChanged()

fireUINewStructure

public void fireUINewStructure()

addSelectionListener

public void addSelectionListener(InterfaceVARNASelectionListener v)

fireSelectionChanged

public void fireSelectionChanged(BaseList mold,
                                 BaseList mnew)

fireHoverChanged

public void fireHoverChanged(ModeleBase mold,
                             ModeleBase mnew)

addRNAListener

public void addRNAListener(InterfaceVARNARNAListener v)

fireSequenceChanged

public void fireSequenceChanged(int index,
                                String oldseq,
                                String newseq)

fireStructureChanged

public void fireStructureChanged(Set<ModeleBP> current,
                                 Set<ModeleBP> addedBasePairs,
                                 Set<ModeleBP> removedBasePairs)

fireLayoutChanged

public void fireLayoutChanged(Hashtable<Integer,Point2D.Double> movedPositions)

getOrientation

public double getOrientation()

setHoverBase

public void setHoverBase(ModeleBase m)