|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
fr.orsay.lri.varna.VARNAPanel
public class VARNAPanel
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);
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 |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private RNA _RNA
private boolean _debug
private VARNAConfig _conf
private ArrayList<InterfaceVARNAListener> _VARNAListeners
private ArrayList<InterfaceVARNASelectionListener> _selectionListeners
private ArrayList<InterfaceVARNARNAListener> _RNAListeners
UndoManager _manager
private Point2D.Double[] _realCoords
private Point2D.Double[] _realCenters
private double _scaleFactor
private Point2D.Double _offsetPanel
private Point2D.Double _offsetRNA
private double _offX
private double _offY
private fr.orsay.lri.varna.controlers.ControleurBlinkingThread _blink
private BaseList _selectedBases
private ArrayList<ModeleBase> _backupSelection
private Integer _nearestBase
private Point2D.Double _lastSelectedCoord
private Point2D.Double _linkOrigin
private Point2D.Double _linkDestination
private Rectangle _selectionRectangle
private boolean _highlightAnnotation
private int _titleHeight
private Dimension _border
private boolean _drawBBox
private boolean _drawBorder
private Point _translation
private boolean _horsCadre
private boolean _premierAffichage
private fr.orsay.lri.varna.controlers.ControleurInterpolator _interpolator
private VueMenu _popup
private VueUI _UI
private TextAnnotation _selectedAnnotation
public static String VARNA_SESSION_EXTENSION
public ModeleBase _hoveredBase
Constructor Detail |
---|
public VARNAPanel() throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
public VARNAPanel(String seq, String str) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
seq
- The raw nucleotide sequencestr
- The secondary structure in DBN format
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
public VARNAPanel(String seq, String str, int drawMode) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
seq
- The raw nucleotide sequencestr
- The secondary structure in DBN formatdrawMode
- The drawing mode
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
RNA.DRAW_MODE_RADIATE
,
RNA.DRAW_MODE_CIRCULAR
,
RNA.DRAW_MODE_NAVIEW
public VARNAPanel(Reader r) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength, fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
public VARNAPanel(Reader r, int drawMode) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength, fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
public VARNAPanel(Reader r, int drawMode, String title) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength, fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
public VARNAPanel(RNA r)
r
- The RNA to be displayed within this panelpublic VARNAPanel(String seq, String str, int drawMode, String title) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
seq
- The raw nucleotide sequencestr
- The secondary structure in DBN formatdrawMode
- The drawing modetitle
- The panel title
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
RNA.DRAW_MODE_CIRCULAR
,
RNA.DRAW_MODE_RADIATE
,
RNA.DRAW_MODE_NAVIEW
public VARNAPanel(String seq1, String struct1, String seq2, String struct2, int drawMode, String title)
Method Detail |
---|
public void setOriginLink(Point2D.Double p)
public void setDestinationLink(Point2D.Double p)
public void removeLink()
private void init()
public void undo()
public void redo()
public void setTitleFontStyle(int newStyle)
newStyle
- An int that describes the new font style ("PLAIN","BOLD",
"BOLDITALIC", or "ITALIC")public void setTitleFontSize(float newSize)
newSize
- The new size of the title fontpublic void setTitleFontFamily(String newFamily)
newFamily
- New font family used for the titlepublic void setTitleFontColor(Color newColor)
newColor
- A color used to draw the titlepublic void setBaseFontSize(Float size)
size
- Font size for base captionpublic void setNumbersFontSize(Float size)
size
- Font size for base captionpublic void setBaseFontStyle(int style)
style
- An int that describes the new font style ("PLAIN","BOLD",
"BOLDITALIC", or "ITALIC")private void updateTitleHeight()
public void setTitle(String title)
title
- The new titlepublic void setNumPeriod(int n)
n
- New numbering periodpublic int getNumPeriod()
private void setAutoFit(boolean fit)
public void lockScrolling()
public void unlockScrolling()
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)
private void drawBasePair(VueVARNAGraphics g2D, Point2D.Double orig, Point2D.Double dest, ModeleBP style, double newRadius)
private Color getHighlightedVersion(Color c1, Color c2)
private Color highlightFilter(int index, Color initialColor, Color c1, Color c2)
private Point2D.Double computeExcentricUnitVector(int i, Point2D.Double[] points, Point2D.Double[] centers)
private void drawBase(VueVARNAGraphics g2D, int i, Point2D.Double[] points, Point2D.Double[] centers, double newRadius)
void drawChemProbAnnotation(VueVARNAGraphics g2D, ChemProbAnnotation cpa, Point2D.Double anchor, double scaleFactor)
Point2D.Double buildCaptionPosition(ModeleBase mb, double scaleFactor, double heightEstimate)
private void renderAnnotations(VueVARNAGraphics g2D, double offX, double offY, double rnaBBoxX, double rnaBBoxY, double scaleFactor)
public Rectangle2D.Double getExtendedRNABBox()
public void drawBackbone(VueVARNAGraphics g2D, Point2D.Double[] newCoords, double newRadius)
public Point2D.Double logicToPanel(Point2D.Double logicPoint)
private void renderRNA(VueVARNAGraphics g2D, Rectangle2D.Double bbox)
public ModeleBase getBaseAt(Point2D.Double po)
public void setColorMapValues(Double[] values)
public void setColorMapMaxValue(double d)
public void setColorMapMinValue(double d)
public ModeleColorMap getColorMap()
public void setColorMap(ModeleColorMap cm)
public void setColorMapCaption(String caption)
public String getColorMapCaption()
public void drawColorMap(boolean draw)
private double getColorMapHeight()
private void drawColorMap(VueVARNAGraphics g2D, double scaleFactor, Rectangle2D.Double rnabbox)
public Point2D.Double panelToLogicPoint(Point2D.Double p)
public Point2D.Double transformCoord(Point2D.Double coordDebut, double offX, double offY, double rnaBBoxX, double rnaBBoxY, double scaleFactor)
public void eraseSequence()
public Point2D.Double transformCoord(Point2D.Double coordDebut)
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public void paintComponent(Graphics g, boolean transparentBackground)
public void renderComponent(VueVARNAGraphics g2D, boolean transparentBackground)
g2D
- A graphical devicetransparentBackground
- Whether the background should be transparent, or drawn.public void drawRegionHighlightsAnnotation(VueVARNAGraphics g2D, Point2D.Double[] realCoords, Point2D.Double[] realCenters, double scaleFactor)
private Rectangle2D.Double getClip()
public Color getBackboneColor()
public void setBackboneColor(Color backbone_color)
backbone_color
- The new color for the backbone boundspublic Color getBondColor()
public String getTitle()
public void setDefaultBPColor(Color bond_color)
bond_color
- The new color for hydrogen bondspublic void setBorderSize(Dimension b)
b
- The new border sizepublic Dimension getBorderSize()
public void showRNA(RNA r)
r
- An already drawn RNA to display in this panelpublic void drawRNA(String seq, String str) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
((((((((....))))..(((((...))).))))))
true
if the sequence/structure couple could be
parsed into a valid secondary structure, and false
otherwise.
seq
- The raw nucleotides sequencestr
- The secondary structure
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
public void drawRNA(RNA r, int drawMode)
r
- The new secondary structuredrawMode
- The drawing algorithmpublic void drawRNA()
public void drawRNA(RNA r)
r
- The new secondary structurepublic void drawRNA(String seq, String str, int drawMode) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
((((((((....))))..(((((...))).))))))
true
if the sequence/structure couple could be
parsed into a valid secondary structure, and false
otherwise.
seq
- The raw nucleotides sequencestr
- The secondary structuredrawMode
- The drawing algorithm
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
public void drawRNA(Reader r, int drawMode) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength, fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax
public void drawRNAInterpolated(String seq, String str) throws fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
seq
- Sequencestr
- Structure in dot bracket notation
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
- If len(seq)!=len(str)public void drawRNAInterpolated(String seq, String str, int drawMode)
seq
- Sequencestr
- Structure in dot bracket notationdrawMode
- The drawing algorithm to be used for the initial placement
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
- If len(seq)!=len(str)public void drawRNAInterpolated(String seq, String str, Mapping m)
seq
- Sequencestr
- Structure in dot bracket notationm
- A mapping between the currently rendered structure and its
successor (seq,str)
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
- If len(seq)!=len(str)public void drawRNAInterpolated(String seq, String str, int drawMode, Mapping m)
seq
- Sequencestr
- Structure in dot bracket notationdrawMode
- The drawing algorithm to be used for the initial placementm
- A mapping between the currently rendered structure and its
successor (seq,str)public void drawRNAInterpolated(RNA target)
target
- Secondary structurepublic void drawRNAInterpolated(RNA target, Mapping m)
target
- Secondary structurem
- A mapping between the currently rendered structure and its
successor (seq,str)public void drawRNAInterpolated(RNA target, int drawMode, Mapping m)
target
- Secondary structure of RNAdrawMode
- The drawing algorithm to be used for the initial placementm
- A mapping between the currently rendered structure and its
successor (seq,str)public int getDrawMode()
public void showRNA(RNA t, VARNAConfig cfg)
public boolean isInterpolationInProgress()
public void showRNAInterpolated(RNA target)
target
- Secondary structure of RNApublic void showRNAInterpolated(RNA target, Mapping m)
target
- Secondary structure of RNAm
- A mapping between the currently rendered structure and its
successor (seq,str)
fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength
- If len(seq)!=len(str)public void showRNAInterpolated(RNA target, VARNAConfig cfg, Mapping m)
public void drawRNA(String firstSeq, String firstStruct, String secondSeq, String secondStruct, int drawMode)
((((((((....))))..(((((...))).))))))
firstSeq
- The first RNA raw nucleotides sequencefirstStruct
- The first RNA secondary structuresecondSeq
- The second RNA raw nucleotides sequencesecondStruct
- The second RNA secondary structuredrawMode
- The drawing algorithmpublic Point2D.Double[] getRealCoords()
public void setRealCoords(Point2D.Double[] coords)
coords
- New coordinatespublic VueMenu getPopup()
public void setBondColor(Color bond_color)
bond_color
- The color of hydrogen bondspublic Color getTitleColor()
public void setTitleColor(Color title_color)
title_color
- The new color used to draw the titleprivate int getTitleHeight()
private void setTitleHeight(int title_height)
title_height
- The height taken by the titlepublic boolean isAutoCentered()
public void setAutoCenter(boolean center)
center
- New auto-centered statepublic Font getTitleFont()
public void setTitleFont(Font font)
font
- New title fontpublic double getBPHeightIncrement()
public void setBPHeightIncrement(double inc)
inc
- New height incrementpublic double getScaleFactor()
public void setScaleFactor(double factor)
factor
- New scale factorpublic Point2D.Double getOffsetPanel()
public Point2D.Double getRNAOffset()
public VueMenu getPopupMenu()
public double getZoomIncrement()
public void setZoomIncrement(Object amount)
amount
- Atomic zoom factor incrementpublic void setZoomIncrement(double amount)
amount
- Atomic zoom factor incrementpublic double getZoom()
public void setZoom(Object _zoom)
_zoom
- New zoom factorpublic Point getTranslation()
public void setTranslation(Point trans)
trans
- A vector describing the new translationpublic RNA getRNA()
public boolean isOutOfFrame()
public void errorDialog(Exception error)
error
- The exception to display within the Dialogpublic void errorDialog(Exception error, Component c)
error
- The exception to display within the Dialogc
- Parent component for the dialog boxsetErrorsOn(boolean)
public static void errorDialogStatic(Exception error, Component c)
error
- The exception to display within the Dialogc
- Parent component for the dialog boxpublic void emitWarning(String warning)
warning
- A message expliciting the warningsetShowWarnings(boolean)
public void setModifiable(boolean modifiable)
modifiable
- Modification statuspublic boolean isModifiable()
public void reset()
public Color getNonStandardBasesColor()
public void setNonStandardBasesColor(Color basesColor)
basesColor
- The color used to draw non-standard basespublic void checkTranslation()
public int getLeftOffset()
public int getInnerWidth()
public int getTopOffset()
public int getInnerHeight()
public boolean isComparisonMode()
public void globalRotation(Double angleDegres)
angleDegres
- Rotation angle, in degreespublic Integer getNearestBase()
public void setNearestBase(Integer base)
base
- Index of the new selected basepublic Color getGapsBasesColor()
public void setGapsBasesColor(Color c)
c
- Color used for 'Gaps'private void imprimer()
public boolean isErrorsOn()
public void setErrorsOn(boolean on)
on
- New error display statuspublic VueUI getVARNAUI()
public void setUseBaseColorsForBPs(boolean on)
on
- True for using base inner color for drawing base-pairs, false
for classic modepublic boolean getUseBaseColorsForBPs()
public void setColorNonStandardBases(boolean on)
on
- True for using a special color used for drawing "non-standard"
bases, false for classic modepublic boolean getColorSpecialBases()
public void setColorGapsBases(boolean on)
on
- True for using a special color used for drawing "Gaps" bases
in comparison mode, false for classic modepublic boolean getColorGapsBases()
public void setShowWarnings(boolean on)
on
- True to display warnings, false otherwisepublic boolean getShowWarnings()
public void setShowNonCanonicalBP(boolean on)
on
- True to display NC base-pairs, false otherwisepublic boolean getShowNonCanonicalBP()
public void setShowNonPlanarBP(boolean on)
on
- True to display "non-planar" base-pairs, false otherwisepublic boolean getShowNonPlanarBP()
public void setBPStyle(VARNAConfig.BP_STYLE st)
st
- The new base-pair stylepublic VARNAConfig.BP_STYLE getBPStyle()
public VARNAConfig getConfig()
public void setBackground(Color c)
setBackground
in class JComponent
c
- New background colorpublic void highlightSelectedBase(ModeleBase m)
public void highlightSelectedStem(ModeleBase m)
public BaseList getSelection()
public ArrayList<Integer> getSelectionIndices()
public void setSelection(ArrayList<Integer> indices)
public void setSelection(Collection<? extends ModeleBase> mbs)
public ArrayList<Integer> getBasesInRectangleDiff(Rectangle recIn, Rectangle recOut)
public ArrayList<Integer> getBasesInRectangle(Rectangle rec)
public void setSelectionRectangle(Rectangle rec)
public void removeSelectionRectangle()
public void addToSelection(Collection<? extends Integer> indices)
public void addToSelection(int i)
public void removeFromSelection(int i)
public boolean isInSelection(int i)
public void toggleSelection(int i)
public void toggleSelection(Collection<? extends Integer> indices)
public void clearSelection()
public void saveSelection()
public void restoreSelection()
public void resetAnnotationHighlight()
public void drawBBox(boolean on)
on
- True to draw the bounding box, false otherwisepublic void drawBorder(boolean on)
on
- True to draw the bounding box, false otherwisepublic void setBaseInnerColor(Color c)
public void setBaseNumbersColor(Color c)
public void setBaseNameColor(Color c)
public void setBaseOutlineColor(Color c)
public ArrayList<TextAnnotation> getListeAnnotations()
public void resetListeAnnotations()
public void addAnnotation(TextAnnotation textAnnotation)
public boolean removeAnnotation(TextAnnotation textAnnotation)
public TextAnnotation get_selectedAnnotation()
public void set_selectedAnnotation(TextAnnotation annotation)
public void removeSelectedAnnotation()
public void highlightSelectedAnnotation()
public boolean getFlatExteriorLoop()
public void setFlatExteriorLoop(boolean on)
public void setLastSelectedPosition(Point2D.Double p)
public Point2D.Double getLastSelectedPosition()
public void setSequence(String s)
public void setColorMapVisible(boolean b)
public boolean getColorMapVisible()
public void removeColorMap()
public void saveSession(String path)
public FullBackup loadSession(String path) throws fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
public static FullBackup importSession(String path) throws fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
public static FullBackup importSession(InputStream fis, String path) throws fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed
public void loadFile(String path)
public boolean getDrawBackbone()
public void setDrawBackbone(boolean b)
public void addHighlightRegion(HighlightRegionAnnotation n)
public void removeHighlightRegion(HighlightRegionAnnotation n)
public void addHighlightRegion(int i, int j)
public void addHighlightRegion(int i, int j, Color fill, Color outline, double radius)
public void loadFile(String path, boolean interpolate)
public void setConfig(VARNAConfig cfg)
public void toggleDrawOutlineBase()
public void toggleFillBase()
public void readValues(Reader r)
public void addVARNAListener(InterfaceVARNAListener v)
public void fireLayoutChanged()
public void fireUINewStructure()
public void addSelectionListener(InterfaceVARNASelectionListener v)
public void fireSelectionChanged(BaseList mold, BaseList mnew)
public void fireHoverChanged(ModeleBase mold, ModeleBase mnew)
public void addRNAListener(InterfaceVARNARNAListener v)
public void fireSequenceChanged(int index, String oldseq, String newseq)
public void fireStructureChanged(Set<ModeleBP> current, Set<ModeleBP> addedBasePairs, Set<ModeleBP> removedBasePairs)
public void fireLayoutChanged(Hashtable<Integer,Point2D.Double> movedPositions)
public double getOrientation()
public void setHoverBase(ModeleBase m)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |