PK@g?META-INF/MANIFEST.MFGڲ6ήQ4ַ-__YL3V}e(;rMì^l鋶L<7 Pf 7iܸB4n^Gˍ(?9*{'ӸE vqoT& CO}"?OnW?n)h; y;! Ψ !H ܐL<;#FÕl,Z=x;s,m$TabQK[p{>8Iκ}Һ(~39.E`!;~6}9QQݹ[6*0.jHzO//8 Th1cmIYNzrI_^|}/F4*#eD=SK Q&% =A+f3dPO{99b< ]Z C5Sfx o?uG)NmFS۵>:|tg?dEQ_NE܍& @WřSc9̕bY|=jxjozx ,}kpC Te.Mv9smiק4hv- rL>Ű8(CΩCK^|VĤ촡OugŇOG84p Q: J8KZE<@F>^/_\.:N[#] 4lG6[i }RjZ,QFT,Un8Jna6A~U^1BA:*r{@<IY"97W&fgS{vA< ݒ=E%˲/t^`?~bī~M3P| W诫5dUʯrs[c>]jɕe8) 0LD1 lv.jƯg\^4㲻Lُ(QYrq WUaΟxDk6;!smM[ OTM x&zžM?PL@NEuE&]bJMkEr$;>׀͔7_祐`M}қ ]\lVeNzj5%!Rݧa:](sH_ p{9O g)I >__\KVpmNR^ Fwۋ/ h'~뗽e݃n:+7å#B}2t{Z.\_L_wAMGߖ awS+"Ae!pu窟ˠ BԕM@h ϩ䎛O,Kn])S)zQG{N|^fOQ5Ց/~uo~kM5XbtD<:]37~X/> .etCͶu|&vKMM _TO6-+6KW}u>ȪC,Vg{7^꫌O"q=Ӟ!:j}AFũM< 6"B8;#AGʉŊ1E !ߟ7~.y_P38#$2#r(0!:uZI\nyW& bw)YSp"9m=avQJ; P8Wz=Nɸ.ܦ*U4Ν#+MiI [ ;xo:ͳRggslhb=%vvቫGHu؃E~^L_/x;ّ'Y7Z 3;%)oO < 2 Z ?(^KFm-h{29_xlY+RQWmëN{==@DNGDiځ+=ʳfpIq07c Y \ 3-IUUCmkNu(\ґ8'{[XX1 hN+8Y1ė],WUub$M6j/r$"ŌR!q1Bfi7~`BgP6h`iha·zb^;?S_n_x?qGnwXO8QnϞZ^L(z*6z/ dXݹ2A6xv\#'exִ<:8IxkNgУ${1X`Hmgo7+lnPj0?gʷ(n碋uɻ[K.a t?JnvY)u\a|:1ރ2/v6)u]%'3*>i2|yyTW)="cNݲOIt`Fy?hKW火o]"gBBAy62u?o(0涯=d^dnO jT#1Z> D. NQMonN)yJб2+# ǥ,|ֲ_ߙЀMۣM`[亷*ѿ;hŌ.} _(sIiDm %b@KXpf,kU)H۹ 6;),sV'g+k ȶ_E8oISg*="L,}ܕ²p,Ke-Ƚ1S!+zTZU-^r~-b]QZ?my꧸%.|b"kNAh *(noڲem} vR OCn~N U"90HZ數F0)I˛A7cpJ\՞LH-%!:;V`C+Wu>uD(U0,VQŗrp]dD"R8˯6\wX>LUy "IE s<09[V$6EW{unAzt@F:a؉X\TDXŲv݇*T^MX[Ƚjk8灒MA჻G{;R>~1/k}xfV;^źUx8:u/8Эl#mfLlɗ>kDըSɋSؓ֗OsGὬ1nH]E{^$GHJ|/yhȍQ>Zj[u}yꀽE Դťˁ>%r=n$;#s:>1.&䑔^Fu4Յ&ר.kikv0!RT[^] mZc ?-%9kx<ЌgV1`6{!Wu TV;mjͦgkNG?UZύwPGrIxCg2G!n˛_̾<<7^Jߛ;dmCo=|Ѿn!M9AiNfoZb Zh VJ9 ry 2]w0":1Hwb6w3nђ8`=Eyyۄ,}AO?H=-Bkot9gUT,'P}SϠ~j=碅FXI{ h@ȫ*KRT& tlV!ޑ:A+fSkI;;V]sGz]ntxZ3$Q=|Qڨpn=Y{nm",?{Q%77&z(b[-wt' u5zv\a$c DcMMy8q\ઑ%tԛQ[=E{UMObe+|Ҹ´5[Md:ʏ:8 >dA76H#&rlA?<=|UvV9̥zR!=Eݤ{OlƚgLISխbTd7Q͓uS~Fg̫bnN#H(kYjx=csP}DyY Z #% L~Ni`-[*:= K|zZ;0 =0G@Ik9U)9VȊi# =Vw.gXgXXY$LR9vn0e ` +U%@7iaC32Uy Gg:rODX,v |ni#²2oW2pvUKc.Bg#?Z";F{Xkj/$$~^"uS`u/ҿjV&au!ÊqkΚ@?ec ]ClzawШ(N&,Zp 56=w ]lDZgK QUjPXGXdɵ'܎IFXKu;4e,ҾzU7VƕIi>_\'ET[*ܶv ڞ-OC V#n~4wew:@\}B>ui 5ٮM<{W`8f?YQV\2$jᗼKycJ&T)xɅsz|0F9k{ :Oeu8s3+W=`cP,k8z^m.o ?ʽvdMzbQ`%fa/)/(m=%DQ,# KO9۲(83KmxY[aoҷyӨSՐv|.#${]T( t^ D$: j}'u8Ru'ASݠ3kBlS6qէ{ˏ0☧} c8`d? R/G r$ܡRmV=ˆ^xET/Vpv(cPdNp(<PL@_@#CjbP6nO60 pHfRKe©m{ i=맼)b|5ʯ4\q!X6։vK cV"iQ +jZfL -st7&Hl61|U.gڮSi4!g$EqLWiNk4 cL M{-nI܅B)v d 5>jm_@ޡ9s^Ϋ),R]ZW;ˎ?Ag5Z߈sN!|V@<4GOА:t_s c ~꠽jJq Q-ttڜz.zb{鵠^K4C1cJ_J+Gt]\BK$}t#>j5\yCKY4fŔ}S#{}Ta Ia^D2HvҜg P4N '5J^q}TFP<-_ ibL v8fG[5CN[1B3Ok_ݽqV 3Ex Cuw+U 6*F]uɔl]{C*'J"X^~uXZLU-#Q=u0~޵@_h[v6@ݩrr>QmPh}`egVM"vć"ax<+묺kN󕘬5Ya܁V~ls;Z,C>[C#UWBR:i?^2{7ܘT\76簍KXT]ЌW%L|ْ:q;}Vзn׷~wV4}+vqU)úUj12j‡X<5AFwp(6“߉_MZT5;|R-׈Z=Bҟ[ڶ$JBܯ}Wz=⧰ԌY`c:a]ZWw9˛j6mw%O'ҥLHw]B1TEk]zgU˅yp_Z)6iH^0Fteudaz Gs] Y2:;$%wFkzAljm oo-qsL#uYXRS|.eUv*cj2$lNw&h"\;[DLBft.+:ElX4p깻 B֊,{@.ɰ+5s9#37G1Kz K/:JӬX:rΓ.&By64ƥ7bt  јXtrgFtT6\Fr)n%Ȏ3=&8.>JJôc묗txXx;xM% ͗XAoܩ+_ya՗] o9d h!/pHS*ǰcKj}ttZG4O)wKr@UA]z,]׫jQ:ܴ&u#D"3&.}h> 2uT n~:bmt"x/>$n-YʆK-P NȸC8(BLnLՉop)x^_vBb:EQ=ԻT)BI6 _Φ HPDw_^38  j_zױ5)𴥞*3 Ǵ 3ba7T3?=]4!@evoXPwv:OfiR8Nl*(>\Q mbUZ0wg (gh$`` g|\>8Cq ޿ӱr+Y___xcڰ ^Hki#yxؼk We#36$5csOȕ򓭒V*~{G^  cM-ݻDjScT< pK$~c|f;aʙ[;ڷy=" JAjųPKnkQ뒲|TWdA BxޮZh/cbh3_ZBqė5GF"^֣Bۄo^'Rψ6vT"hם2Kzf#|aM #'`Ӷrk˩_`Zn 14ě! R2㜯8 `"AXAHQ6KEq^rg:棴y@q8Opf.SzÄ\et94wTe yFv+b nk9ͫG=rp|b:~t(2DŽ͚|VzLCǨyԋEK%Ò,hy{ :|gl! Pu+yH[{<Ӱd߲_VQkh_'WY{Ei[r\(iD r<ߧH_ hIPɫ3IE n40L;@3üޅ%a .Xy8"ȹf|^G)s@(jB^0R TI9"NxIiFNDd1Q6k3}\y0`ԁ9g\$HQ9\GQ~Ru)U#mA" I_L35i馕h_` n+yK0oL`#~t Z=̝ /IIɉNUqQx3w16Do]d9~d4wYPVҦUUO0~3j9vynOT|Lп Q[PIF"œfuZ/>t }2k-ЁsVŻvcZ]-5ƞ_oҷ//oQR*zTOӜ= ]wSce%)MgR)<pSf)jYO 7мF@sԮrfRjj+ ΣOΣip6fS‘UV]ȣF@b*e4UO 9Mϧ$)> +r~*6W],5lc>lV ?rs=j"rYyu|Jp,uTw^DEn/Ώg xCD[OQ@P4f7ͤx[mʦ`_reYJקClhGrq֭a:-_`2B"ruF)6+ح6y^]᫫(A#@lfBFH,:*2|63jޠ7IԵB/`ǝӆdm֦1W1UHDSWV=]S |}@ο= \UClu96uJ_2 WF9k笊1--URAx䀔B}] z5;ų۟(XASsݱ<#0Ղ,V9W彿6}nu.Zm][aN>,֗ݳr#.uQf&>\X?C~U+{~yKغ4BH"ʗ\FSid}5#sOUVGS'66L+VTb@["L_^=O[ $GH[ R_~|֛]߼² S jPa3k~;;D*X\F9n2KZYulE..q{0L H̍EL;Ata0˝ϛS5?7u%NDՒ\nt e43zӿy1#/{,ktw)2|X`}fX7El.Оke}{5]u؋W3C F[RQPPKA,6@PK@g?META-INF/JALVIEW.SFGZ ;C 4^ v7O8a&LI$0[orʒxm^{5N77N?]n]r""Y rM'o !/E ſkvA+?#¬%>Ղg$j3~S,J6_a[H(W%_eV6S-SUݣ~8(_*!*L_&$@Po)1.M-8/ڤӏq*=ν-sAW<*3;NǢ{m&C `LtĉdW-Nq [@ݢR\ Dt'~Dﶛ_$8#]?Pm R]Nvv?u)8vRĭ/;n7%_fذrj2$_ ?mFF8Bn-~7qqK]/ hxzGv*٣d 4qio_Z<~8B,v'"8v s/nP:OKsv>h=H\yWkŎx ,n~ 7\MUfNW.~uMK!=]K} 'OM),e;4΁I`bLL 6o6No7/wۑ\XR@\2W0e&*'^qqI,.ۑԢ^+ĐbV=kYqPYbg97k͎S~ܵNew?.a%ȑ kBqPE6p.[k>wya)Pm|[؇ZO ^ ,UR~Ry"rNt9۶W'7@NF-pc1r ﶴϏo[{wA,Pghhr:zl E>/YϥOVBrT!r07^/]6#=v)fr/rhZɀ-X-[Ԙ9;dqV6/|MȪҾb`Yтlil|"P-?n2Z;YܯUXoB.rwejv\nB^Eد*fDG"gu|2WG~ o#1gg5L~7˓[^z^QK1{/O^ɲoAW-Y X\4d '@(CHk9 t[{)R<1457"Ő́!Y6Z,6>6Gj*UotQIJyU+P`uM# sA1oPvx,\$&2 */ "󜲇9#z;alƿd@摥VY%г#d9dOR[Hg 6ZK0l7nt+4W.J1kCj}4֬˘3S7g=OQ44.x"oV:Mp]vc?{LEWAV>N1XnKs$D{ лNKy-F{ 7b%rX6.DËN-o23^1@H{ڀOvp)-YGYHDedcbxV?LGQ/{vEu~%m6O&|&:iڠF#?fv9k[bײ9ߎɛ^ޯF݌lg_=|g?{jTJxwTkP(I5ŕ8:F/YxSNUlETP8{O1*,UA/Y_D&-!߰YM >?v{8x*"6& =}+C^?{a/9CDtT4lTSXO싘4b3{TUQqŒk؜SwHm}JS_?G{ڵZ>ĦHg 6\TH\7-^ёi8f2]ň&'FNOnoB9n{j\݄tj{k_Էm\cJ ȌBfȷ{WU>Q`$Pq\DU?|sBYX# Ur+ŷ Z-`߶%I>-@ X-l&kLSeW3;;/_gy$sN)EͅN uxm\ *+DB0X0((z,IJN͕0 >WP?#6\a2b<пw~єnYyP,iHCQ9ON<%C7GYl4~3B^ۺߋ8嘞d⛥QِE^ J}-w"Tcjdvbm!.Q[ ;^{ԕˎ ȫhpj#2a `n\խu,0 $yDS^K>Ȳ+J" gxt0)SO@ܿ{ =+P_z][үݧ;W8%1(_3:bR uQ krX[x&6J׆WSJϕGPEn!B"9z@uoSt͂y-j!\[nKE'xiɮNŰ:sAC[ yr"Dݧ?ʄ,:x`u|9`$><|/?Ctl콳ZUwbuzmNI Zf ַ`6do!NྐG 5ӌ<-mF̹߭'p%ݓM\p[93y IA*\cА1Ǿ eY-6NV57bCpmi){7`f7r;݅x0q&᳜os8M?$6Qn2h.nC~6#|NYi~TH{j`]|g4mf߀OX,HزY~j1$}e|+{ۭGEߥ43n]c9娮=tXjZ2c+"/ND%܍ Lq2it JMGv0dP>zrϞxo-7ڡ-fbT2?җi7v^ nrj/:G#٠YrZL֎/-^͂&RP/"q_s?vm #†OYOYCD&eש?؇T0j_^=9О-]XڅTg)(rfXU"9ȝ΋uQ$Em=8;Gyk/&^;ujMI^XM4RڡoPLKL9%jrn<ZS̠N9Qs>U 'qYk\IX)$HEdyP;h0_߭ѣ 2qIr>0^Dow:y0q|zA5[_Ɉ㵀MaJJ1tNr:1yK7w1ׁW5G^TNG}Jg]?>*rދOl^_8#: CHGAvzxs߿e}\E mx„ yd }I,p'm/GDɌFq >QvOAP$&AeQx{'؎6l_#\TW8WH4 :A|/=snk{9jA$h&+TS+_-1zr֗ .O0wF\*b7r>]p NOHA(wkg`0J>5\Z790XMLv풮D I,7B?Uj6R`X'gը7eaT 5vkRPv|VTk;=XD4YHvzI" khPfaǁV_"3end.:]ؾU0\7-?e'Yi nEkO`bœJkkE"+$ =s\#dGd?T5v n?@L#@ jr)=|P_h#lG}^Z t9FW\RuLS/gG(ujX*Tg$kQG$jM\60P [vo 7ia2쉝)Ԑ"OZZhUCHIG[jN:$IL@{ cѻ^W> .G;>z\ q_.6-,]B}PTZz3MG4x)i'䔪f; b?7(nFNO,8499t?#,6 $]qf:#kHx&c='ݒ{Ss-{0e7S[n{ Jlէ=//1W:7N;ti,V:(>U;Ȱ8 +VP-P`icE-πWڛ-1[]㕋YH8%⪖FƔ!E rwLD׵amQ͠7r}( ׸*ux&+]';}`wُQH顡6mR>zۻo[̓ۉrV1dbDN݆fy-}IKWѳ@ԝFf#=_[bQͿu^~5c왳3[勑 V4j:);E$#s2un. ?rWJ6xmKRKPZ,m}7̳qi:GJ=P#:x˗@e}* LK-[vtkFE/2~{ڛ &nrN> n-v{vx\FOE'w f/YYT\.H eP&TqERߛ&pZ72W<9P}__;- H:st]$6ዴ?cKH~O 5B6+hCRiZߜo(WG*gV6L3V'#"G]!UYd^9xT+6cf)Ȅx{ yZTeT0b\]T^>4 npߩQRg OfėycnLҘ-'jxe7_6#rrBU<@J ? &:L?#}ߘ>3)-e̓܄wK_HSsd$m)yveV %l1x]Y+K*d%VM֫(CYyǦ`(>6xv>o^,X(G|ғ0eHm0>FrM+t%]ϛ9hڧ_)<VI;6#vGYϝgZ>DYCknc+L8H+`o`_R}*Vk`CLVQ\ъ{YPvx:#v]o#W2b=JBHHrzHtg;)3KE']~+p,bEM&@5sv2yaXn柆d,W^Xi$dnEEM&hmҴʨ@i;`՛ V|V ZmN*Ƈ ~mǞt,rJykwe)R+"4^KR[J8m?W2 6%g7+:3+zZo`wg|[dMKO*'!4?Ap0 5R&zYb38)[26{:b+83GI'Fk),O{l?W-%j\ Ƞ}={y;9iV]wSЭpx6NU5tnO9귷@{]6od=%4\qV輺<_Mbkd~(XURc`+,z]aA&(ےA42 w8U=W!\/yT,<ƞ5- h>P!F9Fovd5G%@{K/,+"vȊ38YsnZWorKڭI{doD U !5+G+ŰqP}ۻ /:yIF%*5 ĹlRei:lSx \ݞpݲTٲ1!kЬ\#)4\"MkQIH{>u@0!;k-tWQqV9xVV7& (*ur/;a=R E V^mM3dXMoz֍#T]}]OS]%?BIEFR1g\gJ/%鞦rKH>*&(lL^Yr'u'Iґئ[p'<}Y"{d^!S|^x zgc-)H>XD~6.-nj75qC?jXmSAxX.F啪KIԕC15]o]H,y 3R{iQwE> &}ƪE9eiQkvT#2նcOpEj|q۾y"~2DpbnwۃAj҇T&=[Ϟ)vOE!i+|#cK2N߳xp݉˪ѫL}pr(+lS9%^YS'eo6{^p6C].NP|{^7eD ث+sNYmp"DTK[eЫDw-@Dkry0mrXW.~V)`@x/E:jӽh[^I\C;$,b]Px=^M\IP\dqj46,Y): 09ƪ9ڿ{i DӾn3_,!/6kK<؇^ٵQU|.w,cQg F馻VRKi/H, ^!?p,|1~"5‡Pⲫ*1x(M'4iXnIQW@xk׽W?`,CYFXʫ,rX⾯`ZVTʖ]a @~ |<"~F @7b*1>l0*B/mZs)b}~QZl @Xphg#j3 >E?=$ߛ{,hT`d?\bDRMq1#9@y}x8\"*"fk%\A렱|hg&6oQ"%7tuwh [ Hiirvq . M~UY*vijfvF_9Mҭ2|ڒ(_&Q AiWi65w։;gC݉nI1&flHXxx>3 9íTK 'Q`&)O޷EN")z?⻄ƾ7rx!FgQP-;x9^4ILС A(⪭Ofz/Mo1~'.EPAp26l\b:r[/.ky?EzwtGlC6fȔ?xfYڗ{gL`SEbFg~H\i1w|ԅBgp"'tO|ymtyȹ*?\t%rβPإ ɃE{+g \k;|՜1RjL0?҃E2Bn00<…{FzOEˑ6XN3x`eVY_ O4.yh:!%{= p!ܴ1NhIt"([|V,.oi+Q|Z&sS}AxCl,:RG 6&;9G_Z̽MsE%[#"NՇ>!󮘺4 [*?Xp);) KfJ/b -]5'>$Q=V1&?/dE# si M4ZWwwހ]y;/6?MlQ[Hw955|ѹfx!okሜ.zz.4#ɩ39bݕ %U5ݬ?e#~-?-"AzNqC?%|X Zm'Kf(|S nqʬg"Nx#vw7qc$z%ma=+թb;Jz`Tl]ZwӊTGޗzrP*.T ݡqI}ER텇ZbvthH[ʄ퐿ve?+~Xn%Yu 08 {\is+/R BbjLLWLZ?ײ~+ !CPPA@ ogd~y"ش0>,lmaWcB$FcKI+׳T`Gð OlkQ3kR@Oy;% hfǵna›V3t[N; %^e0dc+)a)@^/O_m\Mc @σ:|H?x?傅Ԣ1~HQ:c 7/aҶQJOyU/ŝEA(]2uz=ko"Kݡ(e"c8 ax_-֙FZsF:wm$ɞ+fg#"iyuP3[p[]ZYm'u孢p4v;cŋf5$4ȔW"W+1hc1"'`+L;F8jSB7x8s۳ o9+,nYo|{4 ;Gԯ'nnlGFI2=pbh%Ǧ-T Gg[$z!w~-n;3)ڇYhd3}cz^AWnJ[+_7^@N,ޠ4k2`ǃ˥8DfڹuYM1SQ̵hxNaD,WK:=H,h̥)ak_x2/b,nPrg1EVτr@:TIS'Ƚ!/^c.o^hѻ4 J@S[ZSYĪ 'ǹ܋:}Ak,)\)1T64 6`\s et53zf5~~q!?0Y=+$Us@V H%XԱ}O~ӓ(qnbEk"TuHLD>AKjRٝt/%!(Yxha%,/ vBBG!9Mƍ%Ü!.binzZ #W"%gEw~$1:V\{`[uMgV((v_XbpYA`q6|xsP6DZ'Unxp~N;>)N܎NJ g'"V7o02Wz>PK6PK@g?META-INF/JALVIEW.DSA3hb>ƩiAF&Ll|LR E 41L,N@s,@`̡,lLކ<\ 0SǎBqA9q^S## C3cc(0ʥMہX9F Go}plf}9zo<&= a9mjJ#m{#~?uӳCs7Z7ȚJK؞=3`_T (߽ǤX??b(?of2 h:Z?)1KνxIazB@2Mv6-z!B+i.h6=cv﬜~/WM?}mٛ#v]V.ذSPF='=xxesR4M;Q̒VN\|alCUS}bnla`jl`mS~Y#0 B?WM^Ɀ?TtX]@d VARNA3-1 org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature PK 4j=k VARNALinks.csv"Name","URL","Algorithms","Structure edition","Annotation","Pseudoknots support","Non canonical","Export vector","Export pixel","Input formats","Output formats","Platforms","Applet","Non-interactive version","Note" "VARNA","http://varna.lri.fr","NAView, Radiate, linear, circular","Partial","Yes","Yes","Yes","SVG, EPS, XFIG","JPEG, PNG","RNAML, CT, BPSeq, Vienna","CT, BPSeq, Vienna","All (JAVA)","Yes","Yes","Standalone re-usable component" "RNAPLOT","http://www.tbi.univie.ac.at/~ivo/RNA/","NAView, Radiate","No","No","No","No","PS, GML, XRNA, SVG ","-","-","-","Linux, Mac, Win (C)","No","Yes","-" "XRNA","http://rna.ucsc.edu/rnacenter/xrna/xrna.html","Radiate","Yes","Rich","No","No","PS*, XRNA","JPG","XRNA","-","All (JAVA)","No","No","*Postscript support through 'Print/To File'" "RNAViz","http://rnaviz.sourceforge.net/","Radiate","Yes","Yes","No","No","PS*","-","SKL, ALI, STR","STR","All (Tcl/Tk)","No","No","*Postscript support through 'Print/To File'" "NavRNA","http://www.labri.fr/perso/auber/projects/tulip","NavRNA","Yes","Yes","Yes","No","EPS, GML, SVG","BMP, PNG, JPG, ...","TLP","TLP","Linux, Mac, Win (C++)","No","No","-" "SstructView","http://helix-web.stanford.edu/sstructview/home.html","???","???","???","???","No","???","???","Internal","???","All (JAVA)","Yes","No","Looks very similar to VARNA, but no longer supported by default applet security policies. Doesn't run as a standalone application." "RNAMovies","http://bibiserv.techfak.uni-bielefeld.de/rnamovies/","NAView","No","No","Yes","No","SVG","PNG, JPG, GIF","RNM, RNAStructML","-","All (JAVA)","Yes","No","-" "RNA2DViewer/S2S","http://www.bioinformatics.org/s2s/","Radiate","Yes","Partial","Yes","Yes","-","PNG","RNAML, PDB","PDB, CT","All (JAVA)","No","No","Very promising" "jViz.RNA","http://varna.lri.fr/old/jViz.jar","Spring model, linear, circular","Partial","No","Yes","No","EPS*","PNG","CT, BPSeq, Vienna","-","All (JAVA)","No","No","No longer available on public site" "PseudoViewer","http://wilab.inha.ac.kr/pseudoviewer/","Planar map","Partial","No","Yes","No","EPS, SVG","PNG, GIF","Vienna+PK, internal","Vienna+PK","Windows (.net)","No*","No*","*A well-documented webservice can play a similar role, although not on the client side." PK 4j=3@ .classpath PK e}=sv9 9 VARNA.js/** * @author ponty */ function setTitle(appletid,ntitle) { var applet = document.getElementById(appletid); var script = "setTitle(\""+ntitle+"\")"; applet.runScript(script); }; function setSeq(appletid,nseq) { var applet = document.getElementById(appletid); var script = "setSeq(\""+nseq+"\")"; applet.runScript(script); }; function eraseSeq(appletid) { var applet = document.getElementById(appletid); var script = "eraseSeq()"; applet.runScript(script); }; function setStruct(appletid,nstr) { var applet = document.getElementById(appletid); var script = "setStruct(\""+nstr+"\")"; applet.runScript(script); }; function setStructSmooth(appletid,nstr) { var applet = document.getElementById(appletid); var script = "setStructSmooth(\""+nstr+"\")"; applet.runScript(script); }; function setRNA(appletid,nseq,nstr) { var applet = document.getElementById(appletid); var script = "setRNA(\""+nseq+"\",\""+nstr+"\")"; applet.runScript(script); }; function setRNASmooth(appletid,nseq,nstr) { var applet = document.getElementById(appletid); var script = "setRNASmooth(\""+nseq+"\",\""+nstr+"\")"; applet.runScript(script); }; function redraw(appletid,nalgo) { var applet = document.getElementById(appletid); var script = "redraw(\""+nalgo+"\")"; applet.runScript(script); }; function setColorMapValues(appletid,values) { var applet = document.getElementById(appletid); var txt = ""; for(var i=0;i0) txt += ", "; txt += values[i]; } var script = "setValues(["+txt+"])"; applet.runScript(script); }; function setColorMapMinValue(appletid,value) { var applet = document.getElementById(appletid); var script = "setColorMapMinValue("+value+")"; applet.runScript(script); }; function setColorMapMaxValue(appletid,value) { var applet = document.getElementById(appletid); var script = "setColorMapMaxValue("+value+")"; applet.runScript(script); }; function setColorMap(appletid,val) { var applet = document.getElementById(appletid); var script = "setColorMap("+val+")"; applet.runScript(script); }; function setCustomColorMap(appletid,val) { var applet = document.getElementById(appletid); var script = "setCustomColorMap("+val+")"; applet.runScript(script); }; function toggleShowColorMap(appletid) { var applet = document.getElementById(appletid); var script = "toggleShowColorMap()"; applet.runScript(script); }; function getCurrentSelection(appletid) { var applet = document.getElementById(appletid); return applet.getSelection(); }; PK 4F>prr VARNA.class1.VARNAjavax/swing/JApplet6fr/orsay/lri/varna/interfaces/InterfaceParameterLoaderjava/awt/dnd/DropTargetListener_vplLjava/util/ArrayList; Signature6Ljava/util/ArrayList;serialVersionUIDJ ConstantValueCK ()VCode    LineNumberTableLocalVariableTablethisLVARNA;init+fr/orsay/lri/varna/models/VARNAConfigLoader ! ";(Lfr/orsay/lri/varna/interfaces/InterfaceParameterLoader;)V $ %&createVARNAPanels()Ljava/util/ArrayList;(java/awt/dnd/DropTarget *,+java/util/ArrayList -.get(I)Ljava/lang/Object;0java/awt/Component '2 38(Ljava/awt/Component;Ljava/awt/dnd/DropTargetListener;)V *5 67size()I 9;:java/io/IOException <= getMessage()Ljava/lang/String;? VARNA Error ACBjavax/swing/JOptionPane DEshowMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V G;H9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax J;K4fr/orsay/lri/varna/exceptions/ExceptionLoadingFailedMjava/awt/GridLayout O P7 getNbColumns R S7 getNbRows LU V(II)V X YZ setLayout(Ljava/awt/LayoutManager;)V \ ]^getContentPane()Ljava/awt/Container; `bajava/awt/Container cdadd*(Ljava/awt/Component;)Ljava/awt/Component; `f gh setVisible(Z)V `j krepaint monfr/orsay/lri/varna/VARNAPanel pqerrorDialogStatic,(Ljava/lang/Exception;Ljava/awt/Component;)Vs5fr/orsay/lri/varna/exceptions/ExceptionParameterErroruAfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxErrorw5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthVARNAcfg-Lfr/orsay/lri/varna/models/VARNAConfigLoader;iIeLjava/io/IOException;;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;6Lfr/orsay/lri/varna/exceptions/ExceptionLoadingFailed;7Lfr/orsay/lri/varna/exceptions/ExceptionParameterError;CLfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError;7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;getParameterValue8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;   getParameter&(Ljava/lang/String;)Ljava/lang/String;keyLjava/lang/String;defgetParameterInfo()[[Ljava/lang/String;   getPanels8()Ljava/util/ArrayList; getSelection  (I)Ljava/lang/String;[ m &getSelectionIndices ,java/util/Listjava/lang/Integer 7intValuejava/lang/StringBuilder java/lang/String valueOf&(Ljava/lang/Object;)Ljava/lang/String; (Ljava/lang/String;)V, append-(Ljava/lang/String;)Ljava/lang/StringBuilder; =toString (I)Ljava/lang/StringBuilder; 5]panelresultvLfr/orsay/lri/varna/VARNAPanel;lLjava/util/List;nLocalVariableTypeTable%Ljava/util/List; runScript 4fr/orsay/lri/varna/controlers/ControleurScriptParser  executeScript4(Lfr/orsay/lri/varna/VARNAPanel;Ljava/lang/String;)V java/lang/Exception printStackTracescript_vpLjava/lang/Exception;setRNA'(Ljava/lang/String;Ljava/lang/String;)V m drawRNA vseqstrsetSmoothedRNA m drawRNAInterpolated mj dragEnter%(Ljava/awt/dnd/DropTargetDragEvent;)Varg0"Ljava/awt/dnd/DropTargetDragEvent;dragExit!(Ljava/awt/dnd/DropTargetEvent;)VLjava/awt/dnd/DropTargetEvent;dragOverdrop%(Ljava/awt/dnd/DropTargetDropEvent;)V  java/awt/dnd/DropTargetDropEvent getTransferable&()Ljava/awt/datatransfer/Transferable; "java/awt/datatransfer/Transferable getTransferDataFlavors%()[Ljava/awt/datatransfer/DataFlavor;  java/awt/datatransfer/DataFlavor isFlavorJavaFileListType()Z  acceptDrop(I)V  getTransferData6(Ljava/awt/datatransfer/DataFlavor;)Ljava/lang/Object;    getSource()Ljava/lang/Object; '    getComponent()Ljava/awt/Component; java/lang/Object m loadFile(Ljava/lang/String;Z)V  h dropComplete   rejectDropdtde"Ljava/awt/dnd/DropTargetDropEvent;tr$Ljava/awt/datatransfer/Transferable;flavors#[Ljava/awt/datatransfer/DataFlavor;listjoLjava/lang/Object;dtLjava/awt/dnd/DropTarget;cLjava/awt/Component;vppathdropActionChanged SourceFile VARNA.java!    < **92 :  ǻY* L*+#='*)/*1*4-M*,8>@M*,F>@M*,I>@*LY+N+QTW=*[*)/_W*4*[e*[iL+*lL+*l L+*l 699 6HG 6WJrtv > ABD(B9F:G?HBGHIIJNKQJWLXM]N`McPlQsPvR{SRUVWXYZ[\_f  xy#z{: |}I |~X |x$z{|||V*+,*+bc e .j & /*o =0*t ~M*)mN-:6D6Y,MY,MY,M,. yz{|~,1EY|h|H~~{{oiPz{,-{ i$*4*)mM,+ǧN-ͱ #*$$ |#*4*)m+,קN-ڱ v "*###|1*4)*)m+,*)mN-ڱ (+v +,0*111,|555 +M,N6-2z+,-2:6N:+'6+': :  m m: :    +-x+ M,+f !06AKT[cjqy~   z{0c!3Z"{A=#$T*%&[#'( j) q * |+5,-PK n={aKK VARNA.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ import java.awt.Component; import java.awt.GridLayout; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.swing.JApplet; import javax.swing.JOptionPane; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurScriptParser; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; import fr.orsay.lri.varna.exceptions.ExceptionModeleStyleBaseSyntaxError; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionParameterError; import fr.orsay.lri.varna.interfaces.InterfaceParameterLoader; import fr.orsay.lri.varna.models.VARNAConfigLoader; import fr.orsay.lri.varna.models.rna.RNA; public class VARNA extends JApplet implements InterfaceParameterLoader,DropTargetListener { ArrayList _vpl = null; /** * */ private static final long serialVersionUID = -2598221520127067670L; public VARNA() { super(); } public void init() { try { VARNAConfigLoader VARNAcfg = new VARNAConfigLoader(this); try { _vpl = VARNAcfg.createVARNAPanels(); for (int i=0;i<_vpl.size();i++) { new DropTarget(_vpl.get(i), this); } } catch (IOException e) { JOptionPane.showMessageDialog(this, e.getMessage(), "VARNA Error", JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e) { JOptionPane.showMessageDialog(this, e.getMessage(), "VARNA Error", JOptionPane.ERROR_MESSAGE); } catch (ExceptionLoadingFailed e) { JOptionPane.showMessageDialog(this, e.getMessage(), "VARNA Error", JOptionPane.ERROR_MESSAGE); } setLayout(new GridLayout(VARNAcfg.getNbColumns(), VARNAcfg .getNbRows())); for (int i = 0; i < _vpl.size(); i++) { getContentPane().add(_vpl.get(i)); } getContentPane().setVisible(true); getContentPane().repaint(); } catch (ExceptionParameterError e) { VARNAPanel.errorDialogStatic(e, this); } catch (ExceptionModeleStyleBaseSyntaxError e) { VARNAPanel.errorDialogStatic(e, this); } catch (ExceptionNonEqualLength e) { VARNAPanel.errorDialogStatic(e, this); } } public String getParameterValue(String key, String def) { if (getParameter(key) == null) { return def; } else { return getParameter(key); } } public String[][] getParameterInfo() { return VARNAConfigLoader.getParameterInfo(); } public ArrayList getPanels() { return _vpl; } public String getSelection() { return getSelection(0); } public String getSelection(int panel) { String result = "["; VARNAPanel v = _vpl.get(panel); List l = v.getSelectionIndices(); for(int i=0;i0) {result += ",";} result += n; } result += "]"; return result; } public void runScript(String script) { if (_vpl.size()>0) { VARNAPanel _vp = _vpl.get(0); try { ControleurScriptParser.executeScript(_vp, script); } catch (Exception e) { e.printStackTrace(); } } } public void setRNA(String seq, String str) { if (_vpl.size()>0) { try { _vpl.get(0).drawRNA(seq, str); } catch (ExceptionNonEqualLength e) { e.printStackTrace(); } } } public void setSmoothedRNA(String seq, String str) { if (_vpl.size()>0) { try { _vpl.get(0).drawRNAInterpolated(seq, str); _vpl.get(0).repaint(); } catch (ExceptionNonEqualLength e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public void dragEnter(DropTargetDragEvent arg0) { } public void dragExit(DropTargetEvent arg0) { } public void dragOver(DropTargetDragEvent arg0) { } public void drop(DropTargetDropEvent dtde) { try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (flavors[i].isFlavorJavaFileListType()) { dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); List list = (List) tr.getTransferData(flavors[i]); for (int j = 0; j < list.size(); j++) { Object o = list.get(j); if (dtde.getSource() instanceof DropTarget) { DropTarget dt = (DropTarget) dtde.getSource(); Component c = dt.getComponent(); if (c instanceof VARNAPanel) { VARNAPanel vp = (VARNAPanel) c; String path = o.toString(); vp.loadFile(path,true); vp.repaint(); } } } dtde.dropComplete(true); return; } } dtde.rejectDrop(); } catch (Exception e) { e.printStackTrace(); dtde.rejectDrop(); } } public void dropActionChanged(DropTargetDragEvent arg0) { } } PK 4F>fr/PK 4F> fr/orsay/PK 4F> fr/orsay/lri/PK 4F>fr/orsay/lri/varna/PK ;y>\7#fr/orsay/lri/varna/VARNAPanel.class1Mfr/orsay/lri/varna/VARNAPaneljavax/swing/JPanelserialVersionUIDJ ConstantValueqo_a_RNA#Lfr/orsay/lri/varna/models/rna/RNA;_debugZ_conf'Lfr/orsay/lri/varna/models/VARNAConfig;_VARNAListenersLjava/util/ArrayList; SignatureMLjava/util/ArrayList;_managerLjavax/swing/undo/UndoManager; _realCoords[Ljava/awt/geom/Point2D$Double; _realCenters _scaleFactorD _offsetPanelLjava/awt/geom/Point2D$Double; _offsetRNA_offX_offY_blink8Lfr/orsay/lri/varna/controlers/ControleurBlinkingThread;_selectedBases$Lfr/orsay/lri/varna/models/BaseList;_backupSelectionALjava/util/ArrayList; _selectedBaseI _nearestBaseLjava/lang/Integer;_lastSelectedCoord_linkDestination_selectionRectangleLjava/awt/Rectangle;_highlightAnnotation _titleHeight_borderLjava/awt/Dimension; _drawBBox _drawBorder _translationLjava/awt/Point; _horsCadre_premierAffichage _interpolator6Lfr/orsay/lri/varna/controlers/ControleurInterpolator;_popup"Lfr/orsay/lri/varna/views/VueMenu;_UI Lfr/orsay/lri/varna/views/VueUI;_selectedAnnotation6Lfr/orsay/lri/varna/models/annotations/TextAnnotation;VARNA_SESSION_EXTENSIONLjava/lang/String;>$SWITCH_TABLE$fr$orsay$lri$varna$models$rna$ModeleStyleBP$Edge[I]$SWITCH_TABLE$fr$orsay$lri$varna$models$annotations$ChemProbAnnotation$ChemProbAnnotationType()VCodeIvarna K @ALineNumberTableLocalVariableTable ExceptionsQ5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthS U NV((Ljava/lang/String;Ljava/lang/String;I)VthisLfr/orsay/lri/varna/VARNAPanel;'(Ljava/lang/String;Ljava/lang/String;)Vseqstr ] N^:(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)VdrawMode(Ljava/io/Reader;)Vb9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax d Ne(Ljava/io/Reader;I)VrLjava/io/Reader; i Nj&(Ljava/io/Reader;ILjava/lang/String;)V l NFn!fr/orsay/lri/varna/models/rna/RNA ml q s u%fr/orsay/lri/varna/models/VARNAConfig tl x zjava/util/ArrayList yl } java/awt/geom/Point2D$Double       ~l    "fr/orsay/lri/varna/models/BaseList selection N(Ljava/lang/String;)V  "#  $  &'  () ~ N(DD)V  *  +  ,-  . java/awt/Dimension N(II)V  01  2  3  fr/orsay/lri/varna/views/VueMenu N"(Lfr/orsay/lri/varna/VARNAPanel;)V  :;fr/orsay/lri/varna/views/VueUI  <=  Finit  edrawRNA  setTitletitlesetDestinationLink!(Ljava/awt/geom/Point2D$Double;)Vp removeLink&(Lfr/orsay/lri/varna/models/rna/RNA;)V  showRNA  V^(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V t _comparisonMode  L(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Vseq1struct1seq2struct2 t DEFAULT_BACKGROUND_COLORLjava/awt/Color;   setBackground(Ljava/awt/Color;)Vjavax/swing/undo/UndoManager l   setLimit(I)V addUndoableEditListener!(Ljavax/swing/undo/UndoManager;)V6fr/orsay/lri/varna/controlers/ControleurBlinkingThread2?ə N'(Lfr/orsay/lri/varna/VARNAPanel;JDDDD)V  ! Fstart  7 java/awt/Point   45  6 t   _fontBasesGeneralLjava/awt/Font;   setFont(Ljava/awt/Font;)V4fr/orsay/lri/varna/controlers/ControleurClicMovement   addMouseListener!(Ljava/awt/event/MouseListener;)V  addMouseMotionListener'(Ljava/awt/event/MouseMotionListener;)V/fr/orsay/lri/varna/controlers/ControleurMolette    addMouseWheelListener&(Ljava/awt/event/MouseWheelListener;)V"6fr/orsay/lri/varna/controlers/ControleurDraggedMolette !%6fr/orsay/lri/varna/controlers/ControleurVARNAPanelKeys $ ( )*addKeyListener(Ljava/awt/event/KeyListener;)V , -.addFocusListener!(Ljava/awt/event/FocusListener;)V04fr/orsay/lri/varna/controlers/ControleurInterpolator / 3 89 /controleurClicMovement6Lfr/orsay/lri/varna/controlers/ControleurClicMovement;ctrlDraggedMolette8Lfr/orsay/lri/varna/controlers/ControleurDraggedMolette;ctrlKey8Lfr/orsay/lri/varna/controlers/ControleurVARNAPanelKeys;undo =?>java/lang/System @AoutLjava/io/PrintStream; C DEgetUndoOrRedoPresentationName()Ljava/lang/String; GIHjava/io/PrintStream Jprintln L ;Fredo O MFsetTitleFontStyle tR S  _titleFont UWV java/awt/Font XY deriveFont(I)Ljava/awt/Font; [ \FupdateTitleHeightnewStylesetTitleFontSize(F)V Ua Xb(F)Ljava/awt/Font;newSizeFsetTitleFontFamily Ug higetStyle()I Uk ligetSize Un No(Ljava/lang/String;II)V newFamilysetTitleFontColor ts t _titleColornewColorsetBaseFontSize(Ljava/lang/Float;)V y{zjava/lang/Float |} floatValue()FsizeLjava/lang/Float;setNumbersFontSize t   _numbersFontsetBaseFontStylestyle  EgetTitle java/lang/String equals(Ljava/lang/Object;)Z?  /'  'x  igetTitleHeight@  'y m setName t A_title setNumPeriod t ' _numPeriodn getNumPeriod setAutoFit(Z)V t  _autoFit  Frepaintfit lockScrolling     setAutoCenterunlockScrollingdrawStringOutlineK(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;Ljava/lang/String;DDD)V 1fr/orsay/lri/varna/models/export/VueVARNAGraphics getStringDimension((Ljava/lang/String;)Ljava/awt/Dimension;  'width  'height java/awt/Color GRAY  setColor  FsetDashedStroke  drawRect(DDDD)Vg2D3Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;resmargind drawSymboln(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;DDDDDZLfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;)V  B()[I 0fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge iordinal   fillCircle(DDD)V  getColor()Ljava/awt/Color;  white   drawCirclejava/awt/geom/GeneralPath l  moveTo(FF)V  lineTo  F closePath  fill(Ljava/awt/geom/GeneralPath;)V  drawposxposynormxnormyradiusisCISe2Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;bckp2Ljava/awt/geom/GeneralPath;ixiyjxjy drawBasePair(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;D)V ~  ~   java/lang/Math !"sqrt(D)D t$ %& _mainBPStyle0Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; (*).fr/orsay/lri/varna/models/VARNAConfig$BP_STYLE +& BP_STYLE_LW@P@ m/ 0' BASE_RADIUS@ 465+fr/orsay/lri/varna/models/rna/ModeleStyleBP 78 isCanonical()Z 4: ;8 isCanonicalGC@ ? @drawLine 4B C8 isWobbleUG 4E  8 4G HIgetEdgePartner54()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; K  4M NIgetEdgePartner3@ (R S&BP_STYLE_SIMPLE (U V&BP_STYLE_RNAVIZ X YZmax(DD)Dorigdest-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; newRadiusdxdydistnxny radiusCirclecxcyp1vdxvdyxcenterycentergetHighlightedVersion2(Ljava/awt/Color;Ljava/awt/Color;)Ljava/awt/Color; o pigetRed r sigetGreen u vigetBlue x yzgetVal()D | }~min(II)I  Y~  N(III)Vc1c2r1g1b1r2g2b2valnrngnbhighlightFilterC(ILjava/awt/Color;Ljava/awt/Color;Ljava/awt/Color;)Ljava/awt/Color; m  getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase;  contains-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)Z  lmindex initialColorcomputeExcentricUnitVector_(I[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;)Ljava/awt/geom/Point2D$Double; ~ distance(Ljava/awt/geom/Point2D;)DipointscentersbyCenterp0dist1v1vn1dist2v2vn2vndrawBasev(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;I[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;D)V m get_listeBases()Ljava/util/ArrayList; y get(I)Ljava/lang/Object;(fr/orsay/lri/varna/models/rna/ModeleBase  m getBaseInnerColor:(ILfr/orsay/lri/varna/models/VARNAConfig;)Ljava/awt/Color;   m getBaseOuterColor m getBaseNameColor2fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide  Eget_c t   _fillBase ~ zgetX ~ zgetY t  _drawOutlineBase t _baseThickness  setStrokeThickness(D)V  valueOf&(Ljava/lang/Object;)Ljava/lang/String;  drawStringCentered(Ljava/lang/String;DD)V3fr/orsay/lri/varna/models/rna/ModeleBasesComparison  FsetPlainStroke@@$   fillRoundRect (DDDDDD)V   drawRoundRect   get_base1()Ljava/lang/Character;   get_base2  getRNA%()Lfr/orsay/lri/varna/models/rna/RNA;   getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;    -fr/orsay/lri/varna/models/rna/ModeleStyleBase  get_base_name_color?333333?333333  i m  isNumberDrawn.(Lfr/orsay/lri/varna/models/rna/ModeleBase;I)Z     get_base_number_color? t   _distNumbers " }Z$java/lang/StringBuilder #l ' (i getBaseNumber #* +,append(I)Ljava/lang/StringBuilder; #. /EtoStringmb*Lfr/orsay/lri/varna/models/rna/ModeleBase;baseInnerColorbaseOuterColor baseNameColormbn4Lfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide;mbc5Lfr/orsay/lri/varna/models/rna/ModeleBasesComparison;label1label2 factorMin factorMaxdrawChemProbAnnotation(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;Ljava/awt/geom/Point2D$Double;D)V @A8fr/orsay/lri/varna/models/annotations/ChemProbAnnotation mC DCHEM_PROB_ARROW_THICKNESS @F Gz getIntensity @I JK getDirVector ()Ljava/awt/geom/Point2D$Double; @M NKgetNormalVector mP QCHEM_PROB_DIST mS TCHEM_PROB_BASE_LENGTH V D @X YZgetTypeS()Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; \]Ofr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType m_ `CHEM_PROB_ARROW_WIDTH mb cCHEM_PROB_ARROW_HEIGHT me fCHEM_PROB_PIN_SEMIDIAG mh iCHEM_PROB_TRIANGLE_WIDTH mk lCHEM_PROB_DOT_RADIUS npojava/lang/Double q(D)Ljava/lang/Double; ns tz doubleValuecpa:Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;anchor scaleFactorvbaseedge arrowTip1 arrowTip2side1side2side3side4Ljava/lang/Double;centerbuildCaptionPositionL(Lfr/orsay/lri/varna/models/rna/ModeleBase;DD)Ljava/awt/geom/Point2D$Double;  K getCenter  K getCoordsheightEstimate realDistancerenderAnnotations;(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;DDDDD)V m getAnnotations y iterator()Ljava/util/Iterator; java/util/Iterator next()Ljava/lang/Object;4fr/orsay/lri/varna/models/annotations/TextAnnotation   getFont()Ljava/awt/Font;  KgetCenterPosition  Yi   getAncrage  "ceil    transformCoordC(Ljava/awt/geom/Point2D$Double;DDDDD)Ljava/awt/geom/Point2D$Double;  EgetTexte  >?    8hasNext m getChemProbAnnotations @ KgetAnchorPosition  =>offXoffYrnaBBoxXrnaBBoxYtextAnnotationposition fontHeightgetExtendedRNABBox$()Ljava/awt/geom/Rectangle2D$Double; m getBBox  java/awt/geom/Rectangle2D$Double      m 8hasVirtualLoops@D@Trnabbox"Ljava/awt/geom/Rectangle2D$Double; drawBackboneV(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;[Ljava/awt/geom/Point2D$Double;D)V  8getDrawBackbone t _backboneColor m ((I)I  igetElementStructure m i getDrawMode m testDirectionality(III)Z@v  Zatan2@!TD-?陙  drawArc y ~i newCoords discontinuousab consecutivevbpdir centerSegdistp1CenterSeq centerDist centerLoopa1a2angle logicToPanel>(Ljava/awt/geom/Point2D$Double;)Ljava/awt/geom/Point2D$Double;     logicPoint renderRNAX(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;Ljava/awt/geom/Rectangle2D$Double;)V   ! "setScaleFactor?333333 t& '  _drawColorMap ) *zgetColorMapHeight y, -(F)Ljava/lang/Float; / vw 1 w t3 4  _autoCenter 6 78round(D)J m: ;!(I)Ljava/awt/geom/Point2D$Double; m= >i get_drawMode @ ABdrawRegionHighlightsAnnotationu(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;D)V D  F GH getStyleBP/()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; tJ K _drawnNonCanonicalBP mM NOgetBasePairThicknessW(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/models/VARNAConfig;)D tQ R _bpThickness mT UVgetBasePairColorf(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/models/VARNAConfig;)Ljava/awt/Color; X YzgetBPHeightIncrement?@f _  ta b _drawnNonPlanarBP md egetStructureAux 4g hi getPartner5,()Lfr/orsay/lri/varna/models/rna/ModeleBase; k ligetIndex 4n oi getPartner3@ s  u vRED x yz drawColorMapY(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;DLjava/awt/geom/Rectangle2D$Double;)V | }igetWidth  i getHeight   m  _debugShape  N(IIII)Vjava/awt/geom/AffineTransform l   translate  scale  createTransformedShape"(Ljava/awt/Shape;)Ljava/awt/Shape;bbox newFontSize newCenters centerBckj1j2coefjmsbpbpauxkbpcatLjava/awt/geom/AffineTransform;sLjava/awt/Shape;LocalVariableTypeTableDLjava/util/ArrayList;J(Ljava/awt/geom/Point2D$Double;)Lfr/orsay/lri/varna/models/rna/ModeleBase;  panelToLogicPointpotmpndistsetColorMapValues([Ljava/lang/Double;)V t _cm.Lfr/orsay/lri/varna/models/rna/ModeleColorMap; m E([Ljava/lang/Double;Lfr/orsay/lri/varna/models/rna/ModeleColorMap;Z)Vvalues[Ljava/lang/Double;setColorMapMaxValue ,fr/orsay/lri/varna/models/rna/ModeleColorMap  setMaxValuesetColorMapMinValue   setMinValue getColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; setColorMap1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V m adaptColorMapToValuescmsetColorMapCaption t A_colorMapCaptioncaptiongetColorMapCaption t 'DEFAULT_COLOR_MAP_FONT_SIZE t _colorMapHeightresult  z getMinValue  z getMaxValue t _colorMapWidth t 'DEFAULT_COLOR_MAP_STRIPE_WIDTH t _colorMapXOffset t _colorMapYOffset  getColorForValue(D)Ljava/awt/Color;  fillRect t DEFAULT_COLOR_MAP_OUTLINE  t DEFAULT_COLOR_MAP_FONT_COLOR java/text/NumberFormat  getInstance()Ljava/text/NumberFormat;  setMaximumFractionDigits  setMinimumFractionDigits    format(D)Ljava/lang/String; # +-(Ljava/lang/String;)Ljava/lang/StringBuilder; xSpaceAvail ySpaceAvailxBasehcaptionyBaserationfLjava/text/NumberFormat;  KgetOffsetPanel  zgetScaleFactor  K getRNAOffset coordDebut eraseSequence m# !FpaintComponent(Ljava/awt/Graphics;)V ' $((Ljava/awt/Graphics;Z)VgLjava/awt/Graphics; , -FbuildPopupMenu / 01add*(Ljava/awt/Component;)Ljava/awt/Component;3java/awt/Graphics2D5.fr/orsay/lri/varna/models/export/SwingGraphics 47 N8(Ljava/awt/Graphics2D;)V :<;java/awt/RenderingHints =>KEY_ANTIALIASINGLjava/awt/RenderingHints$Key; :@ ABVALUE_ANTIALIAS_ONLjava/lang/Object; 2D EFsetRenderingHint2(Ljava/awt/RenderingHints$Key;Ljava/lang/Object;)V H IF removeAll K $% M NOrenderComponent7(Lfr/orsay/lri/varna/models/export/VueVARNAGraphics;Z)V Q R8 isFocusOwnerTjava/awt/BasicStroke? SW N_ 2Y Z[ setStroke(Ljava/awt/Stroke;)V]#C0C0C0 _ `adecode$(Ljava/lang/String;)Ljava/awt/Color; 2 2d transparentBackgroundLjava/awt/Graphics2D; h iBLACK k li getLeftOffset n oi getTopOffset q ri getInnerWidth t uigetInnerHeight tw x_backgroundColor  { |}getMinimumSize()Ljava/awt/Dimension;  l}  getClip   java/awt/Rectangle     igetSelectedBaseIndex t  _bondColor   getSelection&()Lfr/orsay/lri/varna/models/BaseList;   getIndicesjava/lang/Integer  iintValue linkOriginlinkDestination m getHighlightRegion?fr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation  getShape\([Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;D)Ljava/awt/geom/GeneralPath;   getFillColor  getOutlineColor realCoords realCentersALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;  NgetBackboneColorsetBackboneColorbackbone_color getBondColor m EgetNamesetDefaultBPColor bond_color setBorderSize(Ljava/awt/Dimension;)V getBorderSize'(Lfr/orsay/lri/varna/models/rna/RNA;I)V m  setDrawMode  m +(ILfr/orsay/lri/varna/models/VARNAConfig;)V   errorDialog(Ljava/lang/Exception;)V 6fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm FprintStackTrace8Lfr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm;  F m YsetRNABfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParenthesesDLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;e1;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax; m ` loadSecStrdrawRNAInterpolated  V  ilength %fr/orsay/lri/varna/models/rna/Mapping DefaultOutermostMapping+(II)Lfr/orsay/lri/varna/models/rna/Mapping;  O(Ljava/lang/String;Ljava/lang/String;ILfr/orsay/lri/varna/models/rna/Mapping;)VN(Ljava/lang/String;Ljava/lang/String;Lfr/orsay/lri/varna/models/rna/Mapping;)Vm'Lfr/orsay/lri/varna/models/rna/Mapping;  N(Lfr/orsay/lri/varna/models/rna/RNA;ILfr/orsay/lri/varna/models/rna/Mapping;)Vtarget mkM(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/Mapping;)V /  addTargetM(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/VARNAConfig;)V   setConfig*(Lfr/orsay/lri/varna/models/VARNAConfig;)VtcfgisInterpolationInProgress / 8showRNAInterpolated     t(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/Mapping;)V /  t   _showWarningsFirst sequence length #/ differs from that of it's secondary structure %. Adapting first sequence length ...   emitWarning   substring(II)Ljava/lang/String; Second sequence length "&. Adapting second sequence length ...  % &'replace(CC)Ljava/lang/String; ) *+charAt(I)C #- +.(C)Ljava/lang/StringBuilder; 0 1(I)Ljava/lang/Integer; y3 0 m5 6<(Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;)V8$ERROR : The super-structure is NULL. m: ;drawRNARadiate m= >F drawRNACircle m@ AF drawRNALine mC DF drawRNANAViewfirstSeq firstStruct secondSeq secondStruct RNALengthstring_superStructstring_superSeq array_rnaOwn*Ljava/util/ArrayList;getSelectedBasesetSelectedBase getRealCoords!()[Ljava/awt/geom/Point2D$Double; setRealCoords"([Ljava/awt/geom/Point2D$Double;)VcoordsgetPopup$()Lfr/orsay/lri/varna/views/VueMenu; setBondColor getTitleColor setTitleColor title_colorsetTitleHeight title_heightisAutoCentered getTitleFont setTitleFontfont mb c_bpHeightIncrementsetBPHeightIncrementincfactor getPopupMenugetZoomIncrement tj k _zoomAmountsetZoomIncrement(Ljava/lang/Object;)V o.pjava/lang/Object yr s%(Ljava/lang/String;)Ljava/lang/Float; u lmamountgetZoom ty z_zoomsetZoomgetTranslation()Ljava/awt/Point;setTranslation(Ljava/awt/Point;)Vtrans isOutOfFrame  ,(Ljava/lang/Exception;Ljava/awt/Component;)VerrorLjava/lang/Exception;  8 isErrorsOn java/lang/Exception E getMessage VARNA Error javax/swing/JOptionPane showMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)VLjava/awt/Component;errorDialogStaticVARNA Critical Error VARNA Warningwarning setModifiable t   _modifiable modifiable isModifiablereset    ~  {m  lgetNonStandardBasesColor t _specialBasesColorsetNonStandardBasesColor basesColorcheckTranslation  wz  |}isComparisonModeglobalRotation(Ljava/lang/Double;)V m   FfireLayoutChanged angleDegresgetNearestBase()Ljava/lang/Integer;setNearestBase(Ljava/lang/Integer;)VgetGapsBasesColor t _dashBasesColorsetGapsBasesColorimprimer2javax/print/attribute/HashPrintRequestAttributeSet l java/awt/print/PrinterJob  getPrinterJob()Ljava/awt/print/PrinterJob;   printDialog3(Ljavax/print/attribute/PrintRequestAttributeSet;)Z  print3(Ljavax/print/attribute/PrintRequestAttributeSet;)Vjava/awt/print/PrinterException attributes0Ljavax/print/attribute/PrintRequestAttributeSet;jobLjava/awt/print/PrinterJob; exception!Ljava/awt/print/PrinterException; t   _errorsOn setErrorsOnon getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI;setUseBaseColorsForBPs t  _useBaseColorsForBPsgetUseBaseColorsForBPssetColorNonStandardBases t  _colorSpecialBasesgetColorSpecialBasessetColorGapsBases t  _colorDashBasesgetColorGapsBasessetShowWarningsgetShowWarningssetShowNonCanonicalBPgetShowNonCanonicalBPsetShowNonPlanarBPgetShowNonPlanarBP setBPStyle3(Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;)Vst getBPStyle2()Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig;  t  _drawBackgroundhighlightSelectedBase   setSelection(Ljava/util/ArrayList;)VselhighlightSelectedStem m findStem(I)Ljava/util/ArrayList; y addAll(Ljava/util/Collection;)ZgetSelectionIndices,()Ljava/util/ArrayList;-(Ljava/util/ArrayList;)V m   getBasesAt-(Ljava/util/Collection;)Ljava/util/ArrayList; " #(Ljava/util/Collection;)VindicesF(Ljava/util/Collection<+Lfr/orsay/lri/varna/models/rna/ModeleBase;>;)V ' (Fclear * +#addBases - . setActivembsLjava/util/Collection;CLjava/util/Collection<+Lfr/orsay/lri/varna/models/rna/ModeleBase;>;getBasesInRectangleDiff?(Ljava/awt/Rectangle;Ljava/awt/Rectangle;)Ljava/util/ArrayList;T(Ljava/awt/Rectangle;Ljava/awt/Rectangle;)Ljava/util/ArrayList; 6 7(Ljava/awt/geom/Point2D;)ZrecInrecOutgetBasesInRectangle+(Ljava/awt/Rectangle;)Ljava/util/ArrayList;@(Ljava/awt/Rectangle;)Ljava/util/ArrayList;recsetSelectionRectangle(Ljava/awt/Rectangle;)V A 23 C :; E N? G H#toggleSelectionremoveSelectionRectangleaddToSelection/(Ljava/util/Collection<+Ljava/lang/Integer;>;)V MNjava/util/Collection P J,Ljava/util/Collection<+Ljava/lang/Integer;>; S TUaddBase-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)VremoveFromSelection X YU removeBase isInSelection(I)Z ] Z[ _ V a HclearSelection saveSelection y' f ggetBasesrestoreSelectionresetAnnotationHighlightdrawBBox drawBordersetBaseInnerColor mn lsetBaseNumbersColor mq osetBaseNameColor mt rsetBaseOutlineColor mw ugetListeAnnotationsO()Ljava/util/ArrayList;resetListeAnnotations m| }FclearAnnotations addAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)V m ~removeAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)Z m doneget_selectedAnnotation8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation;set_selectedAnnotation annotationremoveSelectedAnnotationhighlightSelectedAnnotationgetFlatExteriorLoop t  _flatExteriorLoopsetFlatExteriorLoopsetLastSelectedPositiongetLastSelectedPosition setSequence m setColorMapVisiblegetColorMapVisibleremoveColorMap saveSessionjava/io/FileOutputStream java/io/ObjectOutputStream  N(Ljava/io/OutputStream;)V$fr/orsay/lri/varna/models/FullBackup  N_(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Ljava/lang/String;)V  m writeObject  Fclose pathfosLjava/io/FileOutputStream;Ljava/io/ObjectOutputStream;ex loadSession:(Ljava/lang/String;)Lfr/orsay/lri/varna/models/FullBackup;4fr/orsay/lri/varna/exceptions/ExceptionLoadingFailed   importSession   rna  config&Lfr/orsay/lri/varna/models/FullBackup;mapjava/io/FileInputStream   O(Ljava/io/InputStream;Ljava/lang/String;)Lfr/orsay/lri/varna/models/FullBackup;File not found.  NYjava/io/FileNotFoundExceptionLjava/io/FileNotFoundException;java/io/ObjectInputStream  N(Ljava/io/InputStream;)V   readObject %I/O error while reading VARNA session&Bad format while reading VARNA sessionjava/io/IOException java/lang/ClassNotFoundExceptionfisLjava/io/InputStream;inLjava/io/ObjectInputStream;Ljava/io/IOException;"Ljava/lang/ClassNotFoundException;loadFile  (Ljava/lang/String;Z)V t   _drawBackbonesetDrawBackboneaddHighlightRegionD(Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)V m removeHighlightRegion m  m &(IILjava/awt/Color;Ljava/awt/Color;D)V m outline   m  m     a interpolatetoggleDrawOutlineBasetoggleFillBase readValues m   A(Ljava/io/Reader;Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)VaddVARNAListener9(Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;)V6Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;4fr/orsay/lri/varna/interfaces/InterfaceVARNAListener  FonLayoutChangedfireUINewStructureM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)V  onUINewStructuregetOrientation m z  BC  !5()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; # $ HOOGSTEEN & 'SUGAR ) * WATSON_CRICK,java/lang/NoSuchFieldError . DC \0 1T()[Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; \3 45 ARROW_TYPEQLfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; \7 85DOT_TYPE \: ;5PIN_TYPE \= >5 TRIANGLE_TYPE SourceFileVARNAPanel.java InnerClassesBP_STYLEChemProbAnnotationTypeEdgeFjava/awt/RenderingHints$KeyKeyIjava/awt/geom/Point2DDoubleLjava/awt/geom/Rectangle2D!$   !"#$%&'()*+,-. /'012 3 456 7 89:;<=>? @A BC DCEFG*HJL MNFOPG8 *RRTL   M  WXNYOPGJ*+,TL /0M WXZA[ANVOPGV *+,R\L E FM* WX ZA [A _'N`OPaG?*+cL JKMWXfgNeOPaGK *+RhL OPM  WX fg _'NjOPaG*k*mYop*r*tYvw*yY{|*~*~**~Y*~Y*Y*yY{***~Y****Y***Y**Y***+*-±LnR*2:?JUbmrwTUVWM*WXfg_'AG>*+L [\MWXFG4*L `aM WXNGd*k*mYop*r*tYvw*yY{|*~*~**~Y*~Y*Y*yY{***~Y****Y***Y**Y**+*Ljw*2:?JUbmrwxyzMWXf N^OPG*k*mYop*r*tYvw*yY{|*~*~**~Y*~Y*Y*yY{***~Y****Y***Y**Y**+,**±Ln|*2:?JUbmrw~M4WXZA[A_'ANG*k*mYop*r*tYvw*yY{|*~*~**~Y*~Y*Y*yY{***~Y****Y***Y**Y**w*+,-**±Lr*2:?JUbmrwMHWXAAAA_'AFGw*۶*Y*'***Y****Y***w Y*L*+*+*Y*!Y*#M*,*,$Y*&N*-'*-*-+*/Y*12*24Lr'-9<CHUZensxM*WXnU56678#9:;FGG<*BF*KL M WXMFG6*NL M WXPGS*w*wQTQ*ZLMWX]'^_GS*w*wQ#`Q*ZLMWXcdeGl(*wUY+*wQf*wQjmQ*ZL #'M(WX(pAqGI *w+r*ZL M WX uvwGN*w*w+x`L MWX~wGN*w*w+x`L MWX~GK*w*wTL  MWX'\FGE*R**wQjk****toL #(2DM EWXGU*p+*w+*ZL#$%&MWXAGA *wL 89M WX 'iG2*wLJM WXGI *w*LNO PM WX  FG= **LST UM  WXFG= **LXY ZM  WXG e+,: ) ‡ogJ Ňoc9+ȹ++)g Ňgg ‡kc Ňkc L^ _`%a.b4cddMHeWXeeAeee \1 G V .L +( og og +:++( og og ++( og og ŻY:( kog kog kog koc( koc kog koc koc( koc koc koc kog( kog koc kog kog ++:++++ ko9 ko9 ko9 wko9Y:(gcgc(cccc(gg +,+:++++L:j$l)m2n=mEpMqVr_sjrotwuvuxz{|}{~~&/2DXadiny!,4=EMUMVWXVVV V V V  V V MC!z4!G-,g9-,g9 -,g-,gk-,g-,gkc9  o9  o9  w9 9~Y,kc, kcM~Y-kg- kgN*w#',*p.g1o*k939,-,- **p.k +, g,g- g-g> A+,,--> -,co9-,co9+,,--> *+ DFJ;F:L:-,co9-,co9+,,--> *+ DJ-,g9-,g9Oo9Oo9*+cc DJ*+gg DJx*w#Q+,,--> R*w#TE,-co9,-co9<*kW9+ggkLC )<BIPUYu &+:HPXeiq #.9AI[bew~MWX[\]^ _` Ba Ub Ycd>e/fgef.Sh9Hi3j$k lmGo +n>+q6+t6,n6,q6,t6*w9  k gkc{6  k gkc{6  k gkc{6 Y   LF #,<BGX^ctzM WX' '|'v'p'#j',a GF' c*' ' Gv**p *-,L  M4WX'Gx^,2-29~Y,2-2go,2-2go:&,d,d2:,2:,`2:  9 ~Y g o g o: ~Y  w: 9~Ygogo:~Yw:~Y co co:~Y9YoYokkcwwLV 4@GLS\ !"#$&%B'M(X*[.M^WX^'^^ Sa4*GLgS \   ]MG)O-2:*p:+*w**p*w*p*w: **p*w*p*wò: **p*w*p*wƲ: ə:  : *wΙ'+ +ggk*wי9+ +*w*k+ggk+ + Թ0(: ++*w*k+ +ggkk*k*k + +ggkk*k*k +occgocgc>  :  :+*+  kgԹ+kcԹ*p**-: ++*w*w!9 *wg*w!9+  ckkc  ckkc ckkc ckkc> +#Y%&)- *wckkc *wckkcL@567"8)9?8D:K;a:f<>@ABEFILMN QR,T4W;ZA[S^[_d`ra_defgeklmnkrs vw"v'z@{Yis1INMOWXOO'OOO^J:01D 2 f3 4 56 A ;78 V9A  L:As ; <=>GKy+,?+B*k,Ek+,H:,L:~Y-*pOkkc-*pOkkc:~Y*pR,Ekkkc*pR,Ekkkc: U,W[. )h~Y,Ek*p^k*pakckc,Ek*p^k*pakckc: ~Y,Ek*p^wk*pakckc,Ek*p^wk*pakckc: +  > +  > +  > ~Y ,Ek*pdkkg ,Ek*pdkkg: ~Y ,Ek*pdkkg ,Ek*pdkkg: ~Y ,Ek*pdkkc ,Ek*pdkkc: ~Y ,Ek*pdkkc ,Ek*pdkkc: Y:        ++  > 3~Y ,Ek*pgkkc ,Ek*pgkkc: ~Y ,Ek*pgwkkc ,Ek*pgwkkc: Y:         + g*pjk,Ekm: ~Y rkc rkc: +  rg  rg rkL9 #)/b"'U3NSr #+EHg (SxMyWXyyuvywyx)Py/Jbz{ '| N} 1~ S  t k| I} @ (P  S% GH 9*p+**wc9+:+: *p.kc9 ~Y g  c okc g  c okcLR &,<EPZabdit~MRWX01x &f,` <P G *p:  : + +  jk k` : ' : j9* :*( :+ * !**+ 1 B*p: . @: * ( :*+   αLJ&ELU_my M WXx ? Lz_01m uv wG *pL+Y*w*p.kg+Y*wk*p.kc+Y*w*p.kg+Y*wk*p.kc*pۙ3+Yg+Yc+Yg+Yc+L. !>Wt~    MWXG} *+*k+*w6,d2:,2:9*p*pdd6 *pd6 *p6   d6 ,~Y:gogo + + *p*p6`,!*pd`6%d*pdd6~Yktk:~Ycoco:9*kk*kkg9~Ykckc:9gwgko9gwgko9g9tktkc9+)kkc)kkckk I+,d2)kc,d2)kc,2)kg,2)kg> *pUL)"(06?_o }!#$%&()+,./0#1*2E3a456789:#;*<C?~CDECJMWX^%'0g6?a_e oU ' }G ' 0    'a #[*TGt 4~Y**+*gkc**+*gkcLNOP0NM4WX4G &*p{*N*w*,-o,-o! #*p.k*k8-Yg-Yc*w%-Y*(c-Yg-Yc*w*,-o,-o! #*p.k*k8**p.kW9*+.*+0*w2w*,ص*,ӵ*,,-*k5goc*,,-*k5goc*~Y***~Y--ӷ*p~:*p~:6 *p :  ~Y** *gkc** *gkcS*p 9: *p<*p<  *pd *p d: *p `:  6 6 : : : :  gocgoc  gocgoc ~Y** *gkc** *gkcS  *pW**+*k++*w*+***?*+C6 8*p 6 *p E:3 *wI*p<*+*p*wLk*k*wPk+*p*wLk*k+*p*wS*p<u d*WZk9 *W9 2 2g9 +2 2co2**p.kog   k\ *+ 22^  *p*w`R*pc: 69 4:3 *wIfj6mj6*p<0+*p*wLpk*k*wPk+%+*p*wLk*k++*p*wS*p<rd*WZk9 *W9 22g9 +22  kog**p.kog   k\ *+22^ +6 *+ r  *p{*r *6+t++***-kg*-kg *w% *+*-w*r *-+ȹ++*{d*~*dd *+******psY2: + Y:**-kg**-kg***p:+LV XZ[!\*]2[5a6bHaNdZeffph}klopqrpuvuwyz{|}~,~/<KNatx~ $7JQXry12DJP^dq  3>GTZm  +,9<=ABIOXtz   !.4: GJV_%m&v'|()*(./12345649 ;=%>-?6@WAdBrCzDGMt%WXsN7d^' 01 D 71 J1 Q'X'yxqjmC @ Q ZV  S G' ']F C''] ' '7(' %` 6Or F G NM*+N9*p:):-9 M9,L* KLM N(P3Q;S>TBNLWMHNWXNL01F Aa(13G]*p+*w*w%*L]^_`MWXGD *w'L d eM WX GD *w'ıL i jM WX G2*wLmM WXGU*p+*w+*LqrstMWXGI *w+*Lwx yM WX AEG2*wаL|M WXyGA *w%L M WX  *zGe%Շ*wcH*wR 'ՇcH'L #M%WX yzGr (*w9*w9+9 *~(kg*go(*wزՇck!9'*{(kgo(*wkc!9  *c(*wg*wgkc9Շ9*c(*wg*wggkc96W*wo9gkc9+*w(kc9 9 +  (*wk *w☛++d(*wkc(*wk +*(Շk`+:+*wܶ(Շk#og+*w߶c(*wkc(Շk#og*wRB+#Y%*wж -(*wkoc(Շ#o*wckcL! !KQu(1Thqv|'M(WX((x(   ! Khe'D7vGv:~Y+*g*o*c+*g*o*cL6M:WX:G !~Y( +gkc +gkcLMH!WX! !!!!!x !FG6*p"L M WXG 3*M~Y**+,gkc**+,gkcL /M 3WX3 .$%G?*+&L MWX)*$(G+*2***to*+**.W*+2N4Y-6:-9?C*G*-J*L*P--SYUVX-\^b-*{d*~dcLN!(16;EILOSX_ft~M4WX)*e ;VfEL!NOG~ *Z*r *,+g++*j*m*p*s **wvy*Yxy*z*~Ţc*z*~¢R*R=+*wr+*wQ+**{l*~*og*+**8+g++**** **+*w++<*k**2N*:+--> *:.6*+****p.krαL !;? M]n !" $&%'+(9)C*I+a,-,/M>WXe CbI\'ABG k+*k+*p:@:,-:++++L* 456/8:9E:M;X<`6j>MHkWXkkkkx/1f:&GR Y*j*m*p*sLB CDBM WXG2*wLMM WXGA *w+L WXM WX G2*wL`M WXEGQ*pR *p*wLijlM WXGA *w+L vwM WX G>*+L MWX 1}G/*LM WX!G>*+pL MWXf YOPGP*+,*p<αL  M WXZA[AGQ +*+ñL M  WX f  _'FGt$*p*p<*wŧ L*++*L#M$WX GN+ *+p*ұL  MWXf VOPG,*p*p+,*ҧ:*ȧ :*ȱ#aL"#%+M>,WX,ZA,[A,_'%eOPaG_*p*p+*ұLM WXfg_'YOPGP*+,*p<L   M WXZA[AVGu*+,*p,L ' ( ) ( ' *M*WXZA[A_'G[*+,*p<-L  = >M*WXZA[AG0mYo:+,*:*ȧ :*ȱ  'aL" R T U V W' X) Y/ [MR0WX0ZA0[A0_'0 ' )Gc*++<*p+L g h i h g jMWX GM *++<,L  y zM  WX   G++*w*w%*2+-:*̱L    % * M4+WX+ +_'+ iG2*pL M WXGa*+,*,*L    M WX 8GC*2*2L  M WXGW*+*p+L    MWX GJ*+,L   M WX  GW *2+,- L  M* WX    G,  *p+-,+,s*w .*#Y+) ,) -+,)#Y+ -L+, +,L-w*w /*#Y-) )! --*#Y- -N--N+6YR#:YR#:yY{: ,-.$M-.$:6 , ( (*#Y, (,-: /2W, (( ((5#Y(,-: , ((/2Wl, () ()5#Y),-: , ()/2W##Y.,-: /2W  6 )#Y+ (,- (,-:  R3R)*p 4 : * ȧ: * ȧ *7*p<W. B8*p*w9,*p<"*p?*pB: * ȧa L2L  + 5 G M T ] ` k n               ! , 7 $@ *I +T -Z 0j 1v 2 1 3 7 8 9 : > ? @ A# C9 DC -M JS Kh Lq Kv J S U V U W X Y Z ] ` b c e f h i l m n p vM WX EA FA GA HA _'!I',JA7KA@L W' P0'     @LM iG/*L M WXNiG<*p*L M WXOG>*L   MWXz'PQG/*L M WXRSG>*+L   MWXTUVG/*L M WXWGA *w+L   M WX XG2*wrL M WXYGA *w+rL   M WX ZiG/*L M WX[G>*L   MWX\']8G2*w2L M WXGA *w2L   M WX  ^G2*wQL M WX_GI *w+Q*ZL   M WX ` YzG2*paL M WXdGA *p'aL   M WX ezG/*L $M WX"G>*'L  . /MWXfKG/*L 7M WXKG/*L AM WXgVG/*L JM WXhzG2*wiL SM WXlmGD *+nqtL  ] ^M WX vBlGA *w'iL  g hM WX vwzG2*wxL pM WX{mGK*w+nqxxL  z {MWXzB|}G/*L M WX~G>*+L   MWX5G/*pL M WX8G/*L M WXG?*+*L   MWXGb*,+L     M WX GM +*L  M  GX*w *+L    MWXAGA *wL   M WX  8G2*wL M WXFGn4*Y*Y*to*m*L $ , 3 M 4WXG2*wL M WXGA *w+L   M WX FG***{*pdot%*Y*{*pdot***{*pdo$*Y*{*pdo***~*hd*sdo+*Y**~*hd*sdo**~*sdot*Y**~*sdot**pot *Y*pot***po*Y*po***sot *Y**sot**so*Y**soL1   # , B E P ^ g |    ! " ! " ! % & ' ( ) * ) * ) ( . / 0+ 15 /8 3L 4Q 5[ 6e 4h 8} 9 : 9 < = > = AM WXliGh&**{*hd*pdl`*`L I J K J I K$ IM &WXriGN*{*hd*wxk5L U V UM WXoiGp&**~*hd*sdl`*`L& _ ` a ` a ` _ a$ _M &WXuiG]#*~*wxk*hg*g5L k l k l kM #WX8G2*wѬL uM WXGQ*p+**L   MWXG/*L M WXG>*+L   MWXz)G2*wưL M WXGA *w+ƱL   M WX FG#YLM,+ԙ,+ا M*,ȱL     " M*#WX 8G2*wL M WXGA *wL   M WX  G/*L M WXGA *wL   M WX  8G2*wL M WXGA *wL   M WX  8G2*wL M WXGA *wL   M WX  8G2*wL M WXGA *w L  $ %M WX  8G2*w L -M WXGA *wIL  7 8M WX  8G2*wIL @M WXGA *w`L  J KM WX  8G2*w`L SM WXGA *w+#L  ] ^M WX &G2*w#L fM WXG/*wL qM WXG?*w:+$*w+v*w+۶*w۵v*wL { | ~ , 6 > M?WX? FG!yY{L*= +/2W*+ L    M !WXy ' yMFG'yY{L*=*pN+-W*+ L    ! & M*'WXy 'fyMfMG/*L M WXG2*L M WXGW **p+!L  M WX $  $M#%Gj*&*+)*,L    MWX/0 /1234GAyY{N6*+*25,*25 -/2W*-L   ( 2 ? M4AWXA8-A9-9 4' 9M:;<G1yY{M>+*25 ,/2W*,L   # / M*1WX1=-) %' )M>?G8yY{M***+@M *+BM*Y+D*,F*L"    " . 3 7 M 8WX8=-0 0MIFG4*L   M WXJ#KG&+LN-=*O-L   % M &WX&$0' &$QJGs%*pM*, *,R*,L   $ M %WX%' 01VGs%*pM*, *,W*,L   $ M %WX%' 01Z[GD**pL MWX'HGV*\ *^*OL  MWX'H#KG&+LN-=*`-L% M &WX&$0' &$QbFGJ*&*,*LM WXcFGI*d**eWLM WXhFG7 **!L M  WXiFG< **L%& 'M  WXjG>*L 12MWX kG>*L ;<MWX lGA *p+mL ?@M WX oGA *p+pL CDM WX rGA *p+sL GHM WX uGA *p+vL KLM WX xyG2*pLOM WXzFG> *p{*LST UM  WX~GI *p+*LXY ZM WX ?GU*p+=*L] ^ _M WX?  G/*LcM WXG>*+L ghMWX?FG= **Lkl mM  WXFG4*L qrM WX8G2*wLuM WXGA *wL yzM WX  GS*+*+L~ MWXKG/*LM WXGI *p+*L M WX AGI *w%*L M WX  8G2*w%LM WXFG? *w%*L M  WXG?MNY+MY,N-Y*w*p*w- :47L&  079>M4?WX?A=;@9OG.+M*,N*,-*,w*,L (,M*.WX.A) OG^Y**ưLY*˿ L MA  OG7MNY*N-M-,:Y+˿:Y+˿)L*  )+M>77A53 + G?*+L MWXA8G2*wLM WXGA *wL M WX  GA *p+L M WX GA *p+L M WX GL *pL  M  WX ' 'Go*p-L M>WX'' G@^*+WWNmYo:+*w : *˧'*:: : "%?B?La?VLF    % ' ,09BDLNVX]M\ ^WX^A^  SJf 'DNXG>*+wL  !MWXFGE*w*wיױL &'M WXFGE*w*wΙαL +,M WX `GH*p+*w L 01MWXfg GB *|+2WL 5 6M WX yFGe%*|M,L+,L:;:$<M%WXyG~**|:N-+,L@A@)BM**WX*y*f zG2*pLEM WXBGu=YW K*"OW*%OW*(OW*Y+&)+*36+LMDGJ-YW/ K*2[OW*6[OW*9[OW*<[OW*Y-+&)+*36+7@C+LM?@A2(tB@\@C@4D@E:G ~HJ KJ PK ;y>; "fr/orsay/lri/varna/VARNAPanel.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ /* GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS */ package fr.orsay.lri.varna; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.geom.AffineTransform; import java.awt.geom.GeneralPath; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Reader; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collection; import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.undo.UndoManager; import fr.orsay.lri.varna.controlers.ControleurBlinkingThread; import fr.orsay.lri.varna.controlers.ControleurClicMovement; import fr.orsay.lri.varna.controlers.ControleurDraggedMolette; import fr.orsay.lri.varna.controlers.ControleurInterpolator; import fr.orsay.lri.varna.controlers.ControleurMolette; import fr.orsay.lri.varna.controlers.ControleurVARNAPanelKeys; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener; import fr.orsay.lri.varna.models.BaseList; import fr.orsay.lri.varna.models.FullBackup; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.annotations.ChemProbAnnotation; import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.annotations.TextAnnotation; import fr.orsay.lri.varna.models.export.SwingGraphics; import fr.orsay.lri.varna.models.export.VueVARNAGraphics; import fr.orsay.lri.varna.models.rna.Mapping; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.models.rna.ModeleBasesComparison; import fr.orsay.lri.varna.models.rna.ModeleColorMap; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.views.VueMenu; import fr.orsay.lri.varna.views.VueUI; /** * 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 * */ public class VARNAPanel extends JPanel { /** * */ private static final long serialVersionUID = 8194421570308956001L; private RNA _RNA = new RNA(); private boolean _debug = false; private VARNAConfig _conf = new VARNAConfig(); private ArrayList _VARNAListeners = new ArrayList(); UndoManager _manager; private Point2D.Double[] _realCoords = new Point2D.Double[0]; private Point2D.Double[] _realCenters = new Point2D.Double[0]; private double _scaleFactor = 1.0; private Point2D.Double _offsetPanel = new Point2D.Double(); private Point2D.Double _offsetRNA = new Point2D.Double(); private double _offX; private double _offY; private ControleurBlinkingThread _blink; private BaseList _selectedBases = new BaseList("selection"); private ArrayList _backupSelection = new ArrayList(); private int _selectedBase = -1; private Integer _nearestBase = null; private Point2D.Double _lastSelectedCoord = new Point2D.Double(0.0,0.0); private Point2D.Double _linkDestination = null; private Rectangle _selectionRectangle = null; private boolean _highlightAnnotation = false; private int _titleHeight; private Dimension _border = new Dimension(0,0); private boolean _drawBBox = false; private boolean _drawBorder = false; // private Point _positionRelativeSouris; private Point _translation; private boolean _horsCadre; private boolean _premierAffichage; private ControleurInterpolator _interpolator; /** * 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. */ private VueMenu _popup = new VueMenu(this); private VueUI _UI = new VueUI(this); private TextAnnotation _selectedAnnotation; /** * Creates an RNA 2D panel with initially displays the empty structure. * * @throws ExceptionNonEqualLength * */ public VARNAPanel() throws ExceptionNonEqualLength { this("", "", RNA.DRAW_MODE_RADIATE); } /** * 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). * * @param seq * The raw nucleotide sequence * @param str * The secondary structure in DBN format * @throws ExceptionNonEqualLength */ public VARNAPanel(String seq, String str) throws ExceptionNonEqualLength { this(seq, str, RNA.DRAW_MODE_RADIATE); } /** * 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. * * @param seq * The raw nucleotide sequence * @param str * The secondary structure in DBN format * @param drawMode * The drawing mode * @throws ExceptionNonEqualLength * @see RNA#DRAW_MODE_RADIATE * @see RNA#DRAW_MODE_CIRCULAR * @see RNA#DRAW_MODE_NAVIEW */ public VARNAPanel(String seq, String str, int drawMode) throws ExceptionNonEqualLength { this(seq, str, drawMode, ""); } public VARNAPanel(Reader r) throws ExceptionNonEqualLength, ExceptionFileFormatOrSyntax { this(r, RNA.DRAW_MODE_RADIATE); } public VARNAPanel(Reader r, int drawMode) throws ExceptionNonEqualLength, ExceptionFileFormatOrSyntax { this(r, drawMode, ""); } public VARNAPanel(Reader r, int drawMode, String title) throws ExceptionNonEqualLength, ExceptionFileFormatOrSyntax { init(); drawRNA(r, drawMode); setTitle(title); } public void setDestinationLink(Point2D.Double p) { _linkDestination = (p); } public void removeLink() { _linkDestination = null; } /** * 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. * * @param seq * The raw nucleotide sequence * @param str * The secondary structure in DBN format * @param drawMode * The drawing mode * @param title * The panel title * @throws ExceptionNonEqualLength * @see RNA#DRAW_MODE_CIRCULAR * @see RNA#DRAW_MODE_RADIATE * @see RNA#DRAW_MODE_NAVIEW */ public VARNAPanel(RNA r){ showRNA(r); init(); } public VARNAPanel(String seq, String str, int drawMode, String title) throws ExceptionNonEqualLength { drawRNA(seq, str, drawMode); init(); setTitle(title); //VARNASecDraw._vp = this; } public VARNAPanel(String seq1, String struct1, String seq2, String struct2, int drawMode, String title) { _conf._comparisonMode = true; drawRNA(seq1, struct1, seq2, struct2, drawMode); init(); setTitle(title); } private void init() { setBackground(VARNAConfig.DEFAULT_BACKGROUND_COLOR); _manager = new UndoManager(); _manager.setLimit(10000); _UI.addUndoableEditListener(_manager); _blink = new ControleurBlinkingThread(this, ControleurBlinkingThread.DEFAULT_FREQUENCY, 0, 1.0, 0.0, 0.2); _blink.start(); _premierAffichage = true; _translation = new Point(0, 0); _horsCadre = false; this.setFont(_conf._fontBasesGeneral); // ajout des controleurs au VARNAPanel ControleurClicMovement controleurClicMovement = new ControleurClicMovement( this); this.addMouseListener(controleurClicMovement); this.addMouseMotionListener(controleurClicMovement); this.addMouseWheelListener(new ControleurMolette(this)); ControleurDraggedMolette ctrlDraggedMolette = new ControleurDraggedMolette( this); this.addMouseMotionListener(ctrlDraggedMolette); this.addMouseListener(ctrlDraggedMolette); ControleurVARNAPanelKeys ctrlKey = new ControleurVARNAPanelKeys(this); this.addKeyListener(ctrlKey); this.addMouseListener(ctrlKey); this.addFocusListener(ctrlKey); _interpolator = new ControleurInterpolator(this); _interpolator.start(); } public void undo() { System.out.println(_manager.getUndoOrRedoPresentationName()); _manager.undo(); } public void redo() { _manager.redo(); } /** * Sets the new style of the title font. * * @param newStyle * An int that describes the new font style ("PLAIN","BOLD", * "BOLDITALIC", or "ITALIC") */ public void setTitleFontStyle(int newStyle) { _conf._titleFont = _conf._titleFont.deriveFont(newStyle); updateTitleHeight(); } /** * Sets the new size of the title font. * * @param newSize * The new size of the title font */ public void setTitleFontSize(float newSize) { _conf._titleFont = _conf._titleFont.deriveFont(newSize); updateTitleHeight(); } /** * 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. * * @param newFamily * New font family used for the title */ public void setTitleFontFamily(String newFamily) { _conf._titleFont = new Font(newFamily, _conf._titleFont.getStyle(), _conf._titleFont.getSize()); updateTitleHeight(); } /** * Sets the color to be used for the title. * * @param newColor * A color used to draw the title */ public void setTitleFontColor(Color newColor) { _conf._titleColor = newColor; updateTitleHeight(); } /** * Sets the font size for displaying bases * * @param size * Font size for base caption */ public void setBaseFontSize(Float size) { _conf._fontBasesGeneral = _conf._fontBasesGeneral.deriveFont(size); } /** * Sets the font size for displaying base numbers * * @param size * Font size for base caption */ public void setNumbersFontSize(Float size) { _conf._numbersFont = _conf._numbersFont.deriveFont(size); } /** * Sets the font style for displaying bases * * @param style * An int that describes the new font style ("PLAIN","BOLD", * "BOLDITALIC", or "ITALIC") */ public void setBaseFontStyle(int style) { _conf._fontBasesGeneral = _conf._fontBasesGeneral.deriveFont(style); } private void updateTitleHeight() { if (!getTitle().equals("")) { _titleHeight = (int) (_conf._titleFont.getSize() * 1.5); } else { _titleHeight = 0; } if (_translation.x==0) {_translation.y = (int) (-getTitleHeight() / 2.0);} } /** * Sets the panel's title, giving a short description of the RNA secondary * structure. * * @param title * The new title */ public void setTitle(String title) { _RNA.setName(title); _conf._title = title; updateTitleHeight(); } /** * Sets the distance between consecutive base numbers. Please notice that : *
    *
  • The first and last base are always numbered
  • *
  • The numbering is based on the base numbers, not on the indices. So * base numbers may appear more frequently than expected if bases are * skipped
  • *
  • The periodicity is measured starting from 0. This means that for a * period of 10 and bases numbered from 1 to 52, the base numbers * [1,10,20,30,40,50,52] will be drawn.
  • *
* * @param n * New numbering period */ public void setNumPeriod(int n) { _conf._numPeriod = n; } /** * Returns the current numbering period. Please notice that : *
    *
  • The first and last base are always numbered
  • *
  • The numbering is based on the base numbers, not on the indices. So * base numbers may appear more frequently than expected if bases are * skipped
  • *
  • The periodicity is measured starting from 0. This means that for a * period of 10 and bases numbered from 1 to 52, the base numbers * [1,10,20,30,40,50,52] will be drawn.
  • *
* * @return Current numbering period */ public int getNumPeriod() { return _conf._numPeriod; } private void setAutoFit(boolean fit) { _conf._autoFit = fit; repaint(); } public void lockScrolling() { setAutoFit(false); setAutoCenter(false); } public void unlockScrolling() { setAutoFit(true); setAutoCenter(true); } private void drawStringOutline(VueVARNAGraphics g2D,String res, double x, double y, double margin) { Dimension d = g2D.getStringDimension(res); x -= (double) d.width / 2.0; y += (double) d.height / 2.0; g2D.setColor(Color.GRAY); g2D.setDashedStroke(); g2D.drawRect((x-margin), (y - d.height-margin), (d.width+2.0*margin), (d.height+2.0*margin)); } private void drawSymbol(VueVARNAGraphics g2D,double posx, double posy, double normx, double normy, double radius, boolean isCIS, ModeleStyleBP.Edge e) { switch (e) { case WATSON_CRICK: if (isCIS) { g2D.fillCircle( (posx - (radius) / 2.0), (posy - (radius) / 2.0), radius); } else { Color bck = g2D.getColor(); g2D.setColor(Color.white); g2D.fillCircle( posx - (radius) / 2.0, (posy - (radius) / 2.0), (radius)); g2D.setColor(bck); g2D.drawCircle( (posx - (radius) / 2.0), (posy - (radius) / 2.0), (radius)); } break; case HOOGSTEEN: { GeneralPath p2 = new GeneralPath(); p2.moveTo((float) (posx - radius * normx / 2.0 - radius * normy / 2.0), (float) (posy - radius * normy / 2.0 + radius * normx / 2.0)); p2.lineTo((float) (posx + radius * normx / 2.0 - radius * normy / 2.0), (float) (posy + radius * normy / 2.0 + radius * normx / 2.0)); p2.lineTo((float) (posx + radius * normx / 2.0 + radius * normy / 2.0), (float) (posy + radius * normy / 2.0 - radius * normx / 2.0)); p2.lineTo((float) (posx - radius * normx / 2.0 + radius * normy / 2.0), (float) (posy - radius * normy / 2.0 - radius * normx / 2.0)); p2.closePath(); if (isCIS) { g2D.fill(p2); } else { Color bck = g2D.getColor(); g2D.setColor(Color.white); g2D.fill(p2); g2D.setColor(bck); g2D.draw(p2); } } break; case SUGAR: { double ix = radius * normx / 2.0; double iy = radius * normy / 2.0; double jx = radius * normy / 2.0; double jy = -radius * normx / 2.0; GeneralPath p2 = new GeneralPath(); p2.moveTo((float) (posx - ix + jx), (float) (posy - iy + jy)); p2.lineTo((float) (posx + ix + jx), (float) (posy + iy + jy)); p2.lineTo((float) (posx - jx), (float) (posy - jy)); p2.closePath(); if (isCIS) { g2D.fill(p2); } else { Color bck = g2D.getColor(); g2D.setColor(Color.white); g2D.fill(p2); g2D.setColor(bck); g2D.draw(p2); } } break; } } private void drawBasePair(VueVARNAGraphics g2D,Point2D.Double orig, Point2D.Double dest, ModeleStyleBP style, double newRadius) { double dx = dest.x - orig.x; double dy = dest.y - orig.y; double dist = Math.sqrt((dest.x - orig.x) * (dest.x - orig.x) + (dest.y - orig.y) * (dest.y - orig.y)); dx /= dist; dy /= dist; double nx = -dy; double ny = dx; orig = new Point2D.Double(orig.x+newRadius*dx,orig.y+newRadius*dy); dest = new Point2D.Double(dest.x-newRadius*dx,dest.y-newRadius*dy); if (_conf._mainBPStyle == VARNAConfig.BP_STYLE.BP_STYLE_LW) { double radiusCircle = ((RNA.BASE_PAIR_DISTANCE - _RNA.BASE_RADIUS) / 5.0) * this._scaleFactor; if (style.isCanonical()) { if (style.isCanonicalGC()) { if ((orig.x != dest.x) || (orig.y != dest.y)) { nx *= this._scaleFactor * _RNA.BASE_RADIUS / 4.0; ny *= this._scaleFactor * _RNA.BASE_RADIUS / 4.0; g2D.drawLine( (orig.x + nx), (orig.y + ny), (dest.x + nx), (dest.y + ny)); g2D.drawLine( (orig.x - nx), (orig.y - ny), (dest.x - nx), (dest.y - ny)); } } else if (style.isWobbleUG()){ g2D.drawLine(orig.x, orig.y, dest.x, dest.y); } else { double cx = (dest.x + orig.x) / 2.0; double cy = (dest.y + orig.y) / 2.0; g2D.drawLine( orig.x, orig.y, dest.x, dest.y); drawSymbol(g2D, cx, cy, nx, ny, radiusCircle, style .isCIS(), style.getEdgePartner5()); } } else { ModeleStyleBP.Edge p1 = style.getEdgePartner5(); ModeleStyleBP.Edge p2 = style.getEdgePartner3(); double cx = (dest.x + orig.x) / 2.0; double cy = (dest.y + orig.y) / 2.0; g2D.drawLine( orig.x, orig.y,dest.x, dest.y); if (p1 == p2) { drawSymbol(g2D, cx, cy, nx, ny, radiusCircle, style .isCIS(), p1); } else { double vdx = (dest.x - orig.x); double vdy = (dest.y - orig.y); vdx /= 6.0; vdy /= 6.0; drawSymbol(g2D, cx + vdx, cy + vdy, nx, ny, radiusCircle, style.isCIS(), p2); drawSymbol(g2D, cx - vdx, cy - vdy, nx, ny, radiusCircle, style.isCIS(), p1); } } } else if (_conf._mainBPStyle == VARNAConfig.BP_STYLE.BP_STYLE_SIMPLE) { g2D.drawLine( orig.x, orig.y,dest.x, dest.y); } else if (_conf._mainBPStyle == VARNAConfig.BP_STYLE.BP_STYLE_RNAVIZ) { double xcenter = (orig.x + dest.x) / 2.0; double ycenter = (orig.y + dest.y) / 2.0; double radius = Math.max(4.0 * this._scaleFactor, 1.0); g2D.fillCircle( (xcenter - radius), (ycenter - radius), (2.0 * radius)); } } private Color getHighlightedVersion(Color c1, Color c2) { int r1 = c1.getRed(); int g1 = c1.getGreen(); int b1 = c1.getBlue(); int r2 = c2.getRed(); int g2 = c2.getGreen(); int b2 = c2.getBlue(); double val = _blink.getVal(); int nr = Math.max(0, Math.min((int) ((r1 * val + r2 * (1.0 - val))), 255)); int ng = Math.max(0, Math.min((int) ((g1 * val + g2 * (1.0 - val))), 255)); int nb = Math.max(0, Math.min((int) ((b1 * val + b2 * (1.0 - val))), 255)); return new Color(nr, ng, nb); } private Color highlightFilter(int index, Color initialColor, Color c1, Color c2) { if (_selectedBases.contains(_RNA.getBaseAt(index))) { return getHighlightedVersion(c1, c2); } else return initialColor; } private Point2D.Double computeExcentricUnitVector(int i,Point2D.Double[] points,Point2D.Double[] centers) { double dist = points[i].distance(centers[i]); Point2D.Double byCenter = new Point2D.Double((points[i].x - centers[i].x)/dist,(points[i].y - centers[i].y)/dist); if ((i>0)&&(i0)){ Point2D.Double vbp = new Point2D.Double(); vbp.x = (p2.x-p1.x)/dist; vbp.y = (p2.y-p1.y)/dist; if (!discontinuous) { g2D.setPlainStroke(); } else { g2D.setDashedStroke(); } if (consecutive && (_RNA.getDrawMode()!=RNA.DRAW_MODE_LINEAR) && (_RNA.getDrawMode()!=RNA.DRAW_MODE_CIRCULAR)) { int dir = 0; if (i+1=0) {dir = (_RNA.testDirectionality(i-2,i-1,i)?-1:1);} Point2D.Double vn = new Point2D.Double(dir*vbp.y,-dir*vbp.x); Point2D.Double centerSeg = new Point2D.Double((p1.x+p2.x)/2.0,(p1.y+p2.y)/2.0); double distp1CenterSeq = p1.distance(centerSeg); double centerDist = Math.sqrt((RNA.VIRTUAL_LOOP_RADIUS*_scaleFactor*RNA.VIRTUAL_LOOP_RADIUS*_scaleFactor)-distp1CenterSeq*distp1CenterSeq); Point2D.Double centerLoop = new Point2D.Double(centerSeg.x+centerDist*vn.x,centerSeg.y+centerDist*vn.y); double radius = centerLoop.distance(p1); double a1 = 360.*(Math.atan2(-(p1.y-centerLoop.y),(p1.x-centerLoop.x)))/(2.*Math.PI); double a2 = 360.*(Math.atan2(-(p2.y-centerLoop.y),(p2.x-centerLoop.x)))/(2.*Math.PI); double angle = (a2-a1); if (-dir*angle<0){angle+= -dir*360.;} //if (angle<0.) angle += 360.; //angle = -dir*(360-dir*angle); g2D.drawArc(centerLoop.x+.8*newRadius*vn.x, centerLoop.y+.8*newRadius*vn.y, 2*radius, 2*radius, a1, angle); } else { g2D.drawLine( (newCoords[i - 1].x+newRadius*vbp.x), (newCoords[i - 1].y+newRadius*vbp.y), (newCoords[i].x-newRadius*vbp.x), (newCoords[i].y-newRadius*vbp.y)); } } } } } public Point2D.Double logicToPanel(Point2D.Double logicPoint) { return new Point2D.Double( _offX + (_scaleFactor * (logicPoint.x - _offsetRNA.x)), _offY + (_scaleFactor * (logicPoint.y - _offsetRNA.y))); } private void renderRNA(VueVARNAGraphics g2D, Rectangle2D.Double bbox) { if (_RNA.get_listeBases().size() != 0) { //_conf._autoCenter = (_RNA.get_drawMode() != RNA.DRAW_MODE_LINEAR); Rectangle2D.Double rnabbox = getExtendedRNABBox(); // Then compute an estimate of the scaling factor if (_conf._autoFit) { setScaleFactor(Math.min((double) bbox.width / (double) rnabbox.width, (double) bbox.height / (double) rnabbox.height)); } // Use it to get an estimate of the font size for numbers ... float newFontSize = Math.max(1, (int) ((1.7 * _RNA.BASE_RADIUS) * _scaleFactor)); // ... and increase bounding box accordingly rnabbox.y -= newFontSize; rnabbox.height += newFontSize; if (_conf._drawColorMap) { rnabbox.height += getColorMapHeight(); } rnabbox.x -= newFontSize; rnabbox.width += newFontSize; // Now, compute the final scaling factor and corresponding font size if (_conf._autoFit) { setScaleFactor(Math.min((double) bbox.width / (double) rnabbox.width, (double) bbox.height / (double) rnabbox.height)); } newFontSize = Math.max(1, (int) ((1.7 * _RNA.BASE_RADIUS) * _scaleFactor)); double newRadius = Math.max(1.0, (_scaleFactor * _RNA.BASE_RADIUS)); setBaseFontSize(newFontSize); setNumbersFontSize(newFontSize); if (_conf._autoCenter) { _offX = bbox.x; _offY = bbox.y; _offX = (bbox.x + (bbox.width - Math.round(rnabbox.width * _scaleFactor)) / 2.0); _offY = (bbox.y + (bbox.height - Math.round(rnabbox.height * _scaleFactor)) / 2.0); _offsetPanel = new Point2D.Double(_offX, _offY); _offsetRNA = new Point2D.Double(rnabbox.x, rnabbox.y); } // Re-scaling once and for all Point2D.Double[] newCoords = new Point2D.Double[_RNA .get_listeBases().size()]; Point2D.Double[] newCenters = new Point2D.Double[_RNA .get_listeBases().size()]; for (int i = 0; i < _RNA.get_listeBases().size(); i++) { ModeleBase mb = _RNA.getBaseAt(i); newCoords[i] = new Point2D.Double( _offX + (_scaleFactor * (mb.getCoords().x - _offsetRNA.x)), _offY + (_scaleFactor * (mb.getCoords().y - _offsetRNA.y))); Point2D.Double centerBck = _RNA.getCenter(i); // si la base est dans un angle entre une boucle et une helice if (_RNA.get_drawMode() == RNA.DRAW_MODE_NAVIEW || _RNA.get_drawMode() == RNA.DRAW_MODE_RADIATE) { if ((mb.getElementStructure() != -1) && i < _RNA.get_listeBases().size() - 1 && i > 1) { ModeleBase b1 = _RNA.get_listeBases().get(i - 1); ModeleBase b2 = _RNA.get_listeBases().get(i + 1); int j1 = b1.getElementStructure(); int j2 = b2.getElementStructure(); if ((j1==-1)^(j2==-1)) { // alors la position du nombre associé doit etre décalé Point2D.Double a1 = b1.getCoords(); Point2D.Double a2 = b2.getCoords(); Point2D.Double c1 = b1.getCenter(); Point2D.Double c2 = b2.getCenter(); centerBck.x = mb.getCoords().x + (c1.x-a1.x)/c1.distance(a1)+(c2.x-a2.x)/c2.distance(a2); centerBck.y = mb.getCoords().y + (c1.y-a1.y)/c1.distance(a1)+(c2.y-a2.y)/c2.distance(a2); } } } newCenters[i] = new Point2D.Double( _offX + (_scaleFactor * (centerBck.x - _offsetRNA.x)), _offY + (_scaleFactor * (centerBck.y - _offsetRNA.y))); } // Keep track of coordinates for mouse interactions _realCoords = newCoords; _realCenters = newCenters; g2D.setStrokeThickness(1.5 * _scaleFactor); g2D.setPlainStroke(); g2D.setFont(_conf._fontBasesGeneral); // Drawing region highlights Annotation drawRegionHighlightsAnnotation(g2D, _realCoords,_realCenters,_scaleFactor); drawBackbone(g2D, newCoords,newRadius); // Drawing base-pairs // si nous sommes en mode ligne double distance, coef; // pour chaque base for (int i = 0; i < _RNA.get_listeBases().size(); i++) { int j = _RNA.get_listeBases().get(i).getElementStructure(); // si c'est une parenthese ouvrante (premiere base du // couple) if (j > i) { ModeleStyleBP msbp = _RNA.get_listeBases().get(i) .getStyleBP(); //System.err.println(msbp); if (msbp.isCanonical() || _conf._drawnNonCanonicalBP) { if (_RNA.get_drawMode() == RNA.DRAW_MODE_LINEAR) { g2D.setStrokeThickness(_RNA .getBasePairThickness(msbp, _conf) * 2.0 * _scaleFactor * _conf._bpThickness); } else { g2D.setStrokeThickness(_RNA.getBasePairThickness(msbp, _conf) * 1.5 * _scaleFactor); } g2D.setColor(_RNA.getBasePairColor(msbp, _conf)); if (_RNA.get_drawMode() == RNA.DRAW_MODE_LINEAR) { if (j - i == 1) coef = getBPHeightIncrement() * 1.75; else coef = getBPHeightIncrement(); distance = newCoords[j].x - newCoords[i].x; g2D.drawArc((newCoords[j].x + newCoords[i].x)/2., newCoords[j].y-_scaleFactor * _RNA.BASE_RADIUS / 2.0, (distance), (distance * coef), 0, 180); } else { drawBasePair(g2D, newCoords[i], newCoords[j], msbp, newRadius); } } } } // Liaisons additionelles (non planaires) if (_conf._drawnNonPlanarBP) { ArrayList bpaux = _RNA.getStructureAux(); for (int k = 0; k < bpaux.size(); k++) { ModeleStyleBP bp = bpaux.get(k); if (bp.isCanonical() || _conf._drawnNonCanonicalBP) { int i = bp.getPartner5().getIndex(); int j = bp.getPartner3().getIndex(); if (_RNA.get_drawMode() == RNA.DRAW_MODE_LINEAR) { g2D.setStrokeThickness(_RNA .getBasePairThickness(bp, _conf) * 2.5 * _scaleFactor * _conf._bpThickness); g2D.setPlainStroke(); } else { g2D.setStrokeThickness(_RNA.getBasePairThickness(bp, _conf) * 1.5 * _scaleFactor); g2D.setPlainStroke(); } g2D.setColor(_RNA.getBasePairColor(bp, _conf)); if (j > i) { if (_RNA.get_drawMode() == RNA.DRAW_MODE_LINEAR ) { if (j - i == 1) coef = getBPHeightIncrement() * 1.75; else coef = getBPHeightIncrement(); distance = (newCoords[j].x - newCoords[i].x); g2D.drawArc( (newCoords[i].x), (newCoords[i].y - (distance * coef / 2) - _scaleFactor * _RNA.BASE_RADIUS / 2.0), (distance), (distance* coef), 0, 180); } else { drawBasePair(g2D, newCoords[i], newCoords[j], bp, newRadius); } } } } } // Drawing bases g2D.setPlainStroke(); for (int i = 0; i < Math.min(_RNA.get_listeBases().size(), newCoords.length); i++) { /*if (mb instanceof ModeleBasesComparison) { ModeleBasesComparison mbc = (ModeleBasesComparison)mb; drawBaseComparison(g2D, i, mbc.get_base1(), mbc.get_base2(), newCoords[i], newCenters[i], newRadius); } else if (mb instanceof ModeleBaseNucleotide)*/ { drawBase(g2D, i, newCoords, newCenters, newRadius); } } // Drawing bbox if (_debug || _drawBBox) { g2D.setColor(Color.RED); g2D.setDashedStroke(); g2D.drawRect(_offX, _offY, (_scaleFactor * rnabbox.width)-1, (_scaleFactor * rnabbox.height)-1); } // Draw color map if (_conf._drawColorMap) { drawColorMap(g2D, _scaleFactor,rnabbox); } if (_debug || _drawBBox) { g2D.setColor(Color.GRAY); g2D.setDashedStroke(); g2D.drawRect(0,0, getWidth()-1, getHeight()-getTitleHeight()-1); } // Draw annotations renderAnnotations(g2D, _offX,_offY,_offsetRNA.x,_offsetRNA.y,_scaleFactor); // Draw additional debug shape if (_RNA._debugShape!=null) { Color c = new Color(255,0,0,50); g2D.setColor(c); AffineTransform at = new AffineTransform(); at.translate(_offX - _scaleFactor *rnabbox.x, _offY - _scaleFactor *rnabbox.y); at.scale(_scaleFactor, _scaleFactor); Shape s = at.createTransformedShape(_RNA._debugShape); if (s instanceof GeneralPath) { g2D.fill((GeneralPath)s); } } } } public ModeleBase getBaseAt(Point2D.Double po) { ModeleBase mb = null; Point2D.Double p = panelToLogicPoint(po); double dist = Double.MAX_VALUE; for(ModeleBase tmp : _RNA.get_listeBases()) { double ndist = tmp.getCoords().distance(p); if (dist > ndist) { mb = tmp; dist = ndist; } } return mb; } public void setColorMapValues(Double[] values){ _RNA.setColorMapValues(values, _conf._cm,true); _conf._drawColorMap = true; repaint(); } public void setColorMapMaxValue(double d) { _conf._cm.setMaxValue(d); } public void setColorMapMinValue(double d) { _conf._cm.setMinValue(d); } public ModeleColorMap getColorMap(){ return _conf._cm; } public void setColorMap(ModeleColorMap cm){ _RNA.adaptColorMapToValues(cm); _conf._cm = cm; repaint(); } public void setColorMapCaption(String caption){ _conf._colorMapCaption = caption; repaint(); } public String getColorMapCaption(){ return _conf._colorMapCaption; } public void drawColorMap(boolean draw){ _conf._drawColorMap = draw; } private double getColorMapHeight() { double result = VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE+_conf._colorMapHeight; if (!_conf._colorMapCaption.equals("")) result += VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE; return result; } private void drawColorMap(VueVARNAGraphics g2D, double scaleFactor, Rectangle2D.Double rnabbox) { double v1 = _conf._cm.getMinValue(); double v2 = _conf._cm.getMaxValue(); double x,y; g2D.setPlainStroke(); double xSpaceAvail = 0; double ySpaceAvail = Math.min((getHeight()-rnabbox.height*scaleFactor-getTitleHeight())/2.0,scaleFactor*(_conf._colorMapHeight+VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE)); if ((int)ySpaceAvail==0) { xSpaceAvail = Math.min((getWidth()-rnabbox.width*scaleFactor)/2,scaleFactor*(_conf._colorMapWidth)+VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH); } double xBase = (xSpaceAvail+ _offX + scaleFactor*( rnabbox.width-_conf._colorMapWidth-_conf._colorMapXOffset )); double hcaption = VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE; double yBase = ( ySpaceAvail+ _offY + scaleFactor*(rnabbox.height - _conf._colorMapHeight - _conf._colorMapYOffset-hcaption)); for (int i=0;i<_conf._colorMapWidth;i++) { double ratio = (((double)i)/((double)_conf._colorMapWidth)); double val = v1+(v2-v1)*ratio; g2D.setColor(_conf._cm.getColorForValue(val)); x = (xBase + scaleFactor*i); y = yBase; g2D.fillRect(x, y, VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH, (scaleFactor*_conf._colorMapHeight)); } g2D.setColor(VARNAConfig.DEFAULT_COLOR_MAP_OUTLINE); g2D.drawRect(xBase, yBase, (VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH-1+scaleFactor*_conf._colorMapWidth), ((scaleFactor*_conf._colorMapHeight))); g2D.setFont(getFont().deriveFont((float) (scaleFactor*VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE))); g2D.setColor(VARNAConfig.DEFAULT_COLOR_MAP_FONT_COLOR); NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(2); nf.setMinimumFractionDigits(2); g2D.drawStringCentered(nf.format(_conf._cm.getMinValue()),xBase,yBase-scaleFactor*(VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE)/1.7); g2D.drawStringCentered(nf.format(_conf._cm.getMaxValue()), xBase+VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH+scaleFactor*_conf._colorMapWidth, yBase-scaleFactor*(VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE)/1.7); if (!_conf._colorMapCaption.equals("")) g2D.drawStringCentered(""+_conf._colorMapCaption,xBase+scaleFactor*_conf._colorMapWidth/2.0,yBase+scaleFactor*(VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE/1.7+_conf._colorMapHeight)); } public Point2D.Double panelToLogicPoint(Point2D.Double p) { return new Point2D.Double(((p.x - getOffsetPanel().x) / getScaleFactor()) + getRNAOffset().x, ((p.y - getOffsetPanel().y) / getScaleFactor()) + getRNAOffset().y); } public Point2D.Double transformCoord(Point2D.Double coordDebut, double offX, double offY, double rnaBBoxX,double rnaBBoxY, double scaleFactor) { return new Point2D.Double( offX + (scaleFactor * (coordDebut.x - rnaBBoxX)), offY+ (scaleFactor * (coordDebut.y - rnaBBoxY))); } public void eraseSequence() { _RNA.eraseSequence(); } public Point2D.Double transformCoord(Point2D.Double coordDebut) { Rectangle2D.Double rnabbox = getExtendedRNABBox(); return new Point2D.Double( _offX + (_scaleFactor * (coordDebut.x - rnabbox.x)), _offY+ (_scaleFactor * (coordDebut.y - rnabbox.y))); } public void paintComponent(Graphics g) { paintComponent(g, false); } public void paintComponent(Graphics g, boolean transparentBackground) { if (_premierAffichage) { //_border = new Dimension(0, 0); _translation.x = 0; _translation.y = (int) (-getTitleHeight() / 2.0); _popup.buildPopupMenu(); this.add(_popup); _premierAffichage = false; } Graphics2D g2 = (Graphics2D) g; VueVARNAGraphics g2D = new SwingGraphics(g2); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); //renderComponent(g2D,transparentBackground); this.removeAll(); super.paintComponent(g2); renderComponent(g2D, transparentBackground); if (isFocusOwner()) { g2.setStroke(new BasicStroke(1.5f)); g2.setColor(Color.decode("#C0C0C0")); g2.drawRect(0, 0, getWidth()-1, getHeight()-1); } /*PSExport e = new PSExport(); SecStrProducerGraphics export = new SecStrProducerGraphics(e); renderRNA(export, getExtendedRNABBox()); try { export.saveToDisk("./out.ps"); } catch (ExceptionWritingForbidden e1) { e1.printStackTrace(); }*/ } /** * Draws current RNA structure in a given Graphics "device". * * @param g * A graphical device * @param transparentBackground * Whether the background should be transparent, or drawn. */ public synchronized void renderComponent(VueVARNAGraphics g2D, boolean transparentBackground) { updateTitleHeight(); if (_debug || _drawBorder) { g2D.setColor(Color.BLACK); g2D.setPlainStroke(); g2D.drawRect(this.getLeftOffset(), this.getTopOffset(), this.getInnerWidth(), this.getInnerHeight()); } if (!transparentBackground) { super.setBackground(_conf._backgroundColor); } else { super.setBackground(new Color(0,0,0,120)); } if (getMinimumSize().height < getSize().height && getMinimumSize().width < getSize().width) { // Draw Title if (!getTitle().equals("")) { g2D.setColor(_conf._titleColor); g2D.setFont(_conf._titleFont); g2D.drawStringCentered(getTitle(), this.getWidth() / 2, this.getHeight() - getTitleHeight() / 2.0); } // Draw RNA renderRNA(g2D, getClip()); } if (_selectionRectangle!=null) { g2D.setColor(Color.BLACK); g2D.setDashedStroke(); g2D.drawRect(_selectionRectangle.x,_selectionRectangle.y,_selectionRectangle.width,_selectionRectangle.height); } if ((getSelectedBaseIndex()>=0) && (_linkDestination!=null)) { g2D.setColor(_conf._bondColor); g2D.setPlainStroke(); g2D.setStrokeThickness(4.0 * _scaleFactor); Point2D.Double linkOrigin = _realCoords[getSelectedBaseIndex()]; Point2D.Double linkDestination = (_linkDestination); g2D.drawLine(linkOrigin.x,linkOrigin.y,linkDestination.x,linkDestination.y); for (int i: getSelection().getIndices()) drawBase(g2D, i, _realCoords, _realCenters, _scaleFactor*_RNA.BASE_RADIUS); } } public void drawRegionHighlightsAnnotation(VueVARNAGraphics g2D, Point2D.Double[] realCoords,Point2D.Double[] realCenters, double scaleFactor) { g2D.setStrokeThickness(2.0 * _scaleFactor); g2D.setPlainStroke(); for (HighlightRegionAnnotation r:_RNA.getHighlightRegion()) { GeneralPath s = r.getShape(realCoords,realCenters,scaleFactor); g2D.setColor(r.getFillColor()); g2D.fill(s); g2D.setColor(r.getOutlineColor()); g2D.draw(s); } } private Rectangle2D.Double getClip() { return new Rectangle2D.Double(this.getLeftOffset(), this.getTopOffset(), this.getInnerWidth(), this .getInnerHeight()); } /** * Returns the color used to draw backbone bounds. * * @return The color used to draw backbone bounds */ public Color getBackboneColor() { return _conf._backboneColor; } /** * Sets the color to be used for drawing backbone interactions. * * @param backbone_color * The new color for the backbone bounds */ public void setBackboneColor(Color backbone_color) { _conf._backboneColor = backbone_color; } /** * Returns the color used to display hydrogen bonds (base pairings) * * @return The color of hydrogen bonds */ public Color getBondColor() { return _conf._bondColor; } /** * Returns the title of this panel * * @return The title */ public String getTitle() { if (!_RNA.getName().equals("")) return _RNA.getName(); else return _conf._title; } /** * Sets the new color to be used for hydrogen bonds (base pairings) * * @param bond_color * The new color for hydrogen bonds */ public void setDefaultBPColor(Color bond_color) { _conf._bondColor = bond_color; } /** * Sets the size of the border, i.e. the empty space between the end of the * drawing area and the actual border. * * @param b * The new border size */ public void setBorderSize(Dimension b) { _border = b; } /** * Returns the size of the border, i.e. the empty space between the end of * the drawing area * * @return The border size */ public Dimension getBorderSize() { return _border; } /** * 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. * * @param r * An already drawn RNA to display in this panel */ public synchronized void showRNA(RNA r) { _RNA = r; } /** * 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. * * @param seq * The raw nucleotides sequence * @param str * The secondary structure * @throws ExceptionNonEqualLength */ public void drawRNA(String seq, String str) throws ExceptionNonEqualLength { drawRNA(seq, str, _RNA.get_drawMode()); } /** * Sets the RNA secondary structure to be drawn in this panel, using a given * layout algorithm. * * @param r * The new secondary structure * @param drawMode * The drawing algorithm */ public void drawRNA(RNA r, int drawMode) { r.setDrawMode(drawMode); drawRNA(r); } /** * Redraws the current RNA. This reassigns base coordinates to their default * value using the current drawing algorithm. */ public void drawRNA() { try { _RNA.drawRNA(_RNA.get_drawMode(),_conf); } catch (ExceptionNAViewAlgorithm e) { errorDialog(e); e.printStackTrace(); } repaint(); } /** * Sets the RNA secondary structure to be drawn in this panel, using the * current drawing algorithm. * * @param r * The new secondary structure */ public void drawRNA(RNA r) { if (r != null) { _RNA = r; drawRNA(); } } /** * 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. * * @param seq * The raw nucleotides sequence * @param str * The secondary structure * @param drawMode * The drawing algorithm * @throws ExceptionNonEqualLength */ public void drawRNA(String seq, String str, int drawMode) throws ExceptionNonEqualLength { _RNA.setDrawMode(drawMode); try { _RNA.setRNA(seq, str); drawRNA(); } catch (ExceptionUnmatchedClosingParentheses e) { errorDialog(e); } catch (ExceptionFileFormatOrSyntax e1) { errorDialog(e1); } } public void drawRNA(Reader r, int drawMode) throws ExceptionNonEqualLength, ExceptionFileFormatOrSyntax { _RNA.setDrawMode(drawMode); _RNA.loadSecStr(r); drawRNA(); } /** * 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. * * @param seq * Sequence * @param str * Structure in dot bracket notation * @throws ExceptionNonEqualLength * If len(seq)!=len(str) */ public void drawRNAInterpolated(String seq, String str) throws ExceptionNonEqualLength { drawRNAInterpolated(seq, str, _RNA.get_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. * * @param seq * Sequence * @param str * Structure in dot bracket notation * @param drawMode * The drawing algorithm to be used for the initial placement * @throws ExceptionNonEqualLength * If len(seq)!=len(str) */ public void drawRNAInterpolated(String seq, String str, int drawMode) { drawRNAInterpolated(seq, str, drawMode, Mapping .DefaultOutermostMapping(_RNA.get_listeBases().size(), str .length())); } /** * 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. * * @param seq * Sequence * @param str * Structure in dot bracket notation * @param m * A mapping between the currently rendered structure and its * successor (seq,str) * @throws ExceptionNonEqualLength * If len(seq)!=len(str) */ public void drawRNAInterpolated(String seq, String str, Mapping m) { drawRNAInterpolated(seq, str, _RNA.get_drawMode(), 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. * * @param seq * Sequence * @param str * Structure in dot bracket notation * @param drawMode * The drawing algorithm to be used for the initial placement * @param m * A mapping between the currently rendered structure and its * successor (seq,str) */ public void drawRNAInterpolated(String seq, String str, int drawMode, Mapping m) { RNA target = new RNA(); try { target.setRNA(seq, str); drawRNAInterpolated(target, drawMode, m); } catch (ExceptionUnmatchedClosingParentheses e) { errorDialog(e); } catch (ExceptionFileFormatOrSyntax e) { errorDialog(e); } } /** * 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. * * @param target * Secondary structure */ public void drawRNAInterpolated(RNA target) { drawRNAInterpolated(target, target.get_drawMode(), Mapping .DefaultOutermostMapping(_RNA.get_listeBases().size(), target .getSize())); } /** * 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. * * @param target * Secondary structure * @param m * A mapping between the currently rendered structure and its * successor (seq,str) */ public void drawRNAInterpolated(RNA target, Mapping m) { drawRNAInterpolated(target, target.get_drawMode(), 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. * * @param target * Secondary structure of RNA * @param drawMode * The drawing algorithm to be used for the initial placement * @param m * A mapping between the currently rendered structure and its * successor (seq,str) */ public void drawRNAInterpolated(RNA target, int drawMode, Mapping m) { try { target.drawRNA(drawMode,_conf); _conf._drawColorMap = false; _interpolator.addTarget(target, m); } catch (ExceptionNAViewAlgorithm e) { errorDialog(e); e.printStackTrace(); } } /** * Returns the current algorithm used for drawing the structure * * @return The current drawing algorithm */ public int getDrawMode() { return this._RNA.getDrawMode(); } public void showRNA(RNA t, VARNAConfig cfg) { showRNA(t); if (cfg!=null) { this.setConfig(cfg); } repaint(); } /** * Checks whether an interpolated transition bewteen two RNAs is occurring. * * @return True if an interpolated transition is occurring, false otherwise */ public boolean isInterpolationInProgress() { if (_interpolator == null) { return false; } else return _interpolator.isInterpolationInProgress(); } /** * 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. * * @param target * Secondary structure of RNA */ public void showRNAInterpolated(RNA target) { showRNAInterpolated(target, Mapping.DefaultOutermostMapping(_RNA .get_listeBases().size(), target.getSize())); } /** * 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. * * @param target * Secondary structure of RNA * @param m * A mapping between the currently rendered structure and its * successor (seq,str) * @throws ExceptionNonEqualLength * If len(seq)!=len(str) */ public void showRNAInterpolated(RNA target, Mapping m) { showRNAInterpolated(target, null,m); } public void showRNAInterpolated(RNA target, VARNAConfig cfg, Mapping m) { _interpolator.addTarget(target,cfg, m); } /** * 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: ((((((((....))))..(((((...))).))))))
* * @param firstSeq * The first RNA raw nucleotides sequence * @param firstStruct * The first RNA secondary structure * @param secondSeq * The second RNA raw nucleotides sequence * @param secondStruct * The second RNA secondary structure * @param drawMode * The drawing algorithm */ public void drawRNA(String firstSeq, String firstStruct, String secondSeq, String secondStruct, int drawMode) { _RNA.setDrawMode(drawMode); /** * Checking the sequences and structures validities... */ // This is a comparison, so the two RNA alignment past in parameters must // have the same sequence and structure length. if (firstSeq.length() == secondSeq.length() && firstStruct.length() == secondStruct.length()) { // First RNA if (firstSeq.length() != firstStruct.length()) { if (_conf._showWarnings) { emitWarning("First sequence length " + firstSeq.length() + " differs from that of it's secondary structure " + firstStruct.length() + ". \nAdapting first sequence length ..."); } if (firstSeq.length() < firstStruct.length()) { while (firstSeq.length() < firstStruct.length()) { firstSeq += " "; } } else { firstSeq = firstSeq.substring(0, firstStruct.length()); } } // Second RNA if (secondSeq.length() != secondStruct.length()) { if (_conf._showWarnings) { emitWarning("Second sequence length " + secondSeq.length() + " differs from that of it's secondary structure " + secondStruct.length() + ". \nAdapting second sequence length ..."); } if (secondSeq.length() < secondStruct.length()) { while (secondSeq.length() < secondStruct.length()) { secondSeq += " "; } } else { secondSeq = secondSeq.substring(0, secondStruct.length()); } } int RNALength = firstSeq.length(); String string_superStruct = new String(""); String string_superSeq = new String(""); /** * In this array, we'll have for each indexes of each characters of * the final super-structure, the RNA number which is own it. */ ArrayList array_rnaOwn = new ArrayList(); /** * Generating super-structure sequences and structures... */ firstStruct = firstStruct.replace('-', '.'); secondStruct = secondStruct.replace('-', '.'); // First of all, we make the structure for (int i = 0; i < RNALength; i++) { // If both characters are the same, so it'll be in the super // structure if (firstStruct.charAt(i) == secondStruct.charAt(i)) { string_superStruct = string_superStruct + firstStruct.charAt(i); array_rnaOwn.add(0); } // Else if one of the characters is an opening parenthese, so // it'll be an opening parenthese in the super structure else if (firstStruct.charAt(i) == '(' || secondStruct.charAt(i) == '(') { string_superStruct = string_superStruct + '('; array_rnaOwn.add((firstStruct.charAt(i) == '(') ? 1 : 2); } // Else if one of the characters is a closing parenthese, so // it'll be a closing parenthese in the super structure else if (firstStruct.charAt(i) == ')' || secondStruct.charAt(i) == ')') { string_superStruct = string_superStruct + ')'; array_rnaOwn.add((firstStruct.charAt(i) == ')') ? 1 : 2); } else { string_superStruct = string_superStruct + '.'; array_rnaOwn.add(-1); } } // Next, we make the sequence taking the characters at the same // index in the first and second sequence for (int i = 0; i < RNALength; i++) { string_superSeq = string_superSeq + firstSeq.charAt(i) + secondSeq.charAt(i); } // Now, we need to create the super-structure RNA with the owning // bases array // in order to color bases outer depending on the owning statement // of each bases. if (!string_superSeq.equals("") && !string_superStruct.equals("")) { try { _RNA.setRNA(string_superSeq, string_superStruct, array_rnaOwn); } catch (ExceptionUnmatchedClosingParentheses e) { errorDialog(e); } catch (ExceptionFileFormatOrSyntax e) { errorDialog(e); } } else { emitWarning("ERROR : The super-structure is NULL."); } switch (_RNA.get_drawMode()) { case RNA.DRAW_MODE_RADIATE: _RNA.drawRNARadiate(_conf); break; case RNA.DRAW_MODE_CIRCULAR: _RNA.drawRNACircle(); break; case RNA.DRAW_MODE_LINEAR: _RNA.drawRNALine(); break; case RNA.DRAW_MODE_NAVIEW: try { _RNA.drawRNANAView(); } catch (ExceptionNAViewAlgorithm e) { errorDialog(e); } break; default: break; } } } /** * Returns the currently selected base index, obtained through a mouse-left * click * * @return Selected base */ public int getSelectedBaseIndex() { return _selectedBase; } /** * Returns the currently selected base, obtained through a mouse-left click * * @return Selected base */ public ModeleBase getSelectedBase() { return _RNA.get_listeBases().get(_selectedBase); } /** * Sets the selected base index * * @param base * New selected base index */ public void setSelectedBase(int base) { _selectedBase = base; } /** * Returns the coordinates of the currently displayed RNA * * @return Coordinates array */ public Point2D.Double[] getRealCoords() { return _realCoords; } /** * Sets the coordinates of the currently displayed RNA * * @param coords * New coordinates */ public void setRealCoords(Point2D.Double[] coords) { _realCoords = coords; } /** * Returns the popup menu used for user mouse iteractions * * @return Popup menu */ public VueMenu getPopup() { return _popup; } /** * Sets the color used to display hydrogen bonds (base pairings) * * @param bond_color * The color of hydrogen bonds */ public void setBondColor(Color bond_color) { _conf._bondColor = bond_color; } /** * Returns the color used to draw the title * * @return The color used to draw the title */ public Color getTitleColor() { return _conf._titleColor; } /** * Sets the color used to draw the title * * @param title_color * The new color used to draw the title */ public void setTitleColor(Color title_color) { _conf._titleColor = title_color; } /** * Returns the height taken by the title * * @return The height taken by the title */ private int getTitleHeight() { return _titleHeight; } /** * Sets the height taken by the title * * @param title_height * The height taken by the title */ @SuppressWarnings("unused") private void setTitleHeight(int title_height) { _titleHeight = title_height; } /** * Returns the current state of auto centering mode. * * @return True if autocentered, false otherwise */ public boolean isAutoCentered() { return _conf._autoCenter; } /** * Sets the current state of auto centering mode. * * @param center * New auto-centered state */ public void setAutoCenter(boolean center) { _conf._autoCenter = center; } /** * Returns the font currently used for rendering the title. * * @return Current title font */ public Font getTitleFont() { return _conf._titleFont; } /** * Sets the font used for rendering the title. * * @param font * New title font */ public void setTitleFont(Font font) { _conf._titleFont = font; updateTitleHeight(); } /** * For the LINE_MODE drawing algorithm, sets the base pair height increment, * i.e. the vertical distance between two nested arcs. * * @return The current base pair increment */ public double getBPHeightIncrement() { return _RNA._bpHeightIncrement; } /** * Sets the base pair height increment, i.e. the vertical distance between * two arcs to be used in LINE_MODE. * * @param inc * New height increment */ public void setBPHeightIncrement(double inc) { _RNA._bpHeightIncrement = inc; } /** * Gets the scale factor used by the autofitting function * * @return Current scale factor */ public double getScaleFactor() { return _scaleFactor; } /** * Sets the scale factor used by the autofitting function * * @param factor * New scale factor */ public void setScaleFactor(double factor) { _scaleFactor = factor; } /** * Returns the shifting of the origin of the Panel in zoom mode * * @return The logical coordinate of the top-left panel point */ public Point2D.Double getOffsetPanel() { return _offsetPanel; } /** * Returns the vector bringing the logical coordinate of left-top-most point * in the panel to the left-top-most point of the RNA. * * @return The logical coordinate of the top-left panel point */ public Point2D.Double getRNAOffset() { return _offsetRNA; } /** * Returns this panel's UI menu * * @return Applet's UI popupmenu */ public VueMenu getPopupMenu() { return _popup; } /** * Returns the atomic zoom factor step, or increment. * * @return Atomic zoom factor increment */ public double getZoomIncrement() { return _conf._zoomAmount; } /** * Sets the atomic zoom factor step, or increment. * * @param amount * Atomic zoom factor increment */ public void setZoomIncrement(Object amount) { setZoomIncrement(Float.valueOf(amount.toString())); } /** * Sets the atomic zoom factor step, or increment. * * @param amount * Atomic zoom factor increment */ public void setZoomIncrement(double amount) { _conf._zoomAmount = amount; } /** * Returns the current zoom factor * * @return Current zoom factor */ public double getZoom() { return _conf._zoom; } /** * Sets the current zoom factor * * @param _zoom * New zoom factor */ public void setZoom(Object _zoom) { _conf._zoom = Float.valueOf(_zoom.toString()); } /** * Returns the translation used for zooming in and out * * @return A vector describing the translation */ public Point getTranslation() { return _translation; } /** * Sets the translation used for zooming in and out * * @param trans * A vector describing the new translation */ public void setTranslation(Point trans) { this._translation = trans; } /** * Returns the current RNA model * * @return Current RNA model */ public RNA getRNA() { return _RNA; } /** * Checks whether the drawn RNA is too large to be displayed, allowing for * shifting mouse interactions. * * @return true if the RNA is too large to be displayed, false otherwise */ public boolean isOutOfFrame() { return _horsCadre; } /** * Pops up an error Dialog displaying an exception in an human-readable way. * * @param error * The exception to display within the Dialog */ public void errorDialog(Exception error) { errorDialog(error, this); } /** * Pops up an error Dialog displaying an exception in an human-readable way * if errors are set to be displayed. * * @see #setErrorsOn(boolean) * @param error * The exception to display within the Dialog * @param c * Parent component for the dialog box */ public void errorDialog(Exception error, Component c) { if (isErrorsOn()) { JOptionPane.showMessageDialog(c, error.getMessage(), "VARNA Error", JOptionPane.ERROR_MESSAGE); } } /** * Pops up an error Dialog displaying an exception in an human-readable way. * * @param error * The exception to display within the Dialog * @param c * Parent component for the dialog box */ public static void errorDialogStatic(Exception error, Component c) { JOptionPane.showMessageDialog(c, error.getMessage(), "VARNA Critical Error", JOptionPane.ERROR_MESSAGE); } /** * Displays a warning message through a modal dialog if warnings are set to * be displayed. * * @see #setShowWarnings(boolean) * @param warning * A message expliciting the warning */ public void emitWarning(String warning) { if (_conf._showWarnings) JOptionPane.showMessageDialog(this, warning, "VARNA Warning", JOptionPane.WARNING_MESSAGE); } /** * Toggles modifications on and off * * @param modifiable * Modification status */ public void setModifiable(boolean modifiable) { _conf._modifiable = modifiable; } /** * Returns current modification status * * @return current modification status */ public boolean isModifiable() { return _conf._modifiable; } /** * Resets the visual aspects (Zoom factor, shift) for the Panel. */ public void reset() { this.setBorderSize(new Dimension(0, 0)); this.setTranslation(new Point(0, (int) (-getTitleHeight() / 2.0))); this.setZoom(VARNAConfig.DEFAULT_ZOOM); this.setZoomIncrement(VARNAConfig.DEFAULT_AMOUNT); } /** * Returns the color used to draw non-standard bases * * @return The color used to draw non-standard bases */ public Color getNonStandardBasesColor() { return _conf._specialBasesColor; } /** * Sets the color used to draw non-standard bases * * @param basesColor * The color used to draw non-standard bases */ public void setNonStandardBasesColor(Color basesColor) { _conf._specialBasesColor = basesColor; } /** * Checks if the current translation doesn't "kick" the whole RNA out of the * panel, and corrects the situation if necessary. */ public void checkTranslation() { // verification pour un zoom < 1 if (this.getZoom() <= 1) { // verification sortie gauche if (this.getTranslation().x < -(int) ((this.getWidth() - this .getInnerWidth()) / 2.0)) { this.setTranslation(new Point(-(int) ((this.getWidth() - this .getInnerWidth()) / 2.0), this.getTranslation().y)); } // verification sortie droite if (this.getTranslation().x > (int) ((this.getWidth() - this .getInnerWidth()) / 2.0)) { this.setTranslation(new Point((int) ((this.getWidth() - this .getInnerWidth()) / 2.0), this.getTranslation().y)); } // verification sortie bas if (this.getTranslation().y > (int) ((this.getHeight() - getTitleHeight() * 2 - this.getInnerHeight()) / 2.0)) { this.setTranslation(new Point(this.getTranslation().x, (int) ((this.getHeight() - getTitleHeight() * 2 - this .getInnerHeight()) / 2.0))); } // verification sortie haut if (this.getTranslation().y < -(int) ((this.getHeight() - this .getInnerHeight()) / 2.0)) { this .setTranslation(new Point(this.getTranslation().x, -(int) ((this.getHeight() - this .getInnerHeight()) / 2.0))); } } else { // zoom > 1 if (this.getTranslation().x < -(int) ((this.getInnerWidth()) / 2.0)) { this.setTranslation(new Point( -(int) ((this.getInnerWidth()) / 2.0), this .getTranslation().y)); } if (this.getTranslation().x > (int) ((this.getInnerWidth()) / 2.0)) { this.setTranslation(new Point( (int) ((this.getInnerWidth()) / 2.0), this .getTranslation().y)); } if (this.getTranslation().y < -(int) ((this.getInnerHeight()) / 2.0)) { this.setTranslation(new Point(this.getTranslation().x, -(int) ((this.getInnerHeight()) / 2.0))); } if (this.getTranslation().y > (int) ((this.getInnerHeight()) / 2.0)) { this.setTranslation(new Point(this.getTranslation().x, (int) ((this.getInnerHeight()) / 2.0))); } } } /** * Returns the "real pixels" x-coordinate of the RNA. * * @return X-coordinate of the translation */ public int getLeftOffset() { return _border.width + ((this.getWidth() - 2 * _border.width) - this.getInnerWidth()) / 2 + _translation.x; } /** * Returns the "real pixels" width of the drawing surface for our RNA. * * @return Width of the drawing surface for our RNA */ public int getInnerWidth() { // Largeur du dessin return (int) Math.round((this.getWidth() - 2 * _border.width) * _conf._zoom); } /** * Returns the "real pixels" y-coordinate of the RNA. * * @return Y-coordinate of the translation */ public int getTopOffset() { return _border.height + ((this.getHeight() - 2 * _border.height) - this .getInnerHeight()) / 2 + _translation.y; } /** * Returns the "real pixels" height of the drawing surface for our RNA. * * @return Height of the drawing surface for our RNA */ public int getInnerHeight() { // Hauteur du dessin return (int) Math.round((this.getHeight()) * _conf._zoom - 2 * _border.height - getTitleHeight()); } /** * Checks if the current mode is the "comparison" mode * * @return True if comparison, false otherwise */ public boolean isComparisonMode() { return _conf._comparisonMode; } /** * Rotates the RNA coordinates by a certain angle * * @param angleDegres * Rotation angle, in degrees */ public void globalRotation(Double angleDegres) { _RNA.globalRotation(angleDegres); fireLayoutChanged(); repaint(); } /** * Returns the index of the currently selected base, defaulting to the * closest base to the last mouse-click. * * @return Index of the currently selected base */ public Integer getNearestBase() { return _nearestBase; } /** * Sets the index of the currently selected base. * * @param base * Index of the new selected base */ public void setNearestBase(Integer base) { _nearestBase = base; } /** * Returns the color used to draw 'Gaps' bases in comparison mode * * @return Color used for 'Gaps' */ public Color getGapsBasesColor() { return _conf._dashBasesColor; } /** * Sets the color to use for 'Gaps' bases in comparison mode * * @param c * Color used for 'Gaps' */ public void setGapsBasesColor(Color c) { _conf._dashBasesColor = c; } @SuppressWarnings("unused") private void imprimer() { // PrintPanel canvas; // canvas = new PrintPanel(); PrintRequestAttributeSet attributes; attributes = new HashPrintRequestAttributeSet(); try { PrinterJob job = PrinterJob.getPrinterJob(); // job.setPrintable(this); if (job.printDialog(attributes)) { job.print(attributes); } } catch (PrinterException exception) { errorDialog(exception); } } /** * Checks whether errors are to be displayed * * @return Error display status */ public boolean isErrorsOn() { return _conf._errorsOn; } /** * Sets whether errors are to be displayed * * @param on * New error display status */ public void setErrorsOn(boolean on) { _conf._errorsOn = on; } /** * Returns the view associated with user interactions * * @return A view associated with user interactions */ public VueUI getVARNAUI() { return _UI; } /** * Toggles on/off using base inner color for drawing base-pairs * * @param on * True for using base inner color for drawing base-pairs, false * for classic mode */ public void setUseBaseColorsForBPs(boolean on) { _conf._useBaseColorsForBPs = on; } /** * Returns true if current base color is used as inner color for drawing * base-pairs * * @return True for using base inner color for drawing base-pairs, false for * classic mode */ public boolean getUseBaseColorsForBPs() { return _conf._useBaseColorsForBPs; } /** * Toggles on/off using a special color used for drawing "non-standard" * bases * * @param on * True for using a special color used for drawing "non-standard" * bases, false for classic mode */ public void setColorNonStandardBases(boolean on) { _conf._colorSpecialBases = on; } /** * Returns true if a special color is used as inner color for non-standard * base * * @return True for using a special color used for drawing "non-standard" * bases, false for classic mode */ public boolean getColorSpecialBases() { return _conf._colorSpecialBases; } /** * Toggles on/off using a special color used for drawing "Gaps" bases in * comparison mode * * @param on * True for using a special color used for drawing "Gaps" bases * in comparison mode, false for classic mode */ public void setColorGapsBases(boolean on) { _conf._colorDashBases = on; } /** * Returns true if a special color is used for drawing "Gaps" bases in * comparison mode * * @return True for using a special color used for drawing "Gaps" bases in * comparison mode, false for classic mode */ public boolean getColorGapsBases() { return _conf._colorDashBases; } /** * Toggles on/off displaying warnings * * @param on * True to display warnings, false otherwise */ public void setShowWarnings(boolean on) { _conf._showWarnings = on; } /** * Get current warning display status * * @return True to display warnings, false otherwise */ public boolean getShowWarnings() { return _conf._showWarnings; } /** * Toggles on/off displaying non-canonical base-pairs * * @param on * True to display NC base-pairs, false otherwise */ public void setShowNonCanonicalBP(boolean on) { _conf._drawnNonCanonicalBP = on; } /** * Return the current display status for non-canonical base-pairs * * @return True if NC base-pairs are displayed, false otherwise */ public boolean getShowNonCanonicalBP() { return _conf._drawnNonCanonicalBP; } /** * Toggles on/off displaying "non-planar" base-pairs * * @param on * True to display "non-planar" base-pairs, false otherwise */ public void setShowNonPlanarBP(boolean on) { _conf._drawnNonPlanarBP = on; } /** * Return the current display status for non-planar base-pairs * * @return True if non-planars base-pairs are displayed, false otherwise */ public boolean getShowNonPlanarBP() { return _conf._drawnNonPlanarBP; } /** * Sets the base-pair representation style * * @param st * The new base-pair style */ public void setBPStyle(VARNAConfig.BP_STYLE st) { _conf._mainBPStyle = st; } /** * Returns the base-pair representation style * * @return The current base-pair style */ public VARNAConfig.BP_STYLE getBPStyle() { return _conf._mainBPStyle; } /** * Returns the current VARNA Panel configuration. The returned instance * should not be modified directly, but rather through the getters/setters * from the VARNAPanel class. * * @return Current configuration */ public VARNAConfig getConfig() { return _conf; } /** * Sets the background color * * @param c * New background color */ public void setBackground(Color c) { if (_conf != null) { if (c!=null) { _conf._backgroundColor = c; _conf._drawBackground = (!c.equals(VARNAConfig.DEFAULT_BACKGROUND_COLOR)); } else { _conf._backgroundColor = VARNAConfig.DEFAULT_BACKGROUND_COLOR; _conf._drawBackground = false; } } } /** * Starts highlighting the selected base. */ public void highlightSelectedBase() { ArrayList v = new ArrayList(); int sel = getSelectedBaseIndex(); if (sel != -1) { v.add(sel); } setSelection(v); } /** * Starts highlighting the selected base. */ public void highlightSelectedStem() { ArrayList v = new ArrayList(); int sel = getSelectedBaseIndex(); if (sel != -1) { ArrayList r = _RNA.findStem(sel); v.addAll(r); } setSelection(v); } public BaseList getSelection() { return _selectedBases; } public ArrayList getSelectionIndices() { return _selectedBases.getIndices(); } public void setSelection(ArrayList indices) { setSelection(_RNA.getBasesAt(indices)); } public void setSelection(Collection mbs) { _selectedBases.clear(); _selectedBases.addBases(mbs); _blink.setActive(true); } public ArrayList getBasesInRectangleDiff(Rectangle recIn, Rectangle recOut) { ArrayList result = new ArrayList(); for (int i=0;i getBasesInRectangle(Rectangle rec) { ArrayList result = new ArrayList(); for (int i=0;i result = new ArrayList(); if (_selectionRectangle!=null) { result = getBasesInRectangleDiff(_selectionRectangle, rec); } else { result = getBasesInRectangle(rec); } _selectionRectangle = new Rectangle(rec); toggleSelection(result); repaint(); } public void removeSelectionRectangle() { _selectionRectangle = null; } public void addToSelection(Collection indices) { for(int i : indices) { addToSelection(i); } } public void addToSelection(int i) { ModeleBase mb = _RNA.getBaseAt(i); if (!_selectedBases.contains(mb)) _selectedBases.addBase(mb); _blink.setActive(true); } public void removeFromSelection(int i) { ModeleBase mb = _RNA.getBaseAt(i); if (_selectedBases.contains(mb)) _selectedBases.removeBase(mb); _blink.setActive(true); } public boolean isInSelection(int i) { return _selectedBases.contains(_RNA.getBaseAt(i)); } public void toggleSelection(int i) { if (isInSelection(i)) removeFromSelection(i); else addToSelection(i); } public void toggleSelection(Collection indices) { for(int i : indices) { toggleSelection(i); } } /** * Stops highlighting bases */ public void clearSelection() { _selectedBases.clear(); _blink.setActive(false); repaint(); } public void saveSelection() { _backupSelection.clear(); _backupSelection.addAll(_selectedBases.getBases()); } public void restoreSelection() { setSelection(_backupSelection); } /** * Stops highlighting bases */ public void resetAnnotationHighlight() { _highlightAnnotation = false; repaint(); } /** * Toggles on/off a rectangular outline of the bounding box. * * @param on * True to draw the bounding box, false otherwise */ public void drawBBox(boolean on) { _drawBBox = on; } /** * Toggles on/off a rectangular outline of the border. * * @param on * True to draw the bounding box, false otherwise */ public void drawBorder(boolean on) { _drawBorder = on; } public void setBaseInnerColor(Color c) { _RNA.setBaseInnerColor(c); } public void setBaseNumbersColor(Color c) { _RNA.setBaseNumbersColor(c); } public void setBaseNameColor(Color c) { _RNA.setBaseNameColor(c); } public void setBaseOutlineColor(Color c) { _RNA.setBaseOutlineColor(c); } public ArrayList getListeAnnotations() { return _RNA.getAnnotations(); } public void resetListeAnnotations() { _RNA.clearAnnotations(); repaint(); } public void addAnnotation(TextAnnotation textAnnotation) { _RNA.addAnnotation(textAnnotation); repaint(); } public boolean removeAnnotation(TextAnnotation textAnnotation) { boolean done = _RNA.removeAnnotation(textAnnotation); repaint(); return done; } public TextAnnotation get_selectedAnnotation() { return _selectedAnnotation; } public void set_selectedAnnotation(TextAnnotation annotation) { _selectedAnnotation = annotation; } public void removeSelectedAnnotation() { _highlightAnnotation = false; _selectedAnnotation = null; } public void highlightSelectedAnnotation() { _highlightAnnotation = true; } public boolean getFlatExteriorLoop() { return _conf._flatExteriorLoop; } public void setFlatExteriorLoop(boolean on) { _conf._flatExteriorLoop = on; } public void setLastSelectedPosition(Point2D.Double p) { _lastSelectedCoord.x = p.x; _lastSelectedCoord.y = p.y; } public Point2D.Double getLastSelectedPosition() { return _lastSelectedCoord; } public void setSequence(String s) { _RNA.setSequence(s); repaint(); } public void setColorMapVisible(boolean b) { _conf._drawColorMap = b; repaint(); } public boolean getColorMapVisible() { return _conf._drawColorMap; } public void removeColorMap() { _conf._drawColorMap = false; repaint(); } public void saveSession(String path) { FileOutputStream fos = null; ObjectOutputStream out = null; try { fos = new FileOutputStream(path); out = new ObjectOutputStream(fos); out.writeObject(new FullBackup(_conf,_RNA,_conf._title)); out.close(); } catch(Exception ex) { ex.printStackTrace(); } } public FullBackup loadSession(String path) throws ExceptionLoadingFailed { FullBackup bck = importSession(path); Mapping map = Mapping.DefaultOutermostMapping(getRNA().getSize(), bck.rna.getSize()); showRNAInterpolated(bck.rna,map); _conf = bck.config; repaint(); return bck; } public static String VARNA_SESSION_EXTENSION = "varna"; public static FullBackup importSession(String path) throws ExceptionLoadingFailed { try { return importSession(new FileInputStream(path),path); } catch (FileNotFoundException e) { throw (new ExceptionLoadingFailed("File not found.",path)); } } public static FullBackup importSession(InputStream fis, String path) throws ExceptionLoadingFailed { FullBackup bck = null; ObjectInputStream in = null; try { in = new ObjectInputStream(fis); bck = (FullBackup) in.readObject(); in.close(); return bck; } catch(IOException ex) { throw new ExceptionLoadingFailed("I/O error while reading VARNA session", path); } catch(ClassNotFoundException ex) { throw new ExceptionLoadingFailed("Bad format while reading VARNA session", path); } } public void loadFile(String path) { loadFile(path,false); } public boolean getDrawBackbone() { return _conf._drawBackbone; } public void setDrawBackbone(boolean b) { _conf._drawBackbone = b; } public void addHighlightRegion(HighlightRegionAnnotation n) { _RNA.addHighlightRegion(n); } public void removeHighlightRegion(HighlightRegionAnnotation n) { _RNA.removeHighlightRegion(n); } public void addHighlightRegion(int i, int j) { _RNA.addHighlightRegion(i, j); } public void addHighlightRegion(int i, int j, Color fill, Color outline, double radius) { _RNA.addHighlightRegion(i, j,fill, outline,radius); } public void loadFile(String path, boolean interpolate) { try{ loadSession(path); } catch(Exception e1) { RNA r = new RNA(); try { r.loadSecStr(path); try { r.drawRNA(_conf); } catch (ExceptionNAViewAlgorithm e) { e.printStackTrace(); } if (!interpolate) { showRNA(r); } else { this.showRNAInterpolated(r); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e) { e.printStackTrace(); }catch (Exception e) { e.printStackTrace(); } } } public void setConfig(VARNAConfig cfg) { _conf = cfg; } public void toggleDrawOutlineBase() { _conf._drawOutlineBase = !_conf._drawOutlineBase; } public void toggleFillBase() { _conf._fillBase =!_conf._fillBase; } public void readValues(Reader r) { this._RNA.readValues(r, _conf._cm); } public void addVARNAListener(InterfaceVARNAListener v) { _VARNAListeners.add(v); } public void fireLayoutChanged() { for(InterfaceVARNAListener v: _VARNAListeners) { v.onLayoutChanged(); } } public void fireUINewStructure(VARNAConfig v, RNA r) { for(InterfaceVARNAListener v2: _VARNAListeners) { v2.onUINewStructure(v,r); } } public double getOrientation() { return _RNA.getOrientation(); } } PK f> fr/orsay/lri/varna/applications/PK 4F>t!2fr/orsay/lri/varna/applications/VARNAPrinter.class1`,fr/orsay/lri/varna/applications/VARNAPrinterjava/lang/Objectjava/awt/print/PrintablecomponentToBePrintedLjava/awt/Component;printComponent(Ljava/awt/Component;)VCode     print()VLineNumberTableLocalVariableTablec    this.Lfr/orsay/lri/varna/applications/VARNAPrinter; java/awt/print/PrinterJob ! getPrinterJob()Ljava/awt/print/PrinterJob; # $% setPrintable(Ljava/awt/print/Printable;)V ' () printDialog()Z ,java/awt/print/PrinterExceptionprintJobLjava/awt/print/PrinterJob;2(Ljava/awt/Graphics;Ljava/awt/print/PageFormat;I)I1java/awt/Graphics2D 354java/awt/print/PageFormat 67 getImageableX()D 39 :7 getImageableY 0< => translate(DD)V @ A disableDoubleBuffering CEDjava/awt/Component FGpaint(Ljava/awt/Graphics;)V I J enableDoubleBufferinggLjava/awt/Graphics; pageFormatLjava/awt/print/PageFormat; pageIndexIg2dLjava/awt/Graphics2D; TVUjavax/swing/RepaintManager WXcurrentManager2(Ljava/awt/Component;)Ljavax/swing/RepaintManager; TZ [\setDoubleBufferingEnabled(Z)VLjavax/swing/RepaintManager; SourceFileVARNAPrinter.java!  : Y*       F **+    iL+*"+& +*M+ -./ 2+0:,2,8;*?*B*H"! "# $)%0&422KL2MN2OP &QR A  G *SL+Y+, - W] J  G *SL+Y01 2 W]^_PK W*=f1fr/orsay/lri/varna/applications/VARNAPrinter.javapackage fr.orsay.lri.varna.applications; import java.awt.*; import javax.swing.*; import java.awt.print.*; public class VARNAPrinter implements Printable { private Component componentToBePrinted; public static void printComponent(Component c) { new VARNAPrinter(c).print(); } public VARNAPrinter(Component componentToBePrinted) { this.componentToBePrinted = componentToBePrinted; } public void print() { PrinterJob printJob = PrinterJob.getPrinterJob(); printJob.setPrintable(this); if (printJob.printDialog()) try { printJob.print(); } catch(PrinterException pe) { //System.out.println("Error printing: " + pe); } } public int print(Graphics g, PageFormat pageFormat, int pageIndex) { if (pageIndex > 0) { return(NO_SUCH_PAGE); } else { Graphics2D g2d = (Graphics2D)g; g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); disableDoubleBuffering(componentToBePrinted); componentToBePrinted.paint(g2d); enableDoubleBuffering(componentToBePrinted); return(PAGE_EXISTS); } } public static void disableDoubleBuffering(Component c) { RepaintManager currentManager = RepaintManager.currentManager(c); currentManager.setDoubleBufferingEnabled(false); } public static void enableDoubleBuffering(Component c) { RepaintManager currentManager = RepaintManager.currentManager(c); currentManager.setDoubleBufferingEnabled(true); } } PK F>dx]]4fr/orsay/lri/varna/applications/NussinovDemo$1.class1'.fr/orsay/lri/varna/applications/NussinovDemo$1java/lang/Objectjava/awt/event/ActionListenerthis$0.Lfr/orsay/lri/varna/applications/NussinovDemo;1(Lfr/orsay/lri/varna/applications/NussinovDemo;)VCode    ()VLineNumberTableLocalVariableTablethis0Lfr/orsay/lri/varna/applications/NussinovDemo$1;actionPerformed(Ljava/awt/event/ActionEvent;)V ,fr/orsay/lri/varna/applications/NussinovDemo  access$0  onLayoutChangedeLjava/awt/event/ActionEvent; SourceFileNussinovDemo.javaEnclosingMethod %RNAPanelDemoInit InnerClasses0  8 *+ *    K* *  !"#$& PK F>/K;;4fr/orsay/lri/varna/applications/NussinovDemo$2.class1T.fr/orsay/lri/varna/applications/NussinovDemo$2java/lang/Objectjava/awt/event/ActionListenerthis$0.Lfr/orsay/lri/varna/applications/NussinovDemo;1(Lfr/orsay/lri/varna/applications/NussinovDemo;)VCode    ()VLineNumberTableLocalVariableTablethis0Lfr/orsay/lri/varna/applications/NussinovDemo$2;actionPerformed(Ljava/awt/event/ActionEvent;)V!fr/orsay/lri/varna/models/rna/RNA   setRNA'(Ljava/lang/String;Ljava/lang/String;)V !#",fr/orsay/lri/varna/applications/NussinovDemo $%access$1D(Lfr/orsay/lri/varna/applications/NussinovDemo;)Ljavax/swing/JLabel; ')(javax/swing/JLabel *+setText(Ljava/lang/String;)V !- ./access$2O(Lfr/orsay/lri/varna/applications/NussinovDemo;)Lfr/orsay/lri/varna/VARNAPanel; 132fr/orsay/lri/varna/VARNAPanel 4+setTitle 16 78showRNA&(Lfr/orsay/lri/varna/models/rna/RNA;)V !: ;onLayoutChanged =?>9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax @printStackTrace B?CBfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses 1E FrepainteLjava/awt/event/ActionEvent;r#Lfr/orsay/lri/varna/models/rna/RNA;e2;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;DLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses; SourceFileNussinovDemo.javaEnclosingMethod RRNAPanelDemoInit InnerClasses0  8 *+ *    UYM,* &* ,0* ,,5* 9M,<M,A* ,D:==:EB2 (3=>EFJT4UUGH5IJ>KLFKMNOP!QS PK F>!Ջ112fr/orsay/lri/varna/applications/NussinovDemo.class1 ,fr/orsay/lri/varna/applications/NussinovDemojavax/swing/JFrame4fr/orsay/lri/varna/interfaces/InterfaceVARNAListenerserialVersionUIDJ ConstantValue͑g SEQUENCE_ALjava/lang/String; AGGCACGUCU SEQUENCE_B GAGUAGCCUC SEQUENCE_C GCAUAGCUGC SEQUENCE_BIGHAAAACAAAAACACCAUGGUGUUUUCACCCAAUUGGGUGAAAACAGAGAUCUCGAGAUCUCUGUUUUUGUUUUDEFAULT_STRUCTURE .......... _vpMasterLfr/orsay/lri/varna/VARNAPanel;_toolsLjavax/swing/JPanel;_input _seqPanel _structPanel_infoLjavax/swing/JLabel;_struct_seq1Ljavax/swing/JComboBox; _structLabel _seqLabel _goButtonLjavax/swing/JButton; _switchButtonerrorOpt_errorZ_backgroundColorLjava/awt/Color; _algoCodeI()VCode8error : - LineNumberTableLocalVariableTable createStyleC(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;@-fr/orsay/lri/varna/models/rna/ModeleStyleBase ?B C5 ?E FGassignParameters(Ljava/lang/String;)V IKJAfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError L5printStackTrace NKO5fr/orsay/lri/varna/exceptions/ExceptionParameterErrortxtresult/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;eCLfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError;7Lfr/orsay/lri/varna/exceptions/ExceptionParameterError;applyToS(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;[I)V Y[Zfr/orsay/lri/varna/VARNAPanel \]getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; _a`!fr/orsay/lri/varna/models/rna/RNA bc getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; egf(fr/orsay/lri/varna/models/rna/ModeleBase hi setStyleBase2(Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)V ek lmgetElementStructure()I Yo p5repaintthis.Lfr/orsay/lri/varna/applications/NussinovDemo;vpmbindices[Iim*Lfr/orsay/lri/varna/models/rna/ModeleBase; B|javax/swing/JPanel {B      !  "javax/swing/JLabel B  #$ CG  %$javax/swing/JComboBox B  &'Forme Prédite  ($ Sequence ARN  )$javax/swing/JButtonReplier  *+Reset  ,+ java/awt/Color 1white  01  getSeq()Ljava/lang/String; Y C'(Ljava/lang/String;Ljava/lang/String;)V   Y  errorDialog(Ljava/lang/Exception;)Vjava/awt/Dimension C(II)V Y setPreferredSize(Ljava/awt/Dimension;)V  5RNAPanelDemoInit5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;MonoSpaced-BOLD-16  java/awt/Font decode#(Ljava/lang/String;)Ljava/awt/Font; getFont()Ljava/awt/Font;A  deriveFont(F)Ljava/awt/Font; setFont(Ljava/awt/Font;)Vjava/lang/String javax/swing/DefaultComboBoxModel C([Ljava/lang/Object;)V setModel(Ljavax/swing/ComboBoxModel;)V  setEditable(Z)V   setBackground(Ljava/awt/Color;)V Y Y addVARNAListener9(Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;)V setHorizontalTextPosition(I)V .fr/orsay/lri/varna/applications/NussinovDemo$1  C1(Lfr/orsay/lri/varna/applications/NussinovDemo;)V  addActionListener"(Ljava/awt/event/ActionListener;)V .fr/orsay/lri/varna/applications/NussinovDemo$2  java/awt/BorderLayout  B {  setLayout(Ljava/awt/LayoutManager;)VWest { add)(Ljava/awt/Component;Ljava/lang/Object;)VCenterjava/awt/GridLayout  { *(Ljava/awt/Component;)Ljava/awt/Component;!South#East % &'getContentPane()Ljava/awt/Container; )*java/awt/Container ) - . setVisible Y0 12 getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; 465fr/orsay/lri/varna/views/VueUI 75 UIRadiateA Y: ;<setTitleFontSize(F)V Y> ?setTitleFontStyleA5Repliement ARN - Salon Culture et Jeux Mathématiques C DGsetTitle F G5onLayoutChanged marginToolstextFieldsFontLjava/awt/Font; labelsFontseqs[Ljava/lang/String;goPanelVARNAs showSolution [ _S T5 drawRNALineVjava/lang/StringBuilderXNombres de formes : U [ \]count(Ljava/lang/String;)J U_ `aappend(J)Ljava/lang/StringBuilder; Uc dtoString YC g h getStruct j kGsetText Ym nodrawRNA&(Lfr/orsay/lri/varna/models/rna/RNA;)V Yq roshowRNAInterpolated Yt uv getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; _x yzdrawRNARadiate*(Lfr/orsay/lri/varna/models/VARNAConfig;)Vrflat#Lfr/orsay/lri/varna/models/rna/RNA;rfoldedrLinear _B _ setRNA KBfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses K9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntaxrDLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax; UB  getSelectedItem()Ljava/lang/Object; U `-(Ljava/lang/Object;)Ljava/lang/StringBuilder; canBasePair(CC)ZaCb fillMatrix(Ljava/lang/String;)[[I  mlength[[I java/lang/Math max(II)I  charAt(I)C  seqntabjkfact1fact2 backtrack)([[ILjava/lang/String;)Ljava/lang/String;  +([[ILjava/lang/String;II)Ljava/lang/String;. U `-(Ljava/lang/String;)Ljava/lang/StringBuilder;()[[J   toUpperCase    mfeback cleanStruct&(Ljava/lang/String;)Ljava/lang/String;[:-]   replaceAll8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;structgetParameterInfo()[[Ljava/lang/String;M sequenceDBNStringA raw RNA sequence structureDBN.An RNA structure in dot bracket notation (DBN)booleanTo show errorsinfo[[Ljava/lang/String;init  ./ getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color;  $(Ljava/lang/String;)Ljava/awt/Color;  getColorjava/lang/ExceptioncoldefLjava/lang/Exception;e2get_varnaPanel!()Lfr/orsay/lri/varna/VARNAPanel;set_varnaPanel"(Lfr/orsay/lri/varna/VARNAPanel;)Vsurfaceget_info()Ljavax/swing/JLabel;set_info(Ljavax/swing/JLabel;)Vmain([Ljava/lang/String;)V B  setDefaultCloseOperation   5packargsdonWarningEmittedsonLoadpathonLoadedonUINewStructureM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)Vv'Lfr/orsay/lri/varna/models/VARNAConfig;access$0  P5access$1D(Lfr/orsay/lri/varna/applications/NussinovDemo;)Ljavax/swing/JLabel;access$2O(Lfr/orsay/lri/varna/applications/NussinovDemo;)Lfr/orsay/lri/varna/VARNAPanel; SourceFileNussinovDemo.java InnerClasses!             !"#$%$&'($)$*+,+ - ./0123456*79; W6< =>6?YAL+*DM,HM,M+ I N;cefhikm<*P QRSTSUVW6A62+X-.^:,dj+Xj^,d-+n;"rtuv"x2r<{@|<>AqrAsAtRAuv9w3xyC56H*z*{Y}~*{Y}*{Y}*{Y}*Y*Y*Y*Y*Y*Y*Y**YY* L*+*YXX*Ʊ;NJKM%N0O;PHQSR`SmTzU[<qrS56O)≮M*ضN*,YSYSYSYS:*Y*********Y*-*-*Y**Y* * Y *****Y**,* Y *****Y**W**W{Y}: Y *~ Y *~**~* *~"** *$ Y ({Y}:Y*W*$+*$*~ +*,*/3*89*=*@B*E;1 9IQYdlt (8DPYes $(<H)qr%H3 IJKJ9LMYN_OP56m*QL+R*UYWY**Z^be**fi*+l*+p*QM,*sw*,p*QN-R*-p;6  (3;CHS[`dl<*mqrh{|H%}|` ~|\]6&_YL+**fM,M,+; $<*&qr|S S6?UY*b; < qr6:G CC GU AA U;&  (*68< :qr::6 +=N66`d6-2O-2-2.-`2.O`6a*++K6`-`2d.66 d-`2.6 -2-2.` `Od`UF-;V !#%!&)'0)J*S,f.i/r13468*#!><f qr 3 x3w3!3Ph3iE3,3 6L*+,,d;C< qr 6+2.+`2.UYY*+,`b`6*,,t6`+`2d.66d+`2.6+2.``6UYY*+,`d*+,`bv ;FHJL3O;QMSPTXVdXgYp[{]_Odfh<Rqr w3383Pn3gW3\]6 +=N66`d6-2 P~-2\/-`2/aP`6X*++B 7`-`2d/7 7 d-`2/7 -2\/ iaP -2 Pd`ZK-2d/;Zmn oqs!t)u0wCxLz_|b}kx{xqo<f qr 3 x3w3!3I_3b<{# h6 *L+L+=*+N*-+:; <4 qr 3  6D +L+;  < qr  6RYYSYSYSSYYSYSYSSYY9SYSYSSL+;"%18OP<RqrP56C***; < qr6+N:+,N:,- ; <Rqr 1Q1Q1Q1 S6/*;< qr6>*+; <qr6/*;< qr6>*+; <qr#$ 6[YL+++,; < M rG566*n; < qr G65;<qr G65;<qr 56+;< qr6?;< qr|6%*;<6%*;P<6%*;H<PK B>ɧN221fr/orsay/lri/varna/applications/NussinovDemo.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.applications; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurInterpolator; import fr.orsay.lri.varna.exceptions.ExceptionDrawingAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionModeleStyleBaseSyntaxError; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionParameterError; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.exceptions.MappingException; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.Mapping; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleStyleBase; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;; public class NussinovDemo extends JFrame implements InterfaceVARNAListener { /** * */ private static final long serialVersionUID = -790155708306987257L; private static final String SEQUENCE_A = "AGGCACGUCU"; private static final String SEQUENCE_B = "GAGUAGCCUC"; private static final String SEQUENCE_C = "GCAUAGCUGC"; private static final String SEQUENCE_BIG = "AAAACAAAAACACCAUGGUGUUUUCACCCAAUUGGGUGAAAACAGAGAUCUCGAGAUCUCUGUUUUUGUUUU"; private static final String DEFAULT_STRUCTURE = ".........."; // private static final String DEFAULT_STRUCTURE1 = "((((....))))"; // private static final String DEFAULT_STRUCTURE2 = // "((((..(((....)))..))))"; private VARNAPanel _vpMaster; private JPanel _tools = new JPanel(); private JPanel _input = new JPanel(); private JPanel _seqPanel = new JPanel(); private JPanel _structPanel = new JPanel(); private JLabel _info = new JLabel(); private JLabel _struct = new JLabel(DEFAULT_STRUCTURE); private JComboBox _seq1 = new JComboBox(); private JLabel _structLabel = new JLabel("Forme Prdite"); private JLabel _seqLabel = new JLabel("Sequence ARN"); private JButton _goButton = new JButton("Replier"); private JButton _switchButton = new JButton("Reset"); private static String errorOpt = "error"; @SuppressWarnings("unused") private boolean _error; private Color _backgroundColor = Color.white; @SuppressWarnings("unused") private int _algoCode; public static ModeleStyleBase createStyle(String txt) { ModeleStyleBase result = new ModeleStyleBase(); try { result.assignParameters(txt); } catch (ExceptionModeleStyleBaseSyntaxError e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ExceptionParameterError e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } public void applyTo(VARNAPanel vp, ModeleStyleBase mb, int[] indices) { for(int i=0;ii+1) { fact1 = tab[i+1][k-1]; } int fact2 = 0; if (ki+1) { fact1 = tab[i+1][k-1]; } int fact2 = 0; if (ki+1) { fact1 = tab[i+1][k-1]; } long fact2 = 1; if (k_ i5fr/orsay/lri/varna/applications/AlignmentDemo$1.class1?/fr/orsay/lri/varna/applications/AlignmentDemo$1java/lang/Objectjava/awt/event/ActionListenerthis$0/Lfr/orsay/lri/varna/applications/AlignmentDemo;2(Lfr/orsay/lri/varna/applications/AlignmentDemo;)VCode    ()VLineNumberTableLocalVariableTablethis1Lfr/orsay/lri/varna/applications/AlignmentDemo$1;actionPerformed(Ljava/awt/event/ActionEvent;)V -fr/orsay/lri/varna/applications/AlignmentDemo access$0P(Lfr/orsay/lri/varna/applications/AlignmentDemo;)Lfr/orsay/lri/varna/VARNAPanel;   getSeq1()Ljava/lang/String; " #  getStruct1 % & getSeq2 ( )  getStruct2 +-,fr/orsay/lri/varna/VARNAPanel ./ getDrawMode()I +1 23drawRNAL(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V +5 6repainteLjava/awt/event/ActionEvent; SourceFileAlignmentDemo.javaEnclosingMethod =RNAPanelDemoInit InnerClasses0  8 *+ * s   w;* * * !* $* '* *0* 4v0w:x;;789:;<> PK 4F>u F3fr/orsay/lri/varna/applications/AlignmentDemo.class1m-fr/orsay/lri/varna/applications/AlignmentDemojavax/swing/JFrameserialVersionUIDJ ConstantValue͑gDEFAULT_SEQUENCE1Ljava/lang/String; 2CGCGCACGCGA----UAUU----UCGCGUCGCGCAUUUGCGCGUAGCGCGDEFAULT_STRUCTURE12(((((.(((((----....----))))).(((((....)))))..)))))DEFAULT_SEQUENCE22CGCGCACGCGSGCGCGUUUGCGCUCGCGU---------------AGCGCGDEFAULT_STRUCTURE22(((((.(((((((((....))))))))).--------------..))))) _vpMasterLfr/orsay/lri/varna/VARNAPanel;_toolsLjavax/swing/JPanel;_input _seq1Panel _seq2Panel _struct1Panel _struct2Panel_infoLjavax/swing/JLabel;_struct1Ljavax/swing/JTextField;_struct2_seq1_seq2 _struct1Label _struct2Label _seq1Label _seq2Label _goButtonLjavax/swing/JButton; _str1Backup _str2Backup _seq1Backup _seq2Backup_RNA#Lfr/orsay/lri/varna/models/rna/RNA;errorOpt_errorZ_backgroundColorLjava/awt/Color; _algoCodeI()VCode>error @ 3 LineNumberTableLocalVariableTable E C;Gjavax/swing/JPanel FE J  L  N  P  R  T Vjavax/swing/JLabel UE Y ![javax/swing/JTextField Z] C^(Ljava/lang/String;)V ` "# b $# d %# f &#h Str1: U] k '!m Str2: o (!q Seq1: s )!u Seq2: w *!yjavax/swing/JButton{Go x] ~ +,  -  .  /  0 !fr/orsay/lri/varna/models/rna/RNA E  12 java/awt/Color 7white  67fr/orsay/lri/varna/VARNAPanel  getSeq1()Ljava/lang/String;   getStruct1  getSeq2   getStruct2 C^(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V  java/awt/Dimension C(II)V setPreferredSize(Ljava/awt/Dimension;)V  ;RNAPanelDemoInitthis/Lfr/orsay/lri/varna/applications/AlignmentDemo;   setBackground(Ljava/awt/Color;)V MonoSpaced-PLAIN-12  java/awt/Font decode#(Ljava/lang/String;)Ljava/awt/Font;/fr/orsay/lri/varna/applications/AlignmentDemo$1 C2(Lfr/orsay/lri/varna/applications/AlignmentDemo;)V x addActionListener"(Ljava/awt/event/ActionListener;)V U setHorizontalTextPosition(I)V U Z setFont(Ljava/awt/Font;)Vjava/awt/BorderLayout E F  setLayout(Ljava/awt/LayoutManager;)VWest F add)(Ljava/awt/Component;Ljava/lang/Object;)VCenterjava/awt/GridLayout F *(Ljava/awt/Component;)Ljava/awt/Component;SouthEast  getContentPane()Ljava/awt/Container; java/awt/Container   setVisible(Z)V  getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; fr/orsay/lri/varna/views/VueUI ; UIRadiate marginToolstextFieldsFontLjava/awt/Font;goPanelVARNAsgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA;   java/lang/String equals(Ljava/lang/Object;)Z   getDrawMode()I  drawRNAL(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V    Z getText   ! cleanStruct&(Ljava/lang/String;)Ljava/lang/String;structgetParameterInfo()[[Ljava/lang/String;&[Ljava/lang/String;( sequenceDBN*String,A raw RNA sequence. structureDBN0.An RNA structure in dot bracket notation (DBN)2boolean4To show errorsinfo[[Ljava/lang/String;init 9 45 getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; = >$(Ljava/lang/String;)Ljava/awt/Color; @ A;getColorCjava/lang/ExceptioncoldefresulteLjava/lang/Exception;e2get_varnaPanel!()Lfr/orsay/lri/varna/VARNAPanel;set_varnaPanel"(Lfr/orsay/lri/varna/VARNAPanel;)Vsurface get_struct()Ljavax/swing/JTextField; set_struct(Ljavax/swing/JTextField;)V_structget_seqset_seq_seqget_info()Ljavax/swing/JLabel;set_info(Ljavax/swing/JLabel;)Vmain([Ljava/lang/String;)V E _ `setDefaultCloseOperation b c;packargsdonWarningEmittedsaccess$0P(Lfr/orsay/lri/varna/applications/AlignmentDemo;)Lfr/orsay/lri/varna/VARNAPanel; SourceFileAlignmentDemo.java InnerClasses!      !"#$#%#&#'!(!)!*!+,- . / 0 12 3 456789:;<*=?A Y/BC;< '*D*FYHI*FYHK*FYHM*FYHO*FYHQ*FYHS*UYWX*ZY\_*ZY\a*ZY \c*ZY\e*UYgij*UYlin*UYpir*UYtiv*xYz|}*****Y**Y*****YX*AndABD%E0F;GFHQI^JkKxLMNOPQSTUVW]ef"g&hB ';<K5(<****M*}Y*ƶ*r*rY*c,*MYض*M*rݶ*M*c*v*vY*e,*OYض*O*vݶ*O*e*jY*j*_,*QYض*Q*jݶ*Q*_*nY*n*a,*SYض*S*nݶ*S*a*KY*K*MW*K*QW*K*OW*K*SWFYHN-Yض*IYض*I*K*I*X*I--*}*YضFYH:Y*W***I**A2km nps+|3}D~LZgt|'5BO_kw %*4B4529@  <** -** ** ** L*****************A. *8VaiqyB <6 **_AB  <6 **aAB  <6 **cAB  <6 **eAB   !<6+AB" #$<R%Y Y'SY)SY+SSY Y-SY)SY/SSY Y?SY1SY3SSL+A"%18OPBRP567;<C***8A B :;<+*+A BNOP</*_AB QR<>*+_A  BS#TP</*cA B UR<>*+cA BV#WX</*XAB YZ<>*+XA B ! [\<[Y]L+^+a+A  Bd&ef^<5A%Bg hi<%*A?Bjkl PK ;m="##2fr/orsay/lri/varna/applications/AlignmentDemo.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.applications; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurInterpolator; import fr.orsay.lri.varna.exceptions.ExceptionDrawingAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.exceptions.MappingException; import fr.orsay.lri.varna.models.rna.Mapping; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;; public class AlignmentDemo extends JFrame{ /** * */ private static final long serialVersionUID = -790155708306987257L; private static final String DEFAULT_SEQUENCE1 = "CGCGCACGCGA----UAUU----UCGCGUCGCGCAUUUGCGCGUAGCGCG"; private static final String DEFAULT_STRUCTURE1 = "(((((.(((((----....----))))).(((((....)))))..)))))"; private static final String DEFAULT_SEQUENCE2 = "CGCGCACGCGSGCGCGUUUGCGCUCGCGU---------------AGCGCG"; private static final String DEFAULT_STRUCTURE2 = "(((((.(((((((((....))))))))).--------------..)))))"; // private static final String DEFAULT_STRUCTURE1 = "((((....))))"; // private static final String DEFAULT_STRUCTURE2 = // "((((..(((....)))..))))"; private VARNAPanel _vpMaster; private JPanel _tools = new JPanel(); private JPanel _input = new JPanel(); private JPanel _seq1Panel = new JPanel(); private JPanel _seq2Panel = new JPanel(); private JPanel _struct1Panel = new JPanel(); private JPanel _struct2Panel = new JPanel(); private JLabel _info = new JLabel(); private JTextField _struct1 = new JTextField(DEFAULT_STRUCTURE1); private JTextField _struct2 = new JTextField(DEFAULT_STRUCTURE2); private JTextField _seq1 = new JTextField(DEFAULT_SEQUENCE1); private JTextField _seq2 = new JTextField(DEFAULT_SEQUENCE2); private JLabel _struct1Label = new JLabel(" Str1:"); private JLabel _struct2Label = new JLabel(" Str2:"); private JLabel _seq1Label = new JLabel(" Seq1:"); private JLabel _seq2Label = new JLabel(" Seq2:"); private JButton _goButton = new JButton("Go"); private String _str1Backup = ""; private String _str2Backup = ""; private String _seq1Backup = ""; private String _seq2Backup = ""; private RNA _RNA = new RNA(); private static String errorOpt = "error"; @SuppressWarnings("unused") private boolean _error; private Color _backgroundColor = Color.white; @SuppressWarnings("unused") private int _algoCode; public AlignmentDemo() { super(); _vpMaster = new VARNAPanel(getSeq1(), getStruct1(), getSeq2(), getStruct2(), RNA.DRAW_MODE_RADIATE,""); _vpMaster.setPreferredSize(new Dimension(600, 400)); RNAPanelDemoInit(); } private void RNAPanelDemoInit() { int marginTools = 40; setBackground(_backgroundColor); _vpMaster.setBackground(_backgroundColor); Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12"); _goButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { _vpMaster.drawRNA(getSeq1(), getStruct1(), getSeq2(), getStruct2(), _vpMaster.getDrawMode()); _vpMaster.repaint(); } }); _seq1Label.setHorizontalTextPosition(JLabel.LEFT); _seq1Label.setPreferredSize(new Dimension(marginTools, 15)); _seq1.setFont(textFieldsFont); _seq1Panel.setLayout(new BorderLayout()); _seq1Panel.add(_seq1Label, BorderLayout.WEST); _seq1Panel.add(_seq1, BorderLayout.CENTER); _seq2Label.setHorizontalTextPosition(JLabel.LEFT); _seq2Label.setPreferredSize(new Dimension(marginTools, 15)); _seq2.setFont(textFieldsFont); _seq2Panel.setLayout(new BorderLayout()); _seq2Panel.add(_seq2Label, BorderLayout.WEST); _seq2Panel.add(_seq2, BorderLayout.CENTER); _struct1Label.setPreferredSize(new Dimension(marginTools, 15)); _struct1Label.setHorizontalTextPosition(JLabel.LEFT); _struct1.setFont(textFieldsFont); _struct1Panel.setLayout(new BorderLayout()); _struct1Panel.add(_struct1Label, BorderLayout.WEST); _struct1Panel.add(_struct1, BorderLayout.CENTER); _struct2Label.setPreferredSize(new Dimension(marginTools, 15)); _struct2Label.setHorizontalTextPosition(JLabel.LEFT); _struct2.setFont(textFieldsFont); _struct2Panel.setLayout(new BorderLayout()); _struct2Panel.add(_struct2Label, BorderLayout.WEST); _struct2Panel.add(_struct2, BorderLayout.CENTER); _input.setLayout(new GridLayout(4, 0)); _input.add(_seq1Panel); _input.add(_struct1Panel); _input.add(_seq2Panel); _input.add(_struct2Panel); JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout()); _tools.setLayout(new BorderLayout()); _tools.add(_input, BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH); _tools.add(goPanel, BorderLayout.EAST); goPanel.add(_goButton, BorderLayout.CENTER); getContentPane().setLayout(new BorderLayout()); JPanel VARNAs = new JPanel(); VARNAs.setLayout(new GridLayout(1,1)); VARNAs.add(_vpMaster); getContentPane().add(VARNAs, BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.SOUTH); setVisible(true); _vpMaster.getVARNAUI().UIRadiate(); } public RNA getRNA() { if (!( _str1Backup.equals(getStruct1()) && _str2Backup.equals(getStruct2()) && _seq1Backup.equals(getSeq1()) && _seq2Backup.equals(getSeq2()) )) { _vpMaster.drawRNA(getSeq1(), getStruct1(), getSeq2(), getStruct2(), _vpMaster.getDrawMode()); _RNA = _vpMaster.getRNA(); _str1Backup = getStruct1(); _str2Backup = getStruct2(); _seq1Backup = getSeq1(); _seq2Backup = getSeq2(); } return _RNA; } public String getStruct1() { return cleanStruct(_struct1.getText()); } public String getStruct2() { return cleanStruct(_struct2.getText()); } public String getSeq1() { return cleanStruct(_seq1.getText()); } public String getSeq2() { return cleanStruct(_seq2.getText()); } private String cleanStruct(String struct) { //struct = struct.replaceAll("[:-]", ""); return struct; } public String[][] getParameterInfo() { String[][] info = { // Parameter Name Kind of Value Description, { "sequenceDBN", "String", "A raw RNA sequence" }, { "structureDBN", "String", "An RNA structure in dot bracket notation (DBN)" }, { errorOpt, "boolean", "To show errors" }, }; return info; } public void init() { _vpMaster.setBackground(_backgroundColor); _error = true; } @SuppressWarnings("unused") private Color getSafeColor(String col, Color def) { Color result; try { result = Color.decode(col); } catch (Exception e) { try { result = Color.getColor(col, def); } catch (Exception e2) { return def; } } return result; } public VARNAPanel get_varnaPanel() { return _vpMaster; } public void set_varnaPanel(VARNAPanel surface) { _vpMaster = surface; } public JTextField get_struct() { return _struct1; } public void set_struct(JTextField _struct) { this._struct1 = _struct; } public JTextField get_seq() { return _seq1; } public void set_seq(JTextField _seq) { this._seq1 = _seq; } public JLabel get_info() { return _info; } public void set_info(JLabel _info) { this._info = _info; } public static void main(String[] args) { AlignmentDemo d = new AlignmentDemo(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); d.pack(); d.setVisible(true); } public void onWarningEmitted(String s) { // TODO Auto-generated method stub } } PK 4F>$_ _ =fr/orsay/lri/varna/applications/FileNameExtensionFilter.class1u7fr/orsay/lri/varna/applications/FileNameExtensionFilter"javax/swing/filechooser/FileFilter_extsLjava/util/Hashtable; Signature;_descLjava/lang/String;'(Ljava/lang/String;Ljava/lang/String;)VCode  ()Vjava/util/Hashtable     java/lang/Integer valueOf(I)Ljava/lang/Integer; ! "#put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;LineNumberTableLocalVariableTablethis9Lfr/orsay/lri/varna/applications/FileNameExtensionFilter;descext19(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V , ext2K(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V 0 *ext3](Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V 4 .ext4accept(Ljava/io/File;)Z 9;: java/io/File <=getName()Ljava/lang/String; 9? @A isDirectory()ZC. EGFjava/lang/String HI lastIndexOf(Ljava/lang/String;)I EK LM substring(I)Ljava/lang/String; O PQ containsKey(Ljava/lang/Object;)ZpathLjava/io/File;nameindexIsuffixgetDescription getExtensions()[Ljava/lang/String; \ ]^size()I ` abkeys()Ljava/util/Enumeration; dfejava/util/Enumeration gh nextElement()Ljava/lang/Object; dj kAhasMoreElementsexts[Ljava/lang/String;kLjava/util/Enumeration;nLocalVariableTypeTable+Ljava/util/Enumeration; SourceFileFileNameExtensionFilter.java!   z(**Y**+*, W$  '% (&'(( ()  * d*+,+*- W$%*&'( ) -  . p*+,-/* W$%4&'( ) - 1  2 |*+,-3* W$" #$%>&'( ) - 1 5 67 3+8M+>,BD>,`J:*N$& () *+,.#//012%43&'3RS.T UV#W X= /*$7% &'YZ 2*[EL*_M>+,cES,i+$"< =>?A$B'?0D%*2&' 'lmnopVq nrstPK pq _exts = new Hashtable(); String _desc = ""; public FileNameExtensionFilter(String desc,String ext1) { _desc = desc; _exts.put(ext1,0); } public FileNameExtensionFilter(String desc,String ext1,String ext2) { this(desc,ext1); _exts.put(ext2,1); } public FileNameExtensionFilter(String desc,String ext1,String ext2,String ext3) { this(desc,ext1,ext2); _exts.put(ext3,2); } public FileNameExtensionFilter(String desc,String ext1,String ext2,String ext3,String ext4) { this(desc,ext1,ext2,ext3); _exts.put(ext4,3); } public boolean accept(File path) { String name = path.getName(); if (path.isDirectory()) return true; int index = name.lastIndexOf("."); if (index != -1) { String suffix = name.substring(index+1); if (_exts.containsKey(suffix)) {return true;} } return false; } @Override public String getDescription() { return _desc; } public String[] getExtensions() { String[] exts = new String[_exts.size()]; Enumeration k = _exts.keys(); int n = 0; while(k.hasMoreElements()) { exts[n] = k.nextElement(); n++; } return exts; } } PK 4F> D%%6fr/orsay/lri/varna/applications/VARNAConsoleDemo.class1m0fr/orsay/lri/varna/applications/VARNAConsoleDemojavax/swing/JAppletjava/awt/event/ActionListenerserialVersionUIDJ ConstantValue͑gDEFAULT_SEQUENCELjava/lang/String;iCAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIADEFAULT_STRUCTUREi..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...))))).._vpLfr/orsay/lri/varna/VARNAPanel;_toolsLjavax/swing/JPanel;_input _seqPanel _structPanel_infoLjavax/swing/JLabel;_goLjavax/swing/JButton;_structLjavax/swing/JTextField;_seq _structLabel _seqLabel_console,Lfr/orsay/lri/varna/components/VARNAConsole;errorOpt_errorZ_backgroundColorLjava/awt/Color; _algoCodeI()VCode0error 2 % LineNumberTableLocalVariableTable 7 5-9javax/swing/JPanel 87 <  >  @  B Djavax/swing/JLabel C7 G Ijavax/swing/JButtonKGo HM 5N(Ljava/lang/String;)V P Rjavax/swing/JTextField Q7 U  W Y Str: CM \ !^ Seq: ` " bdcjava/awt/Color e)white g ()ifr/orsay/lri/varna/VARNAPanel Qk lmgetText()Ljava/lang/String; ho 5p'(Ljava/lang/String;Ljava/lang/String;)V r  ht uv setErrorsOn(Z)V hx yz errorDialog(Ljava/lang/Exception;)V | }-RNAPanelDemoInit5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengththis2Lfr/orsay/lri/varna/applications/VARNAConsoleDemo;e7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;   setBackground(Ljava/awt/Color;)V h h getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !fr/orsay/lri/varna/models/rna/RNA psetRNAMonoSpaced-PLAIN-12  java/awt/Font decode#(Ljava/lang/String;)Ljava/awt/Font;*fr/orsay/lri/varna/components/VARNAConsole 5"(Lfr/orsay/lri/varna/VARNAPanel;)V  #$ H addActionListener"(Ljava/awt/event/ActionListener;)V C setHorizontalTextPosition(I)Vjava/awt/Dimension 5(II)V C setPreferredSize(Ljava/awt/Dimension;)V Q setFont(Ljava/awt/Font;)V mgetSeq Q NsetTextjava/awt/BorderLayout 7 8  setLayout(Ljava/awt/LayoutManager;)VWest 8 add)(Ljava/awt/Component;Ljava/lang/Object;)VCenter m getStructDBNjava/awt/GridLayout 8 *(Ljava/awt/Component;)Ljava/awt/Component;SouthEast  getContentPane()Ljava/awt/Container; java/awt/Container h  getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; fr/orsay/lri/varna/views/VueUI - UIRadiate   v setVisible java/lang/Exception marginToolse1Ljava/lang/Exception;textFieldsFontLjava/awt/Font;getParameterInfo()[[Ljava/lang/String;[Ljava/lang/String;java/lang/String sequenceDBNStringA raw RNA sequence structureDBN.An RNA structure in dot bracket notation (DBN)booleanTo show errorsinfo[[Ljava/lang/String;init  -retrieveParametersValues  &' getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; b $(Ljava/lang/String;)Ljava/awt/Color; b getColorcoldefresulte2getParameterValue8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;  !" getParameter&(Ljava/lang/String;)Ljava/lang/String;keytmp&false (  *,+java/lang/Boolean -. parseBoolean(Ljava/lang/String;)Z0 background b2 3mtoString 5 79 algorithm;radiate=circular ? @Aequals(Ljava/lang/Object;)Z C *+EnaviewGline hI JKdrawRNA((Ljava/lang/String;Ljava/lang/String;I)V ~M N-printStackTrace_algoget_varnaPanel!()Lfr/orsay/lri/varna/VARNAPanel;set_varnaPanelsurface get_struct()Ljavax/swing/JTextField; set_struct(Ljavax/swing/JTextField;)Vget_seqset_seqget_info()Ljavax/swing/JLabel;set_info(Ljavax/swing/JLabel;)VactionPerformed(Ljava/awt/event/ActionEvent;)V 7 hb cpdrawRNAInterpolated he f-repaintarg0Ljava/awt/event/ActionEvent;r#Lfr/orsay/lri/varna/models/rna/RNA; SourceFileVARNAConsoleDemo.java!       !"#$ % &'()*+,-.*/13 K045-.1*6*8Y:;*8Y:=*8Y:?*8Y:A*CYEF*HYJLO*QYST*QYSV*CYXZ[*CY]Z_*af*hY*Vj*Tjnq*qs L*q+w*{~3JS=>@%A0B;CHDSE^FkGxNUVWXZ[4}-.(<**f*q*f*q*Vj*Tj*qs M*q,wM*Y*q*O**_*_Y*V,*V*q*?Y*?*_ö*?*Vɶ*[Y*[*T,*T*q˶*AY*A*[ö*A*Tɶ*=Yж*=*?W*=*AW*;Y*;*=ɶ*;*FԶ*;*Oֶ*ػY**qɶ**;Զ*q*Y**693'`b cf.g9h:iBlHnWq_sgtxuvxyz|}~#/;IVcp~4*+:Hy.NYYSYSYSSYYSYSYSSYY1SYSYSSL+3""-4KL4NL   -.K* *q*f*34 .+N:+,N:,- 3 4R )))) .b*+N-,-3 4*#  $ -.**1%')*q*s***/*f1'*f4f*q*f*V*6'*T*6'*8:'L+<> *B,+D> *B+F> *B*B*Vj6>%*Tj6>*V*T*q*Vj*Tj*BHM,L~3^"36AQbmw4 mO PQ./*q34 R.>*+q3 4STU./*T34 VW.>*+T3 4XU./*V34 YW.>*+V3 4 Z[./*F34 \].>*+F3 4^_.-Y`M*q*Vj*TjaN-L*qd ~3 !%, 4*--gh%ij!klPK pq. */ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.components.VARNAConsole; import fr.orsay.lri.varna.controlers.ControleurDemoTextField; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.models.rna.RNA; /** * An RNA 2d Panel demo applet * * @author Yann Ponty & Darty Kévin * */ public class VARNAConsoleDemo extends JApplet implements ActionListener { /** * */ private static final long serialVersionUID = -790155708306987257L; private static final String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA"; private static final String DEFAULT_STRUCTURE = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...))))).."; private VARNAPanel _vp; private JPanel _tools = new JPanel(); private JPanel _input = new JPanel(); private JPanel _seqPanel = new JPanel(); private JPanel _structPanel = new JPanel(); private JLabel _info = new JLabel(); private JButton _go = new JButton("Go"); private JTextField _struct = new JTextField(); private JTextField _seq = new JTextField(); private JLabel _structLabel = new JLabel(" Str:"); private JLabel _seqLabel = new JLabel(" Seq:"); private VARNAConsole _console; private static String errorOpt = "error"; private boolean _error; private Color _backgroundColor = Color.white; private int _algoCode; public VARNAConsoleDemo() { super(); try { _vp = new VARNAPanel(_seq.getText(), _struct.getText()); _vp.setErrorsOn(false); } catch (ExceptionNonEqualLength e) { _vp.errorDialog(e); } RNAPanelDemoInit(); } private void RNAPanelDemoInit() { int marginTools = 40; setBackground(_backgroundColor); _vp.setBackground(_backgroundColor); try { _vp.getRNA().setRNA(_seq.getText(), _struct.getText()); _vp.setErrorsOn(false); } catch (Exception e1) { _vp.errorDialog(e1); } Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12"); _console = new VARNAConsole(_vp); _go.addActionListener(this); _seqLabel.setHorizontalTextPosition(JLabel.LEFT); _seqLabel.setPreferredSize(new Dimension(marginTools, 15)); _seq.setFont(textFieldsFont); _seq.setText(_vp.getRNA().getSeq()); _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel, BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER); _structLabel.setPreferredSize(new Dimension(marginTools, 15)); _structLabel.setHorizontalTextPosition(JLabel.LEFT); _struct.setFont(textFieldsFont); _struct.setText(_vp.getRNA().getStructDBN()); _structPanel.setLayout(new BorderLayout()); _structPanel.add(_structLabel, BorderLayout.WEST); _structPanel.add(_struct, BorderLayout.CENTER); _input.setLayout(new GridLayout(3, 0)); _input.add(_seqPanel); _input.add(_structPanel); _tools.setLayout(new BorderLayout()); _tools.add(_input, BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH); _tools.add(_go, BorderLayout.EAST); getContentPane().setLayout(new BorderLayout()); getContentPane().add(_vp, BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.SOUTH); _vp.getVARNAUI().UIRadiate(); setPreferredSize(new Dimension(400,400)); setVisible(true); _console.setVisible(true); } public String[][] getParameterInfo() { String[][] info = { // Parameter Name Kind of Value Description, { "sequenceDBN", "String", "A raw RNA sequence" }, { "structureDBN", "String", "An RNA structure in dot bracket notation (DBN)" }, { errorOpt, "boolean", "To show errors" }, }; return info; } public void init() { retrieveParametersValues(); _vp.setBackground(_backgroundColor); _error = true; } private Color getSafeColor(String col, Color def) { Color result; try { result = Color.decode(col); } catch (Exception e) { try { result = Color.getColor(col, def); } catch (Exception e2) { return def; } } return result; } private String getParameterValue(String key, String def) { String tmp; tmp = getParameter(key); if (tmp == null) { return def; } else { return tmp; } } private void retrieveParametersValues() { _error = Boolean.parseBoolean(getParameterValue(errorOpt, "false")); _vp.setErrorsOn(_error); _backgroundColor = getSafeColor(getParameterValue("background", _backgroundColor.toString()), _backgroundColor); _vp.setBackground(_backgroundColor); _seq.setText(getParameterValue("sequenceDBN", "")); _struct.setText(getParameterValue("structureDBN", "")); String _algo = getParameterValue("algorithm", "radiate"); if (_algo.equals("circular")) _algoCode = RNA.DRAW_MODE_CIRCULAR; else if (_algo.equals("naview")) _algoCode = RNA.DRAW_MODE_NAVIEW; else if (_algo.equals("line")) _algoCode = RNA.DRAW_MODE_LINEAR; else _algoCode = RNA.DRAW_MODE_RADIATE; if (_seq.getText().equals("") && _struct.getText().equals("")) { _seq.setText(DEFAULT_SEQUENCE); _struct.setText(DEFAULT_STRUCTURE); } try { _vp.drawRNA(_seq.getText(), _struct.getText(), _algoCode); } catch (ExceptionNonEqualLength e) { e.printStackTrace(); } } public VARNAPanel get_varnaPanel() { return _vp; } public void set_varnaPanel(VARNAPanel surface) { _vp = surface; } public JTextField get_struct() { return _struct; } public void set_struct(JTextField _struct) { this._struct = _struct; } public JTextField get_seq() { return _seq; } public void set_seq(JTextField _seq) { this._seq = _seq; } public JLabel get_info() { return _info; } public void set_info(JLabel _info) { this._info = _info; } public void actionPerformed(ActionEvent arg0) { RNA r = new RNA(); try { _vp.drawRNAInterpolated(_seq.getText(), _struct.getText()); } catch (ExceptionNonEqualLength e) { // TODO Auto-generated catch block e.printStackTrace(); } _vp.repaint(); } } PK 4F> *  0fr/orsay/lri/varna/applications/VARNAGUI$1.class1p*fr/orsay/lri/varna/applications/VARNAGUI$1java/lang/Object'javax/swing/event/ListSelectionListenerthis$0*Lfr/orsay/lri/varna/applications/VARNAGUI;-(Lfr/orsay/lri/varna/applications/VARNAGUI;)VCode    ()VLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/applications/VARNAGUI$1; valueChanged)(Ljavax/swing/event/ListSelectionEvent;)V (fr/orsay/lri/varna/applications/VARNAGUI access$1\(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/components/ReorderableJList;  .fr/orsay/lri/varna/components/ReorderableJList !"isSelectionEmpty()Z $&%$javax/swing/event/ListSelectionEvent '"getValueIsAdjusting ) *+getSelectedValue()Ljava/lang/Object;-$fr/orsay/lri/varna/models/FullBackup / 01access$0K(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/VARNAPanel; 354fr/orsay/lri/varna/VARNAPanel 67getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; 9;:!fr/orsay/lri/varna/models/rna/RNA <=getSize()I ,? @Arna#Lfr/orsay/lri/varna/models/rna/RNA; CED%fr/orsay/lri/varna/models/rna/Mapping FGDefaultOutermostMapping+(II)Lfr/orsay/lri/varna/models/rna/Mapping; ,I JKconfig'Lfr/orsay/lri/varna/models/VARNAConfig; 3M NOshowRNAInterpolatedt(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/Mapping;)V Q RSaccess$2D(Lfr/orsay/lri/varna/applications/VARNAGUI;)Ljavax/swing/JTextField; 9U VWgetSeq()Ljava/lang/String; Y[Zjavax/swing/JTextField \]setText(Ljava/lang/String;)V _ `Saccess$3 9b cW getStructDBNarg0&Ljavax/swing/event/ListSelectionEvent;sel&Lfr/orsay/lri/varna/models/FullBackup;map'Lfr/orsay/lri/varna/models/rna/Mapping; SourceFile VARNAGUI.javaEnclosingMethod nRNAPanelDemoInit InnerClasses0  8 *+ *    p* e+#^* (,M* .28,>8BN* .,>,H-L* P,>TX* ^,>aX":M^o*ppde"Mfg:5hijklmo PK 4F>? ]e e 0fr/orsay/lri/varna/applications/VARNAGUI$2.class1k*fr/orsay/lri/varna/applications/VARNAGUI$2java/lang/Objectjava/awt/event/ActionListenerthis$0*Lfr/orsay/lri/varna/applications/VARNAGUI;-(Lfr/orsay/lri/varna/applications/VARNAGUI;)VCode    ()VLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/applications/VARNAGUI$2;actionPerformed(Ljava/awt/event/ActionEvent;)V!fr/orsay/lri/varna/models/rna/RNA (fr/orsay/lri/varna/applications/VARNAGUI generateDefaultName()Ljava/lang/String;  !(Ljava/lang/String;)V # $%access$2D(Lfr/orsay/lri/varna/applications/VARNAGUI;)Ljavax/swing/JTextField; ')(javax/swing/JTextField *getText , -%access$3 / 01setRNA'(Ljava/lang/String;Ljava/lang/String;)V 3 45access$0K(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/VARNAPanel; 798fr/orsay/lri/varna/VARNAPanel :; getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; = >?drawRNARadiate*(Lfr/orsay/lri/varna/models/VARNAConfig;)V A BCaccess$4c(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/applications/VARNAGUI$BackupHolder;E%fr/orsay/lri/varna/models/VARNAConfig D HJI5fr/orsay/lri/varna/applications/VARNAGUI$BackupHolder KLaddN(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Z)V NPOBfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses Q getMessageSError UWVjavax/swing/JOptionPane XYshowMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V [P\9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntaxeLjava/awt/event/ActionEvent;nRNA#Lfr/orsay/lri/varna/models/rna/RNA;e1DLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax; SourceFile VARNAGUI.javaEnclosingMethod hRNAPanelDemoInit InnerClasses BackupHolder0  8 *+ *    oYM,* "&* +&.,* 26<* @DYF,G*M* 2,MRTM* 2,ZRTDGND\[& #1GH\]n4oo]^ <_`Hab]acdefgiHjPK 4F>@q0fr/orsay/lri/varna/applications/VARNAGUI$3.class1+*fr/orsay/lri/varna/applications/VARNAGUI$3java/lang/Objectjava/awt/event/ActionListenerthis$0*Lfr/orsay/lri/varna/applications/VARNAGUI;-(Lfr/orsay/lri/varna/applications/VARNAGUI;)VCode    ()VLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/applications/VARNAGUI$3;actionPerformed(Ljava/awt/event/ActionEvent;)V (fr/orsay/lri/varna/applications/VARNAGUI access$4c(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/applications/VARNAGUI$BackupHolder;  5fr/orsay/lri/varna/applications/VARNAGUI$BackupHolder !removeSelectedeLjava/awt/event/ActionEvent; SourceFile VARNAGUI.javaEnclosingMethod (RNAPanelDemoInit InnerClasses BackupHolder0  8 *+ *    C *     "#$%&')*PK 4F>*]0fr/orsay/lri/varna/applications/VARNAGUI$4.class1h*fr/orsay/lri/varna/applications/VARNAGUI$4java/lang/Objectjava/awt/event/ActionListenerthis$0*Lfr/orsay/lri/varna/applications/VARNAGUI;-(Lfr/orsay/lri/varna/applications/VARNAGUI;)VCode    ()VLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/applications/VARNAGUI$4;actionPerformed(Ljava/awt/event/ActionEvent;)V (fr/orsay/lri/varna/applications/VARNAGUI access$4c(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/applications/VARNAGUI$BackupHolder;   access$0K(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/VARNAPanel; "$#fr/orsay/lri/varna/VARNAPanel %& getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; (*)%fr/orsay/lri/varna/models/VARNAConfig +&clone "- ./getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; 132!fr/orsay/lri/varna/models/rna/RNA +/5java/lang/StringBuilder 17 89getName()Ljava/lang/String; ;=<java/lang/String >?valueOf&(Ljava/lang/Object;)Ljava/lang/String; 4A B(Ljava/lang/String;)VD- 4F GHappend-(Ljava/lang/String;)Ljava/lang/StringBuilder; JLKjava/text/DateFormat MNgetTimeInstance(I)Ljava/text/DateFormat;Pjava/util/Date O JS TUformat$(Ljava/util/Date;)Ljava/lang/String; 4W X9toString Z\[5fr/orsay/lri/varna/applications/VARNAGUI$BackupHolder ]^add`(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Ljava/lang/String;Z)VeLjava/awt/event/ActionEvent; SourceFile VARNAGUI.javaEnclosingMethod eRNAPanelDemoInit InnerClasses BackupHolder0  8 *+ *    V* * !'* ,04Y* ,6:@CEIOYQREVY UVV_`abcdfZgPK 4F>dF;fr/orsay/lri/varna/applications/VARNAGUI$BackupHolder.class15fr/orsay/lri/varna/applications/VARNAGUI$BackupHolderjava/lang/Object_rnaListLjavax/swing/DefaultListModel;_rnasLjava/util/ArrayList; Signature:Ljava/util/ArrayList;_lLjavax/swing/JList;this$0*Lfr/orsay/lri/varna/applications/VARNAGUI;^(Lfr/orsay/lri/varna/applications/VARNAGUI;Ljavax/swing/DefaultListModel;Ljavax/swing/JList;)VCode    ()Vjava/util/ArrayList       LineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/applications/VARNAGUI$BackupHolder;rnaListladdM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)V )+*!fr/orsay/lri/varna/models/rna/RNA ,-getName()Ljava/lang/String; / &0`(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Ljava/lang/String;Z)Vc'Lfr/orsay/lri/varna/models/VARNAConfig;r#Lfr/orsay/lri/varna/models/rna/RNA;N(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Z)VselectZ_(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Ljava/lang/String;)VnameLjava/lang/String; <>=javax/swing/DefaultListModel ?@size()I BDCjavax/swing/JList EFremoveSelectionInterval(II)VH JLKjava/lang/String MNequals(Ljava/lang/Object;)Z PRQ(fr/orsay/lri/varna/applications/VARNAGUI S-generateDefaultNameU$fr/orsay/lri/varna/models/FullBackup TW 8 Y &Z(ILjava/lang/Object;)V <Y B] ^_setSelectedIndex(I)Vbck&Lfr/orsay/lri/varna/models/FullBackup;remove d be(I)Ljava/lang/Object; <diIgetModel ()Ljavax/swing/DefaultListModel;contains&(Lfr/orsay/lri/varna/models/rna/RNA;)Z n kN getElementAt)(I)Lfr/orsay/lri/varna/models/FullBackup; <r oeremoveSelected Bu v@getSelectedIndex <x y@getSize )| ~. ) setRNA'(Ljava/lang/String;Ljava/lang/String;)V P access$0K(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/VARNAPanel; fr/orsay/lri/varna/VARNAPanel showRNA&(Lfr/orsay/lri/varna/models/rna/RNA;)V repaint B setSelectedValue(Ljava/lang/Object;Z)VBfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntaxnewi SourceFile VARNAGUI.java InnerClasses BackupHolder     m*+**Y*,*-  ! "#$% &'N *+,,(.  !  "# 12 34&5X *+,,(.  !* "# 12 34 67&8U *+,-. !* "# 12 34 9:&0N**;A-GIONTY+,-V:*,X*[ *\ * !-6@EM!>N"#N12N34N9:N67-!`ab_O*cW*fW  !"#ghij/* ! "#kl= *+m ! "# 34op@ *qT ! "# ghs*t<u*w3)YzM,{}NN*,*1`=*w *wd=*qTN*-*fW (+ (/ B  +/0;HLWamv!4"#xgh (34L*hm `a PPK 4F>Vl99.fr/orsay/lri/varna/applications/VARNAGUI.class1(fr/orsay/lri/varna/applications/VARNAGUIjavax/swing/JFramejava/awt/dnd/DropTargetListener4fr/orsay/lri/varna/interfaces/InterfaceVARNAListener java/awt/event/MouseListenerserialVersionUIDJ ConstantValue͑gDEFAULT_SEQUENCELjava/lang/String;iCAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIADEFAULT_STRUCTURE1i..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..DEFAULT_STRUCTURE2i..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...))))).._vpLfr/orsay/lri/varna/VARNAPanel;_toolsLjavax/swing/JPanel;_input _seqPanel _strPanel_infoLjavax/swing/JLabel;_strLjavax/swing/JTextField;_seq _strLabel _seqLabel _createButtonLjavax/swing/JButton; _deleteButton_duplicateButton _listPanel _sideList0Lfr/orsay/lri/varna/components/ReorderableJList;errorOpt_errorZ_backgroundColorLjava/awt/Color;_nextIDI _algoCode_rnaList7Lfr/orsay/lri/varna/applications/VARNAGUI$BackupHolder;()VCode=error ? / A 45LineNumberTableLocalVariableTableF VARNA GUI H DI(Ljava/lang/String;)VKjavax/swing/JPanel JM D: O  Q  S  U Wjavax/swing/JLabel VM Z !"\javax/swing/JTextField [H _ #$ a %$c Str: VH f &"h Seq: j '"ljavax/swing/JButtonnCreate kH q ()sDelete u *)wSnapshot y +) { , } -. java/awt/Color 3white  23  :RNAPanelDemoInitthis*Lfr/orsay/lri/varna/applications/VARNAGUI;javax/swing/DefaultListModel M%javax/swing/DefaultListSelectionModel M setSelectionMode(I)V  setLeadAnchorNotificationEnabled(Z)V.fr/orsay/lri/varna/components/ReorderableJList M setModel(Ljavax/swing/ListModel;)V addMouseListener!(Ljava/awt/event/MouseListener;)V setSelectionModel#(Ljavax/swing/ListSelectionModel;)Vjava/awt/Dimension D(II)V setPreferredSize(Ljava/awt/Dimension;)V*fr/orsay/lri/varna/applications/VARNAGUI$1 D-(Lfr/orsay/lri/varna/applications/VARNAGUI;)V addListSelectionListener,(Ljavax/swing/event/ListSelectionListener;)V5fr/orsay/lri/varna/applications/VARNAGUI$BackupHolder D^(Lfr/orsay/lri/varna/applications/VARNAGUI;Ljavax/swing/DefaultListModel;Ljavax/swing/JList;)V  78!fr/orsay/lri/varna/models/rna/RNAUser defined 1 HUser defined 2fr/orsay/lri/varna/VARNAPanel0. D'(Ljava/lang/String;Ljava/lang/String;)V   setRNA  getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; drawRNARadiate*(Lfr/orsay/lri/varna/models/VARNAConfig;)V  errorDialog(Ljava/lang/Exception;)V Bfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses :printStackTrace 9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax %fr/orsay/lri/varna/models/VARNAConfig clone  generateDefaultName()Ljava/lang/String; add_(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Ljava/lang/String;)V `(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Ljava/lang/String;Z)Vjavax/swing/JScrollPane D(Ljava/awt/Component;)V   setBackground(Ljava/awt/Color;)V MonoSpaced-PLAIN-12    java/awt/Font   decode#(Ljava/lang/String;)Ljava/awt/Font; V setHorizontalTextPosition V [ setFont(Ljava/awt/Font;)V [ IsetText*fr/orsay/lri/varna/applications/VARNAGUI$2  k addActionListener"(Ljava/awt/event/ActionListener;)V java/awt/BorderLayout M J# $% setLayout(Ljava/awt/LayoutManager;)V'West J) *)(Ljava/awt/Component;Ljava/lang/Object;)V,Center.java/awt/GridLayout - J1 2*(Ljava/awt/Component;)Ljava/awt/Component;4South6East8*fr/orsay/lri/varna/applications/VARNAGUI$3 7;*fr/orsay/lri/varna/applications/VARNAGUI$4 :>Structures Manager V@ DA(Ljava/lang/String;I)VCNorthEjavax/swing/JSplitPane DG DH-(IZLjava/awt/Component;Ljava/awt/Component;)V J KLgetContentPane()Ljava/awt/Container; N#Ojava/awt/Container N) R S setVisibleUjava/awt/dnd/DropTarget TW DX8(Ljava/awt/Component;Ljava/awt/dnd/DropTargetListener;)V Z [\addVARNAListener9(Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;)V^5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthdlmLjavax/swing/DefaultListModel; marginToolsm'Ljavax/swing/DefaultListSelectionModel;_RNA1#Lfr/orsay/lri/varna/models/rna/RNA;_RNA2e7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;e2DLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;e3;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax; listScrollerLjavax/swing/JScrollPane;textFieldsFontLjava/awt/Font;goPanelopsjsplitLjavax/swing/JSplitPane;dtLjava/awt/dnd/DropTarget;yjava/lang/StringBuilder{ User file # xH x~ append(I)Ljava/lang/StringBuilder; x toStringgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA;  getSelectedValue()Ljava/lang/Object;getParameterInfo()[[Ljava/lang/String;[Ljava/lang/String;java/lang/String sequenceDBNStringA raw RNA sequence structureDBN.An RNA structure in dot bracket notation (DBN)booleanTo show errorsinfo[[Ljava/lang/String;init  01 getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color;   $(Ljava/lang/String;)Ljava/awt/Color;  getColorjava/lang/ExceptioncoldefresultLjava/lang/Exception;get_varnaPanel!()Lfr/orsay/lri/varna/VARNAPanel;set_varnaPanel"(Lfr/orsay/lri/varna/VARNAPanel;)Vsurfaceget_seq()Ljavax/swing/JTextField;set_seq(Ljavax/swing/JTextField;)Vget_info()Ljavax/swing/JLabel;set_info(Ljavax/swing/JLabel;)Vmain([Ljava/lang/String;)V M  setDefaultCloseOperation  :packargsd dragEnter%(Ljava/awt/dnd/DropTargetDragEvent;)Varg0"Ljava/awt/dnd/DropTargetDragEvent;dragExit!(Ljava/awt/dnd/DropTargetEvent;)VLjava/awt/dnd/DropTargetEvent;dragOverdrop%(Ljava/awt/dnd/DropTargetDropEvent;)V  java/awt/dnd/DropTargetDropEvent getTransferable&()Ljava/awt/datatransfer/Transferable; "java/awt/datatransfer/Transferable getTransferDataFlavors%()[Ljava/awt/datatransfer/DataFlavor;  java/awt/datatransfer/DataFlavor isFlavorJavaFileListType()Z   acceptDrop  getTransferData6(Ljava/awt/datatransfer/DataFlavor;)Ljava/lang/Object;java/util/List  get(I)Ljava/lang/Object;   getSource T  getComponent()Ljava/awt/Component; java/lang/Object   importSession:(Ljava/lang/String;)Lfr/orsay/lri/varna/models/FullBackup; $fr/orsay/lri/varna/models/FullBackup config'Lfr/orsay/lri/varna/models/VARNAConfig;  erna   name M  I loadSecStr  drawRNA  getName  equals(Ljava/lang/Object;)Z  java/io/File  ! separatorCharC # $% lastIndexOf(I)I ' () substring(I)Ljava/lang/String; + ,-size()I / 0 dropComplete 2 3: rejectDrop 64fr/orsay/lri/varna/exceptions/ExceptionLoadingFaileddtde"Ljava/awt/dnd/DropTargetDropEvent;tr$Ljava/awt/datatransfer/Transferable;flavors#[Ljava/awt/datatransfer/DataFlavor;iobLjava/lang/Object;listLjava/util/List;ocLjava/awt/Component;pathvpbck&Lfr/orsay/lri/varna/models/FullBackup;6Lfr/orsay/lri/varna/exceptions/ExceptionLoadingFailed;rdropActionChangedonLayoutChangedonUINewStructureM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)VvonWarningEmitteds mouseClicked(Ljava/awt/event/MouseEvent;)V UWVjava/awt/event/MouseEvent X- getClickCount UZ [\getPoint()Ljava/awt/Point; ^ _`locationToIndex(Ljava/awt/Point;)I b cdgetModel()Ljavax/swing/ListModel; fhgjavax/swing/ListModel i getElementAt k lensureIndexIsVisiblenSpecify a new name for this RNAp Rename RNA  sutjavax/swing/JOptionPane vwshowInputDialog(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;ILjavax/swing/Icon;[Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; y z:repaintLjava/awt/event/MouseEvent;indexLjavax/swing/ListModel;itemnewName mouseEntered mouseExited mousePressed mouseReleasedaccess$0K(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/VARNAPanel;access$1\(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/components/ReorderableJList;access$2D(Lfr/orsay/lri/varna/applications/VARNAGUI;)Ljavax/swing/JTextField;access$3access$4c(Lfr/orsay/lri/varna/applications/VARNAGUI;)Lfr/orsay/lri/varna/applications/VARNAGUI$BackupHolder; SourceFile VARNAGUI.java InnerClasses BackupHolder!       !"#$%$&"'"()*)+),-. /0123 456578!9:;2 <>@Bnt KCD:;"*EG*JYLN*JYLP*JYLR*JYLT*VYXY*[Y]^*[Y]`*VYbde*VYgdi*kYmop*kYrot*kYvox*JYLz*|*~*BJ|\]_'`2a=bJcWddeqf~ghjkr}~C :;m iYL(=YN--*Y|*|+*|**|-*|Yd*|Y**Y*+*|Y·:Yŷ:*Y˷͵*жն*жն٧":*ݧ: :*лY**жն**жնY*|:Y****:*i *iY*`*`*pY**RY!"*R*i&(*R*`+(*eY*e *^*TY!"*T*e&(*T*^+(*P-Y/"*P*R0W*P*T0WJYL:Y!"*NY!"*N*P+(*N*Y3(*N5(*t7Y*9*x:Y*<JYL:  -Y/" *t0W *x0WVY=?: *zY!"*z 3(*z B(*z+(*p+(DY*z*зF: *IY!M*I +P*I*NBP*QTY**V: **Y]B2L (08@Q`q| #0@HS[ct} '3<HVdr~%3?MR`h Cia_` ^a5Vbc|defe ghijkl09mn[op<-qr s" %Dtu ` vw ;:xYz|@Y`@}B C;5 *|BC  ;RYYSYSYSSYYSYSYSSYY>SYSYSSL+B"%18OPCRP:;C***B! "#C ;+N:+,N:,- B)* ,-.1CR3333 gi;/*аB5C ;>*+бB 9:C;/*`B>C ;>*+`B BCC%$;/*YBFC ;>*+YB JKC!" ;[YL+++QBNO PQRC;5BXC;5B]C;5BbC;!+M,N6-2ߙ+,-2::6:+T+T:  :  Ǚ:  :  : *    V: Y :   ն:  "`&:* ն*E+.-+1 M,4+1}5B#fg hij!k-l5n<oBpMrWt`ugvoxvy}{|~oh C!!789:  ;<=5->?<@A?s5MB?`vw gCD v{E }tF GH QkI HJe0 gK;5BCL:;+BC MN;P*+,B  C OJePI;5B CQRS;[+TU*|+Y]=*|aN-e:*|j*moqr: *|xBF(014789:?DISZ"C>[[g{F|5>_}(2~HD?S;5B'C{S;5B,C{S;5B1C{S;5B6C{;%*аBZC;%*|BkC;%*`BcC;%*^BbC;%*BxC*7:PK IP>!8wAA-fr/orsay/lri/varna/applications/VARNAGUI.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.applications; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.File; import java.text.DateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.swing.DefaultListModel; import javax.swing.DefaultListSelectionModel; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTextField; import javax.swing.ListModel; import javax.swing.ListSelectionModel; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.components.ReorderableJList; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener; import fr.orsay.lri.varna.models.FullBackup; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.Mapping; import fr.orsay.lri.varna.models.rna.RNA; public class VARNAGUI extends JFrame implements DropTargetListener, InterfaceVARNAListener, MouseListener { /** * */ private static final long serialVersionUID = -790155708306987257L; private static final String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA"; private static final String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...))))).."; private static final String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...))))).."; // private static final String DEFAULT_STRUCTURE1 = "((((....))))"; // private static final String DEFAULT_STRUCTURE2 = // "((((..(((....)))..))))"; private VARNAPanel _vp; private JPanel _tools = new JPanel(); private JPanel _input = new JPanel(); private JPanel _seqPanel = new JPanel(); private JPanel _strPanel = new JPanel(); private JLabel _info = new JLabel(); private JTextField _str = new JTextField(DEFAULT_STRUCTURE1); private JTextField _seq = new JTextField(DEFAULT_SEQUENCE); private JLabel _strLabel = new JLabel(" Str:"); private JLabel _seqLabel = new JLabel(" Seq:"); private JButton _createButton = new JButton("Create"); private JButton _deleteButton = new JButton("Delete"); private JButton _duplicateButton = new JButton("Snapshot"); private JPanel _listPanel = new JPanel(); private ReorderableJList _sideList = null; private static String errorOpt = "error"; @SuppressWarnings("unused") private boolean _error; private Color _backgroundColor = Color.white; private static int _nextID = 1; @SuppressWarnings("unused") private int _algoCode; private BackupHolder _rnaList; public VARNAGUI() { super("VARNA GUI"); RNAPanelDemoInit(); } private void RNAPanelDemoInit() { DefaultListModel dlm = new DefaultListModel(); int marginTools = 40; DefaultListSelectionModel m = new DefaultListSelectionModel(); m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); m.setLeadAnchorNotificationEnabled(false); _sideList = new ReorderableJList(); _sideList.setModel(dlm); _sideList.addMouseListener(this); _sideList.setSelectionModel(m); _sideList.setPreferredSize(new Dimension(100, 0)); _sideList.addListSelectionListener( new ListSelectionListener(){ public void valueChanged(ListSelectionEvent arg0) { //System.out.println(arg0); if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting()) { FullBackup sel = (FullBackup) _sideList.getSelectedValue(); Mapping map = Mapping.DefaultOutermostMapping(_vp.getRNA().getSize(), sel.rna.getSize()); _vp.showRNAInterpolated(sel.rna,sel.config,map); _seq.setText(sel.rna.getSeq()); _str.setText(sel.rna.getStructDBN()); } } }); _rnaList = new BackupHolder(dlm,_sideList); RNA _RNA1 = new RNA("User defined 1"); RNA _RNA2 = new RNA("User defined 2"); try { _vp = new VARNAPanel("0","."); _RNA1.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE1); _RNA1.drawRNARadiate(_vp.getConfig()); _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2); _RNA2.drawRNARadiate(_vp.getConfig()); } catch (ExceptionNonEqualLength e) { _vp.errorDialog(e); } catch (ExceptionUnmatchedClosingParentheses e2) { e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) { e3.printStackTrace(); } _vp.setPreferredSize(new Dimension(400, 400)); _rnaList.add(_vp.getConfig().clone(),_RNA2,generateDefaultName()); _rnaList.add(_vp.getConfig().clone(),_RNA1,generateDefaultName(),true); JScrollPane listScroller = new JScrollPane(_sideList); listScroller.setPreferredSize(new Dimension(150, 0)); setBackground(_backgroundColor); _vp.setBackground(_backgroundColor); Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12"); _seqLabel.setHorizontalTextPosition(JLabel.LEFT); _seqLabel.setPreferredSize(new Dimension(marginTools, 15)); _seq.setFont(textFieldsFont); _seq.setText(DEFAULT_SEQUENCE); _createButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { RNA nRNA = new RNA(generateDefaultName()); nRNA.setRNA(_seq.getText(), _str.getText()); nRNA.drawRNARadiate(_vp.getConfig()); _rnaList.add(new VARNAConfig(),nRNA,true); } catch (ExceptionUnmatchedClosingParentheses e1) { JOptionPane.showMessageDialog(_vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e1) { JOptionPane.showMessageDialog(_vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE); } } }); _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel, BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER); _strLabel.setPreferredSize(new Dimension(marginTools, 15)); _strLabel.setHorizontalTextPosition(JLabel.LEFT); _str.setFont(textFieldsFont); _strPanel.setLayout(new BorderLayout()); _strPanel.add(_strLabel, BorderLayout.WEST); _strPanel.add(_str, BorderLayout.CENTER); _input.setLayout(new GridLayout(2, 0)); _input.add(_seqPanel); _input.add(_strPanel); JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout()); _tools.setLayout(new BorderLayout()); _tools.add(_input, BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH); _tools.add(goPanel, BorderLayout.EAST); _deleteButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } }); _duplicateButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { _rnaList.add((VARNAConfig)_vp.getConfig().clone(),_vp.getRNA().clone(),_vp.getRNA().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new Date()),true); }}); JPanel ops = new JPanel(); ops.setLayout(new GridLayout(1,2)); ops.add(_deleteButton); ops.add(_duplicateButton); JLabel j = new JLabel("Structures Manager",JLabel.CENTER); _listPanel.setLayout(new BorderLayout()); _listPanel.add(ops,BorderLayout.SOUTH); _listPanel.add(j,BorderLayout.NORTH); _listPanel.add(listScroller,BorderLayout.CENTER); goPanel.add(_createButton, BorderLayout.CENTER); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,_vp); getContentPane().setLayout(new BorderLayout()); getContentPane().add(split, BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.NORTH); setVisible(true); DropTarget dt = new DropTarget(_vp, this); _vp.addVARNAListener(this); } public static String generateDefaultName() { return "User file #"+_nextID++; } public RNA getRNA() { return (RNA)_sideList.getSelectedValue(); } public String[][] getParameterInfo() { String[][] info = { // Parameter Name Kind of Value Description, { "sequenceDBN", "String", "A raw RNA sequence" }, { "structureDBN", "String", "An RNA structure in dot bracket notation (DBN)" }, { errorOpt, "boolean", "To show errors" }, }; return info; } public void init() { _vp.setBackground(_backgroundColor); _error = true; } @SuppressWarnings("unused") private Color getSafeColor(String col, Color def) { Color result; try { result = Color.decode(col); } catch (Exception e) { try { result = Color.getColor(col, def); } catch (Exception e2) { return def; } } return result; } public VARNAPanel get_varnaPanel() { return _vp; } public void set_varnaPanel(VARNAPanel surface) { _vp = surface; } public JTextField get_seq() { return _seq; } public void set_seq(JTextField _seq) { this._seq = _seq; } public JLabel get_info() { return _info; } public void set_info(JLabel _info) { this._info = _info; } public static void main(String[] args) { VARNAGUI d = new VARNAGUI(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); d.pack(); d.setVisible(true); } public void dragEnter(DropTargetDragEvent arg0) { // TODO Auto-generated method stub } public void dragExit(DropTargetEvent arg0) { // TODO Auto-generated method stub } public void dragOver(DropTargetDragEvent arg0) { // TODO Auto-generated method stub } public void drop(DropTargetDropEvent dtde) { try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (flavors[i].isFlavorJavaFileListType()) { dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); Object ob = tr.getTransferData(flavors[i]); if (ob instanceof List) { List list = (List) ob; for (int j = 0; j < list.size(); j++) { Object o = list.get(j); if (dtde.getSource() instanceof DropTarget) { DropTarget dt = (DropTarget) dtde.getSource(); Component c = dt.getComponent(); if (c instanceof VARNAPanel) { String path = o.toString(); VARNAPanel vp = (VARNAPanel) c; try{ FullBackup bck = VARNAPanel.importSession(path); _rnaList.add(bck.config, bck.rna,bck.name,true); } catch (ExceptionLoadingFailed e3) { RNA r = new RNA(); r.loadSecStr(path); r.drawRNA(vp.getConfig()); String name =r.getName(); if (name.equals("")) { name = path.substring(path.lastIndexOf(File.separatorChar)+1); } _rnaList.add(vp.getConfig().clone(),r,name,true); } } } } } // If we made it this far, everything worked. dtde.dropComplete(true); return; } } // Hmm, the user must not have dropped a file list dtde.rejectDrop(); } catch (Exception e) { e.printStackTrace(); dtde.rejectDrop(); } } public void dropActionChanged(DropTargetDragEvent arg0) { } private class BackupHolder{ private DefaultListModel _rnaList; private ArrayList _rnas = new ArrayList(); JList _l; public BackupHolder(DefaultListModel rnaList, JList l) { _rnaList = rnaList; _l = l; } public void add(VARNAConfig c, RNA r) { add(c, r, r.getName(),false); } public void add(VARNAConfig c, RNA r,boolean select) { add(c, r, r.getName(),select); } public void add(VARNAConfig c, RNA r, String name) { add(c, r, name,false); } public void add(VARNAConfig c, RNA r, String name, boolean select) { if (select){ _l.removeSelectionInterval(0, _rnaList.size()); } if (name.equals("")) { name = generateDefaultName(); } FullBackup bck = new FullBackup(c,r,name); _rnas.add(0, r); _rnaList.add(0,bck); if (select){ _l.setSelectedIndex(0); } } public void remove(int i) { _rnas.remove(i); _rnaList.remove(i); } public DefaultListModel getModel() { return _rnaList; } public boolean contains(RNA r) { return _rnas.contains(r); } /*public int getSize() { return _rnaList.getSize(); }*/ public FullBackup getElementAt(int i) { return (FullBackup) _rnaList.getElementAt(i); } public void removeSelected() { int i = _l.getSelectedIndex(); if (i!=-1) { if (_rnaList.getSize()==1) { RNA r = new RNA(); try { r.setRNA(" ", "."); } catch (ExceptionUnmatchedClosingParentheses e1) { } catch (ExceptionFileFormatOrSyntax e1) { } _vp.showRNA(r); _vp.repaint(); } else { int newi = i+1; if (newi==_rnaList.getSize()) { newi = _rnaList.getSize()-2; } FullBackup bck = (FullBackup) _rnaList.getElementAt(newi); _l.setSelectedValue(bck,true); } _rnaList.remove(i); } } } public void onLayoutChanged() { // TODO Auto-generated method stub } public void onUINewStructure(VARNAConfig v, RNA r) { _rnaList.add(v, r,"",true); } public void onWarningEmitted(String s) { // TODO Auto-generated method stub } public void mouseClicked(MouseEvent e) { if(e.getClickCount() == 2){ int index = _sideList.locationToIndex(e.getPoint()); ListModel dlm = _sideList.getModel(); FullBackup item = (FullBackup) dlm.getElementAt(index);; _sideList.ensureIndexIsVisible(index); Object newName = JOptionPane.showInputDialog( this, "Specify a new name for this RNA", "Rename RNA", JOptionPane.QUESTION_MESSAGE, (Icon)null, null, item.toString()); if (newName!=null) { item.name = newName.toString(); this._sideList.repaint(); } } } public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } public void mousePressed(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseReleased(MouseEvent arg0) { // TODO Auto-generated method stub } } PK 4F>Fa 0FF5fr/orsay/lri/varna/applications/VARNAOnlineDemo.class1P/fr/orsay/lri/varna/applications/VARNAOnlineDemojavax/swing/JAppletserialVersionUIDJ ConstantValue͑gDEFAULT_SEQUENCELjava/lang/String; iCAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIADEFAULT_STRUCTUREi..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...))))).._vpLfr/orsay/lri/varna/VARNAPanel;_toolsLjavax/swing/JPanel;_input _seqPanel _structPanel_infoLjavax/swing/JLabel;_structLjavax/swing/JTextField;_seq _structLabel _seqLabelerrorOpt_errorZ_backgroundColorLjava/awt/Color; _algoCodeI()VCode*error ,  LineNumberTableLocalVariableTable 1 /'3javax/swing/JPanel 21 6  8  :  < >javax/swing/JLabel =1 A Cjavax/swing/JTextField B1 F  H J Str: =L /M(Ljava/lang/String;)V O Q Seq: S  UWVjava/awt/Color X#white Z "#\fr/orsay/lri/varna/VARNAPanel B^ _`getText()Ljava/lang/String; [b /c'(Ljava/lang/String;Ljava/lang/String;)V e  [g hi setErrorsOn(Z)V [k lm errorDialog(Ljava/lang/Exception;)V o p'RNAPanelDemoInitr5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengththis1Lfr/orsay/lri/varna/applications/VARNAOnlineDemo;e7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength; x yz setBackground(Ljava/awt/Color;)V [x [} ~getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !fr/orsay/lri/varna/models/rna/RNA csetRNAMonoSpaced-PLAIN-12  java/awt/Font decode#(Ljava/lang/String;)Ljava/awt/Font; = setHorizontalTextPosition(I)Vjava/awt/Dimension /(II)V = setPreferredSize(Ljava/awt/Dimension;)V B setFont(Ljava/awt/Font;)V `getSeq B MsetTextjava/awt/BorderLayout 1 2  setLayout(Ljava/awt/LayoutManager;)VWest 2 add)(Ljava/awt/Component;Ljava/lang/Object;)VCenter ` getStructDBN5fr/orsay/lri/varna/controlers/ControleurDemoTextField /4(Lfr/orsay/lri/varna/applications/VARNAOnlineDemo;)V B addCaretListener$(Ljavax/swing/event/CaretListener;)Vjava/awt/GridLayout 2 *(Ljava/awt/Component;)Ljava/awt/Component;South  getContentPane()Ljava/awt/Container; java/awt/Container  i setVisible [  getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; fr/orsay/lri/varna/views/VueUI ' UIRadiatejava/lang/Exception marginToolse1Ljava/lang/Exception;textFieldsFontLjava/awt/Font;controleurTextField7Lfr/orsay/lri/varna/controlers/ControleurDemoTextField;getParameterInfo()[[Ljava/lang/String;[Ljava/lang/String;java/lang/String sequenceDBNStringA raw RNA sequence structureDBN.An RNA structure in dot bracket notation (DBN)booleanTo show errorsinfo[[Ljava/lang/String;init  'retrieveParametersValues  ! getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; U $(Ljava/lang/String;)Ljava/awt/Color; U getColorcoldefresulte2getParameterValue8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;   getParameter&(Ljava/lang/String;)Ljava/lang/String;keytmpfalse    java/lang/Boolean  parseBoolean(Ljava/lang/String;)Z background U! "`toString $ &( algorithm*radiate,circular . /0equals(Ljava/lang/Object;)Z 2 $%4naview6line [8 9:drawRNA((Ljava/lang/String;Ljava/lang/String;I)V q< ='printStackTrace_algoget_varnaPanel!()Lfr/orsay/lri/varna/VARNAPanel;set_varnaPanel"(Lfr/orsay/lri/varna/VARNAPanel;)Vsurface get_struct()Ljavax/swing/JTextField; set_struct(Ljavax/swing/JTextField;)Vget_seqset_seqget_info()Ljavax/swing/JLabel;set_info(Ljavax/swing/JLabel;)V SourceFileVARNAOnlineDemo.java!      !"#$%&'(*)+- U=./'( *0*2Y45*2Y47*2Y49*2Y4;*=Y?@*BYDE*BYDG*=YIKN*=YPKR*TY*[Y*G]*E]ad*df L*d+j*nrq-F]JKM%N0O;PFQQR^SkXr_`abde.stuvp'((<**Yw*d*Y{*d|*G]*E]*df M*d,jM*R*RY*G,*G*d|*9Y*9*R*9*G*NY*N*E,*E*d|*;Y*;*N*;*EY*N*G-*E-*7Y*7*9W*7*;W*5Y*5*7*5*@Ŷ*ǻY**d**5Ŷ**dҶֱ69-%hj kn.o9p:qBtHvPwaxiyz{|} %1=KXes.4st%:HU(JYYSYSYSSYYSYSYSSYY+SYSYSSL+-"",2GH.JstH'(K**d*Y{*-. st(+N:+,N:,- - .Rst  # # # # u   (b*+N-,-- .*st   '(**+*d*f****Y *Y#Y*d*Y{*G*%*E*%*')L++- *1,+3- *1+5- *1*1*G]%-%*E]%-*G *E*d*G]*E]*17M,;q-^"36AQalv~. stl> uv?@(/*d-. stAB(>*+d- .stCDE(/*E-. stFG(>*+E- .stHE(/*G-. stIG(>*+G- .stJK(/*@-. stLM(>*+@- .stNOPK pq<Ý4fr/orsay/lri/varna/applications/VARNAOnlineDemo.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.applications; /* VARNA is a Java library for quick automated drawings RNA secondary structure Copyright (C) 2007 Yann Ponty This program is free software:you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import javax.swing.JApplet; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurDemoTextField; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.models.rna.RNA; /** * An RNA 2d Panel demo applet * * @author Yann Ponty & Darty Kévin * */ public class VARNAOnlineDemo extends JApplet { /** * */ private static final long serialVersionUID = -790155708306987257L; private static final String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA"; private static final String DEFAULT_STRUCTURE = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...))))).."; private VARNAPanel _vp; private JPanel _tools = new JPanel(); private JPanel _input = new JPanel(); private JPanel _seqPanel = new JPanel(); private JPanel _structPanel = new JPanel(); private JLabel _info = new JLabel(); private JTextField _struct = new JTextField(); private JTextField _seq = new JTextField(); private JLabel _structLabel = new JLabel(" Str:"); private JLabel _seqLabel = new JLabel(" Seq:"); private static String errorOpt = "error"; private boolean _error; private Color _backgroundColor = Color.white; private int _algoCode; public VARNAOnlineDemo() { super(); try { _vp = new VARNAPanel(_seq.getText(), _struct.getText()); _vp.setErrorsOn(false); } catch (ExceptionNonEqualLength e) { _vp.errorDialog(e); } RNAPanelDemoInit(); } private void RNAPanelDemoInit() { int marginTools = 40; setBackground(_backgroundColor); _vp.setBackground(_backgroundColor); try { _vp.getRNA().setRNA(_seq.getText(), _struct.getText()); _vp.setErrorsOn(false); } catch (Exception e1) { _vp.errorDialog(e1); } Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12"); _seqLabel.setHorizontalTextPosition(JLabel.LEFT); _seqLabel.setPreferredSize(new Dimension(marginTools, 15)); _seq.setFont(textFieldsFont); _seq.setText(_vp.getRNA().getSeq()); _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel, BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER); _structLabel.setPreferredSize(new Dimension(marginTools, 15)); _structLabel.setHorizontalTextPosition(JLabel.LEFT); _struct.setFont(textFieldsFont); _struct.setText(_vp.getRNA().getStructDBN()); _structPanel.setLayout(new BorderLayout()); _structPanel.add(_structLabel, BorderLayout.WEST); _structPanel.add(_struct, BorderLayout.CENTER); ControleurDemoTextField controleurTextField = new ControleurDemoTextField(this); _seq.addCaretListener(controleurTextField); _struct.addCaretListener(controleurTextField); _input.setLayout(new GridLayout(3, 0)); _input.add(_seqPanel); _input.add(_structPanel); _tools.setLayout(new BorderLayout()); _tools.add(_input, BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH); getContentPane().setLayout(new BorderLayout()); getContentPane().add(_vp, BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.SOUTH); setVisible(true); _vp.getVARNAUI().UIRadiate(); } public String[][] getParameterInfo() { String[][] info = { // Parameter Name Kind of Value Description, { "sequenceDBN", "String", "A raw RNA sequence" }, { "structureDBN", "String", "An RNA structure in dot bracket notation (DBN)" }, { errorOpt, "boolean", "To show errors" }, }; return info; } public void init() { retrieveParametersValues(); _vp.setBackground(_backgroundColor); _error = true; } private Color getSafeColor(String col, Color def) { Color result; try { result = Color.decode(col); } catch (Exception e) { try { result = Color.getColor(col, def); } catch (Exception e2) { return def; } } return result; } private String getParameterValue(String key, String def) { String tmp; tmp = getParameter(key); if (tmp == null) { return def; } else { return tmp; } } private void retrieveParametersValues() { _error = Boolean.parseBoolean(getParameterValue(errorOpt, "false")); _vp.setErrorsOn(_error); _backgroundColor = getSafeColor(getParameterValue("background", _backgroundColor.toString()), _backgroundColor); _vp.setBackground(_backgroundColor); _seq.setText(getParameterValue("sequenceDBN", "")); _struct.setText(getParameterValue("structureDBN", "")); String _algo = getParameterValue("algorithm", "radiate"); if (_algo.equals("circular")) _algoCode = RNA.DRAW_MODE_CIRCULAR; else if (_algo.equals("naview")) _algoCode = RNA.DRAW_MODE_NAVIEW; else if (_algo.equals("line")) _algoCode = RNA.DRAW_MODE_LINEAR; else _algoCode = RNA.DRAW_MODE_RADIATE; if (_seq.getText().equals("") && _struct.getText().equals("")) { _seq.setText(DEFAULT_SEQUENCE); _struct.setText(DEFAULT_STRUCTURE); } try { _vp.drawRNA(_seq.getText(), _struct.getText(), _algoCode); } catch (ExceptionNonEqualLength e) { e.printStackTrace(); } } public VARNAPanel get_varnaPanel() { return _vp; } public void set_varnaPanel(VARNAPanel surface) { _vp = surface; } public JTextField get_struct() { return _struct; } public void set_struct(JTextField _struct) { this._struct = _struct; } public JTextField get_seq() { return _seq; } public void set_seq(JTextField _seq) { this._seq = _seq; } public JLabel get_info() { return _info; } public void set_info(JLabel _info) { this._info = _info; } } PK 4F>-(Lfr/orsay/lri/varna/applications/VARNAcmd;)VCode    ()VLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/applications/VARNAcmd$1;compare'(Ljava/lang/Object;Ljava/lang/Object;)I[Ljava/lang/String; java/lang/String  compareTo(Ljava/lang/String;)Io1Ljava/lang/Object;o2tab1tab2 SourceFile VARNAcmd.javaEnclosingMethod((fr/orsay/lri/varna/applications/VARNAcmd *+ printMatrix(I)V InnerClasses0  8 *+ *    p+N,:-22 4 ! " #$%&'), PK 4F>M5656.fr/orsay/lri/varna/applications/VARNAcmd.class1w(fr/orsay/lri/varna/applications/VARNAcmdjava/lang/Object6fr/orsay/lri/varna/interfaces/InterfaceParameterLoader _optsValuesLjava/util/Hashtable; Signature;Ljava/util/Hashtable; _basicOptsInv_inFileLjava/lang/String;_outFile _baseWidthI_scaleD_qualityF _basicOptions[Ljava/lang/String;matrixLjava/util/Vector;'Ljava/util/Vector<[Ljava/lang/String;>; MAX_WIDTH()VCode  LineNumberTableLocalVariableTable(Ljava/util/Vector;)V)(Ljava/util/Vector;)V & "(java/util/Hashtable '& +  - / 1 3  5  7 ?fff : <java/lang/String >@?+fr/orsay/lri/varna/models/VARNAConfigLoader A algoOpt >C D  bpStyleOpt >F G  bondColorOpt >I J backboneColorOpt >L M  periodNumOpt >O P baseInnerColorOpt >R S baseOutlineColorOpt U Wjava/util/Vector V& Z  '\ ]^put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; V` ab elementAt(I)Ljava/lang/Object; ;d efcharAt(I)Chjava/lang/StringBuilderjMissing or unknown option " gl "m(Ljava/lang/String;)V go pqappend-(Ljava/lang/String;)Ljava/lang/StringBuilder;s" gu vwtoString()Ljava/lang/String; y zm errorExit|-h ;~ equals(Ljava/lang/Object;)Z  displayLightHelpExit-x  displayDetailledHelpExit V size()IMissing argument for option " V bget-i-o-quality java/lang/Float  parseFloat(Ljava/lang/String;)F -resolution   addOption'(Ljava/lang/String;Ljava/lang/String;)VMissing output filethis*Lfr/orsay/lri/varna/applications/VARNAcmd;argsjioptvalLocalVariableTypeTable&Ljava/util/Vector; ;  substring(I)Ljava/lang/String;keyvaluegetDescriptionMVARNA v3.8 Assisted drawing of RNA secondary structure (Command Line version)indent ; valueOf&(Ljava/lang/Object;)Ljava/lang/String; kresultcomplete'(Ljava/lang/String;I)Ljava/lang/String; ; lengthsaddLine V addline printMatrix(I)V V toArray(([Ljava/lang/Object;)[Ljava/lang/Object;*fr/orsay/lri/varna/applications/VARNAcmd$1 "-(Lfr/orsay/lri/varna/applications/VARNAcmd;)V java/util/Arrays sort,([Ljava/lang/Object;Ljava/util/Comparator;)V java/lang/Math max(II)I  - java/lang/System outLjava/io/PrintStream; min ; (II)Ljava/lang/String; java/io/PrintStream mprintlnindvalues[[Ljava/lang/String;maxSizeelemmsgoffnmsg printUsageUUsage: java -cp . [-i InFile|-sequenceDBN XXX -structureDBN YYY] -o OutFile [Options]Where:   2OutFile Supported formats: {JPEG,PNG,EPS,XFIG,SVG} HInFile Secondary structure file: Supported formats: {BPSEQ,CT,RNAML,DBN}printHelpOptions Main options:h6Displays a short description of main options and exits  x/Displays a detailled description of all options  printMainOptions([[Ljava/lang/String;)V ' ! containsKeyinfoprintAdvancedOptions% Advanced options:'quality)+Sets quality (non-vector file formats only)+ resolution-.Sets resolution (non-vector file formats only) >/ 01getParameterInfo()[[Ljava/lang/String; 3 w 5  7  9 :exit < #>Error: @ B getParameterValue8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; 'F G&(Ljava/lang/Object;)Ljava/lang/Object;defrun ExceptionsLjava/io/IOException >N "O;(Lfr/orsay/lri/varna/interfaces/InterfaceParameterLoader;)VQ!fr/orsay/lri/varna/models/rna/RNA P& PT Um loadSecStrW sequenceDBN Y CD[ structureDBN P] ^setRNA >` ^a&(Lfr/orsay/lri/varna/models/rna/RNA;)V >c decreateVARNAPanels()Ljava/util/ArrayList; ghjava/util/ArrayList gkfr/orsay/lri/varna/VARNAPanel jm nogetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; Pq rsgetBBox$()Ljava/awt/geom/Rectangle2D$Double; ;u vw toLowerCasex.jpeg ;z {|endsWith(Ljava/lang/String;)Z~.jpg.png j  getTitleFont()Ljava/awt/Font;  java/awt/Font getSize j setTitleFontSize(F)V  java/awt/geom/Rectangle2D$Double height  width j setSize(II)V.eps j  getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; P  saveRNAEPS<(Ljava/lang/String;Lfr/orsay/lri/varna/models/VARNAConfig;)V.xfig.fig P  saveRNAXFIG.svg P  saveRNASVG   saveToJPEG4(Ljava/lang/String;Lfr/orsay/lri/varna/VARNAPanel;)V   saveToPNG.varna j m saveSession#Unknown extension for output file " 7fr/orsay/lri/varna/exceptions/ExceptionWritingForbidden printStackTrace 3fr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding 5fr/orsay/lri/varna/exceptions/ExceptionParameterError Afr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError 5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength Bfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses 3fr/orsay/lri/varna/exceptions/ExceptionExportFailed 7fr/orsay/lri/varna/exceptions/ExceptionPermissionDenied 4fr/orsay/lri/varna/exceptions/ExceptionLoadingFailed 9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax msetPath Error: Missing input file "".java/io/FileNotFoundExceptionVARNAcfg-Lfr/orsay/lri/varna/models/VARNAConfigLoader;vplLjava/util/ArrayList;r#Lfr/orsay/lri/varna/models/rna/RNA;_vpLfr/orsay/lri/varna/VARNAPanel;_rnabbox"Ljava/awt/geom/Rectangle2D$Double;e9Lfr/orsay/lri/varna/exceptions/ExceptionWritingForbidden;5Lfr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding;7Lfr/orsay/lri/varna/exceptions/ExceptionParameterError;CLfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError;7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;DLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;5Lfr/orsay/lri/varna/exceptions/ExceptionExportFailed;9Lfr/orsay/lri/varna/exceptions/ExceptionPermissionDenied;6Lfr/orsay/lri/varna/exceptions/ExceptionLoadingFailed;;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;Ljava/io/FileNotFoundException;6Ljava/util/ArrayList;java/awt/image/BufferedImage j getWidth  round(F)I j   getHeight  " (III)V  createGraphics()Ljava/awt/Graphics2D; j paintComponent(Ljava/awt/Graphics;)V*javax/imageio/stream/FileImageOutputStream java/io/File l  "(Ljava/io/File;)Vjpeg !#"javax/imageio/ImageIO $%getImageWritersByFormatName((Ljava/lang/String;)Ljava/util/Iterator; ')(java/util/Iterator *+next()Ljava/lang/Object;-javax/imageio/ImageWriter ,/ 01getDefaultWriteParam!()Ljavax/imageio/ImageWriteParam; 354javax/imageio/ImageWriteParam 6setCompressionMode 38 9setCompressionQuality ,; <= setOutput(Ljava/lang/Object;)V?javax/imageio/IIOImage >A "BU(Ljava/awt/image/RenderedImage;Ljava/util/List;Ljavax/imageio/metadata/IIOMetadata;)V ,D EFwrite^(Ljavax/imageio/metadata/IIOMetadata;Ljavax/imageio/IIOImage;Ljavax/imageio/ImageWriteParam;)V H Iclose KK Lw getMessage N "filenamevpmyImageLjava/awt/image/BufferedImage;g2Ljava/awt/Graphics2D;,Ljavax/imageio/stream/FileImageOutputStream;writerLjavax/imageio/ImageWriter;paramsLjavax/imageio/ImageWriteParam; myIIOImageLjavax/imageio/IIOImage;Ljava/io/IOException; ^`_java/awt/Graphics2D adisposecPNG !e EfA(Ljava/awt/image/RenderedImage;Ljava/lang/String;Ljava/io/File;)Z Kmain([Ljava/lang/String;)V k "# m Iargvoptsapp SourceFile VARNAcmd.java InnerClassesujava/awt/geom/Rectangle2DDouble!          *d :!"# $*%*'Y)**'Y),*.0*.2*4*6*89*;Y=SYBSYESYHSYKSYNSYQST*VYXY=*,*T2*T2[W*T=+_;N-c-*gYik-nrntx-{}*-} *`+*gYk-nrntx+`;:-} *0G-} *25-}*9 -}*6 *-+**2.} *x -K;<= >&?-@2A8C9C@CFDRE^FeGlwL|MLOPQRSUVXY[\ ^_"`+a4b=cFdRe[fhhokrPzmnp!>y# V  1+} *,0"+} *,2**+,[W s tuv"x0z! 11 1 w- }! ~&.M>gY,kntM, $!*&&# {#+NgY-köntN-- !!*## #! g;Y+SY,SN*Y-W  !*   E E*YM*Y,W,Y*׸>6,2:2Ÿ>,``>6,2:2:2:gY*.kn*dnt:gYkdŸnt`id6Q`dŸ: gY*.ŷk ntd`6š,*VYXY n  "(.:DJPV\b%/9D!z EE :"#%. MV\ b [1 OgY*k ntgY*k nt .  $-03BHN! O]#***  "! #L**=!+22N*,- *-+22+* * "(3=FK!*LL"'( #L$=!+22N*,- *-+22+*&(**,* * )2<FK!*LL" ' d.L*2*4*+68 !"m!.L*2*4*+6*+;8  !!"zm|4*2gY=k+n?nt*4*A8  '+/3!44 CD_**+**+E;,    !  H IJKy>Y*MLPYRN*0.}-*0S-*V.X*Z.X\+-_+bM,f(,ij:l:lp:*2twy#*2t}y*2ty?*6k*4*6k*6*4kko*2ty*2*2ty*2ty*2O*2ty*2.*2twy*2t}y**2*2ty**2*2ty*2*gYk*2nrntxN-8N-8N-8N-8xN-8lN-8`N-8TN-8HN-8CHOY` j#z$%'(*+,-.(/80I1Y2i3v45679:9=>?@ABCDEFGHIJK L MNOPQ#R$S(T/U0V4W;X<YDZH[O\P]p^t`xa!y pHYs`ljb $0<P$ HJj Y,, N-:,YY+: &,:.:2*97:>Y-@:CG:YJ+M%~K Rfg f hifjk%m6nFoMpSq\rcsotyuvwz!f O PyQRsST6KUF;VWM4XYoZ[\JEY,, N-:,]-bY+dW :g*:=K 6 ~ ~ ~%*=?D!>EEO EP,QR&ST?\ hi4VYXL=+*2W*Y+jM,lN-g'+.K &  './3!44n,o ' p/\ ,oqrstv PK 0Wy=& 4 4-fr/orsay/lri/varna/applications/VARNAcmd.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.applications; import java.awt.Graphics2D; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Hashtable; import java.util.Vector; import javax.imageio.IIOImage; import javax.imageio.ImageIO; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.stream.FileImageOutputStream; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.exceptions.ExceptionExportFailed; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionJPEGEncoding; import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; import fr.orsay.lri.varna.exceptions.ExceptionModeleStyleBaseSyntaxError; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionParameterError; import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.exceptions.ExceptionWritingForbidden; import fr.orsay.lri.varna.interfaces.InterfaceParameterLoader; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.VARNAConfigLoader; import fr.orsay.lri.varna.models.rna.RNA; public class VARNAcmd implements InterfaceParameterLoader { private Hashtable _optsValues = new Hashtable(); private Hashtable _basicOptsInv = new Hashtable(); private String _inFile = ""; private String _outFile = ""; int _baseWidth = 400; double _scale = 1.0; float _quality = 0.9f; private String[] _basicOptions = { VARNAConfigLoader.algoOpt, VARNAConfigLoader.bpStyleOpt, VARNAConfigLoader.bondColorOpt, VARNAConfigLoader.backboneColorOpt, VARNAConfigLoader.periodNumOpt, VARNAConfigLoader.baseInnerColorOpt, VARNAConfigLoader.baseOutlineColorOpt, }; public VARNAcmd(Vector args) { for (int j = 0; j < _basicOptions.length; j++) { _basicOptsInv.put(_basicOptions[j], _basicOptions[j]); } int i = 0; while (i < args.size()) { String opt = args.elementAt(i); if (opt.charAt(0) != '-') { errorExit("Missing or unknown option \"" + opt + "\""); } if (opt.equals("-h")) { displayLightHelpExit(); } if (opt.equals("-x")) { displayDetailledHelpExit(); } else { if (i + 1 >= args.size()) { errorExit("Missing argument for option \"" + opt + "\""); } String val = args.get(i + 1); if (opt.equals("-i")) { _inFile = val; } else if (opt.equals("-o")) { _outFile = val; } else if (opt.equals("-quality")) { _quality = Float.parseFloat(val); } else if (opt.equals("-resolution")) { _scale = Float.parseFloat(val); } else { addOption(opt, val); } } i += 2; } if (_outFile.equals("")) { errorExit("Missing output file"); } } public void addOption(String key, String value) { if (key.equals("-i")) { _inFile = value; } else if (key.equals("-o")) { _outFile = value; } else { _optsValues.put(key.substring(1), value); } } private String getDescription() { return "VARNA v" + VARNAConfig.MAJOR_VERSION + "." + VARNAConfig.MINOR_VERSION + " Assisted drawing of RNA secondary structure (Command Line version)"; } private String indent(int k) { String result = ""; for (int i = 0; i < k; i++) { result += " "; } return result; } private String complete(String s, int k) { String result = s; while (result.length() < k) { result += " "; } return result; } Vector matrix = new Vector(); private void addLine(String opt, String val) { String[] line = { opt, val }; matrix.add(line); } private static int MAX_WIDTH = 100; @SuppressWarnings("unchecked") private void printMatrix(int ind) { String[][] values = new String[matrix.size()][]; matrix.toArray(values); Arrays.sort(values, new Comparator() { public int compare(Object o1, Object o2) { String[] tab1 = (String[]) o1; String[] tab2 = (String[]) o2; return tab1[0].compareTo(tab2[0]); } }); int maxSize = 0; for (int i = 0; i < values.length; i++) { String[] elem = values[i]; maxSize = Math.max(maxSize, elem[0].length()); } maxSize += ind + 2; for (int i = 0; i < values.length; i++) { String[] elem = values[i]; String opt = elem[0]; String msg = elem[1]; opt = complete("", ind) + "-" + complete(opt, maxSize - ind); System.out.println(opt + msg.substring(0, Math.min(MAX_WIDTH - opt.length(), msg.length()))); if (opt.length() + msg.length() >= MAX_WIDTH) { int off = MAX_WIDTH - opt.length(); while (off < msg.length()) { String nmsg = msg.substring(off, Math.min(off + MAX_WIDTH - opt.length(), msg.length())); System.out.println(complete("", opt.length())+nmsg); off += MAX_WIDTH - opt.length(); } } } matrix = new Vector(); } private void printUsage() { System.out .println("Usage: java -cp . [-i InFile|-sequenceDBN XXX -structureDBN YYY] -o OutFile [Options]"); System.out.println("Where:"); System.out.println(indent(1) + "OutFile\tSupported formats: {JPEG,PNG,EPS,XFIG,SVG}"); System.out .println(indent(1) + "InFile\tSecondary structure file: Supported formats: {BPSEQ,CT,RNAML,DBN}"); } private void printHelpOptions() { System.out.println("\nMain options:"); addLine("h", "Displays a short description of main options and exits"); addLine("x", "Displays a detailled description of all options"); printMatrix(2); } private void printMainOptions(String[][] info) { System.out.println("\nMain options:"); addLine("h", "Displays a short description of main options and exits"); addLine("x", "Displays a detailled description of all options"); for (int i = 0; i < info.length; i++) { String key = info[i][0]; if (_basicOptsInv.containsKey(key)) { addLine(key, info[i][2]); } } printMatrix(2); } private void printAdvancedOptions(String[][] info) { System.out.println("\nAdvanced options:"); for (int i = 0; i < info.length; i++) { String key = info[i][0]; if (!_basicOptsInv.containsKey(key)) { addLine(key, info[i][2]); } } addLine("quality", "Sets quality (non-vector file formats only)"); addLine("resolution", "Sets resolution (non-vector file formats only)"); printMatrix(2); } private void displayLightHelpExit() { String[][] info = VARNAConfigLoader.getParameterInfo(); System.out.println(getDescription()); printUsage(); printMainOptions(info); System.exit(1); } private void displayDetailledHelpExit() { String[][] info = VARNAConfigLoader.getParameterInfo(); System.out.println(getDescription()); printUsage(); printMainOptions(info); printAdvancedOptions(info); System.exit(1); } private void errorExit(String msg) { System.out.println(getDescription()); System.out.println("Error: " + msg + "\n"); printUsage(); printHelpOptions(); System.exit(1); } public String getParameterValue(String key, String def) { if (_optsValues.containsKey(key)) { return _optsValues.get(key); } return def; } public void run() throws IOException { VARNAConfigLoader VARNAcfg = new VARNAConfigLoader(this); ArrayList vpl; try { RNA r = new RNA(); if (!_inFile.equals("")) { r.loadSecStr(_inFile); } else { r.setRNA(this.getParameterValue("sequenceDBN", ""), this.getParameterValue( "structureDBN", "")); } VARNAcfg.setRNA(r); vpl = VARNAcfg.createVARNAPanels(); if (vpl.size() > 0) { VARNAPanel _vp = vpl.get(0); RNA _rna = _vp.getRNA(); Rectangle2D.Double bbox = _vp.getRNA().getBBox(); //System.out.println(_vp.getRNA().getBBox()); if (_outFile.toLowerCase().endsWith(".jpeg") || _outFile.toLowerCase().endsWith(".jpg") || _outFile.toLowerCase().endsWith(".png")) { _vp.setTitleFontSize((int)(_scale*_vp.getTitleFont().getSize())); _vp.setSize((int)(_baseWidth*_scale), (int)((_scale*_baseWidth*bbox.height)/((double)bbox.width))); } if (_outFile.toLowerCase().endsWith(".eps")) { _rna.saveRNAEPS(_outFile, _vp.getConfig()); } else if (_outFile.toLowerCase().endsWith(".xfig") || _outFile.toLowerCase().endsWith(".fig")) { _rna.saveRNAXFIG(_outFile, _vp.getConfig()); } else if (_outFile.toLowerCase().endsWith(".svg")) { _rna.saveRNASVG(_outFile, _vp.getConfig()); } else if (_outFile.toLowerCase().endsWith(".jpeg") || _outFile.toLowerCase().endsWith(".jpg")) { this.saveToJPEG(_outFile, _vp); } else if (_outFile.toLowerCase().endsWith(".png")) { this.saveToPNG(_outFile, _vp); } else if (_outFile.toLowerCase().endsWith(".varna")) { _vp.saveSession(_outFile); } else { errorExit("Unknown extension for output file \"" + _outFile + "\""); } } } catch (ExceptionWritingForbidden e) { e.printStackTrace(); System.exit(1); } catch (ExceptionJPEGEncoding e) { e.printStackTrace(); System.exit(1); } catch (ExceptionParameterError e) { e.printStackTrace(); System.exit(1); } catch (ExceptionModeleStyleBaseSyntaxError e) { e.printStackTrace(); System.exit(1); } catch (ExceptionNonEqualLength e) { e.printStackTrace(); System.exit(1); } catch (ExceptionUnmatchedClosingParentheses e) { e.printStackTrace(); System.exit(1); } catch (ExceptionExportFailed e) { e.printStackTrace(); System.exit(1); } catch (ExceptionPermissionDenied e) { e.printStackTrace(); System.exit(1); } catch (ExceptionLoadingFailed e) { e.printStackTrace(); System.exit(1); } catch (ExceptionFileFormatOrSyntax e) { e.setPath(_inFile); e.printStackTrace(); System.exit(1); } catch (FileNotFoundException e) { System.out.println("Error: Missing input file \""+_inFile+"\"."); System.exit(1); } System.exit(0); } public void saveToJPEG(String filename, VARNAPanel vp) throws ExceptionJPEGEncoding, ExceptionExportFailed { BufferedImage myImage = new BufferedImage((int) Math.round(vp .getWidth() ), (int) Math.round(vp.getHeight() ), BufferedImage.TYPE_INT_RGB); Graphics2D g2 = myImage.createGraphics(); vp.paintComponent(g2); try { FileImageOutputStream out = new FileImageOutputStream(new File(filename)); ImageWriter writer = ImageIO.getImageWritersByFormatName("jpeg").next(); ImageWriteParam params = writer.getDefaultWriteParam(); params.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); params.setCompressionQuality(_quality); writer.setOutput(out); IIOImage myIIOImage = new IIOImage(myImage, null, null); writer.write(null, myIIOImage, params); out.close(); } catch (IOException e) { throw new ExceptionExportFailed(e.getMessage(), filename); } } public void saveToPNG(String filename, VARNAPanel vp) throws ExceptionExportFailed { BufferedImage myImage = new BufferedImage((int) Math.round(vp .getWidth()), (int) Math.round(vp.getHeight() ), BufferedImage.TYPE_INT_RGB); Graphics2D g2 = myImage.createGraphics(); vp.paintComponent(g2); g2.dispose(); try { ImageIO.write(myImage, "PNG", new File(filename)); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] argv) { Vector opts = new Vector(); for (int i = 0; i < argv.length; i++) { opts.add(argv[i]); } VARNAcmd app = new VARNAcmd(opts); try { app.run(); } catch (IOException e) { e.printStackTrace(); } } } PK 4F> RNYgg9fr/orsay/lri/varna/applications/SuperpositionDemo$1.class1=3fr/orsay/lri/varna/applications/SuperpositionDemo$1java/lang/Objectjava/awt/event/ActionListenerthis$03Lfr/orsay/lri/varna/applications/SuperpositionDemo;6(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)VCode    ()VLineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/applications/SuperpositionDemo$1;actionPerformed(Ljava/awt/event/ActionEvent;)V 1fr/orsay/lri/varna/applications/SuperpositionDemo access$06(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)I   access$17(Lfr/orsay/lri/varna/applications/SuperpositionDemo;I)V " #$access$2T(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)Lfr/orsay/lri/varna/VARNAPanel; & '(getRNA&(I)Lfr/orsay/lri/varna/models/rna/RNA; *,+fr/orsay/lri/varna/VARNAPanel -.drawRNA&(Lfr/orsay/lri/varna/models/rna/RNA;)V 0 1$access$3 3 4onLayoutChangedeLjava/awt/event/ActionEvent; SourceFileSuperpositionDemo.javaEnclosingMethod ;RNAPanelDemoInit InnerClasses0  8 *+ *    N* * `p* !* * %)* /* * `p%)* 2*FMNN56789:< PK 4F>UV9fr/orsay/lri/varna/applications/SuperpositionDemo$2.class1_3fr/orsay/lri/varna/applications/SuperpositionDemo$2java/lang/Objectjava/awt/event/ActionListenerthis$03Lfr/orsay/lri/varna/applications/SuperpositionDemo;6(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)VCode    ()VLineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/applications/SuperpositionDemo$2;actionPerformed(Ljava/awt/event/ActionEvent;)V 1fr/orsay/lri/varna/applications/SuperpositionDemo access$06(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)I   access$17(Lfr/orsay/lri/varna/applications/SuperpositionDemo;I)V " #$ getStruct(I)Ljava/lang/String; &('%fr/orsay/lri/varna/models/rna/Mapping )*readMappingFromAlignmentM(Ljava/lang/String;Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/Mapping; , -.access$2T(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)Lfr/orsay/lri/varna/VARNAPanel; 0 12getRNA&(I)Lfr/orsay/lri/varna/models/rna/RNA; 465fr/orsay/lri/varna/VARNAPanel 78showRNAInterpolatedM(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/Mapping;)V : ;.access$3 = >onLayoutChanged @ A$getText 4C DEdrawRNAInterpolated'(Ljava/lang/String;Ljava/lang/String;)V GIH5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength JprintStackTrace 4L MrepaintO.fr/orsay/lri/varna/exceptions/MappingExceptioneLjava/awt/event/ActionEvent;m'Lfr/orsay/lri/varna/models/rna/Mapping;m2e30Lfr/orsay/lri/varna/exceptions/MappingException;e17Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength; SourceFileSuperpositionDemo.javaEnclosingMethod ]RNAPanelDemoInit InnerClasses0  8 *+ *    * * `p* * !* * `p!%M* * `p!* * !%N* +* * /,3* 9* * `p/-3* <2M* +* * ?* * !BN-F* +K* 9KNG>26VZs>PQ6dRSZ@TS.UVWXYZ[\^ PK 4F> Cs117fr/orsay/lri/varna/applications/SuperpositionDemo.class11fr/orsay/lri/varna/applications/SuperpositionDemojavax/swing/JFrame4fr/orsay/lri/varna/interfaces/InterfaceVARNAListenerserialVersionUIDJ ConstantValue͑gDEFAULT_SEQUENCE1Ljava/lang/String;*CGCGCACGCGAUAUUUCGCGUCGCGCAUUUGCGCGUAGCGCGDEFAULT_SEQUENCE2DEFAULT_STRUCTURE12(((((.(((((----....----))))).(((((....)))))..)))))DEFAULT_STRUCTURE22(((((.(((((((((....))))))))).--------------..))))) _vpMasterLfr/orsay/lri/varna/VARNAPanel;_vpSlave_toolsLjavax/swing/JPanel;_input _seqPanel _struct1Panel _struct2Panel_infoLjavax/swing/JLabel;_struct1Ljavax/swing/JTextField;_struct2_seq1_seq2 _struct1Label _struct2Label _seqLabel _goButtonLjavax/swing/JButton; _switchButton _str1Backup _str2Backup_RNA1#Lfr/orsay/lri/varna/models/rna/RNA;_RNA2errorOpt_errorZ_backgroundColorLjava/awt/Color; _algoCodeI_currentDisplay()VCode>error @ 2 LineNumberTableLocalVariableTable createStyleC(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;F-fr/orsay/lri/varna/models/rna/ModeleStyleBase EH I; EK LMassignParameters(Ljava/lang/String;)V OQPAfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError R;printStackTrace TQU5fr/orsay/lri/varna/exceptions/ExceptionParameterErrortxtresult/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;eCLfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError;7Lfr/orsay/lri/varna/exceptions/ExceptionParameterError;applyToS(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;[I)V _a`fr/orsay/lri/varna/VARNAPanel bcgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; egf!fr/orsay/lri/varna/models/rna/RNA hi getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; kml(fr/orsay/lri/varna/models/rna/ModeleBase no setStyleBase2(Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)V kq rsgetElementStructure()I _u v;repaintthis3Lfr/orsay/lri/varna/applications/SuperpositionDemo;vpmbindices[Iim*Lfr/orsay/lri/varna/models/rna/ModeleBase; Hjavax/swing/JPanel H          javax/swing/JLabel H  !javax/swing/JTextField IM  "#  $#  %#  &# Str1:  '! Str2:  (! Seq:  )!javax/swing/JButtonGo  *+Switch  ,+  -  . eH  /0  10 java/awt/Color 6white  56  98  getText1()Ljava/lang/String;   getStruct1 _ I'(Ljava/lang/String;Ljava/lang/String;)V    getText2   getStruct2   _  errorDialog(Ljava/lang/Exception;)Vjava/awt/Dimension I(II)V _ setPreferredSize(Ljava/awt/Dimension;)V  ;RNAPanelDemoInit5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;   setBackground(Ljava/awt/Color;)V _ _ addVARNAListener9(Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;)V#F0F0F0 decode$(Ljava/lang/String;)Ljava/awt/Color;  b&(I)Lfr/orsay/lri/varna/models/rna/RNA; _ drawRNA&(Lfr/orsay/lri/varna/models/rna/RNA;)V MonoSpaced-PLAIN-12     java/awt/Font #(Ljava/lang/String;)Ljava/awt/Font;  setHorizontalTextPosition(I)V  setFont(Ljava/awt/Font;)V  cgetRNA1 e getSeq   MsetText " #cgetRNA2%3fr/orsay/lri/varna/applications/SuperpositionDemo$1 $' I(6(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)V * +,addActionListener"(Ljava/awt/event/ActionListener;)V.3fr/orsay/lri/varna/applications/SuperpositionDemo$2 -'1java/awt/BorderLayout 0H 4 56 setLayout(Ljava/awt/LayoutManager;)V8West : ;<add)(Ljava/awt/Component;Ljava/lang/Object;)V>Center@java/awt/GridLayout ? C ;D*(Ljava/awt/Component;)Ljava/awt/Component;FSouthHEast J KLgetContentPane()Ljava/awt/Container; N4Ojava/awt/Container N: R ST setVisible(Z)V _V WX getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; Z\[fr/orsay/lri/varna/views/VueUI ]; UIRadiate _ `;onLayoutChanged marginToolstextFieldsFontLjava/awt/Font;goPanelVARNAs getMasterRNA getSlaveRNA1 getSlaveRNA2 jlkjava/lang/String mnequals(Ljava/lang/Object;)Z ep qsetRNA _s ts getDrawMode _v wx getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; ez {+(ILfr/orsay/lri/varna/models/VARNAConfig;)V }Q~Bfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses Q7fr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithm9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntaxDLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;e1;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;9Lfr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithm;getText(I)Ljava/lang/String; getStruct     cleanStruct&(Ljava/lang/String;)Ljava/lang/String;[:-] j  replaceAll8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;structgetParameterInfo()[[Ljava/lang/String;[Ljava/lang/String; sequenceDBNStringA raw RNA sequence structureDBN.An RNA structure in dot bracket notation (DBN)booleanTo show errorsinfo[[Ljava/lang/String;init  34 getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color;  getColorjava/lang/ExceptioncoldefLjava/lang/Exception;e2get_varnaPanel!()Lfr/orsay/lri/varna/VARNAPanel;set_varnaPanel"(Lfr/orsay/lri/varna/VARNAPanel;)Vsurface get_struct()Ljavax/swing/JTextField; set_struct(Ljavax/swing/JTextField;)V_structget_info()Ljavax/swing/JLabel;set_info(Ljavax/swing/JLabel;)Vmain([Ljava/lang/String;)V H  setDefaultCloseOperation  ;packargsd   %fr/orsay/lri/varna/models/rna/Mapping readMappingFromAlignmentM(Ljava/lang/String;Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/Mapping; 4fr/orsay/lri/varna/controlers/ControleurInterpolator moveNearOtherRNAp(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/Mapping;)V java/lang/System outLjava/io/PrintStream; .fr/orsay/lri/varna/exceptions/MappingException toString java/io/PrintStream Mprintln'Lfr/orsay/lri/varna/models/rna/Mapping;e30Lfr/orsay/lri/varna/exceptions/MappingException;onWarningEmittedsonLoadpathonLoadedonUINewStructureM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)Vv'Lfr/orsay/lri/varna/models/VARNAConfig;raccess$06(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)Iaccess$17(Lfr/orsay/lri/varna/applications/SuperpositionDemo;I)Vaccess$2T(Lfr/orsay/lri/varna/applications/SuperpositionDemo;)Lfr/orsay/lri/varna/VARNAPanel;access$3 SourceFileSuperpositionDemo.java InnerClasses!           !"#$#%#&#'!(!)!*+,+- . /010 2 34567898%:;<*=?A ]4B CD<EYGL+*JM,NM,S+ O TAjlmoprtB*V WXYZY[\]<A62+^-.d:,jp+^pd,j-+tA"y{|}"2y<@B>AwxAyAzXA{|9}8~I;<4**Y*Y*Y*Y*Y*Y*Y*Y*Y*Y*Y*Y*Y*Y*Y***eY*eY*µ**_Y**Ϸҵ*_Y**ڷҵݧ L*+*ջY*AvGHJ%K0L;MFNSO`PmQzRSTUVXYZ[af/3B4wxY;<{(<**Ƕ**Ƕ******p***`p M**Y*,***,**!*$Y*&)*-Y*/)*0Y23**79**=9*Y**,*0Y23**79**=9*Y**,*0Y23**79**=9*?YA3**BW**BW**BWYN-0Y23*0Y23**=9**E9*-G9-*=9-*E9*I0Y2MY:?YA3*նBW*ݶBW*I=P*I*EP*Q*նUY*ݶUY*^A7 *;NU]nv->FN\jx !/9CO]blv z B4{wxxa8U&bcd!Zefc<3 **ɶAB  wxgc<7 **`pAB  wxhc<7 **`pAB  wxb<J**!A !Bwx}8c<[**϶iK***϶o**նr*նuyL+|L*+ߧL+**ϵ*25}2=2IA. &()5*6+=,>-I.J0N2V4B*[wx6Y>JY#c<[**ڶiK***ڶo**նr*նuyL+|L*+ߧL+**ڵ*25}2=2IA. 8:;5<6==>>?I@JBNDVFB*[wx6Y>JY<7AKBwx}8<P **APQ SBwx}8<2*AYB wx<2*A^B wx<6 **AbB  wx<6 **AfB  wx<D +L+A j kB wx  <RYjYSYSYSSYjYSYSYSSYjY?SYSYSSL+A"oqr%r1s8tOoPuBRwxP;<C**Ƕ*Ay z{B wx<+N:+,N:,- A BRwx 6W6W6W6 Y</*հAB wx<>*+ձA Bwx</*AB wx<>*+A Bwx#</*AB wx<>*+A Bwx ! <[YL+++QA Bx`;<Q**`p**pӸL**p**`p+*ݶt*նtL+BEA4;EPB Qwx+~F M<5ABwx M<5ABwx ;<+AB wx<?AB wx0<%*ɬAfB<&*ɱAfB<%*հADB<%*ݰAEB$-PK VC>/|VK6K66fr/orsay/lri/varna/applications/SuperpositionDemo.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.applications; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurInterpolator; import fr.orsay.lri.varna.exceptions.ExceptionDrawingAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionModeleStyleBaseSyntaxError; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionParameterError; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.exceptions.MappingException; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.Mapping; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleStyleBase; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;; public class SuperpositionDemo extends JFrame implements InterfaceVARNAListener { /** * */ private static final long serialVersionUID = -790155708306987257L; private static final String DEFAULT_SEQUENCE1 = "CGCGCACGCGAUAUUUCGCGUCGCGCAUUUGCGCGUAGCGCG"; private static final String DEFAULT_SEQUENCE2 = "CGCGCACGCGAUAUUUCGCGUCGCGCAUUUGCGCGUAGCGCG"; private static final String DEFAULT_STRUCTURE1 = "(((((.(((((----....----))))).(((((....)))))..)))))"; private static final String DEFAULT_STRUCTURE2 = "(((((.(((((((((....))))))))).--------------..)))))"; // private static final String DEFAULT_STRUCTURE1 = "((((....))))"; // private static final String DEFAULT_STRUCTURE2 = // "((((..(((....)))..))))"; private VARNAPanel _vpMaster; private VARNAPanel _vpSlave; private JPanel _tools = new JPanel(); private JPanel _input = new JPanel(); private JPanel _seqPanel = new JPanel(); private JPanel _struct1Panel = new JPanel(); private JPanel _struct2Panel = new JPanel(); private JLabel _info = new JLabel(); private JTextField _struct1 = new JTextField(DEFAULT_STRUCTURE1); private JTextField _struct2 = new JTextField(DEFAULT_STRUCTURE2); private JTextField _seq1 = new JTextField(DEFAULT_SEQUENCE1); private JTextField _seq2 = new JTextField(DEFAULT_SEQUENCE2); private JLabel _struct1Label = new JLabel(" Str1:"); private JLabel _struct2Label = new JLabel(" Str2:"); private JLabel _seqLabel = new JLabel(" Seq:"); private JButton _goButton = new JButton("Go"); private JButton _switchButton = new JButton("Switch"); private String _str1Backup = ""; private String _str2Backup = ""; private RNA _RNA1 = new RNA(); private RNA _RNA2 = new RNA(); private static String errorOpt = "error"; @SuppressWarnings("unused") private boolean _error; private Color _backgroundColor = Color.white; @SuppressWarnings("unused") private int _algoCode; private int _currentDisplay = 1; public static ModeleStyleBase createStyle(String txt) { ModeleStyleBase result = new ModeleStyleBase(); try { result.assignParameters(txt); } catch (ExceptionModeleStyleBaseSyntaxError e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ExceptionParameterError e) { // TODO Auto-generated catch block e.printStackTrace(); } return result; } public void applyTo(VARNAPanel vp, ModeleStyleBase mb, int[] indices) { for(int i=0;i/fr/orsay/lri/varna/applications/templateEditor/PK 4F>BYfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAddTemplateEdit.class19Sfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAddTemplateEdit%javax/swing/undo/AbstractUndoableEdit_hILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;_p>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)VCode  ()V    LineNumberTableLocalVariableTablethisULfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAddTemplateEdit;hpundo Exceptions$javax/swing/undo/CannotUndoException  <. . \fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAttachTemplateEdit.class1OVfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAttachTemplateEdit%javax/swing/undo/AbstractUndoableEdit_c;Lfr/orsay/lri/varna/applications/templateEditor/Connection;_p>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;|(Lfr/orsay/lri/varna/applications/templateEditor/Connection;Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)VCode  ()V    LineNumberTableLocalVariableTablethisXLfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAttachTemplateEdit;cpundo Exceptions$javax/swing/undo/CannotUndoException  (Lfr/orsay/lri/varna/applications/templateEditor/Connection;)V $ %repaintredo($javax/swing/undo/CannotRedoException *,+9fr/orsay/lri/varna/applications/templateEditor/Connection -._h1ILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement; *0 12_edge1ZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; *4 5._h2 *7 82_edge2 : ;< addConnection(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Connection;canUndo()ZcanRedogetPresentationName()Ljava/lang/String;CGraphical elements attached SourceFileTemplateEdits.java InnerClassesHXfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePositionJGfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElementRelativePositionM ?@  E***#B CD &' a/***)*/*3*69*#F'G.H /=> ,I ?> ,J @A -BK DEFGIK@LN PK 4F>#. . \fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementDetachTemplateEdit.class1OVfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementDetachTemplateEdit%javax/swing/undo/AbstractUndoableEdit_c;Lfr/orsay/lri/varna/applications/templateEditor/Connection;_p>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;|(Lfr/orsay/lri/varna/applications/templateEditor/Connection;Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)VCode  ()V    LineNumberTableLocalVariableTablethisXLfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementDetachTemplateEdit;cpundo Exceptions$javax/swing/undo/CannotUndoException  9fr/orsay/lri/varna/applications/templateEditor/Connection !"_h1ILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement; $ %&_edge1ZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; ( )"_h2 + ,&_edge2 .0/(Lfr/orsay/lri/varna/applications/templateEditor/Connection;)VcanUndo()ZcanRedogetPresentationName()Ljava/lang/String;CGraphical elements detached SourceFileTemplateEdits.java InnerClassesHXfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePositionJGfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElementRelativePositionM ,_ ?> ,` @A -Ba DEFGIK@LN PK 4F>4J? ? ^fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementEdgeMoveTemplateEdit.class1Xfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementEdgeMoveTemplateEdit%javax/swing/undo/AbstractUndoableEdit_urILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;_edgeZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;_oxD_oy_nx_ny_p>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;DDLfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)VCode  ()V     Gfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement getEdgePositionz(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Ljava/awt/geom/Point2D$Double; !#"java/awt/geom/Point2D$Double $ x & !( ) y + - / 1 LineNumberTableLocalVariableTablethisZLfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementEdgeMoveTemplateEdit;uredgenxnypundo Exceptions>$javax/swing/undo/CannotUndoException !@ A(DD)V C DEsetEdgePosition{(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Ljava/awt/geom/Point2D$Double;)V GIH845868788 89 8:;<=T"**!Y*%**?B*0F2xy!z3 "45K<LT"**!Y*,*.?B*0F2|}!~3 "45NO,23 45PO,23 45QR>SYUW*Z^23 45ab"++M,*z!Y*%**?N!Y*,*.?:!Y,%,*?:!Y,,,.?:*,,c"-gk*,,,*,..22  '8IZ|3H45mn o5'gpq8VrqIEsqZ4tquvwxz@{} !~ PK 4F>$9E\fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementRemoveTemplateEdit.class19Vfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementRemoveTemplateEdit%javax/swing/undo/AbstractUndoableEdit_hILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;_p>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)VCode  ()V    LineNumberTableLocalVariableTablethisXLfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementRemoveTemplateEdit;hpundo Exceptions$javax/swing/undo/CannotUndoException  *IIXfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$HelixFlipTemplateEdit.class17Rfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$HelixFlipTemplateEdit%javax/swing/undo/AbstractUndoableEdit_h6Lfr/orsay/lri/varna/applications/templateEditor/Helix;_p>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;w(Lfr/orsay/lri/varna/applications/templateEditor/Helix;Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)VCode  ()V    LineNumberTableLocalVariableTablethisTLfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$HelixFlipTemplateEdit;hpundo Exceptions$javax/swing/undo/CannotUndoException  4fr/orsay/lri/varna/applications/templateEditor/Helix ! toggleFlipped #%$XЯBfr/orsay/lri/varna/applications/templateEditor/TemplateEdits.class1(()VCode  LineNumberTableLocalVariableTablethis>Lfr/orsay/lri/varna/applications/templateEditor/TemplateEdits; SourceFileTemplateEdits.java InnerClassesSfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAddTemplateEditElementAddTemplateEditVfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAttachTemplateEditElementAttachTemplateEditVfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementDetachTemplateEditElementDetachTemplateEdit Xfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementEdgeMoveTemplateEditElementEdgeMoveTemplateEdit#Vfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementRemoveTemplateEditElementRemoveTemplateEdit&Rfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$HelixFlipTemplateEditHelixFlipTemplateEdit!  /*   2   ! "$ %' PK ,)i?m6m6Cfr/orsay/lri/varna/applications/templateEditor/TemplateEditor.class1=fr/orsay/lri/varna/applications/templateEditor/TemplateEditorjavax/swing/JFramejava/awt/event/KeyListenerjava/awt/event/ActionListener java/awt/dnd/DropTargetListener_sk>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;_vpLfr/orsay/lri/varna/VARNAPanel;currentFilePathLjava/io/File; saveButtonLjavax/swing/JButton;managerLjavax/swing/undo/UndoManager;serialVersionUIDJ ConstantValue.u()VCodeVARNA Template Editor: New file  !(Ljava/lang/String;)V # $initLineNumberTableLocalVariableTablethis?Lfr/orsay/lri/varna/applications/templateEditor/TemplateEditor;*fr/orsay/lri/varna/VARNAPanel, .. )0 1'(Ljava/lang/String;Ljava/lang/String;)V 3  5765fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength 8printStackTrace ): ;< setNumPeriod(I)V>javax/swing/JPanel =@ Bjava/awt/GridLayout AD E(II)V =G HI setLayout(Ljava/awt/LayoutManager;)VKjavax/swing/JToolBar J@Njavax/swing/JButtonPOpen...RFileView.directoryIcon TVUjavax/swing/UIManager WXgetIcon&(Ljava/lang/Object;)Ljavax/swing/Icon; MZ ['(Ljava/lang/String;Ljavax/swing/Icon;)V]open M_ `!setActionCommand Mb cdaddActionListener"(Ljava/awt/event/ActionListener;)V Mf ghaddKeyListener(Ljava/awt/event/KeyListener;)VjSavelFileView.floppyDriveIcon n psave Mr st setEnabled(Z)Vv Save As...xsave aszUndo M }undoRedoredojava/lang/Stringno helix length adjustmentmax increase factormin non-intersect factorhelix translatejava/lang/StringBuilderApply ( append-(Ljava/lang/String;)Ljava/lang/StringBuilder;) toString()Ljava/lang/String;apply (I)Ljava/lang/StringBuilder;Flipflip J add*(Ljava/awt/Component;)Ljava/awt/Component; J  addSeparator Jfjavax/swing/ButtonGroup @ J <setOrientationjavax/swing/JToggleButtonSelect select _ b fHelixhelixUnpairedunpaired (Ljavax/swing/AbstractButton;)Vjava/awt/BorderLayout @ G=java/lang/System ?@outLjava/io/PrintStream; BDCjava/io/PrintStream EFprintln(Ljava/lang/Object;)V HJIjava/awt/event/KeyEvent KL getKeyCode()I N OP getSelectedK()Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement; R SUnselect U VW getTemplateUIH()Lfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI; Y[ZDfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI \]removeElementUIL(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;)V _ `repaint Hb c isControlDown e } g Ljava/awt/event/KeyEvent;hILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement; l mcanUndooUndo: q rgetUndoPresentationName Bt E! e w xcanRedozRedo: | }getRedoPresentationName g keyReleasedkeyTypedactionPerformed(Ljava/awt/event/ActionEvent;)V java/awt/event/ActionEvent getActionCommand  equals(Ljava/lang/Object;)Z4fr/orsay/lri/varna/applications/templateEditor/Helix Y  flipHelixUI9(Lfr/orsay/lri/varna/applications/templateEditor/Helix;)V   startsWith(Ljava/lang/String;)Z  Llength   substring(I)Ljava/lang/String; java/lang/Integer parseInt(Ljava/lang/String;)I ) getRNA%()Lfr/orsay/lri/varna/models/rna/RNA;   getTemplate3()Lfr/orsay/lri/varna/models/templates/RNATemplate; !fr/orsay/lri/varna/models/rna/RNA drawRNATemplatel(Lfr/orsay/lri/varna/models/templates/RNATemplate;I)Lfr/orsay/lri/varna/models/templates/RNATemplateMapping; 6fr/orsay/lri/varna/models/templates/RNATemplateMapping getSourceElemsAsSet()Ljava/util/Set;  java/util/Set iterator()Ljava/util/Iterator; java/util/Iterator next()Ljava/lang/Object;  LintValue   getPartnerG(I)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;   getElement(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement; Gfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement getDominantColor()Ljava/awt/Color;   getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; (fr/orsay/lri/varna/models/rna/ModeleBase  getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase; -fr/orsay/lri/varna/models/rna/ModeleStyleBase set_base_inner_color(Ljava/awt/Color;)V  hasNext )_ 7Hfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException   getMessage Template-based RNA drawing error javax/swing/JOptionPane showMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V   /fr/orsay/lri/varna/models/templates/RNATemplate " toXMLFileTemplate saved in  java/io/File 74fr/orsay/lri/varna/exceptions/ExceptionXMLGeneration 79fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate javax/swing/JFileChooser @ 7fr/orsay/lri/varna/applications/FileNameExtensionFilterVARNA RNA template (.xml)xml  0   setFileFilter'(Ljavax/swing/filechooser/FileFilter;)V  showSaveDialog(Ljava/awt/Component;)I  getSelectedFile  getAbsolutePath ! " toLowerCase$.xml & 'endsWith ) *+valueOf&(Ljava/lang/Object;)Ljava/lang/String;  . !" 0 1showOpenDialog 3 4"loadFromXmlFile 6 7discardAllEditsLjava/awt/event/ActionEvent;grmethodmap8Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;tDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;cLjava/awt/Color;e1JLfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException;6Lfr/orsay/lri/varna/exceptions/ExceptionXMLGeneration;;Lfr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate;chooserLjavax/swing/JFileChooser;filter$Ljavax/swing/filechooser/FileFilter;pathLjava/lang/String; templatePath dragEnter%(Ljava/awt/dnd/DropTargetDragEvent;)Varg0"Ljava/awt/dnd/DropTargetDragEvent;dragExit!(Ljava/awt/dnd/DropTargetEvent;)VLjava/awt/dnd/DropTargetEvent;dragOverdrop%(Ljava/awt/dnd/DropTargetDropEvent;)V WYX java/awt/dnd/DropTargetDropEvent Z[getTransferable&()Ljava/awt/datatransfer/Transferable; ]_^"java/awt/datatransfer/Transferable `agetTransferDataFlavors%()[Ljava/awt/datatransfer/DataFlavor; ced java/awt/datatransfer/DataFlavor fisFlavorJavaFileListType Wh i< acceptDrop ]k lmgetTransferData6(Ljava/awt/datatransfer/DataFlavor;)Ljava/lang/Object;ojava/util/List nq rsget(I)Ljava/lang/Object; Wu v getSource x yz getComponent()Ljava/awt/Component; |}java/lang/Object ) loadFile(Ljava/lang/String;Z)V n Lsize W t dropComplete W  rejectDrop 7java/lang/Exceptiondtde"Ljava/awt/dnd/DropTargetDropEvent;tr$Ljava/awt/datatransfer/Transferable;flavors#[Ljava/awt/datatransfer/DataFlavor;listLjava/util/List;joLjava/lang/Object;dtLjava/awt/dnd/DropTarget;Ljava/awt/Component;vpskLjava/lang/Exception;dropActionChanged SourceFileTemplateEditor.java InnerClassesBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementRNATemplateElement!   = **"%>? @&  '($=*)Y+-/2L+4*29=Y?L+AYCFJYLMMYOQSYN-\^-*a-*e*MYikSYm*mo^*m*a*m*e*mqMYukSY:w^*a*eMYy{:|^*a*eMY~{:^*a*eM:YSYSYSYS:6 V MYY 2{S 2Y ^ 2*a 2*e  MY{:  ^ *a *e,-W,*mW,W,,W,W,, W,6 , 2W  ,*JYL: Y:  Y:   * *Y:   * *Y:¶**       W  W W,**Yɶ*Y͵*λY XҶ*Yٵ*ж**ڶ**Y* :+W+*2W*,* *+***2****ζW5%v]HIJLM'N4P<QKRQSVT[UmVvW~XYZ[\]^_`abcdefg hi8jQkZlchnoypqruvwxyz{|}~~ $+17BIOU\cjrz)4<&='('<K   c J  0^ y  Q H 7 $ BS/*%& '(!"c#*+*mq*Y#+%(% "&#'(# +,[Y-L+.+1+4% &78(9:j;+A+G^YSZE!*ζMM*ζQ*ζT,X*ζ^+a*d+a*f%6 ,4;FMPW[^ei& j'(jh4ij}e/*ڶk';Yn*ڶps*ڶu% '.& /'(e/*ڶv';Yy*ڶ{s*ڶ~% '.& /'(:@;+A% &'(h:@;+A% &'(h@+| *d/+ *f+'*ζMM,,*ζT,+++d=*2*ζN-:<6-:*ʶ:*2Զ*2^M,*,J+oA*ζ*;Y*sM,M,+wY M Y N,-,*ζ,: #%Y(#:*ζY,;Ys*Y,-e:[:Q+\EY M Y N,-,*ζ/,:*2*-*ڶ5b/2/:%5   &2:>EVbv !"$%&'*-.2/30:1;2B5N7V8d9i:t;}<=@ABCDEFJLMNO#P)Q2R8U?Y&@'(@8:9jvn:[;<*"=>?@AB3AC;ADVEFdGH}qIJACAD:EF,GH)KLM5%]&'(NOPQ5%`&'(NRSM5%c&'(NOTU +VM,\N6-2b+g,-2jn:6zp:+tb+t:w:  )! ): {:   ~ , ˙$ : {:  Y ,2 ^+-L+ M,+%zij kmo!p0q6sAtKvTw[xczj{q|y}qk&'( 03AiTV[O? j qIJ  IJ M5%&'(NO PK >4(;//Bfr/orsay/lri/varna/applications/templateEditor/TemplateEditor.javapackage fr.orsay.lri.varna.applications.templateEditor; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.ComponentOrientation; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JToggleButton; import javax.swing.JToolBar; import javax.swing.UIManager; import javax.swing.filechooser.FileFilter; import javax.swing.undo.UndoManager; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.applications.FileNameExtensionFilter; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionXMLGeneration; import fr.orsay.lri.varna.models.templates.RNATemplateDrawingAlgorithmException; import fr.orsay.lri.varna.models.templates.RNATemplateMapping; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement; public class TemplateEditor extends JFrame implements KeyListener, ActionListener,DropTargetListener { private TemplatePanel _sk; private VARNAPanel _vp; private File currentFilePath; private JButton saveButton; public TemplateEditor() { super("VARNA Template Editor: New file"); init(); } private UndoManager manager; private void init() { try { _vp = new VARNAPanel(" ","."); } catch (ExceptionNonEqualLength e) { e.printStackTrace(); } _vp.setNumPeriod(0); JPanel p = new JPanel(); p.setLayout(new GridLayout(1,2)); JToolBar systemBar = new JToolBar(); JButton loadButton = new JButton("Open...",UIManager.getIcon("FileView.directoryIcon")); loadButton.setActionCommand("open"); loadButton.addActionListener(this); loadButton.addKeyListener(this); saveButton = new JButton("Save",UIManager.getIcon("FileView.floppyDriveIcon")); saveButton.setActionCommand("save"); saveButton.addActionListener(this); saveButton.addKeyListener(this); saveButton.setEnabled(false); JButton saveAsButton = new JButton("Save As...",UIManager.getIcon("FileView.floppyDriveIcon")); saveAsButton.setActionCommand("save as"); saveAsButton.addActionListener(this); saveAsButton.addKeyListener(this); JButton undoButton = new JButton("Undo"); undoButton.setActionCommand("undo"); undoButton.addActionListener(this); undoButton.addKeyListener(this); JButton redoButton = new JButton("Redo"); redoButton.setActionCommand("redo"); redoButton.addActionListener(this); redoButton.addKeyListener(this); JButton applyButtons[] = new JButton[4]; String applyMethods[] = {"no helix length adjustment", "max increase factor", "min non-intersect factor", "helix translate"}; for (int i=0; iȕXXBfr/orsay/lri/varna/applications/templateEditor/TemplatePanel.class1;_RNAConnectionsRLjava/util/ArrayList;_helixToConnectionLjava/util/Hashtable;.Ljava/util/Hashtable;Lfr/orsay/lri/varna/applications/templateEditor/Connection;>;_uiFLfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI; _template1Lfr/orsay/lri/varna/models/templates/RNATemplate;BackgroundColors[Ljava/awt/Color;_nextBackgroundColorI _selectedILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;_relposZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; _mousePosLjava/awt/geom/Point2D$Double;_colors CYCLE_COLORLjava/awt/Color;NON_EXISTANT_COLOR CONTROL_COLORBACKGROUND_COLOR _solidStrokeLjava/awt/Stroke; _dashedStroke()VCode.java/awt/Color -0 1#blue -3 4#red -6 7#cyan -9 :#green -< =# lightGray -? @#magenta -B C#PINK E  -G H#gray -J K#pink -M N#RED -P Q#orange S ! U "# -W XYbrighter()Ljava/awt/Color; [ $# -] ^Ydarker ` %# -b c#white e &#LineNumberTableLocalVariableTablenextBackgroundColor j  -l mngetRed()I -p qngetBlue -s tngetGreen -v wx(IIII)Vthis>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;c } w+   Xfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition RP_OUTER  java/awt/geom/Point2D$Double }    +init getTemplate3()Lfr/orsay/lri/varna/models/templates/RNATemplate;  getRNAComponents()Ljava/util/List;]()Ljava/util/List;  Dfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI wA(Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)V  java/util/ArrayList }   java/util/Hashtable }  /fr/orsay/lri/varna/models/templates/RNATemplate } - #WHITE   setBackground(Ljava/awt/Color;)V=fr/orsay/lri/varna/applications/templateEditor/MouseControler w(Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;Lfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI;)V  addMouseListener!(Ljava/awt/event/MouseListener;)V  addMouseMotionListener'(Ljava/awt/event/MouseMotionListener;)Vjava/awt/BasicStroke?@@ w(FIIF)V  '(@ w (FIIF[FF)V  )(mc?Lfr/orsay/lri/varna/applications/templateEditor/MouseControler;dash[FaddUndoableEditListener!(Ljavax/swing/undo/UndoManager;)V managerLjavax/swing/undo/UndoManager; getTemplateUIH()Lfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI;flip9(Lfr/orsay/lri/varna/applications/templateEditor/Helix;)V 4fr/orsay/lri/varna/applications/templateEditor/Helix + toggleFlippedh6Lfr/orsay/lri/varna/applications/templateEditor/Helix; addElementL(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;)V add(Ljava/lang/Object;)Z removeElement remove Gfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement getTemplateElementF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; G(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Z9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate getSelectedK()Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement; setSelectedselsetSelectedEdge](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Vrel unselectEdge setPointerPos!(Ljava/awt/geom/Point2D$Double;)VpUnselect getElement(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;    iterator()Ljava/util/Iterator;   java/util/Iterator next()Ljava/lang/Object;   hasNext()ZtDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;t2 getElementAtM(II)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;  (IILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;xy  !"get(I)Ljava/lang/Object; $ %&getRelativePosition^(DD)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; ( )RP_CONNECT_END3 + ,RP_CONNECT_END5 . /RP_CONNECT_START3 1 2RP_CONNECT_START5 4 5nsize 7 8getElementCloseToexcludedih2 addConnection>(Lfr/orsay/lri/varna/applications/templateEditor/Connection;)V?5fr/orsay/lri/varna/applications/templateEditor/Couple ACB9fr/orsay/lri/varna/applications/templateEditor/Connection D_h1 AF G_edge1 >I wJ'(Ljava/lang/Object;Ljava/lang/Object;)V L MNput8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; AP Q_h2 AS T_edge2 V WXattach(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V Z\[java/lang/System ]^outLjava/io/PrintStream; ` abtoString()Ljava/lang/String; dfejava/io/PrintStream ghprintln(Ljava/lang/String;)V;Lfr/orsay/lri/varna/applications/templateEditor/Connection;e;Lfr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate;(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Connection; n op getPartner(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Couple; Ar wsI(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V u <=h1edge1edge2addGraphicalConnection { |XgraphicalAttachremoveConnection  &(Ljava/lang/Object;)Ljava/lang/Object;java/lang/StringBuilder[A]  wh  append-(Ljava/lang/Object;)Ljava/lang/StringBuilder; `  detach isInCycle(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Zjava/util/Stack }   pop   containsKeyjava/lang/Integer  w(I)V > firstLjava/lang/Object; > second  getConnectedEdge(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;  push  emptyeledgeLjava/util/Stack; alreadySeenc27Lfr/orsay/lri/varna/applications/templateEditor/Couple;otherEndchildLocalVariableTypeTableLjava/util/Stack;>;Ljava/util/Hashtable;Ljava/lang/Integer;>;Lfr/orsay/lri/varna/applications/templateEditor/Couple;getIndexedColor(I)Ljava/awt/Color;nbuildConnectedComponents()Ljava/util/HashMap;()Ljava/util/HashMap;Ljava/lang/Integer;>;java/util/HashMap }  getConnectedEdges()Ljava/util/ArrayList;      setMainColorm(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Ljava/awt/Color;)V LLjava/util/HashMap;numConnectedComponentsLjava/util/HashMap;Ljava/lang/Integer;>;>(Lfr/orsay/lri/varna/applications/templateEditor/Connection;)Z  (Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Couple;   getConnection(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Connection;  !target isConnected(Lfr/orsay/lri/varna/applications/templateEditor/Helix;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)ZpartnerdrawConnectionsS(Ljava/awt/Graphics2D;Lfr/orsay/lri/varna/applications/templateEditor/Connection;)V  getEdgePositionz(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Ljava/awt/geom/Point2D$Double;   java/awt/Graphics2D setColor  #BACKBONE_COLOR  D    xdrawLineg2dLjava/awt/Graphics2D;p1p2paintComponent(Ljava/awt/Graphics;)V  +rescale java/awt/RenderingHints  KEY_ANTIALIASINGLjava/awt/RenderingHints$Key;   VALUE_ANTIALIAS_ON  setRenderingHint2(Ljava/awt/RenderingHints$Key;Ljava/lang/Object;)V  + removeAll       setStroke(Ljava/awt/Stroke;)V     YgetDominantColor " #$getArea()Ljava/awt/Shape; & '(fill(Ljava/awt/Shape;)V * +,draw(Ljava/awt/Graphics2D;Z)VgLjava/awt/Graphics;elem 1 23getBoundingPolygon()Ljava/awt/Polygon; 576java/awt/Polygon 89 getBounds()Ljava/awt/Rectangle; ;=<java/awt/Rectangle  ?A@java/lang/Math BCmin(II)I ;E Fwidth ?H ICmax ;K  ;M Nheight P QR translate(DD)VTjava/awt/Dimension SV wW(II)V Y Z[setPreferredSize(Ljava/awt/Dimension;)V ] ^+ revalidateminXmaxXminYmaxYLjava/awt/Polygon;rLjava/awt/Rectangle; loadTemplate4(Lfr/orsay/lri/varna/models/templates/RNATemplate;)V i j+clear i m n classicIteratorpBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementr@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix t wuE(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;)V w hY y zsetDominantColor |L} java/util/MapKfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence=fr/orsay/lri/varna/applications/templateEditor/UnpairedRegion  wP(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;)V y   makeEdgeList java/util/ListOfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint  getOtherEndPointS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;   |   getPositionH()Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;  (relativePositionFromEdgeEndPointPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;  ys  +repainttemplatemapLjava/util/Map;iterLjava/util/Iterator;templateElement templateHelixBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;graphicalHelixtemplateSequenceMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;graphicalSequence?Lfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion;v1QLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;v2gte1gte2rp1rp2Ljava/util/Map;ZLjava/util/Iterator;gLjava/util/Iterator;loadFromXmlFile(Ljava/io/File;)V   fromXMLFileA(Ljava/io/File;)Lfr/orsay/lri/varna/models/templates/RNATemplate;  fg 1fr/orsay/lri/varna/exceptions/ExceptionXmlLoading +printStackTrace  b getMessageTemplate loading error javax/swing/JOptionPane showMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)VfilenameLjava/io/File; newTemplate3Lfr/orsay/lri/varna/exceptions/ExceptionXmlLoading; SourceFileTemplatePanel.java InnerClassesRelativePositionDfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPositionEdgeEndPointPositionRNATemplateElement EdgeEndPointRNATemplateHelixRNATemplateUnpairedSequencejava/awt/RenderingHints$KeyKeyjava/awt/geom/Point2DDouble!        !"#$#%#&#'()(&*+,~-Y/SY2SY5SY8SY;SY>SYASD-YFSYISY5SYLSY8SYOSR2TFVZF\_adf<35_enw}-ghY,o3D*YiZ`i2L*YiDpi-Y+k+o+r2ufBCDg3yz#{#w+,g%*|*i*~**Y*fG>  I$Jg %yz,/*fNg yz ,/*fRg yz+, *Y**Y*Y*Y*Y*Y**L*+*+*Y÷ĵYQYQM*Y, ʵͱf6 W YZ"[-]8_?`LaQbVcgduefg yzL=u,A *+ձf jkg yz ,/*fog yz,=+ݱf uvgyz,B *+Wf z {g yz ,b*+W*+WM f gyz,/*~fg yz,>*+~f gyz,>*+f gyz,>*+f gyz,>*+f gyz +,4*~f g yz,x**N- M+,,-f(g *yz* ,F*fg yz,}:6Z*:#'0#*!#-#0 -:*3 *-6:f6  &5DSY]lqzgH}yz}}}9zf:F;8,F*6fg yz8,B:6-*:# -:*3f" &,0?gHByzBBB9?9:;<=,n*+W*>Y+@+EH+KW*>Y+O+RH+KW+@+O+E+RU+O+@+R+EUMY,_c9_bf" !9Lbcmg nyzn{ic jk<l,1+--*+,m$*-mAY+,-q:*tf&,/g>1yz1v1w1;1x& {iys,}AY+,-q:*W*>Y@EHKW*>YORHKW@OERzO@REzf3Ne|g>}yz}v}w};}xo{i}=,Z*+W*>Y+@+EH~W*>Y+O+RH~WYY+c+@+Ef   7 NYgZyzZ{i, YNY:->Y+,HW->:YKW:>YH: -W%*m: -W-yfF"+57G!\"o#y%)*,2g\ yz+z\Io6 4+zo6  ,5 RRp2f9g   ,U #YL=*: N-ƶ: :>Y-H:+ʚ»Y:W>Y--HW>: + ʚ|  ˶+ YW  : >Y  H:  W*  m:   Wo+ff>? @!B9DEENGWH_IsJvLMPQRSTUVWJ Z B@!^gp #yz !9E{W > +  >E{W +  ,A *+@+E֬fcg yz {iop ,=*+,N-3-@+-E,>Y-O-RH>Y-@-EHfhi kl+n;rg*=yz==6{i,#>Y+,HN*-*-Afx y{!~g*#yz##   ,m*+,mN-f g*yz , ^,@N,E:-:,O:,R::*, +T ++f.  (0:A]g\ ^yz^^{iYv SwK E;?x(6 ,*+M,  **,*W*~?*5*~*N,*Ƕ,**-->*A:*,*3>?*:,,!%*~ ,) ,)*3fj  !(2>Fdiv}gRyz-. >& f%:v{iJ:,/+, <=>66X*:0:4::><:D`G=J>>JL`G6*3A6/*:ttO*3*SYd Gd`d Gd`UX*\fV $+5EOapx~gp yz_`a b d:D$=c+6de{;:fg, "*+*h*h*kYM+lN- o:q6q:Ys:*vx*W,{W;~3~:Y:*v*W,{W-|+NY- ::,:,::: * -*f! "'*5=DOXbpx!g"yz""'5sD,O!)bKD4$   "'b,+M*,M,*,˱ f"# $%&(g*yzjB@@ooq~  PK m>H^FFAfr/orsay/lri/varna/applications/templateEditor/TemplatePanel.java/** * */ package fr.orsay.lri.varna.applications.templateEditor; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Stroke; import java.awt.geom.Point2D; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Stack; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.undo.UndoManager; import fr.orsay.lri.varna.applications.templateEditor.GraphicalTemplateElement.RelativePosition; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.exceptions.ExceptionXmlLoading; import fr.orsay.lri.varna.models.templates.RNATemplate; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateHelix; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateUnpairedSequence; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement.EdgeEndPoint; /** * @author ponty * */ public class TemplatePanel extends JPanel { /** * */ private static final long serialVersionUID = 3162771335587335679L; private ArrayList _RNAComponents; private ArrayList _RNAConnections; private Hashtable,Connection> _helixToConnection; private TemplateEditorPanelUI _ui; private RNATemplate _template; private static Color[] BackgroundColors = {Color.blue,Color.red,Color.cyan,Color.green,Color.lightGray,Color.magenta,Color.PINK}; private int _nextBackgroundColor = 0 ; public Color nextBackgroundColor() { Color c = BackgroundColors[_nextBackgroundColor++]; _nextBackgroundColor = _nextBackgroundColor % BackgroundColors.length; return new Color(c.getRed(),c.getBlue(),c.getGreen(),50); } public TemplatePanel() { init(); } public RNATemplate getTemplate() { return _template; } List getRNAComponents() { return _RNAComponents; } private void init() { _ui = new TemplateEditorPanelUI(this); _RNAComponents = new ArrayList(); _RNAConnections = new ArrayList(); _helixToConnection = new Hashtable,Connection>(); _template = new RNATemplate(); setBackground(Color.WHITE); MouseControler mc = new MouseControler(this,_ui); addMouseListener(mc); addMouseMotionListener(mc); _solidStroke = new BasicStroke(1.5f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND, 3.0f); float[] dash = { 5.0f, 5.0f }; _dashedStroke = new BasicStroke(1.5f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND, 3.0f, dash, 0); } public void addUndoableEditListener(UndoManager manager) { _ui.addUndoableEditListener(manager); } public TemplateEditorPanelUI getTemplateUI() { return _ui; } public void flip(Helix h) { h.toggleFlipped(); } public void addElement(GraphicalTemplateElement h) { _RNAComponents.add(h); } public void removeElement(GraphicalTemplateElement h) { _RNAComponents.remove(h); try { _template.removeElement(h.getTemplateElement()); } catch (ExceptionInvalidRNATemplate e) { //e.printStackTrace(); } } private GraphicalTemplateElement _selected = null; public GraphicalTemplateElement getSelected() { return _selected; } public void setSelected(GraphicalTemplateElement sel) { _selected = sel; } Helix.RelativePosition _relpos = Helix.RelativePosition.RP_OUTER; public void setSelectedEdge(Helix.RelativePosition rel) { _relpos = rel; } public void unselectEdge(Helix.RelativePosition rel) { _relpos = rel; } Point2D.Double _mousePos = new Point2D.Double(); public void setPointerPos(Point2D.Double p) { _mousePos = p; } public void Unselect() { _selected = null; } public GraphicalTemplateElement getElement(RNATemplateElement t) { for(GraphicalTemplateElement t2: _RNAComponents) if (t==t2.getTemplateElement()) return t2; return null; } public GraphicalTemplateElement getElementAt(int x, int y) { return getElementAt(x, y, null); } public GraphicalTemplateElement getElementAt(int x, int y, GraphicalTemplateElement excluded) { GraphicalTemplateElement h = null; for (int i=0; i<_RNAComponents.size();i++) { GraphicalTemplateElement h2 = _RNAComponents.get(i); if (( (h2.getRelativePosition(x, y)== Helix.RelativePosition.RP_CONNECT_END3) || (h2.getRelativePosition(x, y)== Helix.RelativePosition.RP_CONNECT_END5) || (h2.getRelativePosition(x, y)== Helix.RelativePosition.RP_CONNECT_START3) || (h2.getRelativePosition(x, y)== Helix.RelativePosition.RP_CONNECT_START5)) && (excluded!=h2)) { h = h2; } } if (h==null) { h = getElementCloseTo(x, y, excluded);}; return h; } public GraphicalTemplateElement getElementCloseTo(int x, int y) { return getElementCloseTo(x, y, null); } public GraphicalTemplateElement getElementCloseTo(int x, int y, GraphicalTemplateElement excluded) { GraphicalTemplateElement h = null; for (int i=0; i<_RNAComponents.size();i++) { GraphicalTemplateElement h2 = _RNAComponents.get(i); if ((h2.getRelativePosition(x, y) != Helix.RelativePosition.RP_OUTER) && (excluded!=h2)) { h = h2; } } return h; } public void addConnection(Connection c) { _RNAConnections.add(c); _helixToConnection.put(new Couple(c._h1,c._edge1), c); _helixToConnection.put(new Couple(c._h2,c._edge2), c); try { c._h1.attach(c._h2, c._edge1, c._edge2); c._h2.attach(c._h1, c._edge2, c._edge1); } catch (ExceptionInvalidRNATemplate e) { System.out.println(e.toString());// TODO Auto-generated catch block } } public Connection addConnection(GraphicalTemplateElement h1, GraphicalTemplateElement.RelativePosition edge1,GraphicalTemplateElement h2, GraphicalTemplateElement.RelativePosition edge2) { if ((h1!=h2)&&(getPartner(h1,edge1)==null)&&(getPartner(h2,edge2)==null)) { Connection c = new Connection(h1,edge1,h2,edge2); addConnection(c); return c; } return null; } /** * When there is already a connection in the underlying RNATemplate * and we want to create one at the graphical level. */ public void addGraphicalConnection(GraphicalTemplateElement h1, GraphicalTemplateElement.RelativePosition edge1,GraphicalTemplateElement h2, GraphicalTemplateElement.RelativePosition edge2) { //System.out.println("Connecting " + h1 + " " + edge1 + " to " + h2 + " " + edge2); Connection c = new Connection(h1,edge1,h2,edge2); _RNAConnections.add(c); _helixToConnection.put(new Couple(c._h1,c._edge1), c); _helixToConnection.put(new Couple(c._h2,c._edge2), c); c._h1.graphicalAttach(c._h2, c._edge1, c._edge2); c._h2.graphicalAttach(c._h1, c._edge2, c._edge1); } public void removeConnection(Connection c) { _RNAConnections.remove(c); _helixToConnection.remove(new Couple(c._h1,c._edge1)); _helixToConnection.remove(new Couple(c._h2,c._edge2)); System.out.println("[A]"+c); c._h1.detach(c._edge1); } public boolean isInCycle(GraphicalTemplateElement el, GraphicalTemplateElement.RelativePosition edge) { Stack > p = new Stack>(); Hashtable,Integer> alreadySeen = new Hashtable,Integer>(); p.add(new Couple(el,edge)); while(!p.empty()) { Couple c2 = p.pop(); if (alreadySeen.containsKey(c2)) { return true; } else { alreadySeen.put(c2, new Integer(1)); } GraphicalTemplateElement.RelativePosition next = c2.first.getConnectedEdge(c2.second); Couple otherEnd = new Couple(c2.first,next); if (!alreadySeen.containsKey(otherEnd)) { p.push(otherEnd); } else { Couple child = getPartner(c2.first,c2.second); if (child!=null) { p.push(child); } } } return false; } private static Color[] _colors = {Color.gray,Color.pink,Color.cyan,Color.RED,Color.green,Color.orange}; public static Color getIndexedColor(int n) { return _colors[n%_colors.length]; } public HashMap,Integer> buildConnectedComponents() { HashMap,Integer> alreadySeen = new HashMap,Integer>(); int numConnectedComponents = 0; for (GraphicalTemplateElement el : this._RNAComponents) { for (GraphicalTemplateElement.RelativePosition edge : el.getConnectedEdges()) { Couple c = new Couple(el,edge); if (!alreadySeen.containsKey(c)) { Stack > p = new Stack>(); p.add(c); p.add(new Couple(el,el.getConnectedEdge(edge))); while(!p.empty()) { Couple c2 = p.pop(); if (!alreadySeen.containsKey(c2)) { //System.out.println(" "+numConnectedComponents+" "+c2); c2.first.setMainColor(c2.second, getIndexedColor(numConnectedComponents)); alreadySeen.put(c2, new Integer(numConnectedComponents)); GraphicalTemplateElement.RelativePosition next = c2.first.getConnectedEdge(c2.second); Couple otherEnd = new Couple(c2.first,next); p.push(otherEnd); Couple child = getPartner(c2.first,c2.second); if (child!=null) { p.push(child); } } } numConnectedComponents += 1; } } } return alreadySeen; } public boolean isInCycle(Connection c) { return isInCycle(c._h1,c._edge1); } public Couple getPartner(GraphicalTemplateElement h, GraphicalTemplateElement.RelativePosition edge) { Connection c = getConnection(h, edge); if (c != null) { if ((c._h1==h)&&(c._edge1==edge)) { return new Couple(c._h2,c._edge2); } else { return new Couple(c._h1,c._edge1); } } else { return null; } } public Connection getConnection(GraphicalTemplateElement h, Helix.RelativePosition edge) { Couple target = new Couple(h,edge); if (_helixToConnection.containsKey(target)) { return _helixToConnection.get(target); } else { return null; } } private boolean isConnected(Helix h, GraphicalTemplateElement.RelativePosition edge) { Couple partner = getPartner(h,edge); return partner!=null; } // Aspects graphiques private static final Color CYCLE_COLOR = Color.red; private static final Color NON_EXISTANT_COLOR = Color.gray.brighter(); private static final Color CONTROL_COLOR = Color.gray.darker(); private static final Color BACKGROUND_COLOR = Color.white; private Stroke _solidStroke; private Stroke _dashedStroke; private void drawConnections(Graphics2D g2d, Connection c) { GraphicalTemplateElement h1 = c._h1; GraphicalTemplateElement.RelativePosition edge1 = c._edge1; Point2D.Double p1 = h1.getEdgePosition(edge1); GraphicalTemplateElement h2 = c._h2; GraphicalTemplateElement.RelativePosition edge2 = c._edge2; Point2D.Double p2 = h2.getEdgePosition(edge2); if (isInCycle(c)) { g2d.setColor(CYCLE_COLOR); } else { g2d.setColor(GraphicalTemplateElement.BACKBONE_COLOR); } g2d.drawLine((int)p1.x,(int)p1.y,(int)p2.x,(int)p2.y); } public void paintComponent(Graphics g) { rescale(); Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); removeAll(); super.paintComponent(g2d); buildConnectedComponents(); if (_selected!=null) { if (_relpos != GraphicalTemplateElement.RelativePosition.RP_OUTER) { Point2D.Double p = _selected.getEdgePosition(_relpos); g2d.setStroke(_solidStroke); g2d.drawLine((int)_mousePos.x, (int)_mousePos.y, (int)p.x, (int)p.y); } } for (int i=0;i<_RNAConnections.size();i++) { Connection c = _RNAConnections.get(i); drawConnections(g2d,c); } for (int i=0;i<_RNAComponents.size();i++) { GraphicalTemplateElement elem = _RNAComponents.get(i); g2d.setColor(elem.getDominantColor()); g2d.fill(elem.getArea()); if (_selected == elem) { elem.draw(g2d,true); } else { elem.draw(g2d,false); } } } private void rescale() { int minX = 0; int maxX = 0; int minY = 0; int maxY = 0; for(int i=0;i graphical template element mapping Map map = new HashMap(); // First, we load elements { Iterator iter = template.classicIterator(); while (iter.hasNext()) { RNATemplateElement templateElement = iter.next(); if (templateElement instanceof RNATemplateHelix) { RNATemplateHelix templateHelix = (RNATemplateHelix) templateElement; Helix graphicalHelix = new Helix(templateHelix); graphicalHelix.setDominantColor(nextBackgroundColor()); _RNAComponents.add(graphicalHelix); map.put(templateHelix, graphicalHelix); } else if (templateElement instanceof RNATemplateUnpairedSequence) { RNATemplateUnpairedSequence templateSequence = (RNATemplateUnpairedSequence) templateElement; UnpairedRegion graphicalSequence = new UnpairedRegion(templateSequence); graphicalSequence.setDominantColor(nextBackgroundColor()); _RNAComponents.add(graphicalSequence); map.put(templateSequence, graphicalSequence); } } } // Now, we load edges { Iterator iter = template.makeEdgeList().iterator(); while (iter.hasNext()) { EdgeEndPoint v1 = iter.next(); EdgeEndPoint v2 = v1.getOtherEndPoint(); GraphicalTemplateElement gte1 = map.get(v1.getElement()); GraphicalTemplateElement gte2 = map.get(v2.getElement()); RelativePosition rp1 = gte1.relativePositionFromEdgeEndPointPosition(v1.getPosition()); RelativePosition rp2 = gte2.relativePositionFromEdgeEndPointPosition(v2.getPosition()); addGraphicalConnection(gte1, rp1, gte2, rp2); } } repaint(); } /** * Load a template from an XML file. */ public void loadFromXmlFile(File filename) { try { RNATemplate newTemplate = RNATemplate.fromXMLFile(filename); loadTemplate(newTemplate); } catch (ExceptionXmlLoading e) { e.printStackTrace(); JOptionPane.showMessageDialog(this, e.getMessage(), "Template loading error", JOptionPane.ERROR_MESSAGE); } } } PK 4F>W%%Cfr/orsay/lri/varna/applications/templateEditor/MouseControler.class1_=fr/orsay/lri/varna/applications/templateEditor/MouseControlerjava/lang/Objectjava/awt/event/MouseListener"java/awt/event/MouseMotionListener _granularityIHYSTERESIS_DISTANCE ConstantValue _sp>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;_elemILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;_uiFLfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI; _currentModeZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; _clickedPosLjava/awt/geom/Point2D$Double;f$SWITCH_TABLE$fr$orsay$lri$varna$applications$templateEditor$GraphicalTemplateElement$RelativePosition[I(Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;Lfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI;)VCode  ()V ! # %'&Xfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition (RP_OUTER * ,java/awt/geom/Point2D$Double + /  1  3  5 LineNumberTableLocalVariableTablethis?Lfr/orsay/lri/varna/applications/templateEditor/MouseControler;spui mouseClicked(Ljava/awt/event/MouseEvent;)Varg0Ljava/awt/event/MouseEvent; mouseEntered mouseExited mousePressed DFEjava/awt/event/MouseEvent GHgetX()I DJ KHgetY MON(Lfr/orsay/lri/varna/applications/templateEditor/Connection;)V 9fr/orsay/lri/varna/applications/templateEditor/Connection _h1 _h24fr/orsay/lri/varna/applications/templateEditor/Helix _edge2 _edge1 M  setPointerPos!(Ljava/awt/geom/Point2D$Double;)V M setSelectedEdge](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Velemn?Lfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion;al7Lfr/orsay/lri/varna/applications/templateEditor/Couple; isConnectedZc;Lfr/orsay/lri/varna/applications/templateEditor/Connection;p1p2 p1IsHelix p1IsUnpaired p2IsHelix p2IsUnpairedp1StillAttachedLocalVariableTypeTableLfr/orsay/lri/varna/applications/templateEditor/Couple; mouseReleased getPos ()Ljava/awt/geom/Point2D$Double;  getExtent + distance(Ljava/awt/geom/Point2D;)D@$ p tremoveElementUI M P(IILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement; | getClosestEdge p addConnectionUII(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Vh6Lfr/orsay/lri/varna/applications/templateEditor/Helix;tedge projectPoint@(IILjava/awt/geom/Point2D$Double;)Ljava/awt/geom/Point2D$Double; + xD + y@!TD- java/lang/Math cos(D)D sinrefresultnxnytmpiangledxdynorm mouseDragged + (DD)D java/lang/System outLjava/io/PrintStream; Creating Helix...   java/io/PrintStream println(Ljava/lang/String;)V M getRNAComponents()Ljava/util/List;  F(DDLfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/util/List;)V l  p setHelixExtentUI;(Lfr/orsay/lri/varna/applications/templateEditor/Helix;DD)V p ! setHelixPosUI p# $ moveHelixUI p& '(setEdge5TangentUID(Lfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion;DD)V p* +(setEdge3TangentUI p- ./ setEdge5UIN(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;DD)V p1 2( setEdge3UIh1durp mouseMoved 9  %; <=values]()[Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; %? @RP_CONNECT_END3 %B CRP_CONNECT_END5 %E FRP_CONNECT_START3 %H IRP_CONNECT_START5 %K L RP_EDIT_END %N ORP_EDIT_TANGENT_3 %Q RRP_EDIT_TANGENT_5 %T URP_INNER_GENERALWjava/lang/NoSuchFieldError SourceFileMouseControler.java InnerClassesRelativePosition]java/awt/geom/Point2DDouble!      2** * "*$)*+Y-.*+0*2*,46&  &("',17 2892:2;<=56789>?@=56789>?A=56$789>?B= *0+C+ILM*+Y+C+IR.*0U,g+X *[)+X^Y+C+I*0`dN-*0gk*4-o*0-u*0x*-2*[)h*,+C+I{)*0,u*,2*).4 (@=::JJJJ::*)*0,*)N-6*0,*):*4::6^6 6 ^6 ,6   6  *2*) *2*)*2&*0+Y+C+IR*0*)*0*2u*0U*2*0x64+,%-,.0082B4J6c7n8v9~:;<ABCDDJLNOUV W%Y3Z<[C\J]Q^X__`fasc}egijlnosuvxz|}789>?c. 3xChJaQZXS _L fE s8 =v*2*). c**ffff*2w*2M,,Ŷ̘]*4*2*0UHE*0+C+I*2M,#,+C+IN*4*2*),-*0$*2*0$*$)*0x6R <FN`krux7489>?N$.c+Y-:-g9-g99 6 Z * ok9  9 9kkc9 %9 -kc-kc  * 6>  &5<CPX\kz7 89   wn i #c 5E <>C7P*=+*2*).z*.+C+I̗ٲ  Y+C+I*0`*0M,*0g*4,o*0,u*0x*,2*2*2M*). t,P*+C+I,N*4,--*+C+I,ŷN*4,--*4,+C+I"*0+Y+C+IR*0x*2^*2^M+Y+C+IRN*). ^sB&*4,+C+I%*0xF*4,+C+I)*0x**4,+C+I,*4,+C+I0*0x6+ $<Eepx  25MTWai{~    7R89>?e'34 4i5{67=56789>?#8YW: K*> OW*AOW*DOW*GOW*JOW*[OW*M OW*P OW*SOW*OW*$OW*Y8 V(+V,69V:DGVHQTVU^aVbloVpz}V~VVV6 7XYZ%|[@+\^ PK m>KkBfr/orsay/lri/varna/applications/templateEditor/MouseControler.javapackage fr.orsay.lri.varna.applications.templateEditor; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.Point2D; public class MouseControler implements MouseListener, MouseMotionListener { private int _granularity = 8; private final int HYSTERESIS_DISTANCE = 10; TemplatePanel _sp; GraphicalTemplateElement _elem; TemplateEditorPanelUI _ui; public MouseControler(TemplatePanel sp, TemplateEditorPanelUI ui) { _sp = sp; _elem = null; _ui = ui; } public void mouseClicked(MouseEvent arg0) { } public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } private GraphicalTemplateElement.RelativePosition _currentMode = Helix.RelativePosition.RP_OUTER; private Point2D.Double _clickedPos = new Point2D.Double(); public void mousePressed(MouseEvent arg0) { GraphicalTemplateElement elem = _sp.getElementAt(arg0.getX(), arg0.getY()); _clickedPos = new Point2D.Double(arg0.getX(), arg0.getY()); _sp.Unselect(); if (elem==null) { if (arg0.getButton()==MouseEvent.BUTTON1) { _currentMode = Helix.RelativePosition.RP_EDIT_START; } else if (arg0.getButton()==MouseEvent.BUTTON3) { UnpairedRegion n = new UnpairedRegion(arg0.getX(),arg0.getY(),_sp.getTemplate()); n.setDominantColor(_sp.nextBackgroundColor()); _ui.addElementUI(n); _sp.setSelected(n); _sp.repaint(); _elem = n; _currentMode = GraphicalTemplateElement.RelativePosition.RP_EDIT_START; } } else { _currentMode = elem.getRelativePosition(arg0.getX(), arg0.getY()); _sp.setSelected(elem); _elem = elem; switch (_currentMode) { case RP_EDIT_START: case RP_EDIT_END: case RP_EDIT_TANGENT_5: case RP_EDIT_TANGENT_3: break; case RP_INNER_MOVE: break; case RP_INNER_GENERAL: _currentMode = Helix.RelativePosition.RP_INNER_MOVE; break; case RP_CONNECT_END3: case RP_CONNECT_END5: case RP_CONNECT_START5: case RP_CONNECT_START3: { Couple al = _sp.getPartner(elem, _currentMode); boolean isConnected = (al!=null); if (isConnected) { Connection c = _sp.getConnection(elem, _currentMode); _ui.removeConnectionUI(c); GraphicalTemplateElement p1 = c._h1; GraphicalTemplateElement p2 = c._h2; boolean p1IsHelix = (p1 instanceof Helix); boolean p1IsUnpaired = (p1 instanceof UnpairedRegion); boolean p2IsHelix = (p2 instanceof Helix); boolean p2IsUnpaired = (p2 instanceof UnpairedRegion); boolean p1StillAttached = (p1 == elem); if ((p1IsUnpaired && p2IsHelix)) { p1StillAttached = false; } if (p1StillAttached) { _elem = p2; _currentMode = c._edge2; } else if (!p1StillAttached) { _elem=p1; _currentMode = c._edge1; } } if (_elem instanceof Helix) { _sp.setPointerPos(new Point2D.Double(arg0.getX(),arg0.getY())); _sp.setSelectedEdge(_currentMode); } _sp.setSelected(_elem); } break; case RP_OUTER: _sp.Unselect(); _elem = null; } _sp.repaint(); } } public void mouseReleased(MouseEvent arg0) { if (_elem!=null) { switch (_currentMode) { case RP_EDIT_START: case RP_EDIT_END: { if (_elem instanceof Helix) { Helix h = (Helix) _elem; if (h.getPos().distance(h.getExtent())<10.0) { _ui.removeElementUI(_elem); _sp.Unselect(); } } } break; case RP_INNER_MOVE: break; case RP_CONNECT_END3: case RP_CONNECT_END5: case RP_CONNECT_START5: case RP_CONNECT_START3: { GraphicalTemplateElement t = _sp.getElementAt(arg0.getX(), arg0.getY(),_elem); if (t!=null) { GraphicalTemplateElement.RelativePosition edge = t.getClosestEdge(arg0.getX(), arg0.getY()); _ui.addConnectionUI(_elem,_currentMode,t,edge); } _sp.setSelectedEdge(Helix.RelativePosition.RP_OUTER); } break; } _elem = null; } _sp.setSelectedEdge(Helix.RelativePosition.RP_OUTER); _currentMode = Helix.RelativePosition.RP_OUTER; _sp.repaint(); } private Point2D.Double projectPoint(int x, int y, Point2D.Double ref) { Point2D.Double result = new Point2D.Double(); double nx = x-ref.x; double ny = y-ref.y; double tmp = Double.MIN_VALUE; for (int i=0;i tmp) { tmp = norm; result.x = ref.x+dx*norm; result.y = ref.y+dy*norm; } } return result; } public void mouseDragged(MouseEvent arg0) { if (_elem == null) { switch (_currentMode) { case RP_EDIT_START: { if (_clickedPos.distance(arg0.getX(),arg0.getY())>HYSTERESIS_DISTANCE) { System.out.println("Creating Helix..."); Helix h1 = new Helix(arg0.getX(),arg0.getY(),_sp.getTemplate(),_sp.getRNAComponents()); h1.setDominantColor(_sp.nextBackgroundColor()); _ui.addElementUI(h1); _sp.setSelected(h1); _sp.repaint(); _elem = h1; } } break; } } else { if (_elem instanceof Helix) { Helix h = (Helix) _elem; switch (_currentMode) { case RP_EDIT_START: { Point2D.Double d = projectPoint(arg0.getX(),arg0.getY(),h.getPos()); _ui.setHelixExtentUI(h, d.x,d.y); } break; case RP_EDIT_END: { Point2D.Double d = projectPoint( arg0.getX(),arg0.getY(),h.getExtent()); _ui.setHelixPosUI(h, d.x,d.y); } break; case RP_INNER_MOVE: _ui.moveHelixUI(h, arg0.getX(),arg0.getY()); break; case RP_CONNECT_END3: case RP_CONNECT_END5: case RP_CONNECT_START5: case RP_CONNECT_START3: _sp.setPointerPos(new Point2D.Double(arg0.getX(),arg0.getY())); _sp.repaint(); break; } } else if (_elem instanceof UnpairedRegion) { UnpairedRegion ur = (UnpairedRegion) _elem; Point2D.Double p = new Point2D.Double(arg0.getX(),arg0.getY()); switch (_currentMode) { case RP_EDIT_TANGENT_5: { _ui.setEdge5TangentUI(ur,arg0.getX(),arg0.getY()); _sp.repaint(); break; } case RP_EDIT_TANGENT_3: { _ui.setEdge3TangentUI(ur,arg0.getX(),arg0.getY()); _sp.repaint(); break; } case RP_CONNECT_START5: _ui.setEdge5UI(ur,arg0.getX(),arg0.getY()); break; case RP_CONNECT_END3: _ui.setEdge3UI(ur,arg0.getX(),arg0.getY()); break; } _sp.repaint(); } } } public void mouseMoved(MouseEvent arg0) { // TODO Auto-generated method stub } } PK 4F>h_^fr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition.class1VXfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePositionjava/lang/EnumRP_OUTERZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;RP_INNER_GENERAL RP_INNER_MOVE RP_EDIT_START RP_EDIT_ENDRP_CONNECT_START5RP_CONNECT_START3RP_CONNECT_END5RP_CONNECT_END3RP_EDIT_TANGENT_3RP_EDIT_TANGENT_5 ENUM$VALUES[[Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;()VCode  (Ljava/lang/String;I)V     "  %  (  +  .  1  4  7  :  < LineNumberTableLocalVariableTable thisvalues]()[Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; DFEjava/lang/System GH arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfn(Ljava/lang/String;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; L IM5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileGraphicalTemplateElement.java SignaturelLjava/lang/Enum; InnerClassesTGfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElementRelativePosition@1 @@@@ @ @ @ @ @@@ YYY !Y#$Y&'Y)*Y,-Y/0Y23Y5 6Y8 9 YSYSY!SY$SY'SY*SY-SY0SY3SY 6SY 9S;=x >1*+?=> @ AB6;YK*Y<YMC,=> IJ* *K=>NOPQR SU@PK 4F>h<a00Mfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement.class1Gfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElementjava/lang/Object_debugZ _mainColorsLjava/util/HashMap; SignatureLjava/util/HashMap;_dominantColorLjava/awt/Color;BACKBONE_COLOR CONTROL_COLOR NUMBER_FONTLjava/awt/Font; NUMBER_COLORBASE_PAIR_COLOR BASE_COLORBASE_FILL_COLORBASE_FILL_3_COLORBASE_FILL_5_COLOR MAGNET_COLOR_attachedElementsKLjava/util/HashMap;>; _boldStrokeLjava/awt/Stroke; _solidStrokedash[F _dashedStroke()VCode $&%java/awt/Color ' gray ) +#D0D0FF $- ./decode$(Ljava/lang/String;)Ljava/awt/Color; 1  3 java/awt/Font5Arial 27 89(Ljava/lang/String;II)V ;  =  $? @ blue B  D  $F G white I  $K L red N  $P Q green S  U  LineNumberTableLocalVariableTable Y 8! [ ]java/util/HashMap \Y ` ??fff $d 8e(FFFF)V g i kjava/awt/BasicStroke@ @@ jo 8p(FIIF)V r ? u @ x  jz 8{ (FIIF[FF)V } thisILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;setDominantColor(Ljava/awt/Color;)VcgetDominantColor()Ljava/awt/Color;getRelativePosition^(DD)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;draw(Ljava/awt/Graphics2D;Z)VgetBoundingPolygon()Ljava/awt/Polygon; translate(DD)VgetClosestEdgegetConnectedEdges()Ljava/util/ArrayList;s()Ljava/util/ArrayList;getTemplateElementF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; setMainColorm(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Ljava/awt/Color;)V \ put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;edgeZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;getArea()Ljava/awt/Shape;attach(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V ExceptionsCfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate5fr/orsay/lri/varna/applications/templateEditor/Couple 8'(Ljava/lang/Object;Ljava/lang/Object;)VeedgeOrigedgeDestgraphicalAttachdetach](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V \  containsKey(Ljava/lang/Object;)Z \ get&(Ljava/lang/Object;)Ljava/lang/Object; \ remove secondLjava/lang/Object; firstXfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition  7Lfr/orsay/lri/varna/applications/templateEditor/Couple;LocalVariableTypeTableLfr/orsay/lri/varna/applications/templateEditor/Couple;getAttachedElement(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Couple;8(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Couple; localedgehasAttachedElement](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Z getEndPoint(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;isIn(Ljava/awt/Graphics2D;)V  g2dLjava/awt/Graphics2D;getStringDimension=(Ljava/awt/Graphics2D;Ljava/lang/String;)Ljava/awt/Dimension; java/awt/Graphics2D getFontMetrics()Ljava/awt/FontMetrics; java/awt/FontMetrics getStringBoundsB(Ljava/lang/String;Ljava/awt/Graphics;)Ljava/awt/geom/Rectangle2D;java/awt/Dimension java/awt/geom/Rectangle2D getWidth()D  getAscent()I  getDescent 8(II)VgsLjava/lang/String;fmLjava/awt/FontMetrics;rLjava/awt/geom/Rectangle2D;drawStringCentered,(Ljava/awt/Graphics2D;Ljava/lang/String;DD)V   widthI@   height    drawRect(IIII)V java/lang/Math round(D)J  9 drawStringg2resxDydLjava/awt/Dimension;getConnectedEdge(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;getEdgePositionz(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Ljava/awt/geom/Point2D$Double;setEdgePosition{(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Ljava/awt/geom/Point2D$Double;)V(relativePositionFromEdgeEndPointPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; canConnectI(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Z ) + el1e1el2e2drawMove6(Ljava/awt/Graphics2D;Ljava/awt/geom/Point2D$Double;)V 3 45 setStroke(Ljava/awt/Stroke;)V 7 8setColor :<;java/awt/geom/Point2D$Double @* :@  B C fillOval E F drawOval@&@ :L 8 N OP drawArrowU(Ljava/awt/Graphics2D;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)VcenterLjava/awt/geom/Point2D$Double; arrowLength drawEditStartR(Ljava/awt/Graphics2D;Lfr/orsay/lri/varna/applications/templateEditor/Helix;DDDD)V WYX4fr/orsay/lri/varna/applications/templateEditor/Helix Z[getCenterEditStart ()Ljava/awt/geom/Point2D$Double; ] ^_drawEdit:(Ljava/awt/Graphics2D;Ljava/awt/geom/Point2D$Double;DDDD)Vh6Lfr/orsay/lri/varna/applications/templateEditor/Helix;dxdynxny drawEditEnd Wh i[getCenterEditEnd@$@ o p drawLine :r stdistance(Ljava/awt/geom/Point2D;)Dorigdest drawAnchor y wzF(Ljava/awt/Graphics2D;Ljava/awt/geom/Point2D$Double;Ljava/awt/Color;)Vp drawAnchor5 drawAnchor3@ drawMagnetdrawBaseequalsb SourceFileGraphicalTemplateElement.java InnerClassesRelativePositionDfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition/fr/orsay/lri/varna/models/templates/RNATemplateEdgeEndPointPositionBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementRNATemplateElementOfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint EdgeEndPointjava/awt/geom/Point2DDouble!             ( !"H#(*,02Y46:#<>A#CEHJMOR0TV. #$%&#')(/)5*;+A,GW8!" |*X*Z*\Y^_*$Yaaabcf*\Y^h*jYlmnq*jYsmnt*YvQYvQw*jYsm*w y|V*  's2CTe{W |~">*+fV 01W~ "/*fV5W ~ "M *_+,WV B CW  ~  "_*h,Y-+WV IJW*~"_*h,Y-+WV UVW*~"2*h+)*h+M*h+W,,ñVZ \] ^1`W 2~2  "U*h+*h+Vc deW~"= *h+ViW ~ "?*+ұV pqW~"$+N-,+:Y--dVwx yz yW4$~$$ "U*+,:)ogJoc9*Z+)d +,)V$+DTW>U~UUUUM !"#$% &'"i!*+(,-(*+*,-*VW*!,!-!.!/01"6 +*t2+06+,9=g,?=gA+(6+,9=g,?=gDGJI9*+,:Y,9)c,?KM*+,:Y,9)g,?KM*+,:Y,9,?)cKM*+,:Y,9,?)gKMV2 )0JNSlW4~QRNjSSeTU" ,V: *+ ) \VWR~`abcde QR fU" ,g: *+ ) \VWR~`abcde QR ^_"y +06+,9jg,?jgA+(6+,9jg,?jgDl9 I9 *+,:Y,9 kc,?  kcK M*+,:Y,9 kg,?  kgK M*+,:Y,9) kc,? kcK M*+,:Y,9) kg,? kgK MV. !(BGLoW\ ~QRbcde GS L OP"> +*t2+,9,?-9-?n,9-9g,-qo9,?-?g,-qo99 w9 +-9-?-9w ckg-?w ckgn+-9-?-9w gkg-?w gkgnV&  1BFKwW\ ~uRvR1sbBbcF^d KYe w1"H *+,0xVW  ~  {R|1"H *+,RxVW  ~  {R}1"H *+,MxVW  ~  {Rwz"A+-6+,9~g,?~gA+C6+,9~g,?~gDV&@W*A~AA{RA 1"C*+,Tx+C6+,9~g,?~gD+,9g,?gDV *BW C~CC{R1"C+H6+,9Ig,?IgA+C6+,9Ig,?IgDV!(BW C~CC{R"N+ +*VW~*@@: PK U p=p|f(f(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement.javapackage fr.orsay.lri.varna.applications.templateEditor; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.ArrayList; import java.util.HashMap; import fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.models.templates.RNATemplate.EdgeEndPointPosition; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement.EdgeEndPoint; public abstract class GraphicalTemplateElement { public boolean _debug = false; protected HashMap _mainColors = new HashMap(); public Color _dominantColor = new Color(0.5f,0.5f,0.5f,0.9f); public enum RelativePosition { RP_OUTER,RP_INNER_GENERAL,RP_INNER_MOVE,RP_EDIT_START,RP_EDIT_END,RP_CONNECT_START5,RP_CONNECT_START3,RP_CONNECT_END5,RP_CONNECT_END3, RP_EDIT_TANGENT_3,RP_EDIT_TANGENT_5; }; static final Color BACKBONE_COLOR = Color.gray; static final Color CONTROL_COLOR = Color.decode("#D0D0FF"); static final Font NUMBER_FONT = new Font("Arial", Font.BOLD,18); static final Color NUMBER_COLOR = Color.gray; static final Color BASE_PAIR_COLOR = Color.blue; static final Color BASE_COLOR = Color.gray; static final Color BASE_FILL_COLOR = Color.white; static final Color BASE_FILL_3_COLOR = Color.red; static final Color BASE_FILL_5_COLOR = Color.green; static final Color MAGNET_COLOR = CONTROL_COLOR; public void setDominantColor(Color c) { _dominantColor = c; } public Color getDominantColor() { return _dominantColor; } public abstract RelativePosition getRelativePosition(double x, double y); public abstract void draw(Graphics2D g2d, boolean selected); public abstract Polygon getBoundingPolygon(); public abstract void translate(double x, double y); public abstract RelativePosition getClosestEdge(double x, double y); public abstract ArrayList getConnectedEdges(); public abstract RNATemplateElement getTemplateElement(); public void setMainColor(RelativePosition edge,Color c) { _mainColors.put(edge, c); } public abstract Shape getArea(); public void attach(GraphicalTemplateElement e, RelativePosition edgeOrig, RelativePosition edgeDest) throws ExceptionEdgeEndpointAlreadyConnected, ExceptionInvalidRNATemplate { _attachedElements.put(edgeOrig, new Couple(edgeDest,e)); } /** * Same as attach(), but without touching the underlying * RNATemplateElement objects. * This is useful if the underlying RNATemplate already contains edges * but not the graphical template. */ public void graphicalAttach(GraphicalTemplateElement e, RelativePosition edgeOrig, RelativePosition edgeDest) { _attachedElements.put(edgeOrig, new Couple(edgeDest,e)); } public void detach(RelativePosition edge) { if (_attachedElements.containsKey(edge)) { Couple c = _attachedElements.get(edge); _attachedElements.remove(edge); c.second.detach(c.first); } } public Couple getAttachedElement(RelativePosition localedge) { if (_attachedElements.containsKey(localedge)) return _attachedElements.get(localedge); return null; } public boolean hasAttachedElement(RelativePosition localedge) { return _attachedElements.containsKey(localedge); } public abstract EdgeEndPoint getEndPoint(RelativePosition r); public abstract boolean isIn(RelativePosition r); public void draw(Graphics2D g2d) { draw(g2d,false); } private HashMap> _attachedElements = new HashMap>(); private Dimension getStringDimension(Graphics2D g, String s) { FontMetrics fm = g.getFontMetrics(); Rectangle2D r = fm.getStringBounds(s, g); return (new Dimension((int) r.getWidth(), (int) fm.getAscent() - fm.getDescent())); } public void drawStringCentered(Graphics2D g2, String res, double x, double y) { Dimension d = getStringDimension(g2, res); x -= (double) d.width / 2.0; y += (double) d.height / 2.0; if (_debug) g2.drawRect((int) x, (int) y - d.height, d.width, d.height); g2.drawString(res, (int) Math.round(x), (int) Math.round(y)); } protected Stroke _boldStroke = new BasicStroke(2.5f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND, 3.0f); protected Stroke _solidStroke = new BasicStroke(1.5f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND, 3.0f); private float[] dash = { 5.0f, 5.0f }; protected Stroke _dashedStroke = new BasicStroke(1.5f, BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND, 3.0f, dash, 0); public abstract RelativePosition getConnectedEdge(RelativePosition edge); public abstract Point2D.Double getEdgePosition(RelativePosition edge); public abstract void setEdgePosition(RelativePosition edge, Point2D.Double pos); public abstract RelativePosition relativePositionFromEdgeEndPointPosition(EdgeEndPointPosition endPointPosition); public static boolean canConnect(GraphicalTemplateElement el1, RelativePosition e1,GraphicalTemplateElement el2, RelativePosition e2) { return (!el1.hasAttachedElement(e1))&&(!el2.hasAttachedElement(e2))&&(el1.isIn(e1)!=el2.isIn(e2)); } protected void drawMove(Graphics2D g2d, Point2D.Double center) { g2d.setStroke(_solidStroke); g2d.setColor(CONTROL_COLOR); g2d.fillOval((int)((center.x-Helix.MOVE_RADIUS)), (int)((center.y-Helix.MOVE_RADIUS)), (int)(2.0*Helix.MOVE_RADIUS), (int)(2.0*Helix.MOVE_RADIUS)); g2d.setColor(BACKBONE_COLOR); g2d.drawOval((int)((center.x-Helix.MOVE_RADIUS)), (int)((center.y-Helix.MOVE_RADIUS)), (int)(2.0*Helix.MOVE_RADIUS), (int)(2.0*Helix.MOVE_RADIUS)); double arrowLength = Helix.MOVE_RADIUS-2.0; double width = 3.0; drawArrow(g2d,center,new Point2D.Double(center.x+arrowLength,center.y),width); drawArrow(g2d,center,new Point2D.Double(center.x-arrowLength,center.y),width); drawArrow(g2d,center,new Point2D.Double(center.x,center.y+arrowLength),width); drawArrow(g2d,center,new Point2D.Double(center.x,center.y-arrowLength),width); } protected void drawEditStart(Graphics2D g2d, Helix h, double dx,double dy,double nx,double ny) { Point2D.Double center = h.getCenterEditStart(); drawEdit(g2d, center, dx,dy,nx,ny); } protected void drawEditEnd(Graphics2D g2d, Helix h, double dx,double dy,double nx,double ny) { Point2D.Double center = h.getCenterEditEnd(); drawEdit(g2d, center, dx,dy,nx,ny); } protected void drawEdit(Graphics2D g2d, Point2D.Double center, double dx,double dy,double nx,double ny) { g2d.setColor(CONTROL_COLOR); g2d.fillOval((int)((center.x-Helix.EDIT_RADIUS)), (int)((center.y-Helix.EDIT_RADIUS)), (int)(2.0*Helix.EDIT_RADIUS), (int)(2.0*Helix.EDIT_RADIUS)); g2d.setColor(BACKBONE_COLOR); g2d.drawOval((int)((center.x-Helix.EDIT_RADIUS)), (int)((center.y-Helix.EDIT_RADIUS)), (int)(2.0*Helix.EDIT_RADIUS), (int)(2.0*Helix.EDIT_RADIUS)); double arrowLength = Helix.EDIT_RADIUS-2.0; double width = 3.0; drawArrow(g2d,center,new Point2D.Double(center.x+nx*arrowLength,center.y+ny*arrowLength),width); drawArrow(g2d,center,new Point2D.Double(center.x-nx*arrowLength,center.y-ny*arrowLength),width); drawArrow(g2d,center,new Point2D.Double(center.x+dx*arrowLength,center.y+dy*arrowLength),width); drawArrow(g2d,center,new Point2D.Double(center.x-dx*arrowLength,center.y-dy*arrowLength),width); } protected void drawArrow(Graphics2D g2d, Point2D.Double orig, Point2D.Double dest, double width) { g2d.setStroke(_solidStroke); g2d.drawLine((int)orig.x,(int)orig.y,(int)dest.x,(int)dest.y); double dx = (orig.x-dest.x)/(orig.distance(dest)); double dy = (orig.y-dest.y)/(orig.distance(dest)); double nx = dy; double ny = -dx; g2d.drawLine((int)dest.x,(int)dest.y,(int)(dest.x-width*(-dx+nx)),(int)(dest.y-width*(-dy+ny))); g2d.drawLine((int)dest.x,(int)dest.y,(int)(dest.x-width*(-dx-nx)),(int)(dest.y-width*(-dy-ny))); } protected void drawAnchor(Graphics2D g2d, Point2D.Double p) { drawAnchor(g2d,p,CONTROL_COLOR); } protected void drawAnchor5(Graphics2D g2d, Point2D.Double p) { drawAnchor(g2d,p,BASE_FILL_5_COLOR); } protected void drawAnchor3(Graphics2D g2d, Point2D.Double p) { drawAnchor(g2d,p,BASE_FILL_3_COLOR); } protected void drawAnchor(Graphics2D g2d, Point2D.Double p, Color c) { g2d.setColor(c); g2d.fillOval((int)(p.x-Helix.EDGE_BASE_RADIUS),(int)(p.y-Helix.EDGE_BASE_RADIUS),(int)(2.0*Helix.EDGE_BASE_RADIUS),(int)(2.0*Helix.EDGE_BASE_RADIUS)); g2d.setColor(BASE_COLOR); g2d.drawOval((int)(p.x-Helix.EDGE_BASE_RADIUS),(int)(p.y-Helix.EDGE_BASE_RADIUS),(int)(2.0*Helix.EDGE_BASE_RADIUS),(int)(2.0*Helix.EDGE_BASE_RADIUS)); } protected void drawMagnet(Graphics2D g2d, Point2D.Double p) { drawAnchor(g2d, p, MAGNET_COLOR); g2d.setColor(BASE_COLOR); g2d.drawOval((int)(p.x-Helix.EDGE_BASE_RADIUS),(int)(p.y-Helix.EDGE_BASE_RADIUS),(int)(2.0*Helix.EDGE_BASE_RADIUS),(int)(2.0*Helix.EDGE_BASE_RADIUS)); g2d.drawOval((int)(p.x-2),(int)(p.y-2),(int)(2.0*2),(int)(2.0*2)); } protected void drawBase(Graphics2D g2d, Point2D.Double p) { g2d.setColor(BASE_FILL_COLOR); g2d.fillOval((int)(p.x-Helix.BASE_RADIUS),(int)(p.y-Helix.BASE_RADIUS),(int)(2.0*Helix.BASE_RADIUS),(int)(2.0*Helix.BASE_RADIUS)); g2d.setColor(BASE_COLOR); g2d.drawOval((int)(p.x-Helix.BASE_RADIUS),(int)(p.y-Helix.BASE_RADIUS),(int)(2.0*Helix.BASE_RADIUS),(int)(2.0*Helix.BASE_RADIUS)); } public boolean equals(Object b) { if (b instanceof GraphicalTemplateElement) { return b==this; } else return false; } } PK 4F>;fr/orsay/lri/varna/applications/templateEditor/Couple.class1E5fr/orsay/lri/varna/applications/templateEditor/Couplejava/lang/ObjectfirstLjava/lang/Object; SignatureTT;secondTU; HASH_PRIMEI ConstantValueBC'(Ljava/lang/Object;Ljava/lang/Object;)V (TT;TU;)VCode  ()V    LineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/applications/templateEditor/Couple;abLocalVariableTypeTable?Lfr/orsay/lri/varna/applications/templateEditor/Couple;equals(Ljava/lang/Object;)Z % "#ccchashCode()I + ()toString()Ljava/lang/String;/java/lang/StringBuilder1( .3 4(Ljava/lang/String;)V .6 78append-(Ljava/lang/Object;)Ljava/lang/StringBuilder;:, .< 7=-(Ljava/lang/String;)Ljava/lang/StringBuilder;?) .A ,- SourceFile Couple.java<Ljava/lang/Object;!    **+*,    ! "#.++M,*$,*$  ..& ' .! '!()O**h**`  !,-a%.Y02*59;*5>;@! % %!BCDPK pq<|dT)oo:fr/orsay/lri/varna/applications/templateEditor/Couple.javapackage fr.orsay.lri.varna.applications.templateEditor; public class Couple { public T first; public U second; private static final int HASH_PRIME = 1000003; public Couple(T a, U b) { first = a; second = b; } public boolean equals( Object c) { if (!(c instanceof Couple)) { return false; } Couple cc = (Couple) c; return (cc.first.equals(first) && (cc.second.equals(second))); } public int hashCode() { return HASH_PRIME*first.hashCode()+second.hashCode(); } public String toString() { return "("+first+","+second+")"; } } PK 4F>}@@Cfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion.class18=fr/orsay/lri/varna/applications/templateEditor/UnpairedRegionGfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement_eMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;DEFAULT_VECTOR_LENGTHD ConstantValue@ADEFAULT_VECTOR_DISTANCEMAX_UNPAIRED_CONTROL_DISTANCE@$UNPAIRED_ARROW_WIDTH@f$SWITCH_TABLE$fr$orsay$lri$varna$applications$templateEditor$GraphicalTemplateElement$RelativePosition[IR$SWITCH_TABLE$fr$orsay$lri$varna$models$templates$RNATemplate$EdgeEndPointPosition6(DDLfr/orsay/lri/varna/models/templates/RNATemplate;)VCode  ()VKfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence ! java/lang/Object "#getClass()Ljava/lang/Class;% ' (F(Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/lang/String;)V * ,java/awt/geom/Point2D$Double +. /(DD)V 1 23 setVertex5!(Ljava/awt/geom/Point2D$Double;)V 5 63 setVertex3 8 9:setInTangentVectorLength(D)V!TD- > ?:setInTangentVectorAngle A B:setOutTangentVectorLength D E:setOutTangentVectorAngle G H updateLengthLineNumberTableLocalVariableTablethis?Lfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion;xytmp1Lfr/orsay/lri/varna/models/templates/RNATemplate;P(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;)VtemplateSequencegetEdge5 ()Ljava/awt/geom/Point2D$Double; VXWXfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition YZRP_CONNECT_START5ZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; \ ]^getAttachedElement(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Couple; ` ab isAnchored5()Z dfe5fr/orsay/lri/varna/applications/templateEditor/Couple ghsecondLjava/lang/Object; dj khfirst m nogetEdgePositionz(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Ljava/awt/geom/Point2D$Double; q rT getVertex5rc7Lfr/orsay/lri/varna/applications/templateEditor/Couple;LocalVariableTypeTableLfr/orsay/lri/varna/applications/templateEditor/Couple;getEdge3 Vz {ZRP_CONNECT_END3 } ~b isAnchored3  T getVertex3setEdge5dLjava/awt/geom/Point2D$Double;setEdge3  getInS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint getOtherElementF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;  getOut bezToShape>(Lfr/orsay/lri/varna/models/CubicBezierCurve;)Ljava/awt/Shape;java/awt/geom/GeneralPath  *fr/orsay/lri/varna/models/CubicBezierCurve getApproxCurveLength()D  uniformParam#([D)[Ljava/awt/geom/Point2D$Double; java/lang/System outLjava/io/PrintStream; java/io/PrintStream println(I)V + M + N moveTo(FF)V (Ljava/lang/Object;)V lineTo TgetP3,Lfr/orsay/lri/varna/models/CubicBezierCurve;pLjava/awt/geom/GeneralPath;nbItab[Dipoints[Ljava/awt/geom/Point2D$Double;agetCurve()Ljava/awt/Shape;  ST  xT  T getControl5  T getControl3!java/awt/geom/CubicCurve2D$Double  (DDDDDDDD)Vp5p3t5t3estimateNumberOfBases()I |(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;I)V@D java/lang/Math round(D)J max(II)I    setLengthdraw(Ljava/awt/Graphics2D;Z)V   _dashedStrokeLjava/awt/Stroke; java/awt/Graphics2D  setStroke(Ljava/awt/Stroke;)V  BACKBONE_COLORLjava/awt/Color;  setColor(Ljava/awt/Color;)V    getBoundingPolygon()Ljava/awt/Polygon;  (Ljava/awt/Shape;)V   _solidStroke   drawAnchor6(Ljava/awt/Graphics2D;Ljava/awt/geom/Point2D$Double;)V + distance(Ljava/awt/geom/Point2D;)D    drawArrowU(Ljava/awt/Graphics2D;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)V " $ % getLength ' (drawBase * + drawAnchor5 - . drawMagnet 0 1 drawAnchor3g2dLjava/awt/Graphics2D;selectedZd5xd5yd3xd3yshifttp5tp3nbezier curveLengthdelta_ttksequenceBasesCoords E FgetInTangentVectorAngle H IJcos(D)D L MgetInTangentVectorLength O PJsinangle S TgetOutTangentVectorAngle V WgetOutTangentVectorLength Y Z[min(DD)D ] [_java/awt/Polygon ^a b([I[II)VminxmaxxminymaxygetClosestEdge^(DD)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;jjava/util/ArrayList i monjava/lang/Double pqvalueOf(D)Ljava/lang/Double; ds t'(Ljava/lang/Object;Ljava/lang/Object;)V iv wxadd(Ljava/lang/Object;)Z Vz {ZRP_EDIT_TANGENT_5 V} ~ZRP_EDIT_TANGENT_3 V ZRP_OUTER i iterator()Ljava/util/Iterator; java/util/Iterator next()Ljava/lang/Object; m  doubleValue  bhasNextvLjava/util/ArrayList;distLjava/util/ArrayList;>;Lfr/orsay/lri/varna/applications/templateEditor/Couple;getConnectedEdge(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;  ()[I V ordinaledgev2a!(Ljava/awt/geom/Point2D$Double;)D  [atan2updateControl5  updateControl3 translategetRelativePosition  gh m java/awt/Shape contains(Ljava/awt/geom/Point2D;)Z V ZRP_INNER_GENERALrpgetAreaattach(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V Exceptions9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate  4fr/orsay/lri/varna/applications/templateEditor/Helix   getEndPoint(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;   isIn](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Z    disconnect   connectToT(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)VeILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;edgeOrigedgeDeste1QLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;e2parity1parity2detach](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V  b isConnected  setEdgePosition{(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Ljava/awt/geom/Point2D$Double;)V  3  3  3  3posgetConnectedEdges()Ljava/util/ArrayList; Signatures()Ljava/util/ArrayList;resultqLjava/util/ArrayList;getTemplateElement(relativePositionFromEdgeEndPointPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;   Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPositionFLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;   V values]()[Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; V ZRP_CONNECT_END5 V  ZRP_CONNECT_START3 V  Z RP_EDIT_END V Z RP_EDIT_START V Z RP_INNER_MOVEjava/lang/NoSuchFieldError    I()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;  IN1   IN2 " #OUT1 % &OUT2 SourceFileUnpairedRegion.java InnerClassesRelativePosition,/fr/orsay/lri/varna/models/templates/RNATemplateEdgeEndPointPosition/Bfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementRNATemplateElement EdgeEndPointRNATemplateUnpairedSequence4java/awt/geom/CubicCurve2DDouble7java/awt/geom/Point2D!          #i**YYW$&)*)+Y')-0*)+Y' c)-4*) 7*);=*) @*);C*FI* (< F!P"Z#d$h&J*iKLiMiNiOPQF **+)I-/ 0J KL RST-UL*+[M*_,c,iVl *)pI45 6J -KL)sZ #tuv  #twxT-yL*+[M*|,c,iVl *)I;< =J -KL)sZ #tuv  #tw3I *)+0*FIBC DJ KL 3I *)+4*FIHI JJ KL ab;*)INJ KL~b;*)ISJ KL AYL =N6-*koR*-:+226%2:++**+IBYZ [\^$\-`4a=bQcWe^ffgvcijJRt 4aT+^?*L*M*N*:Y++--,,ذIqr stuJ4?KL: 50*9*L*M*N*:Y+-,:odI}~ %J>9KL4 /*$%tH: *)*I  J  KLM *N*:*:*:+*++*  +**+*+-g-o9-g-o9 go9 go9 9+Ykg kg-:+Y kg kg-:*+-*+++*+*! *)#6Y- h:9  `o9 : 6 ` kR :6*+2&*_ *+-) *+-,*| *+/ *+,I* #*2:AH[n '.8>DQ[djt~JKL2345 [6n7 o8 Z9 U:6;<='>.? 8u@ >oA ABdICgBT 7*L*)DI+Y+(G*)Kkc+(N*)Kkc-I "3J 7KL2 *QT 7*L*)RI+Y+(G*)Ukc+(N*)Ukc-I "3J 7KL2 *Q  *L*M*N*:+,-XXX9+,-\\\9+,-XXX9 +,-\\\9 g9c9 g9  c9  YOYOYOYO:  Y OY OY OY O:^Y `I> 1MiJp KL 1cMdie gf *M Ngh+Y')-:*:*:*:*: iYk:  dYlUruW dYlyruW dYlyruW dY l|ruW9 :  :7d:im im9 cV:  IJ #,F`zJz KLMN # , P KsZ (tuv, (tt4+.( (($yUI(,0 J4KL4ZnoI+.< (<<-72*̰*ΰ*а*Ӱ*̰I05:?DJIKLIZ@ ++I!J KL 3<*M*),+7+Y+,g+,g-N*)*-=*FI&'(+)7*;+J*<KL<7+M3<*M*),+@+Y+,g+,g-N*)*-C*FI/01+273;4J*<KL<7+M/A*)pY'c*)pY)c*)Y'c*)Y)cI78 90:@;J AKLAMANhE*'):*+Y')-9*!+Y')-I>?@%A(B=CADJ4EKLEMEN=Z)/*!IIJ KLM*+,-+™A*,:+-:*,6+-6 ѱI. OPRST#U*V;X@YEZL]JRMKLMMZMZ70#)5*"5z:+.0 00(*)*)Ia(d0f8hJ:KL:sZn.+.$ $$"Il(o*q,sJ.KL.sZ*+Ķ*+[M*+Ķ*+Iy {|J KLZtuv twN+.E (EE0@8*,*,*,*,I& 058=@EHMJ NKLNZNliYkL+UuW+yuW+IJKLv /*)IJ KLn.+.$$ UyI$(,J.KL.#YW K*y OW*OW*OW*UOW* OW*OW*| OW*y OW*OW*OW*OW*Y (+,69:DGHQTU^ablopz}~IJJYW K*OW*OW*!OW*$OW*Y&)*367@CIJ'():V*@+-@.+0.1+235 +65 PK m>F22Bfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion.javapackage fr.orsay.lri.varna.applications.templateEditor; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.Shape; import java.awt.geom.CubicCurve2D; import java.awt.geom.GeneralPath; import java.awt.geom.Point2D; import java.awt.geom.Point2D.Double; import java.util.ArrayList; import fr.orsay.lri.varna.applications.templateEditor.GraphicalTemplateElement.RelativePosition; import fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.models.CubicBezierCurve; import fr.orsay.lri.varna.models.templates.RNATemplate; import fr.orsay.lri.varna.models.templates.RNATemplate.EdgeEndPointPosition; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateHelix; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateUnpairedSequence; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement.EdgeEndPoint; public class UnpairedRegion extends GraphicalTemplateElement{ private RNATemplateUnpairedSequence _e; public static final double DEFAULT_VECTOR_LENGTH = 35; public static final double DEFAULT_VECTOR_DISTANCE = 35; public UnpairedRegion(double x, double y, RNATemplate tmp) { _e = tmp.new RNATemplateUnpairedSequence(""); _e.setVertex5(new Point2D.Double(x,y)); _e.setVertex3(new Point2D.Double(x+DEFAULT_VECTOR_DISTANCE,y)); _e.setInTangentVectorLength(DEFAULT_VECTOR_LENGTH); _e.setInTangentVectorAngle(-Math.PI/2.0); _e.setOutTangentVectorLength(DEFAULT_VECTOR_LENGTH); _e.setOutTangentVectorAngle(-Math.PI/2.0); updateLength(); } /** * Build an UnpairedRegion object from a RNATemplateUnpairedSequence * object. The RNATemplateUnpairedSequence must be connected to * an helix on both sides. */ public UnpairedRegion(RNATemplateUnpairedSequence templateSequence) { _e = templateSequence; } public Point2D.Double getEdge5() { RelativePosition r = RelativePosition.RP_CONNECT_START5; Couple c = getAttachedElement(r); return (isAnchored5()? c.second.getEdgePosition(c.first): _e.getVertex5()); } public Point2D.Double getEdge3() { RelativePosition r = RelativePosition.RP_CONNECT_END3; Couple c = getAttachedElement(r); return (isAnchored3()? c.second.getEdgePosition(c.first): _e.getVertex3()); } public void setEdge5(Point2D.Double d) { _e.setVertex5(d); updateLength(); } public void setEdge3(Point2D.Double d) { _e.setVertex3(d); updateLength(); } public boolean isAnchored5() { return (_e.getIn().getOtherElement()!=null); } public boolean isAnchored3() { return (_e.getOut().getOtherElement()!=null); } public static Shape bezToShape(CubicBezierCurve c) { GeneralPath p = new GeneralPath(); int nb = 9; double[] tab = new double[nb]; for (int i=0;i> v = new ArrayList>(); v.add(new Couple(p.distance(p5),RelativePosition.RP_CONNECT_START5)); v.add(new Couple(p.distance(p3),RelativePosition.RP_CONNECT_END3)); v.add(new Couple(p.distance(t5),RelativePosition.RP_EDIT_TANGENT_5)); v.add(new Couple(p.distance(t3),RelativePosition.RP_EDIT_TANGENT_3)); double dist = java.lang.Double.MAX_VALUE; RelativePosition r = RelativePosition.RP_OUTER; for (Couple c : v) { if (c.first c = getAttachedElement(edge); getEndPoint(edge).disconnect(); } // Call the parent class detach function, which will also take care to disconnect this other endpoint of this edge super.detach(edge); } public void setEdgePosition(RelativePosition edge, Point2D.Double pos) { switch(edge) { case RP_CONNECT_START5: setEdge5(pos); break; case RP_CONNECT_END3: setEdge3(pos); break; case RP_EDIT_TANGENT_5: updateControl5(pos); break; case RP_EDIT_TANGENT_3: updateControl3(pos); break; } } public ArrayList getConnectedEdges() { ArrayList result = new ArrayList(); result.add(RelativePosition.RP_CONNECT_START5); result.add(RelativePosition.RP_CONNECT_END3); return result; } public RNATemplateElement getTemplateElement() { return _e; } public RelativePosition relativePositionFromEdgeEndPointPosition( EdgeEndPointPosition pos) { switch (pos) { case IN1: return RelativePosition.RP_CONNECT_START5; case OUT1: return RelativePosition.RP_CONNECT_END3; default: return null; } } } PK 4F>^}xPP:fr/orsay/lri/varna/applications/templateEditor/Helix.class14fr/orsay/lri/varna/applications/templateEditor/HelixGfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement_hBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;BASE_PAIR_DISTANCED ConstantValue@P@ LOOP_DISTANCE@DSELECTION_RADIUS@. EDIT_RADIUS@$ MOVE_RADIUS@* BASE_RADIUS@EDGE_BASE_RADIUS@f$SWITCH_TABLE$fr$orsay$lri$varna$applications$templateEditor$GraphicalTemplateElement$RelativePosition[IR$SWITCH_TABLE$fr$orsay$lri$varna$models$templates$RNATemplate$EdgeEndPointPositionF(DDLfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/util/List;)V Signature(DDLfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/util/List;)VCode ' ()getNextAutomaticCaption$(Ljava/util/List;)Ljava/lang/String; + !,H(DDLjava/lang/String;Lfr/orsay/lri/varna/models/templates/RNATemplate;)VLineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/applications/templateEditor/Helix;xytmp1Lfr/orsay/lri/varna/models/templates/RNATemplate;existingRNAElementsLjava/util/List;LocalVariableTypeTable[Ljava/util/List; : !;()V=@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix ?A@java/lang/Object BCgetClass()Ljava/lang/Class; <E !FF(Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/lang/String;)V H Jjava/awt/geom/Point2D$Double IL !M(DD)V <O PQsetStartPosition!(Ljava/awt/geom/Point2D$Double;)V <S TQsetEndPosition <V WX setLength(I)V <Z [\ setCaption(Ljava/lang/String;)VcapLjava/lang/String;E(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;)V templateHelixo(Ljava/util/List;)Ljava/lang/String;cjava/util/HashSet b: fhgjava/util/List ijiterator()Ljava/util/Iterator; lnmjava/util/Iterator opnext()Ljava/lang/Object; r st getCaption()Ljava/lang/String; vxw java/util/Set yzadd(Ljava/lang/Object;)Z l| }~hasNext()Zjava/lang/StringBuilderH  !\  append(I)Ljava/lang/StringBuilder;  ttoString v zcontainscaptionsLjava/util/Set;elementILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;helixiIcandidateCaption#Ljava/util/Set; toggleFlipped < ~ isFlipped <  setFlipped(Z)V  ;updateAttachedUnpairedRegions  getConnectedEdges()Ljava/util/ArrayList; hjava/util/ArrayListXfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition  getAttachedElement(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/Couple; 5fr/orsay/lri/varna/applications/templateEditor/Couple secondLjava/lang/Object;=fr/orsay/lri/varna/applications/templateEditor/UnpairedRegion  getEdgePositionz(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Ljava/awt/geom/Point2D$Double; first RP_CONNECT_START5ZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; QsetEdge5 RP_CONNECT_END3 QsetEdge3rposc7Lfr/orsay/lri/varna/applications/templateEditor/Couple;unpairedRegion?Lfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion;posLjava/awt/geom/Point2D$Double;Lfr/orsay/lri/varna/applications/templateEditor/Couple;getPosX()D < getStartPosition ()Ljava/awt/geom/Point2D$Double; I 1 <rgetPosY I 2getTemplateElementD()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;setX(D)VsetYsetPos  ; updateLengthp  QgetPos moveCenter < getEndPosition@centerdxdy setExtent  Q  getNbBP()I getExtentX getExtent getExtentY getAbsStart5 I distance(Ljava/awt/geom/Point2D;)D   nxnystart5 getAbsStart3start3 getAbsEnd5   end5 getAbsEnd3end3 getStart5     getStart3getEnd5    getEnd3getBoundingPolygon()Ljava/awt/Polygon;%java/awt/Polygon $: $( )*addPoint(II)VLjava/awt/Polygon; getCentergetCenterEditStartdistgetCenterEditEndgetSelectionBox()Ljava/awt/Shape; 3 "# $5 6xpoints $8 9ypointshboxgetArea = 01getRelativePosition^(DD)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; ACBjava/awt/Shape D(Ljava/awt/geom/Point2D;)Z F - H I RP_EDIT_START K / M N RP_EDIT_END P , R S RP_INNER_MOVE U ! W  Y ZRP_CONNECT_END5 \  ^ _RP_CONNECT_START3 a  c dRP_INNER_GENERAL f gRP_OUTERcurrentLjava/awt/Shape;getClosestEdgeresultdcand p q()[I s tordinal v x edgegetConnectedEdge(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;isAnchored5Start <~ getIn1S()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint getOtherElementF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;isAnchored5End < getOut1isAnchored3Start < getOut2isAnchored3End < getIn2 java/lang/Math round(D)J  max(II)Iextent helLengthdraw(Ljava/awt/Graphics2D;Z)V   _solidStrokeLjava/awt/Stroke; java/awt/Graphics2D  setStroke(Ljava/awt/Stroke;)VP@  BACKBONE_COLORLjava/awt/Color;  setColor(Ljava/awt/Color;)V  z{   _mainColorsLjava/util/HashMap; java/util/HashMap z containsKey  get&(Ljava/lang/Object;)Ljava/lang/Object;java/awt/Color   _boldStroke  drawLine(IIII)V   NUMBER_COLOR?  drawStringCentered,(Ljava/awt/Graphics2D;Ljava/lang/String;DD)V <  getLength  BASE_PAIR_COLOR  ~   drawMagnet6(Ljava/awt/Graphics2D;Ljava/awt/geom/Point2D$Double;)V   drawAnchor3  ~   drawAnchor5  |~  ~  drawBase   _dashedStroke  (Ljava/awt/Shape;)V  drawMove   drawEditStartR(Ljava/awt/Graphics2D;Lfr/orsay/lri/varna/applications/templateEditor/Helix;DDDD)V   drawEditEndg2dLjava/awt/Graphics2D; isSelectedZep1p2captionxcaptiony nbBasePairsp5p3 translate  M  MgetHelix getEndPoint(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;risIn](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)Zattach(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V Exceptions9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate   "  " %  % ( ); disconnect + ,- connectToT(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)VedgeOrigedgeDeste1QLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;e2parity1parity2detach](Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)V 8 9~ isConnected ; 56setEdgePosition{(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Ljava/awt/geom/Point2D$Double;)V ? Ms()Ljava/util/ArrayList; : xLjava/util/ArrayList;qLjava/util/ArrayList;FHelix H I-(Ljava/lang/String;)Ljava/lang/StringBuilder;(relativePositionFromEdgeEndPointPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; M q OsPDfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPositionFLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; S U  W XYvalues]()[Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition; [ \RP_EDIT_TANGENT_3 ^ _RP_EDIT_TANGENT_5ajava/lang/NoSuchFieldError c  Oe XfI()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; Oh iQIN1 Ok lQIN2 On oQOUT1 Oq rQOUT2 SourceFile Helix.java InnerClassesRelativePositionx/fr/orsay/lri/varna/models/templates/RNATemplateEdgeEndPointPosition{Bfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementRNATemplateElement EdgeEndPointRNATemplateHelixjava/awt/geom/Point2DDouble!             ;!"#$%v*')&*-  .4/01234567 58!,%J*9*WDG*GIY')KN*GIY')KR*GU*GY- (!8"@#I$.4J/0J1J2J]^J34!_%F *9*+G-&' (. /0 ` ()#a%kbYdL*eN.-kM,,:q+quW-{=YN+---2 -./#0)112=.F7H8Y9c:e7.>k56c!)0H#Y ^7k58c;%M*G*G*-ABC. /0;%h*MV,kL*+N-B-8-:*+:- ç-Ʀ ,{-. MNO)P2Q9RCSMTWU^MgY.4h/0IC2,9%7 C%5 *Gִگ-].  /0st%2*Gܰ-b. /0%5 *Gִޯ-g.  /0%/*G-l. /0%D *G'ڱ- q r. /0 1%D *G'ޱ- v w. /0 2Q%I *G+N*-{| }. /0 M%P*IY')K-  . /012%2*Gְ-. /0M% IY*Gִ*Gco*Gִ*GcoK:'g9)g9*GIY*Gִc*GִcKN*GIY*Gc*GcKR-;DMu.>/012;cDZMQM%P*IY')K-  . /012;%: *G*U-  .  /0Q%I *G+R*- . /0 %5 *Gگ-.  /0%2*G-. /0%5 *Gޯ-.  /0% *Gִ*Gg*G*GoH*Gִ*Gg*G*GoJ)9'w9IY* kog* kogK:  -(PSW~.>/0(YP1S. W* ~  % *Gִ*Gg*G*GoH*Gִ*Gg*G*GoJ)9'w9IY* koc* kocK:  -(PSW~.>/0(YP1S. W* ~ % *Gִ*Gg*G*GoH*Gִ*Gg*G*GoJ)9'w9IY* kog* kogK:  -(PSW~.>/0(YP1S. W* ~ % *Gִ*Gg*G*GoH*Gִ*Gg*G*GoJ)9'w9IY* koc* kocK:  -(PSW~.>/0(YP1S. W* ~ %F*G**- . /0%F*G**- . /0%F*G**- . /0!%F*G**- . /0"#% C*Gִ*Gg*G*GoH*Gִ*Gg*G*GoJ)9'w9IY* koc* kocK: IY* koc* kocK: IY* kog* kogK: IY* kog* kogK: $Y&:   ڎ ގ'  ڎ ގ'  ڎ ގ'  ڎ ގ' -:(PSW~      /@.f C/0(PS W ~  w P G+ ,%p>IY*Gִ*Gco*Gִ*GcoK-:. >/0-% t*G*GH*G*Gִg'oJ*G*Gִg'o9IY*Gִ'g)kc*Gִ'gkcK-* C!["p!.*t/0b.*JC1/% p*G*GH*G*Gִg'oJ*G*Gִg'o9IY*Gִ)kc*GִkcK-'(*)C*Y+l*.*p/0^.*FC-01%# ]*Gִ*Gg*G*GoH*Gִ*Gg*G*GoJ)9'w9*2: $Y&: IY 4.'ckc 7.)ckcK: IY 4.'wckc 7.)wckcK: IY 4.'wgkc 7.)wgkcK: IY 4.'gkc 7.)gkcK:  ڎ ގ'  ڎ ގ'  ڎ ގ' ڎގ' ->1(2P3S4W5]6f789:;'<8=I>Z?.p ]/0(5P S  W ]:+ f+   r G ;1%/*<-D. /0>?%KIY')K:*<:@*EG*JL*OQ*Tư*VX*[]*`be-NP QRT-V1XAZE\U^Y`ibmd}fhjlnqt.4/012 hij?%: e:k9IY')K:*`9    9:*[9    9]:*V9    9X:*T9    9:-Ryz {| }(,1<DHMX`dit|.H/012m ~.sh hn %\o+r.O J@E6;1,*T*V*`*[*u*w*O*O-& 49>CHMRW.\/0\yz{%<o+r.0 (,$ ]Xưe-(,048.</0<y|~%;*G}-. /0~%;*G-. /0~%;*G-. /0~%;*G-. /0%t *uL*wM+,J) o`- .* /0 %0 +**uN*w:-g-o9-g-o9 ko9 ko9 *`: *V:*[:*T:*:k:+*+*:**:*+*Ķ+*ƶ+ڎގclcl{z+Ͷ*G Чk kcoc9*G Чk kcoc9*+*q*G6+*65+۶IY kddkcdo kddkcdoK:IYkddkcdokddkcdoK:+ڎގڎގ6*ޙ *+ *+* *+W*+Md6* *+ *+* *+*+*+*+\9 w9 *<:++*+*O:+**+*+*ww  *+*ww  -D &9EQW]ci/Yfow} */ 6 @ GNXbkr|"#')*+,-./01235./0 &9E  Q  W ]c is\P / Y o z< Ji/M%1*u:*w:*'c)c*'c)c-9: ;<0=.41/01112+ %%/*G-@. /0%Jo+r.@ (80*G}*G*G*G-E(H0J8L@NHP.J/0J%z2o+r.( "&$-T(W*Y,[.]0_.2/02%F*+,-*,!:+-#:*,$6+-&6 ''*-* efghi#j4l9m>nEp.RF/0FF.F/801121*3##456%Y*+!7 *+!'*+:-w y}~./0y<=%Eo+r.8,$*,*,*,,޶>*-"$),14@D. E/0EyE#@%*YAL+BW+]BW+XBW+ƶBW+- (.*/0"mC7 "mDt%?YE*qG-. /0JK%:L+N.0 ($,Xư]-(,048.:/0:QA%%*R-.q%#TYWV K*ƶr OW*XrOW*]rOW*rOW*LrOW*GrOW*Zr OW*]r OW*brOW*QrOW*erOW*YT `(+`,69`:DG`HQT`U^a`blo`pz}`~```-. q%JbYWd K*gNOW*jNOW*mNOW*pNOW*Yb`&)`*36`7@C`-.stu2v@Owy@zw|z}<w~I PK m> (Wn=M=M9fr/orsay/lri/varna/applications/templateEditor/Helix.javapackage fr.orsay.lri.varna.applications.templateEditor; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.Shape; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.models.templates.RNATemplate; import fr.orsay.lri.varna.models.templates.RNATemplate.EdgeEndPointPosition; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateHelix; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement.EdgeEndPoint; public class Helix extends GraphicalTemplateElement{ RNATemplateHelix _h; public Helix(double x, double y, RNATemplate tmp, List existingRNAElements) { this(x,y,getNextAutomaticCaption(existingRNAElements),tmp); } public Helix(double x, double y, String cap, RNATemplate tmp) { _h = tmp.new RNATemplateHelix(cap); _h.setStartPosition(new Point2D.Double(x,y)); _h.setEndPosition(new Point2D.Double(x,y)); _h.setLength(1); _h.setCaption(cap); } public Helix(RNATemplateHelix templateHelix) { _h = templateHelix; } private static String getNextAutomaticCaption(List existingRNAElements) { // Find which captions are already used Set captions = new HashSet(); for (GraphicalTemplateElement element: existingRNAElements) { if (element instanceof Helix) { Helix helix = (Helix) element; if (helix.getCaption() != null) { captions.add(helix.getCaption()); } } } // Find a non-conflicting name for this helix for (int i=1;;i++) { String candidateCaption = "H" + i; if (! captions.contains(candidateCaption)) { return candidateCaption; } } } public void toggleFlipped() { _h.setFlipped(!_h.isFlipped()); updateAttachedUnpairedRegions(); } /** * When an helix is moved/resized/etc... it is necessary to update * the positions of endpoints from unpaired regions that are attached * to the helix. This function updates the endpoints positions of * attached unpaired regions. */ public void updateAttachedUnpairedRegions() { for (RelativePosition rpos: getConnectedEdges()) { Couple c = getAttachedElement(rpos); if (c != null && c.second instanceof UnpairedRegion) { UnpairedRegion unpairedRegion = (UnpairedRegion) c.second; Point2D.Double pos = getEdgePosition(rpos); if (c.first == RelativePosition.RP_CONNECT_START5) { unpairedRegion.setEdge5(pos); } else if (c.first == RelativePosition.RP_CONNECT_END3) { unpairedRegion.setEdge3(pos); } } } } public double getPosX() { return _h.getStartPosition().x; } public String getCaption() { return _h.getCaption(); } public double getPosY() { return _h.getStartPosition().y; } public RNATemplateHelix getTemplateElement() { return _h; } public void setX(double x) { _h.getStartPosition().x = x; } public void setY(double y) { _h.getStartPosition().y = y; } public void setPos(Point2D.Double p) { _h.setStartPosition(p); updateLength(); } public void setPos(double x, double y) { setPos(new Point2D.Double(x,y)); } public Point2D.Double getPos() { return _h.getStartPosition(); } public void moveCenter(double x, double y) { Point2D.Double center = new Point2D.Double((_h.getStartPosition().x+_h.getEndPosition().x)/2.0,(_h.getStartPosition().y+_h.getEndPosition().y)/2.0); double dx = x-center.x; double dy = y-center.y; _h.setStartPosition(new Point2D.Double(_h.getStartPosition().x+dx,_h.getStartPosition().y+dy)); _h.setEndPosition(new Point2D.Double(_h.getEndPosition().x+dx,_h.getEndPosition().y+dy)); } public void setExtent(double x, double y) { setExtent(new Point2D.Double(x,y)); } private void updateLength() { _h.setLength(getNbBP()); } public void setExtent(Point2D.Double p) { _h.setEndPosition(p); updateLength(); } public double getExtentX() { return _h.getEndPosition().x; } public Point2D.Double getExtent() { return _h.getEndPosition(); } public double getExtentY() { return _h.getEndPosition().y; } public static final double BASE_PAIR_DISTANCE = RNA.BASE_PAIR_DISTANCE; public static final double LOOP_DISTANCE = RNA.LOOP_DISTANCE; public static final double SELECTION_RADIUS = 15.0; public Point2D.Double getAbsStart5() { double dx = (_h.getStartPosition().x-_h.getEndPosition().x)/(_h.getStartPosition().distance(_h.getEndPosition())); double dy = (_h.getStartPosition().y-_h.getEndPosition().y)/(_h.getStartPosition().distance(_h.getEndPosition())); double nx = dy; double ny = -dx; Point2D.Double start5 = new Point2D.Double((getPosX()-Helix.BASE_PAIR_DISTANCE*nx/2.0),(getPosY()-Helix.BASE_PAIR_DISTANCE*ny/2.0)); return start5; } public Point2D.Double getAbsStart3() { double dx = (_h.getStartPosition().x-_h.getEndPosition().x)/(_h.getStartPosition().distance(_h.getEndPosition())); double dy = (_h.getStartPosition().y-_h.getEndPosition().y)/(_h.getStartPosition().distance(_h.getEndPosition())); double nx = dy; double ny = -dx; Point2D.Double start3 = new Point2D.Double((getPosX()+Helix.BASE_PAIR_DISTANCE*nx/2.0),(getPosY()+Helix.BASE_PAIR_DISTANCE*ny/2.0)); return start3; } public Point2D.Double getAbsEnd5() { double dx = (_h.getStartPosition().x-_h.getEndPosition().x)/(_h.getStartPosition().distance(_h.getEndPosition())); double dy = (_h.getStartPosition().y-_h.getEndPosition().y)/(_h.getStartPosition().distance(_h.getEndPosition())); double nx = dy; double ny = -dx; Point2D.Double end5 = new Point2D.Double((getExtentX()-Helix.BASE_PAIR_DISTANCE*nx/2.0),(getExtentY()-Helix.BASE_PAIR_DISTANCE*ny/2.0)); return end5; } public Point2D.Double getAbsEnd3() { double dx = (_h.getStartPosition().x-_h.getEndPosition().x)/(_h.getStartPosition().distance(_h.getEndPosition())); double dy = (_h.getStartPosition().y-_h.getEndPosition().y)/(_h.getStartPosition().distance(_h.getEndPosition())); double nx = dy; double ny = -dx; Point2D.Double end3 = new Point2D.Double((getExtentX()+Helix.BASE_PAIR_DISTANCE*nx/2.0),(getExtentY()+Helix.BASE_PAIR_DISTANCE*ny/2.0)); return end3; } public Point2D.Double getStart5() { if (_h.isFlipped()) return getAbsStart3(); else return getAbsStart5(); } public Point2D.Double getStart3() { if (_h.isFlipped()) return getAbsStart5(); else return getAbsStart3(); } public Point2D.Double getEnd5() { if (_h.isFlipped()) return getAbsEnd3(); else return getAbsEnd5(); } public Point2D.Double getEnd3() { if (_h.isFlipped()) return getAbsEnd5(); else return getAbsEnd3(); } public Polygon getBoundingPolygon() { double dx = (_h.getStartPosition().x-_h.getEndPosition().x)/(_h.getStartPosition().distance(_h.getEndPosition())); double dy = (_h.getStartPosition().y-_h.getEndPosition().y)/(_h.getStartPosition().distance(_h.getEndPosition())); double nx = dy; double ny = -dx; Point2D.Double start5 = new Point2D.Double((getPosX()+Helix.BASE_PAIR_DISTANCE*nx/2.0),(getPosY()+Helix.BASE_PAIR_DISTANCE*ny/2.0)); Point2D.Double end5 = new Point2D.Double((getExtentX()+Helix.BASE_PAIR_DISTANCE*nx/2.0),(getExtentY()+Helix.BASE_PAIR_DISTANCE*ny/2.0)); Point2D.Double start3 = new Point2D.Double((getPosX()-Helix.BASE_PAIR_DISTANCE*nx/2.0),(getPosY()-Helix.BASE_PAIR_DISTANCE*ny/2.0)); Point2D.Double end3 = new Point2D.Double((getExtentX()-Helix.BASE_PAIR_DISTANCE*nx/2.0),(getExtentY()-Helix.BASE_PAIR_DISTANCE*ny/2.0)); Polygon p = new Polygon(); p.addPoint((int)start5.x, (int)start5.y); p.addPoint((int)end5.x, (int)end5.y); p.addPoint((int)end3.x, (int)end3.y); p.addPoint((int)start3.x, (int)start3.y); return p; } public Point2D.Double getCenter() { return new Point2D.Double((int)((_h.getStartPosition().x+_h.getEndPosition().x)/2.0), (int)((_h.getStartPosition().y+_h.getEndPosition().y)/2.0)); } public Point2D.Double getCenterEditStart() { double dist = _h.getStartPosition().distance(_h.getEndPosition()); double dx = (_h.getEndPosition().x-_h.getStartPosition().x)/(dist); double dy = (_h.getEndPosition().y-_h.getStartPosition().y)/(dist); return new Point2D.Double((int)(_h.getStartPosition().x+(dist-10.0)*dx), (int)(_h.getStartPosition().y+(dist-10.0)*dy)); } public Point2D.Double getCenterEditEnd() { double dist = _h.getStartPosition().distance(_h.getEndPosition()); double dx = (_h.getEndPosition().x-_h.getStartPosition().x)/(dist); double dy = (_h.getEndPosition().y-_h.getStartPosition().y)/(dist); return new Point2D.Double((int)(_h.getStartPosition().x+(10.0)*dx), (int)(_h.getStartPosition().y+(10.0)*dy)); } public Shape getSelectionBox() { double dx = (_h.getStartPosition().x-_h.getEndPosition().x)/(_h.getStartPosition().distance(_h.getEndPosition())); double dy = (_h.getStartPosition().y-_h.getEndPosition().y)/(_h.getStartPosition().distance(_h.getEndPosition())); double nx = dy; double ny = -dx; Polygon hbox = getBoundingPolygon(); Polygon p = new Polygon(); Point2D.Double start5 = new Point2D.Double(hbox.xpoints[0]+SELECTION_RADIUS*(dx+nx),hbox.ypoints[0]+SELECTION_RADIUS*(dy+ny)); Point2D.Double end5 = new Point2D.Double(hbox.xpoints[1]+SELECTION_RADIUS*(-dx+nx),hbox.ypoints[1]+SELECTION_RADIUS*(-dy+ny)); Point2D.Double end3 = new Point2D.Double(hbox.xpoints[2]+SELECTION_RADIUS*(-dx-nx),hbox.ypoints[2]+SELECTION_RADIUS*(-dy-ny));; Point2D.Double start3 = new Point2D.Double(hbox.xpoints[3]+SELECTION_RADIUS*(dx-nx),hbox.ypoints[3]+SELECTION_RADIUS*(dy-ny));; p.addPoint((int)start5.x, (int)start5.y); p.addPoint((int)end5.x, (int)end5.y); p.addPoint((int)end3.x, (int)end3.y); p.addPoint((int)start3.x, (int)start3.y); return p; } public Shape getArea() { return getSelectionBox(); } public static final double EDIT_RADIUS = 10.0; public static final double MOVE_RADIUS = 13.0; public static final double BASE_RADIUS = 3.0; public static final double EDGE_BASE_RADIUS = 7.0; public RelativePosition getRelativePosition(double x, double y) { Point2D.Double current = new Point2D.Double(x,y); Shape p = getSelectionBox(); if (p.contains(current)) { if (getCenterEditStart().distance(current) getConnectedEdges() { ArrayList result = new ArrayList(); result.add(RelativePosition.RP_CONNECT_START5); result.add(RelativePosition.RP_CONNECT_START3); result.add(RelativePosition.RP_CONNECT_END5); result.add(RelativePosition.RP_CONNECT_END3); return result; } public String toString() { return "Helix " + getCaption(); } public RelativePosition relativePositionFromEdgeEndPointPosition( EdgeEndPointPosition pos) { switch (pos) { case IN1: return RelativePosition.RP_CONNECT_START5; case OUT1: return RelativePosition.RP_CONNECT_END5; case IN2: return RelativePosition.RP_CONNECT_END3; case OUT2: return RelativePosition.RP_CONNECT_START3; default: return null; } } } PK 4F>tO?fr/orsay/lri/varna/applications/templateEditor/Connection.class1,9fr/orsay/lri/varna/applications/templateEditor/Connectionjava/lang/Object_h1ILfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;_edge1ZLfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;_h2_edge2I(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;)VCode  ()V        LineNumberTableLocalVariableTablethis;Lfr/orsay/lri/varna/applications/templateEditor/Connection;h1edge1h2edge2equals>(Lfr/orsay/lri/varna/applications/templateEditor/Connection;)Zc SourceFileConnection.java InnerClasses(Xfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition*Gfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElementRelativePosition!    **+*-*,*  4 !" d0*+&*+*+*+00#$%& ')+@PK pq<>fr/orsay/lri/varna/applications/templateEditor/Connection.javapackage fr.orsay.lri.varna.applications.templateEditor; public class Connection { public GraphicalTemplateElement _h1; public GraphicalTemplateElement.RelativePosition _edge1; public GraphicalTemplateElement _h2; public GraphicalTemplateElement.RelativePosition _edge2; public Connection(GraphicalTemplateElement h1, GraphicalTemplateElement.RelativePosition edge1,GraphicalTemplateElement h2, GraphicalTemplateElement.RelativePosition edge2) { _h1 = h1; _h2 = h2; _edge1 = edge1; _edge2 = edge2; } public boolean equals( Connection c) { return ((_h1==c._h1)&&(_h2==c._h2)&&(_edge1==c._edge1)&&(_edge2==c._edge2)); } } PK 4F>hhJfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI.class1Dfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUIjava/lang/Object_undoableEditSupport&Ljavax/swing/undo/UndoableEditSupport;_tp>Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;A(Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)VCode  ()V  $javax/swing/undo/UndoableEditSupport  (Ljava/lang/Object;)V  LineNumberTableLocalVariableTablethisFLfr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI;tpundoableEdgeMove(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;DD)V Xfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementEdgeMoveTemplateEdit " #(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement;Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;DDLfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)V % &'postEdit"(Ljavax/swing/undo/UndoableEdit;)V)java/awt/geom/Point2D$Double (+ ,(DD)V .0/Gfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement 12setEdgePosition{(Lfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition;Ljava/awt/geom/Point2D$Double;)V 465(Lfr/orsay/lri/varna/applications/templateEditor/Connection;)VVfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementDetachTemplateEdit 4 removeConnection flipHelixUI9(Lfr/orsay/lri/varna/applications/templateEditor/Helix;)VRfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$HelixFlipTemplateEdit w(Lfr/orsay/lri/varna/applications/templateEditor/Helix;Lfr/orsay/lri/varna/applications/templateEditor/TemplatePanel;)V 4 flip getTemplate3()Lfr/orsay/lri/varna/models/templates/RNATemplate; 4  SourceFileTemplateEditorPanelUI.java InnerClassesRelativePosition=?@ T *+A(F*  89 <= >=HI T *+J(F!*  8M <= >=NI T *+O(F#*  8M <= >=RI T *+S(F%*  8M <= >=VW T *+X(F'*  8[ <= >=\W T *+](F)*  8[ <= >=`W T *+a(F+*  8[ <= >=de X*fY+*h$*+k01289ne X*oY+*q$*+r67889uv A *+w =>  z{|} .+,-~%*+,-:*Y*$E GH-J>..9.;.9.; X*Y+*$*+NOP c#*Y+*$*+*3TUV"W##8[ 2*[ BB.@f  o ( PK efr/orsay/lri/varna/components/PK 4F>kpFQxx2fr/orsay/lri/varna/components/ActionRenderer.class1-,fr/orsay/lri/varna/components/ActionRendererjavax/swing/JButton#javax/swing/table/TableCellRendererserialVersionUIDJ ConstantValue()VCode  LineNumberTableLocalVariableTablethis.Lfr/orsay/lri/varna/components/ActionRenderer;getTableCellRendererComponent@(Ljavax/swing/JTable;Ljava/lang/Object;ZZII)Ljava/awt/Component; java/lang/Object toString()Ljava/lang/String;   setText(Ljava/lang/String;)VtableLjavax/swing/JTable;buttonLjava/lang/Object; isSelectedZhasFocusrowIcolumn SourceFileActionRenderer.java!   3*  t *,* H  !" #$ %& '& () *)+,PK p(>Kr1fr/orsay/lri/varna/components/ActionRenderer.java package fr.orsay.lri.varna.components; import java.awt.Color; import java.awt.Component; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.border.Border; import javax.swing.table.TableCellRenderer; public class ActionRenderer extends JButton implements TableCellRenderer { /** * */ private static final long serialVersionUID = 1L; public ActionRenderer() { } public Component getTableCellRendererComponent(JTable table, Object button, boolean isSelected, boolean hasFocus, int row, int column) { this.setText(button.toString()); return this; } } PK 4F>|,GDfr/orsay/lri/varna/components/ReorderableJList$RJLTransferable.class1>>fr/orsay/lri/varna/components/ReorderableJList$RJLTransferablejava/lang/Object"java/awt/datatransfer/TransferableobjectLjava/lang/Object;this$00Lfr/orsay/lri/varna/components/ReorderableJList;E(Lfr/orsay/lri/varna/components/ReorderableJList;Ljava/lang/Object;)VCode   ()V  LineNumberTableLocalVariableTablethis@Lfr/orsay/lri/varna/components/ReorderableJList$RJLTransferable;ogetTransferData6(Ljava/awt/datatransfer/DataFlavor;)Ljava/lang/Object; Exceptions0java/awt/datatransfer/UnsupportedFlavorException java/io/IOException " #$isDataFlavorSupported%(Ljava/awt/datatransfer/DataFlavor;)Z & '%(Ljava/awt/datatransfer/DataFlavor;)Vdf"Ljava/awt/datatransfer/DataFlavor; +-,.fr/orsay/lri/varna/components/ReorderableJList .)localObjectFlavor 021 java/awt/datatransfer/DataFlavor 3$equalsgetTransferDataFlavors%()[Ljava/awt/datatransfer/DataFlavor; +7 89supportedFlavors#[Ljava/awt/datatransfer/DataFlavor; SourceFileReorderableJList.java InnerClassesRJLTransferable    K*+**,  R*+!*Y+% ()#$ <+*/()45 .6 :;< +=PK 4F>Q*+Pfr/orsay/lri/varna/components/ReorderableJList$ReorderableListCellRenderer.class1]Jfr/orsay/lri/varna/components/ReorderableJList$ReorderableListCellRenderer#javax/swing/DefaultListCellRenderer isTargetCellZ isLastItemthis$00Lfr/orsay/lri/varna/components/ReorderableJList;3(Lfr/orsay/lri/varna/components/ReorderableJList;)VCode    ()VLineNumberTableLocalVariableTablethisLLfr/orsay/lri/varna/components/ReorderableJList$ReorderableListCellRenderer;getListCellRendererComponent>(Ljavax/swing/JList;Ljava/lang/Object;IZZ)Ljava/awt/Component; .fr/orsay/lri/varna/components/ReorderableJList dropTargetIndexI   !#"javax/swing/JList $%getModel()Ljavax/swing/ListModel; ')(javax/swing/ListModel *+getSize()I -  / listLjavax/swing/JList;valueLjava/lang/Object;index isSelectedhasFocus showSelectedpaintComponent(Ljava/awt/Graphics;)V ; 89 =?>java/awt/Color @AblackLjava/awt/Color; CEDjava/awt/Graphics FGsetColor(Ljava/awt/Color;)V I *J()Ljava/awt/Dimension; LNMjava/awt/Dimension Owidth CQ RSdrawLine(IIII)V LU VheightgLjava/awt/Graphics; SourceFileReorderableJList.java InnerClassesReorderableListCellRenderer    4 *+ *   O** *+ &d* + &,6*+,.?CFIKHOO01O23O4O5O6C 789 N*+:*+<B+*HKP*,(+<B+*HTd*HK*HTdP" !(/MNNWXYZ[ \PK 4F>Bym4fr/orsay/lri/varna/components/ReorderableJList.class17.fr/orsay/lri/varna/components/ReorderableJListjavax/swing/JListjava/awt/dnd/DragSourceListenerjava/awt/dnd/DropTargetListener  java/awt/dnd/DragGestureListenerlocalObjectFlavor"Ljava/awt/datatransfer/DataFlavor;supportedFlavors#[Ljava/awt/datatransfer/DataFlavor; dragSourceLjava/awt/dnd/DragSource; dropTargetLjava/awt/dnd/DropTarget;dropTargetIndexI draggedIndex()VCode java/awt/datatransfer/DataFlavor&application/x-java-jvm-local-objectref   (Ljava/lang/String;)V " $&% java/lang/ClassNotFoundException 'printStackTrace ) LineNumberTableLocalVariableTablecnfe"Ljava/lang/ClassNotFoundException; /  1 3Jfr/orsay/lri/varna/components/ReorderableJList$ReorderableListCellRenderer 25 63(Lfr/orsay/lri/varna/components/ReorderableJList;)V 8 9:setCellRenderer!(Ljavax/swing/ListCellRenderer;)V<javax/swing/DefaultListModel ;/ ? @AsetModel(Ljavax/swing/ListModel;)VCjava/awt/dnd/DragSource B/ F  BH IJ"createDefaultDragGestureRecognizer](Ljava/awt/Component;ILjava/awt/dnd/DragGestureListener;)Ljava/awt/dnd/DragGestureRecognizer;Ljava/awt/dnd/DropTarget KN O8(Ljava/awt/Component;Ljava/awt/dnd/DropTargetListener;)V Q this0Lfr/orsay/lri/varna/components/ReorderableJList;dgr$Ljava/awt/dnd/DragGestureRecognizer;dragGestureRecognized"(Ljava/awt/dnd/DragGestureEvent;)V Y[Zjava/lang/System \]outLjava/io/PrintStream;V `bajava/io/PrintStream c println egfjava/awt/dnd/DragGestureEvent hi getDragOrigin()Ljava/awt/Point; k lmlocationToIndex(Ljava/awt/Point;)I o pqgetModel()Ljavax/swing/ListModel; sutjavax/swing/ListModel vw getElementAt(I)Ljava/lang/Object;y>fr/orsay/lri/varna/components/ReorderableJList$RJLTransferable x{ |E(Lfr/orsay/lri/varna/components/ReorderableJList;Ljava/lang/Object;)V ~java/awt/Cursor getDefaultCursor()Ljava/awt/Cursor; B  startDragx(Ljava/awt/dnd/DragGestureEvent;Ljava/awt/Cursor;Ljava/awt/datatransfer/Transferable;Ljava/awt/dnd/DragSourceListener;)VdgeLjava/awt/dnd/DragGestureEvent; clickPointLjava/awt/Point;indextargetLjava/lang/Object;trans$Ljava/awt/datatransfer/Transferable; dragDropEnd%(Ljava/awt/dnd/DragSourceDropEvent;)V dragDropEnd()    repaintdsde"Ljava/awt/dnd/DragSourceDropEvent; dragEnter%(Ljava/awt/dnd/DragSourceDragEvent;)V"Ljava/awt/dnd/DragSourceDragEvent;dragExit!(Ljava/awt/dnd/DragSourceEvent;)VdseLjava/awt/dnd/DragSourceEvent;dragOverdropActionChanged%(Ljava/awt/dnd/DropTargetDragEvent;)V  java/awt/dnd/DropTargetDragEvent  getSource()Ljava/lang/Object;  rejectDrag  acceptDrag(I)Vaccepted dragEnterdtde"Ljava/awt/dnd/DropTargetDragEvent;!(Ljava/awt/dnd/DropTargetEvent;)VdteLjava/awt/dnd/DropTargetEvent; i getLocation   getCellBounds(II)Ljava/awt/Rectangle; java/awt/Point y java/awt/Rectangle height ` c dragPointrLjava/awt/Rectangle;drop%(Ljava/awt/dnd/DropTargetDropEvent;)Vdrop()!  java/awt/dnd/DropTargetDropEventjava/lang/StringBuilderrejecting for bad source (  java/lang/Object getClass()Ljava/lang/Class; java/lang/Class getName()Ljava/lang/String; append-(Ljava/lang/String;)Ljava/lang/StringBuilder;) toString  rejectDrop drop index is (I)Ljava/lang/StringBuilder;dropped onto self  acceptDropaccepted  getTransferable&()Ljava/awt/datatransfer/Transferable;  "java/awt/datatransfer/Transferable   getTransferData6(Ljava/awt/datatransfer/DataFlavor;)Ljava/lang/Object; drop  to  source is not before target insert at ; wremove ;  add(ILjava/lang/Object;)V "&#java/lang/Exception % &' dropComplete(Z)V"Ljava/awt/dnd/DropTargetDropEvent; dropPointdroppedZdraggedsourceBeforeTargetmodLjavax/swing/DefaultListModel;eLjava/lang/Exception; SourceFileReorderableJList.java InnerClassesRJLTransferableReorderableListCellRenderer!    d"Y!K*#Y!S( $*' &(*! + ,-D*.*0*2Y*47*;Y=>*BYDE*E**GL*KY**MP*. 1. 23 4+60718265569+DRS6TUVWEX^_+dM*,j>*nr:xY*z:*0*E+}**2 >@ ABCD%E1F6G>HAGDI+>ERSE 82% 1[X_**0**LM NOP+RS5*Q+RS5*R+RS5*S+RS5*T+RSp(X_+*P ++X_*WXY[\'^+(RS(5*_+RS5*a+RSb+*P++M*,j>**/***:,l` *Y`X***2 e fghij'l5mIoSr]sat+4bRSbNH5}XӶ_+*P,XYڷ+նݶ_++M*,j>"*:,l`XY_6*0 *0`X_++X_+!:XY *0_*06XY _XY d_*n;:*0W d6 :!+$o"lo"*(wxyz4y7{;|<~AGLThk!.@CLVioqv|+f }RS}(A<)G6T*+,x-+L#./q01234x526PK \>Ê3fr/orsay/lri/varna/components/ReorderableJList.javapackage fr.orsay.lri.varna.components; import java.awt.Color; import java.awt.Component; import java.awt.Cursor; import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.dnd.DnDConstants; import java.awt.dnd.DragGestureEvent; import java.awt.dnd.DragGestureListener; import java.awt.dnd.DragGestureRecognizer; import java.awt.dnd.DragSource; import java.awt.dnd.DragSourceDragEvent; import java.awt.dnd.DragSourceDropEvent; import java.awt.dnd.DragSourceEvent; import java.awt.dnd.DragSourceListener; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.io.IOException; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JList; public class ReorderableJList extends JList implements DragSourceListener, DropTargetListener, DragGestureListener { static DataFlavor localObjectFlavor; static { try { localObjectFlavor = new DataFlavor (DataFlavor.javaJVMLocalObjectMimeType); } catch (ClassNotFoundException cnfe) { cnfe.printStackTrace(); } } static DataFlavor[] supportedFlavors = { localObjectFlavor }; DragSource dragSource; DropTarget dropTarget; int dropTargetIndex; int draggedIndex = -1; public ReorderableJList () { super(); setCellRenderer (new ReorderableListCellRenderer()); setModel (new DefaultListModel()); dragSource = new DragSource(); DragGestureRecognizer dgr = dragSource.createDefaultDragGestureRecognizer (this, DnDConstants.ACTION_MOVE, this); dropTarget = new DropTarget (this, this); } // DragGestureListener public void dragGestureRecognized (DragGestureEvent dge) { System.out.println ("dragGestureRecognized"); // find object at this x,y Point clickPoint = dge.getDragOrigin(); int index = locationToIndex(clickPoint); if (index == -1) return; Object target = getModel().getElementAt(index); Transferable trans = new RJLTransferable (target); draggedIndex = index; dragSource.startDrag (dge,Cursor.getDefaultCursor(), trans, this); } // DragSourceListener events public void dragDropEnd (DragSourceDropEvent dsde) { System.out.println ("dragDropEnd()"); dropTargetIndex = -1; draggedIndex = -1; repaint(); } public void dragEnter (DragSourceDragEvent dsde) {} public void dragExit (DragSourceEvent dse) {} public void dragOver (DragSourceDragEvent dsde) {} public void dropActionChanged (DragSourceDragEvent dsde) {} // DropTargetListener events public void dragEnter (DropTargetDragEvent dtde) { System.out.println ("dragEnter"); if (dtde.getSource() != dropTarget) dtde.rejectDrag(); else { dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE); System.out.println ("accepted dragEnter"); } } public void dragExit (DropTargetEvent dte) {} public void dropActionChanged (DropTargetDragEvent dtde) {} public void dragOver (DropTargetDragEvent dtde) { // figure out which cell it's over, no drag to self if (dtde.getSource() != dropTarget) dtde.rejectDrag(); Point dragPoint = dtde.getLocation(); int index = locationToIndex (dragPoint); dropTargetIndex = index; if (dropTargetIndex != -1) { Rectangle r = getCellBounds(dropTargetIndex,dropTargetIndex); if (dragPoint.y > r.y+r.height/2) { dropTargetIndex += 1; } } System.out.println(dropTargetIndex); repaint(); } public void drop (DropTargetDropEvent dtde) { System.out.println ("drop()!"); if (dtde.getSource() != dropTarget) { System.out.println ("rejecting for bad source (" + dtde.getSource().getClass().getName() + ")"); dtde.rejectDrop(); return; } Point dropPoint = dtde.getLocation(); int index = locationToIndex (dropPoint); if (index != -1) { Rectangle r = getCellBounds(index,index); if (dropPoint.y > r.y+r.height/2) { index += 1; } } System.out.println ("drop index is " + index); boolean dropped = false; try { if ((index == -1) || (index == draggedIndex)|| (index == draggedIndex+1)) { System.out.println ("dropped onto self"); dtde.rejectDrop(); return; } dtde.acceptDrop (DnDConstants.ACTION_MOVE); System.out.println ("accepted"); Object dragged = dtde.getTransferable().getTransferData(localObjectFlavor); // move items - note that indicies for insert will // change if [removed] source was before target System.out.println ("drop " + draggedIndex + " to " + index); boolean sourceBeforeTarget = (draggedIndex < index); System.out.println ("source is" + (sourceBeforeTarget ? "" : " not") + " before target"); System.out.println ("insert at " + (sourceBeforeTarget ? index-1 : index)); DefaultListModel mod = (DefaultListModel) getModel(); mod.remove (draggedIndex); mod.add ((sourceBeforeTarget ? index-1 : index), dragged); dropped = true; } catch (Exception e) { e.printStackTrace(); } dtde.dropComplete (dropped); } private class ReorderableListCellRenderer extends DefaultListCellRenderer { boolean isTargetCell; boolean isLastItem; public ReorderableListCellRenderer() { super(); } public Component getListCellRendererComponent (JList list, Object value, int index, boolean isSelected, boolean hasFocus) { isTargetCell = (index == dropTargetIndex); isLastItem = (index == list.getModel().getSize()-1) && (dropTargetIndex == list.getModel().getSize()); boolean showSelected = isSelected; return super.getListCellRendererComponent (list, value, index, showSelected, hasFocus); } public void paintComponent (Graphics g) { super.paintComponent(g); if (isTargetCell) { g.setColor(Color.black); g.drawLine (0, 0, getSize().width, 0); } if (isLastItem) { g.setColor(Color.black); g.drawLine (0, getSize().height-1, getSize().width, getSize().height-1); } } } private class RJLTransferable implements Transferable { Object object; public RJLTransferable (Object o) { object = o; } public Object getTransferData(DataFlavor df) throws UnsupportedFlavorException, IOException { if (isDataFlavorSupported (df)) return object; else throw new UnsupportedFlavorException(df); } public boolean isDataFlavorSupported (DataFlavor df) { return (df.equals (localObjectFlavor)); } public DataFlavor[] getTransferDataFlavors () { return supportedFlavors; } } } PK 4F>AAA0fr/orsay/lri/varna/components/VARNAConsole.class1*fr/orsay/lri/varna/components/VARNAConsolejavax/swing/JFramejava/awt/event/ActionListenerjava/awt/event/FocusListener java/awt/event/KeyListener_vpLfr/orsay/lri/varna/VARNAPanel; _quitButtonLjavax/swing/JButton; _contentPanelLjavax/swing/JPanel; _quitPanel_inputLjavax/swing/JTextField;_outputLjavax/swing/JEditorPane;_scrollsLjavax/swing/JScrollPane; _firstFocusZ"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V !  # % &initLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/components/VARNAConsole;vp-javax/swing/JButton/Exit ,1 2(Ljava/lang/String;)V 4 6javax/swing/JPanel 5 9  ; =javax/swing/JTextField?Your command here... <1 B Djavax/swing/JEditorPane C G Ijavax/swing/JScrollPane HK L(Ljava/awt/Component;)V N  <P QRaddFocusListener!(Ljava/awt/event/FocusListener;)V <T UVaddKeyListener(Ljava/awt/event/KeyListener;)VXjava/lang/StringBuilder Z\[%fr/orsay/lri/varna/models/VARNAConfig ]^ getFullName()Ljava/lang/String; `bajava/lang/String cdvalueOf&(Ljava/lang/Object;)Ljava/lang/String; W1g console Wi jkappend-(Ljava/lang/String;)Ljava/lang/StringBuilder; Wm n^toString Cp q2setTextsjava/awt/Dimension ru v(II)V Cx yzsetPreferredSize(Ljava/awt/Dimension;)V C| }~ setEditable(Z)V 5 add*(Ljava/awt/Component;)Ljava/awt/Component; , addActionListener"(Ljava/awt/event/ActionListener;)Vjava/awt/BorderLayout  5  setLayout(Ljava/awt/LayoutManager;)VCenter 5 )(Ljava/awt/Component;Ljava/lang/Object;)VSouth  getContentPane()Ljava/awt/Container; java/awt/Container  packactionPerformed(Ljava/awt/event/ActionEvent;)V  ~ setVisiblearg0Ljava/awt/event/ActionEvent; focusGained(Ljava/awt/event/FocusEvent;)V < setSelectionStart(I)V < ^getText ` length()I < setSelectionEndLjava/awt/event/FocusEvent; focusLost keyPressed(Ljava/awt/event/KeyEvent;)VLjava/awt/event/KeyEvent; keyReleasedkeyTyped java/awt/event/KeyEvent  getKeyChar()C 4fr/orsay/lri/varna/controlers/ControleurScriptParser  executeScript4(Lfr/orsay/lri/varna/VARNAPanel;Ljava/lang/String;)V C java/lang/Exception ^ getMessage W j(C)Ljava/lang/StringBuilder; printStackTracecCeLjava/lang/Exception; SourceFileVARNAConsole.java!   W** *+"*$'$M &'(()*+ &u*,Y.03*5Y78*5Y7:*@A*CYEF*HY*FJM*A*O*A*S*FWYY_efhlo*FrY,tw*F{*8*3W*3**:Y*:*M*:*A*Y**:**8*'V, -.#/00;1J3R4Z6v78:<>?@BCDFG( )*>*' JK()*j&* !*A*A*A* 'PRS T%V(&)*&5'[()*5'`()*5'e()*I+= @*"*Aħ/N*FWY*Fʸ_e-˶h жlo-ӱ 'ij mnoDpHs(*I)*ID+PK oqIZ7fr/orsay/lri/varna/components/GradientEditorPanel.class111fr/orsay/lri/varna/components/GradientEditorPaneljavax/swing/JPaneljava/awt/event/MouseListener"java/awt/event/MouseMotionListener_mcm.Lfr/orsay/lri/varna/models/rna/ModeleColorMap;TRIGGERS_SEMI_WIDTHI ConstantValuePALETTE_HEIGHT  REMOVE_HEIGHT TOLERANCEGAPEDGESLjava/awt/Color;BUTTONS_selectedIndex1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)VCode  ()V !#"java/awt/Color $gray !& '(brighter()Ljava/awt/Color; *  !, - LIGHT_GRAY /  1  3 5 67addMouseListener!(Ljava/awt/event/MouseListener;)V 9 :;addMouseMotionListener'(Ljava/awt/event/MouseMotionListener;)VLineNumberTableLocalVariableTablethis3Lfr/orsay/lri/varna/components/GradientEditorPanel;mcm setColorMap getColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap;getStartChoose()I G HE getHeight getEndChoose K DEgetStartRemove N IE getEndRemove Q LEgetStripeHeight alterColor#(Ljava/awt/Color;I)Ljava/awt/Color; !V WEgetRed Y[Zjava/lang/Math \]max(II)I Y_ `]min !b cEgetGreen !e fEgetBlue !h i(III)VcincnrngnbpaintComponent(Ljava/awt/Graphics;)V r optjava/awt/Graphics2D vxwjava/awt/RenderingHints yzKEY_ANTIALIASINGLjava/awt/RenderingHints$Key; v| }~VALUE_ANTIALIAS_ONLjava/lang/Object; s setRenderingHint2(Ljava/awt/RenderingHints$Key;Ljava/lang/Object;)V  RE ,fr/orsay/lri/varna/models/rna/ModeleColorMap  getMinValue()D  getMaxValue  EgetWidth getColorForValue(D)Ljava/awt/Color; s setColor(Ljava/awt/Color;)V s drawLine(IIII)V  getValueAt(I)Ljava/lang/Double; java/lang/Double  doubleValue  getColorAt(I)Ljava/awt/Color; s fillRect s drawRect E getNumColors  ST s fillOval ! redgLjava/awt/Graphics;g2dLjava/awt/Graphics2D;heightv1Dv2iratiovalnormxxcross1ycross1xcross2ycross2 isChooseColor(II)Z  OE  getXPos(I)I Y absyisRemovelocateSelectedIndexdistindexxptmpDist mouseClicked(Ljava/awt/event/MouseEvent;)V java/awt/event/MouseEvent EgetX EgetY  ]    removeEntry(I)VChoose new color javax/swing/JColorChooser  showDialogH(Ljava/awt/Component;Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; addColor(DLjava/awt/Color;)V  repaintPaletteChangedab    firePropertyChange9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Varg0Ljava/awt/event/MouseEvent;nc mouseEntered mouseExited mousePressed   requestFocus    replaceEntry(ILjava/awt/Color;D)Vnv mouseReleased cm mouseDragged mouseMoved !#"java/awt/Cursor $%getPredefinedCursor(I)Ljava/awt/Cursor; ' () setCursor(Ljava/awt/Cursor;)VLjava/awt/Cursor; SourceFileGradientEditorPanel.java InnerClasses/java/awt/RenderingHints$KeyKey!            }-** %)*+%.*0*+2**4**8<"*+"',=->?-@ A>*+2< =>?@ BC/*2<"= >?DE9*F d ddd</= >?IE2*J `<4= >?LE1*M`<9= >?OE2*P `<>= >?RE:*F d ddd<C= >?STB+U`X^>+a`X^6+d`X^6!Yg<HI#J5K=>B>?BjBk 1l #m 5 n opm*+q+sM,u{*>*29*2965*o9 g kc9 ,*2 ,*6*29 *2:  *2g*2*2go9  *dk6, ,d`*Fd,*),dd*F,``*F2,*),` , ,``` 6*2d8,*), d` , , d``` ,*),d`  ,* ,d```  , ,d```  ,*  ,d`````,*),d` `  ,*.,d``` `  d`6` ``6 `d6 `d6,,,*2 <7PQ RSRTU"V+W1Y<ZI[V\`Wl^r`abcefghiknopq*s8v@wPxVym~u!,5>EQ]^l=m>?m cT "K+B.> <$ I o  j   !< ,1 5( > l*0e*0*0*2d)*Σ*J**0d *M *J**0d<EUj= l>?l l H*0A*0*0*2d*Σ *P**0d<!1F= H>?H H 3*2I(*2g*2*2go9*dk< '=*3>?3  '' ] ?J66&*6dԇ9) 6J*2<*  &*-<=R?>?? ? ;8  2  **++0*0*++**0p**0+d\*2+*2*2gk*docI**2*0:*2(**<2 '2Fl=*>?  l3  5<=>?  5<=>?  `***++0*0F*++7**2*0M,!*2*0J**0,)*0<* +=APZ_=*`>?`  =" P>*0< =>?   hY:68(*29*2:  ),*2*2**<2     #.:A PVZg=Rh>?h h h _  D #. j VYM>*"*29*2:,*2*,2**<.   "#)$1?'D(H)U*=>V>?V N  5 )j\*0V*0O*0*2d?*2*0M*2+*2*2gk*docJ**0,)<.0+1Q2[4=*\>?\  +0jQ  M**++0*0*++   Mm*0f*0*2dV*++   M>**0+d   M!+*F*d   M W*,&<>789;,=5?LA[CdExGIKOST= >?  j*+,- .v0 PK oq<&&6fr/orsay/lri/varna/components/GradientEditorPanel.javapackage fr.orsay.lri.varna.components; import java.awt.Color; import java.awt.Cursor; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.JColorChooser; import javax.swing.JPanel; import fr.orsay.lri.varna.models.rna.ModeleColorMap; public class GradientEditorPanel extends JPanel implements MouseListener, MouseMotionListener{ ModeleColorMap _mcm; public GradientEditorPanel (ModeleColorMap mcm) { _mcm = mcm; this.addMouseListener( this); this.addMouseMotionListener(this); } public void setColorMap(ModeleColorMap mcm) { _mcm = mcm; } public ModeleColorMap getColorMap() { return _mcm; } private final static int TRIGGERS_SEMI_WIDTH = 2; private final static int PALETTE_HEIGHT = 11; private final static int REMOVE_HEIGHT = 11; private final static int TOLERANCE = 5; private final static int GAP = 4; private final Color EDGES = Color.gray.brighter(); private final Color BUTTONS = Color.LIGHT_GRAY.brighter(); public int getStartChoose() { return getHeight()-PALETTE_HEIGHT-REMOVE_HEIGHT-GAP-1; } public int getEndChoose() { return getStartChoose()+PALETTE_HEIGHT; } public int getStartRemove() { return getEndChoose()+GAP; } public int getEndRemove() { return getStartRemove()+REMOVE_HEIGHT; } private int getStripeHeight() { return getHeight()-PALETTE_HEIGHT-REMOVE_HEIGHT-2*GAP-1; } private Color alterColor(Color c, int inc) { int nr = Math.min(Math.max(c.getRed()+inc, 0),255); int ng = Math.min(Math.max(c.getGreen()+inc, 0),255); int nb = Math.min(Math.max(c.getBlue()+inc, 0),255); return new Color(nr,ng,nb); } public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); int height = getStripeHeight(); double v1 = _mcm.getMinValue(); double v2 = _mcm.getMaxValue(); for (int i=0;i<=getWidth();i++) { double ratio = (((double)i)/((double)getWidth())); double val = v1+(v2-v1)*ratio; g2d.setColor(_mcm.getColorForValue(val)); g2d.drawLine(i, 0, i, height); } for(int i=0;i<_mcm.getNumColors();i++) { double val = _mcm.getValueAt(i); Color c = _mcm.getColorAt(i); double norm = (val-_mcm.getMinValue())/(_mcm.getMaxValue()-_mcm.getMinValue()); int x = (int)(norm*(getWidth()-1)); // Target g2d.setColor(c); g2d.fillRect(x-TRIGGERS_SEMI_WIDTH+1, 0, 2*TRIGGERS_SEMI_WIDTH-1, getHeight()-1); g2d.setColor(EDGES); g2d.drawLine(x-TRIGGERS_SEMI_WIDTH, 0, x-TRIGGERS_SEMI_WIDTH, getHeight()); g2d.drawLine(x+TRIGGERS_SEMI_WIDTH, 0, x+TRIGGERS_SEMI_WIDTH, getHeight()); if (i==0) { // Choose Color g2d.setColor(EDGES); g2d.drawRect(x,height+GAP,PALETTE_HEIGHT,2*PALETTE_HEIGHT+GAP); g2d.setColor(c); g2d.fillRect(x+1,height+GAP+1,PALETTE_HEIGHT-1,2*PALETTE_HEIGHT+GAP-1); } else if (i==_mcm.getNumColors()-1) { // Choose Color g2d.setColor(EDGES); g2d.drawRect(x-PALETTE_HEIGHT,height+GAP,PALETTE_HEIGHT,2*PALETTE_HEIGHT+GAP); g2d.setColor(c); g2d.fillRect(x-PALETTE_HEIGHT+1,height+GAP+1,PALETTE_HEIGHT-1,2*PALETTE_HEIGHT+GAP-1); } else { // Choose Color g2d.setColor(EDGES); g2d.drawRect(x-PALETTE_HEIGHT/2,height+GAP,PALETTE_HEIGHT,PALETTE_HEIGHT); g2d.setColor(alterColor(c,-15)); g2d.fillRect(x-PALETTE_HEIGHT/2+1,height+GAP+1,PALETTE_HEIGHT-1,PALETTE_HEIGHT-1); g2d.setColor(c); g2d.fillOval(x-PALETTE_HEIGHT/2+1,height+GAP+1,PALETTE_HEIGHT-1,PALETTE_HEIGHT-1); g2d.setColor(alterColor(c,10)); g2d.fillOval(x-PALETTE_HEIGHT/2+1+2,height+GAP+1+2,PALETTE_HEIGHT-1-4,PALETTE_HEIGHT-1-4); // Remove Color g2d.setColor(EDGES); g2d.drawRect(x-PALETTE_HEIGHT/2,height+2*GAP+PALETTE_HEIGHT,REMOVE_HEIGHT,REMOVE_HEIGHT); g2d.setColor(BUTTONS); g2d.fillRect(x-PALETTE_HEIGHT/2+1,height+2*GAP+1+PALETTE_HEIGHT,REMOVE_HEIGHT-1,REMOVE_HEIGHT-1); int xcross1 = x-PALETTE_HEIGHT/2+2; int ycross1 = height+2*GAP+PALETTE_HEIGHT +2; int xcross2 = xcross1+REMOVE_HEIGHT-4; int ycross2 = ycross1+REMOVE_HEIGHT-4; g2d.setColor(Color.red); g2d.drawLine(xcross1, ycross1, xcross2 , ycross2); g2d.drawLine(xcross1, ycross2, xcross2 , ycross1); } } } private boolean isChooseColor(int x, int y) { if (_selectedIndex != -1) { if ((_selectedIndex ==0)||(_selectedIndex == _mcm.getNumColors()-1)) return (y<=getEndRemove() && y>=getStartChoose() && Math.abs(getXPos(_selectedIndex)-x)<=PALETTE_HEIGHT); if (y<=getEndChoose() && y>=getStartChoose()) { return Math.abs(getXPos(_selectedIndex)-x)<=PALETTE_HEIGHT/2; } } return false; } private boolean isRemove(int x, int y) { if (_selectedIndex != -1) { if ((_selectedIndex ==0)||(_selectedIndex == _mcm.getNumColors()-1)) return false; if (y<=getEndRemove() && y>=getStartRemove()) { return Math.abs(getXPos(_selectedIndex)-x)<=PALETTE_HEIGHT/2; } } return false; } private int getXPos(int i) { double val = _mcm.getValueAt(i); double norm = (val-_mcm.getMinValue())/(_mcm.getMaxValue()-_mcm.getMinValue()); return (int)(norm*(getWidth()-1)); } private int locateSelectedIndex(int x, int y) { double dist = Double.MAX_VALUE; int index = -1; for(int i=0;i<_mcm.getNumColors();i++) { int xp = getXPos(i); double tmpDist = Math.abs(x-xp); if (tmpDistTOLERANCE) { double val = _mcm.getMinValue()+ arg0.getX()*(_mcm.getMaxValue()-_mcm.getMinValue())/(getWidth()-1); Color nc = JColorChooser.showDialog(this, "Choose new color" ,_mcm.getColorAt(_selectedIndex)); if (nc != null) { _mcm.addColor(val, nc); repaint(); firePropertyChange("PaletteChanged","a","b"); } } } } public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } public void mousePressed(MouseEvent arg0) { requestFocus(); _selectedIndex = locateSelectedIndex(arg0.getX(),arg0.getY()); if (_selectedIndex!=-1) { if (isChooseColor(arg0.getX(),arg0.getY())) { Color nc = JColorChooser.showDialog(this, "Choose new color" ,_mcm.getColorAt(_selectedIndex)); if (nc != null) { double nv = _mcm.getValueAt(_selectedIndex); replaceEntry(_selectedIndex, nc, nv); _selectedIndex = -1; } } } } public void mouseReleased(MouseEvent arg0) { _selectedIndex = -1; } private void replaceEntry(int index, Color nc, double nv) { ModeleColorMap cm = new ModeleColorMap(); for(int i=0;i<_mcm.getNumColors();i++) { if (i!=index) { double val = _mcm.getValueAt(i); Color c = _mcm.getColorAt(i); cm.addColor(val, c); } else { cm.addColor(nv, nc); } } _mcm = cm; repaint(); firePropertyChange("PaletteChanged","a","b"); } private void removeEntry(int index) { ModeleColorMap cm = new ModeleColorMap(); for(int i=0;i<_mcm.getNumColors();i++) { if (i!=index) { double val = _mcm.getValueAt(i); Color c = _mcm.getColorAt(i); cm.addColor(val, c); } } _mcm = cm; repaint(); firePropertyChange("PaletteChanged","a","b"); } public void mouseDragged(MouseEvent arg0) { if ((_selectedIndex!=-1)&&(_selectedIndex!=0)&&(_selectedIndex!=_mcm.getNumColors()-1)) { Color c = _mcm.getColorAt(_selectedIndex); double val = _mcm.getMinValue()+ arg0.getX()*(_mcm.getMaxValue()-_mcm.getMinValue())/(getWidth()-1); replaceEntry(_selectedIndex, c, val); } } public void mouseMoved(MouseEvent arg0) { Cursor c = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); _selectedIndex = locateSelectedIndex(arg0.getX(),arg0.getY()); if (_selectedIndex!=-1) { if (isChooseColor(arg0.getX(),arg0.getY())) { c = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR); } else if ((_selectedIndex != 0)&&(_selectedIndex != _mcm.getNumColors()-1)) { if (isRemove(arg0.getX(),arg0.getY())) { c = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR); } else if (Math.abs(getXPos(_selectedIndex)-arg0.getX())<=TOLERANCE) { c = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR); } else if (arg0.getY()amPe0fr/orsay/lri/varna/components/ActionEditor.class1\*fr/orsay/lri/varna/components/ActionEditorjavax/swing/AbstractCellEditor!javax/swing/table/TableCellEditor_btnLjavax/swing/JButton;"(Ljava/awt/event/ActionListener;)VCode  ()Vjavax/swing/JButton      addActionListenerLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/components/ActionEditor;aLjava/awt/event/ActionListener;getTableCellEditorComponent?(Ljavax/swing/JTable;Ljava/lang/Object;ZII)Ljava/awt/Component; "!java/lang/Object #$toString()Ljava/lang/String; & '(setText(Ljava/lang/String;)V*java/lang/StringBuilder ,.-java/lang/String /0valueOf&(Ljava/lang/Object;)Ljava/lang/String; )2 (4- )6 78append-(Ljava/lang/String;)Ljava/lang/StringBuilder; ): 7;(I)Ljava/lang/StringBuilder; )" > ?(setActionCommandtableLjavax/swing/JTable;valueLjava/lang/Object; isSelectedZrowIndexI vColIndexgetCellEditorValue()Ljava/lang/Object;LshouldSelectCell(Ljava/util/EventObject;)Z P MNanEventLjava/util/EventObject;isCellEditable U SNstopCellEditing()Z Y VW SourceFileActionEditor.java!  X* *Y*+ 2*,%*)Y,+1359<=* ->22@A2BC2DE2FG2HGIJ -K" MN :*+O'QRSN :*+T-QRVW /*X2 Z[PK (>j3->>/fr/orsay/lri/varna/components/ActionEditor.javapackage fr.orsay.lri.varna.components; import java.awt.Component; import java.awt.Event; import java.awt.event.ActionListener; import java.util.EventObject; import javax.swing.AbstractCellEditor; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.table.TableCellEditor; public class ActionEditor extends AbstractCellEditor implements TableCellEditor { JButton _btn = new JButton(); public ActionEditor (ActionListener a) { // add all elments you need to your panel _btn.addActionListener(a); } public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int rowIndex, int vColIndex) { _btn.setText(value.toString()); _btn.setActionCommand(value.toString()+"-"+rowIndex); // set all elemnts of you panel to the according values // or add dynamically an action listener return _btn; } public Object getCellEditorValue() { return ""; } public boolean shouldSelectCell(EventObject anEvent) { return super.shouldSelectCell(anEvent); } public boolean isCellEditable(EventObject anEvent) { return super.isCellEditable(anEvent); } public boolean stopCellEditing() { return super.stopCellEditing(); } } PK 4F>nn1fr/orsay/lri/varna/components/ColorRenderer.class1m+fr/orsay/lri/varna/components/ColorRendererjavax/swing/JLabel#javax/swing/table/TableCellRendererserialVersionUIDJ ConstantValueunselectedBorderLjavax/swing/border/Border;selectedBorder isBorderedZ(Z)VCode  ()V        setOpaqueLineNumberTableLocalVariableTablethis-Lfr/orsay/lri/varna/components/ColorRenderer;getTableCellRendererComponent@(Ljavax/swing/JTable;Ljava/lang/Object;ZZII)Ljava/awt/Component;'java/awt/Color ) *+ setBackground(Ljava/awt/Color;)V -/.javax/swing/JTable 01getSelectionBackground()Ljava/awt/Color; 354javax/swing/BorderFactory 67createMatteBorder6(IIIILjava/awt/Color;)Ljavax/swing/border/MatteBorder; 9 :; setBorder(Ljavax/swing/border/Border;)V -= >1 getBackground@java/lang/StringBuilderB RGB value: ?D E(Ljava/lang/String;)V &G HIgetRed()I ?K LMappend(I)Ljava/lang/StringBuilder;O, ?Q LR-(Ljava/lang/String;)Ljava/lang/StringBuilder; &T UIgetGreen &W XIgetBlue ?Z [\toString()Ljava/lang/String; ^ _EsetToolTipTexttableLjavax/swing/JTable;colorLjava/lang/Object; isSelectedhasFocusrowIcolumnnewColorLjava/awt/Color; SourceFileColorRenderer.java!   j******  !"#$%>,&:*(*F$**+,2**8!**+<2**8*?YACFJNPSJNPVJY]* J !"#"$*#-&8(?)C*K)N,V0m102!R"#`abcdefghgijklPK Vo(>ff0fr/orsay/lri/varna/components/ColorRenderer.java package fr.orsay.lri.varna.components; import java.awt.Color; import java.awt.Component; import javax.swing.BorderFactory; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.border.Border; import javax.swing.table.TableCellRenderer; public class ColorRenderer extends JLabel implements TableCellRenderer { /** * */ private static final long serialVersionUID = 1L; Border unselectedBorder = null; Border selectedBorder = null; boolean isBordered = true; public ColorRenderer(boolean isBordered) { this.isBordered = isBordered; setOpaque(true); // MUST do this for background to show up. } public Component getTableCellRendererComponent(JTable table, Object color, boolean isSelected, boolean hasFocus, int row, int column) { Color newColor = (Color) color; setBackground(newColor); if (isBordered) { if (isSelected) { if (selectedBorder == null) { selectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getSelectionBackground()); } setBorder(selectedBorder); } else { if (unselectedBorder == null) { unselectedBorder = BorderFactory.createMatteBorder(2, 5, 2, 5, table.getBackground()); } setBorder(unselectedBorder); } } setToolTipText("RGB value: " + newColor.getRed() + ", " + newColor.getGreen() + ", " + newColor.getBlue()); return this; } } PK 4F> 2fr/orsay/lri/varna/components/BaseTableModel.class1,fr/orsay/lri/varna/components/BaseTableModel$javax/swing/table/AbstractTableModelserialVersionUIDJ ConstantValue columnNames[Ljava/lang/String;dataLjava/util/ArrayList; Signature@Ljava/util/ArrayList;>; outlineColorLjava/awt/Color; innerColor baseColor numberColor(Ljava/util/ArrayList;)V>(Ljava/util/ArrayList;)VCode  ()Vjava/lang/StringNumbers!Base# Outline Color% Inner Color' Name Color) Number Color + -java/util/ArrayList , 0 243%fr/orsay/lri/varna/models/VARNAConfig 5BASE_OUTLINE_COLOR_DEFAULT 7  29 :BASE_INNER_COLOR_DEFAULT <  2> ?BASE_NAME_COLOR_DEFAULT A  2C DBASE_NUMBER_COLOR_DEFAULT F  ,H IJget(I)Ljava/lang/Object;L"fr/orsay/lri/varna/models/BaseList KN OP getNumbers()Ljava/lang/String; ,R STadd(Ljava/lang/Object;)Z KV WP getCaption Y[Zjava/lang/Integer \]parseInt(Ljava/lang/String;)I K_ `P getContents Kb cdgetAverageOutlineColor()Ljava/awt/Color; Kf gdgetAverageInnerColor Ki jdgetAverageNameColor Kl mdgetAverageNumberColor ,o pqsize()Isjava/lang/NumberFormatExceptionLineNumberTableLocalVariableTablethis.Lfr/orsay/lri/varna/components/BaseTableModel;basesligneiIbl$Lfr/orsay/lri/varna/models/BaseList;xe!Ljava/lang/NumberFormatException;LocalVariableTypeTable;Ljava/util/ArrayList;)Ljava/util/ArrayList;getColumnCount getRowCount getColumnName(I)Ljava/lang/String;col getValueAt(II)Ljava/lang/Object;rowgetColumnClass(I)Ljava/lang/Class;  java/lang/Object getClass()Ljava/lang/Class;cisCellEditable(II)Z setValueAt(Ljava/lang/Object;II)V , set'(ILjava/lang/Object;)Ljava/lang/Object;  fireTableCellUpdated(II)VvalueLjava/lang/Object; SourceFileBaseTableModel.java!  **YSY SY"SY$SY&SY(S**,Y./*16*8;*=@*BE>v,Y.M+GK:,MQWUX6,^QW:,UQW,aQW,eQW,hQW,kQW*/,QW+nsrtb-%% &+'6(=)D*K+R/W0_1i2s4}579<=>?@/CuHvwx _ky T~z{i^|}} ~{ x_kyq0**tFu vwq2*/ntJu vw;**2tNuvw{N*/G,GtRu vw{{> *t\u vw {O tbceu  vw { {h*/G,+W*tjkmu*vw{{PK oq<*AZ 1fr/orsay/lri/varna/components/BaseTableModel.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.components; import java.awt.Color; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; import fr.orsay.lri.varna.models.BaseList; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleStyleBase; public class BaseTableModel extends AbstractTableModel { /** * */ private static final long serialVersionUID = 1L; private String[] columnNames = { "Numbers", "Base", "Outline Color", "Inner Color", "Name Color", "Number Color" }; private ArrayList> data = new ArrayList>(); private Color outlineColor = VARNAConfig.BASE_OUTLINE_COLOR_DEFAULT, innerColor = VARNAConfig.BASE_INNER_COLOR_DEFAULT, baseColor = VARNAConfig.BASE_NAME_COLOR_DEFAULT, numberColor = VARNAConfig.BASE_NUMBER_COLOR_DEFAULT; public BaseTableModel(ArrayList bases) { ArrayList ligne; for (int i = 0; i < bases.size(); i++) { ligne = new ArrayList(); BaseList bl = bases.get(i); ligne.add(bl.getNumbers()); try{ int x = Integer.parseInt(bl.getCaption()); ligne.add(bl.getContents()); } catch(NumberFormatException e) { ligne.add(bl.getCaption()); } ligne.add(bl.getAverageOutlineColor()); ligne.add(bl.getAverageInnerColor()); ligne.add(bl.getAverageNameColor()); ligne.add(bl.getAverageNumberColor()); this.data.add(ligne); } } public int getColumnCount() { return columnNames.length; } public int getRowCount() { return data.size(); } public String getColumnName(int col) { return columnNames[col]; } public Object getValueAt(int row, int col) { return data.get(row).get(col); } /* * JTable uses this method to determine the default renderer/ editor for * each cell. If we didn't implement this method, then the last column would * contain text ("true"/"false"), rather than a check box. */ @SuppressWarnings("unchecked") public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } public boolean isCellEditable(int row, int col) { // Note that the data/cell address is constant, // no matter where the cell appears onscreen. if (col < 2) { return false; } else { return true; } } public void setValueAt(Object value, int row, int col) { data.get(row).set(col, value); fireTableCellUpdated(row, col); } }PK 4F>Ɛ :fr/orsay/lri/varna/components/BaseSpecialColorEditor.class1w4fr/orsay/lri/varna/components/BaseSpecialColorEditorjavax/swing/AbstractCellEditor!javax/swing/table/TableCellEditorserialVersionUIDJ ConstantValue currentColorLjava/awt/Color;buttonLjavax/swing/JButton; colorChooserLjavax/swing/JColorChooser;dialogLjavax/swing/JDialog;EDITLjava/lang/String;edit _vueBases#Lfr/orsay/lri/varna/views/VueBases;_controleurSpecialColorEditor@Lfr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor;&(Lfr/orsay/lri/varna/views/VueBases;)VCode  !()V#javax/swing/JButton " &  "( )*setActionCommand(Ljava/lang/String;)V,>fr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor +. /9(Lfr/orsay/lri/varna/components/BaseSpecialColorEditor;)V 1  "3 45addActionListener"(Ljava/awt/event/ActionListener;)V "7 89setBorderPainted(Z)V ; <!fireEditingStopped > @javax/swing/JColorChooser ? C E Pick a Color ?G HI createDialog(Ljava/awt/Component;Ljava/lang/String;ZLjavax/swing/JColorChooser;Ljava/awt/event/ActionListener;Ljava/awt/event/ActionListener;)Ljavax/swing/JDialog; K LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/components/BaseSpecialColorEditor;vueBasesgetCellEditorValue()Ljava/lang/Object; T getTableCellEditorComponent?(Ljavax/swing/JTable;Ljava/lang/Object;ZII)Ljava/awt/Component;Xjava/awt/ColortableLjavax/swing/JTable;valueLjava/lang/Object; isSelectedZrowIcolumngetSerialVersionUID()JgetCurrentColor()Ljava/awt/Color; getButton()Ljavax/swing/JButton;getColorChooser()Ljavax/swing/JColorChooser; getDialog()Ljavax/swing/JDialog;getEDIT()Ljava/lang/String; get_vueBases%()Lfr/orsay/lri/varna/views/VueBases; get_controleurSpecialColorEditorB()Lfr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor;setCurrentColor(Ljava/awt/Color;)VcallFireEditingStopped SourceFileBaseSpecialColorEditor.java!     c**"Y$%*%'*+Y*-0*%*02*%6*:*+=*?YAB**%D*B*0FJL: %&'$(/)7*;+@.K/S0[2_/b3McNOcPQR/*SL7M NOUVm *,WS*%L =>M> NO YZ [\ ]^ _` a` bc" LBMde/*SLFM NOfg/*%LJM NOhi/*BLNM NOjk/*JLRM NO lm#LVMno/*=LZM NOpq/*0L^M NOrs>*+SL bcMNO t!3*:L fgM NOuvPK oq<=Q 9fr/orsay/lri/varna/components/BaseSpecialColorEditor.java package fr.orsay.lri.varna.components; import java.awt.Color; import java.awt.Component; import javax.swing.AbstractCellEditor; import javax.swing.JButton; import javax.swing.JColorChooser; import javax.swing.JDialog; import javax.swing.JTable; import javax.swing.table.TableCellEditor; import fr.orsay.lri.varna.controlers.ControleurBaseSpecialColorEditor; import fr.orsay.lri.varna.views.VueBases; public class BaseSpecialColorEditor extends AbstractCellEditor implements TableCellEditor { /** * */ private static final long serialVersionUID = 1L; private Color currentColor; private JButton button; private JColorChooser colorChooser; private JDialog dialog; protected static final String EDIT = "edit"; private VueBases _vueBases; private ControleurBaseSpecialColorEditor _controleurSpecialColorEditor; public BaseSpecialColorEditor(VueBases vueBases) { // Set up the editor (from the table's point of view), // which is a button. // This button brings up the color chooser dialog, // which is the editor from the user's point of view. button = new JButton(); button.setActionCommand(EDIT); _controleurSpecialColorEditor = new ControleurBaseSpecialColorEditor(this); button.addActionListener(_controleurSpecialColorEditor); button.setBorderPainted(false); fireEditingStopped(); _vueBases = vueBases; // Set up the dialog that the button brings up. colorChooser = new JColorChooser(); dialog = JColorChooser.createDialog(button, "Pick a Color", true, // modal colorChooser, _controleurSpecialColorEditor, // OK button // handler null); // no CANCEL button handler } // Implement the one CellEditor method that AbstractCellEditor doesn't. public Object getCellEditorValue() { return currentColor; } // Implement the one method defined by TableCellEditor. public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { currentColor = (Color) value; return button; } public static long getSerialVersionUID() { return serialVersionUID; } public Color getCurrentColor() { return currentColor; } public JButton getButton() { return button; } public JColorChooser getColorChooser() { return colorChooser; } public JDialog getDialog() { return dialog; } public static String getEDIT() { return EDIT; } public VueBases get_vueBases() { return _vueBases; } public ControleurBaseSpecialColorEditor get_controleurSpecialColorEditor() { return _controleurSpecialColorEditor; } public void setCurrentColor(Color currentColor) { this.currentColor = currentColor; } public void callFireEditingStopped() { fireEditingStopped(); } } PK 4F>0TT8fr/orsay/lri/varna/components/AnnotationTableModel.class1[2fr/orsay/lri/varna/components/AnnotationTableModel$javax/swing/table/AbstractTableModelserialVersionUIDJ ConstantValue columnNames[Ljava/lang/String;dataLjava/util/ArrayList; Signature@Ljava/util/ArrayList;>;(Ljava/util/ArrayList;)V,(Ljava/util/ArrayList;)VCode  ()Vjava/lang/String Annotation  java/util/ArrayList  ! # $%get(I)Ljava/lang/Object; ' ()add(Ljava/lang/Object;)Z + ,-size()ILineNumberTableLocalVariableTablethis4Lfr/orsay/lri/varna/components/AnnotationTableModel;annotligneiILocalVariableTypeTable)Ljava/util/ArrayList;getColumnCount getRowCount getColumnName(I)Ljava/lang/String;col getValueAt(II)Ljava/lang/Object;rowgetColumnClass(I)Ljava/lang/Class; C => EGFjava/lang/Object HIgetClass()Ljava/lang/Class;cisCellEditable(II)Z setValueAt(Ljava/lang/Object;II)V P QRset'(ILjava/lang/Object;)Ljava/lang/Object; T UVfireTableCellUpdated(II)VvalueLjava/lang/Object; SourceFileAnnotationTableModel.java!  H**YS*Y >!YM,+"&W* ,&W+*ݱ.& "$!%)&3'<$G*/*H01H2 )3 )456H27)378-0*.-/ 019-2* *.1/ 01:;;*2.5/01<5=>N* "".9/ 01?5<5@A> *BD.C/ 01 J5KLO .IJL/  01 ?5 <5MNh* "+OW*S.QRS/*01WX?5<5YZPK oq<+R 7fr/orsay/lri/varna/components/AnnotationTableModel.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.components; import java.util.ArrayList; import javax.swing.table.AbstractTableModel; public class AnnotationTableModel extends AbstractTableModel { /** * */ private static final long serialVersionUID = 1L; private String[] columnNames = { "Annotation" }; private ArrayList> data = new ArrayList>(); public AnnotationTableModel(ArrayList annot) { ArrayList ligne; for (int i = 0; i < annot.size(); i++) { ligne = new ArrayList(); ligne.add(annot.get(i)); data.add(ligne); } } public int getColumnCount() { return columnNames.length; } public int getRowCount() { return data.size(); } public String getColumnName(int col) { return columnNames[col]; } public Object getValueAt(int row, int col) { return data.get(row).get(col); } /* * JTable uses this method to determine the default renderer/ editor for * each cell. If we didn't implement this method, then the last column would * contain text ("true"/"false"), rather than a check box. */ @SuppressWarnings("unchecked") public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } public boolean isCellEditable(int row, int col) { // Note that the data/cell address is constant, // no matter where the cell appears onscreen. if (col < 1) { return false; } else { return true; } } public void setValueAt(Object value, int row, int col) { data.get(row).set(col, value); fireTableCellUpdated(row, col); } }PK 4F>fr/orsay/lri/varna/controlers/PK 4F>ˍ+OO9fr/orsay/lri/varna/controlers/ControleurSliderLabel.class1@3fr/orsay/lri/varna/controlers/ControleurSliderLabeljava/lang/Object javax/swing/event/ChangeListener_lLjavax/swing/JLabel;_factorD(Ljavax/swing/JLabel;)VCode  ()V   LineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/controlers/ControleurSliderLabel;zoomAmountValueLabel(Ljavax/swing/JLabel;Z)V?zG{percentZ(Ljavax/swing/JLabel;D)Vfactor stateChanged"(Ljavax/swing/event/ChangeEvent;)V $&%javax/swing/event/ChangeEvent '( getSource()Ljava/lang/Object;*javax/swing/JSlider ), -.getValue()I 021java/lang/String 34valueOf(D)Ljava/lang/String; 687javax/swing/JLabel 9:setText(Ljava/lang/String;)VeLjavax/swing/event/ChangeEvent;value SourceFileControleurSliderLabel.java!   X***+*  !  l***+ *# $%&'   b***+*() *+,  !" i+#)+I(*kI*(/5/ 012 ;< = >?PK pq<CC8fr/orsay/lri/varna/controlers/ControleurSliderLabel.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import javax.swing.JLabel; import javax.swing.JSlider; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; public class ControleurSliderLabel implements ChangeListener { private JLabel _l; private double _factor = 1.0; public ControleurSliderLabel(JLabel zoomAmountValueLabel) { _l = zoomAmountValueLabel; _factor = 1.0; } public ControleurSliderLabel(JLabel zoomAmountValueLabel, boolean percent) { _l = zoomAmountValueLabel; if (percent) _factor = 0.01; } public ControleurSliderLabel(JLabel zoomAmountValueLabel, double factor) { _l = zoomAmountValueLabel; _factor = factor; } public void stateChanged(ChangeEvent e) { double value = ((JSlider) e.getSource()).getValue(); value *= _factor; _l.setText(String.valueOf(value)); } } PK 4F><fr/orsay/lri/varna/controlers/ControleurBlinkingThread.class1]6fr/orsay/lri/varna/controlers/ControleurBlinkingThreadjava/lang/ThreadDEFAULT_FREQUENCYJ ConstantValue2_period_parentLfr/orsay/lri/varna/VARNAPanel;_minValD_maxVal_val_incr _increasingZ_active"(Lfr/orsay/lri/varna/VARNAPanel;)VCode?ə  '(Lfr/orsay/lri/varna/VARNAPanel;JDDDD)VLineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/controlers/ControleurBlinkingThread;vp # $()V &  (  * ,  .  0  2 periodminValmaxValvalincr setActive(Z)V ; <$ interruptb getActive()ZgetVal()D C run F GHsleep(J)V JLKjava/lang/Math MNmin(DD)D JP QNmax SUTfr/orsay/lri/varna/VARNAPanel V$repaint'Zjava/lang/InterruptedException SourceFileControleurBlinkingThread.java!    G *+   !  +*"*%*'*+)* +*-*/* 1& " $%&'$(*)H+ +! +3+4+5+6+7 89]*'*'*'*:,0 125 =>?/*'8  @A/*B=  D$y*'h*+E*%+**B*1c*/IB*B*/0*%(**B*1g*-OB*B*-*%*)RWELruY6 CDEF)G5H=KQL]MbPlRuTvA y [\PK pq<[' ;fr/orsay/lri/varna/controlers/ControleurBlinkingThread.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import fr.orsay.lri.varna.VARNAPanel; public class ControleurBlinkingThread extends Thread { public static final long DEFAULT_FREQUENCY = 50; private long _period; private VARNAPanel _parent; private double _minVal, _maxVal, _val, _incr; private boolean _increasing = true; private boolean _active = false; public ControleurBlinkingThread(VARNAPanel vp) { this(vp, DEFAULT_FREQUENCY, 0, 1.0, 0.0, 0.2); } public ControleurBlinkingThread(VARNAPanel vp, long period, double minVal, double maxVal, double val, double incr) { _parent = vp; _period = period; _minVal = minVal; _maxVal = maxVal; _incr = incr; } public void setActive(boolean b) { if (_active == b) {} else { _active = b; if (_active) { interrupt(); } } } public boolean getActive() { return _active; } public double getVal() { return _val; } public void run() { while (true) { try { if (_active) { sleep(_period); if (_increasing) { _val = Math.min(_val + _incr, _maxVal); if (_val == _maxVal) { _increasing = false; } } else { _val = Math.max(_val - _incr, _minVal); if (_val == _minVal) { _increasing = true; } } _parent.repaint(); } else { sleep(10000); } } catch (InterruptedException e) { } } } } PK 4F>vVFfr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates.class1J@fr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStatesjava/lang/EnumNONEBLfr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates; MOVE_ELEMENTSELECT_ELEMENTSELECT_REGION_OR_UNSELECT SELECT_REGION CREATE_BP POPUP_MENUMOVE_ANNOTATION ENUM$VALUESC[Lfr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates;()VCode  (Ljava/lang/String;I)V       "  %  (  +  .  0 LineNumberTableLocalVariableTable thisvaluesE()[Lfr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates; 8:9java/lang/System ;< arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfV(Ljava/lang/String;)Lfr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates; @ =A5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileControleurClicMovement.java SignatureTLjava/lang/Enum; InnerClassesH4fr/orsay/lri/varna/controlers/ControleurClicMovement MouseStates@1 @@@@ @ @ @ @ YYYY !Y#$Y&'Y)*Y,-YSYSYSY!SY$SY'SY*SY-S/1& C DE'F4GAHNI\JjB21*+31B2 4 566/YK*Y<YM7,12 =>* *?12BCDEF GI@PK 4F>sGG:fr/orsay/lri/varna/controlers/ControleurClicMovement.class14fr/orsay/lri/varna/controlers/ControleurClicMovementjava/lang/Objectjava/awt/event/MouseListener"java/awt/event/MouseMotionListener #javax/swing/event/PopupMenuListener_vpLfr/orsay/lri/varna/VARNAPanel;_presenceMenuSelectionZ_submenuSelectionLjavax/swing/JMenu; _spawnPointLjava/awt/Point; _initialPoint _prevPoint _currentPointMIN_SELECTION_DISTANCED ConstantValue@DHYSTERESIS_DISTANCE@$ _currentStateBLfr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode $ %()V ')(@fr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates *NONE ,  . 021fr/orsay/lri/varna/VARNAPanel 34getPopup$()Lfr/orsay/lri/varna/views/VueMenu; 687 fr/orsay/lri/varna/views/VueMenu 9:addPopupMenuListener((Ljavax/swing/event/PopupMenuListener;)V < LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/controlers/ControleurClicMovement;_vuep mouseClicked(Ljava/awt/event/MouseEvent;)Varg0Ljava/awt/event/MouseEvent; mouseEntered mouseExited mousePressed 0J K% requestFocus MONjava/awt/event/MouseEvent PQ getButton()I MS TU isShiftDown()Z MW XU isControlDown MZ [U isAltDown 0] ^%removeSelectedAnnotation 0` aU isModifiable 'c d MOVE_ELEMENT 0f gh getRealCoords!()[Ljava/awt/geom/Point2D$Double; 0j klgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; npo!fr/orsay/lri/varna/models/rna/RNA qrget_listeBases()Ljava/util/ArrayList; tvujava/util/ArrayList wQsize ny zQ get_drawMode | }~getNearestBaseIndex (Ljava/awt/event/MouseEvent;ZZ)I  getNearestAnnotationS(Ljava/awt/event/MouseEvent;)Lfr/orsay/lri/varna/models/annotations/TextAnnotation;java/awt/Point M QgetX M QgetY (II)V   (Ljava/awt/Point;)V     0 setSelectedBase(I)V 0 % lockScrolling 0 %highlightSelectedStem 0 rgetSelectionIndices java/lang/Integer valueOf(I)Ljava/lang/Integer; t contains(Ljava/lang/Object;)Z 0 %highlightSelectedBase ' MOVE_ANNOTATION 0 set_selectedAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)V 0 %highlightSelectedAnnotation 0 %clearSelection ' SELECT_REGION_OR_UNSELECT '  CREATE_BP ' SELECT_ELEMENT '  POPUP_MENU 0 4 getPopupMenu 6 %removeSelectionMenu  CupdateNearestBase  CaddMenu 0 get_selectedAnnotation8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation; 6  get_rotation()Ljavax/swing/JMenuItem; javax/swing/JMenuItem  setEnabled(Z)V 6 % updateDialog 6 show(Ljava/awt/Component;II)V 0 %repaintbutton1button2button3shiftctrlalt selectedIndexIselectedAnnotation6Lfr/orsay/lri/varna/models/annotations/TextAnnotation; mouseDragged 0 QgetSelectedBaseIndex 0  getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI;java/awt/geom/Point2D$Double  (DD)V 0 panelToLogicPoint>(Ljava/awt/geom/Point2D$Double;)Ljava/awt/geom/Point2D$Double;    fr/orsay/lri/varna/views/VueUI  UIMoveHelixAtom"(ILjava/awt/geom/Point2D$Double;)V   moveSelection#(Ljava/awt/Point;Ljava/awt/Point;)V  x  y 4fr/orsay/lri/varna/models/annotations/TextAnnotation  setAncrage   !distance(DD)D '# $ SELECT_REGION &  (*)java/lang/Math +,min(II)I .  (0 1,max3java/awt/Rectangle 25 6(IIII)V 08 9:setSelectionRectangle(Ljava/awt/Rectangle;)V 0< =>setDestinationLink!(Ljava/awt/geom/Point2D$Double;)V @ ABgetNearestBaseI(Ljava/awt/event/MouseEvent;ZZ)Lfr/orsay/lri/varna/models/rna/ModeleBase; 0D EFgetSelectedBase,()Lfr/orsay/lri/varna/models/rna/ModeleBase; HJI(fr/orsay/lri/varna/models/rna/ModeleBase KQgetIndex 0M NaddToSelection HP QR getCoords ()Ljava/awt/geom/Point2D$Double; 0T U logicToPanelmepLjava/awt/geom/Point2D$Double;minxminymaxxmaxymb*Lfr/orsay/lri/varna/models/rna/ModeleBase;mborig mouseReleased 0b c%unlockScrolling 0e ftoggleSelection 0h i%removeSelectionRectanglek+fr/orsay/lri/varna/models/rna/ModeleStyleBP jm nW(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V  p qrUIAddBP2(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V 0t u% removeLinkmsbp-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;yjavax/swing/JMenu{ Selection x} ~(Ljava/lang/String;)V    % addCurrent  % addMenuBase 0 A()Ljava/lang/Integer;  QintValue t get(I)Ljava/lang/Object; H QgetElementStructure  %addMenuBasePair  % detectBulge  % detect3Prime  % detect5Prime  % detectLoop  % detectHelix  % detectStem  % addAllBase  CdetectAnnotation 6 addSelectionMenu(Ljavax/swing/JMenuItem;)V 0 rgetListeAnnotations t iterator()Ljava/util/Iterator; java/util/Iterator next()Ljava/lang/Object;  RgetCenterPosition 0 transformCoord@ ( !pow ( sqrt(D)D  UhasNext x % addSeparator 6 addAnnotationMenu(Ljavax/swing/JMenu;Z)Vdistd2position textAnnot n  findBulge(I)Ljava/util/ArrayList; n getHelixCountOnLoop(I)IBulge:fr/orsay/lri/varna/controlers/ControleurSelectionHighlightjava/util/Vector  (Ljava/util/Collection;)V  K(Ljava/util/Vector;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V x addChangeListener%(Ljavax/swing/event/ChangeListener;)Vbulge x ~setActionCommand x 6 addColorOptions(Ljavax/swing/JMenu;)V x add0(Ljavax/swing/JMenuItem;)Ljavax/swing/JMenuItem;indiceBindicesLjava/util/ArrayList; submenuBulgeLocalVariableTypeTable*Ljava/util/ArrayList; n   findHelixHelixhelix 6 indiceH submenuHelix n findStemStemstemindiceS submenuStem n ! find3Prime#3'indice3 submenu3Prime n' ( find5Prime*5'indice5 submenu5Prime n. /findLoop1Loop 3 4N(Ljava/util/ArrayList;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V6loop1 n8 9findLoopForward; Forward loop n= >findLoopBackward@ Backward loopBloop2indexLlistLoop submenuLoop listLoop1 submenuLoop1 listLoop2 submenuLoop2 0K LM getSelection&()Lfr/orsay/lri/varna/models/BaseList; OQP"fr/orsay/lri/varna/models/BaseList RrgetBases TvUjava/util/CollectionWCurrent Y ZO(Ljava/util/Collection;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V\currentmbsLjava/util/Collection; submenuAllCLjava/util/Collection<+Lfr/orsay/lri/varna/models/rna/ModeleBase;>; x$c3fr/orsay/lri/varna/models/rna/ModeleBasesComparisonejava/lang/StringBuildergBase # d} Hj kQ getBaseNumber dm noappend(I)Ljava/lang/StringBuilder;q: ds nt-(Ljava/lang/String;)Ljava/lang/StringBuilder; bv Rw()Ljava/lang/String; dy zwtoString x| }~setText2fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide ~ wget_c  :(ILfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)Vbase Edit base }baseChar  6 get_controleurMenu0()Lfr/orsay/lri/varna/controlers/ControleurMenu;  addActionListener"(Ljava/awt/event/ActionListener;)V submenuBaseLjavax/swing/JMenuItem; n rfindAllAllall n findPair Base pair #(,)bpEdit BPbasepair x getMenuComponents()[Ljava/awt/Component;  wgetActionCommand,BPColor java/lang/String (Ljava/lang/CharSequence;)Z x insert1(Ljavax/swing/JMenuItem;I)Ljavax/swing/JMenuItem;indiceBPsubmenuBasePairpartnercomps[Ljava/awt/Component;offseticLjava/awt/Component;jmialways onlyPaired(Ljava/awt/event/MouseEvent;)I 0 getScaleFactor()D 0 setNearestBase(Ljava/lang/Integer;)Vt mouseMoved  } 0 >setLastSelectedPosition java/lang/System outLjava/io/PrintStream;[B] java/io/PrintStream ~println   UIShiftBaseCoord(Ljava/util/ArrayList;DD)V 0 %fireLayoutChangedprevcurp1p2dxdyndxndypopupMenuCanceled%(Ljavax/swing/event/PopupMenuEvent;)V"Ljavax/swing/event/PopupMenuEvent;popupMenuWillBecomeInvisible 0 %resetAnnotationHighlightpopupMenuWillBecomeVisible SourceFileControleurClicMovement.java InnerClasses MouseStatesjava/awt/geom/Point2DDouble!    !"i!*#*&+*+-*-/*5*;=PL QRS T>!?@!A BC"5=W>?@DEFC"5=Z>?@DEGC"5=]>?@DEHC" *-I+L=+L>+L6+R6+V6+Y6*-\WRMH*-_*b+*-ep*-ee*-imsU*+*-ix{6*+: *Y++*Y**Y*P*-*-ix*-*-*-*-*- *+*- *-*-*-*+*Y++*Y**Y*Fd_ZU*+{6$*-*+*-*-*Y++*Y*>94/*ĵ+*Y++*Y**ǵ+*; *-ʶ*-e.*-ims*+*+*- *-*-ix*-/ާ*-/*-/*-/*-++*-= Babc#d2e8f>gDhKi^khmonyoprstuvwyz| }'0:?FOY`ho"5GLSZd~>p ?@DE#28>D IC"* *+b*-*-ix/*-*-*-Y++ 1*Y++****Y**-*+B*-*-Y++M*-,,*-L*+ĥ *+%*++ *"+*+"{*Y++*%*%'=*-*-'>*%*%/6*-*-/6*-2Ydd47*+*++r*+{=*-Y++;D*+?N*-C:*-*--GL*-GL*-*--OS;*-=$ #Obn}#5GZm>f ?@VEWX5SYGAZZ.[m\g9]^0_^`C"FP+L5*+b#*-*-*-a*-\ *+*-*-*-\*+ĦO*-e3*-e(*-ims*+{= *-d*-*-\*+" *-g~*+t*++G*+{=;*+?N*-C:jY-l:-*--GGo*-s*-*-*-\*&+*-=% !(2<CKU_it!"$'(*,.023567 8:%>,?3@:DAEHFOG>HP?@PDE <0]^'_^ vwC"p*xYz|***-im*-H*********+*-/**;=JLMOQ0R4Q7S;W?YC[G]K_OaScWe\gjhoi>p?@pDEC". *-sI*-:\::*-:+gȸ+gȸc9(*-I**-/*ױ=>l mp,r3s>tOu`tfwmxvyyp|}>>?@DEf3FX,M%"*-<*-iM,sh*-i*-PxY|N-YY,*---*-_-*--*-W=: 6AFVY`joz>*?@ ymAB m %" {*-<*-i M,s_xY|N-YY,*---*-_-*---*--*-W=> ).>AHRWbfqz>*{?@ pd)Q d %"l*-<*-iM,sPxY|N-YY,*---*-_-*--*-W=6  ).>AHRWbk>*l?@ aU)B U %"l*-<*-iM,sPxY"|N-YY,*---"*-_-*--*-W=6  ).>AHRWbk>*l?@ a$U)B% U %"l*-<*-i&M,sPxY)|N-YY,*---)*-_-*--*-W=6  ).>AHRWbk>*l?@ a+U)B, U %"a*-<*-imHg*-i-MxY0|N-Y,*--2-5*-_-*---*--*-W*-i7M,sXxY:|N-Y,*--2-5*-_-*---*--*-W*-iRa?@ VC/XD:MEFJGeHRI /XD F eH %"[*-JNL+SIxYV|M,Y+*-,X,[*-_,*-,*,W=2  $-07A F Q Z > [?@ P]^;_  P]`%"xYaL*-im*-HM,b.+dYfh,ilpr,burx{++dYfh,ilpr,~rx{+Y,G*-++*-_+YN--*-ʶ+-W*-++*-+*+W=b#*BOUmz}!"#$%&'()>*?@#]^?%"Y*-iLxY|M,YY+*-,,*-_,*-,*,W=. , -./+..051?2D3O4X5> Y?@ NC_  N %" X*-<*-iM*-im*-HN- xYa:*-im-H:Y,*-2dYh-ii'lr-ii/lrx{*-_ Y:*-ʶ*-:66 . 2:  ߙ :   6  W W*W=18 9:;1:2<:=C>G?M@Q?W>YA[B_CfBlDxE|FEGHIHIDJLMOPQRQTUVWXYZ[#\'W2`8aEcMeWg>z X?@ MA2&^CY^a^6 !   A AB"~$*+{6*-imH=i jk>4$?@$DE$$ }"<*+{=o>?@DE}~"7 966 *-im H`*-e 2+gȸ*-e 2+gȸc9 *-k 9 6  *-ey=2 rstu+wDx]vcyz{t>R?@DEc%]  C"c*+{=*-ѱ= > ?@DE", M*-sJ*-: g ::*-:+gȸ+gȸc9)*-k MJ ,=:.5@Qbh>H?@DE}h5QX.XC"O*+=*+N*--*--*-*-*-Y++ٱ=*   (/6N>*O?@ODEI C"> *-Y+%+-N*-Y,%,-:-g9-g9*-_89 9 *-ix9 *-*-  *-=6  "<HT^bftw>\ ?@"rX<XXHLT@b1 f- "5=>?@D"L*-*-=>?@D"5=>?@D'@ PK h<>~^^9fr/orsay/lri/varna/controlers/ControleurClicMovement.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.Component; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Collection; import java.util.Vector; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.models.annotations.TextAnnotation; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.models.rna.ModeleBasesComparison; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; /** * Controller of the mouse click * * @author darty * */ public class ControleurClicMovement implements MouseListener, MouseMotionListener, PopupMenuListener { private VARNAPanel _vp; private boolean _presenceMenuSelection; private JMenu _submenuSelection; public Point _spawnPoint; public Point _initialPoint; public Point _prevPoint; public Point _currentPoint; public static final double MIN_SELECTION_DISTANCE = 40.0; public static final double HYSTERESIS_DISTANCE = 10.0; public enum MouseStates { NONE, MOVE_ELEMENT, SELECT_ELEMENT, SELECT_REGION_OR_UNSELECT, SELECT_REGION, CREATE_BP, POPUP_MENU, MOVE_ANNOTATION, }; private MouseStates _currentState = MouseStates.NONE; public ControleurClicMovement(VARNAPanel _vuep) { _vp = _vuep; _vp.getPopup().addPopupMenuListener(this); _presenceMenuSelection = false; } public void mouseClicked(MouseEvent arg0) { } public void mouseEntered(MouseEvent arg0) { } public void mouseExited(MouseEvent arg0) { } public void mousePressed(MouseEvent arg0) { _vp.requestFocus(); boolean button1 = (arg0.getButton() == MouseEvent.BUTTON1); boolean button2 = (arg0.getButton() == MouseEvent.BUTTON2); boolean button3 = (arg0.getButton() == MouseEvent.BUTTON3); boolean shift = arg0.isShiftDown(); boolean ctrl = arg0.isControlDown(); boolean alt = arg0.isAltDown(); _vp.removeSelectedAnnotation(); if (button1 && !ctrl && !alt && !shift) { if (_vp.isModifiable()) { _currentState = MouseStates.MOVE_ELEMENT; if (_vp.getRealCoords() != null && _vp.getRealCoords().length != 0 && _vp.getRNA().get_listeBases().size() != 0) { int selectedIndex = getNearestBaseIndex(arg0,false,_vp.getRNA().get_drawMode()==RNA.DRAW_MODE_RADIATE); TextAnnotation selectedAnnotation = this.getNearestAnnotation(arg0); _initialPoint = new Point(arg0.getX(),arg0.getY()); _currentPoint = new Point(_initialPoint); _prevPoint = new Point(_initialPoint); if (selectedIndex !=-1) { _vp.setSelectedBase(selectedIndex); if (_vp.getRNA().get_drawMode() == RNA.DRAW_MODE_RADIATE) { _vp.lockScrolling(); _vp.highlightSelectedStem(); } else { if (!_vp.getSelectionIndices().contains(selectedIndex)) { _vp.setSelectedBase(selectedIndex); _vp.highlightSelectedBase(); } else { // Otherwise, keep current selection as it is and move it } } } else { if (selectedAnnotation != null) { _currentState = MouseStates.MOVE_ANNOTATION; _vp.set_selectedAnnotation(selectedAnnotation); _vp.highlightSelectedAnnotation(); } else { _vp.clearSelection(); _vp.setSelectedBase(-1); _currentState = MouseStates.SELECT_REGION_OR_UNSELECT; _initialPoint = new Point(arg0.getX(),arg0.getY()); _prevPoint = new Point(_initialPoint); _currentPoint = new Point(_initialPoint); } } } } } else if (button1 && ctrl && !alt && !shift) { int selectedIndex = getNearestBaseIndex(arg0,false,false); if (selectedIndex !=-1) { _vp.clearSelection(); _currentState = MouseStates.CREATE_BP; _vp.setSelectedBase(selectedIndex); _vp.highlightSelectedBase(); _initialPoint = new Point(arg0.getX(),arg0.getY()); _currentPoint = new Point(_initialPoint); } } else if (button1 && !ctrl && !alt && shift) { _currentState = MouseStates.SELECT_ELEMENT; _initialPoint = new Point(arg0.getX(),arg0.getY()); _currentPoint = new Point(_initialPoint); } else if (button3) { _currentState = MouseStates.POPUP_MENU; if (_presenceMenuSelection) { _vp.getPopupMenu().removeSelectionMenu(); } if ((_vp.getRealCoords() != null) && _vp.getRNA().get_listeBases().size() != 0) { updateNearestBase(arg0); // on insere dans le menu les nouvelles options addMenu(arg0); if (_vp.get_selectedAnnotation() != null) _vp.highlightSelectedAnnotation(); } // affichage du popup menu if (_vp.getRNA().get_drawMode() == RNA.DRAW_MODE_LINEAR) { _vp.getPopup().get_rotation().setEnabled(false); } else { _vp.getPopup().get_rotation().setEnabled(true); } _vp.getPopup().updateDialog(); _vp.getPopup().show(_vp, arg0.getX(), arg0.getY()); } _vp.repaint(); } public void mouseDragged(MouseEvent me) { if (_currentState == MouseStates.MOVE_ELEMENT) { // si on deplace la souris et qu'une base est selectionnée if (_vp.getSelectedBaseIndex() != -1) { if (_vp.getRNA().get_drawMode() == RNA.DRAW_MODE_RADIATE) { // dans le cas radiale on deplace une helice _vp.getVARNAUI().UIMoveHelixAtom(_vp.getSelectedBaseIndex(), _vp.panelToLogicPoint(new Point2D.Double(me.getX(), me.getY()))); } else { // dans le cas circulaire naview ou line on deplace une base _currentPoint = new Point(me.getX(), me.getY()); moveSelection(_prevPoint,_currentPoint); _prevPoint = new Point(_currentPoint); } _vp.repaint(); } } else if (_currentState == MouseStates.MOVE_ANNOTATION) { if (_vp.get_selectedAnnotation()!=null) { Point2D.Double p = _vp.panelToLogicPoint(new Point2D.Double(me.getX(), me.getY())); _vp.get_selectedAnnotation().setAncrage(p.x,p.y); _vp.repaint(); } } else if ((_currentState == MouseStates.SELECT_ELEMENT)||(_currentState == MouseStates.SELECT_REGION_OR_UNSELECT)) { if (_initialPoint.distance(me.getX(),me.getY())>HYSTERESIS_DISTANCE) _currentState = MouseStates.SELECT_REGION; } else if (_currentState == MouseStates.SELECT_REGION) { _currentPoint = new Point(me.getX(),me.getY()); int minx = Math.min(_currentPoint.x, _initialPoint.x); int miny = Math.min(_currentPoint.y, _initialPoint.y); int maxx = Math.max(_currentPoint.x, _initialPoint.x); int maxy = Math.max(_currentPoint.y, _initialPoint.y); _vp.setSelectionRectangle(new Rectangle(minx,miny,maxx-minx,maxy-miny)); } else if (_currentState == MouseStates.CREATE_BP) { if (_initialPoint.distance(me.getX(),me.getY())>HYSTERESIS_DISTANCE) { int selectedIndex = getNearestBaseIndex(me,false,false); if (selectedIndex<0) { _vp.setDestinationLink(new Point2D.Double(me.getX(),me.getY())); } else { ModeleBase mb = getNearestBase(me,false,false); ModeleBase mborig = _vp.getSelectedBase(); _vp.clearSelection(); _vp.addToSelection(mb.getIndex()); _vp.addToSelection(mborig.getIndex()); _vp.setDestinationLink(_vp.logicToPanel(mb.getCoords())); } _vp.repaint(); } } } public void mouseReleased(MouseEvent arg0) { if (arg0.getButton() == MouseEvent.BUTTON1) { if (_currentState == MouseStates.MOVE_ELEMENT) { _vp.clearSelection(); _vp.setSelectedBase(-1); _vp.unlockScrolling(); _vp.removeSelectedAnnotation(); } else if (_currentState == MouseStates.SELECT_REGION_OR_UNSELECT) { _vp.clearSelection(); _vp.setSelectedBase(-1); _vp.removeSelectedAnnotation(); } else if (_currentState == MouseStates.SELECT_ELEMENT) { if (_vp.getRealCoords() != null && _vp.getRealCoords().length != 0 && _vp.getRNA().get_listeBases().size() != 0) { int selectedIndex = getNearestBaseIndex(arg0,false,false); if (selectedIndex !=-1) { _vp.toggleSelection(selectedIndex); } } _vp.setSelectedBase(-1); _vp.removeSelectedAnnotation(); } else if (_currentState == MouseStates.SELECT_REGION) { _vp.removeSelectionRectangle(); } else if (_currentState == MouseStates.CREATE_BP) { if (_initialPoint.distance(arg0.getX(),arg0.getY())>HYSTERESIS_DISTANCE) { int selectedIndex = getNearestBaseIndex(arg0,false,false); if (selectedIndex>=0) { ModeleBase mb = getNearestBase(arg0,false,false); ModeleBase mborig = _vp.getSelectedBase(); ModeleStyleBP msbp = new ModeleStyleBP(mb,mborig); if (mb!=mborig) { _vp.getVARNAUI().UIAddBP(mb.getIndex(),mborig.getIndex(),msbp); } } } _vp.removeLink(); _vp.clearSelection(); _vp.repaint(); } } _vp.removeSelectedAnnotation(); _currentState = MouseStates.NONE; _vp.repaint(); } private void addMenu(MouseEvent arg0) { // creation du menu _submenuSelection = new JMenu("Selection"); addCurrent(); // ajout des option sur base addMenuBase(); // ajout des option sur paire de base if (_vp.getRNA().get_listeBases().get(_vp.getNearestBase()) .getElementStructure() != -1) { addMenuBasePair(); } // detection renflement detectBulge(); // detection 3' detect3Prime(); // detection 5' detect5Prime(); // detection boucle detectLoop(); // detection d'helice detectHelix(); // detection tige detectStem(); // Ajout de toutes bases addAllBase(); // detection d'annotation detectAnnotation(arg0); _vp.getPopup().addSelectionMenu(_submenuSelection); _presenceMenuSelection = true; } private void detectAnnotation(MouseEvent arg0) { if (_vp.getListeAnnotations().size() != 0) { double dist = Double.MAX_VALUE; double d2; Point2D.Double position; for (TextAnnotation textAnnot : _vp.getListeAnnotations()) { // calcul de la distance position = textAnnot.getCenterPosition(); position = _vp.transformCoord(position); d2 = Math.sqrt(Math.pow((position.x - arg0.getX()), 2) + Math.pow((position.y - arg0.getY()), 2)); // si la valeur est inferieur au minimum actuel if (dist > d2) { _vp.set_selectedAnnotation(textAnnot); dist = d2; } } _submenuSelection.addSeparator(); _vp.getPopup().addAnnotationMenu(_submenuSelection,true); } } private void detectBulge() { int indiceB = _vp.getNearestBase(); ArrayList indices = _vp.getRNA().findBulge(indiceB); if ((indices.size() > 0) && (_vp.getRNA().getHelixCountOnLoop(_vp.getNearestBase()) == 2)) { JMenu submenuBulge = new JMenu("Bulge"); submenuBulge.addChangeListener(new ControleurSelectionHighlight( new Vector(indices), _vp, submenuBulge)); submenuBulge.setActionCommand("bulge"); if (!_vp.isModifiable()) submenuBulge.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuBulge); _submenuSelection.add(submenuBulge); } } private void detectHelix() { int indiceH = _vp.getNearestBase(); ArrayList indices = _vp.getRNA().findHelix(indiceH); if (indices.size() != 0) { // ajout menu helice JMenu submenuHelix = new JMenu("Helix"); submenuHelix.addChangeListener(new ControleurSelectionHighlight( new Vector(indices), _vp, submenuHelix)); submenuHelix.setActionCommand("helix"); if (!_vp.isModifiable()) submenuHelix.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuHelix); submenuHelix.addSeparator(); _vp.getPopupMenu().addAnnotationMenu(submenuHelix); _submenuSelection.add(submenuHelix); } } private void detectStem() { int indiceS = _vp.getNearestBase(); ArrayList indices = _vp.getRNA().findStem(indiceS); if (indices.size() > 0) { JMenu submenuStem = new JMenu("Stem"); submenuStem.addChangeListener(new ControleurSelectionHighlight( new Vector(indices), _vp, submenuStem)); submenuStem.setActionCommand("stem"); if (!_vp.isModifiable()) submenuStem.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuStem); _submenuSelection.add(submenuStem); } } private void detect3Prime() { // detection 3' int indice3 = _vp.getNearestBase(); ArrayList indices = _vp.getRNA().find3Prime(indice3); if (indices.size() != 0) { JMenu submenu3Prime = new JMenu("3'"); submenu3Prime.addChangeListener(new ControleurSelectionHighlight( new Vector(indices), _vp, submenu3Prime)); submenu3Prime.setActionCommand("3'"); if (!_vp.isModifiable()) submenu3Prime.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenu3Prime); _submenuSelection.add(submenu3Prime); } } private void detect5Prime() { int indice5 = _vp.getNearestBase(); ArrayList indices = _vp.getRNA().find5Prime(indice5); if (indices.size() != 0) { JMenu submenu5Prime = new JMenu("5'"); submenu5Prime.addChangeListener(new ControleurSelectionHighlight( new Vector(indices), _vp, submenu5Prime)); submenu5Prime.setActionCommand("5'"); if (!_vp.isModifiable()) submenu5Prime.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenu5Prime); _submenuSelection.add(submenu5Prime); } } private void detectLoop() { int indexL = _vp.getNearestBase(); if (_vp.getRNA().get_listeBases().get(indexL).getElementStructure() == -1) { ArrayList listLoop = _vp.getRNA().findLoop(indexL); JMenu submenuLoop = new JMenu("Loop"); submenuLoop.addChangeListener(new ControleurSelectionHighlight( listLoop, _vp, submenuLoop)); submenuLoop.setActionCommand("loop1"); if (!_vp.isModifiable()) submenuLoop.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuLoop); submenuLoop.addSeparator(); _vp.getPopupMenu().addAnnotationMenu(submenuLoop); _submenuSelection.add(submenuLoop); } else { ArrayList listLoop1 = _vp.getRNA().findLoopForward(indexL); if (listLoop1.size() > 0) { JMenu submenuLoop1 = new JMenu("Forward loop"); submenuLoop1 .addChangeListener(new ControleurSelectionHighlight( listLoop1, _vp, submenuLoop1)); submenuLoop1.setActionCommand("loop1"); if (!_vp.isModifiable()) submenuLoop1.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuLoop1); submenuLoop1.addSeparator(); _vp.getPopupMenu().addAnnotationMenu(submenuLoop1); _submenuSelection.add(submenuLoop1); } ArrayList listLoop2 = _vp.getRNA() .findLoopBackward(indexL); if (listLoop2.size() > 0) { JMenu submenuLoop2 = new JMenu("Backward loop"); submenuLoop2 .addChangeListener(new ControleurSelectionHighlight( listLoop2, _vp, submenuLoop2)); submenuLoop2.setActionCommand("loop2"); if (!_vp.isModifiable()) submenuLoop2.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuLoop2); submenuLoop2.addSeparator(); _vp.getPopupMenu().addAnnotationMenu(submenuLoop2); _submenuSelection.add(submenuLoop2); } } } private void addCurrent() { Collection mbs = _vp.getSelection().getBases(); if (mbs.size()>0) { JMenu submenuAll = new JMenu("Current"); submenuAll.addChangeListener(new ControleurSelectionHighlight( mbs, _vp, submenuAll)); submenuAll.setActionCommand("current"); if (!_vp.isModifiable()) submenuAll.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuAll); _submenuSelection.add(submenuAll); } } private void addMenuBase() { JMenu submenuBase = new JMenu(); ModeleBase mb = _vp.getRNA().get_listeBases().get(_vp.getNearestBase()); if (mb instanceof ModeleBasesComparison) { submenuBase.setText("Base #" + (mb.getBaseNumber()) + ":" + ((ModeleBasesComparison) mb).getBases()); } else { submenuBase.setText("Base #" + (mb.getBaseNumber()) + ":" + ((ModeleBaseNucleotide) mb).get_c()); } submenuBase.addChangeListener(new ControleurSelectionHighlight(mb .getIndex(), _vp, submenuBase)); submenuBase.setActionCommand("base"); // option disponible seulement en mode modifiable if (!_vp.isModifiable()) submenuBase.setEnabled(false); JMenuItem baseChar = new JMenuItem("Edit base"); baseChar.setActionCommand("baseChar"); baseChar.addActionListener(_vp.getPopupMenu().get_controleurMenu()); submenuBase.add(baseChar); _vp.getPopupMenu().addColorOptions(submenuBase); submenuBase.addSeparator(); _vp.getPopupMenu().addAnnotationMenu(submenuBase); _submenuSelection.add(submenuBase); } private void addAllBase() { ArrayList indices = _vp.getRNA().findAll(); JMenu submenuAll = new JMenu("All"); submenuAll.addChangeListener(new ControleurSelectionHighlight( new Vector(indices), _vp, submenuAll)); submenuAll.setActionCommand("all"); if (!_vp.isModifiable()) submenuAll.setEnabled(false); _vp.getPopupMenu().addColorOptions(submenuAll); _submenuSelection.add(submenuAll); } private void addMenuBasePair() { int indiceBP = _vp.getNearestBase(); ArrayList indices = _vp.getRNA().findPair(indiceBP); ModeleBase base = _vp.getRNA() .get_listeBases().get(_vp.getNearestBase()); if (base.getElementStructure() != -1) { JMenu submenuBasePair = new JMenu(); ModeleBase partner = _vp .getRNA().get_listeBases().get( base.getElementStructure()); submenuBasePair .addChangeListener(new ControleurSelectionHighlight( indices, _vp, submenuBasePair)); submenuBasePair.setText("Base pair #(" + (Math.min(base.getBaseNumber(), partner .getBaseNumber())) + "," + (Math.max(base.getBaseNumber(), partner .getBaseNumber())) + ")"); submenuBasePair.setActionCommand("bp"); // option disponible seulement en mode modifiable if (!_vp.isModifiable()) submenuBasePair.setEnabled(false); JMenuItem basepair = new JMenuItem("Edit BP"); basepair.setActionCommand("basepair"); basepair.addActionListener(_vp.getPopupMenu() .get_controleurMenu()); _vp.getPopupMenu().addColorOptions(submenuBasePair); Component[] comps = submenuBasePair.getMenuComponents(); int offset = -1; for (int i = 0; i < comps.length; i++) { Component c = comps[i]; if (c instanceof JMenuItem) { JMenuItem jmi = (JMenuItem) c; if (jmi.getActionCommand().contains(",BPColor")) { offset = i; } } } if (offset != -1) { submenuBasePair.insert(basepair, offset); } else { submenuBasePair.add(basepair); } _submenuSelection.add(submenuBasePair); } } private ModeleBase getNearestBase(MouseEvent arg0, boolean always, boolean onlyPaired) { int i = getNearestBaseIndex(arg0, always,onlyPaired); if (i==-1) return null; return _vp.getRNA().get_listeBases().get(i); } private int getNearestBaseIndex(MouseEvent arg0) { return getNearestBaseIndex(arg0, false ,false); } private int getNearestBaseIndex(MouseEvent arg0, boolean always, boolean onlyPaired) { double d2, dist = Double.MAX_VALUE; int mb = -1; for (int i = 0; i < _vp.getRealCoords().length; i++) { if (!onlyPaired || (_vp.getRNA().get_listeBases().get(i).getElementStructure()!=-1)) {d2 = Math.sqrt(Math .pow((_vp.getRealCoords()[i].x - arg0.getX()), 2) + Math.pow((_vp.getRealCoords()[i].y - arg0.getY()), 2)); if ((dist > d2) && ((d2<_vp.getScaleFactor()*MIN_SELECTION_DISTANCE) || always)) { dist = d2; mb = i; } } } return mb; } private void updateNearestBase(MouseEvent arg0) { int i = getNearestBaseIndex(arg0,true,false); if (i!=-1) _vp.setNearestBase(i); } private TextAnnotation getNearestAnnotation(MouseEvent arg0) { TextAnnotation t = null; if (_vp.getListeAnnotations().size() != 0) { double dist = Double.MAX_VALUE; double d2; Point2D.Double position; for (TextAnnotation textAnnot : _vp.getListeAnnotations()) { // calcul de la distance position = textAnnot.getCenterPosition(); position = _vp.transformCoord(position); d2 = Math.sqrt(Math.pow((position.x - arg0.getX()), 2) + Math.pow((position.y - arg0.getY()), 2)); // si la valeur est inferieur au minimum actuel if ((dist > d2)&& (d2<_vp.getScaleFactor()*MIN_SELECTION_DISTANCE)) { t = textAnnot; dist = d2; } } } return t; } public void mouseMoved(MouseEvent arg0) { int selectedIndex = getNearestBaseIndex(arg0); TextAnnotation selectedAnnotation = getNearestAnnotation(arg0); if (selectedIndex!=-1) { _vp.setSelectedBase(selectedIndex); } else if (selectedAnnotation!=null) { _vp.set_selectedAnnotation(selectedAnnotation); _vp.highlightSelectedAnnotation(); _vp.repaint(); } _vp.setLastSelectedPosition(new Point2D.Double(arg0.getX(),arg0.getY())); } /** * Move a base of the rna * * @param index * :the index of the base to move in the base list * @param x * :the new x coordinate * @param y * :the new y coordinate */ private void moveSelection(Point prev, Point cur) { System.out.println("[B]"); Point2D.Double p1 = _vp.panelToLogicPoint(new Point2D.Double(prev.x,prev.y)); Point2D.Double p2 = _vp.panelToLogicPoint(new Point2D.Double(cur.x,cur.y)); double dx = (p2.x - p1.x); double dy = (p2.y - p1.y); if (_vp.isModifiable()) { double ndx = dx; double ndy = dy; if (_vp.getRNA().get_drawMode() == RNA.DRAW_MODE_LINEAR) { ndy=0.0; } _vp.getVARNAUI().UIShiftBaseCoord(_vp.getSelectionIndices(), ndx, ndy); _vp.fireLayoutChanged(); } } public void popupMenuCanceled(PopupMenuEvent arg0) { } public void popupMenuWillBecomeInvisible(PopupMenuEvent arg0) { //_vp.clearSelection(); _vp.resetAnnotationHighlight(); _vp.setSelectedBase(-1); } public void popupMenuWillBecomeVisible(PopupMenuEvent arg0) { } }PK 4F>ZN˰;fr/orsay/lri/varna/controlers/ControleurDemoTextField.class15fr/orsay/lri/varna/controlers/ControleurDemoTextFieldjava/lang/Objectjavax/swing/event/CaretListener_vod1Lfr/orsay/lri/varna/applications/VARNAOnlineDemo;_oldSeqLjava/lang/String; _oldStruct_hilitLjavax/swing/text/Highlighter;_painter/Ljavax/swing/text/Highlighter$HighlightPainter; COLORERRORLjava/awt/Color; COLORWARNING4(Lfr/orsay/lri/varna/applications/VARNAOnlineDemo;)VCode  ()V java/awt/Color RED   ! "ORANGE $  &  (*)/fr/orsay/lri/varna/applications/VARNAOnlineDemo +,get_seq()Ljavax/swing/JTextField; .0/javax/swing/JTextField 12getText()Ljava/lang/String; 4 (6 7, get_struct 9 ;#javax/swing/text/DefaultHighlighter : > @;javax/swing/text/DefaultHighlighter$DefaultHighlightPainter B CBLACK ?E F(Ljava/awt/Color;)V H  .J KLsetHighlighter!(Ljavax/swing/text/Highlighter;)VLineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/controlers/ControleurDemoTextField;VOD caretUpdate!(Ljavax/swing/event/CaretEvent;)VUjava/util/ArrayList T (X YZget_info()Ljavax/swing/JLabel; \^]javax/swing/JLabel _ removeAll acbjavax/swing/text/Highlighter dremoveAllHighlightsfjava/util/Stack e ikjjava/lang/String lmcharAt(I)C oqpjava/lang/Integer rsvalueOf(I)Ljava/lang/Integer; eu vwpush&(Ljava/lang/Object;)Ljava/lang/Object; ey z{size()I a} ~ addHighlightE(IILjavax/swing/text/Highlighter$HighlightPainter;)Ljava/lang/Object; ( get_varnaPanel!()Lfr/orsay/lri/varna/VARNAPanel; fr/orsay/lri/varna/VARNAPanel  errorDialog(Ljava/lang/Exception;)V e pop()Ljava/lang/Object; i {lengthtoo many closing parentheses T add(Ljava/lang/Object;)Z o {intValue e isEmpty()Ztoo many opening parentheses \ F setForeground . getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !fr/orsay/lri/varna/models/rna/RNA { get_drawMode drawRNA((Ljava/lang/String;Ljava/lang/String;I)Vdifferent lenghts  black  getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; fr/orsay/lri/varna/views/VueUI UIReset i Tyjava/lang/StringBuilder i r&(Ljava/lang/Object;)Ljava/lang/String; (Ljava/lang/String;)V T get(I)Ljava/lang/Object; append-(Ljava/lang/String;)Ljava/lang/StringBuilder; 2toString, . \ setText%javax/swing/text/BadLocationException5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengtheLjavax/swing/event/CaretEvent;infosLjava/util/ArrayList;nbPOInbPFpLjava/util/Stack;pbZie1'Ljavax/swing/text/BadLocationException;indice7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;infoLocalVariableTypeTable)Ljava/util/ArrayList;&Ljava/util/Stack; SourceFileControleurDemoTextField.java InnerClassesDefaultHighlightPainter-javax/swing/text/Highlighter$HighlightPainterHighlightPainter!   [*** #*+%**%'-3**%5-8*:Y<=*?YADG*%5*=IM* 0- .12%334>5L6Z7N[OP[QRS *8*%5-*3*%'-TYVM*%W[*=`**%5-8**%'-3>6eYg:66{*%5-h(ntWS*%5-h)?x.*=`*G|W:*%6 W*%5-y x ,WxG5o6*=`*G|W:*%,W*%W**%'**%5**%*%'-*%5-*%:*%*%'-*%5-),W*%'*#*%5*#*%'*%5*%iY:,iY÷,iͶ:6(Y÷Զ,iͶ:,ջY÷ֶͶ:*%Wر+?BM=;<"=*>4?=@KAYB^DgEjFpGHIJKLNOPRTFY[ \^`a+cBdDeP`Xh_jmk{lpqrpstwxwz{| %2;B^dNOP*[Y^VgMjJm +%D  ;y a1*gM?: a PK pq<*>>:fr/orsay/lri/varna/controlers/ControleurDemoTextField.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.Color; import java.util.ArrayList; import java.util.Stack; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; import javax.swing.text.BadLocationException; import javax.swing.text.DefaultHighlighter; import javax.swing.text.Highlighter; import fr.orsay.lri.varna.applications.VARNAOnlineDemo; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; /** * It controls the sequence and structure text fields and changes their color if * they have different lengths or unbalanced parentheses. * * @author darty * */ public class ControleurDemoTextField implements CaretListener { private VARNAOnlineDemo _vod; private String _oldSeq, _oldStruct; private Highlighter _hilit; private Highlighter.HighlightPainter _painter; private final Color COLORERROR = Color.RED; private final Color COLORWARNING = Color.ORANGE; public ControleurDemoTextField(VARNAOnlineDemo VOD) { _vod = VOD; _oldSeq = _vod.get_seq().getText(); _oldStruct = _vod.get_struct().getText(); _hilit = new DefaultHighlighter(); _painter = new DefaultHighlighter.DefaultHighlightPainter(Color.BLACK); _vod.get_struct().setHighlighter(_hilit); } // if there is any change public void caretUpdate(CaretEvent e) { if (_oldStruct != _vod.get_struct().getText() || _oldSeq != _vod.get_seq().getText()) { ArrayList infos = new ArrayList(); _vod.get_info().removeAll(); _hilit.removeAllHighlights(); _oldStruct = _vod.get_struct().getText(); _oldSeq = _vod.get_seq().getText(); int nbPO = 0, nbPF = 0; // compte les parentheses ouvrantes et fermantes Stack p = new Stack(); boolean pb = false; for (int i = 0; i < _vod.get_struct().getText().length(); i++) { if (_vod.get_struct().getText().charAt(i) == '(') { nbPO++; p.push(i); } else if (_vod.get_struct().getText().charAt(i) == ')') { nbPF++; if (p.size() == 0) { try { _hilit.addHighlight(i, i + 1, _painter); } catch (BadLocationException e1) { _vod.get_varnaPanel().errorDialog(e1); } pb = true; } else p.pop(); } } // si le nombre de parentheses ouvrantes/fermantes est different if (pb || p.size() > 0) { // colorie en rouge if (pb) { infos.add("too many closing parentheses"); } if (p.size() > 0) { int indice; while (!p.isEmpty()) { indice = p.pop(); try { _hilit.addHighlight(indice, indice + 1, _painter); } catch (BadLocationException e1) { _vod.get_varnaPanel().errorDialog(e1); } } infos.add("too many opening parentheses"); } _vod.get_info().setForeground(COLORERROR); _vod.get_seq().setForeground(COLORERROR); _vod.get_struct().setForeground(COLORERROR); } else { try { // redraw the new RNA _vod.get_varnaPanel().drawRNA(_vod.get_seq().getText(), _vod.get_struct().getText(), _vod.get_varnaPanel().getRNA().get_drawMode()); } catch (ExceptionNonEqualLength e1) { _vod.get_varnaPanel().errorDialog(e1); } // verifie la longueur de la structure et de la sequence if (_vod.get_seq().getText().length() != _vod.get_struct() .getText().length()) { // colorie en orange infos.add("different lenghts"); _vod.get_seq().setForeground(COLORWARNING); _vod.get_struct().setForeground(COLORWARNING); } else { // sinon colorie en noir _vod.get_seq().setForeground(Color.black); _vod.get_struct().setForeground(Color.black); } } _vod.get_varnaPanel().getVARNAUI().UIReset(); String info = new String(); if (infos.size() != 0) { info += infos.get(0); for (int i = 1; i < infos.size(); i++) { info += ", " + infos.get(i); } info += "."; } _vod.get_info().setText(info); } } }PK 4F>]xx<fr/orsay/lri/varna/controlers/ControleurGlobalRotation.class176fr/orsay/lri/varna/controlers/ControleurGlobalRotationjava/lang/Object javax/swing/event/ChangeListener_vGR,Lfr/orsay/lri/varna/views/VueGlobalRotation; _oldAngleD_vpLfr/orsay/lri/varna/VARNAPanel;N(Lfr/orsay/lri/varna/views/VueGlobalRotation;Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V     LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/controlers/ControleurGlobalRotation;vGRvp stateChanged"(Ljavax/swing/event/ChangeEvent;)V "$#fr/orsay/lri/varna/VARNAPanel %& getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; (*)*fr/orsay/lri/varna/views/VueGlobalRotation +,getAngle()D .0/fr/orsay/lri/varna/views/VueUI 12UIGlobalRotation(D)VeLjavax/swing/event/ChangeEvent; SourceFileControleurGlobalRotation.java!   b**+**,"# $%&   ^"*!*'*g-**')*!+""3456PK a*>;fr/orsay/lri/varna/controlers/ControleurGlobalRotation.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.models.VARNAEdits; import fr.orsay.lri.varna.views.VueGlobalRotation; public class ControleurGlobalRotation implements ChangeListener { private VueGlobalRotation _vGR; private double _oldAngle; private VARNAPanel _vp; public ControleurGlobalRotation(VueGlobalRotation vGR, VARNAPanel vp) { _vGR = vGR; _oldAngle = 0; _vp = vp; } public void stateChanged(ChangeEvent e) { _vp.getVARNAUI().UIGlobalRotation(_vGR.getAngle() - _oldAngle); _oldAngle = _vGR.getAngle(); } } PK 4F>4fr/orsay/lri/varna/controlers/ControleurBorder.class1M.fr/orsay/lri/varna/controlers/ControleurBorderjava/lang/Object javax/swing/event/ChangeListener_vb$Lfr/orsay/lri/varna/views/VueBorder;'(Lfr/orsay/lri/varna/views/VueBorder;)VCode  ()V  LineNumberTableLocalVariableTablethis0Lfr/orsay/lri/varna/controlers/ControleurBorder;vb stateChanged"(Ljavax/swing/event/ChangeEvent;)V "fr/orsay/lri/varna/views/VueBorder  getDimension()Ljava/awt/Dimension; ! java/awt/Dimension "# getHeight()D % &'get_vp!()Lfr/orsay/lri/varna/VARNAPanel; )+*fr/orsay/lri/varna/VARNAPanel ",()I . /#getWidth )1 /, )3 45 setBorderSize(Ljava/awt/Dimension;)V )7 8 getBorderSize : ;<widthI > ?<height A B(II)V )D E5setMinimumSize )G HrepainteLjavax/swing/event/ChangeEvent; SourceFileControleurBorder.java!  F * *+ ! "   }**$(f*-*$0M*$*2*$Y*$69h*$6=h@C*$F* %&2'C(J)]*k)o(r+|-}}IJKLPK pqF?fr/orsay/lri/varna/controlers/ControleurJCheckBoxMenuItem.class1!9fr/orsay/lri/varna/controlers/ControleurJCheckBoxMenuItemjava/lang/Objectjava/awt/event/ItemListener_vpLfr/orsay/lri/varna/VARNAPanel;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  LineNumberTableLocalVariableTablethis;Lfr/orsay/lri/varna/controlers/ControleurJCheckBoxMenuItem;vitemStateChanged(Ljava/awt/event/ItemEvent;)V fr/orsay/lri/varna/VARNAPanel repainteLjava/awt/event/ItemEvent; SourceFile ControleurJCheckBoxMenuItem.java!  F * *+$% &   @* )* PK pq<r>fr/orsay/lri/varna/controlers/ControleurJCheckBoxMenuItem.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import fr.orsay.lri.varna.VARNAPanel; /** * Controller of check box menu items to repaint if item state changes * * @author darty * */ public class ControleurJCheckBoxMenuItem implements ItemListener { private VARNAPanel _vp; public ControleurJCheckBoxMenuItem(VARNAPanel v) { _vp = v; } public void itemStateChanged(ItemEvent e) { _vp.repaint(); } } PK 4F>K25fr/orsay/lri/varna/controlers/ControleurMolette.class10/fr/orsay/lri/varna/controlers/ControleurMolettejava/lang/Object!java/awt/event/MouseWheelListener_vpLfr/orsay/lri/varna/VARNAPanel;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  LineNumberTableLocalVariableTablethis1Lfr/orsay/lri/varna/controlers/ControleurMolette;vuepmouseWheelMoved#(Ljava/awt/event/MouseWheelEvent;)V java/awt/event/MouseWheelEvent getWheelRotation()I ! fr/orsay/lri/varna/VARNAPanel "# getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; %'&fr/orsay/lri/varna/views/VueUI (UIZoomIn %* + UIZoomOute Ljava/awt/event/MouseWheelEvent; SourceFileControleurMolette.java!  F * *+#$ %   ` +*$ *)*+/1  ,-./PK pq zoom in if (e.getWheelRotation() == -1) { _vp.getVARNAUI().UIZoomIn(); } // Roulement vers le bas => zoom out else { _vp.getVARNAUI().UIZoomOut(); } } } PK 4F>' LP<fr/orsay/lri/varna/controlers/ControleurDraggedMolette.class1b6fr/orsay/lri/varna/controlers/ControleurDraggedMolettejava/lang/Objectjava/awt/event/MouseListener"java/awt/event/MouseMotionListener_vpLfr/orsay/lri/varna/VARNAPanel;_rightButtonClickLjava/lang/Boolean; _directionLjava/awt/Point;_avant_apres"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  java/lang/Boolean valueOf(Z)Ljava/lang/Boolean;  "java/awt/Point ! %  '  ) LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/controlers/ControleurDraggedMolette;vp mouseDragged(Ljava/awt/event/MouseEvent;)V 2 34 booleanValue()Z 687java/awt/event/MouseEvent 9:getPoint()Ljava/awt/Point; !< =>xI !@ A>y !C D(II)V FHGfr/orsay/lri/varna/VARNAPanel I:getTranslation FK LMsetTranslation(Ljava/awt/Point;)V FO PcheckTranslation FR SrepainteLjava/awt/event/MouseEvent; mouseMoved mouseClicked mouseEntered mouseExited mousePressed 6\ ]^ getButton()I mouseReleased SourceFileControleurDraggedMolette.java!   g#**+!Y#Y$Y&(*78 9:";+#,-#. /0y1r+5&!Y&;(;d&?(?dB$*!Y*E;$;`*E?$?`BJ&(*N*Q** ? AD4FMGaFdIjJqKxM+y,-yTUV05*P+,-TUW05*S+,-TUX05*V+,-TUY05*Y+,-TUZ0e!+5(+[  *]`bf j+!,-!TU_0L+[ *opq+,-TU`aPK pqtrue if the right button is pressed
* false if not */ private static Boolean _rightButtonClick; /** * The vector which contains the direction of the mouse movement */ private static Point _direction; /** * The position of the cursor before the mouse drag */ private static Point _avant; /** * The position of the cursor after the mouse drag */ private static Point _apres; public ControleurDraggedMolette(VARNAPanel vp) { _vp = vp; _rightButtonClick = false; _avant = _apres = _direction = new Point(); } public void mouseDragged(MouseEvent e) { // si le bon boutton a été pressé if (_rightButtonClick) { // la position du curseur est enregistrée _apres = e.getPoint(); // le vecteur direction est crée avec la difference du point avant // et après _direction = new Point(_apres.x - _avant.x, _apres.y - _avant.y); // la translation est mise a jour sur le VARNAPanel _vp.setTranslation(new Point(_vp.getTranslation().x + _direction.x, _vp.getTranslation().y + _direction.y)); // le point avant est mise à jour à la valeur du point d'après _avant = _apres; _vp.checkTranslation(); _vp.repaint(); } } public void mouseMoved(MouseEvent e) { } public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { // lors du clic, la position du curseur est enregistrée _avant = e.getPoint(); // si le boutton molette est pressé ou si le boutton gauche et shift // sont pressés if (e.getButton() == MouseEvent.BUTTON2) { _rightButtonClick = true; } else { _rightButtonClick = false; } } public void mouseReleased(MouseEvent e) { // si le boutton molette est relaché ou si le boutton gauche et shift // sont relachés if (e.getButton() == MouseEvent.BUTTON2) _rightButtonClick = false; } } PK 4F>ӍV>fr/orsay/lri/varna/controlers/ControleurTableAnnotations.class18fr/orsay/lri/varna/controlers/ControleurTableAnnotationsjava/lang/Objectjava/awt/event/MouseListener"java/awt/event/MouseMotionListenerREMOVEI ConstantValueEDIT_tableLjavax/swing/JTable;_vpLfr/orsay/lri/varna/VARNAPanel;_type7(Ljavax/swing/JTable;Lfr/orsay/lri/varna/VARNAPanel;I)VCode  ()V       LineNumberTableLocalVariableTablethis:Lfr/orsay/lri/varna/controlers/ControleurTableAnnotations;tablevptype mouseClicked(Ljava/awt/event/MouseEvent;)V * +edit - .removearg0Ljava/awt/event/MouseEvent; 243fr/orsay/lri/varna/VARNAPanel 56set_selectedAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)V 8:9javax/swing/JTable ;<getSelectedRow()I 8> ?@ getValueAt(II)Ljava/lang/Object;B4fr/orsay/lri/varna/models/annotations/TextAnnotation 2D EFremoveAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)ZHjava/lang/ExceptionJImpossible de supprimer GL M(Ljava/lang/String;)V 2O PQ errorDialog(Ljava/lang/Exception;)VSDeleted! 8U VW setValueAt(Ljava/lang/Object;II)VY8fr/orsay/lri/varna/models/annotations/ChemProbAnnotation 2[ \]getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; _a`!fr/orsay/lri/varna/models/rna/RNA bcremoveChemProbAnnotation=(Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;)Ve?fr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation _g hiremoveHighlightRegionD(Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)V 2k lrepaintoLjava/lang/Object;p&fr/orsay/lri/varna/views/VueAnnotation or sY(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/TextAnnotation;Z)V ou vshow dx yzcloneC()Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;|/fr/orsay/lri/varna/views/VueHighlightRegionEdit {~ c(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)V { v()Z d getBases()Ljava/util/ArrayList; d setBases(Ljava/util/ArrayList;)V d  getFillColor()Ljava/awt/Color; d  setFillColor(Ljava/awt/Color;)V d getOutlineColor d setOutlineColor d  getRadius()D d  setRadius(D)V X y<()Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;.fr/orsay/lri/varna/views/VueChemProbAnnotation \(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;)V X getColor X setColor X  getIntensity X  setIntensity X getTypeS()Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; X setTypeT(Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;)V X isOut X setOut(Z)V textAnnot6Lfr/orsay/lri/varna/models/annotations/TextAnnotation; vueAnnotation(Lfr/orsay/lri/varna/views/VueAnnotation;annotALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;an1Lfr/orsay/lri/varna/views/VueHighlightRegionEdit;:Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;0Lfr/orsay/lri/varna/views/VueChemProbAnnotation; mouseEntered mouseExited mousePressed mouseReleased mouseDragged mouseMoved java/awt/event/MouseEvent getPoint()Ljava/awt/Point; 8  rowAtPoint(Ljava/awt/Point;)I  getClass()Ljava/lang/Class;  equals(Ljava/lang/Object;)Z 2 get_selectedAnnotation8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation; SourceFileControleurTableAnnotations.java InnerClassesOfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationTypeChemProbAnnotationType!      l**+*,* 78 9:;!*"#$%& '(s+*&*) *, >@ A#C'D*H!+"#+/0.*1**7=L+A5*+AC*GYIKN*R*7TR+X%*Z+X^*R*7T)+d"*Z+df*R*7T*j :NOPQ-R=SQUXVfWzYZ[]^!"#mn+**7=L+A+AMoY*,qN-t+dF+dM,wN{Y*,}:m,-,-,-,-J+XC+XM,NY*,:#,-,-,-,- jde dfhj*k1l8n=oBpPqXs`thupv{xz{|}!f "#mn*=>B9P+;6((5 !"#/0(L*1*j !"#/0(5 !"#/0(5 !"#/0(5 !"#/0(M*+նۜ**+ն=M,A ,**,A1*j "#/:EL! M"#M/0#*mn X@PK pq<=fr/orsay/lri/varna/controlers/ControleurTableAnnotations.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import javax.swing.JTable; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.models.annotations.ChemProbAnnotation; import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.annotations.TextAnnotation; import fr.orsay.lri.varna.views.VueAnnotation; import fr.orsay.lri.varna.views.VueChemProbAnnotation; import fr.orsay.lri.varna.views.VueHighlightRegionEdit; /** * Mouse action and motion listener for AnnotationTableModel * * @author Darty@lri.fr * */ public class ControleurTableAnnotations implements MouseListener, MouseMotionListener { public static final int REMOVE = 0, EDIT = 1; private JTable _table; private VARNAPanel _vp; private int _type; /** * * @param table * @param vp * @param type * : REMOVE = 0, EDIT = 1 */ public ControleurTableAnnotations(JTable table, VARNAPanel vp, int type) { _table = table; _vp = vp; _type = type; } public void mouseClicked(MouseEvent arg0) { switch (_type) { case EDIT: edit(); break; case REMOVE: remove(); break; default: break; } } /** * if remove case */ private void remove() { _vp.set_selectedAnnotation(null); Object o = _table.getValueAt(_table.getSelectedRow(), 0); if (o instanceof TextAnnotation) { if (!_vp.removeAnnotation((TextAnnotation) o)) _vp.errorDialog(new Exception("Impossible de supprimer")); _table.setValueAt("Deleted!", _table.getSelectedRow(), 0); } else if (o instanceof ChemProbAnnotation) { _vp.getRNA().removeChemProbAnnotation((ChemProbAnnotation) o); _table.setValueAt("Deleted!", _table.getSelectedRow(), 0); } else if (o instanceof HighlightRegionAnnotation) { _vp.getRNA().removeHighlightRegion((HighlightRegionAnnotation) o); _table.setValueAt("Deleted!", _table.getSelectedRow(), 0); } _vp.repaint(); } /** * if edit case */ private void edit() { Object o = _table.getValueAt(_table .getSelectedRow(), 0); if (o instanceof TextAnnotation) { TextAnnotation textAnnot = (TextAnnotation) o; VueAnnotation vueAnnotation; vueAnnotation = new VueAnnotation(_vp, textAnnot, false); vueAnnotation.show(); }else if (o instanceof HighlightRegionAnnotation) { HighlightRegionAnnotation annot = (HighlightRegionAnnotation) o; HighlightRegionAnnotation an = annot.clone(); VueHighlightRegionEdit vueAnnotation = new VueHighlightRegionEdit(_vp,annot); if (!vueAnnotation.show()) { annot.setBases(an.getBases()); annot.setFillColor(an.getFillColor()); annot.setOutlineColor(an.getOutlineColor()); annot.setRadius(an.getRadius()); } }else if (o instanceof ChemProbAnnotation) { ChemProbAnnotation annot = (ChemProbAnnotation) o; ChemProbAnnotation an = annot.clone(); VueChemProbAnnotation vueAnnotation = new VueChemProbAnnotation(_vp,annot); if (!vueAnnotation.show()) { annot.setColor(an.getColor()); annot.setIntensity(an.getIntensity()); annot.setType(an.getType()); annot.setOut(an.isOut()); } } } public void mouseEntered(MouseEvent arg0) { } public void mouseExited(MouseEvent arg0) { _vp.set_selectedAnnotation(null); _vp.repaint(); } public void mousePressed(MouseEvent arg0) { } public void mouseReleased(MouseEvent arg0) { } public void mouseDragged(MouseEvent arg0) { } /** * update selected annotation */ public void mouseMoved(MouseEvent arg0) { if (_table.rowAtPoint(arg0.getPoint()) < 0) return; Object o = _table.getValueAt(_table.rowAtPoint(arg0.getPoint()), 0); if (o.getClass().equals(TextAnnotation.class) && o != _vp.get_selectedAnnotation()) { _vp.set_selectedAnnotation((TextAnnotation) o); _vp.repaint(); } } } PK 4F>%b?fr/orsay/lri/varna/controlers/ControleurSpaceBetweenBases.class189fr/orsay/lri/varna/controlers/ControleurSpaceBetweenBasesjava/lang/Object javax/swing/event/ChangeListener_vsbb/Lfr/orsay/lri/varna/views/VueSpaceBetweenBases;2(Lfr/orsay/lri/varna/views/VueSpaceBetweenBases;)VCode  ()V  LineNumberTableLocalVariableTablethis;Lfr/orsay/lri/varna/controlers/ControleurSpaceBetweenBases;vsbb stateChanged"(Ljavax/swing/event/ChangeEvent;)V -fr/orsay/lri/varna/views/VueSpaceBetweenBases get_vp!()Lfr/orsay/lri/varna/VARNAPanel; ! fr/orsay/lri/varna/VARNAPanel "#getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; % &'getSpace()Ljava/lang/Double; )+*!fr/orsay/lri/varna/models/rna/RNA ,-set_spaceBetweenBases(Ljava/lang/Double;)V / 0drawRNA 2 3repainteLjavax/swing/event/ChangeEvent; SourceFile ControleurSpaceBetweenBases.java!  F * *+    i)**$(*.*1#$%(&))4567PK pq<Ye>fr/orsay/lri/varna/controlers/ControleurSpaceBetweenBases.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.views.VueSpaceBetweenBases; public class ControleurSpaceBetweenBases implements ChangeListener { private VueSpaceBetweenBases _vsbb; public ControleurSpaceBetweenBases(VueSpaceBetweenBases vsbb) { _vsbb = vsbb; } public void stateChanged(ChangeEvent e) { _vsbb.get_vp().getRNA().set_spaceBetweenBases(_vsbb.getSpace()); _vsbb.get_vp().drawRNA(); _vsbb.get_vp().repaint(); } } PK 4F>><fr/orsay/lri/varna/controlers/ControleurVARNAPanelKeys.class166fr/orsay/lri/varna/controlers/ControleurVARNAPanelKeysjava/lang/Objectjava/awt/event/MouseListenerjava/awt/event/KeyListener java/awt/event/FocusListener_vpLfr/orsay/lri/varna/VARNAPanel;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/controlers/ControleurVARNAPanelKeys;vp mouseClicked(Ljava/awt/event/MouseEvent;)VeLjava/awt/event/MouseEvent; mouseEntered mouseExited mousePressed mouseReleased keyPressed(Ljava/awt/event/KeyEvent;)V %'&java/awt/event/KeyEvent ()getModifiersEx()I +-,fr/orsay/lri/varna/VARNAPanel ./ getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; %1 2) getKeyCode 465fr/orsay/lri/varna/views/VueUI 7UIAbout 49 : UISetBorder 4< =UISetColorMapCaption 4? @UIPickGapsBasesColor 4B CUIToggleColorGapsBases 4E FUIToggleShowNonPlanar 4H IUIToggleFlatExteriorLoop 4K LUISetBackground 4N OUIToggleGaspinMode 4Q RUISetBPHeightIncrement +T UVgetLastSelectedPosition ()Ljava/awt/geom/Point2D$Double; XZYjava/awt/geom/Point2D$Double [\xD X^ _\y 4a bcUIAnnotationsAddPosition(II)V 4e fUIPickSpecialBasesColor 4h iUIToggleColorSpecialBases 4k lUILoadColorMapValues 4n oUISetBackboneColor 4q rUIToggleColorMap 4t uUISetColorMapStyle 4w xUISetColorMapValues 4z {UISetNumPeriod 4} ~UIToggleModifiable 4  UIManualInput 4 UIFile 4  UISetBPStyle 4 UIPrint 4 UIAutoAnnotateHelices 4 UIAutoAnnotateTerminalLoops 4 UIAutoAnnotateInteriorLoops 4 UIAutoAnnotateStrandEnds 4 UIReset 4 UIGlobalRotation 4 UISetSpaceBetweenBases 4 UISaveAs 4 UISetTitleFont 4 UISetTitleColor 4  UISetTitle 4 UIBaseTypeColor 4 UIBasePairTypeColor 4 UIBaseAllColor 4 UIToggleShowNCBP 4 UIExport 4 UIRedo 4 UIUndo 4  UICustomZoom 4 UILine 4  UICircular 4  UIRadiate 4 UINAView 4  UIVARNAView 4  UIMOTIFView + getZoom()D + getTranslation()Ljava/awt/Point; java/awt/Point _I + checkTranslation [ 4 UIZoomIn 4  UIZoomOut +  errorDialog(Ljava/lang/Exception;)V + repaintjava/lang/ExceptionLjava/awt/event/KeyEvent; controlDownZ shiftDownaltDownui Lfr/orsay/lri/varna/views/VueUI;pLjava/awt/geom/Point2D$Double;e1Ljava/lang/Exception; getRandomRNA()Ljava/lang/String;  java/lang/Math  random?@$java/lang/StringBuilder java/lang/String valueOf&(Ljava/lang/Object;)Ljava/lang/String;  (Ljava/lang/String;)V  append(C)Ljava/lang/StringBuilder;   toString@pilejilfunLjava/lang/String; keyReleasedkeyTyped focusGained(Ljava/awt/event/FocusEvent;)Varg0Ljava/awt/event/FocusEvent; focusLost SourceFileControleurVARNAPanelKeys.java InnerClasses4java/awt/geom/Point2DDouble!   F **++, -   505659 5<!5?"#-9+$~=+$@~@>+$~6**:+0%%&\'(6-123456*=A4B@CLD\EtFGHJKLM:NWOcPoQRST'ULWXYZ 38; >AxtDlhG` JTPKMC P3/+*S:W]`  dg jm p sv y|} mie]**C**)** **    ****lhd_**RNFB:6.   ħǧʧͧЧӧ**Yd***Y`*j*^*Y`*D*8*Yd*:**D#&BC&D;EDG|IJLNOQSTVXYZ\_abdfgiklnoqstv xy#{&}*~.6;>FNRWZbjnvz %2<?CGOTW[_glosw&.36:?BFK N R WZ^cfjorv{~!"#%'()+-./134 57:;=#?&@(A1C8DR99%&;D( <>: 8= k9Y.:ߧ C?=!k9"Y):?ا8=!k9"Y(:С>Y):"`b c def!g$h:i=j@gKmYn[odpgq}rstpwxyz{|}ycf #3$[:$3$%!*&\d1&\*&\ '()#5*#5+,@* -./,@* -.012 X35 PK <>!V&&;fr/orsay/lri/varna/controlers/ControleurVARNAPanelKeys.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.Point2D; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.views.VueUI; /** * VARNAPanel Shortcuts Controller * * @author darty * */ public class ControleurVARNAPanelKeys implements MouseListener, KeyListener, FocusListener { private VARNAPanel _vp; public ControleurVARNAPanelKeys(VARNAPanel vp) { _vp = vp; } public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { // prise du focus //_vp.requestFocus(); } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } public void keyPressed(KeyEvent e) { boolean controlDown = (e.getModifiersEx() & (KeyEvent.CTRL_DOWN_MASK)) == KeyEvent.CTRL_DOWN_MASK; boolean shiftDown = (e.getModifiersEx() & (KeyEvent.SHIFT_DOWN_MASK)) == KeyEvent.SHIFT_DOWN_MASK; boolean altDown = (e.getModifiersEx() & (KeyEvent.ALT_DOWN_MASK)) == KeyEvent.ALT_DOWN_MASK; VueUI ui = _vp.getVARNAUI(); try { switch (e.getKeyCode()) { case (KeyEvent.VK_A): if (controlDown) { ui.UIAbout(); } break; case (KeyEvent.VK_B): if (controlDown) { ui.UISetBorder(); } break; case (KeyEvent.VK_C): if (shiftDown && controlDown) { ui.UISetColorMapCaption(); } break; case (KeyEvent.VK_D): if (controlDown) { if (shiftDown) { ui.UIPickGapsBasesColor(); } else { ui.UIToggleColorGapsBases(); } } break; case (KeyEvent.VK_E): if (controlDown) { ui.UIToggleShowNonPlanar(); } break; case (KeyEvent.VK_F): if (controlDown) { ui.UIToggleFlatExteriorLoop(); } break; case (KeyEvent.VK_G): if (controlDown) { ui.UISetBackground(); } else if (!shiftDown && altDown) { ui.UIToggleGaspinMode(); } break; case (KeyEvent.VK_H): if (controlDown && !shiftDown) { ui.UISetBPHeightIncrement(); } else if (controlDown && shiftDown) { Point2D.Double p = _vp.getLastSelectedPosition(); ui.UIAnnotationsAddPosition((int)p.x,(int)p.y); } break; case (KeyEvent.VK_J): if (controlDown) { if (shiftDown) { ui.UIPickSpecialBasesColor(); } else { ui.UIToggleColorSpecialBases(); } } break; case (KeyEvent.VK_K): if (controlDown && shiftDown) { ui.UILoadColorMapValues(); } else if (controlDown) { ui.UISetBackboneColor(); } break; case (KeyEvent.VK_L): if (shiftDown && controlDown) { ui.UIToggleColorMap(); } else if (controlDown) { ui.UISetColorMapStyle(); } else if (shiftDown) { ui.UISetColorMapValues(); } break; case (KeyEvent.VK_M): if (controlDown) { ui.UISetNumPeriod(); } else if (shiftDown && altDown) { ui.UIToggleModifiable(); } break; case (KeyEvent.VK_N): if (controlDown) { ui.UIManualInput(); } break; case (KeyEvent.VK_O): if (controlDown) { ui.UIFile(); } break; case (KeyEvent.VK_P): if (controlDown && shiftDown) { ui.UISetBPStyle(); } else if (controlDown && !shiftDown) { ui.UIPrint(); } break; case (KeyEvent.VK_Q): if (controlDown && !shiftDown && !altDown) { _vp.getVARNAUI().UIAutoAnnotateHelices(); } else if (controlDown && shiftDown && !altDown) { _vp.getVARNAUI().UIAutoAnnotateTerminalLoops(); } else if (!controlDown && shiftDown && altDown) { _vp.getVARNAUI().UIAutoAnnotateInteriorLoops(); } else if (controlDown && !shiftDown && altDown) { _vp.getVARNAUI().UIAutoAnnotateStrandEnds(); } break; case (KeyEvent.VK_R): if (controlDown) { if (shiftDown) { ui.UIReset(); } else { ui.UIGlobalRotation(); } } break; case (KeyEvent.VK_S): if (controlDown) { if (shiftDown) { ui.UISetSpaceBetweenBases(); } else { ui.UISaveAs(); } } break; case (KeyEvent.VK_T): if (controlDown) { if (shiftDown) { ui.UISetTitleFont(); } else if (altDown) { ui.UISetTitleColor(); } else { ui.UISetTitle(); } } break; case (KeyEvent.VK_U): if (controlDown && !shiftDown && !altDown) { _vp.getVARNAUI().UIBaseTypeColor(); } else if (!controlDown && shiftDown && !altDown) { _vp.getVARNAUI().UIBasePairTypeColor(); } else if (!controlDown && !shiftDown && altDown) { _vp.getVARNAUI().UIBaseAllColor(); } break; case (KeyEvent.VK_W): if (controlDown) { ui.UIToggleShowNCBP(); } break; case (KeyEvent.VK_X): if (controlDown) { ui.UIExport(); } break; case (KeyEvent.VK_Y): if (controlDown) { ui.UIRedo(); } break; case (KeyEvent.VK_Z): if (controlDown && !shiftDown) { ui.UIUndo(); } else if (controlDown && shiftDown) { ui.UIRedo(); } else if (!controlDown && !shiftDown) { ui.UICustomZoom(); } break; case (KeyEvent.VK_1): if (controlDown) { ui.UILine(); } break; case (KeyEvent.VK_2): if (controlDown) { ui.UICircular(); } break; case (KeyEvent.VK_3): if (controlDown) { ui.UIRadiate(); } break; case (KeyEvent.VK_4): if (controlDown) { ui.UINAView(); } break; case (KeyEvent.VK_5): if (controlDown) { ui.UIVARNAView(); } break; case (KeyEvent.VK_6): if (controlDown) { ui.UIMOTIFView(); } break; // Navigation control keys (Zoom in/out, arrow keys ...) case (KeyEvent.VK_DOWN): if (_vp.getZoom() > 1) { _vp.getTranslation().y -= 5; _vp.checkTranslation(); } break; case (KeyEvent.VK_UP): if (_vp.getZoom() > 1) { _vp.getTranslation().y += 5; _vp.checkTranslation(); } break; case (KeyEvent.VK_LEFT): if (_vp.getZoom() > 1) { _vp.getTranslation().x += 5; _vp.checkTranslation(); } break; case (KeyEvent.VK_RIGHT): if (_vp.getZoom() > 1) { _vp.getTranslation().x -= 5; _vp.checkTranslation(); } break; case (KeyEvent.VK_EQUALS): case (KeyEvent.VK_PLUS): ui.UIZoomIn(); break; case (KeyEvent.VK_MINUS): ui.UIZoomOut(); break; } } catch (Exception e1) { _vp.errorDialog(e1); } _vp.repaint(); } /** * if ((e.getKeyCode() == KeyEvent.VK_PLUS)||(e.getKeyChar() == '+')) { * _vp.getVARNAUI().UIZoomIn(); } else if (e.getKeyCode() == * KeyEvent.VK_MINUS) { _vp.getVARNAUI().UIZoomOut(); } // 1 pour Redraw * Radiate else if (e.getKeyChar() == KeyEvent.VK_1) { * _vp.getVARNAUI().UIRadiate(); } // 2 pour Redraw Circular else if * (e.getKeyChar() == KeyEvent.VK_2) { _vp.getVARNAUI().UICircular(); } // 3 * pour Redraw NAView else if (e.getKeyChar() == KeyEvent.VK_3) { * _vp.getVARNAUI().UINAView(); } * * // 4 for RNA on a line else if (e.getKeyChar() == KeyEvent.VK_4) { * _vp.getVARNAUI().UILine(); } // 5 fun arn random coord else if * (e.isControlDown() && e.getKeyChar() == KeyEvent.VK_9) { for (int i = 0; * i < _vp.getRNA().get_listeBases().size(); i++) { * _vp.getRNA().get_listeBases().get(i).set_coords( new * Point2D.Double(_vp.getWidth() * Math.random(), _vp.getHeight() * * Math.random())); _vp.getRNA().get_listeBases().get(i).set_center( new * Point2D.Double(_vp.getWidth() / 2 Math.random(), _vp.getHeight() / 2 * Math.random())); } } // 6 fun random arn structure else if * (e.isControlDown() & e.getKeyChar() == KeyEvent.VK_8) { try { * _vp.drawRNA(_vp.getRNA().getListeBasesToString(), getRandomRNA(), _vp * .getRNA().get_drawMode()); } catch (ExceptionNonEqualLength e1) { * _vp.errorDialog(e1); } } _vp.repaint(); } **/ public String getRandomRNA() { int pile = 0, j, i = 0; double l; String fun = ""; while (i < 2000) { if (Math.random() > 0.5) { j = 0; l = Math.random() * 10; while (j < l) { fun += '.'; i++; j++; } } else { if (Math.random() > 0.5 && pile > 0) { j = 0; l = Math.random() * 5; while (j < l && pile > 0) { fun += ')'; pile--; j++; i++; } } else { j = 0; l = Math.random() * 5; while (j < l) { fun += '('; pile++; j++; i++; } } } } while (pile > 0) { fun += ')'; pile--; } return fun; } public void keyReleased(KeyEvent e) { } public void keyTyped(KeyEvent e) { } public void focusGained(FocusEvent arg0) { _vp.repaint(); } public void focusLost(FocusEvent arg0) { _vp.repaint(); } }PK 4F> \GG?fr/orsay/lri/varna/controlers/ControleurBPHeightIncrement.class189fr/orsay/lri/varna/controlers/ControleurBPHeightIncrementjava/lang/Object javax/swing/event/ChangeListener_vsbb/Lfr/orsay/lri/varna/views/VueBPHeightIncrement;2(Lfr/orsay/lri/varna/views/VueBPHeightIncrement;)VCode  ()V  LineNumberTableLocalVariableTablethis;Lfr/orsay/lri/varna/controlers/ControleurBPHeightIncrement;vsbb stateChanged"(Ljavax/swing/event/ChangeEvent;)V -fr/orsay/lri/varna/views/VueBPHeightIncrement get_vp!()Lfr/orsay/lri/varna/VARNAPanel;  ! getIncrement()Ljava/lang/Double; #%$java/lang/Double &' doubleValue()D )+*fr/orsay/lri/varna/VARNAPanel ,-setBPHeightIncrement(D)V )/ 0drawRNA )2 3repainteLjavax/swing/event/ChangeEvent; SourceFile ControleurBPHeightIncrement.java!  F * *+    i)**"(*.*1#$%(&))4567PK pq>>fr/orsay/lri/varna/controlers/ControleurBPHeightIncrement.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.views.VueBPHeightIncrement; public class ControleurBPHeightIncrement implements ChangeListener { private VueBPHeightIncrement _vsbb; public ControleurBPHeightIncrement(VueBPHeightIncrement vsbb) { _vsbb = vsbb; } public void stateChanged(ChangeEvent e) { _vsbb.get_vp().setBPHeightIncrement(_vsbb.getIncrement()); _vsbb.get_vp().drawRNA(); _vsbb.get_vp().repaint(); } } PK 4F>,L,L2fr/orsay/lri/varna/controlers/ControleurMenu.class1,fr/orsay/lri/varna/controlers/ControleurMenujava/lang/Object4fr/orsay/lri/varna/interfaces/InterfaceVARNAListenerjava/awt/event/ActionListener_vpLfr/orsay/lri/varna/VARNAPanel;_vm"Lfr/orsay/lri/varna/views/VueMenu;_typeLjava/lang/String;_color_sourceLjava/lang/Object;D(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/views/VueMenu;)VCode  ()V   fr/orsay/lri/varna/VARNAPanel !getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; #%$!fr/orsay/lri/varna/models/rna/RNA &'addVARNAListener9(Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;)VLineNumberTableLocalVariableTablethis.Lfr/orsay/lri/varna/controlers/ControleurMenu; _varnaPanel_vueMenuactionPerformed(Ljava/awt/event/ActionEvent;)V 132java/awt/event/ActionEvent 45getActionCommand()Ljava/lang/String;7, 9;:java/lang/String <=split'(Ljava/lang/String;)[Ljava/lang/String; 1? @A getSource()Ljava/lang/Object; C  E  G I K LM optionRedraw()Z O PM optionExport R SM optionImport U VMoptionRNADisplay X YM optionTitle [ \MoptionColorMap ^ _M optionView a bM optionBase d eMoptionBasePair g hM optionLoop j kM option3prime m nM option5prime p qM optionHelix s tM optionStem v wM optionBulge y zMoptionAnnotation | }MoptionBPjava/lang/Exceptionjava/lang/StringBuilderUknown action command ' (Ljava/lang/String;)V append-(Ljava/lang/String;)Ljava/lang/StringBuilder;' 5toString ~   errorDialog(Ljava/lang/Exception;)VeLjava/awt/event/ActionEvent;temp[Ljava/lang/String; editallbps 9 equals(Ljava/lang/Object;)Z   getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; fr/orsay/lri/varna/views/VueUI UIEditAllBasePairs annotation 9 contains(Ljava/lang/CharSequence;)ZannotationsaddPosition  getPopup$()Lfr/orsay/lri/varna/views/VueMenu;  fr/orsay/lri/varna/views/VueMenu  getSpawnPoint()Ljava/awt/Point; java/awt/Point xI y UIAnnotationsAddPosition(II)VannotationsaddBase UIAnnotationsAddBaseannotationsaddLoop UIAnnotationsAddLoopannotationsaddChemProb UIAnnotationsAddChemProbannotationsaddRegion UIAnnotationsAddRegionannotationsaddHelix UIAnnotationsAddHelixannotationsautohelices UIAutoAnnotateHelicesannotationsautointerior UIAutoAnnotateInteriorLoopsannotationsautoterminal UIAutoAnnotateTerminalLoopsannotationsremove UIAnnotationsRemoveannotationsautoextremites UIAutoAnnotateStrandEndsannotationsedit UIAnnotationsEditSelectionannotationremove  get_selectedAnnotation8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation;   UIAnnotationRemoveFromAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)V Selectionannotationedit   UIAnnotationEditFromAnnotation annotationadd 9 endsWith(Ljava/lang/String;)Zannotationremoveannotationedit  trouverAncrage()Ijava/util/ArrayList    !getNearestBase()Ljava/lang/Integer; # $add&loop1 9( ) startsWith +-,java/lang/Integer .intValue #0 12findLoopForward(I)Ljava/util/ArrayList;4loop2 #6 72findLoopBackward #9 :2findLoop #< =2 findHelix ? @AUIAnnotationAddFromStructure(ILjava/util/ArrayList;)V C DAUIAnnotationRemoveFromStructure F GAUIAnnotationEditFromStructure ~I JprintStackTracetype listeIndexLjava/util/ArrayList;e2Ljava/lang/Exception;LocalVariableTypeTable*Ljava/util/ArrayList;SloopUhelixWbaseY&probleme d'identification de l'ancrage  \ ]M colorBases_ Choose new a InnerColor 9c devalueOf&(Ljava/lang/Object;)Ljava/lang/String;g inner color ikj%fr/orsay/lri/varna/models/VARNAConfig lmBASE_INNER_COLOR_DEFAULTLjava/awt/Color; oqpjavax/swing/JColorChooser rs showDialogH(Ljava/awt/Component;Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; u vwlistSwitchType)(Ljava/lang/String;)Ljava/util/ArrayList; #y z{get_listeBases()Ljava/util/ArrayList; } ~get(I)Ljava/lang/Object;(fr/orsay/lri/varna/models/rna/ModeleBase   getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase; -fr/orsay/lri/varna/models/rna/ModeleStyleBase set_base_inner_color(Ljava/awt/Color;)V  size  repaint OutlineColor outline color i mBASE_OUTLINE_COLOR_DEFAULT  set_base_outline_color NameColor name color i mBASE_NAME_COLOR_DEFAULT  set_base_name_color NumberColor number color i mBASE_NUMBER_COLOR_DEFAULT  set_base_number_colorBPColor base-pair color  getElementStructure   getStyleBP/()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; +fr/orsay/lri/varna/models/rna/ModeleStyleBP setCustomColor BPThickness'fr/orsay/lri/varna/views/VueBPThickness  7(Lfr/orsay/lri/varna/VARNAPanel;Ljava/util/ArrayList;)V  getPanel()Ljavax/swing/JPanel;Set base pair(s) thickness javax/swing/JOptionPane showConfirmDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)I  restoreThicknesseslistBasephrasecimb*Lfr/orsay/lri/varna/models/rna/ModeleBase;styleBPsvbpt)Lfr/orsay/lri/varna/views/VueBPThickness;DLjava/util/ArrayList; Signature>(Ljava/lang/String;)Ljava/util/ArrayList;current  {getSelectionIndicesallBases # {findAllstem # 2findStembasepairbpcolorbp + d(I)Ljava/lang/Integer;5' # findNonPairedBaseGroup*(Ljava/lang/Integer;)Ljava/util/ArrayList;3'bulgealllistj baseChar   UISetBaseCharacter  UIEditBasePair  UIColorBasePair thickness  UIThicknessBasePair background  UISetBackgroundshownc  !UIToggleShowNCBP#shownp % &UIToggleShowNonPlanar(spaceBetweenBases * +UISetSpaceBetweenBases-bpheightincrement / 0UISetBPHeightIncrement2 borderSize 4 5 UISetBorder7zoom 9 : UICustomZoom 9< =length 9? @A substring(I)Ljava/lang/String; +C DEparseInt(Ljava/lang/String;)I@YIjava/lang/Double HK L(D)V N OPsetZoom(Ljava/lang/Object;)VRrotation T UUIGlobalRotationfactorpcDZ titleDisplay \ ]UISetTitleFont_setTitle a b UISetTitled titleColor f gUISetTitleColoritoggleshowcolormap k lUIToggleColorMapncolormapcaption p qUISetColorMapCaptions colormapstyle u vUISetColorMapStylexcolormaploadvalues z {UILoadColorMapValues}colormapvalues  UISetColorMapValuesgaspin  UIToggleGaspinModebackbone  UISetBackboneColorbondsChoose new bonds color   getBackground()Ljava/awt/Color;  setDefaultBPColorbasecolorforBPjavax/swing/JCheckBoxMenuItem  MgetState  setUseBaseColorsForBPs(Z)Vbpstyle   UISetBPStylespecialbasecolored  UIToggleColorSpecialBases showwarnings  UIToggleShowWarningsdashbasecolored  UIToggleColorGapsBases numPeriod  UISetNumPeriodeachKind  UIBaseTypeColorNo base   emitWarning eachCouple  UIBasePairTypeColoreachBase  UIBaseAllColorspecialBasesColor  UIPickSpecialBasesColordashBasesColor  UIPickGapsBasesColorcheckLjavax/swing/JCheckBoxMenuItem; userInput   UIManualInputfile  UIFileprint  UIPrintabout  UIAboutjava/text/ParseException5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthe1Ljava/text/ParseException;7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength;reset  UIResetcircular   UICircularradiate   UIRadiatenaview  UINAView  varnaview    UIVARNAView motifview   UIMOTIFViewline  UILineflat  UIToggleFlatExteriorLoopsaveas  !UISaveAs#dbn % & UISaveAsDBN(bpseq * + UISaveAsBPSEQ-ct / 0 UISaveAsCT2eps 4 5 UIExportEPS7xfig 9 : UIExportXFIG<svg > ? UIExportSVGAjpeg C D UIExportJPEGFpng H I UIExportPNGK3fr/orsay/lri/varna/exceptions/ExceptionExportFailedM7fr/orsay/lri/varna/exceptions/ExceptionPermissionDeniedO7fr/orsay/lri/varna/exceptions/ExceptionWritingForbiddenQ3fr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding5Lfr/orsay/lri/varna/exceptions/ExceptionExportFailed;9Lfr/orsay/lri/varna/exceptions/ExceptionPermissionDenied;9Lfr/orsay/lri/varna/exceptions/ExceptionWritingForbidden;5Lfr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding; getExtension"(Ljava/io/File;)Ljava/lang/String; Y[Z java/io/File \5getName ^ V_&(Ljava/lang/String;)Ljava/lang/String;fLjava/io/File;s 9d ef lastIndexOf(I)I 9h i5 toLowerCaseext l mM isErrorsOn ~o p5 getMessager VARNA Error t uvshowMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)VonLayoutChangedonWarningEmittedz VARNA WarningonLoadpathonLoadedonUINewStructureM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)Vv'Lfr/orsay/lri/varna/models/VARNAConfig;r#Lfr/orsay/lri/varna/models/rna/RNA; SourceFileControleurMenu.java!   h**+*,**"(EF GHI) *+, - ./k+068M*+>B*,2D, *,2F *HF*J*N*Q*T*W}*Zv*]o*`h*ca*fZ*iS*lL*oE*r>*u7*x0*{)*~YY*D(fL MNOP)R/T6U=VDWKXRYYZ`[g\n]u^|_`abcdef) *+ }MS*D*(j kmn) *+zMi*D*D****ç)*DǶ****ɧ*D̶****Χ*DѶ****ӧ*Dֶ****ا]*D۶****ݧ**D**D**D**D**D**D**D*{*D**[*D** :*D *D*D*<YM',*"W*D%'***/MU*D3'***5M0***8M***;M*D *,>K*D**,B,*D**,E L+HWZ]~(:r suvAwMxtyz{|}~ @LYer~ #*0W\d,>K]^eg)*i*+\KdLM^NOP dLQ=*DR*DT*DV*~YXZ(" +-;) =*+nM/*[() *+kM/*[() *+wM/*[() *+tM/*[() *+qM/*[() *+]M:YLY^*DM*F`pY,bfM*,hnN-Z**DtL6)*x+|+*|-+**FpY,bM*,nN-**DtL6)*x+|+*|-+**FpY,bM*,nN-f**DtL6)*x+|+*|-+**FpY,bM*,nN-**DtL6)*x+|+*|-+**F}Y,bM*,nN-r**DtL66*x+|+*|: -+**F}Y,bM*,nN-**DtL66*x+|+*|: -+**F**DtLYN67*x+|+*|: -"W+ƻY*-:*͙*(b*?DGKOX^z38;?CLRnu      ',/37@FP\dmv !"#"$%&'(')*& -/ 0)21374A5M4U6^7h3t:;<;=>AB)*+MKLm[2Lm2?LmO2Lm23YmC?dYm?1sM4@U"PQ1svw+T***;+ *+*+%***/+3***5+***+VYM,*"W,++ +WYM**>,"W*x|:6,"W,"W,+**+**+**+*鰻Y($F GH)I1K;LFNPOeQoRTUVWXY[\]^_`ab c)d3f5h?iQj[kmlwmnop)H*+ MLMA%PQLQhM/*[(t) *+bMT*D* *[(x yz|) *+eMM*D* *D**D*(*  &02?IK) M*+_M*D**D**D"*$*D'*)*D,*.*D1*3y*D6'P*D6*8R*D6;>L+BI(FoI*HY(JM**DQ*S(b '4AN[hu) *+"VWXYMR*DY*[9*D^*`*Dc*e(" '4ANP) R*+\M*Dh*jm*Dm*oS*Dr*t9*Dw*y*D|*~(2  '4AN[hu) *+VM*D**D**D+**nL+*+**D1*B*B*BL*+*z*D*`*D*F*D*,*D**D**D**x***DĶ:*x *x*Ƨ**Dɶ:*x *x*˧I*<*Dζ*Ч"*DӶ*է*[(/ '4AHOSW_iv} &3@MZgt ) *+SmSM#*Dڶ"*ܧnL*+ZeL*+Z\*D߶*BL*+Z9*D**D*  #9CF(B    # $ ,9FGO\iv)**+$NGLMB*D**D**D**D*m*D * S*D*9*D**D*(J  !'"4#A$N%[&h'u()*+,-.01) *+PM*D"*nL*+ZeL*+Z\*D""*$BL*+Z9L*+Z0*D'"*)L*+Z L*+Z*D,"*.L*+ZL*+Z*D1"*3L*+ZL*+Z*D6"*8L*+ZL*+Z*D;"*=fL*+Z]L*+ZT*D@"*B:L*+Z1L*+Z(*DE*GL*+Z J #L9CFJ9COLeorJeo{LJLNJNJ"N+JAKNPAKWJmwzJ(65 789#:$;,=9?F@GAOBPCXEeGrHsI{J|KMOPQRSUWXYZ[]_`abceg"h#i+j,k4mAoNpOqWrXs`umwzx{y|})*+R$SGRPSsR|SRSTRTR#T,ROUXR{RVWM +XM*,]( )  *+ `abV_|$M+.c>+;d+`>gM,( ")*$*+$b"j ^*k*+nqs( )*+Ow+() *+x[*k*+ys( )*+b{5()*+|}+() *+~?() *+PK VC>VUU1fr/orsay/lri/varna/controlers/ControleurMenu.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.text.ParseException; import java.util.ArrayList; import javax.swing.JCheckBoxMenuItem; import javax.swing.JColorChooser; import javax.swing.JOptionPane; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.exceptions.ExceptionExportFailed; import fr.orsay.lri.varna.exceptions.ExceptionJPEGEncoding; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; import fr.orsay.lri.varna.exceptions.ExceptionWritingForbidden; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.annotations.TextAnnotation; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.views.VueBPThickness; import fr.orsay.lri.varna.views.VueMenu; /** * This listener controls menu items * * @author darty * */ public class ControleurMenu implements InterfaceVARNAListener, ActionListener { private VARNAPanel _vp; @SuppressWarnings("unused") private VueMenu _vm; private String _type; private String _color; private Object _source; /** * Creates the menu listener * * @param _varnaPanel * The VARNAPanel */ public ControleurMenu(VARNAPanel _varnaPanel, VueMenu _vueMenu) { _vp = _varnaPanel; _vm = _vueMenu; _vp.getRNA().addVARNAListener(this); } public void actionPerformed(ActionEvent e) { String[] temp = e.getActionCommand().split(","); _source = e.getSource(); _type = temp[0]; if (temp.length > 1) _color = temp[1]; else _color = ""; // selon l'option choisie dans le menu: if (!optionRedraw()) if (!optionExport()) if (!optionImport()) if (!optionRNADisplay()) if (!optionTitle()) if (!optionColorMap()) if (!optionView()) if (!optionBase()) if (!optionBasePair()) if (!optionLoop()) if (!option3prime()) if (!option5prime()) if (!optionHelix()) if (!optionStem()) if (!optionBulge()) if (!optionAnnotation()) if (!optionBP()) _vp.errorDialog(new Exception("Uknown action command '"+_type+"'")); } private boolean optionBP() { if (_type.equals("editallbps")) { _vp.getVARNAUI().UIEditAllBasePairs(); } else return false; return true; } private boolean optionAnnotation() { if (!_type.contains("annotation")) return false; // a partir du menu principale (gestion des annotations) if (_type.equals("annotationsaddPosition")) { _vp.getVARNAUI().UIAnnotationsAddPosition(_vp.getPopup().getSpawnPoint().x,_vp.getPopup().getSpawnPoint().y); } else if (_type.equals("annotationsaddBase")) { _vp.getVARNAUI().UIAnnotationsAddBase(_vp.getPopup().getSpawnPoint().x,_vp.getPopup().getSpawnPoint().y); } else if (_type.equals("annotationsaddLoop")) { _vp.getVARNAUI().UIAnnotationsAddLoop(_vp.getPopup().getSpawnPoint().x,_vp.getPopup().getSpawnPoint().y); } else if (_type.equals("annotationsaddChemProb")) { _vp.getVARNAUI().UIAnnotationsAddChemProb(_vp.getPopup().getSpawnPoint().x,_vp.getPopup().getSpawnPoint().y); } else if (_type.equals("annotationsaddRegion")) { _vp.getVARNAUI().UIAnnotationsAddRegion(_vp.getPopup().getSpawnPoint().x,_vp.getPopup().getSpawnPoint().y); } else if (_type.equals("annotationsaddHelix")) { _vp.getVARNAUI().UIAnnotationsAddHelix(_vp.getPopup().getSpawnPoint().x,_vp.getPopup().getSpawnPoint().y); } else if (_type.equals("annotationsautohelices")) { _vp.getVARNAUI().UIAutoAnnotateHelices(); } else if (_type.equals("annotationsautointerior")) { _vp.getVARNAUI().UIAutoAnnotateInteriorLoops(); } else if (_type.equals("annotationsautoterminal")) { _vp.getVARNAUI().UIAutoAnnotateTerminalLoops(); } else if (_type.equals("annotationsautohelices")) { _vp.getVARNAUI().UIAutoAnnotateHelices(); } else if (_type.equals("annotationsremove")) { _vp.getVARNAUI().UIAnnotationsRemove(); } else if (_type.equals("annotationsautoextremites")) { _vp.getVARNAUI().UIAutoAnnotateStrandEnds(); } else if (_type.equals("annotationsedit")) { _vp.getVARNAUI().UIAnnotationsEdit(); // a partir du menu selection (annotation la plus proche) } else if (_type.equals("Selectionannotationremove")) { _vp.getVARNAUI().UIAnnotationRemoveFromAnnotation( _vp.get_selectedAnnotation()); } else if (_type.equals("Selectionannotationedit")) { _vp.getVARNAUI().UIAnnotationEditFromAnnotation( _vp.get_selectedAnnotation()); // a partir d'une structure(base, loop, helix) dans l'arn // (annotation li� a la structure) } else if (_type.endsWith("annotationadd")||_type.contains("annotationremove")||_type.contains("annotationedit")) { try { int type = trouverAncrage(); ArrayList listeIndex = new ArrayList(); switch(type) { case(TextAnnotation.BASE): listeIndex.add(_vp.getNearestBase()); case(TextAnnotation.LOOP): if (_type.startsWith("loop1")) listeIndex = _vp.getRNA().findLoopForward(_vp.getNearestBase()); else if (_type.startsWith("loop2")) listeIndex = _vp.getRNA().findLoopBackward(_vp.getNearestBase()); else listeIndex = _vp.getRNA().findLoop(_vp.getNearestBase()); break; case(TextAnnotation.HELIX): listeIndex = _vp.getRNA().findHelix(_vp.getNearestBase()); break; } if (_type.endsWith("annotationadd")) { _vp.getVARNAUI().UIAnnotationAddFromStructure(type,listeIndex); } else if (_type.contains("annotationremove")) { _vp.getVARNAUI().UIAnnotationRemoveFromStructure(trouverAncrage(),listeIndex); } else if (_type.contains("annotationedit")) { _vp.getVARNAUI().UIAnnotationEditFromStructure(trouverAncrage(),listeIndex); } } catch (Exception e2) { e2.printStackTrace(); } } else return false; return true; } private int trouverAncrage() { if (_type.contains("loop")) return TextAnnotation.LOOP; if (_type.contains("helix")) return TextAnnotation.HELIX; if (_type.contains("base")) return TextAnnotation.BASE; errorDialog(new Exception("probleme d'identification de l'ancrage")); return 0; } private boolean option5prime() { return colorBases(); } private boolean option3prime() { return colorBases(); } private boolean optionBulge() { return colorBases(); } private boolean optionStem() { return colorBases(); } private boolean optionHelix() { return colorBases(); } private boolean colorBases() { // System.out.println(_type); ArrayList listBase = new ArrayList(); String phrase = "Choose new " + _type; if (_color.equals("InnerColor")) { phrase += " inner color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_INNER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)) .getStyleBase().set_base_inner_color(c); } _vp.repaint(); } } else if (_color.equals("OutlineColor")) { phrase += " outline color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_OUTLINE_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)) .getStyleBase().set_base_outline_color(c); } _vp.repaint(); } } else if (_color.equals("NameColor")) { phrase += " name color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NAME_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)) .getStyleBase().set_base_name_color(c); } _vp.repaint(); } } else if (_color.equals("NumberColor")) { phrase += " number color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NUMBER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { _vp.getRNA().get_listeBases().get(listBase.get(i)) .getStyleBase().set_base_number_color(c); } _vp.repaint(); } } else if (_color.equals("BPColor")) { phrase += " base-pair color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NUMBER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get( listBase.get(i)); if (mb.getElementStructure() != -1) { mb.getStyleBP().setCustomColor(c); } } _vp.repaint(); } } else if (_color.equals("BPColor")) { phrase += " base-pair color"; Color c = JColorChooser.showDialog(_vp, phrase, VARNAConfig.BASE_NUMBER_COLOR_DEFAULT); if (c != null) { listBase = listSwitchType(_type); for (int i = 0; i < listBase.size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get( listBase.get(i)); if (mb.getElementStructure() != -1) { mb.getStyleBP().setCustomColor(c); } } _vp.repaint(); } } else if (_color.equals("BPThickness")) { listBase = listSwitchType(_type); // System.out.println(listBase.size()); ArrayList styleBPs = new ArrayList(); for (int i = 0; i < listBase.size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get( listBase.get(i)); if (mb.getElementStructure() != -1) { styleBPs.add(mb.getStyleBP()); } } VueBPThickness vbpt = new VueBPThickness(_vp, styleBPs); if (JOptionPane.showConfirmDialog(_vp, vbpt.getPanel(), "Set base pair(s) thickness", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { vbpt.restoreThicknesses(); _vp.repaint(); } } else return false; return true; } private ArrayList listSwitchType(String _type) { if (_type.equals("helix")) return _vp.getRNA().findHelix(_vp.getNearestBase()); if (_type.equals("current")) { return _vp.getSelectionIndices(); } if (_type.equals("allBases")) { return _vp.getRNA().findAll(); } if (_type.equals("loop1")) { return _vp.getRNA().findLoopForward(_vp.getNearestBase()); } if (_type.equals("loop2")) { return _vp.getRNA().findLoopBackward(_vp.getNearestBase()); } if (_type.equals("stem")) return _vp.getRNA().findStem(_vp.getNearestBase()); if (_type.equals("base")) { ArrayList list = new ArrayList(); list.add(_vp.getNearestBase()); return list; } if (_type.equals("basepair") || _type.equals("bpcolor") || _type.equals("bp")) { ArrayList list = new ArrayList(); int i = _vp.getNearestBase(); list.add(i); ModeleBase mb = _vp.getRNA().get_listeBases().get(i); int j = mb.getElementStructure(); if (mb.getElementStructure() != -1) { list.add(i); list.add(j); } return list; } if (_type.equals("5'")) return _vp.getRNA().findNonPairedBaseGroup(_vp.getNearestBase()); if (_type.equals("3'")) return _vp.getRNA().findNonPairedBaseGroup(_vp.getNearestBase()); if (_type.equals("bulge")) return _vp.getRNA().findNonPairedBaseGroup(_vp.getNearestBase()); if (_type.equals("all")) return _vp.getRNA().findAll(); return new ArrayList(); } private boolean optionLoop() { return colorBases(); } private boolean optionBase() { if (_type.equals("baseChar")) { _vp.getVARNAUI().UISetBaseCharacter(); return true; } else { return colorBases(); } } private boolean optionBasePair() { if (_type.equals("basepair")) { _vp.getVARNAUI().UIEditBasePair(); return true; } else if (_type.equals("bpcolor")) { _vp.getVARNAUI().UIColorBasePair(); return true; } else if (_type.equals("thickness")) { _vp.getVARNAUI().UIThicknessBasePair(); return true; } return false; } private boolean optionView() { if (_type.equals("background")) { _vp.getVARNAUI().UISetBackground(); } else if (_type.equals("shownc")) { _vp.getVARNAUI().UIToggleShowNCBP(); } else if (_type.equals("shownp")) { _vp.getVARNAUI().UIToggleShowNonPlanar(); } else if (_type.equals("spaceBetweenBases")) { _vp.getVARNAUI().UISetSpaceBetweenBases(); } else if (_type.equals("bpheightincrement")) { _vp.getVARNAUI().UISetBPHeightIncrement(); } else if (_type.equals("borderSize")) { _vp.getVARNAUI().UISetBorder(); } else if (_type.startsWith("zoom")) { if (_type.equals("zoom")) { _vp.getVARNAUI().UICustomZoom(); } else { String factor = _type.substring("zoom".length()); double pc = Integer.parseInt(factor); pc /= 100.0; _vp.setZoom(new Double(pc)); _vp.repaint(); } } else if (_type.equals("rotation")) { _vp.getVARNAUI().UIGlobalRotation(); } else return false; return true; } private boolean optionTitle() { if (_type.equals("titleDisplay")) { _vp.getVARNAUI().UISetTitleFont(); } else if (_type.equals("setTitle")) { _vp.getVARNAUI().UISetTitle(); } else if (_type.equals("titleColor")) { _vp.getVARNAUI().UISetTitleColor(); } else return false; return true; } private boolean optionColorMap() { if (_type.equals("toggleshowcolormap")) { _vp.getVARNAUI().UIToggleColorMap(); } else if (_type.equals("colormapcaption")) { _vp.getVARNAUI().UISetColorMapCaption(); } else if (_type.equals("colormapstyle")) { _vp.getVARNAUI().UISetColorMapStyle(); } else if (_type.equals("colormaploadvalues")) { _vp.getVARNAUI().UILoadColorMapValues(); } else if (_type.equals("colormapvalues")) { _vp.getVARNAUI().UISetColorMapValues(); } else return false; return true; } private boolean optionRNADisplay() { // les options d'affichages generales if (_type.equals("gaspin")) { _vp.getVARNAUI().UIToggleGaspinMode(); } else if (_type.equals("backbone")) { _vp.getVARNAUI().UISetBackboneColor(); } else if (_type.equals("bonds")) { Color c = JColorChooser.showDialog(_vp, "Choose new bonds color", _vp.getBackground()); if (c != null) { _vp.setDefaultBPColor(c); _vp.repaint(); } } else if (_type.equals("basecolorforBP")) { if (_source != null) { if (_source instanceof JCheckBoxMenuItem) { JCheckBoxMenuItem check = (JCheckBoxMenuItem) _source; _vp.setUseBaseColorsForBPs(check.getState()); _vp.repaint(); } } } else if (_type.equals("bpstyle")) { _vp.getVARNAUI().UISetBPStyle(); } else if (_type.equals("specialbasecolored")) { _vp.getVARNAUI().UIToggleColorSpecialBases(); } else if (_type.equals("showwarnings")) { _vp.getVARNAUI().UIToggleShowWarnings(); } else if (_type.equals("dashbasecolored")) { _vp.getVARNAUI().UIToggleColorGapsBases(); } else if (_type.equals("numPeriod")) { _vp.getVARNAUI().UISetNumPeriod(); } else if (_type.equals("eachKind")) { if (_vp.getRNA().get_listeBases() != null) { _vp.getVARNAUI().UIBaseTypeColor(); } else { _vp.emitWarning("No base"); } } else if (_type.equals("eachCouple")) { if (_vp.getRNA().get_listeBases() != null && _vp.getRNA().get_listeBases().size() != 0) { _vp.getVARNAUI().UIBasePairTypeColor(); } else { _vp.emitWarning("No base"); } } else if (_type.equals("eachBase")) { if (_vp.getRNA().get_listeBases() != null && _vp.getRNA().get_listeBases().size() != 0) { _vp.getVARNAUI().UIBaseAllColor(); } else { _vp.emitWarning("No base"); } } else if (_type.equals("specialBasesColor")) { _vp.getVARNAUI().UIPickSpecialBasesColor(); } else if (_type.equals("dashBasesColor")) { _vp.getVARNAUI().UIPickGapsBasesColor(); } else return colorBases(); return true; } private boolean optionImport() { if (_type.equals("userInput")) { try { _vp.getVARNAUI().UIManualInput(); } catch (ParseException e1) { errorDialog(e1); } catch (ExceptionNonEqualLength e2) { errorDialog(e2); } } else if (_type.equals("file")) { try { _vp.getVARNAUI().UIFile(); } catch (ExceptionNonEqualLength e1) { errorDialog(e1); } } else if (_type.equals("print")) { _vp.getVARNAUI().UIPrint(); } else if (_type.equals("about")) { _vp.getVARNAUI().UIAbout(); } else return false; return true; } private boolean optionRedraw() { if (_type.equals("reset")) { _vp.getVARNAUI().UIReset(); } else if (_type.equals("circular")) { _vp.getVARNAUI().UICircular(); } else if (_type.equals("radiate")) { _vp.getVARNAUI().UIRadiate(); } else if (_type.equals("naview")) { _vp.getVARNAUI().UINAView(); } else if (_type.equals("varnaview")) { _vp.getVARNAUI().UIVARNAView(); } else if (_type.equals("motifview")) { _vp.getVARNAUI().UIMOTIFView(); } else if (_type.equals("line")) { _vp.getVARNAUI().UILine(); } else if (_type.equals("flat")) { _vp.getVARNAUI().UIToggleFlatExteriorLoop(); } else return false; return true; } private boolean optionExport() { if (_type.equals("saveas")) { try { _vp.getVARNAUI().UISaveAs(); } catch (ExceptionExportFailed e1) { errorDialog(e1); } catch (ExceptionPermissionDenied e1) { errorDialog(e1); } } else if (_type.equals("dbn")) { try { _vp.getVARNAUI().UISaveAsDBN(); } catch (ExceptionExportFailed e) { errorDialog(e); } catch (ExceptionPermissionDenied e) { errorDialog(e); } } else if (_type.equals("bpseq")) { try { _vp.getVARNAUI().UISaveAsBPSEQ(); } catch (ExceptionExportFailed e) { errorDialog(e); } catch (ExceptionPermissionDenied e) { errorDialog(e); } } else if (_type.equals("ct")) { try { _vp.getVARNAUI().UISaveAsCT(); } catch (ExceptionExportFailed e) { errorDialog(e); } catch (ExceptionPermissionDenied e) { errorDialog(e); } } else if (_type.equals("eps")) { try { _vp.getVARNAUI().UIExportEPS(); } catch (ExceptionWritingForbidden e1) { errorDialog(e1); } catch (ExceptionExportFailed e) { errorDialog(e); } } else if (_type.equals("xfig")) { try { _vp.getVARNAUI().UIExportXFIG(); } catch (ExceptionWritingForbidden e1) { errorDialog(e1); } catch (ExceptionExportFailed e) { errorDialog(e); } } else if (_type.equals("svg")) { try { _vp.getVARNAUI().UIExportSVG(); } catch (ExceptionWritingForbidden e1) { errorDialog(e1); } catch (ExceptionExportFailed e) { errorDialog(e); } } else if (_type.equals("jpeg")) { try { _vp.getVARNAUI().UIExportJPEG(); } catch (ExceptionJPEGEncoding e1) { errorDialog(e1); } catch (ExceptionExportFailed e1) { errorDialog(e1); } } else if (_type.equals("png")) { try { _vp.getVARNAUI().UIExportPNG(); } catch (ExceptionExportFailed e1) { errorDialog(e1); } } else return false; return true; } /** * Return the extension of a file, it means the string after the last dot of * the file name * * @param f * The file * @return null if the file name have no dot
* ext if the file name contains a dot */ public String getExtension(File f) { String s = f.getName(); return getExtension(s); } /** * Return the extension of a string, it means the string after the last dot * of the path * * @param s * The strnig o the path * @return null if the path have no dot
* ext if the path contains a dot */ public String getExtension(String s) { String ext = null; int i = s.lastIndexOf('.'); if (i > 0 && i < s.length() - 1) { ext = s.substring(i + 1).toLowerCase(); } return ext; } /** * Open an error message dialog with the exception message * * @param e1 * The Exception */ public void errorDialog(Exception e1) { if (_vp.isErrorsOn()) JOptionPane.showMessageDialog(_vp, e1.getMessage(), "VARNA Error", JOptionPane.ERROR_MESSAGE); } public void onLayoutChanged() { // TODO Auto-generated method stub } public void onWarningEmitted(String s) { if (_vp.isErrorsOn()) JOptionPane.showMessageDialog(_vp,s, "VARNA Warning", JOptionPane.ERROR_MESSAGE); } public void onLoad(String path) { // TODO Auto-generated method stub } public void onLoaded() { // TODO Auto-generated method stub } public void onUINewStructure(VARNAConfig v, RNA r) { // TODO Auto-generated method stub } } PK 4F>k2.Gfr/orsay/lri/varna/controlers/ControleurInterpolator$MinimizeRMSD.class1SAfr/orsay/lri/varna/controlers/ControleurInterpolator$MinimizeRMSDjava/lang/ObjectX1[DX2Y1Y2 ([D[D[D[D)VCode  ()V        LineNumberTableLocalVariableTablethisCLfr/orsay/lri/varna/controlers/ControleurInterpolator$MinimizeRMSD;f(D)D ! java/lang/Math "cos $ %sinthetaD cos_theta sin_thetanIsumidsxdsyfprimefsecondcomputeOptimalTheta()D>h 7 1 9 :3random? > 0 @ Aabs@ !TD- E epsilonx_nnumsteps maxnumsteps x_n_plus_1resultd SourceFileControleurInterpolator.java InnerClassesQ4fr/orsay/lri/varna/controlers/ControleurInterpolator MinimizeRMSD    * *+*-*,* 4  t'J'#9*696 R* 1)k* 1kg* 1g9 * 1k* 1)kc* 1g9   kc  kc9  *  9Wgq\ tt&'o(' i)'b*+_,'Y-+ 9..' W/' 0  q'J'#9*696 O* 1* 1k* 1* 1kckc* 1* 1k* 1* 1kg)kc9  2  ?@adnHqq&'l(' f)'_*+\,'V-+ 1  q'J'#9*696 O* 1* 1k* 1* 1kc)kc* 1* 1k* 1* 1kgkc9  2  >?adnHqq&'l(' f)'_*+\,'V-+ 23 k 4HJ6d6*)69  )48;gkc9')*)=*)6og9)g?4 9 d 9 J* BcD* D  Bc9  R   0 ? MQT[_beh| #z F'G' ~H+ zI+-J'?&J'hJ'QK' _K' hK' NL' MNO PR PK 4F>IRhEEBfr/orsay/lri/varna/controlers/ControleurInterpolator$Targets.class1K;this$06Lfr/orsay/lri/varna/controlers/ControleurInterpolator;9(Lfr/orsay/lri/varna/controlers/ControleurInterpolator;)VCode   ()Vjava/util/LinkedList   LineNumberTableLocalVariableTablethis>Lfr/orsay/lri/varna/controlers/ControleurInterpolator$Targets;addG(Lfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder;)V  !addLast(Ljava/lang/Object;)V # $notifydDLfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder;getF()Lfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder; * +wait -/.java/lang/InterruptedException 0printStackTrace 2 34size()I 6 78getFirst()Ljava/lang/Object;:Bfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder < =8 removeFirste Ljava/lang/InterruptedException;xw(Lfr/orsay/lri/varna/controlers/ControleurInterpolator;Lfr/orsay/lri/varna/controlers/ControleurInterpolator$Targets;)V C  SourceFileControleurInterpolator.java InnerClassesH4fr/orsay/lri/varna/controlers/ControleurInterpolatorTargets TargetsHolder    C*+**Y   ! I *+*"   %&!'( .*)L+,*1*59L*;W+ -"! " #&$',( . >?$ @& A &*+BDEFGI9GJPK 4F>XHfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder.class1(Bfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolderjava/lang/Objecttarget#Lfr/orsay/lri/varna/models/rna/RNA;conf'Lfr/orsay/lri/varna/models/VARNAConfig;mapping'Lfr/orsay/lri/varna/models/rna/Mapping;this$06Lfr/orsay/lri/varna/controlers/ControleurInterpolator;(Lfr/orsay/lri/varna/controlers/ControleurInterpolator;Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/Mapping;)VCode   ()V      LineNumberTableLocalVariableTablethisDLfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder;tcm SourceFileControleurInterpolator.java InnerClasses&4fr/orsay/lri/varna/controlers/ControleurInterpolator TargetsHolder    r*+**,*-* * ! "#$ %'PK 4F>.E"++:fr/orsay/lri/varna/controlers/ControleurInterpolator.class1n4fr/orsay/lri/varna/controlers/ControleurInterpolatorjava/lang/Thread_vpnLfr/orsay/lri/varna/VARNAPanel; _numStepsI _timeDelayJ_runningZ_d>Lfr/orsay/lri/varna/controlers/ControleurInterpolator$Targets;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V     ;>;  |([I[I)Ljava/util/Vector; numIndices mappedIndices[IindicesA([I[I)Ljava/util/Vector;>;9Mapping Error: Cannot cluster indices in an empty mapping  (Ljava/lang/String;)Vjava/util/Vector  java/util/Arrays sort([I)V ;(Ljava/lang/Object;)Z java/lang/Integer valueOf(I)Ljava/lang/Integer;resLjava/util/Vector;jktmpLocalVariableTypeTable;Ljava/util/Vector;>;'Ljava/util/Vector;run  getF()Lfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder; 4 01 4 => 4 23  / nextTarget java/lang/System errLjava/io/PrintStream; java/io/PrintStream println(Ljava/lang/Object;)V java/lang/Exception printStackTracedDLfr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder;eLjava/lang/Exception;computeCentroid7(Ljava/util/ArrayList;[I)Ljava/awt/geom/Point2D$Double;c(Ljava/util/ArrayList;[I)Ljava/awt/geom/Point2D$Double; M (I)Ljava/lang/Object;(fr/orsay/lri/varna/models/rna/ModeleBase  getCoords ()Ljava/awt/geom/Point2D$Double;rnaBasesLjava/util/ArrayList;indexes centroidXD centroidYindexcoordsALjava/util/ArrayList;minimizeRotateRMSD ([D[D[D[D)DAfr/orsay/lri/varna/controlers/ControleurInterpolator$MinimizeRMSD  ([D[D[D[D)V ccomputeOptimalThetaX1[DY1X2Y2 minimizerCLfr/orsay/lri/varna/controlers/ControleurInterpolator$MinimizeRMSD;moveNearOtherRNAp(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/Mapping;)V S getSourceElems()[I S getTargetElems  \ x \ y S  getPartner(I)I  @f@ !TD- java/lang/Double (D)Ljava/lang/Double; G globalRotation(Ljava/lang/Double;)Vrna1rna2rna1MappedElemsrna2MappedElems rna1Bases rna2Basesrna1MappedElemsCentroidrna2MappedElemsCentroid base1Indexcoords1coords2theta $ %u(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/Mapping;Z)V_target_conf_mapping * , |} / 0QintValue O 3 Z[ S5 6 getAncestor A8 9?showRNA A; <= setConfig*(Lfr/orsay/lri/varna/models/VARNAConfig;)V G? @AsetCoord"(ILjava/awt/geom/Point2D$Double;)V C DE setCoords!(Ljava/awt/geom/Point2D$Double;)V AG Hrepaint J KLsleep(J)V NOjava/lang/InterruptedException  moveTargetsourcecurrent currBases destBases intArrSource intArrTarget initPosSource[Ljava/awt/geom/Point2D$Double;finalPosTargetfinalPosSource initPosTargetdestmatchedNeighborLeftmatchedNeighborRight firstHalfm*Lfr/orsay/lri/varna/models/rna/ModeleBase;mpcmnc Ljava/lang/InterruptedException;0Lfr/orsay/lri/varna/exceptions/MappingException; SourceFileControleurInterpolator.java InnerClasses MinimizeRMSDTargets TargetsHolderDouble!  u)*****Y*"*+$&)$ %&'#*(+')())*!+,J*+,-& ./' ()0123!+/_*"4Y*+,-69& 34'*()01=>23!+?^*+*$@FL+FLR-&7879'()01XY/*&=' ()Z[ ̻\Y+^^cdo+ffcdoi:\Y,^^cdo,ffcdoi: \Ydlk lkcodmk mkcoi: \Y l-^g m-fgi: \Y-^d lkc-fd mkci:  &RBCD B%E)F7GEEJH]IdJHKLKMNOMP' ()nopoqorstouo%vwJxw Eyw (zw {w |}~  N6 -O*-,&UV WVY'4 ()  r|~,+ YYN+,6Y:6Q+.,.6-WY:+.W-WY:+.W+ ,66+.W+-W-&fp qrqtv w$x'y0z6{A|H}Q~^entz'R()3r''004*"L**+++M,,*  &" !(,1' 4())!   TI96,+.6*Ӷ:(^cIfc9+(+oI+o9\Y(i&*  '1;AI'HTTRO3r o T iY*+,-:& 3 4'4  :,N,:*F:+F:-6-:: -: -: : : 6n-.6Ӷ: gR gR,Ӷ:  gR  gR-    9+ k o&b>? @ABE"J*K3P9Q?RFSMTSUYVhWxXYZ[T_bc'1123 s*w3w 9 ? F M PurYbhS w !w"/U *+,-#& fg'* () &1 '> (3% *$@:: +-)F:+F:Y: Y: *L-+: *L-+: L\: L\: 6 + Ӷ:  \Y^fiS  L6 + Ӷ:  \Y^fiS  L \:  \:61-$ -2: \Y^fiS 60 --.6 --.6x 1d<  1d--.6  1d--.63 d--.6 `--.6 -:6B-.6 * 2 2 2`1` 2 22S1 161-4$ -42:\Y^fiS60 --.6 --.6x 1d<  1d--.6  1d--.63 d--.6 `--.6 -:6B-.6* 2 2 2`1`222S1 166*lA*$+7+:F:6, *$,:6 2> 6: 2: 2:2: 2:\Y*dd^k^kc*do*ddfkfkc*doiBLv*$F*I* :M:P :*$+7*$FN&.r s uw x&y/z8|>}B|G~MQ~VX[`bejp&,1F^jlsy !.;AKVcklw} $06EJOTdiqr $4FVadqx'(7()&1'>(3Q  R1 S1 nT&hU/_V 8VW `.XY j$ZY m5r o5r o[Y \Y9r]o)rF^^s^[__[_OzL->9rV]ozr^^ s^__$[_0Oz3LE-` rtab co WcodoPdoef> nT&hU/_V 8VW Oz0Ozghi"j k4l\_m PK dl=i={G{G9fr/orsay/lri/varna/controlers/ControleurInterpolator.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.geom.Point2D; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; import java.util.Vector; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.exceptions.MappingException; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.Mapping; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.RNA; public class ControleurInterpolator extends Thread { VARNAPanel _vpn; private int _numSteps = 25; private long _timeDelay = 15; private boolean _running = false; Targets _d = new Targets(); public ControleurInterpolator(VARNAPanel vpn) { _vpn = vpn; } public synchronized void addTarget(RNA target, Mapping mapping) { addTarget(target, null, mapping); } public synchronized void addTarget(RNA target, VARNAConfig conf, Mapping mapping) { _d.add(new TargetsHolder(target,conf,mapping)); } public synchronized void addTarget(RNA target) { addTarget(target, null, Mapping.DefaultOutermostMapping(_vpn.getRNA() .get_listeBases().size(), target.get_listeBases().size())); } public boolean isInterpolationInProgress() { return _running; } private Point2D.Double computeDestination(Point2D pli, Point2D pri, Point2D pi, int i, int n, Point2D plf, Point2D prf) { Point2D.Double plm = new Point2D.Double( (pli.getX() + plf.getX()) / 2.0, (pli.getY() + plf.getY()) / 2.0); Point2D.Double prm = new Point2D.Double( (pri.getX() + prf.getX()) / 2.0, (pri.getY() + prf.getY()) / 2.0); Point2D.Double pm = new Point2D.Double(((n - i) * plm.getX() + i * prm.getX()) / n, ((n - i) * plm.getY() + i * prm.getY()) / n); Point2D.Double v = new Point2D.Double(pm.getX() - pi.getX(), pm.getY() - pi.getY()); Point2D.Double pf = new Point2D.Double(pi.getX() + 2.0 * v.getX(), pi .getY() + 2.0 * v.getY()); return pf; } private Vector> clusterIndices(int numIndices, int[] mappedIndices) throws MappingException { int[] indices = new int[numIndices]; for (int i = 0; i < numIndices; i++) { indices[i] = i; } return clusterIndices(indices, mappedIndices); } /** * Builds and returns an interval array, alternating unmatched regions and * matched indices. Namely, returns a vector of vector such that the vectors * found at odd positions contain those indices that are NOT associated with * any other base in the current mapping. On the other hand, vectors found * at even positions contain only one mapped index.
* Ex: If indices=[1,2,3,4,5] and mappedIndices= * [2,5] then the function will return * [[1],[2],[3,4],[5],[]]. * * @param indices * The total list of indices * @param mappedIndices * Matched indices, should be a subset of indices * @return A clustered array * @throws MappingException * If one of the parameters is an empty array */ private Vector> clusterIndices(int[] indices, int[] mappedIndices) throws MappingException { if ((mappedIndices.length == 0) || (indices.length == 0)) { throw new MappingException( "Mapping Error: Cannot cluster indices in an empty mapping"); } Vector> res = new Vector>(); Arrays.sort(indices); Arrays.sort(mappedIndices); int i, j = 0, k; Vector tmp = new Vector(); for (i = 0; (i < indices.length) && (j < mappedIndices.length); i++) { if (indices[i] == mappedIndices[j]) { res.add(tmp); tmp = new Vector(); tmp.add(indices[i]); res.add(tmp); tmp = new Vector(); j++; } else { tmp.add(indices[i]); } } k = i; for (i = k; (i < indices.length); i++) { tmp.add(indices[i]); } res.add(tmp); return res; } public void run() { while (true) { TargetsHolder d = _d.get(); _running = true; try{ nextTarget(d.target,d.conf,d.mapping); } catch(Exception e) { System.err.println(e); e.printStackTrace(); } _running = false; } } /** * Compute the centroid of the RNA bases that have their indexes * in the given array. */ private static Point2D.Double computeCentroid(ArrayList rnaBases, int[] indexes) { double centroidX = 0, centroidY = 0; for (int i=0; i= maxnumsteps) { // If things go bad (for example f''(x) keeps being 0) // we need to give up after what we consider to be too many steps. // In practice this can happen only in pathological cases // like f being constant, which is very unlikely. result = x_n_plus_1; break; } x_n = x_n_plus_1; } // We now have either found the min or the max at x = result. // If we have the max at x we know the min is at x+pi. if (f(result + Math.PI) < f(result)) { result = result + Math.PI; } return result; } } /** * We suppose we have two lists of points. The coordinates of the first * list of points are X1 and Y1, and X2 and Y2 for the second list. * We suppose that the centroids of [X1,Y1] and [X2,Y2] are both (0,0). * This function computes the rotation to apply to the second set of * points such that the RMSD (Root mean square deviation) between them * is minimum. The returned angle is in radians. */ private static double minimizeRotateRMSD(double[] X1, double[] Y1, double[] X2, double[] Y2) { MinimizeRMSD minimizer = new MinimizeRMSD(X1, Y1, X2, Y2); return minimizer.computeOptimalTheta(); } /** * Move rna2 using a rotation so that it would move as little as possible * (in the sense that we minimize the RMSD) when transforming * it to rna1 using the given mapping. */ public static void moveNearOtherRNA(RNA rna1, RNA rna2, Mapping mapping) { int[] rna1MappedElems = mapping.getSourceElems(); int[] rna2MappedElems = mapping.getTargetElems(); ArrayList rna1Bases = rna1.get_listeBases(); ArrayList rna2Bases = rna2.get_listeBases(); int n = rna1MappedElems.length; // If there is less than 2 points, it is useless to rotate the RNA. if (n < 2) return; // We can now assume that n >= 2. // Compute the centroids of both RNAs Point2D.Double rna1MappedElemsCentroid = computeCentroid(rna1Bases, rna1MappedElems); Point2D.Double rna2MappedElemsCentroid = computeCentroid(rna2Bases, rna2MappedElems); // Compute the optimal rotation // We first compute coordinates for both RNAs, changing the origins // to be the centroids. double[] X1 = new double[rna1MappedElems.length]; double[] Y1 = new double[rna1MappedElems.length]; double[] X2 = new double[rna2MappedElems.length]; double[] Y2 = new double[rna2MappedElems.length]; for (int i=0; i currBases = current.get_listeBases(); ArrayList destBases = _target.get_listeBases(); Vector> intArrSource = new Vector>(); Vector> intArrTarget = new Vector>(); // Building interval arrays intArrSource = clusterIndices(currBases.size(), _mapping .getSourceElems()); intArrTarget = clusterIndices(destBases.size(), _mapping .getTargetElems()); // Duplicating source and target coordinates Point2D.Double[] initPosSource = new Point2D.Double[currBases .size()]; Point2D.Double[] finalPosTarget = new Point2D.Double[destBases .size()]; for (int i = 0; i < currBases.size(); i++) { Point2D tmp = currBases.get(i).getCoords(); initPosSource[i] = new Point2D.Double(tmp.getX(), tmp.getY()); } for (int i = 0; i < destBases.size(); i++) { Point2D tmp = destBases.get(i).getCoords(); finalPosTarget[i] = new Point2D.Double(tmp.getX(), tmp.getY()); } /** * Assigning final (Source) and initial (Target) coordinates */ Point2D.Double[] finalPosSource = new Point2D.Double[initPosSource.length]; Point2D.Double[] initPosTarget = new Point2D.Double[finalPosTarget.length]; // Final position of source model for (int i = 0; i < finalPosSource.length; i++) { if (_mapping.getPartner(i) != Mapping.UNKNOWN) { Point2D dest; dest = finalPosTarget[_mapping.getPartner(i)]; finalPosSource[i] = new Point2D.Double(dest.getX(), dest .getY()); } } for (int i = 0; i < intArrSource.size(); i += 2) { int matchedNeighborLeft, matchedNeighborRight; if (i == 0) { matchedNeighborLeft = intArrSource.get(1).get(0); matchedNeighborRight = intArrSource.get(1).get(0); } else if (i == intArrSource.size() - 1) { matchedNeighborLeft = intArrSource.get( intArrSource.size() - 2).get(0); matchedNeighborRight = intArrSource.get( intArrSource.size() - 2).get(0); } else { matchedNeighborLeft = intArrSource.get(i - 1).get(0); matchedNeighborRight = intArrSource.get(i + 1).get(0); } Vector v = intArrSource.get(i); for (int j = 0; j < v.size(); j++) { int index = v.get(j); finalPosSource[index] = computeDestination( initPosSource[matchedNeighborLeft], initPosSource[matchedNeighborRight], initPosSource[index], j + 1, v.size() + 1, finalPosSource[matchedNeighborLeft], finalPosSource[matchedNeighborRight]); } } for (int i = 0; i < initPosTarget.length; i++) { if (_mapping.getAncestor(i) != Mapping.UNKNOWN) { Point2D dest; dest = initPosSource[_mapping.getAncestor(i)]; initPosTarget[i] = new Point2D.Double(dest.getX(), dest .getY()); } } for (int i = 0; i < intArrTarget.size(); i += 2) { int matchedNeighborLeft, matchedNeighborRight; if (i == 0) { matchedNeighborLeft = intArrTarget.get(1).get(0); matchedNeighborRight = intArrTarget.get(1).get(0); } else if (i == intArrTarget.size() - 1) { matchedNeighborLeft = intArrTarget.get( intArrTarget.size() - 2).get(0); matchedNeighborRight = intArrTarget.get( intArrTarget.size() - 2).get(0); } else { matchedNeighborLeft = intArrTarget.get(i - 1).get(0); matchedNeighborRight = intArrTarget.get(i + 1).get(0); } Vector v = intArrTarget.get(i); for (int j = 0; j < v.size(); j++) { int index = v.get(j); initPosTarget[index] = computeDestination( finalPosTarget[matchedNeighborLeft], finalPosTarget[matchedNeighborRight], finalPosTarget[index], j + 1, v.size() + 1, initPosTarget[matchedNeighborLeft], initPosTarget[matchedNeighborRight]); } } boolean firstHalf = true; for (int i = 0; i < _numSteps; i++) { if (i == _numSteps / 2) { _vpn.showRNA(_target); current = _target; currBases = current.get_listeBases(); firstHalf = false; if (_conf!=null) {_vpn.setConfig(_conf);} for (int j = 0; j < initPosSource.length; j++) { source.setCoord(j, initPosSource[j]); } } for (int j = 0; j < currBases.size(); j++) { ModeleBase m = currBases.get(j); Point2D mpc, mnc; if (firstHalf) { mpc = initPosSource[j]; mnc = finalPosSource[j]; } else { mpc = initPosTarget[j]; mnc = finalPosTarget[j]; } m.setCoords(new Point2D.Double(((_numSteps - 1 - i) * mpc.getX() + (i) * mnc.getX()) / (_numSteps - 1), ((_numSteps - 1 - i) * mpc.getY() + i * mnc.getY()) / (_numSteps - 1))); } _vpn.repaint(); sleep(_timeDelay); } } catch (InterruptedException e) { e.printStackTrace(); } catch (MappingException e) { e.printStackTrace(); }catch (Exception e) { e.printStackTrace(); } _vpn.showRNA(_target); _vpn.repaint(); } private class TargetsHolder { public RNA target; public VARNAConfig conf; public Mapping mapping; public TargetsHolder(RNA t, VARNAConfig c, Mapping m) { target = t; conf = c; mapping = m; } } private class Targets { LinkedList _d = new LinkedList(); public synchronized void add(TargetsHolder d) { _d.addLast(d); notify(); } public synchronized TargetsHolder get() { while(_d.size()==0) { try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } TargetsHolder x = _d.getFirst(); _d.removeFirst(); return x; } } } PK 4F>4JJDfr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor.class1>fr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditorjava/lang/Objectjava/awt/event/ActionListener_specialColorEditor6Lfr/orsay/lri/varna/components/BaseSpecialColorEditor; _selectedRowI _selectedCol_selectedColorLjava/awt/Color;_selectedColTitleLjava/lang/String;9(Lfr/orsay/lri/varna/components/BaseSpecialColorEditor;)VCode  ()V  LineNumberTableLocalVariableTablethis@Lfr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor;specialColorEditoractionPerformed(Ljava/awt/event/ActionEvent;)V "!4fr/orsay/lri/varna/components/BaseSpecialColorEditor #$getEDIT()Ljava/lang/String; &('java/awt/event/ActionEvent )$getActionCommand +-,java/lang/String ./equals(Ljava/lang/Object;)Z 1 23 getButton()Ljavax/swing/JButton; 5 67getCurrentColor()Ljava/awt/Color; 9;:javax/swing/JButton <= setBackground(Ljava/awt/Color;)V ? @AgetColorChooser()Ljavax/swing/JColorChooser; CEDjavax/swing/JColorChooser F=setColor H IJ getDialog()Ljavax/swing/JDialog; LNMjavax/swing/JDialog OP setVisible(Z)V R ScallFireEditingStopped CU V7getColor X Y=setCurrentColor [ \] get_vueBases%()Lfr/orsay/lri/varna/views/VueBases; _a`!fr/orsay/lri/varna/views/VueBases bcgetTable()Ljavax/swing/JTable; egfjavax/swing/JTable higetSelectedRow()I k em nigetSelectedColumn p r _t uvgetSpecialTableModel0()Lfr/orsay/lri/varna/components/BaseTableModel; xzy,fr/orsay/lri/varna/components/BaseTableModel {| getColumnName(I)Ljava/lang/String; ~  _  getDataAt'(I)Lfr/orsay/lri/varna/models/BaseList; "fr/orsay/lri/varna/models/BaseList getBases()Ljava/util/ArrayList; java/util/ArrayList iterator()Ljava/util/Iterator; java/util/Iterator next()Ljava/lang/Object;(fr/orsay/lri/varna/models/rna/ModeleBase   applyColorO(Ljava/lang/String;Ljava/awt/Color;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V hasNext()Z _ get_vp!()Lfr/orsay/lri/varna/VARNAPanel; fr/orsay/lri/varna/VARNAPanel repainteLjava/awt/event/ActionEvent;lb$Lfr/orsay/lri/varna/models/BaseList;mb*Lfr/orsay/lri/varna/models/rna/ModeleBase; Inner Color  getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase; -fr/orsay/lri/varna/models/rna/ModeleStyleBase =set_base_inner_color Outline Color =set_base_outline_color Name Color =set_base_name_color Number Color =set_base_number_colortitreColcouleur SourceFile%ControleurBaseSpecialColorEditor.java!   F **+() *  +%*:*0*48*>*4B*GK*Q**>TW**Z^dj**Z^lo**4q**Zs*ow}*Z*jM,:N**}*q-*Zr0 3435%6,5/7::D=H>R=U@VAc@fCgDtCwFHIHJKMKOQ*; N+*-,<+*-,(+*-,+ö* -,ű6 U V WXY!Z([1\5]<^E_I`Mc*NNN NPK pq<ۆ+@@Cfr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import fr.orsay.lri.varna.components.BaseSpecialColorEditor; import fr.orsay.lri.varna.models.BaseList; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.views.VueBases; public class ControleurBaseSpecialColorEditor implements ActionListener { private BaseSpecialColorEditor _specialColorEditor; private int _selectedRow; private int _selectedCol; private Color _selectedColor; private String _selectedColTitle; public ControleurBaseSpecialColorEditor(BaseSpecialColorEditor specialColorEditor) { _specialColorEditor = specialColorEditor; } /** * Handles events from the editor button and from the dialog's OK button. */ public void actionPerformed(ActionEvent e) { if (BaseSpecialColorEditor.getEDIT().equals(e.getActionCommand())) { // The user has clicked the cell, so // bring up the dialog. _specialColorEditor.getButton().setBackground( _specialColorEditor.getCurrentColor()); _specialColorEditor.getColorChooser().setColor( _specialColorEditor.getCurrentColor()); _specialColorEditor.getDialog().setVisible(true); // Make the renderer reappear. _specialColorEditor.callFireEditingStopped(); } else { // User pressed dialog's "OK" button. _specialColorEditor.setCurrentColor(_specialColorEditor .getColorChooser().getColor()); _selectedRow = _specialColorEditor.get_vueBases().getTable() .getSelectedRow(); _selectedCol = _specialColorEditor.get_vueBases().getTable() .getSelectedColumn(); _selectedColor = _specialColorEditor.getCurrentColor(); _selectedColTitle = _specialColorEditor.get_vueBases() .getSpecialTableModel().getColumnName(_selectedCol); BaseList lb = _specialColorEditor.get_vueBases().getDataAt(_selectedRow); for(ModeleBase mb: lb.getBases()) { applyColor(_selectedColTitle, _selectedColor,mb); } _specialColorEditor.get_vueBases().get_vp().repaint(); } } private void applyColor(String titreCol, Color couleur, ModeleBase mb) { if (titreCol.equals("Inner Color")) { mb.getStyleBase() .set_base_inner_color(couleur); } else if (titreCol.equals("Outline Color")) { mb.getStyleBase() .set_base_outline_color(couleur); } else if (titreCol.equals("Name Color")) { mb.getStyleBase() .set_base_name_color(couleur); } else if (titreCol.equals("Number Color")) { mb.getStyleBase() .set_base_number_color(couleur); } } } PK 4F>S} @fr/orsay/lri/varna/controlers/ControleurSelectionHighlight.class1d:fr/orsay/lri/varna/controlers/ControleurSelectionHighlightjava/lang/Object javax/swing/event/ChangeListener _selectionLjava/util/Collection; SignatureCLjava/util/Collection<+Lfr/orsay/lri/varna/models/rna/ModeleBase;>;_targetLfr/orsay/lri/varna/VARNAPanel;_parentLjavax/swing/JMenuItem;:(ILfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)VCode  ()Vjava/util/ArrayList  java/lang/Integer valueOf(I)Ljava/lang/Integer;  !add(Ljava/lang/Object;)Z #%$fr/orsay/lri/varna/VARNAPanel &'getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; )+*!fr/orsay/lri/varna/models/rna/RNA ,- getBasesAt-(Ljava/util/Collection;)Ljava/util/ArrayList; /  1 3 LineNumberTableLocalVariableTablethis;K(Ljava/util/Vector;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V`(Ljava/util/Vector;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V C D(Ljava/util/Collection;)V F GN(Ljava/util/ArrayList;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)VLjava/util/Vector;'Ljava/util/Vector;c(Ljava/util/ArrayList;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V L MO(Ljava/util/Collection;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V|(Ljava/util/Collection<+Lfr/orsay/lri/varna/models/rna/ModeleBase;>;Lfr/orsay/lri/varna/VARNAPanel;Ljavax/swing/JMenuItem;)V stateChanged"(Ljavax/swing/event/ChangeEvent;)V RTSjavax/swing/JMenuItem UV isSelected()Z #X Y saveSelection #[ \D setSelection #^ _restoreSelectioneLjavax/swing/event/ChangeEvent; SourceFile!ControleurSelectionHighlight.java!    /*Y:W*,"(.*,0*-24%& '($))*.+54/67/89/: /; "<=>  "<?@ Am*Y+B,-E4 /05*67<H: ;> <IG Jm*,"+(,-K4 455*67<=: ;> <?M N~**+.*,0*-2479 :;<5*67<: ;> < OPk'*2Q*0W*0*.Z *0]4? @AC&F5'67'`abcPK pq _selection; private VARNAPanel _target; private JMenuItem _parent; public ControleurSelectionHighlight(int elem, VARNAPanel v, JMenuItem parent) { ArrayList sel = new ArrayList(); sel.add(elem); _selection = v.getRNA().getBasesAt(sel); _target = v; _parent = parent; } public ControleurSelectionHighlight(Vector sel, VARNAPanel v, JMenuItem parent) { this(new ArrayList(sel), v, parent); } public ControleurSelectionHighlight(ArrayList sel, VARNAPanel v, JMenuItem parent) { this(v.getRNA().getBasesAt(sel),v,parent); } public ControleurSelectionHighlight(Collection sel, VARNAPanel v, JMenuItem parent) { _selection = sel; _target = v; _parent = parent; } public void stateChanged(ChangeEvent e) { if (_parent.isSelected()) { _target.saveSelection(); _target.setSelection(_selection); } else { _target.restoreSelection(); } } } PK 4F>ಃ[[;fr/orsay/lri/varna/controlers/ControleurVueAnnotation.class1U5fr/orsay/lri/varna/controlers/ControleurVueAnnotationjava/lang/Objectjavax/swing/event/CaretListener javax/swing/event/ChangeListener java/awt/event/ActionListener _vueAnnot(Lfr/orsay/lri/varna/views/VueAnnotation;+(Lfr/orsay/lri/varna/views/VueAnnotation;)VCode  ()V  LineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/controlers/ControleurVueAnnotation;vueAnnot caretUpdate!(Ljavax/swing/event/CaretEvent;)V &fr/orsay/lri/varna/views/VueAnnotation updatearg0Ljavax/swing/event/CaretEvent; stateChanged"(Ljavax/swing/event/ChangeEvent;)VLjavax/swing/event/ChangeEvent;actionPerformed(Ljava/awt/event/ActionEvent;)V )+*java/awt/event/ActionEvent ,-getActionCommand()Ljava/lang/String;/setcolor 132java/lang/String 45equals(Ljava/lang/Object;)Z 7 89get_vp!()Lfr/orsay/lri/varna/VARNAPanel;; Pick a color = >?getTextAnnotation8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation; ACB4fr/orsay/lri/varna/models/annotations/TextAnnotation DEgetColor()Ljava/awt/Color; GIHjavax/swing/JColorChooser JK showDialogH(Ljava/awt/Component;Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; M NO updateColor(Ljava/awt/Color;)VLjava/awt/event/ActionEvent;cLjava/awt/Color; SourceFileControleurVueAnnotation.java!   F **+01 2   @* 56!"#$@* 9:!%&'7+(.0&*6:*<@FM, *,L*"= >?>#@'A/D6E 77!P# QRSTPK pq<:fr/orsay/lri/varna/controlers/ControleurVueAnnotation.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JColorChooser; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.views.VueAnnotation; /** * Annotation View Controller * * @author Darty@lri.fr * */ public class ControleurVueAnnotation implements CaretListener, ChangeListener, ActionListener { private VueAnnotation _vueAnnot; /** * Creates a ControleurVueAnnotation * * @param vueAnnot */ public ControleurVueAnnotation(VueAnnotation vueAnnot) { _vueAnnot = vueAnnot; } public void caretUpdate(CaretEvent arg0) { _vueAnnot.update(); } public void stateChanged(ChangeEvent arg0) { _vueAnnot.update(); } public void actionPerformed(ActionEvent arg0) { if (arg0.getActionCommand().equals("setcolor")) { Color c = JColorChooser.showDialog(_vueAnnot.get_vp(), "Pick a color", _vueAnnot.getTextAnnotation().getColor()); if (c != null) { _vueAnnot.updateColor(c); } } _vueAnnot.update(); } } PK 4F>u~2fr/orsay/lri/varna/controlers/ControleurZoom.class15,fr/orsay/lri/varna/controlers/ControleurZoomjava/lang/Object javax/swing/event/ChangeListener_vz"Lfr/orsay/lri/varna/views/VueZoom;%(Lfr/orsay/lri/varna/views/VueZoom;)VCode  ()V  LineNumberTableLocalVariableTablethis.Lfr/orsay/lri/varna/controlers/ControleurZoom;vz stateChanged"(Ljavax/swing/event/ChangeEvent;)V  fr/orsay/lri/varna/views/VueZoom get_vp!()Lfr/orsay/lri/varna/VARNAPanel;  !getZoom()D #%$java/lang/Double &'valueOf(D)Ljava/lang/Double; )+*fr/orsay/lri/varna/VARNAPanel ,-setZoom(Ljava/lang/Object;)V )/ 0repainteLjavax/swing/event/ChangeEvent; SourceFileControleurZoom.java!  F * *+    [**"(*.#$%1234PK pqgICfr/orsay/lri/varna/controlers/ControleurScriptParser$Argument.class1!=fr/orsay/lri/varna/controlers/ControleurScriptParser$Argumentjava/lang/Object_tCLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;F(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;)VCode   ()V  LineNumberTableLocalVariableTablethis?Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Argument;tgetTypeE()Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;toString()Ljava/lang/String; SourceFileControleurScriptParser.java InnerClasses4fr/orsay/lri/varna/controlers/ControleurScriptParserArgumentAfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType ArgumentType  F * *+  " #   /* '   @PK 4F>vzGfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType.class1:Afr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentTypejava/lang/Enum STRING_TYPECLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType; NUMBER_TYPE ARRAY_TYPE COLOR_TYPE ENUM$VALUESD[Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;()VCode  (Ljava/lang/String;I)V          LineNumberTableLocalVariableTable thisvaluesF()[Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType; (*)java/lang/System +, arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfW(Ljava/lang/String;)Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType; 0 -15(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileControleurScriptParser.java SignatureULjava/lang/Enum; InnerClasses84fr/orsay/lri/varna/controlers/ControleurScriptParser ArgumentType@0@@@@   TYYYYYSYSYSYS!u vw'x4t"1*+#!t" $ %&6YK*Y<YM',!" -.* */!"23456 79@PK 4F>522Hfr/orsay/lri/varna/controlers/ControleurScriptParser$ArrayArgument.class19Bfr/orsay/lri/varna/controlers/ControleurScriptParser$ArrayArgument=fr/orsay/lri/varna/controlers/ControleurScriptParser$Argument_valLjava/util/Vector; SignatureSLjava/util/Vector;(Ljava/util/Vector;)VV(Ljava/util/Vector;)VCode Afr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType  ARRAY_TYPECLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;  F(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;)V  LineNumberTableLocalVariableTablethisDLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArrayArgument;valLocalVariableTypeTablegetSize()I !#"java/util/Vector $size getArgumentB(I)Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Argument; !( )*get(I)Ljava/lang/Object;iItoString()Ljava/lang/String; !0 -. SourceFileControleurScriptParser.java InnerClasses54fr/orsay/lri/varna/controlers/ControleurScriptParserArgument ArgumentType ArrayArgument   [ * *+bc d     2* g %& @ *'k  +,-. 2*/o 12346 47@48 PK 4F>A25aaHfr/orsay/lri/varna/controlers/ControleurScriptParser$ColorArgument.class1*Bfr/orsay/lri/varna/controlers/ControleurScriptParser$ColorArgument=fr/orsay/lri/varna/controlers/ControleurScriptParser$Argument_valLjava/awt/Color;(Ljava/awt/Color;)VCode  Afr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType  COLOR_TYPECLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;  F(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;)V  LineNumberTableLocalVariableTablethisDLfr/orsay/lri/varna/controlers/ControleurScriptParser$ColorArgument;valgetColor()Ljava/awt/Color;toString()Ljava/lang/String; ! java/awt/Color  SourceFileControleurScriptParser.java InnerClasses&4fr/orsay/lri/varna/controlers/ControleurScriptParserArgument ArgumentType ColorArgument  I * *+DE F   /*I  2*M "#$%' %(@%) PK 4F>LqqBfr/orsay/lri/varna/controlers/ControleurScriptParser$Command.class1&;T(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;Ljava/util/Vector;)V(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;Ljava/util/Vector;)VCode  ()V    LineNumberTableLocalVariableTablethis>Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Command;fargvLocalVariableTypeTable SourceFileControleurScriptParser.java InnerClasses!4fr/orsay/lri/varna/controlers/ControleurScriptParserCommand$=fr/orsay/lri/varna/controlers/ControleurScriptParser$FunctionFunction      k**+*,     " # %@PK 4F>csPPCfr/orsay/lri/varna/controlers/ControleurScriptParser$Function.class1f=fr/orsay/lri/varna/controlers/ControleurScriptParser$Functionjava/lang/Enum ERASE_SEQ?Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;SET_COLOR_MAP_MINSET_COLOR_MAP_MAX SET_COLOR_MAPSET_CUSTOM_COLOR_MAPSET_SEQ SET_STRUCTSET_STRUCT_SMOOTH SET_TITLESET_RNASET_RNA_SMOOTH SET_VALUESTOGGLE_SHOW_COLOR_MAPREDRAWUNKNOWN ENUM$VALUES@[Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;()VCode  (Ljava/lang/String;I)V   #  &  )  ,  /  2  5  8  ;  >  A  D  G  J  L LineNumberTableLocalVariableTable thisvaluesB()[Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function; TVUjava/lang/System WX arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfS(Ljava/lang/String;)Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function; \ Y]5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileControleurScriptParser.java SignatureQLjava/lang/Enum; InnerClassesd4fr/orsay/lri/varna/controlers/ControleurScriptParserFunction@0@@@@ @ @ @ @ @@@@@@@8YY!"Y$%Y'(Y*+Y-.Y01Y34Y67Y9 :Y< =Y? @YB CYE FYHIYSY"SY%SY(SY+SY.SY1SY4SY7SY :SY =SY @SY CSY FSYISKMB} ~'4AN\jx|N1*+OM|N P QR6KYK*Y<YMS,MN YZ* *[MN^_`ab ce@PK 4F>a2nnIfr/orsay/lri/varna/controlers/ControleurScriptParser$NumberArgument.class1*Cfr/orsay/lri/varna/controlers/ControleurScriptParser$NumberArgument=fr/orsay/lri/varna/controlers/ControleurScriptParser$Argument_valLjava/lang/Number;(Ljava/lang/Number;)VCode  Afr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType  NUMBER_TYPECLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;  F(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;)V  LineNumberTableLocalVariableTablethisELfr/orsay/lri/varna/controlers/ControleurScriptParser$NumberArgument;val getNumber()Ljava/lang/Number;toString()Ljava/lang/String; ! java/lang/Object  SourceFileControleurScriptParser.java InnerClasses&4fr/orsay/lri/varna/controlers/ControleurScriptParserArgument ArgumentTypeNumberArgument  I * *+34 5   /*8  2*< "#$%' %(@%) PK 4F>O]fIfr/orsay/lri/varna/controlers/ControleurScriptParser$StringArgument.class1(Cfr/orsay/lri/varna/controlers/ControleurScriptParser$StringArgument=fr/orsay/lri/varna/controlers/ControleurScriptParser$Argument_valLjava/lang/String;(Ljava/lang/String;)VCode  Afr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType  STRING_TYPECLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;  F(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;)V  LineNumberTableLocalVariableTablethisELfr/orsay/lri/varna/controlers/ControleurScriptParser$StringArgument;valtoString()Ljava/lang/String; java/lang/String  SourceFileControleurScriptParser.java InnerClasses$4fr/orsay/lri/varna/controlers/ControleurScriptParserArgument ArgumentTypeStringArgument  I * *+UV W   2*Z  !"#% #&@#' PK 4F>+\3\3:fr/orsay/lri/varna/controlers/ControleurScriptParser.class14fr/orsay/lri/varna/controlers/ControleurScriptParserjava/lang/ObjectSCRIPT_ERROR_PREFIXLjava/lang/String; _name2FunLjava/util/Hashtable; SignaturehLjava/util/Hashtable; _fun2ProtLjava/util/Hashtable;K$SWITCH_TABLE$fr$orsay$lri$varna$controlers$ControleurScriptParser$Function[I()VCodeError  java/util/Hashtable      LineNumberTableLocalVariableTable this6Lfr/orsay/lri/varna/controlers/ControleurScriptParser; initFunctions & '(size()I*eraseseq ,.-=fr/orsay/lri/varna/controlers/ControleurScriptParser$Function /0 ERASE_SEQ?Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;2Afr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType 4 56put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;8settitle ,: ;0 SET_TITLE 1= >? STRING_TYPECLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType;Aredraw ,C D0REDRAWF setstruct ,H I0 SET_STRUCTKsetseq ,M N0SET_SEQPsetrna ,R S0SET_RNAUsetstructsmooth ,W X0SET_STRUCT_SMOOTHZ setrnasmooth ,\ ]0SET_RNA_SMOOTH_ setvalues ,a b0 SET_VALUES 1d e? ARRAY_TYPEg setcolormap ,i j0 SET_COLOR_MAPlsetcolormapminvalue ,n o0SET_COLOR_MAP_MIN 1q r? NUMBER_TYPEtsetcolormapmaxvalue ,v w0SET_COLOR_MAP_MAXysetcustomcolormap ,{ |0SET_CUSTOM_COLOR_MAP~toggleshowcolormap , 0TOGGLE_SHOW_COLOR_MAPfuntxtfunprotoD[Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType; getFunctionS(Ljava/lang/String;)Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function; java/lang/String trim()Ljava/lang/String;  toLowerCase   containsKey(Ljava/lang/Object;)Z  get&(Ljava/lang/Object;)Ljava/lang/Object; , 0UNKNOWNfs getPrototype(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;)[Lfr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType; executeScript4(Lfr/orsay/lri/varna/VARNAPanel;Ljava/lang/String;)V Exceptionsjava/lang/Exception   parseScript&(Ljava/lang/String;)Ljava/util/Vector; java/util/Vector (I)Ljava/lang/Object;java/lang/StringBuilder @ !A&(Ljava/lang/Object;)Ljava/lang/String; =C E : Method ' =G HIappend-(Ljava/lang/String;)Ljava/lang/StringBuilder; =K HL-(Ljava/lang/Object;)Ljava/lang/StringBuilder;N' unimplemented. = C &vpLfr/orsay/lri/varna/VARNAPanel;cmdtxtcmdsiIcmd>Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Command;cm.Lfr/orsay/lri/varna/models/rna/ModeleColorMap;argDLfr/orsay/lri/varna/controlers/ControleurScriptParser$ArrayArgument;ja?Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Argument;aarga1a2seqstrvals[Ljava/lang/Double;nargELfr/orsay/lri/varna/controlers/ControleurScriptParser$NumberArgument;modemodeStrLocalVariableTypeTableRLjava/util/Vector; parseColor$(Ljava/lang/String;)Ljava/awt/Color; qsrjava/awt/Color todecoderesultLjava/awt/Color;parseArguments.(Ljava/io/StreamTokenizer;Z)Ljava/util/Vector;o(Ljava/io/StreamTokenizer;Z)Ljava/util/Vector;  |~}java/io/StreamTokenizer ( nextToken | Wttype | nvalD  (Ljava/lang/Number;)V  add | sval  noCfr/orsay/lri/varna/controlers/ControleurScriptParser$StringArgument C  (Ljava/awt/Color;)V  wx  (Ljava/util/Vector;)V : Opening  parenthesisbracket matched with a closing : Unmatched opening stLjava/io/StreamTokenizer;parTypeZcSLjava/util/Vector; parseCommandR(Ljava/lang/String;)Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Command;(  indexOf(Ljava/lang/String;)I: Syntax error   substring(II)Ljava/lang/String;  : Unknown function ""java/io/StringReader  (I)Ljava/lang/String; C | (Ljava/io/Reader;)V | <eolIsSignificant |  parseNumbers |  quoteChar(I)V |  ordinaryChar |  wordChars(II)V   checkArgsT(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;Ljava/util/Vector;)Z  T(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;Ljava/util/Vector;)Vcutargv(Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function;Ljava/util/Vector;)Z  ): Wrong number of argument for function "". : Bad type (!=) for argument # = H(I)Ljava/lang/StringBuilder; in function "argtypesf(Ljava/lang/String;)Ljava/util/Vector;  $;  split'(Ljava/lang/String;)[Ljava/lang/String;  data[Ljava/lang/String;   ,  valuesB()[Lfr/orsay/lri/varna/controlers/ControleurScriptParser$Function; java/lang/NoSuchFieldError SourceFileControleurScriptParser.java InnerClassesArgument ArgumentType ArrayArgument ColorArgumentCommandFunctionNumberArgumentStringArgument!        FYY /*! "# $%)K+L1M*+3W+,3W7K9L1Y6,:.HOhjE/ l**öŶɶϧ*öŶɶӧ*ֶظ۶Y::6h:cQ:  A :  :  p&  öŶ **ֶض* :ֶ:*ֶ:*ֶ:ֶ:*h* :ֶ:**?ֶ:ֶ:**::61:p:  ŶɸS*#*6ֶض:') 63,) 6".) 60)6O**2B**59/Y=Y?BDFJMFOP*,QȱBP hlo  "#%& (!+9F0L2O5b7e:n;<>ABDGHIKNOPQSV WX$Y([+^9_C`IbRc]edft`ijlopqrstuvwxyz| 6:E FRSFTAU>VW&XYZ[{\]r^WY_`Ga] 6b`  .c` ndedded e d e9P\]CFfgF9^WR"_`dhi ejWQkl AUm noU L*pLM+      uv wx yɻYzM*{W* jTk"(),h[],Y*W2*N-,Y*W,Y-W,Y*W,Y*W,Y*W,Y=Y?BF FF FOP,Y=Y?BF FF FOP1Y=Y?BF FOP*)T*]G,r h{~268| *u$vl u *<!Y=Y?BFOP*M,N-+Y=Y?BF,FFOP|YY*`÷Ʒ:"=,[]()##:-WY-:Z +27>f} HXW270}cuYl   !*M,+Q+Y=Y?BF*JFOP>k,2+ִWY=Y?BF,2JF+ִJF`F*JFOP,"6;L *08qVWl   1YzL*M>+,2W,+ &/ *1X &UVWl  &Um {YW K*+OW*BOW*hOW*uOW*mOW*zOW*Q OW*[ OW*LOW*GOW*VOW*9 OW*` OW* OW*OW*Y '* +47 8AD ENQ R[^ _il mwz {          B 1@   ,@  PK Ch}=Zu47479fr/orsay/lri/varna/controlers/ControleurScriptParser.javapackage fr.orsay.lri.varna.controlers; import java.awt.Color; import java.io.StreamTokenizer; import java.io.StringReader; import java.util.Hashtable; import java.util.Vector; import javax.swing.JOptionPane; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.models.rna.ModeleColorMap; import fr.orsay.lri.varna.models.rna.RNA; public class ControleurScriptParser { private static String SCRIPT_ERROR_PREFIX = "Error"; private static class Command{ Function _f; Vector _argv; public Command(Function f, Vector argv) { _f = f; _argv = argv; } }; private static abstract class Argument{ ArgumentType _t; public Argument(ArgumentType t) { _t = t; } public ArgumentType getType() { return _t; } public abstract String toString(); }; private static class NumberArgument extends Argument{ Number _val; public NumberArgument(Number val) { super(ArgumentType.NUMBER_TYPE); _val = val; } public Number getNumber() { return _val; } public String toString() { return _val.toString(); } }; private static class ColorArgument extends Argument{ Color _val; public ColorArgument(Color val) { super(ArgumentType.COLOR_TYPE); _val = val; } public Color getColor() { return _val; } public String toString() { return _val.toString(); } }; private static class StringArgument extends Argument{ String _val; public StringArgument(String val) { super(ArgumentType.STRING_TYPE); _val = val; } public String toString() { return _val.toString(); } }; private static class ArrayArgument extends Argument{ Vector _val; public ArrayArgument(Vector val) { super(ArgumentType.ARRAY_TYPE); _val = val; } public int getSize() { return _val.size(); } public Argument getArgument(int i) { return _val.get(i); } public String toString() { return _val.toString(); } }; private enum ArgumentType{ STRING_TYPE, NUMBER_TYPE, ARRAY_TYPE, COLOR_TYPE }; private enum Function{ ERASE_SEQ, SET_COLOR_MAP_MIN, SET_COLOR_MAP_MAX, SET_COLOR_MAP, SET_CUSTOM_COLOR_MAP, SET_SEQ, SET_STRUCT, SET_STRUCT_SMOOTH, SET_TITLE, SET_RNA, SET_RNA_SMOOTH, SET_VALUES, TOGGLE_SHOW_COLOR_MAP, REDRAW, UNKNOWN, }; private static Hashtable _name2Fun = new Hashtable(); private static Hashtable _fun2Prot = new Hashtable(); private static void initFunctions() { if (_name2Fun.size()>0) { return; } { String funtxt = "eraseseq"; Function fun = Function.ERASE_SEQ; ArgumentType[] proto = {}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "settitle"; Function fun = Function.SET_TITLE; ArgumentType[] proto = {ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "redraw"; Function fun = Function.REDRAW; ArgumentType[] proto = {ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setstruct"; Function fun = Function.SET_STRUCT; ArgumentType[] proto = {ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setseq"; Function fun = Function.SET_SEQ; ArgumentType[] proto = {ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setrna"; Function fun = Function.SET_RNA; ArgumentType[] proto = {ArgumentType.STRING_TYPE,ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setstructsmooth"; Function fun = Function.SET_STRUCT_SMOOTH; ArgumentType[] proto = {ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setrnasmooth"; Function fun = Function.SET_RNA_SMOOTH; ArgumentType[] proto = {ArgumentType.STRING_TYPE,ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setvalues"; Function fun = Function.SET_VALUES; ArgumentType[] proto = {ArgumentType.ARRAY_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setcolormap"; Function fun = Function.SET_COLOR_MAP; ArgumentType[] proto = {ArgumentType.STRING_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setcolormapminvalue"; Function fun = Function.SET_COLOR_MAP_MIN; ArgumentType[] proto = {ArgumentType.NUMBER_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setcolormapmaxvalue"; Function fun = Function.SET_COLOR_MAP_MAX; ArgumentType[] proto = {ArgumentType.NUMBER_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "setcustomcolormap"; Function fun = Function.SET_CUSTOM_COLOR_MAP; ArgumentType[] proto = {ArgumentType.ARRAY_TYPE}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } { String funtxt = "toggleshowcolormap"; Function fun = Function.TOGGLE_SHOW_COLOR_MAP; ArgumentType[] proto = {}; _name2Fun.put(funtxt,fun);_fun2Prot.put(fun,proto); } } private static Function getFunction(String f) { String s = f.trim().toLowerCase(); if (_name2Fun.containsKey(s)) return _name2Fun.get(s); return Function.UNKNOWN; } private static ArgumentType[] getPrototype(Function f) { if (_fun2Prot.containsKey(f)) return _fun2Prot.get(f); return new ArgumentType[0]; } public static void executeScript(VARNAPanel vp, String cmdtxt) throws Exception { Vector cmds = parseScript(cmdtxt); for(int i=0;i parseArguments(StreamTokenizer st, boolean parType) throws Exception { Vector result = new Vector(); while((st.ttype!=')' && parType) || (st.ttype!=']' && !parType)) { st.nextToken(); //System.out.println(""+ (parType?"Par.":"Bra.")+" "+(char)st.ttype); switch(st.ttype) { case(StreamTokenizer.TT_NUMBER): { result.add(new NumberArgument(st.nval)); } break; case(StreamTokenizer.TT_WORD): { Color c = parseColor(st.sval); if (c==null) result.add(new StringArgument(st.sval)); else result.add(new ColorArgument(c)); } break; case('"'): { result.add(new StringArgument(st.sval)); } break; case('['): { result.add(new ArrayArgument(parseArguments(st, false))); } break; case('('): { result.add(new ArrayArgument(parseArguments(st, true))); } break; case(')'): { if (parType) return result; else throw new Exception(SCRIPT_ERROR_PREFIX+": Opening "+(parType?"parenthesis":"bracket")+" matched with a closing "+(!parType?"parenthesis":"bracket")); } case(']'): { if (!parType) return result; else throw new Exception(SCRIPT_ERROR_PREFIX+": Opening "+(parType?"parenthesis":"bracket")+" matched with a closing "+(!parType?"parenthesis":"bracket")); } case(','): break; case(StreamTokenizer.TT_EOF): { throw new Exception(SCRIPT_ERROR_PREFIX+": Unmatched opening "+(parType?"parenthesis":"bracket")); } } } return result; } private static Command parseCommand(String cmd) throws Exception { int cut = cmd.indexOf("("); if (cut==-1) { throw new Exception(SCRIPT_ERROR_PREFIX+": Syntax error"); } String fun = cmd.substring(0,cut); Function f = getFunction(fun); if (f==Function.UNKNOWN) { throw new Exception(SCRIPT_ERROR_PREFIX+": Unknown function \""+fun+"\""); } StreamTokenizer st = new StreamTokenizer(new StringReader(cmd.substring(cut+1))); st.eolIsSignificant(false); st.parseNumbers(); st.quoteChar('\"'); st.ordinaryChar('='); st.ordinaryChar(','); st.ordinaryChar('['); st.ordinaryChar(']'); st.ordinaryChar('('); st.ordinaryChar(')'); st.wordChars('#', '#'); Vector argv = parseArguments(st,true); checkArgs(f,argv); Command result = new Command(f,argv); return result; } private static boolean checkArgs(Function f, Vector argv) throws Exception { ArgumentType[] argtypes = getPrototype(f); if (argtypes.length!=argv.size()) throw new Exception(SCRIPT_ERROR_PREFIX+": Wrong number of argument for function \""+f+"\"."); for (int i=0;i parseScript(String cmd) throws Exception { initFunctions(); Vector cmds = new Vector(); String[] data = cmd.split(";"); for (int i=0;ipʣ7fr/orsay/lri/varna/controlers/ControleurNumPeriod.class1/1fr/orsay/lri/varna/controlers/ControleurNumPeriodjava/lang/Object javax/swing/event/ChangeListener_vnp'Lfr/orsay/lri/varna/views/VueNumPeriod;*(Lfr/orsay/lri/varna/views/VueNumPeriod;)VCode  ()V  LineNumberTableLocalVariableTablethis3Lfr/orsay/lri/varna/controlers/ControleurNumPeriod;vnp stateChanged"(Ljavax/swing/event/ChangeEvent;)V %fr/orsay/lri/varna/views/VueNumPeriod get_vp!()Lfr/orsay/lri/varna/VARNAPanel;  ! getNumPeriod()I #%$fr/orsay/lri/varna/VARNAPanel &' setNumPeriod(I)V #) *repainteLjavax/swing/event/ChangeEvent; SourceFileControleurNumPeriod.java!  F * *+    X**"*(#$%+,-.PK pq<9u6fr/orsay/lri/varna/controlers/ControleurNumPeriod.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.controlers; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.views.VueNumPeriod; public class ControleurNumPeriod implements ChangeListener { private VueNumPeriod _vnp; public ControleurNumPeriod(VueNumPeriod vnp) { _vnp = vnp; } public void stateChanged(ChangeEvent e) { _vnp.get_vp().setNumPeriod(_vnp.getNumPeriod()); _vnp.get_vp().repaint(); } } PK 4F>fr/orsay/lri/varna/exceptions/PK 4F>h9fr/orsay/lri/varna/exceptions/ExceptionExportFailed.class123fr/orsay/lri/varna/exceptions/ExceptionExportFailedjava/lang/ExceptionserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;_path'(Ljava/lang/String;Ljava/lang/String;)VCode  ()V   LineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/exceptions/ExceptionExportFailed; errorMessagepathgetError()Ljava/lang/String; getMessage!java/lang/StringBuilder#Export failed, File % &(Ljava/lang/String;)V ( )*append-(Ljava/lang/String;)Ljava/lang/StringBuilder;,$ cannot be created or overwritten ! . /toString SourceFileExceptionExportFailed.java!   Y**+*,#$ %&   /*) K Y"$*'+'--.- 01PK mq//=fr/orsay/lri/varna/exceptions/ExceptionPermissionDenied.class1 7fr/orsay/lri/varna/exceptions/ExceptionPermissionDeniedjava/lang/ExceptionserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;(Ljava/lang/String;)VCode  ()V  LineNumberTableLocalVariableTablethis9Lfr/orsay/lri/varna/exceptions/ExceptionPermissionDenied; errorMessagegetError()Ljava/lang/String; getMessagebPermission denied for security reason ! Consider using the VARNA panel class in a signed context.  SourceFileExceptionPermissionDenied.java!  F **+"# $   /*' -+ PK mq<+SS<fr/orsay/lri/varna/exceptions/ExceptionPermissionDenied.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.exceptions; /** * Exception for permission denied problems due to security * * @author darty * */ public class ExceptionPermissionDenied extends Exception { /** * */ private static final long serialVersionUID = 1L; private String _errorMessage; public ExceptionPermissionDenied(String errorMessage) { _errorMessage = errorMessage; } public String getError() { return _errorMessage; } public String getMessage() { return "Permission denied for security reason !\n" + "Consider using the VARNA panel class in a signed context.\n"; } } PK 4F>N2j<fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm.class16fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm7fr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithmserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;(Ljava/lang/String;)VCode  ()V  LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm; errorMessagegetError()Ljava/lang/String; getMessage SourceFileExceptionNAViewAlgorithm.java!  F **+    /*! /*% PK mq<;fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.exceptions; public class ExceptionNAViewAlgorithm extends ExceptionDrawingAlgorithm { /** * */ private static final long serialVersionUID = 1L; private String _errorMessage; public ExceptionNAViewAlgorithm(String errorMessage) { _errorMessage = errorMessage; } public String getError() { return _errorMessage; } public String getMessage() { return _errorMessage; } } PK 4F>B**7fr/orsay/lri/varna/exceptions/ExceptionXmlLoading.class11fr/orsay/lri/varna/exceptions/ExceptionXmlLoadingjava/lang/ExceptionserialVersionUIDJ ConstantValue ((Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethis3Lfr/orsay/lri/varna/exceptions/ExceptionXmlLoading;messageLjava/lang/String;()V   SourceFileExceptionXmlLoading.java!  >*+      3*  PK Pqᔿ?fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax.class139fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntaxjava/lang/ExceptionserialVersionUIDJ ConstantValue_pathLjava/lang/String; _errorMessage'(Ljava/lang/String;Ljava/lang/String;)VCode  ()V   LineNumberTableLocalVariableTablethis;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax; errorMessagepath(Ljava/lang/String;)VgetError()Ljava/lang/String; getMessage"java/lang/StringBuilder$)Unknown format or syntax error in file ' !&  !( )*append-(Ljava/lang/String;)Ljava/lang/StringBuilder;, '. Loading cancelled ! !. /toStringsetPath SourceFile ExceptionFileFormatOrSyntax.java!   Y**,*+"# $%    F **+'( )   /*,  K!Y#%*'+'-010 0>*+ 56 12PK mq<>fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.exceptions; /** * Exception for any problem with the format or the syntax of a file loaded * * @author darty * */ public class ExceptionFileFormatOrSyntax extends Exception { /** * */ private static final long serialVersionUID = 1L; private String _path; private String _errorMessage; public ExceptionFileFormatOrSyntax(String errorMessage, String path) { _path = path; _errorMessage = errorMessage; } public ExceptionFileFormatOrSyntax(String path) { _path = path; } public String getError() { return _errorMessage; } public String getMessage() { return "Unknown format or syntax error in file ' " + _path + " '. \nLoading cancelled !"; } public void setPath(String path) { _path = path; } } PK 4F>#":fr/orsay/lri/varna/exceptions/ExceptionLoadingFailed.class124fr/orsay/lri/varna/exceptions/ExceptionLoadingFailedjava/lang/ExceptionserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;_path'(Ljava/lang/String;Ljava/lang/String;)VCode  ()V   LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/exceptions/ExceptionLoadingFailed; errorMessagepathgetError()Ljava/lang/String; getMessage!java/lang/StringBuilder#Loading failed! File ' % &(Ljava/lang/String;)V ( )*append-(Ljava/lang/String;)Ljava/lang/StringBuilder;,' cannot be read ! . /toString SourceFileExceptionLoadingFailed.java!   Y**+*,#$ %&   /*) C Y"$*'+'-- 01PK mqB33:fr/orsay/lri/varna/exceptions/ExceptionXMLGeneration.class14fr/orsay/lri/varna/exceptions/ExceptionXMLGenerationjava/lang/ExceptionserialVersionUIDJ ConstantValue{%K [(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/exceptions/ExceptionXMLGeneration;messageLjava/lang/String;()V   SourceFileExceptionXMLGeneration.java!  >*+      3*  PK mq<>Sww9fr/orsay/lri/varna/exceptions/ExceptionXMLGeneration.javapackage fr.orsay.lri.varna.exceptions; /** * Thrown by XML-generating algorithms when they fail. * * @author Raphael Champeimont */ public class ExceptionXMLGeneration extends Exception { private static final long serialVersionUID = 8867910395701431387L; public ExceptionXMLGeneration(String message) { super(message); } public ExceptionXMLGeneration() { } } PK 4F>11::Hfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses.class10Bfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParenthesesjava/text/ParseExceptionserialVersionUIDJ ConstantValue(Ljava/lang/String;I)VCode  LineNumberTableLocalVariableTablethisDLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;sLjava/lang/String; errorOffsetI(I)V getMessage()Ljava/lang/String;java/lang/StringBuilderUnbalanced parentheses expression, cannot resolve secondary structure. Bad secondary structure (DBN format):Unmatched closing parentheses ')' at ! "(Ljava/lang/String;)V $ %&getErrorOffset()I ( )*append(I)Ljava/lang/StringBuilder; , -toString SourceFile)ExceptionUnmatchedClosingParentheses.java!  I*+  $%   @*  () FY *#'+, ., ./PK mq h?=fr/orsay/lri/varna/exceptions/ExceptionWritingForbidden.class1 7fr/orsay/lri/varna/exceptions/ExceptionWritingForbiddenjava/lang/ExceptionserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;(Ljava/lang/String;)VCode  ()V  LineNumberTableLocalVariableTablethis9Lfr/orsay/lri/varna/exceptions/ExceptionWritingForbidden; errorMessagegetError()Ljava/lang/String; getMessage6Writing is not allowed within current security policy. SourceFileExceptionWritingForbidden.java!  F **+"# $   /*' -+ PK mq蛪 Gfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError.class1Afr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxErrorjava/lang/ExceptionserialVersionUIDJ ConstantValue_detailsLjava/lang/String;(Ljava/lang/String;)VCode  ()V  LineNumberTableLocalVariableTablethisCLfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError;details getMessage()Ljava/lang/String; SourceFile(ExceptionModeleStyleBaseSyntaxError.java!  F **+!" #   /*& PK mqy<<=fr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithm.class17fr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithmjava/lang/ExceptionserialVersionUIDJ ConstantValue1(хs(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethis9Lfr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithm;messageLjava/lang/String;()V   SourceFileExceptionDrawingAlgorithm.java!  >*+     3*  PK mq"EBB?fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate.class19fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplatejava/lang/ExceptionserialVersionUIDJ ConstantValue5n̠(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethis;Lfr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate;messageLjava/lang/String;()V   SourceFile ExceptionInvalidRNATemplate.java!  >*+     3*  PK mq< MQ>fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate.javapackage fr.orsay.lri.varna.exceptions; /** * This exception is thrown when we discover that a template is invalid * (it contains impossible connections between elements). * * @author Raphael Champeimont */ public class ExceptionInvalidRNATemplate extends Exception { private static final long serialVersionUID = 3866618355319087333L; public ExceptionInvalidRNATemplate(String message) { super(message); } public ExceptionInvalidRNATemplate() { } } PK 4F>Xf;fr/orsay/lri/varna/exceptions/ExceptionParameterError.class1%5fr/orsay/lri/varna/exceptions/ExceptionParameterErrorjava/lang/ExceptionserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;_details'(Ljava/lang/String;Ljava/lang/String;)VCode  ()V   LineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/exceptions/ExceptionParameterError; errorMessagedetails(Ljava/lang/String;)VgetError()Ljava/lang/String; getMessage SourceFileExceptionParameterError.java!   Y**+*,#$ %&    P***+() *+  !/*. "!/*2 #$PK mq*cŦIfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected.class1Cfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplateserialVersionUIDJ ConstantValue75I騚2(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethisELfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected;messageLjava/lang/String;()V"Edge endpoint is already connected SourceFile*ExceptionEdgeEndpointAlreadyConnected.java!  >*+    5*   PK mq<9+  Hfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected.javapackage fr.orsay.lri.varna.exceptions; /** * Thrown by an EdgeEndPoint when it is already connected and you try * to connect it. * * @author Raphael Champeimont */ public class ExceptionEdgeEndpointAlreadyConnected extends ExceptionInvalidRNATemplate { private static final long serialVersionUID = 3978166870034913842L; public ExceptionEdgeEndpointAlreadyConnected(String message) { super(message); } public ExceptionEdgeEndpointAlreadyConnected() { super("Edge endpoint is already connected"); } } PK 4F>RkE9fr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding.class1 3fr/orsay/lri/varna/exceptions/ExceptionJPEGEncodingjava/lang/ExceptionserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;(Ljava/lang/String;)VCode  ()V  LineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding; errorMessagegetError()Ljava/lang/String; getMessageJPEG encoding failed! SourceFileExceptionJPEGEncoding.java!  F **+ !   /*$ -( PK mq:JJ4fr/orsay/lri/varna/exceptions/MappingException.class1/.fr/orsay/lri/varna/exceptions/MappingExceptionjava/lang/ExceptionserialVersionUIDJ ConstantValue$MULTIPLE_PARTNERS_DEFINITION_ATTEMPTIBAD_ALIGNMENT_INPUTCUSTOM_MESSAGE _errorMessageLjava/lang/String;_type(Ljava/lang/String;)VCode  ()V     LineNumberTableLocalVariableTablethis0Lfr/orsay/lri/varna/exceptions/MappingException; errorMessage(I)Vtype getMessage()Ljava/lang/String;(BMapping error: Attempt to define multiple partners for a base-pair*"Mapping error: Bad input alignment,Mapping error: Type is unknown. SourceFileMappingException.java!     O**+* ! !"#F **#$ % ! $ %&h.*'"')*+( *#,&/+1 . !-.PK mq<)qѬ3fr/orsay/lri/varna/exceptions/MappingException.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.exceptions; public class MappingException extends Exception { private static final long serialVersionUID = 1L; public static final int MULTIPLE_PARTNERS_DEFINITION_ATTEMPT = 1; public static final int BAD_ALIGNMENT_INPUT = 2; public static final int CUSTOM_MESSAGE = 3; private String _errorMessage; private int _type; public MappingException(String errorMessage) { _errorMessage = errorMessage; _type = CUSTOM_MESSAGE; } public MappingException(int type) { _type = type; } public String getMessage() { switch (_type) { case MULTIPLE_PARTNERS_DEFINITION_ATTEMPT: return "Mapping error: Attempt to define multiple partners for a base-pair"; case BAD_ALIGNMENT_INPUT: return "Mapping error: Bad input alignment"; case CUSTOM_MESSAGE: return _errorMessage; default: return "Mapping error: Type is unknown."; } } } PK 4F>c  ;fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength.class1 5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthjava/lang/ExceptionserialVersionUIDJ ConstantValue _errorMessageLjava/lang/String;(Ljava/lang/String;)VCode  ()V  LineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength; errorMessagegetError()Ljava/lang/String; getMessageFBoth RNA have not the same length, cannot resolve secondary structure. SourceFileExceptionNonEqualLength.java!  F **+"# $   /*' -+ PK mq<ǘ:fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.exceptions; /** * Exception for different rna lenghts * * @author darty * */ public class ExceptionNonEqualLength extends Exception { /** * */ private static final long serialVersionUID = 1L; private String _errorMessage; public ExceptionNonEqualLength(String errorMessage) { _errorMessage = errorMessage; } public String getError() { return _errorMessage; } public String getMessage() { return "Both RNA have not the same length, cannot resolve secondary structure."; } } PK 4F>fr/orsay/lri/varna/interfaces/PK 4F>=<fr/orsay/lri/varna/interfaces/InterfaceVARNAObservable.class16fr/orsay/lri/varna/interfaces/InterfaceVARNAObservablejava/lang/Object()VCode  LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/interfaces/InterfaceVARNAObservable;addVARNAListener9(Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;)V SourceFileInterfaceVARNAObservable.java!/*   PK mq<~;fr/orsay/lri/varna/interfaces/InterfaceVARNAObservable.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.interfaces; /** * Observable design pattern * * @author darty * */ public abstract class InterfaceVARNAObservable { public abstract void addVARNAListener(InterfaceVARNAListener rl); }PK 4F>|YY:fr/orsay/lri/varna/interfaces/InterfaceVARNAListener.class1 4fr/orsay/lri/varna/interfaces/InterfaceVARNAListenerjava/lang/ObjectonWarningEmitted(Ljava/lang/String;)VonLayoutChanged()VonUINewStructureM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)V SourceFileInterfaceVARNAListener.java   PK TVC>G*9fr/orsay/lri/varna/interfaces/InterfaceVARNAListener.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.interfaces; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.RNA; /** * Observable design pattern * * @author darty * */ public abstract interface InterfaceVARNAListener { public abstract void onWarningEmitted(String s); public abstract void onLayoutChanged(); public void onUINewStructure(VARNAConfig v, RNA r); } PK 4F>=u-<fr/orsay/lri/varna/interfaces/InterfaceParameterLoader.class1 6fr/orsay/lri/varna/interfaces/InterfaceParameterLoaderjava/lang/ObjectgetParameterValue8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; SourceFileInterfaceParameterLoader.javaPK mq<(*;fr/orsay/lri/varna/interfaces/InterfaceParameterLoader.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.interfaces; public interface InterfaceParameterLoader { public String getParameterValue(String key, String def); } PK 4F>fr/orsay/lri/varna/models/PK >o_>1fr/orsay/lri/varna/models/VARNAConfigLoader.class1+fr/orsay/lri/varna/models/VARNAConfigLoaderjava/lang/ObjectMAXSTYLEI ConstantValue2 numColumnsOptLjava/lang/String; numRowsOptalgoOptannotationsOptapplyBasesStyleOpt auxBPsOptautoHelicesOptautoInteriorLoopsOptautoTerminalLoopsOptbackboneColorOptbackgroundColorOptbaseInnerColorOptbaseNameColorOptbaseNumbersColorOptbaseOutlineColorOpt basesStyleOpt borderOpt bondColorOptbpIncrementOpt bpStyleOpt colorMapOptcolorMapCaptionOptcolorMapDefOpt chemProbOptcustomBasesOpt customBPsOpt drawNCOptdrawTertiaryOptdrawColorMapOptdrawBackboneOpterrorOptflatExteriorLoopOpthighlightRegionOptnonStandardColorOptorientationOpt modifiableOpt periodNumOpt rotationOpt sequenceOpt structureOpttitleOpt titleColorOpt titleSizeOptURLOptzoomOpt zoomAmountOpt warningOptcomparisonModeOptgapsBaseColorOptfirstSequenceForComparisonOptsecondSequenceForComparisonOptfirstStructureForComparisonOptsecondStructureForComparisonOpt_algo _annotations _chemProbs _rotationD_sseq_sstruct_numRows _numColumns_title _titleSize _titleColorLjava/awt/Color;_auxBPs_highlightRegion _autoHelicesZ_autoInteriorLoops_autoTerminalLoops _drawBackbone_backboneColor _bondColor_bpStyle0Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;_baseOutlineColor_baseInnerColor _baseNumColor_baseNameColor _gapsColor_nonStandardColor_flatExteriorLoop _customBases _customBPs_colorMapStyle_colorMapCaption_colorMapValues_drawNC _drawTertiary _drawColorMap _periodResNum_borderLjava/awt/Dimension;_backgroundColor _orientation_warning_error _modifiable_zoom _zoomAmount_basesStyleListLjava/util/ArrayList; SignatureFLjava/util/ArrayList;_comparisonMode_firstSequence_secondSequence_firstStructure_secondStructure _mainSurfaceLfr/orsay/lri/varna/VARNAPanel;_useNonStandardColor _useGapsColor _bpIncrement_useInnerBaseColor_useBaseNameColor_useBaseNumbersColor_useBaseOutlineColor_URL_VARNAPanelList6Ljava/util/ArrayList;_optionProducer8Lfr/orsay/lri/varna/interfaces/InterfaceParameterLoader;LEONTIS_WESTHOF_BP_STYLElwSIMPLE_BP_STYLEsimpleRNAVIZ_BP_STYLErnaviz NONE_BP_STYLEnone _defaultRNA#Lfr/orsay/lri/varna/models/rna/RNA;ALGORITHM_CIRCULARcircularALGORITHM_NAVIEWnaviewALGORITHM_LINElineALGORITHM_RADIATEradiateALGORITHM_VARNA_VIEW varnaviewALGORITHM_MOTIF_VIEW motifview()VCoderows  columns   algorithm   annotations  applyBasesStyle   auxBPs    autoHelices   autoInteriorLoops   autoTerminalLoops   backbone    background    baseInner   baseName   baseNum    baseOutline    basesStyle   border   bp    bpIncrement   bpStyle   colorMap   colorMapCaption    colorMapStyle  chemProb  !   customBases  "  customBPs  # drawNC  $  drawTertiary  %  drawColorMap  &  drawBackbone ! ' #error % ( 'flat ) ) +highlightRegion - * / nsBasesColor 1 + 3 orientation 5 , 7 modifiable 9 - ; periodNum = . ?rotation A / C sequenceDBN E 0 G structureDBN I 1 Ktitle M 2 O titleColor Q 3 S titleSize U 4 Wurl Y 5 [zoom ] 6 _ zoomAmount a 7 cwarning e 8 gcomparisonMode i 9 k gapsColor m : o firstSequence q ; ssecondSequence u < wfirstStructure y = {secondStructure } > LineNumberTableLocalVariableTable;(Lfr/orsay/lri/varna/interfaces/InterfaceParameterLoader;)V  java/util/ArrayList   q!fr/orsay/lri/varna/models/rna/RNA    this-Lfr/orsay/lri/varna/models/VARNAConfigLoader;ilcreateVARNAPanels()Ljava/util/ArrayList; Exceptions5fr/orsay/lri/varna/exceptions/ExceptionParameterErrorAfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthjava/io/IOException9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax4fr/orsay/lri/varna/exceptions/ExceptionLoadingFailed8()Ljava/util/ArrayList;  retrieveParametersValues getNbRows()I  F getNbColumns  G initValues  ?   L  NO  PO  QO  @ %fr/orsay/lri/varna/models/VARNAConfig KDEFAULT_BACKGROUND_COLOR  iK  ^  _  A  `  b  a  eO  cO  dOjava/awt/Dimension  (II)V  gh  D  E  f  BC  H  DEFAULT_TITLE_FONTLjava/awt/Font;  java/awt/Font getSize  I  KDEFAULT_BACKBONE_COLOR  SK  RO  KDEFAULT_BOND_COLOR  TK  VDEFAULT_BP_STYLE  UV  M  KBASE_OUTLINE_COLOR_DEFAULT  WK   KBASE_INNER_COLOR_DEFAULT  XK  KBASE_NUMBER_COLOR_DEFAULT  YK  KBASE_NAME_COLOR_DEFAULT  ZK  KDEFAULT_TITLE_COLOR  JK  kO  lO " mO $ nC?333333 ( oC * tO , u . w 0 v 2 x 4 5KDEFAULT_DASH_BASE_COLOR 7 [K 9 |O ; <KDEFAULT_SPECIAL_BASE_COLOR > \K @ {O B ~O D O F O H O? L }C N P ]O R j  getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; VXWjava/awt/Color YZdecode$(Ljava/lang/String;)Ljava/awt/Color; V\ ]TgetColor_java/lang/NumberFormatExceptionajava/lang/Exceptioncoldefresulte!Ljava/lang/NumberFormatException;e2Ljava/lang/Exception;getSafeBPStylet(Ljava/lang/String;Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;)Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; lnmjava/lang/String op toLowerCase()Ljava/lang/String; lr stequals(Ljava/lang/Object;)Z vxw.fr/orsay/lri/varna/models/VARNAConfig$BP_STYLE yV BP_STYLE_LW v{ |VBP_STYLE_SIMPLE v~ VBP_STYLE_RNAVIZ v V BP_STYLE_NONEoptgetParameterInfo()[[Ljava/lang/String;[Ljava/lang/String;String>Drawing algorithm, choosen from [naview,line,radiate,circular]stringA set of textual annotationsColorBackbone color (Ex: #334455)boolean3True if the backbone must be drawn, false otherwiseBackground color (Ex: #334455)0Default value for inner base color (Ex: #334455)!Residues font color (Ex: #334455)%Base numbers font color (Ex: #334455) Base outline color (Ex: #334455)Base pair color (Ex: #334455)/Border width and height in pixels (Ex: "20x40")Raw RNA sequence1RNA structure given in dot bracket notation (DBN)intPeriodicity of base-numberingRNA drawing titleTitle color (Ex: #334455)Title font sizeZoom coefficient"Zoom increment on user interaction Show warnings Show errors=Define and use custom color for gaps bases in comparison modeEDefine and use custom color for non-standard bases in comparison modeBase style declarationBase style applicationKLook and feel for base pairs drawings, choosen from [lw,none,simple,rnaviz]Allows/prohibits modificationsActivates comparison mode)In comparison mode, sequence of first RNA*In comparison mode, structure of first RNA*In comparison mode, sequence of second RNA+In comparison mode, structure of second RNAAdds a list of (possibly non-canonical) base-pairs to those already defined by the main secondary structure (Ex: "(1,10);(2,11);(3,12)"). Custom BP styles can be specified (Ex: "(2,11):thickness=4;(3,12):color=#FF0000").floatWRotates RNA after initial drawing (Ex: '20' for a 20 degree counter-clockwise rotation)Sets the general orientation of an RNA, i.e. the deviation of the longest axis (defined by the most distant couple of bases) from the horizontal axis.2Toggles on/off display of non-canonical base-pairs>Toggles on/off display of tertiary interaction, ie pseudoknotsEToggles on/off (true/false) drawing exterior bases on a straight lineAssociates a list of numerical values (eg '0.2,0.4,0.6,0.8') with the RNA bases with respect to their natural order, and modifies the color used to fill these bases according to current color map style.Sets current color map caption.Selects a specific color map style. It can be either one of the predefined styles (eg 'red', 'green', 'blue', 'bw', 'heat', 'energy') or a new one (eg '0:#FFFF00;1:#ffFFFF;6:#FF0000').GDistance between nested base-pairs (i.e. arcs) in linear representationinfo[[Ljava/lang/String;  pqjava/lang/StringBuilder   append(I)Ljava/lang/StringBuilder;  ptoString 6fr/orsay/lri/varna/interfaces/InterfaceParameterLoader getParameterValue8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; java/lang/Integer parseInt(Ljava/lang/String;)I ^ p getMessage'   (Ljava/lang/String;)V   -(Ljava/lang/String;)Ljava/lang/StringBuilder;1' is not a integer value for the number of rows !  '(Ljava/lang/String;Ljava/lang/String;)V4' is not a integer value for the number of columns ! l valueOf&(Ljava/lang/Object;)Ljava/lang/String;-fr/orsay/lri/varna/models/rna/ModeleStyleBase    assignParameters   tadd "  $ ST V ')(java/lang/Double *(D)Ljava/lang/String; ', -. parseDouble(Ljava/lang/String;)D0*' is not a valid float value for rotation!2A' is not a valid integer value for the period of residue numbers!47' is not a valid integer value for the number of rows ! 6 7(D)Ljava/lang/StringBuilder;9-' is not a valid integer value for the zoom !;4' is not a valid integer value for the zoom amount ! = >(Z)Ljava/lang/StringBuilder; @BAjava/lang/Boolean CD parseBoolean(Ljava/lang/String;)ZFfalseHtrueJ0X0 L MNparseDimension((Ljava/lang/String;)Ljava/awt/Dimension; P ij R S  applyValuestmpimsb/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;xnjsetRNA&(Lfr/orsay/lri/varna/models/rna/RNA;)Vr_fr/orsay/lri/varna/VARNAPanel ^a b^(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V d yz ^f g((Ljava/lang/String;Ljava/lang/String;I)V ^ ^j kl getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; n opdrawRNA+(ILfr/orsay/lri/varna/models/VARNAConfig;)V rts7fr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithm uprintStackTrace ^w o\y java/net/URL x x| }~openConnection()Ljava/net/URLConnection; java/net/URLConnection  setUseCaches(Z)V  getInputStream()Ljava/io/InputStream;java/io/InputStreamReader  (Ljava/io/InputStream;)V ^  VARNA_SESSION_EXTENSION l DendsWith ^  importSessionO(Ljava/io/InputStream;Ljava/lang/String;)Lfr/orsay/lri/varna/models/FullBackup; $fr/orsay/lri/varna/models/FullBackup config'Lfr/orsay/lri/varna/models/VARNAConfig; ^  setConfig*(Lfr/orsay/lri/varna/models/VARNAConfig;)V  rna ^ \showRNA  guessFileTypeFromExtension   loadSecStr(Ljava/io/Reader;I)V ^ o'(Lfr/orsay/lri/varna/models/rna/RNA;I)V x pgetPath   setPathX. ^ setBaseInnerColor(Ljava/awt/Color;)V ^ setBaseOutlineColor ^ setBaseNameColor ^ setBaseNumbersColor ^  setBackground ^  setNumPeriod(I)V ^ setBackboneColor ^ setDefaultBPColor ^ setBPHeightIncrement(D)V ^  setBPStyle3(Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;)V ^ setDrawBackbone ^ setTitleFontColor ^  setTitle ^ setTitleFontSize(F)V ^  getPopupMenu$()Lfr/orsay/lri/varna/views/VueMenu;  fr/orsay/lri/varna/views/VueMenu get_itemShowWarnings!()Ljavax/swing/JCheckBoxMenuItem; javax/swing/JCheckBoxMenuItem setState ^  setErrorsOn ^ setFlatExteriorLoop ' (D)Ljava/lang/Double; ^ setZoom(Ljava/lang/Object;)V ^  setZoomIncrement ^    setBorderSize(Ljava/awt/Dimension;)V ^ setGapsBasesColor ^ setColorGapsBases ^ setNonStandardBasesColor ^ setColorNonStandardBases ^ setShowNonPlanarBP ^ setShowNonCanonicalBP !  # $%applyBasesCustomStyles"(Lfr/orsay/lri/varna/VARNAPanel;)V ' (%applyHighlightRegion * +% applyAuxBPs - .%applyChemProbs 0 1%applyBPsCustomStyles ^3 o 5 6%applyAnnotations ^8 9: getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; <>=fr/orsay/lri/varna/views/VueUI ?UIAutoAnnotateHelices <A BUIAutoAnnotateTerminalLoops <D EUIAutoAnnotateInteriorLoops@v ^I JKgetOrientation()D@!TD- ^O PQglobalRotation(Ljava/lang/Double;)V ^S T setModifiable ^V W setColorMapCaption Y Z%applyColorMapStyle \ ]%applyColorMapValuesalgoCode9Lfr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithm;Ljava/net/URL; connexionLjava/net/URLConnection;Ljava/io/InputStream;inrLjava/io/InputStreamReader;f&Lfr/orsay/lri/varna/models/FullBackup;;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;d k lmget(I)Ljava/lang/Object;oonq, ls tusplit'(Ljava/lang/String;)[Ljava/lang/String; lw xptrimz- ^| }~getRNA%()Lfr/orsay/lri/varna/models/rna/RNA;  getIndexFromBaseNumber(I)I  (I)Ljava/lang/Integer;Bad Base Index:  intValue  get_listeBases  size(fr/orsay/lri/varna/models/rna/ModeleBase   setStyleBase2(Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)VnumStyle indicesList basesListkcandargsindex baseNumFrom indexFrom baseNumToindexTolLocalVariableTypeTable*Ljava/util/ArrayList; l length ,fr/orsay/lri/varna/models/rna/ModeleColorMap  parseColorMapB(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleColorMap; ^  setColorMap1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)Vvp[;,]  toArray(([Ljava/lang/Object;)[Ljava/lang/Object; ^ setColorMapValues([Ljava/lang/Double;)Vvaluesvals[Ljava/lang/Double;)Ljava/util/ArrayList;;:   getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;  clone java/lang/System errLjava/io/PrintStream;ApplyBasesCustomStyle: ` java/io/PrintStream  println baseStyles thisStyledatastyle ?fr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation parseHighlightRegionAnnotationt(Ljava/lang/String;Lfr/orsay/lri/varna/VARNAPanel;)Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation; ^ addHighlightRegionD(Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)VapplyHighlightRegion: regionsregionntALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation; l indexOf l  substring(II)Ljava/lang/String; l (I)Ljava/lang/String;  width  heightswh( l D startsWith)     getBPStyle1(II)Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;  +fr/orsay/lri/varna/models/rna/ModeleStyleBPApplyBPsCustomStyle: indicesdata2s1s2abmsbp-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;8fr/orsay/lri/varna/models/annotations/ChemProbAnnotation  i(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;Ljava/lang/String;)V   !addChemProbAnnotation=(Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;)V# ChempProbs:  chemProbsthisAnncmblcpa:Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;ALjava/util/ArrayList;  , -W(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V / 01addBPToStructureUsingNumbers2(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V3 AuxApplyBPs: 5764fr/orsay/lri/varna/models/annotations/TextAnnotation 8 DEFAULTFONT 5: ;K DEFAULTCOLOR==?type lA Bp toUpperCaseDHFLHPJBXMyOanchor R ST deriveFont(F)Ljava/awt/Font;VcolorXjava/awt/geom/Point2D$Double WZ [(DD)V ^] ^_panelToLogicPoint>(Ljava/awt/geom/Point2D$Double;)Ljava/awt/geom/Point2D$Double; Wa XC Wc MC 5e f(Ljava/lang/String;DD)V 5h i?(Ljava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V k lm findHelix(I)Ljava/util/ArrayList; o pqiterator()Ljava/util/Iterator; sutjava/util/Iterator vwnext()Ljava/lang/Object; sy z{hasNext()Z 5} ~+(Ljava/lang/String;Ljava/util/ArrayList;I)V  mfindLoop 5 setColor 5 setFont(Ljava/awt/Font;)V ^  addAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)VApply Annotations: textfontann6Lfr/orsay/lri/varna/models/annotations/TextAnnotation;data3namevaluepLjava/awt/geom/Point2D$Double;mb*Lfr/orsay/lri/varna/models/rna/ModeleBase; SourceFileVARNAConfigLoader.java InnerClassesBP_STYLEjava/awt/geom/Point2DDouble!~                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A BCD E FGH IJKL M NOPOQOROSKTKUVWKXKYKZK[K\K]O^ _ ` a b cOdOeOfghiKj kOlOmOnCoCpqrstOu v w x yz{O|O}C~OOOO qr          )³Ƴʳγҳֳڳ޳   "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~6OP RSTUV#W(X-Z2[7\<]A^F_K`PaUbZc_ddfignhtjzklnopqsuwy{} "(Jd **Y*Y*+~  r7 **~   /*~ /*~ ga*****************Y׵*** **********  ******!*#*%'*)*+*-*/*1*36*8*:=*?*A*C*E*G*IK*M*O*Q~8    # * 18?FMTY^cpw~ !#$&')+,-.012345789 :;=!>&?-@2B7C<DAEFGMITJYK`L a ST*UMN*+[M:+,^ `~QS UVX[Hb cKdKdKdK efghijB+kqu+kqz+kq}+kq,~& e fgh i,j0k<l@n BB BcV F*YlYSYSYSSYlYSYSYSSYlYSYSYSSYlY SYSYSSYlYSYSYSSYlYSYSYSSYlYSYSYSSYlYSYSYSSYlYSYSYSSY lYSYSYSSY lYSYSYSSY lYDSYSYSSY lYHSYSYSSY lYDPXr (.:BHT\bnv $,2>CsD D;  9***Y**Y*CLY+Y*Y*   **Y*CLY+Y*Y*  L=K*YL+YN-+*-W *W2*!6 6 `*h`=YN**N*8*?*Yܸ- L+q*C*+*#*Y- L+q*E*+*#*Y- L+q*G*+*#*Yظ- L+q*A*+* # *Y0- L+q*+*=#=*?*Yl- *6%L+q*+*6#6*8**Y@- *&+V:YY*Y<- Y* / **Y- *K&+K:**Y<- Y*V:YY*Y<- Y* 1 **YT- Y*V:YY*YT- Y* 3 **Y\- Y*#5+#V:YY*Y\- Y*#5 8 **Y`- Y*'5+'V:YY*Y`- Y*'5 : **Yĸ- Y*<?**Y- Y*϶<?**Y - Y*<?**Y- *˹**Y̸- Y*<?**Yȸ- Y*<?**Y- Y*Ѷ<?**Y(- Y*O<?O**Y- Y*Ӷ<?**Yd- E?**Y$- G?***Y- IK**Yh- E?)**Yp- *++**Yx- *--**Yt- *//**Y|- *11**Y- ***YX- *MM**Y- ***Y - *ù**Y- ***Y,- ***Y- *ǹ**Y- *Ź**Y- *ɹ**Y- *͹**Yи- *%*#**YԸ- *%*#**Y- *%*#***Y- *O**YL- ***Y4- *QQ**YP- *%*#*Mq***)*+*-*/ *1s**YD- *ܹ**YH- *޹*q*q *M*)*-Q** 9<^|^^o^^*_b^^@ux^~ 6<=O]gox|  &/8<BHUdtx}%* 6 W a fr !1"B#Z"b$k!o(p)t)*(+/001/234567 869#5&3*;b<d=h>m?w@{A@B?=FGFHIJ!K+J3L<I@PAQEQ`RoPxSzT~UVWXYXYXWZVT\]5^j_`ab.ccdefgh5iZjklmn o 8p ]q r s t u v ;w jx y z { | >} m z                , 8 9=?ef?ef TT QUVWU Xd Y ? UE ZQefQefdQefQefzQef[\>*+~ ]S   ;*q=[*q=J*q=9*q=(*q=*q ==*)%*^Y*+*-*/*1`c4*MqW*q*^Y**ec*^Yhc**cimN-q*c*vNxY*MzN-{::Y:Y:*^Yhc*Mk)*M:*c*cD*M*cim*c:-- :q*c*^Yec*A*c* *G*c**C*c**E*c**c**c**c**c**c*K*c**c**c**c**c**c**c**c*O*c*#*c*'*c*ڶ *8*c*6*c*?*c*=*c*c*Ӷ*c*Ѷ*+ *q **c"*q **c&*q **c)*q **c,*q **c/*c2*q **c4* *c7;* *c7@* *c7C*Qq$F*cHkLoJ**Q+)gN*c*N*c*!R*c*ͶU**cX**c[**cWrr^~n ".3?DPUagip} (3CNZiw !,7BMXcnz    !)!6">$K%S'`(h*u+}-/01234568;<>CFHI&J.O:P;;Y ^^0^A^R^d^i^e_W`ab}]crde(iNfg ehe_iC *>*jz*Yn + MY:,D,pr:62v:yr:,6 *c{ 6   W2v6 *c{ 6 2v6 *c{ 6  L F 6  W   ':YY2 *6Lj65*c{#*c{j*j*s_^~(UWX9YBZF[O\U^_`iapcwdefhjklmnpqptuvwu#\.z4|C}ZdflwzzUY 9NT BEqO8R_ iw"  P B 6 (  "ef1VC7 BEZ%W*ɶ+*ɸ~  z]%`*qU*rMYN6-,2+W:,-':-W+*ϱ&58`~2   &8:DMTZ_>``zG ?q#!UMd  ?$%w *rM>,2:ör:x26*c{6[2:+{jŶ:  +{j  :̻YҷԶ Մ,o{~`~B &/=CI`g~p z  U |/L=>I2 `VW eh(%R*rM>>,2:+:)+ :̻YԶ Մ,±(+`~*  "+-HQHRRz G DU3 -ehMN?YM+kL+x>+:+`:,,N, 9<^~&  '0<=>??  5ih&U ' 1%*rM>,2:ör:2:2:pr:{2: 2:  d Y 6   d6 +{  :  *  :̻YԶ Մ,O`~^ &,2<CIOepsyz  U ,o 2i <_IR OL p+   eh.%*rM>,2:ör:2:2:yr:|26 26 +{ 6 +{ 6 +{: Y  j  j:+{ :̻Y"Զ Մ,N`~b &,2<CL U ` k o r txz $ U% ,p 2j <`LP UG `<& k1i t('q ()eh t('* +%F*rM>,2:ör:2:pr:2:2:  6   d6 +{ 6 +{ 6  Y+{ j+{ j+:2: +{  . :̻Y2Զ Մ,`~v & ,!6"=#C$I%_&j'm(s'|)*+,-+./0267:z  U , 6C I jp |^ S& Hi ! eh6%*rM>,2:ör::666 6 4: 9: : 2:2pr:62:<r:2k:2:>qS@Cq 6 @Eq 6 @Gq 6 @Iqw6 qKq 6\Lq 6 GNq 62Pq Q: Uq  #:  cVA ;+WY Y\:5Y`bd:  +{6+{j:5Yg: ػY:+{6+{j:n:'r6+{jWxջ5Y |: oiY:+{6+{:n:'r6+{jWxջ5Y |:  7    +  :̻YԶ Մ,=`~jZC DEFH$I'J*K-L0M5N:O=QDRJSVT\UcVmWtX}YZ[\]^_`abdefghij(k*l0k8mCnLTWrxtuvuwy{|}|~~4>MPV_cejuDB z  U% $ 'O*X-M 0? 5 :VK = VYZc m}   ]'qRGq_]'qjRuGqeh*]'*G_]'*uGv@W PK > 0fr/orsay/lri/varna/models/VARNAConfigLoader.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models; /* * VARNA is a Java library for quick automated drawings RNA secondary structure * Copyright (C) 2007 Yann Ponty * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.geom.Point2D; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.exceptions.ExceptionDrawingAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; import fr.orsay.lri.varna.exceptions.ExceptionModeleStyleBaseSyntaxError; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionParameterError; import fr.orsay.lri.varna.interfaces.InterfaceParameterLoader; import fr.orsay.lri.varna.models.annotations.ChemProbAnnotation; import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.annotations.TextAnnotation; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleColorMap; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.ModeleStyleBase; import fr.orsay.lri.varna.models.rna.RNA; /** * An RNA 2d Panel demo applet * * @author Yann Ponty * */ public class VARNAConfigLoader { private static final int MAXSTYLE = 50; // Applet Options public static String numColumnsOpt = "rows"; public static String numRowsOpt = "columns"; public static String algoOpt = "algorithm"; public static String annotationsOpt = "annotations"; public static String applyBasesStyleOpt = "applyBasesStyle"; public static String auxBPsOpt = "auxBPs"; public static String autoHelicesOpt = "autoHelices"; public static String autoInteriorLoopsOpt = "autoInteriorLoops"; public static String autoTerminalLoopsOpt = "autoTerminalLoops"; public static String backboneColorOpt = "backbone"; public static String backgroundColorOpt = "background"; public static String baseInnerColorOpt = "baseInner"; public static String baseNameColorOpt = "baseName"; public static String baseNumbersColorOpt = "baseNum"; public static String baseOutlineColorOpt = "baseOutline"; public static String basesStyleOpt = "basesStyle"; public static String borderOpt = "border"; public static String bondColorOpt = "bp"; public static String bpIncrementOpt = "bpIncrement"; public static String bpStyleOpt = "bpStyle"; public static String colorMapOpt = "colorMap"; public static String colorMapCaptionOpt = "colorMapCaption"; public static String colorMapDefOpt = "colorMapStyle"; public static String chemProbOpt = "chemProb"; public static String customBasesOpt = "customBases"; public static String customBPsOpt = "customBPs"; public static String drawNCOpt = "drawNC"; public static String drawTertiaryOpt = "drawTertiary"; public static String drawColorMapOpt = "drawColorMap"; public static String drawBackboneOpt = "drawBackbone"; public static String errorOpt = "error"; public static String flatExteriorLoopOpt = "flat"; public static String highlightRegionOpt = "highlightRegion"; public static String nonStandardColorOpt = "nsBasesColor"; public static String orientationOpt = "orientation"; public static String modifiableOpt = "modifiable"; public static String periodNumOpt = "periodNum"; public static String rotationOpt = "rotation"; public static String sequenceOpt = "sequenceDBN"; public static String structureOpt = "structureDBN"; public static String titleOpt = "title"; public static String titleColorOpt = "titleColor"; public static String titleSizeOpt = "titleSize"; public static String URLOpt = "url"; public static String zoomOpt = "zoom"; public static String zoomAmountOpt = "zoomAmount"; public static String warningOpt = "warning"; public static String comparisonModeOpt = "comparisonMode"; public static String gapsBaseColorOpt = "gapsColor"; public static String firstSequenceForComparisonOpt = "firstSequence"; public static String secondSequenceForComparisonOpt = "secondSequence"; public static String firstStructureForComparisonOpt = "firstStructure"; public static String secondStructureForComparisonOpt = "secondStructure"; // Applet assignable parameters private String _algo; public String _annotations; public String _chemProbs; private double _rotation; private String _sseq; private String _sstruct; private int _numRows; private int _numColumns; private String _title; private int _titleSize; private Color _titleColor; private String _auxBPs; private String _highlightRegion; private boolean _autoHelices; private boolean _autoInteriorLoops; private boolean _autoTerminalLoops; private boolean _drawBackbone; private Color _backboneColor; private Color _bondColor; private VARNAConfig.BP_STYLE _bpStyle; private Color _baseOutlineColor; private Color _baseInnerColor; private Color _baseNumColor; private Color _baseNameColor; private Color _gapsColor; private Color _nonStandardColor; private boolean _flatExteriorLoop; private String _customBases; private String _customBPs; private String _colorMapStyle; private String _colorMapCaption; private String _colorMapValues; private boolean _drawNC; private boolean _drawTertiary; private boolean _drawColorMap; private int _periodResNum; private Dimension _border; private Color _backgroundColor; private String _orientation; private boolean _warning, _error; private boolean _modifiable; private double _zoom, _zoomAmount; private ArrayList _basesStyleList; private boolean _comparisonMode; private String _firstSequence; private String _secondSequence; private String _firstStructure; private String _secondStructure; private VARNAPanel _mainSurface; private boolean _useNonStandardColor; private boolean _useGapsColor; private double _bpIncrement; private boolean _useInnerBaseColor; private boolean _useBaseNameColor; private boolean _useBaseNumbersColor; private boolean _useBaseOutlineColor; private String _URL; protected ArrayList _VARNAPanelList = new ArrayList(); InterfaceParameterLoader _optionProducer; public VARNAConfigLoader(InterfaceParameterLoader il) { _optionProducer = il; } public ArrayList createVARNAPanels() throws ExceptionParameterError, ExceptionModeleStyleBaseSyntaxError, ExceptionNonEqualLength, IOException, ExceptionFileFormatOrSyntax, ExceptionLoadingFailed { retrieveParametersValues(); return _VARNAPanelList; } public int getNbRows() { return this._numRows; } public int getNbColumns() { return this._numColumns; } private void initValues() { // Applet assignable parameters _algo = "radiate"; _auxBPs = ""; _autoHelices = false; _autoInteriorLoops = false; _autoTerminalLoops = false; _annotations = ""; _backgroundColor = VARNAConfig.DEFAULT_BACKGROUND_COLOR; _customBases = ""; _customBPs = ""; _chemProbs = ""; _colorMapStyle = ""; _colorMapValues = ""; _colorMapCaption = ""; _drawColorMap = false; _drawNC = true; _drawTertiary = true; _border = new Dimension(0, 0); _sseq = "";// = // "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA"; _sstruct = "";// = // "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...))))).."; _periodResNum = VARNAConfig.DEFAULT_PERIOD; _rotation = 0.0; _title = ""; _titleSize = VARNAConfig.DEFAULT_TITLE_FONT.getSize(); _backboneColor = VARNAConfig.DEFAULT_BACKBONE_COLOR; _drawBackbone = true; _bondColor = VARNAConfig.DEFAULT_BOND_COLOR; _bpStyle = VARNAConfig.DEFAULT_BP_STYLE; _highlightRegion = ""; _baseOutlineColor = VARNAConfig.BASE_OUTLINE_COLOR_DEFAULT; _baseInnerColor = VARNAConfig.BASE_INNER_COLOR_DEFAULT; _baseNumColor = VARNAConfig.BASE_NUMBER_COLOR_DEFAULT; _baseNameColor = VARNAConfig.BASE_NAME_COLOR_DEFAULT; _titleColor = VARNAConfig.DEFAULT_TITLE_COLOR; _warning = false; _error = true; _modifiable = true; _zoom = VARNAConfig.DEFAULT_ZOOM; _zoomAmount = VARNAConfig.DEFAULT_AMOUNT; _comparisonMode = false; _firstSequence = ""; _firstStructure = ""; _secondSequence = ""; _secondStructure = ""; _gapsColor = VARNAConfig.DEFAULT_DASH_BASE_COLOR; _useGapsColor = false; _nonStandardColor = VARNAConfig.DEFAULT_SPECIAL_BASE_COLOR; _useNonStandardColor = false; _useInnerBaseColor = false; _useBaseNameColor = false; _useBaseNumbersColor = false; _useBaseOutlineColor = false; _bpIncrement = VARNAConfig.DEFAULT_BP_INCREMENT; _URL = ""; _flatExteriorLoop = false; _orientation = ""; } public static Color getSafeColor(String col, Color def) { Color result; try { result = Color.decode(col); } catch (NumberFormatException e) { try { result = Color.getColor(col, def); } catch (Exception e2) { // Not a valid color return def; } } return result; } public static final String LEONTIS_WESTHOF_BP_STYLE = "lw"; public static final String SIMPLE_BP_STYLE = "simple"; public static final String RNAVIZ_BP_STYLE = "rnaviz"; public static final String NONE_BP_STYLE = "none"; private VARNAConfig.BP_STYLE getSafeBPStyle(String opt, VARNAConfig.BP_STYLE def) { if (opt.toLowerCase().equals(LEONTIS_WESTHOF_BP_STYLE)) { return VARNAConfig.BP_STYLE.BP_STYLE_LW; } else if (opt.toLowerCase().equals(SIMPLE_BP_STYLE)) { return VARNAConfig.BP_STYLE.BP_STYLE_SIMPLE; } else if (opt.toLowerCase().equals(RNAVIZ_BP_STYLE)) { return VARNAConfig.BP_STYLE.BP_STYLE_RNAVIZ; } else if (opt.toLowerCase().equals(NONE_BP_STYLE)) { return VARNAConfig.BP_STYLE.BP_STYLE_NONE; } else { return def; } } public static String[][] getParameterInfo() { String[][] info = { // Parameter Name Kind of Value Description { algoOpt, "String", "Drawing algorithm, choosen from [" + VARNAConfigLoader.ALGORITHM_NAVIEW + "," + VARNAConfigLoader.ALGORITHM_LINE + "," + VARNAConfigLoader.ALGORITHM_RADIATE + "," + VARNAConfigLoader.ALGORITHM_CIRCULAR + "]" }, { annotationsOpt, "string", "A set of textual annotations" }, { backboneColorOpt, "Color", "Backbone color (Ex: #334455)" }, { drawBackboneOpt, "boolean", "True if the backbone must be drawn, false otherwise" }, { backgroundColorOpt, "Color", "Background color (Ex: #334455)" }, { baseInnerColorOpt, "Color", "Default value for inner base color (Ex: #334455)" }, { baseNameColorOpt, "Color", "Residues font color (Ex: #334455)" }, { baseNumbersColorOpt, "Color", "Base numbers font color (Ex: #334455)" }, { baseOutlineColorOpt, "Color", "Base outline color (Ex: #334455)" }, { bondColorOpt, "Color", "Base pair color (Ex: #334455)" }, { borderOpt, "String", "Border width and height in pixels (Ex: \"20x40\")" }, { sequenceOpt, "String", "Raw RNA sequence" }, { structureOpt, "String", "RNA structure given in dot bracket notation (DBN)" }, { periodNumOpt, "int", "Periodicity of base-numbering" }, { titleOpt, "String", "RNA drawing title" }, { titleColorOpt, "Color", "Title color (Ex: #334455)" }, { titleSizeOpt, "int", "Title font size" }, { zoomOpt, "int", "Zoom coefficient" }, { zoomAmountOpt, "int", "Zoom increment on user interaction" }, { warningOpt, "boolean", "Show warnings" }, { errorOpt, "boolean", "Show errors" }, { gapsBaseColorOpt, "Color","Define and use custom color for gaps bases in comparison mode" }, { nonStandardColorOpt, "Color", "Define and use custom color for non-standard bases in comparison mode" }, { basesStyleOpt, "String", "Base style declaration" }, { applyBasesStyleOpt, "String", "Base style application" }, { bpStyleOpt, "String", "Look and feel for base pairs drawings, choosen from [" + VARNAConfigLoader.LEONTIS_WESTHOF_BP_STYLE + "," + VARNAConfigLoader.NONE_BP_STYLE + "," + VARNAConfigLoader.SIMPLE_BP_STYLE + "," + VARNAConfigLoader.RNAVIZ_BP_STYLE + "]" }, { modifiableOpt, "boolean", "Allows/prohibits modifications" }, { comparisonModeOpt, "boolean", "Activates comparison mode" }, { firstSequenceForComparisonOpt, "String", "In comparison mode, sequence of first RNA" }, { firstStructureForComparisonOpt, "String", "In comparison mode, structure of first RNA" }, { secondSequenceForComparisonOpt, "String", "In comparison mode, sequence of second RNA" }, { secondStructureForComparisonOpt, "String", "In comparison mode, structure of second RNA" }, { auxBPsOpt, "String", "Adds a list of (possibly non-canonical) base-pairs to those already defined by the main secondary structure (Ex: \"(1,10);(2,11);(3,12)\"). Custom BP styles can be specified (Ex: \"(2,11):thickness=4;(3,12):color=#FF0000\")." }, {rotationOpt, "float", "Rotates RNA after initial drawing (Ex: '20' for a 20 degree counter-clockwise rotation)" }, {orientationOpt, "float", "Sets the general orientation of an RNA, i.e. the deviation of the longest axis (defined by the most distant couple of bases) from the horizontal axis."}, { drawNCOpt, "boolean", "Toggles on/off display of non-canonical base-pairs" }, { drawTertiaryOpt, "boolean", "Toggles on/off display of tertiary interaction, ie pseudoknots" }, { flatExteriorLoopOpt, "boolean", "Toggles on/off (true/false) drawing exterior bases on a straight line" }, { colorMapOpt, "String", "Associates a list of numerical values (eg '0.2,0.4,0.6,0.8') with the RNA bases with respect to their natural order, and modifies the color used to fill these bases according to current color map style." }, { colorMapCaptionOpt, "String", "Sets current color map caption." }, { colorMapDefOpt, "String", "Selects a specific color map style. It can be either one of the predefined styles (eg 'red', 'green', 'blue', 'bw', 'heat', 'energy') or a new one (eg '0:#FFFF00;1:#ffFFFF;6:#FF0000')." }, { bpIncrementOpt, "float", "Distance between nested base-pairs (i.e. arcs) in linear representation" }, }; return info; } private void retrieveParametersValues() throws ExceptionParameterError, ExceptionModeleStyleBaseSyntaxError, ExceptionNonEqualLength, IOException, ExceptionFileFormatOrSyntax, ExceptionLoadingFailed { _numRows = 1; _numColumns = 1; _basesStyleList = new ArrayList(); try { _numRows = Integer.parseInt(_optionProducer.getParameterValue( numRowsOpt, "" + _numRows)); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "'" + _optionProducer.getParameterValue(numRowsOpt, "" + _numRows) + "' is not a integer value for the number of rows !"); } try { _numColumns = Integer.parseInt(_optionProducer.getParameterValue( numColumnsOpt, "" + _numColumns)); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "'" + _optionProducer.getParameterValue(numColumnsOpt, "" + _numColumns) + "' is not a integer value for the number of columns !"); } String tmp = null; for (int i = 0; i < MAXSTYLE; i++) { tmp = _optionProducer.getParameterValue(basesStyleOpt + i, null); if (tmp != null) { ModeleStyleBase msb = new ModeleStyleBase(); msb.assignParameters(tmp); _basesStyleList.add(msb); } else { _basesStyleList.add(null); } } // _containerApplet.getLayout(). int x; String n; initValues(); for (int i = 0; i < _numColumns; i++) { for (int j = 0; j < _numRows; j++) { // initValues(); x = 1 + j + i * _numRows; n = "" + x; if ((_numColumns == 1) && (_numRows == 1)) { n = ""; } _useGapsColor = false; _useNonStandardColor = false; tmp = _optionProducer.getParameterValue(baseNameColorOpt + n,""); if (!tmp.equals("")) { _useBaseNameColor = true; _baseNameColor = getSafeColor(tmp, _baseNameColor); } tmp = _optionProducer.getParameterValue( baseNumbersColorOpt + n, ""); if (!tmp.equals("")) { _useBaseNumbersColor = true; _baseNumColor = getSafeColor(tmp, _baseNumColor); } tmp = _optionProducer.getParameterValue(baseOutlineColorOpt + n, ""); if (!tmp.equals("")) { _useBaseOutlineColor = true; _baseOutlineColor = getSafeColor(tmp, _baseOutlineColor); } tmp = _optionProducer.getParameterValue(baseInnerColorOpt + n,""); if (!tmp.equals("")) { _useInnerBaseColor = true; _baseInnerColor = getSafeColor(tmp, _baseInnerColor); } tmp = _optionProducer.getParameterValue(nonStandardColorOpt + n, ""); if (!tmp.equals("")) { _nonStandardColor = getSafeColor(tmp, _nonStandardColor); _useNonStandardColor = true; } tmp = _optionProducer.getParameterValue(gapsBaseColorOpt + n, _gapsColor.toString()); if (!tmp.equals("")) { _gapsColor = getSafeColor(tmp, _gapsColor); _useGapsColor = true; } try { _rotation = Double.parseDouble(_optionProducer .getParameterValue(rotationOpt + n, Double .toString(_rotation))); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "'" + _optionProducer.getParameterValue(periodNumOpt + n, "" + _periodResNum) + "' is not a valid float value for rotation!"); } try { _bpIncrement = Double.parseDouble(_optionProducer .getParameterValue(bpIncrementOpt + n, Double .toString(_bpIncrement))); } catch (NumberFormatException e) { } try { _periodResNum = Integer.parseInt(_optionProducer .getParameterValue(periodNumOpt + n, "" + _periodResNum)); } catch (NumberFormatException e) { throw new ExceptionParameterError( e.getMessage(), "'" + _optionProducer.getParameterValue( periodNumOpt + n, "" + _periodResNum) + "' is not a valid integer value for the period of residue numbers!"); } try {_titleSize = Integer.parseInt(_optionProducer.getParameterValue(titleSizeOpt + n, ""+ _titleSize)); } catch (NumberFormatException e) { throw new ExceptionParameterError( e.getMessage(), "'" + _optionProducer.getParameterValue( titleSizeOpt + n, "" + _titleSize) + "' is not a valid integer value for the number of rows !"); } try { _zoom = Double.parseDouble(_optionProducer .getParameterValue(zoomOpt + n, "" + _zoom)); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "'" + _optionProducer.getParameterValue(zoomOpt + n, "" + _zoom) + "' is not a valid integer value for the zoom !"); } try { _zoomAmount = Double.parseDouble(_optionProducer .getParameterValue(zoomAmountOpt + n, "" + _zoomAmount)); } catch (NumberFormatException e) { throw new ExceptionParameterError( e.getMessage(), "'" + _optionProducer .getParameterValue(zoomAmountOpt + n, "" + _zoomAmount) + "' is not a valid integer value for the zoom amount !"); } _autoHelices = Boolean.parseBoolean(_optionProducer.getParameterValue(autoHelicesOpt + n, ""+ _autoHelices)); _drawColorMap = Boolean.parseBoolean(_optionProducer.getParameterValue(drawColorMapOpt + n, ""+ _drawColorMap)); _drawBackbone = Boolean.parseBoolean(_optionProducer.getParameterValue(drawBackboneOpt + n, ""+ _drawBackbone)); _colorMapValues = _optionProducer.getParameterValue(colorMapOpt + n, _colorMapValues); _autoTerminalLoops = Boolean.parseBoolean(_optionProducer.getParameterValue(autoTerminalLoopsOpt + n, ""+ _autoTerminalLoops)); _autoInteriorLoops = Boolean.parseBoolean(_optionProducer.getParameterValue(autoInteriorLoopsOpt + n, ""+ _autoInteriorLoops)); _drawNC = Boolean.parseBoolean(_optionProducer.getParameterValue(drawNCOpt + n, "" + _drawNC)); _flatExteriorLoop = Boolean.parseBoolean(_optionProducer.getParameterValue(flatExteriorLoopOpt + n, ""+ _flatExteriorLoop)); _drawTertiary = Boolean.parseBoolean(_optionProducer.getParameterValue(drawTertiaryOpt + n, ""+ _drawTertiary)); _warning = Boolean.parseBoolean(_optionProducer.getParameterValue(warningOpt + n, "false")); _error = Boolean.parseBoolean(_optionProducer.getParameterValue(errorOpt + n, "true")); _border = parseDimension(_optionProducer.getParameterValue(borderOpt + n, "0X0")); _comparisonMode = Boolean.parseBoolean(_optionProducer.getParameterValue(comparisonModeOpt + n, "false")); _firstSequence = _optionProducer.getParameterValue(firstSequenceForComparisonOpt + n, _firstSequence); _firstStructure = _optionProducer.getParameterValue(firstStructureForComparisonOpt + n, _firstStructure); _secondSequence = _optionProducer.getParameterValue(secondSequenceForComparisonOpt + n, _secondSequence); _secondStructure = _optionProducer.getParameterValue(secondStructureForComparisonOpt + n, _secondStructure); _annotations = _optionProducer.getParameterValue(annotationsOpt+ n, _annotations); _URL = _optionProducer.getParameterValue(URLOpt + n, _URL); _algo = _optionProducer.getParameterValue(algoOpt + n, _algo); _customBases = _optionProducer.getParameterValue(customBasesOpt+ n, _customBases); _auxBPs = _optionProducer.getParameterValue(auxBPsOpt + n,_auxBPs); _highlightRegion = _optionProducer.getParameterValue(highlightRegionOpt + n,_highlightRegion); _chemProbs = _optionProducer.getParameterValue(chemProbOpt + n, _chemProbs); _customBPs = _optionProducer.getParameterValue(customBPsOpt + n, _customBPs); _colorMapStyle = _optionProducer.getParameterValue(colorMapDefOpt + n, _colorMapStyle); _colorMapCaption = _optionProducer.getParameterValue(colorMapCaptionOpt + n, _colorMapCaption); _backboneColor = getSafeColor(_optionProducer.getParameterValue(backboneColorOpt + n, _backboneColor.toString()), _backboneColor); _backgroundColor = getSafeColor(_optionProducer.getParameterValue(backgroundColorOpt + n,_backgroundColor.toString()), _backgroundColor); _bondColor = getSafeColor(_optionProducer.getParameterValue(bondColorOpt + n, _bondColor.toString()), _bondColor); _bpStyle = getSafeBPStyle(_optionProducer.getParameterValue(bpStyleOpt + n, ""), _bpStyle); _title = _optionProducer.getParameterValue(titleOpt + n, _title); _orientation = _optionProducer.getParameterValue(orientationOpt + n, _orientation); _titleColor = getSafeColor(_optionProducer.getParameterValue(titleColorOpt + n, _titleColor.toString()), _titleColor); if (!_URL.equals("")) { _sstruct = ""; _sseq = ""; } if (_comparisonMode && _firstSequence != null && _firstStructure != null && _secondSequence != null && _secondStructure != null) { } else { _sseq = _optionProducer.getParameterValue(sequenceOpt + n, _sseq); _sstruct = _optionProducer.getParameterValue(structureOpt + n, _sstruct); if (!_sseq.equals("") && !_sstruct.equals("")) { _URL = ""; } _comparisonMode = false; } // applique les valeurs des parametres recuperees applyValues(n); }// fin de boucle sur les lignes }// fin de boucle sur les colonnes } private RNA _defaultRNA = new RNA(); public void setRNA(RNA r) { _defaultRNA = r; } public static final String ALGORITHM_CIRCULAR = "circular"; public static final String ALGORITHM_NAVIEW = "naview"; public static final String ALGORITHM_LINE = "line"; public static final String ALGORITHM_RADIATE = "radiate"; public static final String ALGORITHM_VARNA_VIEW = "varnaview"; public static final String ALGORITHM_MOTIF_VIEW = "motifview"; private void applyValues(String n) throws ExceptionParameterError, ExceptionNonEqualLength, IOException, ExceptionFileFormatOrSyntax, ExceptionLoadingFailed { int algoCode; if (_algo.equals(ALGORITHM_CIRCULAR)) algoCode = RNA.DRAW_MODE_CIRCULAR; else if (_algo.equals(ALGORITHM_NAVIEW)) algoCode = RNA.DRAW_MODE_NAVIEW; else if (_algo.equals(ALGORITHM_LINE)) algoCode = RNA.DRAW_MODE_LINEAR; else if (_algo.equals(ALGORITHM_RADIATE)) algoCode = RNA.DRAW_MODE_RADIATE; else if (_algo.equals(ALGORITHM_VARNA_VIEW)) algoCode = RNA.DRAW_MODE_VARNA_VIEW; else if (_algo.equals(ALGORITHM_MOTIF_VIEW)) algoCode = RNA.DRAW_MODE_MOTIFVIEW; else algoCode = RNA.DRAW_MODE_RADIATE; if (_comparisonMode) { _mainSurface = new VARNAPanel(_firstSequence, _firstStructure, _secondSequence, _secondStructure, algoCode, ""); } else { if (_URL.equals("")) { if (!_sstruct.equals("")) { _mainSurface = new VARNAPanel(_sseq, _sstruct, algoCode); } else { _mainSurface = new VARNAPanel(); try { _defaultRNA.drawRNA(algoCode,_mainSurface.getConfig()); } catch (ExceptionDrawingAlgorithm e) { e.printStackTrace(); } _mainSurface.drawRNA(_defaultRNA); } } else { URL url = null; try { url = new URL(_URL); URLConnection connexion = url.openConnection(); connexion.setUseCaches(false); InputStream r = connexion.getInputStream(); InputStreamReader inr = new InputStreamReader(r); RNA rna = new RNA(); _mainSurface = new VARNAPanel(); if (_URL.toLowerCase().endsWith(VARNAPanel.VARNA_SESSION_EXTENSION)) { FullBackup f; f = VARNAPanel.importSession(r,_URL); _mainSurface.setConfig(f.config); _mainSurface.showRNA(f.rna); } else { rna.loadSecStr(inr, RNA.guessFileTypeFromExtension(_URL)); rna.drawRNA(algoCode,_mainSurface.getConfig()); _mainSurface.drawRNA(rna, algoCode); } } catch (ExceptionFileFormatOrSyntax e) { if (url != null) e.setPath(url.getPath()); } catch (ExceptionDrawingAlgorithm e) { // TODO Auto-generated catch block e.printStackTrace(); } if (_mainSurface == null) { _mainSurface = new VARNAPanel("X", ".", algoCode); } } } if (_useInnerBaseColor) { _mainSurface.setBaseInnerColor(_baseInnerColor); } if (_useBaseOutlineColor) { _mainSurface.setBaseOutlineColor(_baseOutlineColor); } if (_useBaseNameColor) { _mainSurface.setBaseNameColor(_baseNameColor); } if (_useBaseNumbersColor) { _mainSurface.setBaseNumbersColor(_baseNumColor); } _mainSurface.setBackground(_backgroundColor); _mainSurface.setNumPeriod(_periodResNum); _mainSurface.setBackboneColor(_backboneColor); _mainSurface.setDefaultBPColor(_bondColor); _mainSurface.setBPHeightIncrement(_bpIncrement); _mainSurface.setBPStyle(_bpStyle); _mainSurface.setDrawBackbone(_drawBackbone); _mainSurface.setTitleFontColor(_titleColor); _mainSurface.setTitle(_title); _mainSurface.setTitleFontSize(_titleSize); _mainSurface.getPopupMenu().get_itemShowWarnings().setState(_warning); _mainSurface.setErrorsOn(_error); _mainSurface.setFlatExteriorLoop(_flatExteriorLoop); _mainSurface.setZoom(_zoom); _mainSurface.setZoomIncrement(_zoomAmount); _mainSurface.setBorderSize(_border); if (_useGapsColor) { _mainSurface.setGapsBasesColor(this._gapsColor); _mainSurface.setColorGapsBases(true); } if (_useNonStandardColor) { _mainSurface.setNonStandardBasesColor(_nonStandardColor); _mainSurface.setColorNonStandardBases(true); } _mainSurface.setShowNonPlanarBP(_drawTertiary); _mainSurface.setShowNonCanonicalBP(_drawNC); applyBasesStyle(n); if (!_customBases.equals("")) applyBasesCustomStyles(_mainSurface); if (!_highlightRegion.equals("")) applyHighlightRegion(_mainSurface); if (!_auxBPs.equals("")) applyAuxBPs(_mainSurface); if (!_chemProbs.equals("")) applyChemProbs(_mainSurface); if (!_customBPs.equals("")) applyBPsCustomStyles(_mainSurface); _mainSurface.drawRNA(); if (!_annotations.equals("")) applyAnnotations(_mainSurface); if (_autoHelices) _mainSurface.getVARNAUI().UIAutoAnnotateHelices(); if (_autoTerminalLoops) _mainSurface.getVARNAUI().UIAutoAnnotateTerminalLoops(); if (_autoInteriorLoops) _mainSurface.getVARNAUI().UIAutoAnnotateInteriorLoops(); if (!_orientation.equals("")) { try{ double d = 360*_mainSurface.getOrientation()/(2.*Math.PI); _rotation = Double.parseDouble(_orientation)-d; } catch(NumberFormatException e){ //TODO : Add some code here... } } _mainSurface.globalRotation(_rotation); _mainSurface.setModifiable(_modifiable); _mainSurface.setColorMapCaption(_colorMapCaption); applyColorMapStyle(_mainSurface); applyColorMapValues(_mainSurface); //if (!_drawColorMap) // _mainSurface.drawColorMap(_drawColorMap); // ajoute le VARNAPanel au conteneur _VARNAPanelList.add(_mainSurface); } private void applyBasesStyle(String n) throws ExceptionParameterError { String tmp; for (int numStyle = 0; numStyle < _basesStyleList.size(); numStyle++) { if (_basesStyleList.get(numStyle) != null) { tmp = _optionProducer.getParameterValue(applyBasesStyleOpt + numStyle + "on" + n, null); ArrayList indicesList = new ArrayList(); if (tmp != null) { String[] basesList = tmp.split(","); for (int k = 0; k < basesList.length; k++) { String cand = basesList[k].trim(); try { String[] args = cand.split("-"); if (args.length==1) { int baseNum = Integer.parseInt(cand); int index = _mainSurface.getRNA().getIndexFromBaseNumber(baseNum); if (index!=-1) { indicesList.add(index); } } else if (args.length==2) { int baseNumFrom = Integer.parseInt(args[0].trim()); int indexFrom = _mainSurface.getRNA().getIndexFromBaseNumber(baseNumFrom); int baseNumTo = Integer.parseInt(args[1].trim()); int indexTo = _mainSurface.getRNA().getIndexFromBaseNumber(baseNumTo); if ((indexFrom!=-1)&&(indexTo!=-1)) { for (int l=indexFrom;l<=indexTo;l++) indicesList.add(l); } } } catch (NumberFormatException e) { throw new ExceptionParameterError(e .getMessage(), "Bad Base Index: " + basesList[k]); } } for(int k=0;k= 0) && (index < _mainSurface.getRNA().get_listeBases().size())) { _mainSurface.getRNA().get_listeBases().get( index).setStyleBase( _basesStyleList.get(numStyle)); } } } } }// fin de boucle sur les styles } private void applyColorMapStyle(VARNAPanel vp) { if (_colorMapStyle.length()==0) return; vp.setColorMap(ModeleColorMap.parseColorMap(_colorMapStyle)); } private void applyColorMapValues(VARNAPanel vp) { if (!_colorMapValues.equals("")) { String[] values = _colorMapValues.split("[;,]"); ArrayList vals = new ArrayList(); for (int i = 0; i < values.length; i++) { try{ vals.add(Double.parseDouble(values[i])); } catch(Exception e) { } } Double[] result = new Double[vals.size()]; vals.toArray(result); vp.setColorMapValues(result); _drawColorMap = true; } } private void applyBasesCustomStyles(VARNAPanel vp) { String[] baseStyles = _customBases.split(";"); for (int i = 0; i < baseStyles.length; i++) { String thisStyle = baseStyles[i]; String[] data = thisStyle.split(":"); try { if (data.length == 2) { int baseNum = Integer.parseInt(data[0]); int index = _mainSurface.getRNA().getIndexFromBaseNumber(baseNum); if (index!=-1) { String style = data[1]; ModeleStyleBase msb = vp.getRNA().get_listeBases().get(index).getStyleBase().clone(); msb.assignParameters(style); vp.getRNA().get_listeBases().get(index).setStyleBase(msb); } } } catch (Exception e) { System.err.println("ApplyBasesCustomStyle: " + e.toString()); } } } private void applyHighlightRegion(VARNAPanel vp) { String[] regions = _highlightRegion.split(";"); for (int i = 0; i < regions.length; i++) { String region = regions[i]; //System.out.println(region); try{ HighlightRegionAnnotation nt = HighlightRegionAnnotation.parseHighlightRegionAnnotation(region,vp); if (nt!=null) vp.addHighlightRegion(nt); } catch (Exception e) { System.err.println("applyHighlightRegion: " + e.toString()); } } } private Dimension parseDimension(String s) { Dimension d = new Dimension(0, 0); try { s = s.toLowerCase(); int i = s.indexOf('x'); String w = s.substring(0, i); String h = s.substring(i + 1); d.width = Integer.parseInt(w); d.height = Integer.parseInt(h); } catch (NumberFormatException e) { } return d; } private void applyBPsCustomStyles(VARNAPanel vp) { String[] baseStyles = _customBPs.split(";"); for (int i = 0; i < baseStyles.length; i++) { String thisStyle = baseStyles[i]; String[] data = thisStyle.split(":"); try { if (data.length == 2) { String indices = data[0]; String style = data[1]; String[] data2 = indices.split(","); if (data2.length == 2) { String s1 = data2[0]; String s2 = data2[1]; if (s1.startsWith("(") && s2.endsWith(")")) { int a = Integer.parseInt(s1.substring(1)); int b = Integer.parseInt(s2.substring(0, s2 .length() - 1)); ModeleStyleBP msbp = vp.getRNA().getBPStyle(a, b); if (msbp != null) { msbp.assignParameters(style); } } } } } catch (Exception e) { System.err.println("ApplyBPsCustomStyle: " + e.toString()); } } } private void applyChemProbs(VARNAPanel vp) { String[] chemProbs = _chemProbs.split(";"); for (int i = 0; i < chemProbs.length; i++) { String thisAnn = chemProbs[i]; String[] data = thisAnn.split(":"); try { if (data.length == 2) { String indices = data[0]; String style = data[1]; String[] data2 = indices.split("-"); if (data2.length == 2) { int a = Integer.parseInt(data2[0]); int b = Integer.parseInt(data2[1]); int c = vp.getRNA().getIndexFromBaseNumber(a); int d = vp.getRNA().getIndexFromBaseNumber(b); ArrayList mbl = vp.getRNA() .get_listeBases(); ChemProbAnnotation cpa = new ChemProbAnnotation(mbl .get(c), mbl.get(d), style); vp.getRNA().addChemProbAnnotation(cpa); } } } catch (Exception e) { System.err.println("ChempProbs: " + e.toString()); } } } private void applyAuxBPs(VARNAPanel vp) { String[] baseStyles = _auxBPs.split(";"); for (int i = 0; i < baseStyles.length; i++) { String thisStyle = baseStyles[i]; String[] data = thisStyle.split(":"); try { if (data.length >= 1) { String indices = data[0]; String[] data2 = indices.split(","); if (data2.length == 2) { String s1 = data2[0]; String s2 = data2[1]; if (s1.startsWith("(") && s2.endsWith(")")) { int a = Integer.parseInt(s1.substring(1)); int b = Integer.parseInt(s2.substring(0, s2 .length() - 1)); int c = vp.getRNA().getIndexFromBaseNumber(a); int d = vp.getRNA().getIndexFromBaseNumber(b); ModeleStyleBP msbp = new ModeleStyleBP(vp.getRNA() .get_listeBases().get(c), vp.getRNA() .get_listeBases().get(d)); if (data.length >= 2) { String style = data[1]; msbp.assignParameters(style); } vp.getRNA().addBPToStructureUsingNumbers(a, b, msbp); } } } } catch (Exception e) { System.err.println("AuxApplyBPs: " + e.toString()); } } } /** * Format: * string:[type=[H|B|L|P]|x=double|y=double|anchor=int|size=int|color=Color]; * * @param vp */ private void applyAnnotations(VARNAPanel vp) { String[] annotations = _annotations.split(";"); for (int i = 0; i < annotations.length; i++) { String thisAnn = annotations[i]; String[] data = thisAnn.split(":"); String text = ""; int anchor = -1; int x = -1; int y = -1; int type = TextAnnotation.LOOP; Font font = TextAnnotation.DEFAULTFONT; Color color = TextAnnotation.DEFAULTCOLOR; TextAnnotation ann = null; try { if (data.length == 2) { text = data[0]; String[] data2 = data[1].split(","); for (int j = 0; j < data2.length; j++) { String opt = data2[j]; String[] data3 = opt.split("="); if (data3.length == 2) { String name = data3[0].toLowerCase(); String value = data3[1]; if (name.equals("type")) { if (value.toUpperCase().equals("H")) { type = TextAnnotation.HELIX; } else if (value.toUpperCase().equals("L")) { type = TextAnnotation.LOOP; } else if (value.toUpperCase().equals("P")) { type = TextAnnotation.POSITION; } else if (value.toUpperCase().equals("B")) { type = TextAnnotation.BASE; } } else if (name.equals("x")) { x = Integer.parseInt(value); } else if (name.equals("y")) { y = Integer.parseInt(value); } else if (name.equals("anchor")) { anchor = Integer.parseInt(value); } else if (name.equals("size")) { font = font.deriveFont((float) Integer .parseInt(value)); } else if (name.equals("color")) { color = getSafeColor(value, color); } } } switch (type) { case (TextAnnotation.POSITION): if ((x != -1) && (y != -1)) { Point2D.Double p = vp .panelToLogicPoint(new Point2D.Double(x, y)); ann = new TextAnnotation(text, p.x, p.y); } break; case (TextAnnotation.BASE): if (anchor != -1) { int index = vp.getRNA().getIndexFromBaseNumber( anchor); ModeleBase mb = vp.getRNA().get_listeBases().get( index); ann = new TextAnnotation(text, mb); } break; case (TextAnnotation.HELIX): if (anchor != -1) { ArrayList mbl = new ArrayList(); int index = vp.getRNA().getIndexFromBaseNumber( anchor); ArrayList il = vp.getRNA() .findHelix(index); for (int k : il) { mbl.add(vp.getRNA().get_listeBases().get(k)); } ann = new TextAnnotation(text, mbl, type); } break; case (TextAnnotation.LOOP): if (anchor != -1) { ArrayList mbl = new ArrayList(); int index = vp.getRNA().getIndexFromBaseNumber( anchor); ArrayList il = vp.getRNA().findLoop(index); for (int k : il) { mbl.add(vp.getRNA().get_listeBases().get(k)); } ann = new TextAnnotation(text, mbl, type); } break; } if (ann != null) { ann.setColor(color); ann.setFont(font); vp.addAnnotation(ann); } } } catch (Exception e) { System.err.println("Apply Annotations: " + e.toString()); } } } } PK 4F>wJJ*fr/orsay/lri/varna/models/FullBackup.class1)$fr/orsay/lri/varna/models/FullBackupjava/lang/Objectjava/io/SerializableserialVersionUIDJ ConstantValue Zconfig'Lfr/orsay/lri/varna/models/VARNAConfig;rna#Lfr/orsay/lri/varna/models/rna/RNA;nameLjava/lang/String;_(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;Ljava/lang/String;)VCode  ()V     LineNumberTableLocalVariableTablethis&Lfr/orsay/lri/varna/models/FullBackup;crntoString()Ljava/lang/String; SourceFileFullBackup.java!   l**+*,*- * !" #$%&/*  !'(PK $Y=XΚ  )fr/orsay/lri/varna/models/FullBackup.javapackage fr.orsay.lri.varna.models; import java.io.Serializable; import fr.orsay.lri.varna.models.rna.RNA; public class FullBackup implements Serializable{ /** * */ private static final long serialVersionUID = -5468893731117925140L; public VARNAConfig config; public RNA rna; public String name; public FullBackup(VARNAConfig c, RNA r, String n){ config = c; rna = r; name = n; } public String toString() { return name; } } PK 4F>E#4fr/orsay/lri/varna/models/VARNAEdits$AddBPEdit.class1`.fr/orsay/lri/varna/models/VARNAEdits$AddBPEdit%javax/swing/undo/AbstractUndoableEdit_msbp-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;_iI_j_vpLfr/orsay/lri/varna/VARNAPanel;Q(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V        LineNumberTableLocalVariableTablethis0Lfr/orsay/lri/varna/models/VARNAEdits$AddBPEdit;ijmsbpvpundo Exceptions%$javax/swing/undo/CannotUndoException ')(fr/orsay/lri/varna/VARNAPanel *+getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; -/.!fr/orsay/lri/varna/models/rna/RNA 01removeBP0(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V '3 4repaintredo7$javax/swing/undo/CannotRedoException -9 :;addBPToStructure2(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)VcanUndo()ZcanRedogetPresentationName()Ljava/lang/String;Bjava/lang/StringBuilderDAdd BP ( AF G(Ljava/lang/String;)V AI JKappend(I)Ljava/lang/StringBuilder;M, AO JP-(Ljava/lang/String;)Ljava/lang/StringBuilder;R) AT U@toStringaddEdit"(Ljavax/swing/undo/UndoableEdit;)ZanEditLjavax/swing/undo/UndoableEdit; SourceFileVARNAEdits.java InnerClasses^$fr/orsay/lri/varna/models/VARNAEdits AddBPEdit!   **-*** 4 ! "#$H*&*,*2 5#6P*&***8*2 <=, >=, ?@O%AYCE*HLN*HQNS %VW6XYZ[\ ]_ PK 4F>{ 9fr/orsay/lri/varna/models/VARNAEdits$BasesShiftEdit.class13fr/orsay/lri/varna/models/VARNAEdits$BasesShiftEdit%javax/swing/undo/AbstractUndoableEdit_indicesLjava/util/ArrayList; Signature*Ljava/util/ArrayList;_dxD_dy_vpLfr/orsay/lri/varna/VARNAPanel;9(Ljava/util/ArrayList;DDLfr/orsay/lri/varna/VARNAPanel;)VN(Ljava/util/ArrayList;DDLfr/orsay/lri/varna/VARNAPanel;)VCode  ()V      LineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/models/VARNAEdits$BasesShiftEdit;indicesdxdypLocalVariableTypeTableundo Exceptions)$javax/swing/undo/CannotUndoException +-,java/util/ArrayList ./iterator()Ljava/util/Iterator; 132java/util/Iterator 45next()Ljava/lang/Object;7java/lang/Integer 69 :;intValue()I =?>fr/orsay/lri/varna/VARNAPanel @AgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; CED!fr/orsay/lri/varna/models/rna/RNA FG getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase;Ijava/awt/geom/Point2D$Double KML(fr/orsay/lri/varna/models/rna/ModeleBase NO getCoords ()Ljava/awt/geom/Point2D$Double; HQ R x HT U y HW X(DD)V CZ [\setCoord"(ILjava/awt/geom/Point2D$Double;)V K^ _O getCenter Ca b\ setCenter 1d efhasNext()Z =h irepaintindexImb*Lfr/orsay/lri/varna/models/rna/ModeleBase;redop$javax/swing/undo/CannotRedoExceptioncanUndocanRedogetPresentationName()Ljava/lang/String;vjava/lang/StringBuilderxBase # uz {(Ljava/lang/String;)V u} ~append-(Ljava/lang/Object;)Ljava/lang/StringBuilder; shifted u ~-(Ljava/lang/String;)Ljava/lang/StringBuilder; u ttoStringaddEdit"(Ljavax/swing/undo/UndoableEdit;)Z + equals(Ljava/lang/Object;)Z H distance(DD)D@KanEditLjavax/swing/undo/UndoableEdit;etotLjava/awt/geom/Point2D$Double; SourceFileVARNAEdits.java InnerClasses$fr/orsay/lri/varna/models/VARNAEditsBasesShiftEditjava/awt/geom/Point2DDouble!   **+*(** !"#4 !" # $ % !&'( **Mp,068<*<BN*<HY-JP*g-JS*gVY*<HY-]P*g-]S*gV`,c*g%'$(N)x%+,  `jk$Tlmn'o **Mp,068<*<BN*<HY-JP*c-JS*cVY*<HY-]P*g-]S*gV`,c*g.0$1N2x.45  `jk$Tlmqf,6  rf,7  stCuYwy*|8  _+Y+M,*FHY*,c*,cVN-*Y,c*Y,c& ;= >@4AACND[E]I*_ _ Q 4) H PK 4F>8fr/orsay/lri/varna/models/VARNAEdits$HelixFlipEdit.class1Q2fr/orsay/lri/varna/models/VARNAEdits$HelixFlipEdit%javax/swing/undo/AbstractUndoableEdit_hLjava/awt/Point;_vpLfr/orsay/lri/varna/VARNAPanel;2(Ljava/awt/Point;Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V    LineNumberTableLocalVariableTablethis4Lfr/orsay/lri/varna/models/VARNAEdits$HelixFlipEdit;hvpundo Exceptions$javax/swing/undo/CannotUndoException  fr/orsay/lri/varna/VARNAPanel !" getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; $&%fr/orsay/lri/varna/views/VueUI '( UIFlipHelix(Ljava/awt/Point;)V * +repaintredo.$javax/swing/undo/CannotRedoExceptioncanUndo()ZcanRedogetPresentationName()Ljava/lang/String;5java/lang/StringBuilder7Helix # 49 :(Ljava/lang/String;)V 4< =>append-(Ljava/lang/Object;)Ljava/lang/StringBuilder;@ flipped 4B =C-(Ljava/lang/String;)Ljava/lang/StringBuilder; 4E F3toStringaddEdit"(Ljavax/swing/undo/UndoableEdit;)ZanEditLjavax/swing/undo/UndoableEdit; SourceFileVARNAEdits.java InnerClassesO$fr/orsay/lri/varna/models/VARNAEdits HelixFlipEdit!  Y* *+*,   H**#*) ,- H**#*) /0 , 10 , 23 C4Y68*;?AD GH 6IJKLM NP PK 4F>' :fr/orsay/lri/varna/models/VARNAEdits$HelixRotateEdit.class1}4fr/orsay/lri/varna/models/VARNAEdits$HelixRotateEdit%javax/swing/undo/AbstractUndoableEdit_deltaD_base_pLimL_pLimR_hLjava/awt/Point;_ml_vpLfr/orsay/lri/varna/VARNAPanel;F(DDDDLjava/awt/Point;Ljava/awt/Point;Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V           " LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/models/VARNAEdits$HelixRotateEdit;deltabasepLimLpLimRhmlvpundo Exceptions1$javax/swing/undo/CannotUndoException 354fr/orsay/lri/varna/VARNAPanel 67 getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; 9;:fr/orsay/lri/varna/views/VueUI <=UIRotateEverything'(DDDDLjava/awt/Point;Ljava/awt/Point;)V 3? @repaintredoC$javax/swing/undo/CannotRedoExceptioncanUndo()ZcanRedogetPresentationName()Ljava/lang/String;Jjava/lang/StringBuilderLHelix # IN O(Ljava/lang/String;)V IQ RSappend-(Ljava/lang/Object;)Ljava/lang/StringBuilder;U rotated angle: IW RX-(Ljava/lang/String;)Ljava/lang/StringBuilder; IZ R[(D)Ljava/lang/StringBuilder; I] ^HtoStringaddEdit"(Ljavax/swing/undo/UndoableEdit;)Z bdcjava/awt/Point efequals(Ljava/lang/Object;)Z@!TD-@ !TD- lnmjava/lang/Math opabs(D)D?!TD-anEditLjavax/swing/undo/UndoableEdit;etotAngle SourceFileVARNAEdits.java InnerClasses{$fr/orsay/lri/varna/models/VARNAEditsHelixRotateEdit!     -**'*)*** * * !#& VX YZ[\ ]&^,_$R-%&-'-(-)-*-+ -, -- ./0] +*!2*w*****8*!>#a#b*c$ +%&A/B\ **!2******8*!>#e"f)g$ *%&DE,#h$ %&FE,#i$ %&GHJ IYKM*PTV*Y\#j$  %&_`I+C+M,*a0,*cJ )ggJ)i)kq *)#. mo pr$s't-s5u@wExG|$*I%&Ist ;u&$#vwxy z| PK 4F>޵/ff5fr/orsay/lri/varna/models/VARNAEdits$RedrawEdit.class1/fr/orsay/lri/varna/models/VARNAEdits$RedrawEdit%javax/swing/undo/AbstractUndoableEdit _prevModeI_newMode _prevFlatZ_newFlat _backupCoordsLjava/util/ArrayList; Signature5Ljava/util/ArrayList;_backupCenters_vpLfr/orsay/lri/varna/VARNAPanel;#(Lfr/orsay/lri/varna/VARNAPanel;Z)VCode fr/orsay/lri/varna/VARNAPanel getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !fr/orsay/lri/varna/models/rna/RNA   getDrawMode()I " #$(ILfr/orsay/lri/varna/VARNAPanel;Z)VLineNumberTableLocalVariableTablethis1Lfr/orsay/lri/varna/models/VARNAEdits$RedrawEdit;vpnewFlat#(ILfr/orsay/lri/varna/VARNAPanel;)V , -.getFlatExteriorLoop()ZnewMode 1 2()V4java/util/ArrayList 31 7 9  ;  =  ? A  C DEget_listeBases()Ljava/util/ArrayList; 3G HIiterator()Ljava/util/Iterator; KMLjava/util/Iterator NOnext()Ljava/lang/Object;Q(fr/orsay/lri/varna/models/rna/ModeleBaseSjava/awt/geom/Point2D$Double PU VW getCoords ()Ljava/awt/geom/Point2D$Double; RY Z[xD R] ^[y R` a(DD)V 3c deadd(Ljava/lang/Object;)Z Pg hW getCenter Kj k.hasNext  n mb*Lfr/orsay/lri/varna/models/rna/ModeleBase;undo Exceptionst$javax/swing/undo/CannotUndoException v wxsetFlatExteriorLoop(Z)V z {| setDrawMode(I)V 3~ get(I)Ljava/lang/Object;  setCoord"(ILjava/awt/geom/Point2D$Double;)V   setCenter 3 size  2repaintr#Lfr/orsay/lri/varna/models/rna/RNA;indexoldCoordLjava/awt/geom/Point2D$Double; oldCenterredo$javax/swing/undo/CannotRedoException   getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig;  drawRNA+(ILfr/orsay/lri/varna/models/VARNAConfig;)V 6fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm 2printStackTracee8Lfr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm;canUndocanRedogetPresentationName()Ljava/lang/String;Redraw whole RNAaddEdit"(Ljavax/swing/undo/UndoableEdit;)ZanEditLjavax/swing/undo/UndoableEdit; SourceFileVARNAEdits.java InnerClasses$fr/orsay/lri/varna/models/VARNAEdits RedrawEditjava/awt/geom/Point2DDouble!       P*++!$ ; <% &'() *M *,,+!$ @ A%  &' / (#(*0*3Y56*3Y58*,:*<*>**:+@*:BF:MJP:*6RYTXT\_bW*8RYfXf\_bWi**:lm$6 C45EF$G)H4IRKqLINO%4&'/() R>opq2rsb*:L*:*@u+*my=,*6}RN*8}R:+-+*:B*:$. QRST V,W9X?YFTZ[a\%4b&'Z=,9 2r0*:*>u*:*<*:L+*: #$_ `#a$b(d/e%0&'$.,$f% &'.,$g% &'-$h% &'6$k%&' R PK 4F>vn((7fr/orsay/lri/varna/models/VARNAEdits$RemoveBPEdit.class1`1fr/orsay/lri/varna/models/VARNAEdits$RemoveBPEdit%javax/swing/undo/AbstractUndoableEdit_msbp-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;_iI_j_vpLfr/orsay/lri/varna/VARNAPanel;Q(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V        LineNumberTableLocalVariableTablethis3Lfr/orsay/lri/varna/models/VARNAEdits$RemoveBPEdit;ijmsbpvpundo Exceptions%$javax/swing/undo/CannotUndoException ')(fr/orsay/lri/varna/VARNAPanel *+getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; -/.!fr/orsay/lri/varna/models/rna/RNA 01addBPToStructure2(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V '3 4repaintredo7$javax/swing/undo/CannotRedoException -9 :;removeBP0(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)VcanUndo()ZcanRedogetPresentationName()Ljava/lang/String;Bjava/lang/StringBuilderD Remove BP ( AF G(Ljava/lang/String;)V AI JKappend(I)Ljava/lang/StringBuilder;M, AO JP-(Ljava/lang/String;)Ljava/lang/StringBuilder;R) AT U@toStringaddEdit"(Ljavax/swing/undo/UndoableEdit;)ZanEditLjavax/swing/undo/UndoableEdit; SourceFileVARNAEdits.java InnerClasses^$fr/orsay/lri/varna/models/VARNAEdits RemoveBPEdit!   **-*** 4 ! "#$P*&***,*2 5#6H*&*8*2 <=, >=, ?@O%AYCE*HLN*HQNS %VW6XYZ[\ ]_ PK 4F>-}}8fr/orsay/lri/varna/models/VARNAEdits$RotateRNAEdit.class1[2fr/orsay/lri/varna/models/VARNAEdits$RotateRNAEdit%javax/swing/undo/AbstractUndoableEdit_angleD_vpLfr/orsay/lri/varna/VARNAPanel;#(DLfr/orsay/lri/varna/VARNAPanel;)VCode  ()V    LineNumberTableLocalVariableTablethis4Lfr/orsay/lri/varna/models/VARNAEdits$RotateRNAEdit;anglevpundo Exceptions$javax/swing/undo/CannotUndoException  fr/orsay/lri/varna/VARNAPanel !"getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; $&%java/lang/Double '(valueOf(D)Ljava/lang/Double; *,+!fr/orsay/lri/varna/models/rna/RNA -.globalRotation(Ljava/lang/Double;)V 0 1repaintredo4$javax/swing/undo/CannotRedoExceptioncanUndo()ZcanRedogetPresentationName()Ljava/lang/String;;java/lang/StringBuilder=Rotate RNA angle: :? @(Ljava/lang/String;)V :B CDappend(D)Ljava/lang/StringBuilder; :F G9toStringaddEdit"(Ljavax/swing/undo/UndoableEdit;)Z KMLjava/lang/Math NOabs(D)D@>anEditLjavax/swing/undo/UndoableEdit;e SourceFileVARNAEdits.java InnerClassesY$fr/orsay/lri/varna/models/VARNAEdits RotateRNAEdit!  Y* *'*-   L**w#)*/ 23 K**#)*/ 56 , 76 , 89 >:Y<>*AE HI 0+*+M*,cJP*Y,c!# $&,'.* 00RS "TUVW XZ PK 4F>") =fr/orsay/lri/varna/models/VARNAEdits$SingleBaseMoveEdit.class17fr/orsay/lri/varna/models/VARNAEdits$SingleBaseMoveEdit%javax/swing/undo/AbstractUndoableEdit_indexI_oxD_oy_nx_ny_vpLfr/orsay/lri/varna/VARNAPanel;%(IDDLfr/orsay/lri/varna/VARNAPanel;)VCode  ()V   fr/orsay/lri/varna/VARNAPanel getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !fr/orsay/lri/varna/models/rna/RNA ! getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; #%$(fr/orsay/lri/varna/models/rna/ModeleBase &' getCoords ()Ljava/awt/geom/Point2D$Double; )+*java/awt/geom/Point2D$Double ,x .  )0 1y 3  5  7  9 LineNumberTableLocalVariableTablethis9Lfr/orsay/lri/varna/models/VARNAEdits$SingleBaseMoveEdit;indexnxnypmb*Lfr/orsay/lri/varna/models/rna/ModeleBase;undo ExceptionsG$javax/swing/undo/CannotUndoException )I J(DD)V L MNsetCoord"(ILjava/awt/geom/Point2D$Double;)V P QrepaintredoT$javax/swing/undo/CannotRedoExceptioncanUndo()ZcanRedogetPresentationName()Ljava/lang/String;[java/lang/StringBuilder]Base # Z_ `(Ljava/lang/String;)V Zb cdappend(I)Ljava/lang/StringBuilder;f moved Zh ci-(Ljava/lang/String;)Ljava/lang/StringBuilder; Zk lYtoStringaddEdit"(Ljavax/swing/undo/UndoableEdit;)Z )p qrequals(Ljava/lang/Object;)Z )t uvdistance(Ljava/awt/geom/Point2D;)D@KanEditLjavax/swing/undo/UndoableEdit;epo1Ljava/awt/geom/Point2D$Double;pn1po2pn2 SourceFileVARNAEdits.java InnerClasses$fr/orsay/lri/varna/models/VARNAEditsSingleBaseMoveEditjava/awt/geom/Point2DDouble!    >**:*"(-*"/2*(4*6*8:&   ,17=;>><=>>>?>@>A *BCDEFW%*8*)Y*-*2HK*8O:$; %<=RESW%*8*)Y*4*6HK*8O:$; %<=UV,:; <=WV,:; <=XYCZY\^*aegj:; <=mn++M,*o)Y*-*2HN)Y*4*6H:)Y,-,2H:)Y,4,6H:o"-sw*,44*,66:2  '8IZqy;H<=yz w{='\|}8K~}I:}Z)} ) PK 4F>9j*fr/orsay/lri/varna/models/VARNAEdits.class1.$fr/orsay/lri/varna/models/VARNAEditsjava/lang/Object MAX_DISTANCED ConstantValue@K()VCode  LineNumberTableLocalVariableTablethis&Lfr/orsay/lri/varna/models/VARNAEdits; SourceFileVARNAEdits.java InnerClasses.fr/orsay/lri/varna/models/VARNAEdits$AddBPEdit AddBPEdit3fr/orsay/lri/varna/models/VARNAEdits$BasesShiftEditBasesShiftEdit2fr/orsay/lri/varna/models/VARNAEdits$HelixFlipEdit HelixFlipEdit 4fr/orsay/lri/varna/models/VARNAEdits$HelixRotateEditHelixRotateEdit#/fr/orsay/lri/varna/models/VARNAEdits$RedrawEdit RedrawEdit&1fr/orsay/lri/varna/models/VARNAEdits$RemoveBPEdit RemoveBPEdit)2fr/orsay/lri/varna/models/VARNAEdits$RotateRNAEdit RotateRNAEdit,7fr/orsay/lri/varna/models/VARNAEdits$SingleBaseMoveEditSingleBaseMoveEdit!  /*  B   ! "$ %' (* +- PK )~*>vb)))fr/orsay/lri/varna/models/VARNAEdits.javapackage fr.orsay.lri.varna.models; import java.awt.Point; import java.awt.geom.Point2D; import java.util.ArrayList; import javax.swing.undo.AbstractUndoableEdit; import javax.swing.undo.CannotRedoException; import javax.swing.undo.CannotUndoException; import javax.swing.undo.UndoableEdit; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.applications.templateEditor.GraphicalTemplateElement; import fr.orsay.lri.varna.applications.templateEditor.TemplatePanel; import fr.orsay.lri.varna.applications.templateEditor.TemplateEdits.ElementEdgeMoveTemplateEdit; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; public class VARNAEdits { public static final double MAX_DISTANCE= 55.0; public static class BasesShiftEdit extends AbstractUndoableEdit { private ArrayList _indices; private double _dx; private double _dy; private VARNAPanel _vp; public BasesShiftEdit(ArrayList indices, double dx, double dy, VARNAPanel p) { _indices = indices; _dx = dx; _dy = dy; _vp = p; } public void undo() throws CannotUndoException { for (int index: _indices) { ModeleBase mb = _vp.getRNA().getBaseAt(index); _vp.getRNA().setCoord(index,new Point2D.Double(mb.getCoords().x-_dx,mb.getCoords().y-_dy)); _vp.getRNA().setCenter(index,new Point2D.Double(mb.getCenter().x-_dx,mb.getCenter().y-_dy)); } _vp.repaint(); } public void redo() throws CannotRedoException { for (int index: _indices) { ModeleBase mb = _vp.getRNA().getBaseAt(index); _vp.getRNA().setCoord(index,new Point2D.Double(mb.getCoords().x+_dx,mb.getCoords().y+_dy)); _vp.getRNA().setCenter(index,new Point2D.Double(mb.getCenter().x-_dx,mb.getCenter().y-_dy)); } _vp.repaint(); } public boolean canUndo() { return true; } public boolean canRedo() { return true; } public String getPresentationName() { return "Base #"+_indices+" shifted"; } public boolean addEdit(UndoableEdit anEdit) { if (anEdit instanceof BasesShiftEdit) { BasesShiftEdit e = (BasesShiftEdit) anEdit; if (e._indices.equals(_indices)) { Point2D.Double tot = new Point2D.Double(_dx+e._dx,_dy+e._dy); if (tot.distance(0.0, 0.0)Math.PI) { totAngle -= 2.0*Math.PI; } if (Math.abs(totAngle) _backupCoords = new ArrayList(); private ArrayList _backupCenters = new ArrayList(); private VARNAPanel _vp; public RedrawEdit(VARNAPanel vp,boolean newFlat) { this(vp.getRNA().getDrawMode(),vp,newFlat); } public RedrawEdit(int newMode, VARNAPanel vp) { this(newMode,vp,vp.getFlatExteriorLoop()); } public RedrawEdit(int newMode, VARNAPanel vp, boolean newFlat) { _vp = vp; _newMode = newMode; _newFlat = newFlat; _prevFlat = _vp.getFlatExteriorLoop(); for (ModeleBase mb: _vp.getRNA().get_listeBases()) { _backupCoords.add(new Point2D.Double(mb.getCoords().x,mb.getCoords().y)); _backupCenters.add(new Point2D.Double(mb.getCenter().x,mb.getCenter().y)); } _prevMode = _vp.getDrawMode(); } public void undo() throws CannotUndoException { RNA r = _vp.getRNA(); _vp.setFlatExteriorLoop(_prevFlat); r.setDrawMode(_prevMode); for (int index =0;index<_vp.getRNA().get_listeBases().size();index++) { Point2D.Double oldCoord = _backupCoords.get(index); Point2D.Double oldCenter = _backupCenters.get(index); r.setCoord(index, oldCoord); r.setCenter(index, oldCenter); } _vp.repaint(); } public void redo() throws CannotRedoException { try { _vp.setFlatExteriorLoop(_newFlat); _vp.getRNA().drawRNA(_newMode,_vp.getConfig()); } catch (ExceptionNAViewAlgorithm e) { e.printStackTrace(); } _vp.repaint(); } public boolean canUndo() { return true; } public boolean canRedo() { return true; } public String getPresentationName() { return "Redraw whole RNA";} public boolean addEdit(UndoableEdit anEdit) { return false; } }; } PK 4F>Y4fr/orsay/lri/varna/models/VARNAConfig$BP_STYLE.class1W.fr/orsay/lri/varna/models/VARNAConfig$BP_STYLEjava/lang/Enumjava/io/Serializable BP_STYLE_LW0Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;BP_STYLE_SIMPLEBP_STYLE_RNAVIZ BP_STYLE_NONE<$SWITCH_TABLE$fr$orsay$lri$varna$models$VARNAConfig$BP_STYLE[I ENUM$VALUES1[Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;()VCode  (Ljava/lang/String;I)V       "  $ LineNumberTableLocalVariableTable thistoString()Ljava/lang/String; , -()[I / 01ordinal()I3Leontis/Westhof5Simple (Straight line)7RNAViz (Single dot)9None ; )*values3()[Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; ?A@java/lang/System BC arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfD(Ljava/lang/String;)Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; G DH5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; J L <=Njava/lang/NoSuchFieldError SourceFileVARNAConfig.java SignatureXLjava/lang/Enum;Ljava/io/Serializable; InnerClassesU%fr/orsay/lri/varna/models/VARNAConfigBP_STYLE@1@@ @ @  xTYYYY !YSYSYSY!S#% 443&1*+'%3& ()*w9+*.., #&)2468*:%6(8+:.<1>4@& 9( <=6#YK*Y<YM>,%& DE* *F%& -JIYWK K*.OW*!.OW*.OW*.OW*YIM&)M*36M7@CM%3&OPQRS TV@PK 4F>;rDD+fr/orsay/lri/varna/models/VARNAConfig.class1%fr/orsay/lri/varna/models/VARNAConfigjava/lang/Objectjava/io/Serializablejava/lang/CloneableserialVersionUIDJ ConstantValue'&É MAJOR_VERSIONI MINOR_VERSIONMAX_ZOOMD@NMIN_ZOOM? DEFAULT_ZOOM? MAX_AMOUNT@ MIN_AMOUNT?(\)DEFAULT_AMOUNT?333333DEFAULT_BP_THICKNESSDEFAULT_DIST_NUMBERS@DEFAULT_PERIOD DEFAULT_TITLE_COLORLjava/awt/Color;DEFAULT_BACKBONE_COLORDEFAULT_BOND_COLORDEFAULT_SPECIAL_BASE_COLORDEFAULT_DASH_BASE_COLORDEFAULT_BASE_OUTLINE_THICKNESS?BASE_OUTLINE_COLOR_DEFAULTBASE_INNER_COLOR_DEFAULTBASE_NUMBER_COLOR_DEFAULTBASE_NAME_COLOR_DEFAULTDEFAULT_BACKGROUND_COLORDEFAULT_TITLE_FONTLjava/awt/Font;DEFAULT_BASE_FONTDEFAULT_NUMBERS_FONTDEFAULT_BP_STYLE0Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;DEFAULT_COLOR_MAP.Lfr/orsay/lri/varna/models/rna/ModeleColorMap;DEFAULT_COLOR_MAP_OUTLINEDEFAULT_BP_INCREMENT?DEFAULT_COLOR_MAP_WIDTHDEFAULT_COLOR_MAP_HEIGHTDEFAULT_COLOR_MAP_X_OFFSETDEFAULT_COLOR_MAP_Y_OFFSETDEFAULT_COLOR_MAP_STRIPE_WIDTHDEFAULT_COLOR_MAP_FONT_SIZEDEFAULT_COLOR_MAP_FONT_COLOR_colorMapHeight_colorMapWidth_colorMapXOffset_colorMapYOffset _mainBPStyle_zoom _zoomAmount _bpThickness_baseThickness_backboneColor _drawBackboneZ_backgroundColor_drawBackground _bondColor _titleColor_specialBasesColor_dashBasesColor _titleFont _numbersFont_fontBasesGeneral_titleLjava/lang/String; _numPeriod_drawOutlineBase _fillBase_autoFit _autoCenter _modifiable _errorsOn_colorSpecialBases_colorDashBases_useBaseColorsForBPs_drawnNonCanonicalBP_drawnNonPlanarBP _showWarnings_comparisonMode_flatExteriorLoop _distNumbers_cm_colorMapCaption _drawColorMap()VCode {}|java/awt/Color ~-black  ,- { - DARK_GRAY { brighter()Ljava/awt/Color;  .- { -blue  /- { -green  0- { -yellow  1-  5- { (III)V  6-  7-  8- { -WHITE  9- java/awt/Font SansSerif (Ljava/lang/String;II)V  :;  <;  =; .fr/orsay/lri/varna/models/VARNAConfig$BP_STYLE ? BP_STYLE_LW  >? ,fr/orsay/lri/varna/models/rna/ModeleColorMap defaultColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap;  @A { -gray  B-@T  F@>  G@D  H  I  J  K { darker  L-LineNumberTableLocalVariableTable  x  M  N  O  P  Q?  R  S  T  U  V-  WX  Y-  ZX  [-  \-  ]-  ^-  _;  `;  a;  bc  d  eX  fX  gX  hX  iX  jX ! kX # lX % mX ' nX ) oX + pX - qX / rX 1 s 3 tA 5 uc 7 vXthis'Lfr/orsay/lri/varna/models/VARNAConfig; getFullName()Ljava/lang/String;= VARNA 3.8clone)()Lfr/orsay/lri/varna/models/VARNAConfig;Ajava/io/ByteArrayOutputStream @Djava/io/ObjectOutputStream CF G(Ljava/io/OutputStream;)V CI JK writeObject(Ljava/lang/Object;)VMjava/io/ObjectInputStreamOjava/io/ByteArrayInputStream @Q RS toByteArray()[B NU V([B)V LX Y(Ljava/io/InputStream;)V L[ \] readObject()Ljava/lang/Object;_java/lang/RuntimeExceptionajava/lang/StringBuilderccannot clone class [ `e f(Ljava/lang/String;)V h ijgetClass()Ljava/lang/Class; lnmjava/lang/Class o;getName `q rsappend-(Ljava/lang/String;)Ljava/lang/StringBuilder;u] via serialization: wyxjava/lang/Exception z;toString `y ^eoutLjava/io/ByteArrayOutputStream;ooutLjava/io/ObjectOutputStream;inLjava/io/ObjectInputStream;eLjava/lang/Exception; Exceptions$java/lang/CloneNotSupportedException  >? SourceFileVARNAConfig.java InnerClassesBP_STYLE!M           !# $& ' (* +,-.-/-0-1-2 35-6-7-8-9-:;<;=;>?@AB-C D F G H I J K L-MNOPQ?RSTUV-WXY-ZX[-\-]-^-_;`;a;bcdeXfXgXhXiXjXkXlXmXnXoXpXqXrXstAucvXwxyAz{YzYYYIJƳ˳ϳӳ۲ƶݳjSTUVW'Y0ZC[I\O^U_d`sayb|acefijklmnoxy**ѵ*͵*յ*׵***$**3********** * ** ******* *"*$*&*(***,*.*(0*ĵ2*4*6*w xyz }',38?FKRW^elsz 89 :;y$<,>?y^@YBLCY+EM,*HLYNY+PTWN-ZL^Y`Ybd*gkptp+vp{|01w2 %)12@PZ4^89)}~ )2,A>]y%* @PK .<>,00*fr/orsay/lri/varna/models/VARNAConfig.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models; import java.awt.Color; import java.awt.Font; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import fr.orsay.lri.varna.models.rna.ModeleColorMap; public class VARNAConfig implements Serializable, Cloneable { /** * */ private static final long serialVersionUID = 2853916694420964233L; /** * */ public static final int MAJOR_VERSION = 3; public static final int MINOR_VERSION = 8; public static String getFullName() { return "VARNA "+MAJOR_VERSION+"."+MINOR_VERSION; } /** * Enum types and internal classes */ public enum BP_STYLE implements Serializable { BP_STYLE_LW, BP_STYLE_SIMPLE, BP_STYLE_RNAVIZ, BP_STYLE_NONE; public String toString() { switch (this) { case BP_STYLE_LW: return "Leontis/Westhof"; case BP_STYLE_SIMPLE: return "Simple (Straight line)"; case BP_STYLE_RNAVIZ: return "RNAViz (Single dot)"; case BP_STYLE_NONE: return "None"; } return super.toString(); } }; /** * Default values for config options */ public static final double MAX_ZOOM = 60; public static final double MIN_ZOOM = 0.5; public static final double DEFAULT_ZOOM = 1; public static final double MAX_AMOUNT = 2; public static final double MIN_AMOUNT = 1.01; public static final double DEFAULT_AMOUNT = 1.2; public static final double DEFAULT_BP_THICKNESS = 1.0; public static final double DEFAULT_DIST_NUMBERS = 3.0; public static final int DEFAULT_PERIOD = 10; public static final Color DEFAULT_TITLE_COLOR = Color.black; public static final Color DEFAULT_BACKBONE_COLOR = Color.DARK_GRAY.brighter(); public static final Color DEFAULT_BOND_COLOR = Color.blue; public static final Color DEFAULT_SPECIAL_BASE_COLOR = Color.green.brighter(); public static final Color DEFAULT_DASH_BASE_COLOR = Color.yellow.brighter(); public static final double DEFAULT_BASE_OUTLINE_THICKNESS = 1.5; public static final Color BASE_OUTLINE_COLOR_DEFAULT = Color.DARK_GRAY.brighter(); public static final Color BASE_INNER_COLOR_DEFAULT = new Color(242, 242,242); public static final Color BASE_NUMBER_COLOR_DEFAULT = Color.DARK_GRAY; public static final Color BASE_NAME_COLOR_DEFAULT = Color.black; public static final Color DEFAULT_BACKGROUND_COLOR = Color.WHITE; public static final Font DEFAULT_TITLE_FONT = new Font("SansSerif", Font.BOLD,18); public static final Font DEFAULT_BASE_FONT = new Font("SansSerif", Font.PLAIN, 18); public static final Font DEFAULT_NUMBERS_FONT = new Font("SansSerif", Font.BOLD, 18); public static final BP_STYLE DEFAULT_BP_STYLE = BP_STYLE.BP_STYLE_LW; public static final ModeleColorMap DEFAULT_COLOR_MAP = ModeleColorMap.defaultColorMap(); public static final Color DEFAULT_COLOR_MAP_OUTLINE = Color.gray; public static final double DEFAULT_BP_INCREMENT = 0.65; public static double DEFAULT_COLOR_MAP_WIDTH = 80; public static double DEFAULT_COLOR_MAP_HEIGHT = 30; public static double DEFAULT_COLOR_MAP_X_OFFSET = 40; public static double DEFAULT_COLOR_MAP_Y_OFFSET = 0; public static int DEFAULT_COLOR_MAP_STRIPE_WIDTH = 3; public static int DEFAULT_COLOR_MAP_FONT_SIZE = 20; public static Color DEFAULT_COLOR_MAP_FONT_COLOR = Color.gray.darker(); /** * Various options. */ public double _colorMapHeight = DEFAULT_COLOR_MAP_HEIGHT; public double _colorMapWidth = DEFAULT_COLOR_MAP_WIDTH; public double _colorMapXOffset = DEFAULT_COLOR_MAP_X_OFFSET; public double _colorMapYOffset = DEFAULT_COLOR_MAP_Y_OFFSET; public BP_STYLE _mainBPStyle = DEFAULT_BP_STYLE; public double _zoom = DEFAULT_ZOOM; public double _zoomAmount = DEFAULT_AMOUNT; public double _bpThickness = 1.0; public double _baseThickness = DEFAULT_BASE_OUTLINE_THICKNESS; public Color _backboneColor = DEFAULT_BACKBONE_COLOR; public boolean _drawBackbone = true; public Color _backgroundColor = DEFAULT_BACKGROUND_COLOR; public boolean _drawBackground = false; public Color _bondColor = DEFAULT_BOND_COLOR; public Color _titleColor = DEFAULT_TITLE_COLOR; public Color _specialBasesColor = DEFAULT_SPECIAL_BASE_COLOR; public Color _dashBasesColor = DEFAULT_DASH_BASE_COLOR; public Font _titleFont = DEFAULT_TITLE_FONT; public Font _numbersFont = DEFAULT_NUMBERS_FONT; public Font _fontBasesGeneral = DEFAULT_BASE_FONT; public String _title = ""; public int _numPeriod = DEFAULT_PERIOD; public boolean _drawOutlineBase = true; public boolean _fillBase = true; public boolean _autoFit = true; public boolean _autoCenter = true; public boolean _modifiable = true; public boolean _errorsOn = false; public boolean _colorSpecialBases = false; public boolean _colorDashBases = false; public boolean _useBaseColorsForBPs = false; public boolean _drawnNonCanonicalBP = true; public boolean _drawnNonPlanarBP = true; public boolean _showWarnings = false; public boolean _comparisonMode = false; public boolean _flatExteriorLoop = false; // Relative distance between the center of a base and its number, expressed as a multiple of base radius public double _distNumbers = DEFAULT_DIST_NUMBERS; public ModeleColorMap _cm = DEFAULT_COLOR_MAP; public String _colorMapCaption = ""; public boolean _drawColorMap = false; public VARNAConfig clone () { try { ByteArrayOutputStream out = new ByteArrayOutputStream (); ObjectOutputStream oout = new ObjectOutputStream (out); oout.writeObject (this); ObjectInputStream in = new ObjectInputStream ( new ByteArrayInputStream (out.toByteArray ())); return (VARNAConfig)in.readObject (); } catch (Exception e) { throw new RuntimeException ("cannot clone class [" + this.getClass ().getName () + "] via serialization: " + e.toString ()); } } } PK 4F>8 8 0fr/orsay/lri/varna/models/CubicBezierCurve.class1*fr/orsay/lri/varna/models/CubicBezierCurvejava/lang/ObjectP0Ljava/awt/geom/Point2D$Double;P1P2P3nIpoints[Ljava/awt/geom/Point2D$Double;lengths[D unitVectorsgetN()ICode  LineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/models/CubicBezierCurve;getApproxCurveLength()D   standardParam!(D)Ljava/awt/geom/Point2D$Double;@ #%$java/lang/Math &'pow(DD)D )  +-,java/awt/geom/Point2D$Double ./xD@ 3  5  7  +9 :/y +< =>(DD)Vt uniformParam#([D)[Ljava/awt/geom/Point2D$Double;C"java/lang/IllegalArgumentExceptionEjava/lang/StringBuilderG element t[ DI =J(Ljava/lang/String;)V DL MNappend(I)Ljava/lang/StringBuilder;P'] is not in [0, getApproxCurveLength()] DR MS-(Ljava/lang/String;)Ljava/lang/StringBuilder; DU VWtoString()Ljava/lang/String; BI Z \  mresultlinei lengthOnLine|(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;I)V d =e()Vgn must be at least 1 i je computeData l  n op lineLength?(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)Dksumldxdy +w xydistance(Ljava/awt/geom/Point2D;)DgetP0 ()Ljava/awt/geom/Point2D$Double;getP1getP2getP3 SourceFileCubicBezierCurve.java InnerClassesjava/awt/geom/Point2DDouble!    /*! 6 **d1)  $'g "*(*k 'g0"k'k*2*kc 'gk'k'k*4*kc''k'k*6*kcJ'g "*(8k 'g0"k'k*28kc 'gk'k'k*48kc''k'k*68kc9+Y);>JK(J)L<J=MJJLN]OtNuPNQNR*?/LX./ :/@Aq +=+N66**1+1* +1!BYDYFHKOQTX+1*d1g9*Y2**[2*kc9*Y28*[28kc9 -+Y ;SV-:jkl mon,q>u\xuyz{m}\ ?] ^  _ ` uCa/)./:/ =b4*c*+(*,2*-4*6* BYfX*h*  %/3>44444 4 je^ **`+Y<*Y**okS*****+[H>k**Y2*Y`2m9*Y`2**Y2*go9*Y`28*Y28go9*[+Y;S'cH*'R*B $/9DFK_yH q Fvr/Hs` _Qs/y7t/u/opD,+v z{/*( |{/*2 }{/*4 ~{/*6  + PK oq<7S/fr/orsay/lri/varna/models/CubicBezierCurve.javapackage fr.orsay.lri.varna.models; import java.awt.geom.Point2D; /** * This class implements a cubic Bezier curve * with a constant speed parametrization. * The Bezier curve is approximated by a sequence of n straight lines, * where the n+1 points between the lines are * { B(k/n), k=0,1,...,n } where B is the standard * parametrization given here: * http://en.wikipedia.org/wiki/Bezier_curve#Cubic_B.C3.A9zier_curves * You can then use the constant speed parametrization over this sequence * of straight lines. * * @author Raphael Champeimont */ public class CubicBezierCurve { /** * The four points defining the curve. */ private Point2D.Double P0, P1, P2, P3; private int n; /** * The number of lines approximating the Bezier curve. */ public int getN() { return n; } /** * Get the (exact) length of the approximation curve. */ public double getApproxCurveLength() { return lengths[n-1]; } /** * The n+1 points between the n lines. */ private Point2D.Double[] points; /** * Array of length n. * lengths[i] is the sum of lengths of lines up to and including the * line starting at point points[i]. */ private double[] lengths; /** * Array of length n. * The vectors along each line, with a norm of 1. */ private Point2D.Double[] unitVectors; /** * The standard exact cubic Bezier curve parametrization. * Argument t must be in [0,1]. */ public Point2D.Double standardParam(double t) { double x = Math.pow(1-t,3) * P0.x + 3 * Math.pow(1-t,2) * t * P1.x + 3 * (1-t) * t * t * P2.x + t * t * t * P3.x; double y = Math.pow(1-t,3) * P0.y + 3 * Math.pow(1-t,2) * t * P1.y + 3 * (1-t) * t * t * P2.y + t * t * t * P3.y; return new Point2D.Double(x, y); } /** * Uniform approximated parametrization. * A value in t must be in [0, getApproxCurveLength()]. * We have built a function f such that f(t) is the position of * the point on the approximation curve (n straight lines). * The interesting property is that the length of the curve * { f(t), t in [0,l] } is exactly l. * The java function is simply the application of f over each element * of a sorted array, ie. uniformParam(t)[k] = f(t[k]). * Computation time is O(n+m) where n is the number of lines in which * the curve is divided and m is the length of the array given as an * argument. The use of a sorted array instead of m calls to the * function enables us to have a complexity of O(n+m) instead of O(n*m) * because we don't need to search in all the n possible lines for * each value in t (as we know their are in increasing order). */ public Point2D.Double[] uniformParam(double[] t) { int m = t.length; Point2D.Double[] result = new Point2D.Double[m]; int line = 0; for (int i=0; i= n || t[i] < 0) { // if line >= n // then it means that lenghts[n-1] < t[i] // which is equivalent to getApproxCurveLength() < t[i] throw (new IllegalArgumentException("element t[" + i + "] is not in [0, getApproxCurveLength()]")); } // So now we know on which line we are double lengthOnLine = t[i] - (line != 0 ? lengths[line-1] : 0); double x = points[line].x + unitVectors[line].x * lengthOnLine; double y = points[line].y + unitVectors[line].y * lengthOnLine; result[i] = new Point2D.Double(x, y); } return result; } /** * A Bezier curve can be defined by four points, * see http://en.wikipedia.org/wiki/Bezier_curve#Cubic_B.C3.A9zier_curves * Here we give this four points and a integer to say in how many * line segments we want to cut the Bezier curve (if n is bigger * the computation takes longer but the precision is better). * The number of lines must be at least 1. */ public CubicBezierCurve( Point2D.Double P0, Point2D.Double P1, Point2D.Double P2, Point2D.Double P3, int n) { this.P0 = P0; this.P1 = P1; this.P2 = P2; this.P3 = P3; this.n = n; if (n < 1) { throw (new IllegalArgumentException("n must be at least 1")); } computeData(); } private void computeData() { points = new Point2D.Double[n+1]; for (int k=0; k<=n; k++) { points[k] = standardParam(((double) k) / n); } lengths = new double[n]; unitVectors = new Point2D.Double[n]; double sum = 0; for (int i=0; i˶m(fr/orsay/lri/varna/models/BaseList.class1"fr/orsay/lri/varna/models/BaseListjava/lang/Object_basesLjava/util/ArrayList; SignatureALjava/util/ArrayList;_captionLjava/lang/String;(Ljava/lang/String;)VCode  ()Vjava/util/ArrayList     LineNumberTableLocalVariableTablethis$Lfr/orsay/lri/varna/models/BaseList;caption?(Ljava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V  !addBase-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)Vmb*Lfr/orsay/lri/varna/models/rna/ModeleBase;contains-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)Z ' $((Ljava/lang/Object;)Z getCaption()Ljava/lang/String; , -(addb removeBase 1 2(removeaddBases(Ljava/util/Collection;)VF(Ljava/util/Collection<+Lfr/orsay/lri/varna/models/rna/ModeleBase;>;)V 7 89addAll(Ljava/util/Collection;)ZmbsLjava/util/Collection;LocalVariableTypeTableCLjava/util/Collection<+Lfr/orsay/lri/varna/models/rna/ModeleBase;>;getBases()Ljava/util/ArrayList;C()Ljava/util/ArrayList;clear C AgetAverageColor'(Ljava/util/ArrayList;)Ljava/awt/Color;9(Ljava/util/ArrayList;)Ljava/awt/Color; H IJiterator()Ljava/util/Iterator; LNMjava/util/Iterator OPnext()Ljava/lang/Object;Rjava/awt/Color QT UVgetRed()I QX YVgetGreen Q[ \VgetBlue L^ _`hasNext()Z b cVsize Qe f(III)VcolsrIgcLjava/awt/Color;'Ljava/util/ArrayList;getAverageOutlineColor()Ljava/awt/Color;q(fr/orsay/lri/varna/models/rna/ModeleBase ps tu getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase; wyx-fr/orsay/lri/varna/models/rna/ModeleStyleBase zoget_base_outline_color | DEgetAverageNameColor w oget_base_name_colorgetAverageNumberColor w oget_base_number_colorgetAverageInnerColor w oget_base_inner_color getNumbersjava/lang/StringBuilder java/lang/String valueOf&(Ljava/lang/Object;)Ljava/lang/String; , append-(Ljava/lang/String;)Ljava/lang/StringBuilder; *toString  get(I)Ljava/lang/Object; p V getBaseNumber (I)Ljava/lang/StringBuilder;resulti getContents p * getContent getIndices,()Ljava/util/ArrayList; p VgetIndex java/lang/Integer (I)Ljava/lang/Integer;indices*Ljava/util/ArrayList; SourceFile BaseList.java!   U**Y*+     h**Y*+*,   "#$% = *+&  "#)* /*!  ! B *++W & '  .#/! B *+0W + ,  .#345 T *+6W 1 2  :;<  :=>?@ /*6 A 6*B ;<  DEF d<=>*G:'KQ:S`<W`=Z`>]*a*al<*al=*al>QYd. @AC#D+E3A=GDIKJRKYM4dgbhi`ji^.ikl< dgmno 7YL*GN-KpM+,rv+W-]+{RST)S2U 7/g "#< /gm}o 7YL*GN-KpM+,r~+W-]+{Z[\)[2] 7/g "#< /gmo 7YL*GN-KpM+,r+W-]+{bcd)c2e 7/g "#< /gmo 7YL*GN-KpM+,r+W-]+{jkl)k2m 7/g "#< /gm* aL=@Y+L*pNY+-L*aY+L+& rsu v w,xBsPz_{*a^ Ki,"#* aL=@Y+L*pNY+-L*aY+L+&  ,BP_*a^ Ki,"#? 4YL*GN-KpM+,+W-]+)2 4, "#< ,PK nq _bases = new ArrayList(); private String _caption; public BaseList( String caption) { _caption = caption; } public BaseList( String caption, ModeleBase mb) { _caption = caption; addBase(mb); } public boolean contains(ModeleBase mb) { return _bases.contains(mb); } public String getCaption() { return _caption; } public void addBase(ModeleBase b) { _bases.add(b); } public void removeBase(ModeleBase b) { _bases.remove(b); } public void addBases(Collection mbs) { _bases.addAll(mbs); } public ArrayList getBases() { return _bases; } public void clear() { _bases.clear(); } public static Color getAverageColor(ArrayList cols) { int r=0,g=0,b=0; for (Color c : cols) { r += c.getRed(); g += c.getGreen(); b += c.getBlue(); } if (cols.size()>0) { r /= cols.size(); g /= cols.size(); b /= cols.size(); } return new Color(r,g,b); } public Color getAverageOutlineColor() { ArrayList cols = new ArrayList(); for (ModeleBase mb : _bases) { cols.add(mb.getStyleBase().get_base_outline_color()); } return getAverageColor(cols); } public Color getAverageNameColor() { ArrayList cols = new ArrayList(); for (ModeleBase mb : _bases) { cols.add(mb.getStyleBase().get_base_name_color()); } return getAverageColor(cols); } public Color getAverageNumberColor() { ArrayList cols = new ArrayList(); for (ModeleBase mb : _bases) { cols.add(mb.getStyleBase().get_base_number_color()); } return getAverageColor(cols); } public Color getAverageInnerColor() { ArrayList cols = new ArrayList(); for (ModeleBase mb : _bases) { cols.add(mb.getStyleBase().get_base_inner_color()); } return getAverageColor(cols); } public String getNumbers() { String result = ""; for (int i=0; i<_bases.size();i++) { if (i>0) {result += ",";} ModeleBase mb = _bases.get(i); result += "" + mb.getBaseNumber(); } result += ""; return result; } public String getContents() { String result = ""; for (int i=0; i<_bases.size();i++) { if (i>0) {result += ",";} ModeleBase mb = _bases.get(i); result += mb.getContent(); } result += ""; return result; } public ArrayList getIndices() { ArrayList indices = new ArrayList(); for (ModeleBase mb : _bases) { indices.add(mb.getIndex()); } return indices; } } PK 4F>&fr/orsay/lri/varna/models/annotations/PK 4F>!"$"$Efr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation.class1j?fr/orsay/lri/varna/models/annotations/HighlightRegionAnnotationjava/lang/Objectjava/io/SerializableserialVersionUIDJ ConstantValuebZ!SDEFAULT_OUTLINE_COLORLjava/awt/Color;DEFAULT_FILL_COLORDEFAULT_RADIUSD@0_basesLjava/util/ArrayList; SignatureALjava/util/ArrayList; _outlineColor _fillColor_radiusNUM_STEPS_ROUNDED_CORNERSI ()VCode!#6ed86e #%$java/awt/Color &'decode$(Ljava/lang/String;)Ljava/awt/Color; ) +#bcffdd -  LineNumberTableLocalVariableTable((Lfr/orsay/lri/varna/models/rna/RNA;II)V 354!fr/orsay/lri/varna/models/rna/RNA 67getBasesBetween(II)Ljava/util/ArrayList; 9 0:(Ljava/util/ArrayList;)VthisALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;r#Lfr/orsay/lri/varna/models/rna/RNA; startIndex stopIndexD(Ljava/util/ArrayList;)V C 0D9(Ljava/util/ArrayList;Ljava/awt/Color;Ljava/awt/Color;D)VbLocalVariableTypeTablee(Ljava/util/ArrayList;Ljava/awt/Color;Ljava/awt/Color;D)V I 0 K  M  O  Q filloutlineradiuscloneC()Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation; getMinIndex()I []\java/util/ArrayList ^_iterator()Ljava/util/Iterator; acbjava/util/Iterator denext()Ljava/lang/Object;g(fr/orsay/lri/varna/models/rna/ModeleBase fi jXgetIndex lnmjava/lang/Math opmin(II)I ar sthasNext()Zmb*Lfr/orsay/lri/varna/models/rna/ModeleBase; getMaxIndex lz {pmaxsetOutlineColor(Ljava/awt/Color;)VcgetBases()Ljava/util/ArrayList;C()Ljava/util/ArrayList;setBases setFillColor getFillColor()Ljava/awt/Color;getOutlineColor getRadius()D setRadius(D)VvgetShape\([Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;D)Ljava/awt/geom/GeneralPath;java/awt/geom/GeneralPath Ijava/util/LinkedList I   [ Xsize [ get(I)Ljava/lang/Object; 3 testDirectionality](Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)Z java/awt/geom/Point2D$Double distance(Ljava/awt/geom/Point2D;)D x y 0(DD)V@ !TD-@& l cos(D)D l sin  addLast(Ljava/lang/Object;)V@ egetLast egetFirst addFirst moveTo(FF)V lineTo  closePath realCoords[Ljava/awt/geom/Point2D$Double; realCenters scaleFactorpLjava/awt/geom/GeneralPath; pointListLjava/util/LinkedList;isDirectZjp1Ljava/awt/geom/Point2D$Double;p2p3point centerBckdistvnkanglenvn interForwardij1j0j2p0dist1v1vn1dist2v2vn2hnnormnnormFnnormB interBackwardprev1prev26Ljava/util/LinkedList;parseHighlightRegionAnnotationt(Ljava/lang/String;Lfr/orsay/lri/varna/VARNAPanel;)Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;:  java/lang/String   split'(Ljava/lang/String;)[Ljava/lang/String; - java/lang/Integer parseInt(Ljava/lang/String;)I fr/orsay/lri/varna/VARNAPanel getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; 3 getIndexFromBaseNumber(I)I,!= # $% toLowerCase()Ljava/lang/String;R ( )*equals(Ljava/lang/Object;)Z ,.-+fr/orsay/lri/varna/models/VARNAConfigLoader /0 getSafeColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color;ST 465java/lang/Double 78 parseDouble(Ljava/lang/String;)D:java/lang/ExceptiontxtLjava/lang/String;vpLfr/orsay/lri/varna/VARNAPanel;parts[Ljava/lang/String;coordsfromtobasesoptionsdatalhsrhstoStringKjava/lang/StringBuilderMHighlighted region JO 0P(Ljava/lang/String;)V R WX JT UVappend(I)Ljava/lang/StringBuilder; JX UY-(Ljava/lang/String;)Ljava/lang/StringBuilder; [ wX J] I%result Exceptionsa$java/lang/CloneNotSupportedException c UV SourceFileHighlightRegionAnnotation.java InnerClasseshjava/awt/geom/Point2DDouble!         9 "(*",./01W *+28. ! "/* ;< => ? @0:AY*+,(B. &'/;<EF E0DG/*H*(J*,L*N*+P*,L*-J*N.& * ,-#.(/.0/4/;</E/R /S /TF /EUVBY*P*L*J*NB.4/ ;<WXz,Y<*PZN-`fM,hk<-q.9:<!:*>/ ,;<)o uvwXz,x<*PZN-`fM,hy<-q.CDF!D*H/ ,;<){ uv|}>*+J. NO/;<~ /*P.S/ ;<:AP*+P. XY/;<EF E}>*+L. ]^/;<~ /*L.b/ ;</*J.g/ ;</*N.l/ ;<>*'N. qr/;< &Y:Y:6*2*fh6+2: +`2: ,2:    6**fh6+2: ,2:   9 Y  g o  g o: 6ko9 c9Y k kcw k kc:Y )*kkc )*kkc: s6.*fh6   +d  d6  `6 + 2: + 2: + 2: 9Y go go:Yw:  9Y  go  go:Yw:YggYo9Ycoco:Y9YoYokoc999 Y )k*kkc )k*kkc:"Y  )k*kkg  )k*kkg:#Þ[:$:%"$#%c"%#$c"#ʧ""#"#ʄ**:**dfh6+2: +d2: ,2:    6***dfh6+2: ,2:   9 Y  g o  g o: 6ko9 c9Y k kcw k kc:Y )*kkc )*kkc: sÞT:6 # :҄  á.~_x yz{ }0~6>DOYiou~#(/9?P^djpv|/Vfr~ 7>HOY`gv',4l/F:;< 06 > D io u ~ y4(<:P d j p v |{g/8Vf "n# N$D%       'yl4F- F  E*M,2 N-26-26+6+6,:(: 9 +2: ,2: 6g 2 :2":2:&'+:11' +: 2'39 : : Y   BMe9T99.n"-8= B G T_er{!$),.1/;<=>?@A@B"C-8=R BS GT TD _uE@ borRF@{IG<CH<F TD I%\$JYLN*QS W*ZS\L+. ;"</$;<"^<AUe_`%*b./def gi PK >'$'$Dfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation.javapackage fr.orsay.lri.varna.models.annotations; import java.awt.Color; import java.awt.Shape; import java.awt.geom.GeneralPath; import java.awt.geom.Point2D; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurClicMovement; import fr.orsay.lri.varna.models.VARNAConfigLoader; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.views.VueHighlightRegionEdit; import fr.orsay.lri.varna.views.VueUI; public class HighlightRegionAnnotation implements Serializable { private static final long serialVersionUID = 7087014168028684775L; public static final Color DEFAULT_OUTLINE_COLOR = Color.decode("#6ed86e"); public static final Color DEFAULT_FILL_COLOR = Color.decode("#bcffdd"); public static final double DEFAULT_RADIUS = 16.0; private ArrayList _bases; private Color _outlineColor = DEFAULT_OUTLINE_COLOR; private Color _fillColor = DEFAULT_FILL_COLOR; private double _radius = DEFAULT_RADIUS; public HighlightRegionAnnotation(RNA r, int startIndex, int stopIndex) { this(r.getBasesBetween(startIndex, stopIndex)); } public HighlightRegionAnnotation(ArrayList b) { this(b,DEFAULT_FILL_COLOR,DEFAULT_OUTLINE_COLOR,DEFAULT_RADIUS); } public HighlightRegionAnnotation(ArrayList b,Color fill, Color outline, double radius) { _bases = b; _fillColor = fill; _outlineColor = outline; _radius = radius; } public HighlightRegionAnnotation clone() { return new HighlightRegionAnnotation(_bases,_fillColor,_outlineColor,_radius); } public int getMinIndex() { int min = Integer.MAX_VALUE; for (ModeleBase mb : _bases) { min = Math.min(min, mb.getIndex()); } return min; } public int getMaxIndex() { int max = Integer.MIN_VALUE; for (ModeleBase mb : _bases) { max = Math.max(max, mb.getIndex()); } return max; } public void setOutlineColor(Color c) { _outlineColor = c; } public ArrayList getBases() { return _bases; } public void setBases(ArrayList b) { _bases = b; } public void setFillColor(Color c) { _fillColor = c; } public Color getFillColor() { return _fillColor; } public Color getOutlineColor() { return _outlineColor; } public double getRadius() { return _radius; } public void setRadius(double v) { _radius = v; } public static final int NUM_STEPS_ROUNDED_CORNERS = 10; public GeneralPath getShape(Point2D.Double[] realCoords,Point2D.Double[] realCenters, double scaleFactor) { GeneralPath p = new GeneralPath(); LinkedList pointList = new LinkedList(); boolean isDirect = true; if (getBases().size()>=2) { int j = getBases().get(0).getIndex(); Point2D.Double p1 = realCoords[j]; Point2D.Double p2 = realCoords[j+1]; Point2D.Double p3 = realCenters[j]; isDirect = RNA.testDirectionality(p1, p3, p2); } if (getBases().size()>0) { int j = getBases().get(0).getIndex(); Point2D.Double point = realCoords[j]; Point2D.Double centerBck = realCenters[j]; double dist = point.distance(centerBck); Point2D.Double vn = new Point2D.Double((centerBck.x-point.x)/dist,(centerBck.y-point.y)/dist); for(int k=1;k<=NUM_STEPS_ROUNDED_CORNERS;k++) { double angle = k*Math.PI/((double)NUM_STEPS_ROUNDED_CORNERS+1); if (isDirect) angle += Math.PI; Point2D.Double nvn = new Point2D.Double(Math.cos(angle)*vn.x+Math.sin(angle)*vn.y,-Math.sin(angle)*vn.x+Math.cos(angle)*vn.y); Point2D.Double interForward = new Point2D.Double(point.x + scaleFactor *getRadius()*nvn.x, point.y + scaleFactor *getRadius()*nvn.y); pointList.addLast(interForward); } } for (int i = 0;i0)&&(j10) { Point2D.Double prev1 = pointList.getLast(); Point2D.Double prev2 = pointList.getFirst(); if ((interForward.distance(prev1)+interBackward.distance(prev2))<(interForward.distance(prev2)+interBackward.distance(prev1))) { pointList.addLast(interForward); pointList.addFirst(interBackward); } else { pointList.addFirst(interForward); pointList.addLast(interBackward); } } else { pointList.addLast(interForward); pointList.addFirst(interBackward); } } } if (getBases().size()>=2) { int j = getBases().get(getBases().size()-1).getIndex(); Point2D.Double p1 = realCoords[j]; Point2D.Double p2 = realCoords[j-1]; Point2D.Double p3 = realCenters[j]; isDirect = RNA.testDirectionality(p1, p2, p3); } if (getBases().size()>0) { int j = getBases().get(getBases().size()-1).getIndex(); Point2D.Double point = realCoords[j]; Point2D.Double centerBck = realCenters[j]; double dist = point.distance(centerBck); Point2D.Double vn = new Point2D.Double((centerBck.x-point.x)/dist,(centerBck.y-point.y)/dist); for(int k=1;k<=NUM_STEPS_ROUNDED_CORNERS;k++) { double angle = k*Math.PI/((double)NUM_STEPS_ROUNDED_CORNERS+1); if (!isDirect) angle += Math.PI; Point2D.Double nvn = new Point2D.Double(Math.cos(angle)*vn.x+Math.sin(angle)*vn.y,-Math.sin(angle)*vn.x+Math.cos(angle)*vn.y); Point2D.Double interForward = new Point2D.Double(point.x + scaleFactor *getRadius()*nvn.x, point.y + scaleFactor *getRadius()*nvn.y); pointList.addLast(interForward); } } if (pointList.size()>0) { Point2D.Double point = pointList.get(0); p.moveTo((float)point.x, (float)point.y); for (int i=1;i bases = vp.getRNA().getBasesBetween(i, j); try { String[] options = parts[1].split(","); for (int k = 0; k < options.length; k++) { //System.out.println(options[k]); try { String[] data = options[k].split("="); String lhs = data[0].toLowerCase(); String rhs = data[1]; if (lhs.equals("fill")) { fill = VARNAConfigLoader.getSafeColor(rhs, fill); } else if (lhs.equals("outline")) { outline = VARNAConfigLoader.getSafeColor(rhs, outline); } else if (lhs.equals("radius")) { radius = Double.parseDouble(rhs); } } catch(Exception e) { } } } catch(Exception e) { } return new HighlightRegionAnnotation(bases,fill,outline,radius); } catch(Exception e) { } return null; } public String toString() { //String result = "HighlightRegionAnnotation["; //result += "fill:"+_fillColor.toString(); //result += ",outline:"+_outlineColor.toString(); //result += ",radius:"+_radius; //return result+"]"; String result = "Highlighted region "+getMinIndex()+"-"+getMaxIndex(); return result; } } PK 4F>;dxx:fr/orsay/lri/varna/models/annotations/TextAnnotation.class1A4fr/orsay/lri/varna/models/annotations/TextAnnotationjava/lang/Objectjava/io/SerializableserialVersionUIDJ ConstantValuet=POSITIONIBASEHELIXLOOP DEFAULTCOLORLjava/awt/Color; DEFAULTFONTLjava/awt/Font;_texteLjava/lang/String;_font_ancrageLjava/lang/Object; _typeAncrage_color_angleD()VCode &('java/awt/Color )black + - java/awt/Font/Arial ,1 23(Ljava/lang/String;II)V 5 LineNumberTableLocalVariableTable(Ljava/lang/String;)V : 2# <  >  @  B !this6Lfr/orsay/lri/varna/models/annotations/TextAnnotation;texte(Ljava/lang/String;DD)V H 28J(fr/orsay/lri/varna/models/rna/VARNAPoint IL 2M(DD)V O  Q  xy?(Ljava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleBase;)Vmb*Lfr/orsay/lri/varna/models/rna/ModeleBase;+(Ljava/lang/String;Ljava/util/ArrayList;I)V ExceptionsZjava/lang/Exception SignatureW(Ljava/lang/String;Ljava/util/ArrayList;I)V^ Bad argument YH listeBaseLjava/util/ArrayList;typeLocalVariableTypeTableALjava/util/ArrayList;9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)V g hi getAncrage()Ljava/lang/Object; k lmgetFont()Ljava/awt/Font; o pqgetTexte()Ljava/lang/String; s tugetType()ItextAnnotationsetTextesetFont(Ljava/awt/Font;)V setAncrage-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)V(Ljava/util/ArrayList;I)VE(Ljava/util/ArrayList;I)VlistgetColor()Ljava/awt/Color;setColor(Ljava/awt/Color;)VcolorgetHelixDescriptionjava/util/ArrayList iterator()Ljava/util/Iterator; java/util/Iterator inext(fr/orsay/lri/varna/models/rna/ModeleBase u getBaseNumber ugetElementStructure java/lang/Math min(II)I max hasNext()Zjava/lang/StringBuilder[ H append(I)Ljava/lang/StringBuilder;, -(Ljava/lang/String;)Ljava/lang/StringBuilder;] [] qtoStringminAmaxAminBmaxBigetLoopDescription] java/text/DecimalFormat.00 H java/lang/String valueOf&(Ljava/lang/Object;)Ljava/lang/String; at (  getCenterPosition ()Ljava/awt/geom/Point2D$Double; java/awt/geom/Point2D$Double R! java/text/NumberFormat format(D)Ljava/lang/String; S!) on base  on helix  q on loop  qtmp formatterLjava/text/NumberFormat; I  toPoint2D  getCoords  calculLoopHelix   calculLoop L  'extractedArrayListModeleBaseFromAncrage()Ljava/util/ArrayList;  usizelistetotalXtotalYbase    java/util/Collections   sort(Ljava/util/List;)V  get(I)Ljava/lang/Object;numC()Ljava/util/ArrayList;clone8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation;  2T I I  2F  2W Y  #printStackTrace " xy $  textAnnoteLjava/lang/Exception;copy *  , -.getAngleInDegres()DgetAngleInRadians@ !TD-@fsetAngleInDegres(D)VsetAngleInRadians8$java/lang/CloneNotSupportedException :  SourceFileTextAnnotation.java InnerClasses?java/awt/geom/Point2DDouble!             !"#$>%*,Y. 046CG(728$e*9*+;**=*4?*A6VW XYZ[7CDE2F$m*+G*IY(KN*P6ghij7*CDER!S!2T$Z*+G*,N*P6uv wx7 CDEUV2WXY[\$/*+G*,N *P *P YY]_6" $.7*/CD/E/`a/b c /`d2e$m%*9*+fN*+j?*+n;*+rP6 $7%CD%vDpq$/*;67 CDw8$>*+;6 7CDlm$/*?67 CDxy$>*+?6 7CDhi$/*N67 CDz{$G *+N*P6 7 CD UVzM$Y*IY')KN*P6 7 CDR!S!z|XY[}$**+N *P *P YY]_6 )7 *CD*~a*b c *~dtu$/*P67 CD$/*=67 CD$>*+=6 7CDq$J *NL=>66+:C:6=>66Y62 +2<CMV_i7RCD`a    +4UV2- c `dq$a*NL=>+:$:6=>ػY6"#*18B7>aCDY`a V S #UV* c Y`dq$3ٻY*;¶L*PcYƷMY+ɷ϶,*Ѵնٶ,*Ѵ߶ٶY+ɷ*NY+ɷ*Y+ɷ*+6"<F  7 CDF:$N*P@ +6;*NI*N**Y6$/:?D7 NCD$X*LI9+:':(cIc9ջY(+o+o6#$ %&*'7%A)74XCDSaQ! N!Vc Sd$ u*L+I996G+: +d +!( cI c9c9+Y(oo62 -. /012"3:5E6R7X1d:7HuCDpa j!g!d!P "6V c pd[$2*N6?7 CD$=L*P4kWY*;*NLVY*;*NI*NIL3Y*;*LY*;*L M,+*?!+*=#+Y6^FH$J7K:MBNLOVMZP]ReSjRnTqVyW~VXZ\]_`a7 CD%D&'(e$}1*+fN*+j?*+n;*+rP*+)=*++A6klmn o(p0q71CD1vD-.$/*A6{7 CD/.$7 *+0k2o67  CD45$>*'A6 7CD !65$F*'2k0oA6  7CD !AiX7$%*967;<= >@ PK Y'>%%9fr/orsay/lri/varna/models/annotations/TextAnnotation.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.annotations; import java.awt.Color; import java.awt.Font; import java.awt.geom.Point2D; import java.io.Serializable; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collections; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.VARNAPoint; /** * The annotated text model * * @author Darty@lri.fr * */ public class TextAnnotation implements Serializable { /** * */ private static final long serialVersionUID = 465236085501860747L; /** * if the annoted text is located by a static position */ public final static int POSITION = 0; /** * if the annoted text is fixed to a base; */ public final static int BASE = 1; /** * if the annoted text is fixed to a helix; */ public final static int HELIX = 2; /** * if the annoted text is fixed to a loop; */ public final static int LOOP = 3; /** * default text color */ public static final Color DEFAULTCOLOR = Color.black; /** * default text font */ public static final Font DEFAULTFONT = new Font("Arial", Font.PLAIN, 12); private String _texte; private Font _font; private Object _ancrage; private int _typeAncrage; private Color _color; private double _angle; /** * creates an annoted text on a VARNAPanel with the specified text * * @param vp * @param texte */ public TextAnnotation(String texte) { _texte = texte; _color = DEFAULTCOLOR; _font = DEFAULTFONT; _angle = 0; } /** * /** creates an annoted text on a VARNAPanel with the specified text and * is static position * * @param vp * @param texte * @param x * @param y */ public TextAnnotation(String texte, double x, double y) { this(texte); _ancrage = new VARNAPoint(x, y); _typeAncrage = POSITION; } /** * creates an annoted text on a VARNAPanel with the specified text fixed to * a base * * @param vp * @param texte * @param mb */ public TextAnnotation(String texte, ModeleBase mb) { this(texte); _ancrage = mb; _typeAncrage = BASE; } /** * creates an annoted text on a VARNAPanel with the specified text fixed to * a helix (if type is HELIX) or to a loop (if type is LOOP) * * @param vp * @param texte * @param listeBase * @param type * @throws Exception */ public TextAnnotation(String texte, ArrayList listeBase, int type) throws Exception { this(texte); _ancrage = listeBase; if (type == HELIX) _typeAncrage = HELIX; else if (type == LOOP) _typeAncrage = LOOP; else throw new Exception("Bad argument"); } /** * creates an annoted text from another one * * @param textAnnotation */ public TextAnnotation(TextAnnotation textAnnotation) { _ancrage = textAnnotation.getAncrage(); _font = textAnnotation.getFont(); _texte = textAnnotation.getTexte(); _typeAncrage = textAnnotation.getType(); } /** * * @return the text */ public String getTexte() { return _texte; } public void setTexte(String _texte) { this._texte = _texte; } /** * * @return the font */ public Font getFont() { return _font; } public void setFont(Font _font) { this._font = _font; } public Object getAncrage() { return _ancrage; } public void setAncrage(ModeleBase mb) { _ancrage = mb; _typeAncrage = BASE; } public void setAncrage(double x, double y) { _ancrage = new VARNAPoint(x, y); _typeAncrage = POSITION; } public void setAncrage(ArrayList list, int type) throws Exception { _ancrage = list; if (type == HELIX) _typeAncrage = HELIX; else if (type == LOOP) _typeAncrage = LOOP; else throw new Exception("Bad argument"); } public int getType() { return _typeAncrage; } public Color getColor() { return _color; } public void setColor(Color color) { this._color = color; } public String getHelixDescription() { ArrayList listeBase = ((ArrayList)_ancrage); int minA = Integer.MAX_VALUE,maxA = Integer.MIN_VALUE; int minB = Integer.MAX_VALUE,maxB = Integer.MIN_VALUE; for(ModeleBase mb : listeBase) { int i = mb.getBaseNumber(); if (mb.getElementStructure()>i) { minA = Math.min(minA, i); maxA = Math.max(maxA, i); } else { minB = Math.min(minB, i); maxB = Math.max(maxB, i); } } return "["+minA+","+maxA+"] ["+minB+","+maxB+"]"; } public String getLoopDescription() { ArrayList listeBase = ((ArrayList)_ancrage); int min = Integer.MAX_VALUE,max = Integer.MIN_VALUE; for(ModeleBase mb : listeBase) { int i = mb.getBaseNumber(); min = Math.min(min, i); max = Math.max(max, i); } return "["+min+","+max+"]"; } public String toString() { String tmp = "["+_texte+"] "; switch (_typeAncrage) { case POSITION: NumberFormat formatter = new DecimalFormat(".00"); return tmp+" at ("+formatter.format(getCenterPosition().x)+","+formatter.format(getCenterPosition().y)+")"; case BASE: return tmp+" on base "+((ModeleBase) _ancrage).getBaseNumber(); case HELIX: return tmp+" on helix "+getHelixDescription(); case LOOP: return tmp+" on loop "+getLoopDescription(); default: return tmp; } } /** * * @return the text position center */ public Point2D.Double getCenterPosition() { switch (_typeAncrage) { case POSITION: return ((VARNAPoint) _ancrage).toPoint2D(); case BASE: return ((ModeleBase) _ancrage).getCoords(); case HELIX: return calculLoopHelix(); case LOOP: return calculLoop(); default: return new Point2D.Double(0., 0.); } } private Point2D.Double calculLoop() { ArrayList liste = extractedArrayListModeleBaseFromAncrage(); double totalX = 0., totalY = 0.; for (ModeleBase base : liste) { totalX += base.getCoords().x; totalY += base.getCoords().y; } return new Point2D.Double(totalX / liste.size(), totalY / liste.size()); } private Point2D.Double calculLoopHelix() { ArrayList liste = extractedArrayListModeleBaseFromAncrage(); Collections.sort(liste); double totalX = 0., totalY = 0.; double num=0.0; for (int i=0;i0 && (i extractedArrayListModeleBaseFromAncrage() { return (ArrayList) _ancrage; } /** * clone a TextAnnotation */ public TextAnnotation clone() { TextAnnotation textAnnot = null; try { switch (_typeAncrage) { case BASE: textAnnot = new TextAnnotation(_texte, (ModeleBase) _ancrage); break; case POSITION: textAnnot = new TextAnnotation(_texte, ((VARNAPoint) _ancrage).x, ((VARNAPoint) _ancrage).y); break; case LOOP: textAnnot = new TextAnnotation(_texte, extractedArrayListModeleBaseFromAncrage(), LOOP); break; case HELIX: textAnnot = new TextAnnotation(_texte, extractedArrayListModeleBaseFromAncrage(), HELIX); break; default: break; } } catch (Exception e) { e.printStackTrace(); } textAnnot.setFont(_font); textAnnot.setColor(_color); return textAnnot; } /** * copy a textAnnotation * * @param textAnnotation */ public void copy(TextAnnotation textAnnotation) { _ancrage = textAnnotation.getAncrage(); _font = textAnnotation.getFont(); _texte = textAnnotation.getTexte(); _typeAncrage = textAnnotation.getType(); _color = textAnnotation.getColor(); _angle = textAnnotation.getAngleInDegres(); } /** * * @return the angle in degrees */ public double getAngleInDegres() { // if (_typeAncrage == TextAnnotation.HELIX) // _angle = calculAngleDegres(); return _angle; } /** * * @return the angle in radians */ public double getAngleInRadians() { return (getAngleInDegres() * Math.PI) / 180.; } public void setAngleInDegres(double _angle) { this._angle = _angle; } public void setAngleInRadians(double _angle) { this._angle = _angle * 180 / Math.PI; } } PK 4F>3q bbUfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType.class1UOfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationTypejava/lang/Enum TRIANGLE_TYPEQLfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; ARROW_TYPEPIN_TYPEDOT_TYPE]$SWITCH_TABLE$fr$orsay$lri$varna$models$annotations$ChemProbAnnotation$ChemProbAnnotationType[I ENUM$VALUESR[Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;()VCode  (Ljava/lang/String;I)V         " LineNumberTableLocalVariableTable thistoString()Ljava/lang/String; * +()[I - ./ordinal()I1Triangle3Arrow5Dot7Pin9UnknownvaluesT()[Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; =?>java/lang/System @A arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfe(Ljava/lang/String;)Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; E BF5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; H J :;Ljava/lang/NoSuchFieldError SourceFileChemProbAnnotation.java SignaturecLjava/lang/Enum; InnerClassesS8fr/orsay/lri/varna/models/annotations/ChemProbAnnotationChemProbAnnotationType@1@@@@   TYYYYYSYSYSYS!# '4$1*+%#$ &'(u7)*,., #)&02468#(+.!1#4%$ 7& :;6!YK*Y<YM<,#$ BC* *D#$ +JGYWI K*,OW*,OW*,OW*,OW*YGK&)K*36K7@CK#$MNOPQ RT@PK 4F>d{B>fr/orsay/lri/varna/models/annotations/ChemProbAnnotation.class18fr/orsay/lri/varna/models/annotations/ChemProbAnnotationjava/lang/Objectjava/io/SerializableserialVersionUIDJ ConstantValueP8(JDEFAULT_INTENSITYD DEFAULT_TYPEQLfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; DEFAULT_COLORLjava/awt/Color;_mbfst*Lfr/orsay/lri/varna/models/rna/ModeleBase;_mbsnd_color _intensity_type_outZ()VCode  "!Ofr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType # ARROW_TYPE %  ')(java/awt/Color *blue ', -.darker()Ljava/awt/Color; 0 LineNumberTableLocalVariableTablei(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;Ljava/lang/String;)V 6 37W(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V 9 :; applyStyle(Ljava/lang/String;)Vthis:Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;mbfstmbsnd styleDescLjava/lang/String; C 3D(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;D)VX(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;D)V intensity(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;)Vtype J 3 LNM(fr/orsay/lri/varna/models/rna/ModeleBase OPgetIndex()I R  T  V  X  Z  \ tmpisOut()ZsetOut(Z)VbgetColor getIntensity()DgetTypeS()Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;setColor(Ljava/awt/Color;)Vc setIntensity(D)VdgetAnchorPosition ()Ljava/awt/geom/Point2D$Double;qjava/awt/geom/Point2D$Double Ls to getCoords pv w x@ p{ | y p~ 3(DD)VresultLjava/awt/geom/Point2D$Double; getDirVector  ogetNormalVector  no L o getCenternormanchorcentervradius p distance(DD)D, java/lang/String split'(Ljava/lang/String;)[Ljava/lang/String;=  toLowerCase()Ljava/lang/String;color equals(Ljava/lang/Object;)Z ' decode$(Ljava/lang/String;)Ljava/awt/Color;  hiF java/lang/Double  parseDouble(Ljava/lang/String;)Ddiroutglypharrowtriangle  TRIANGLE_TYPEpin PIN_TYPEdot DOT_TYPE chemProbs[Ljava/lang/String;iI thisStyledatanamevaluesetTypeT(Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;)Vsclone<()Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;toStringjava/lang/StringBuilder Chem. prob. 3; append-(Ljava/lang/Object;)Ljava/lang/StringBuilder; Base# -(Ljava/lang/String;)Ljava/lang/StringBuilder; L P getBaseNumber (I)Ljava/lang/StringBuilder;- ()Ljava/lang/Object; Exceptions$java/lang/CloneNotSupportedException   SourceFileChemProbAnnotation.java InnerClassesChemProbAnnotationTypejava/awt/geom/Point2DDouble!     @$&+/1*+ , 234\ *+,5*-8167 82* <= > ? @A37O *+,$B1 ; <2  <= > ?3EW *+,$)B1 ? @2* <= > ? F 3GW *+,-B1 C D2* <= > ? H3D9*I+K,K ,:+ML*+Q*,S*-U*W*/Y*[12 FGIJKMN!O&P,Q3R8S2>9<=9>9?9H9F ]^_/*[1W2 <=`a>*[1 \]2<=bc./*Y1a2 <=de/*W1f2 <=fg/*U1k2 <=hi>*+Y1 op2<=jkl>*'W1 st2<=m no<pY*Qru*Srucxo*Qrz*Srzcxo}L+1xyz6x:{2<<=:ox*LpY+zw+u}M*NpY*Qu*Sucxo*Qz*Szcxo}:pYu-ugxoz-zgxo}:*[/,uuk,zzkcApY,uw,zw},uuk,zzkcpY,uw,zw},1F8QVZhv{2><=V{aoYpY*Sru*Qrugxo*Srz*Qrzgxo}L+IpY+u(o+z(o}:16:AV2*Y<=:]A V:; +M>,2::2:2:: *Y:**W*[i\ *UE *U. *õUƶ *ȵU,1n !'-:AFLUbn{2\ <=@A A'A-AAj>*+U1 2<=z2Y*Q*S5L+*WW+*UU+*YY+*[[+1 (022<="=\2Y۷*U*Q*S12 2<=A%*12 @p PK oq</ff=fr/orsay/lri/varna/models/annotations/ChemProbAnnotation.javapackage fr.orsay.lri.varna.models.annotations; import java.awt.Color; import java.awt.geom.Point2D; import java.io.Serializable; import fr.orsay.lri.varna.models.rna.ModeleBase; public class ChemProbAnnotation implements Serializable { /** * */ private static final long serialVersionUID = 5833315460145031242L; public enum ChemProbAnnotationType { TRIANGLE_TYPE, ARROW_TYPE, PIN_TYPE, DOT_TYPE; public String toString() { switch(this) { case TRIANGLE_TYPE: return "Triangle"; case ARROW_TYPE: return "Arrow"; case DOT_TYPE: return "Dot"; case PIN_TYPE: return "Pin"; default: return "Unknown"; } } }; public static double DEFAULT_INTENSITY = 1.0; public static ChemProbAnnotationType DEFAULT_TYPE = ChemProbAnnotationType.ARROW_TYPE; public static Color DEFAULT_COLOR = Color.blue.darker(); private ModeleBase _mbfst; private ModeleBase _mbsnd; private Color _color; private double _intensity; private ChemProbAnnotationType _type; private boolean _out; public ChemProbAnnotation(ModeleBase mbfst, ModeleBase mbsnd, String styleDesc) { this(mbfst,mbsnd); applyStyle(styleDesc); } public ChemProbAnnotation(ModeleBase mbfst, ModeleBase mbsnd) { this(mbfst,mbsnd,ChemProbAnnotation.DEFAULT_TYPE,ChemProbAnnotation.DEFAULT_INTENSITY); } public ChemProbAnnotation(ModeleBase mbfst, ModeleBase mbsnd, double intensity) { this(mbfst,mbsnd,ChemProbAnnotation.DEFAULT_TYPE,intensity); } public ChemProbAnnotation(ModeleBase mbfst, ModeleBase mbsnd, ChemProbAnnotationType type) { this(mbfst,mbsnd,type,ChemProbAnnotation.DEFAULT_INTENSITY); } public ChemProbAnnotation(ModeleBase mbfst, ModeleBase mbsnd, ChemProbAnnotationType type, double intensity) { if (mbfst.getIndex()>mbsnd.getIndex()) { ModeleBase tmp = mbsnd; mbsnd = mbfst; mbfst = tmp; } _mbfst = mbfst; _mbsnd = mbsnd; _type = type; _intensity = intensity; _color = DEFAULT_COLOR; _out = true; } public boolean isOut() { return _out; } public void setOut(boolean b) { _out = b; } public Color getColor() { return _color; } public double getIntensity() { return _intensity; } public ChemProbAnnotationType getType() { return _type; } public void setColor(Color c){ _color = c; } public void setIntensity(double d){ _intensity = d; } public Point2D.Double getAnchorPosition() { Point2D.Double result = new Point2D.Double( (_mbfst.getCoords().x+_mbsnd.getCoords().x)/2.0, (_mbfst.getCoords().y+_mbsnd.getCoords().y)/2.0); return result; } public Point2D.Double getDirVector() { Point2D.Double norm = getNormalVector(); Point2D.Double result = new Point2D.Double(-norm.y,norm.x); Point2D.Double anchor = getAnchorPosition(); Point2D.Double center = new Point2D.Double( (_mbfst.getCenter().x+_mbsnd.getCenter().x)/2.0, (_mbfst.getCenter().y+_mbsnd.getCenter().y)/2.0); Point2D.Double vradius = new Point2D.Double( (center.x-anchor.x)/2.0, (center.y-anchor.y)/2.0); if (_out) { if (result.x*vradius.x+result.y*vradius.y>0) { return new Point2D.Double(-result.x,-result.y); } } else { if (result.x*vradius.x+result.y*vradius.y<0) { return new Point2D.Double(-result.x,-result.y); } } return result; } public Point2D.Double getNormalVector() { Point2D.Double tmp = new Point2D.Double( (_mbsnd.getCoords().x-_mbfst.getCoords().x)/2.0, (_mbsnd.getCoords().y-_mbfst.getCoords().y)/2.0); double norm = tmp.distance(0, 0); Point2D.Double result = new Point2D.Double(tmp.x/norm,tmp.y/norm); return result; } public void applyStyle(String styleDesc) { String[] chemProbs = styleDesc.split(","); for (int i = 0; i < chemProbs.length; i++) { String thisStyle = chemProbs[i]; String[] data = thisStyle.split("="); if (data.length==2) { String name = data[0]; String value = data[1]; if (name.toLowerCase().equals("color")) { Color c = Color.decode(value); if (c==null) { c = _color; } setColor(c); } else if (name.toLowerCase().equals("intensity")) { _intensity = Double.parseDouble(value); } else if (name.toLowerCase().equals("dir")) { _out = value.toLowerCase().equals("out"); } else if (name.toLowerCase().equals("glyph")) { if (value.toLowerCase().equals("arrow")) {_type = ChemProbAnnotationType.ARROW_TYPE;} else if (value.toLowerCase().equals("triangle")) {_type = ChemProbAnnotationType.TRIANGLE_TYPE;} else if (value.toLowerCase().equals("pin")) {_type = ChemProbAnnotationType.PIN_TYPE;} else if (value.toLowerCase().equals("dot")) {_type = ChemProbAnnotationType.DOT_TYPE;} } } } } public void setType(ChemProbAnnotationType s) { _type = s; } public ChemProbAnnotation clone() { ChemProbAnnotation result = new ChemProbAnnotation(this._mbfst,this._mbsnd); result._intensity = _intensity; result._type = _type; result._color= _color; result._out = _out; return result; } public String toString() { return "Chem. prob. "+this._type+" Base#"+this._mbfst.getBaseNumber()+"-"+this._mbsnd.getBaseNumber(); } } PK 4F>!fr/orsay/lri/varna/models/export/PK 4F> C8fr/orsay/lri/varna/models/export/FillCircleCommand.class112fr/orsay/lri/varna/models/export/FillCircleCommand/fr/orsay/lri/varna/models/export/GraphicElement_baseLjava/awt/geom/Point2D$Double;_radiusD _thickness_colorLjava/awt/Color;3(Ljava/awt/geom/Point2D$Double;DDLjava/awt/Color;)VCode  ()V        LineNumberTableLocalVariableTablethis4Lfr/orsay/lri/varna/models/export/FillCircleCommand;baseradius thicknesscolorget_base ()Ljava/awt/geom/Point2D$Double; get_radius()D get_thickness get_color()Ljava/awt/Color; SourceFileFillCircleCommand.java InnerClasses-java/awt/geom/Point2D$Double/java/awt/geom/Point2DDouble!   **+*(** !"#$4 ! "#/*' $%/*+ &%/*/ '(/*3 )*+ ,.0 PK nq6==0fr/orsay/lri/varna/models/export/SVGExport.class1*fr/orsay/lri/varna/models/export/SVGExport6fr/orsay/lri/varna/models/export/SecStrDrawingProducer _fontsizeD_bb"Ljava/awt/geom/Rectangle2D$Double; _thickness()VCode  @$   java/awt/geom/Rectangle2D$Double  (DDDD)V  @  ? ! "#setScale(D)VLineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/models/export/SVGExport; getRGBString$(Ljava/awt/Color;)Ljava/lang/String; +-,java/awt/Color ./getRed()I@o@Y +5 6/getGreen +8 9/getBlue;java/lang/StringBuilder=rgb( :? @(Ljava/lang/String;)V :B CDappend(I)Ljava/lang/StringBuilder;F%, :H CI-(Ljava/lang/String;)Ljava/lang/StringBuilder;K%) :M NOtoString()Ljava/lang/String;colLjava/awt/Color;rpcIgpcbpc drawCircleS4(Ljava/awt/geom/Point2D$Double;DD)Ljava/lang/String;Y baseLjava/awt/geom/Point2D$Double;radius thickness drawLineSQ(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)Ljava/lang/String;~ origdestdrawRectangleSdims drawTextSD(Ljava/awt/geom/Point2D$Double;Ljava/lang/String;)Ljava/lang/String; java/lang/System outLjava/io/PrintStream; java/io/PrintStream @println  txtLjava/lang/String; fillCircleSD(Ljava/awt/geom/Point2D$Double;DDLjava/awt/Color;)Ljava/lang/String;" stroke="none" stroke-width=""/> footerS headerS6(Ljava/awt/geom/Rectangle2D$Double;)Ljava/lang/String; �bb�setFontS�(ID)Ljava/lang/String;�font�size�drawArcS�6(Ljava/awt/geom/Point2D$Double;DDDD)Ljava/lang/String;�� �points�[Ljava/awt/geom/Point2D$Double;�result�i� fillPolygonS�C([Ljava/awt/geom/Point2D$Double;Ljava/awt/Color;)Ljava/lang/String;��z" style="fill:��; stroke:none;"/> � SourceFile�SVGExport.java� InnerClasses��java/awt/geom/Point2D�Double��java/awt/geom/Rectangle2D�!������������������ ���� �� � �� ���k� ����-*� *��*�Y����*��*�� ����$�������"��� ����%�#�,�$�%��� ����-�&�'����(�)�� ��������W+�*�0o�2k=+�4�0o�2k>+�7�0o�2k6�:Y<�>�AE�G�AE�G�AJ�G�L����$�������'��(��)�.�*�%���4����W�&�'�����W�P�Q���H�R�S���9�T�S��.�)�U�S���V�W�� ��������V*��:YX�>+�Z�_b�G*��d+�gg�_j�G(�_l�G**�n�q�Gs�G�_u�G�L����$�������/��0�*�1�C�2�R�0�%���*����V�&�'�����V�w�x����V�y�����V�z����{�|�� ��������k*)��:Y}�>+�Z�_�G*��d+�gg�_�G,�Z�_�G*��d,�gg�_l�G**�n�q�Gs�G)�_�G�L����$�������7��8�)�9�I�:�Y�;�g�8�%���*����k�&�'�����k��x����k��x����k�z�����|�� ���T�����*)�����$��� ����@��B�%���*�����&�'�������x������x�����z������� ��������b�,��:Y�>+�Z�_�G*��d+�gg�*�kc�_�G*��_�G**�n�q�G�G,�G�G�L����$���&� ���F��G��H��I��J�4�K�9�L�U�M�^�G�%��� ����b�&�'�����b�w�x����b�������� ��������T*��:YX�>+�Z�_b�G*��d+�gg�_j�G(�_�G�_�G*�q�G�G�L����$�������R��T�*�U�8�V�P�T�%���4����T�&�'�����T�w�x����T�y�����T�z�����T�P�Q����O�� ���-���������$�������Z�%��� �����&�'������� ���@�����*+�����$��� ����^��_�%��������&�'������������� ���N����� *�(k�����$��� ����h� �i�%��� ���� �&�'����� ��S���� �������� ��p�����(�o9 �o9 +�Z9*��d+�gg9+�Z(c9*��d+�gg9�:Y�>�_�G�_¶�G �_�G �_Ķ�G�_�G�_ƶ�G**�n�q�Gȶ�G*��_�G�L:����$���2� ���p��q��r��s�#�t�+�u�9�w�e�x�~�y��z��w��{�%���� ����&�'�������x�����������f������������������� ����� ������#�����+�w����9�i������������� ��L�����:6��B�:Y�ٷ�>߶�G+2�Z�_�G*��d+2�gg�_�G�L:�?�:Y�ٷ�>�G+2�Z�_�G*��d+2�gg�_�G�L:+y�:Y�ٷ�>�G**�n�q�Gȶ�G(�_�G�L:����$���:������� ����A��F��N����������������%���4�����&�'������������z�����������S������ ��;�����N6��@�:Y-�ٷ�>߶�G+2�Z�_�G*��d+2�gg�_�G�LN�=�:Y-�ٷ�>�G+2�Z�_�G*��d+2�gg�_�G�LN+}�:Y-�ٷ�>�G**�n�q�G�G�LN-����$���:������� ����?��D��K��|��������������%���4�����&�'������������P�Q����������S�������������[��� ���� PK �����Ģk=Fb��b��/���fr/orsay/lri/varna/models/export/SVGExport.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.Color; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.geom.Point2D.Double; public class SVGExport extends SecStrDrawingProducer { private double _fontsize = 10.0; private Rectangle2D.Double _bb = new Rectangle2D.Double(0, 0, 10, 10); double _thickness = 2.0; public SVGExport() { super(); super.setScale(0.5); } private String getRGBString(Color col) { int rpc = (int) ((((double) col.getRed()) / 255.0) * 100); int gpc = (int) ((((double) col.getGreen()) / 255.0) * 100); int bpc = (int) ((((double) col.getBlue()) / 255.0) * 100); return "rgb(" + rpc + "%, " + gpc + "%, " + bpc + "%)"; } public String drawCircleS(Point2D.Double base, double radius, double thickness) { _thickness = thickness; return "\n"; } public String drawLineS(Point2D.Double orig, Point2D.Double dest, double thickness) { _thickness = thickness; return "\n"; } public String drawRectangleS(Point2D.Double orig, Point2D.Double dims, double thickness) { _thickness = thickness; // TODO Auto-generated method stub return ""; } public String drawTextS(Point2D.Double base, String txt) { System.out.println(txt); return "" + txt + "\n"; } public String fillCircleS(Point2D.Double base, double radius, double thickness, Color col) { _thickness = thickness; return "\n"; } public String footerS() { return "\n"; } public String headerS(Rectangle2D.Double bb) { _bb = bb; return "\n" + "\n" + "\n" + "\n"; } public String setFontS(int font, double size) { _fontsize = 0.5 * size; return ""; } public String drawArcS(Point2D.Double o, double width, double height, double startAngle, double endAngle) { // TODO: This hack assumes a (0,180) type of angle. Needs to be // corrected for further usage. double rx = width / 2.0; double ry = height / 2.0; double xs = o.x; double ys = (_bb.height - o.y); double xe = o.x + width; double ye = (_bb.height - o.y); String d = "\n"; return d; } public String drawPolygonS(Double[] points, double thickness) { String result = "\n"; return result; } @Override public String fillPolygonS(Double[] points, Color col) { String result = "\n"; return result; } } PK �����4F>ub��b��4���fr/orsay/lri/varna/models/export/SwingGraphics.class���1���.fr/orsay/lri/varna/models/export/SwingGraphics��java/lang/Object��1fr/orsay/lri/varna/models/export/VueVARNAGraphics� _dashedStroke�Ljava/awt/BasicStroke;� _plainStroke�_g2d�Ljava/awt/Graphics2D;�_debug�Z��(Ljava/awt/Graphics2D;)V�Code �� ���()V �� � � �� � � @����java/awt/BasicStroke@@�� �� ��� (FIIF[FF)V �� �� ��" ��#�(FIIF)V ��% � ��LineNumberTable�LocalVariableTable�this�0Lfr/orsay/lri/varna/models/export/SwingGraphics;�g2d�dash�[F�getStringDimension�((Ljava/lang/String;)Ljava/awt/Dimension; �0�2�1�java/awt/Graphics2D �3�4�getFontMetrics�()Ljava/awt/FontMetrics; �6�8�7�java/awt/FontMetrics �9�:�getStringBounds�B(Ljava/lang/String;Ljava/awt/Graphics;)Ljava/awt/geom/Rectangle2D;�<�java/awt/Dimension �>�@�?�java/awt/geom/Rectangle2D �A�B�getWidth�()D �6�D �E�F� getAscent�()I �6�H �I�F� getDescent �;�K ��L�(II)V�s�Ljava/lang/String;�fm�Ljava/awt/FontMetrics;�r�Ljava/awt/geom/Rectangle2D;�drawStringCentered�(Ljava/lang/String;DD)V ��V �-�. �;�X �Y�Z�width�I@������� �;�^ �_�Z�height �0�a �b�c� getStroke�()Ljava/awt/Stroke; �0�e �f�g� setStroke�(Ljava/awt/Stroke;)V�i� java/awt/geom/Rectangle2D$Double �h�k ��l�(DDDD)V �0�n �o�p�draw�(Ljava/awt/Shape;)V �0�r �s�t� drawString�(Ljava/lang/String;FF)V�res�x�D�y�d�Ljava/awt/Dimension;�bck�Ljava/awt/Stroke;�(Ljava/awt/geom/GeneralPath;)V�Ljava/awt/geom/GeneralPath;�drawArc� (DDDDDD)V �0� ��� (IIIIII)V�rx�ry� angleStart�angleEnd�drawLine �0� ���(IIII)V�x1�y1�x2�y2� drawCircle�(DDD)V��java/awt/geom/Ellipse2D$Double ��k�drawRect �0� ���w�h� drawRoundRect �0� ���fill �0� ��p� fillCircle�fillRect �0� ��� fillRoundRect �0� ���getColor�()Ljava/awt/Color; �0� ���setColor�(Ljava/awt/Color;)V �0� ���c�Ljava/awt/Color;�setDashedStroke�setFont�(Ljava/awt/Font;)V �0� ���f�Ljava/awt/Font;�setPlainStroke� deriveStroke�/(Ljava/awt/BasicStroke;D)Ljava/awt/BasicStroke; �� ��F� getEndCap �� ��F� getLineJoin �� ��� getMiterLimit�()F �� ��� getDashArray�()[F �� ��� getDashPhase�t�setStrokeThickness�(D)V �� ���dashed� SourceFile�SwingGraphics.java� InnerClasses��java/awt/geom/Ellipse2D�Double�!������������ ������ � ���� � ������������ ����?*�*�*+�YQYQM*�Y , ��*�Y �!�$����&���������� ������.��>��'��� ����?�(�)�����?�*� ���#�+�,���-�.����������(*��/M,+*��5N�;Y-�=,�C,�Gd�J����&��������� ��!��"�$�!�'���*����(�(�)�����(�M�N��� �O�P����Q�R���S�T������ ����y*+�U:(�W�[ogI�]�[oc9*��D*��`:*�*�$�d*��hY(�]g�W�]�j�m*��d*�+(�q����&���*� ���'��(��)�#�*�*�,�3�-�>�.�b�/�k�1�x�2�'���>����y�(�)�����y�u�N����y�v�w����y�x�w���r�y�z��3�8�{�|���o�}�����A����� *�+�m����&��� ����5��6�'������� �(�)����� �M�~����������� ���&*�'�[og)�[og  �����&��� ����:�%�;�'���H����&�(�)�����&�v�w����&�x�w����&��w����&��w����&��w� ���&��w� ���l�����h�� ���*�')�����&��� ����>��?�'���4�����(�)�������w������w������w������w���������a� ����*��Y')��m����&��� ����B��C�'���*�����(�)������v�w�����x�w�����Q�w����l�����h�� ���*�')�����&��� ����F��G�'���4�����(�)������v�w�����x�w������w������w����������� ���*�')  �����&��� ����K��L�'���H�����(�)������v�w�����x�w������w������w������w� �����w� ��s�T�����Z�����*�+(�q����&��� ����O� �P�'���*�����(�)������M�N�����v�w�����x�w����}�����A����� *�+�����&��� ����S��T�'������� �(�)����� �M�~���������a� ����*��Y')������&��� ����W��X�'���*�����(�)������v�w�����x�w�����Q�w����l�����h�� ���*�')�����&��� ����[��\�'���4�����(�)������v�w�����x�w������w������w����������� ���*�')  �����&��� ����`��a�'���H�����(�)������v�w�����x�w������w������w������w� �����w� ��������2�����*������&�������d�'��� �����(�)����������A����� *�+�����&��� ����h��i�'������� �(�)����� �����������:����� *�*��d����&��� ����l� �m�'��� ���� �(�)����������A����� *�+�����&��� ����p��q�'������� �(�)����� �����������:����� *�*�$�d����&��� ����t� �u�'��� ���� �(�)����������\������Y(+�+�+�+�+�ɷ�����&�������y�'��� �����(�)������M�������w��������������L*��`*���>***�$'�ϵ�$***�'�ϵ��*�*��d�*�*�$�d����&�������}��~�!��.��2��@��K��'��� ����L�(�)�����L��w���8�� ���������������� �h�>�� PK �����[>,ՠ����3���fr/orsay/lri/varna/models/export/SwingGraphics.javapackage fr.orsay.lri.varna.models.export; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.Ellipse2D; import java.awt.geom.GeneralPath; import java.awt.geom.Rectangle2D; public class SwingGraphics implements VueVARNAGraphics { private BasicStroke _dashedStroke; private BasicStroke _plainStroke; Graphics2D _g2d; private boolean _debug = false; public SwingGraphics(Graphics2D g2d) { _g2d = g2d; float[] dash = { 5.0f, 5.0f }; _dashedStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 3.0f, dash, 0); _plainStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 3.0f); } public Dimension getStringDimension(String s) { FontMetrics fm = _g2d.getFontMetrics(); Rectangle2D r = fm.getStringBounds(s, _g2d); return (new Dimension((int) r.getWidth(), (int) fm.getAscent() - fm.getDescent())); } public void drawStringCentered(String res, double x, double y) { Dimension d = getStringDimension(res); x -= (double) d.width / 2.0; y += (double) d.height / 2.0; if (_debug) { Stroke bck = _g2d.getStroke(); _g2d.setStroke(_plainStroke); _g2d.draw(new Rectangle2D.Double(x, y - d.height, d.width, d.height)); _g2d.setStroke(bck); } _g2d.drawString(res, (float) (x), (float) (y)); } public void draw(GeneralPath s) { _g2d.draw(s); } public void drawArc(double x, double y, double rx, double ry, double angleStart, double angleEnd) { _g2d.drawArc((int) (x-rx/2.), (int) (y-ry/2.), (int) rx, (int) ry, (int) angleStart, (int) angleEnd); } public void drawLine(double x1, double y1, double x2, double y2) { _g2d.drawLine((int)x1, (int)y1, (int)x2, (int)y2); } public void drawCircle(double x, double y, double r) { _g2d.draw(new Ellipse2D.Double(x, y, r, r)); } public void drawRect(double x, double y, double w, double h) { _g2d.drawRect((int)x, (int)y, (int)w, (int)h); } public void drawRoundRect(double x, double y, double w, double h, double rx, double ry) { _g2d.drawRoundRect((int)x, (int)y, (int)w, (int)h, (int)rx, (int)ry); } public void drawString(String s, double x, double y) { _g2d.drawString(s, (float)x, (float)y); } public void fill(GeneralPath s) { _g2d.fill(s); } public void fillCircle(double x, double y, double r) { _g2d.fill(new Ellipse2D.Double(x, y, r, r)); } public void fillRect(double x, double y, double w, double h) { _g2d.fillRect((int)x, (int)y, (int)w, (int)h); } public void fillRoundRect(double x, double y, double w, double h, double rx, double ry) { _g2d.fillRoundRect((int)x, (int)y, (int)w, (int)h, (int)rx, (int)ry); } public Color getColor() { return _g2d.getColor(); } public void setColor(Color c) { _g2d.setColor(c); } public void setDashedStroke() { _g2d.setStroke(_dashedStroke); } public void setFont(Font f) { _g2d.setFont(f); } public void setPlainStroke() { _g2d.setStroke(_plainStroke); } private BasicStroke deriveStroke(BasicStroke s, double t) { return new BasicStroke((float)t, s.getEndCap(), s.getLineJoin(), s.getMiterLimit(), s.getDashArray(), s.getDashPhase()) ; } public void setStrokeThickness(double t) { boolean dashed = (_g2d.getStroke()==_dashedStroke); _plainStroke = deriveStroke(_plainStroke, t); _dashedStroke = deriveStroke(_dashedStroke, t); if(dashed) { _g2d.setStroke(_dashedStroke); } else { _g2d.setStroke(_plainStroke); } } } PK �����4F>\/��/��<���fr/orsay/lri/varna/models/export/SecStrDrawingProducer.class���1��6fr/orsay/lri/varna/models/export/SecStrDrawingProducer��java/lang/Object�FONT_TIMES_ROMAN�I� ConstantValue�����FONT_TIMES_BOLD����FONT_TIMES_ITALIC����FONT_TIMES_BOLD_ITALIC����FONT_HELVETICA����FONT_HELVETICA_OBLIQUE����FONT_HELVETICA_BOLD����FONT_HELVETICA_BOLD_OBLIQUE���� FONT_COURIER��� �FONT_COURIER_BOLD��� �FONT_COURIER_OBLIQUE����FONT_COURIER_BOLD_OBLIQUE���� _commands�Ljava/util/Vector;� Signature�ELjava/util/Vector;�_scale�D�_xmin�_ymin�_xmax�_ymax� _curColor�Ljava/awt/Color;�_backgroundColor� _fontsize�_font��()V�Code ��2 �.�/�4�java/util/Vector �3�2 ��7 �� ��9 �#�$ ��= �%�$ ��? �&�$ ��C �'�$ ��E �(�$ �G�I�H�java/awt/Color �J�*�black ��L �)�* ��N �+�*@$������ ��R �,�$ ��T �-��LineNumberTable�LocalVariableTable�this�8Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;�getCurrentColor�()Ljava/awt/Color;�getCurFontSize�()D�getCurrentFont�()I� drawLineS�Q(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)Ljava/lang/String;�drawArcS�6(Ljava/awt/geom/Point2D$Double;DDDD)Ljava/lang/String;� drawTextS�D(Ljava/awt/geom/Point2D$Double;Ljava/lang/String;)Ljava/lang/String;�drawRectangleS� drawCircleS�4(Ljava/awt/geom/Point2D$Double;DD)Ljava/lang/String;� fillCircleS�D(Ljava/awt/geom/Point2D$Double;DDLjava/awt/Color;)Ljava/lang/String;� drawPolygonS�4([Ljava/awt/geom/Point2D$Double;D)Ljava/lang/String;� fillPolygonS�C([Ljava/awt/geom/Point2D$Double;Ljava/awt/Color;)Ljava/lang/String;�setFontS�(ID)Ljava/lang/String;� setColorS�$(Ljava/awt/Color;)Ljava/lang/String;�s���col�headerS�6(Ljava/awt/geom/Rectangle2D$Double;)Ljava/lang/String;�footerS�()Ljava/lang/String;�resetBoundingBox�updateBoundingBox�(DD)V �}��~�java/lang/Math ���min�(DD)D �}� ���max�x�y�drawLine�(DDDDD)V �� �z�{��,fr/orsay/lri/varna/models/export/LineCommand��java/awt/geom/Point2D$Double �� �.�{ �� �.��@(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)V �3� ���add�(Ljava/lang/Object;)Z�x0�y0�x1�y1� thickness�drawArc�%(Ljava/awt/geom/Point2D$Double;DDDD)V �� ��$ �� ��$@���������+fr/orsay/lri/varna/models/export/ArcCommand �� �.��origine�Ljava/awt/geom/Point2D$Double;�width�height� startAngle�endAngle�drawText�(DDLjava/lang/String;)V��,fr/orsay/lri/varna/models/export/TextCommand��java/lang/String �� �.��(Ljava/lang/String;)V �� �.��3(Ljava/awt/geom/Point2D$Double;Ljava/lang/String;)V�txt�Ljava/lang/String;� drawRectangle��1fr/orsay/lri/varna/models/export/RectangleCommand ���w�h� fillRectangle�(DDDDLjava/awt/Color;)V �� ��� fillPolygon�([D[DLjava/awt/Color;)V�color�xtab�[D�ytab� drawCircle�(DDDD)V��.fr/orsay/lri/varna/models/export/CircleCommand �� �.��#(Ljava/awt/geom/Point2D$Double;DD)V�radius�setColor�(Ljava/awt/Color;)V��-fr/orsay/lri/varna/models/export/ColorCommand �� �.��setBackgroundColor�removeBackgroundColor� fillCircle��2fr/orsay/lri/varna/models/export/FillCircleCommand �� �.��3(Ljava/awt/geom/Point2D$Double;DDLjava/awt/Color;)V� drawPolygon�([D[DD)V��/fr/orsay/lri/varna/models/export/PolygonCommand �� �.��#([Ljava/awt/geom/Point2D$Double;D)V�points�[Ljava/awt/geom/Point2D$Double;�i�(Ljava/awt/geom/GeneralPath;D)V ����java/awt/geom/GeneralPath ���getPathIterator�=(Ljava/awt/geom/AffineTransform;)Ljava/awt/geom/PathIterator; ����java/awt/geom/PathIterator ���currentSegment�([D)I �� ��/�next �� ���isDone�()Z �3 �^�size �3 �get�(I)Ljava/lang/Object; � ���p�Ljava/awt/geom/GeneralPath;�pi�Ljava/awt/geom/PathIterator;�v�coords�code�LocalVariableTypeTable�2Ljava/util/Vector;�.(Ljava/awt/geom/GeneralPath;Ljava/awt/Color;)V�3fr/orsay/lri/varna/models/export/FillPolygonCommand  �.�2([Ljava/awt/geom/Point2D$Double;Ljava/awt/Color;)V�setFont�(ID)V�,fr/orsay/lri/varna/models/export/FontCommand  �.�font�setScale�(D)V�sc�getBoundingBox�$()Ljava/awt/geom/Rectangle2D$Double;&� java/awt/geom/Rectangle2D$Double %( �.�� transform�A(Ljava/awt/geom/Point2D$Double;DDD)Ljava/awt/geom/Point2D$Double; �, )-�%(DDDDD)Ljava/awt/geom/Point2D$Double;�factor�dx�dy�export �3 #$ %� %� %7 ��$ %9 ��$;�java/lang/StringBuffer :�2 �> �u�v :@ AB�append�,(Ljava/lang/String;)Ljava/lang/StringBuffer; �D �l�m �3F G� elementAtI�/fr/orsay/lri/varna/models/export/GraphicElement �K LM�get_orig� ()Ljava/awt/geom/Point2D$Double; �O )* �Q RM�get_dest �T U�\� get_thickness �W �_�` �Y ZM�get_base �\ ]�x�get_txt �_ �c�d �K �b cM�get_dims �T �f �e�` �Y �i j�\� get_radius �T �m �f�g �Y �i �T �r s�Z� get_color �u �h�i w x�^�get_font z {�\�get_size �} �n�o � �Z�getColor � �p�q � M� getOrigine � �\�getWidth � �\� getHeight � �\� getStartAngle � �\� getEndAngle � �a�b � � get_points�!()[Ljava/awt/geom/Point2D$Double; �T � �j�k  r � �w�x : �x�toString�oldbb�"Ljava/awt/geom/Rectangle2D$Double;�nbb�buf�Ljava/lang/StringBuffer;�tab�ge�1Lfr/orsay/lri/varna/models/export/GraphicElement;�c�.Lfr/orsay/lri/varna/models/export/LineCommand;�tmp�.Lfr/orsay/lri/varna/models/export/TextCommand;�3Lfr/orsay/lri/varna/models/export/RectangleCommand;�0Lfr/orsay/lri/varna/models/export/CircleCommand;�4Lfr/orsay/lri/varna/models/export/FillCircleCommand;�.Lfr/orsay/lri/varna/models/export/FontCommand;�/Lfr/orsay/lri/varna/models/export/ColorCommand;�-Lfr/orsay/lri/varna/models/export/ArcCommand;�1Lfr/orsay/lri/varna/models/export/PolygonCommand;�j�5Lfr/orsay/lri/varna/models/export/FillPolygonCommand;�reset� SourceFile�SecStrDrawingProducer.java� InnerClasses�java/awt/geom/Point2D�Double�java/awt/geom/Rectangle2D!���������������� ������� �� ������� �� ���������������������������������������������������������������������������������� ��!����"��#�$����%�$����&�$����'�$����(�$����)�*����+�*����,�$����-����'��.�/��0��������J*�1*�3Y�5�6*�8*�:�<*�:�>*�@�B*�@�D*�F�K*�M*�O�Q*�S����U���2� �����*��,��-��.�"�/�)�0�0�2�7�3�<�5�C�6�I��V��� ����J�W�X����Y�Z��0���/�����*�K����U�������:�V��� �����W�X����[�\��0���/�����*�Q����U�������>�V��� �����W�X����]�^��0���/�����*�S����U�������B�V��� �����W�X���_�`���a�b���c�d���e�`���f�g���h�i���j�k���l�m���n�o����p�q��0���@�����*+�Kr����U��� ����_��`�V��������W�X������t�*��u�v���w�x����y�/��0���W�����*�:�<*�:�>*�@�B*�@�D����U�������i��j��k��l��m�V��� �����W�X����z�{��0��������A**�<'�Og�|�<**�>)�Og�|�>**�B'�Oc��B**�D)�Oc��D����U�������p��q� �r�0�s�@�t�V��� ����A�W�X�����A��$����A��$������0���� � ���4*')�*�*�6�Y�Y')��Y� ��W����U�������x��y��z��{�/�z�3�|�V���>����4�W�X�����4��$����4��$����4��$����4��$����4��$� �����0���� � ���-*+�(c+��oc�*�6�Y+(��W����U����������#��(��,��V���>����-�W�X�����-������-��$����-��$����-��$����-��$������0���x� ����(*')�*�6�Y�Y')��Y���W����U����������'��V���*����(�W�X�����(��$����(��$����(��������0���� � ���8*')�*'c)c�*�6�Y�Y')��Y� ��W����U������������#��3��7��V���>����8�W�X�����8��$����8��$����8��$����8��$����8��$� �����0����� ���I: :  'R 'cR 'cR 'R )R )R )cR )cR*   �ű����U���2� ������ ��������$��)��.��6��>��H��V���R����I�W�X�����I��$����I��$����I��$����I��$����I��*� ��D��� � �?��� �����0���� � ���5*'g)g�*'c)c�*�6�Y�Y')��Ѷ�W����U�������� ����+��0��4��V���4����5�W�X�����5��$����5��$����5��$����5��$������0���R�����*+�K*�6�Y+�ٶ�W����U������������V��������W�X������t�*������0���>�����*+�M����U��� �������V��������W�X������t�*����/��0���4�����*�M����U��� �������V��� �����W�X�������0���� � ���7*'g)g�*'c)c�*�6�Y�Y')� ��W����U�������� ����+��2��6��V���>����7�W�X�����7��$����7��$����7��$����7��$����7��*� �����0��������Q+,�L+�:6�&�Y+1,1�S*+1,1�+*�6�Y)��W����U���"�����������(��4��>��P��V���>����Q�W�X�����Q������Q������Q��$���B�����-��������0���� ���+�:�3Y�5::�J��6��Y11��W��Y11��W����::6 �*  ��R  ��R  *(����U���N�������������$��)��>��D��Y��`��j��s��|������������V���f� ����W�X�����  ������$���  ���� ������$�<���s�J����|�A�����4��� ��� ��������0���� ���+�N�3Y�5::�H-��6��Y11��W��Y11��W-��-��::6�*��R��R*,�ű����U���N�������������"��'��<��B��W��]��f��o��x��~����������V���f� ����W�X�����  ������*���  ���� ������"�;���o�J����x�A����{�4������ ���������0��������Q+,�L+�:6�&�Y+1,1�S*+1,1�+*�6Y-�W����U���"�������(�4�>�P �V���>����Q�W�X�����Q������Q������Q��*���B�����-������0���f�����*(�Q*�S*�6Y(�W����U������ �� ��V��� �����W�X�����������$�� !��0���>�����*'�8����U��� �����V��������W�X�����"�$��#$��0���T� ����"%Y*�<*�>*�B*�g'����U���������V��� ����"�W�X���)*��0���d� ����*+�+�(+����U�������V���4�����W�X����� �����.�$����/�$����0�$��)-��0���r�� ����Y'ck) ck�����U������#�V���>�����W�X�������$������$����.�$����/�$����0�$� �1�x��0��?� � ��e*2L+4wI+5w9%Y+6*�8k+8*�8k'::Y<:*=?W*�M�g+6*�8k9+8*�8k9 �:  �Y�S �Y�S �Y �S �Y �S* *�MC?W6*�6EH:  ��@ �: ** J*�8(N* P*�8(N SV:  ?WA ��0 �: ** X*�8(N [^:  ?W  ��? �: ** `*�8(N* a*�8N de:  ?W �ϙ�: �: ** g*�8(N h*�8k kl:  ?W �ޙ�? �: ** n*�8(N o*�8k p qt:  ?WE �% : * v y|:  ?W �י�  �: * ~:  ?W� ��I �: ** *�8(N *�8k *�8k  :  ?W� ��O �:  : 6 �  *  2*�8(NS   *  :  ?W�T �L :  : 6 �  *  2*�8(NS   *  C:  ?W*�6c*?W����U��b�X��'�(� )�*�/+�8,�D-�K/�V0�a1�g2�t3�4�5�6�8�9�:�;�<�=�>�<�?@AB(C-B2D=EEFLGXHlIqGvJKLMNOMPQRSTUSVW XY#Z.[6\=]H^S_[`bacbxcdaefghijilmnop qr&q1t4u9t>vF8Uy_z�V��`�#��e�W�X���`�� Z/�$��S0�$��/6��8-��V�Y��$��a�N��$� �g�H�� ������ ��6� �� �� �&� 2� �� L�5� v� �� �0� � �� �5� � �� �� #� �� =�� H� �� b�?� � �� �E� �>��� �#�� � �� �B�  �;��� �#�� >��� ��/��0���+����������U�������V��� �����W�X������������ %� PK �����Z>H0��0��;���fr/orsay/lri/varna/models/export/SecStrDrawingProducer.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.Color; import java.awt.geom.AffineTransform; import java.awt.geom.GeneralPath; import java.awt.geom.PathIterator; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.Vector; public abstract class SecStrDrawingProducer { public static final int FONT_TIMES_ROMAN = 0; public static final int FONT_TIMES_BOLD = 1; public static final int FONT_TIMES_ITALIC = 2; public static final int FONT_TIMES_BOLD_ITALIC = 3; public static final int FONT_HELVETICA = 16; public static final int FONT_HELVETICA_OBLIQUE = 17; public static final int FONT_HELVETICA_BOLD = 18; public static final int FONT_HELVETICA_BOLD_OBLIQUE = 19; public static final int FONT_COURIER = 12; public static final int FONT_COURIER_BOLD = 13; public static final int FONT_COURIER_OBLIQUE = 14; public static final int FONT_COURIER_BOLD_OBLIQUE = 15; private Vector _commands = new Vector(); private double _scale = 1.0; private double _xmin = Double.MAX_VALUE; private double _ymin = Double.MAX_VALUE; private double _xmax = -Double.MAX_VALUE; private double _ymax = -Double.MAX_VALUE; protected Color _curColor = Color.black; protected Color _backgroundColor = null; protected double _fontsize = 10.0; protected int _font = FONT_HELVETICA_BOLD; public Color getCurrentColor() { return _curColor; } public double getCurFontSize() { return _fontsize; } public int getCurrentFont() { return _font; } public abstract String drawLineS(Point2D.Double orig, Point2D.Double dest, double thickness); public abstract String drawArcS(Point2D.Double origine, double width, double height, double startAngle, double endAngle); public abstract String drawTextS(Point2D.Double base, String txt); public abstract String drawRectangleS(Point2D.Double orig, Point2D.Double dims, double thickness); public abstract String drawCircleS(Point2D.Double base, double radius, double thickness); public abstract String fillCircleS(Point2D.Double base, double radius, double thickness, Color color); public abstract String drawPolygonS(Point2D.Double[] points, double thickness); public abstract String fillPolygonS(Point2D.Double[] points, Color color); public abstract String setFontS(int font, double size); public String setColorS(Color col) { _curColor = col; return ""; } public abstract String headerS(Rectangle2D.Double bb); public abstract String footerS(); @SuppressWarnings("unused") private void resetBoundingBox() { _xmin = Double.MAX_VALUE; _ymin = Double.MAX_VALUE; _xmax = -Double.MAX_VALUE; _ymax = -Double.MAX_VALUE; } private void updateBoundingBox(double x, double y) { _xmin = Math.min(_xmin, x - 10); _ymin = Math.min(_ymin, y - 10); _xmax = Math.max(_xmax, x + 10); _ymax = Math.max(_ymax, y + 10); } public void drawLine(double x0, double y0, double x1, double y1, double thickness) { updateBoundingBox(x0, y0); updateBoundingBox(x1, y1); _commands.add(new LineCommand(new Point2D.Double(x0, y0), new Point2D.Double(x1, y1), thickness)); } public void drawArc(Point2D.Double origine, double width, double height, double startAngle, double endAngle) { updateBoundingBox(origine.x + width, origine.y + height/2); _commands.add(new ArcCommand(origine, width, height, startAngle, endAngle)); } public void drawText(double x, double y, String txt) { updateBoundingBox(x, y); _commands.add(new TextCommand(new Point2D.Double(x, y), new String(txt))); } public void drawRectangle(double x, double y, double w, double h, double thickness) { updateBoundingBox(x, y); updateBoundingBox(x + w, y + h); _commands.add(new RectangleCommand(new Point2D.Double(x, y), new Point2D.Double(w, h), thickness)); } public void fillRectangle(double x, double y, double w, double h, Color color) { double [] xtab = new double[4]; double [] ytab = new double[4]; xtab[0] = x; xtab[1] = x+w; xtab[2] = x+w; xtab[3] = x; ytab[0] = y; ytab[1] = y; ytab[2] = y+h; ytab[3] = y+h; fillPolygon(xtab, ytab, color); } public void drawCircle(double x, double y, double radius, double thickness) { updateBoundingBox(x - radius, y - radius); updateBoundingBox(x + radius, y + radius); _commands.add(new CircleCommand(new Point2D.Double(x, y), radius, thickness)); } public void setColor(Color col) { _curColor = col; _commands.add(new ColorCommand(col)); } public void setBackgroundColor(Color col){ _backgroundColor = col; } public void removeBackgroundColor(){ _backgroundColor = null; } public void fillCircle(double x, double y, double radius, double thickness, Color color) { updateBoundingBox(x - radius, y - radius); updateBoundingBox(x + radius, y + radius); _commands.add(new FillCircleCommand(new Point2D.Double(x, y), radius, thickness, color)); } public void drawPolygon(double[] xtab, double[] ytab, double thickness) { if (xtab.length == ytab.length) { Point2D.Double points[] = new Point2D.Double[xtab.length]; for (int i = 0; i < xtab.length; i++) { points[i] = new Point2D.Double(xtab[i], ytab[i]); updateBoundingBox(xtab[i], ytab[i]); } _commands.add(new PolygonCommand(points, thickness)); } } public void drawPolygon(GeneralPath p, double thickness) { PathIterator pi = p.getPathIterator(null); Vector v = new Vector(); double[] coords = new double[6]; while (!pi.isDone()) { int code = pi.currentSegment(coords); if (code == PathIterator.SEG_MOVETO) { v.add(new Point2D.Double(coords[0],coords[1])); } if (code == PathIterator.SEG_LINETO) { v.add(new Point2D.Double(coords[0],coords[1])); } pi.next(); } double[] xtab = new double[v.size()]; double[] ytab = new double[v.size()]; for(int i=0;i v = new Vector(); double[] coords = new double[6]; while (!pi.isDone()) { int code = pi.currentSegment(coords); if (code == PathIterator.SEG_MOVETO) { v.add(new Point2D.Double(coords[0],coords[1])); } if (code == PathIterator.SEG_LINETO) { v.add(new Point2D.Double(coords[0],coords[1])); } pi.next(); } double[] xtab = new double[v.size()]; double[] ytab = new double[v.size()]; for(int i=0;i$|1����1���fr/orsay/lri/varna/models/export/ArcCommand.class���1�/��+fr/orsay/lri/varna/models/export/ArcCommand��/fr/orsay/lri/varna/models/export/GraphicElement�origine�Ljava/awt/geom/Point2D$Double;�width�D�height� startAngle�endAngle��%(Ljava/awt/geom/Point2D$Double;DDDD)V�Code �� � ��()V �� �� �� �� �� � � �� � � �� � ��LineNumberTable�LocalVariableTable�this�-Lfr/orsay/lri/varna/models/export/ArcCommand;� getOrigine� ()Ljava/awt/geom/Point2D$Double;�getWidth�()D� getHeight� getStartAngle� getEndAngle� SourceFile�ArcCommand.java� InnerClasses�+�java/awt/geom/Point2D$Double�-�java/awt/geom/Point2D�Double�!����������������� ����� ����� ������ � ������� ���!*�*+�*(�*�*�*��������������� ��� ��!��"� �#����>����!�������!������!������!� �����!� �����!� ���� �!�����/�����*������������&���� ����������"�#�����/�����*������������*���� ����������$�#�����/�����*������������.���� ����������%�#�����/�����*������������2���� ����������&�#�����/�����*������������6���� ����������'����(�)��� ��*�,�.� PK �����nq< V"��"��0���fr/orsay/lri/varna/models/export/ArcCommand.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.geom.Point2D; public class ArcCommand extends GraphicElement { private Point2D.Double origine; private double width, height; private double startAngle, endAngle; public ArcCommand(Point2D.Double origine, double width, double height, double startAngle, double endAngle) { this.origine = origine; this.width = width; this.height = height; this.startAngle = startAngle; this.endAngle = endAngle; } public Point2D.Double getOrigine() { return origine; } public double getWidth() { return width; } public double getHeight() { return height; } public double getStartAngle() { return startAngle; } public double getEndAngle() { return endAngle; } } PK �����4F>“g��g��2���fr/orsay/lri/varna/models/export/TextCommand.class���1�%��,fr/orsay/lri/varna/models/export/TextCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_base�Ljava/awt/geom/Point2D$Double;�_txt�Ljava/lang/String;��3(Ljava/awt/geom/Point2D$Double;Ljava/lang/String;)V�Code �� � ��()V �� �� �� ���LineNumberTable�LocalVariableTable�this�.Lfr/orsay/lri/varna/models/export/TextCommand;�base�txt�get_base� ()Ljava/awt/geom/Point2D$Double;�get_txt�()Ljava/lang/String;� SourceFile�TextCommand.java� InnerClasses�!�java/awt/geom/Point2D$Double�#�java/awt/geom/Point2D�Double�!������������������ � �� ���Y�����*� *+�*,��������������� ������� ������������������������� ���/�����*������������ ���� ������������� ���/�����*������������$���� ������������������ �� �"�$� PK �����nq< j����1���fr/orsay/lri/varna/models/export/TextCommand.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.geom.Point2D; public class TextCommand extends GraphicElement { private Point2D.Double _base; private String _txt; public TextCommand(Point2D.Double base, String txt) { _base = base; _txt = txt; } public Point2D.Double get_base() { return _base; } public String get_txt() { return _txt; } } PK �����4F>����=���fr/orsay/lri/varna/models/export/SecStrProducerGraphics.class���1���7fr/orsay/lri/varna/models/export/SecStrProducerGraphics��java/lang/Object��1fr/orsay/lri/varna/models/export/VueVARNAGraphics�_ss�8Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;� _thickness�D�_color�Ljava/awt/Color;��;(Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;)V�Code �� � ��()V �� ���LineNumberTable�LocalVariableTable�this�9Lfr/orsay/lri/varna/models/export/SecStrProducerGraphics;�ss�draw�(Ljava/awt/geom/GeneralPath;)V �� ���getColor�()Ljava/awt/Color; �!�#�"�6fr/orsay/lri/varna/models/export/SecStrDrawingProducer �$�%� fillPolygon�.(Ljava/awt/geom/GeneralPath;Ljava/awt/Color;)V�s�Ljava/awt/geom/GeneralPath;�drawArc� (DDDDDD)V�x�y�rx�ry� angleStart�angleEnd�drawLine�(DDDD)V ��3 � � �!�5 �0�6�(DDDDD)V�x1�y1�x2�y2� drawCircle�(DDD)V?������ �!�@ �;�1�r�drawRect�w�h� drawRoundRect�drawStringCentered�(Ljava/lang/String;DD)V �!�I �J�K�drawText�(DDLjava/lang/String;)V�res�Ljava/lang/String;�fill� fillCircle �!�Q �R��getCurrentColor �!�T �O�U�(DDDDLjava/awt/Color;)V�fillRect� fillRoundRect�getStringDimension�((Ljava/lang/String;)Ljava/awt/Dimension;�setColor�(Ljava/awt/Color;)V �!�] �Z�[�c�setDashedStroke�setFont�(Ljava/awt/Font;)V �c�e�d� java/awt/Font �f�g� getSize2D�()F �!�i �`�j�(ID)V�f�Ljava/awt/Font;�setPlainStroke�setStrokeThickness�(D)V�t� saveToDisk�(Ljava/lang/String;)V� Exceptions�u�7fr/orsay/lri/varna/exceptions/ExceptionWritingForbidden�w�java/io/FileWriter �v�y � �r �!�{ �|�}�export�()Ljava/lang/String; �v� ��r�write �v� ���close ����java/io/IOException ��}� getMessage �t�y�path�fout�Ljava/io/FileWriter;�e�Ljava/io/IOException;� SourceFile�SecStrProducerGraphics.java�!�������������� � ����� � ����� ������F����� *�*+��������������� ��������� ������� �����������E����� *�+*�� ������� ����� ��������� ������� �&�'���(�)�����g��� ��������������!����H������������*� �����+� �����,� �����-� �����.� � ����/� � ��0�1�����j� � ���*�')ww*�2�4������� ����$��%����4������������7� �����8� �����9� �����:� ���;�<�����o� ����#*�'�=kc)w�=kg�=k*�2�?������� ����(�"�)����*����#�������#�*� ����#�+� ����#�A� ���B�1�����S��� ��������������.����4������������*� �����+� �����C� �����D� ���E�)�����g��� ��������������4����H������������*� �����+� �����C� �����D� �����,� � ����-� � ��F�G�����Y����� *�(w+�H������� ����7� �8����*���� ������� �L�M���� �*� ���� �+� ���N������E����� *�+*�� ������� ����;� �<�������� ������� �&�'���O�<�����v� ����**�'�=kc)w�=kg�=k*�2*��P�S������� ����?�)�@����*����*�������*�*� ����*�+� ����*�A� ���V�1�����S��� ��������������E����4������������*� �����+� �����C� �����D� ���W�)�����g��� ��������������K����H������������*� �����+� �����C� �����D� �����,� � ����-� � ��������2�����*��P�����������M���� ����������X�Y�����6����������������R����������������&�M���Z�[�����A����� *�+�\������� ����V��W�������� ������� �^� ���_������+�����������������\���� ����������`�a�����G�����*�+�b�h������� ����`��a����������������k�l���m������+�����������������f���� ����������n�o�����>�����*'�2������� ����i��j����������������p� ���q�r��s�����t���������)�vY+�xM,*��z�~,��N�tY-�����������������p� �q��r��s��t�(�v����4����)�������)��M�� �����(������ ���������PK �����p=!_7 �� ��<���fr/orsay/lri/varna/models/export/SecStrProducerGraphics.javapackage fr.orsay.lri.varna.models.export; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Shape; import java.awt.geom.Ellipse2D; import java.awt.geom.GeneralPath; import java.io.FileWriter; import java.io.IOException; import fr.orsay.lri.varna.exceptions.ExceptionWritingForbidden; import fr.orsay.lri.varna.models.rna.RNA; public class SecStrProducerGraphics implements VueVARNAGraphics{ SecStrDrawingProducer _ss; double _thickness; Color _color; public SecStrProducerGraphics(SecStrDrawingProducer ss) { _ss = ss; } public void draw(GeneralPath s) { _ss.fillPolygon(s, getColor()); } public void drawArc(double x, double y, double rx, double ry, double angleStart, double angleEnd) { // TODO Auto-generated method stub } public void drawLine(double x1, double y1, double x2, double y2) { this._ss.drawLine(x1, -y1, x2, -y2, _thickness); } public void drawCircle(double x, double y, double r) { _ss.drawCircle(x+0.5*r, -y-0.5*r, 0.5*r, _thickness); } public void drawRect(double x, double y, double w, double h) { // TODO Auto-generated method stub } public void drawRoundRect(double x, double y, double w, double h, double rx, double ry) { // TODO Auto-generated method stub } public void drawStringCentered(String res, double x, double y) { _ss.drawText(x, -y, res); } public void fill(GeneralPath s) { _ss.fillPolygon(s, getColor()); } public void fillCircle(double x, double y, double r) { _ss.fillCircle(x+0.5*r, -y-0.5*r, 0.5*r, _thickness, _ss.getCurrentColor()); } public void fillRect(double x, double y, double w, double h) { // TODO Auto-generated method stub } public void fillRoundRect(double x, double y, double w, double h, double rx, double ry) { // TODO Auto-generated method stub } public Color getColor() { return _ss.getCurrentColor(); } public Dimension getStringDimension(String s) { // TODO Auto-generated method stub return null; } public void setColor(Color c) { _ss.setColor(c); } public void setDashedStroke() { // TODO Auto-generated method stub } public void setFont(Font f) { //System.out.println("Font "+f.getSize2D()); _ss.setFont(_ss.FONT_HELVETICA_BOLD,f.getSize2D()); } public void setPlainStroke() { // TODO Auto-generated method stub } public void setStrokeThickness(double t) { _thickness = t; } public void saveToDisk(String path) throws ExceptionWritingForbidden { FileWriter fout; try { fout = new FileWriter(path); fout.write(_ss.export()); fout.close(); } catch (IOException e) { throw new ExceptionWritingForbidden(e.getMessage()); } } } PK �����4F>Y7����7���fr/orsay/lri/varna/models/export/VueVARNAGraphics.class���1�$��1fr/orsay/lri/varna/models/export/VueVARNAGraphics��java/lang/Object�getStringDimension�((Ljava/lang/String;)Ljava/awt/Dimension;�drawStringCentered�(Ljava/lang/String;DD)V�setColor�(Ljava/awt/Color;)V�getColor�()Ljava/awt/Color;�drawLine�(DDDD)V�drawRect�fillRect� drawCircle�(DDD)V� fillCircle� drawRoundRect� (DDDDDD)V� fillRoundRect�drawArc�draw�(Ljava/awt/geom/GeneralPath;)V�fill�setFont�(Ljava/awt/Font;)V�setDashedStroke�()V�setPlainStroke�setStrokeThickness�(D)V� SourceFile�VueVARNAGraphics.java���������������� � ��� � ��� ���������������������������������������������������� �!����"����#PK �����p=t,����6���fr/orsay/lri/varna/models/export/VueVARNAGraphics.javapackage fr.orsay.lri.varna.models.export; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.GeneralPath; public interface VueVARNAGraphics { public Dimension getStringDimension(String s); public void drawStringCentered(String res, double x, double y); public void setColor(Color c); public Color getColor(); public void drawLine(double x1, double y1, double x2, double y2); public void drawRect(double x, double y, double w, double h); public void fillRect(double x, double y, double w, double h); public void drawCircle(double x, double y, double r); public void fillCircle(double x, double y, double r); public void drawRoundRect(double x, double y, double w, double h, double rx, double ry); public void fillRoundRect(double x, double y, double w, double h, double rx, double ry); public void drawArc(double x, double y, double rx, double ry, double angleStart, double angleEnd); //public void drawString(String s, double x, double y); public void draw(GeneralPath s); public void fill(GeneralPath s); public void setFont(Font f); public void setDashedStroke(); public void setPlainStroke(); public void setStrokeThickness(double t); } PK �����4F>|:#I#��I#��/���fr/orsay/lri/varna/models/export/PSExport.class���1D��)fr/orsay/lri/varna/models/export/PSExport��6fr/orsay/lri/varna/models/export/SecStrDrawingProducer��()V�Code �� ��?ٙ �� ���setScale�(D)V�LineNumberTable�LocalVariableTable�this�+Lfr/orsay/lri/varna/models/export/PSExport;�PSMacros�()Ljava/lang/String;��N/setbasefont { /Helvetica-Bold findfont exch scalefont setfont } def ��e/txtcenter { dup stringwidth pop 2 div neg 3 -1 roll 2 div neg rmoveto show } def ��/ellipse { /endangle exch def /startangle exch def /yrad exch def /xrad exch def /y exch def /x exch def /savematrix matrix currentmatrix def x y translate xrad yrad scale 0 0 1 startangle endangle arc savematrix setmatrix } def ��java/lang/StringBuilder ��!� �java/lang/String �"�#�valueOf�&(Ljava/lang/Object;)Ljava/lang/String; ��% ��&�(Ljava/lang/String;)V ��( �)�*�append�-(Ljava/lang/String;)Ljava/lang/StringBuilder; ��, �-��toString� setFontSize�Ljava/lang/String;�writeTextCentered� drawEllipse� EPSHeader�(DDDD)Ljava/lang/String; ��5 �6�3�PSBBox�8�%!PS-Adobe-3.0 %%Pages: 1 �:�%%EndComments �<� %%Page: 1 1 ��> ���minX�D�maxX�minY�maxY�bbox�init�macros� EPSFooter�I�showpage %%EndPage: 1 %%EOF� PSNewPath�L�newpath �PSMoveTo�(DD)Ljava/lang/String; �� ��Q �)�R�(D)Ljava/lang/StringBuilder;�T� �V� moveto �x�y�PSLineTo�[� lineto �dx�dy� PSRLineTo�`� rlineto �PSSetLineWidth�(D)Ljava/lang/String;@��������f� setlinewidth � thickness�PSStroke�j�stroke �PSArc�(DDDDDD)Ljava/lang/String; ��n �"�b�p� ellipse �radiusX�radiusY� angleFrom�angleTo�centerX�centerY�(DDDDD)Ljava/lang/String;�y� arc �radius�|�%%BoundingBox: �~���java/lang/Math ���floor�(D)D �� �)��(J)Ljava/lang/StringBuilder; �~� ���ceil�� ��%%HighResBoundingBox: �norm�high�PSText�&(Ljava/lang/String;)Ljava/lang/String;��(��) �txt�PSShow��show � PSClosePath�� closepath �PSFill��fill � PSSetColor�$(Ljava/awt/Color;)Ljava/lang/String; ����java/awt/Color ���getRed�()I@o����� �� ���getGreen �� ���getBlue�� setrgbcolor �col�Ljava/awt/Color;�fontName�(I)Ljava/lang/String;�� /Times-Roman�� /Times-Bold�� /Times-Italic��/Times-BoldItalic�� /Helvetica��/Helvetica-Bold��/Helvetica-Oblique��/Helvetica-BoldOblique��/Courier�� /Courier-Bold��/Courier-Oblique��/Courier-BoldOblique�font�I� PSSetFont�(ID)Ljava/lang/String; �� ���� findfont �� scalefont setfont �size�setFontS �� ��@� _fontsize �� ��� setColorS �� �� �� ���result� drawLineS�Q(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)Ljava/lang/String;��� ����java/awt/geom/Point2D$Double �W�@ �� �X�@ �� �M�N �� �Y�N �� �a�b �� �h��p0�Ljava/awt/geom/Point2D$Double;�p1�tmp� drawTextS�D(Ljava/awt/geom/Point2D$Double;Ljava/lang/String;)Ljava/lang/String;�� �� ��� txtcenter �p�drawRectangleS � �J� � �^�N � ���orig�dims� drawCircleS�4(Ljava/awt/geom/Point2D$Double;DD)Ljava/lang/String;@v����� � �k�w� fillCircleS�D(Ljava/awt/geom/Point2D$Double;DDLjava/awt/Color;)Ljava/lang/String; � ���color�footerS � �G��headerS�6(Ljava/awt/geom/Rectangle2D$Double;)Ljava/lang/String; �� java/awt/geom/Rectangle2D$Double � ! "�@�width $ %�@�height �' �2�3�bb�"Ljava/awt/geom/Rectangle2D$Double;�drawArcS�6(Ljava/awt/geom/Point2D$Double;DDDD)Ljava/lang/String; �- �k�l�origine� startAngle�endAngle� drawPolygonS�4([Ljava/awt/geom/Point2D$Double;D)Ljava/lang/String;�points�[Ljava/awt/geom/Point2D$Double;�i� fillPolygonS�C([Ljava/awt/geom/Point2D$Double;Ljava/awt/Color;)Ljava/lang/String; �9 :�� _curColor�bck� SourceFile� PSExport.java� InnerClasses@�java/awt/geom/Point2D�DoubleC�java/awt/geom/Rectangle2D�!������� ��������>����� *�*� � �����������!��"� �#���� ���� ������������|����� LMN�Y+��$,�'-�'�+�����������(��&��0��.��9� �@����*���� �������.�/����0�/�� ��1�/���2�3������ � ���D*')�4: �Y7�$ �'9�';�'�+: *�=: �Y ��$ �'�+�����������D� �E��F�$�E�)�G�/�H����R����D�������D�?�@����D�A�@����D�B�@����D�C�@�� �8�D�/� �)��E�/� �/��F�/� ��G������-�����H�����������L���� ����������J������-�����K�����������P���� ����������M�N�����[������Y�O'�PS�')�PU�'�+�����������T���� ������������W�@�����X�@���Y�N�����[������Y�O'�PS�')�PZ�'�+�����������X���� ������������\�@�����]�@���^�N�����[������Y�O'�PS�')�P_�'�+�����������\���� ������������\�@�����]�@���a�b�����R�����'�coH�Y�O'�Pe�'�+������� ����`��a����������������g�@���h������-�����i�����������e���� ����������k�l����������\'�coc9 )9�Y �m�$S�'�PS�'�co�PS�'�co�PS�' �PS�' �Po�'�+�����������k� �l� �q�8�r�X�q����\� ���\�������\�W�@����\�X�@����\�q�@����\�r�@����\�s�@� ���\�t�@� � �R�u�@� � �O�v�@���k�w������� ���;�Y�O'�PS�')�PS�'�PS�'�PS�' �Px�'�+�����������y�-�z�7�y����>����;�������;�W�@����;�X�@����;�z�@����;�s�@����;�t�@� ��6�3����#�� ����Y{�$'�}�S�'�}�S�')��S�'���'�+: �Y�$'�}�S�'�}�S�')��S�'���'�+: �Y ��$ �'�+�������&� ���~���1��?�~�D��Z��u���������H������������?�@�����A�@�����B�@�����C�@��D�Y��/� ����/� ��������J������Y�$+�'�'�+����������������������������/���������-�������������������� ����������������-�������������������� ����������������-�������������������� ����������������~�����>�Y�O+��o�PS�'+��o�PS�'+��o�P�'�+��������������)��:���������>�������>�������������������������������_���b���e���h���������������������������w���z���}������k���q���n���tðŰǰɰ˰�������:�����`��c��f��i��l��o��r��u��x��{��~�������������������������������_�����!�Y*�Ѹ��$Ӷ�'(�Pն�'�+��������������� ����!�������!������!��@���������W�����*� (k�**�ٷ�ܰ������� ����� ����� �������������������@���������T�����*+�W*+�M,�������������� ����� ��������������� ���/��������������x:�Y��$*+�+���'�+:�Y��$*,�,���'�+:�Y��$*)��'�+:�Y��$*��'�+:��������������$��D��]��u�����4����x�������x������x������x�g�@���t��/��������������pN�Y-��$*+�+���'�+N�Y-��$*��coc�P�'�+N�Y-��$*,��'�+N�Y-��$��'�+N-��������������!��B��Y��n�����*����p�������p�����p��/���m��/�������<�����*:�Y��$*+�+���'�+:�Y��$*,��'�+:�Y��$*,��'�+:�Y��$*,�w�'�+:�Y��$*�'�+:�Y��$*)��'�+:�Y��$*��'�+:�������&� ������&��C��`��~�����������4����������� ����� ������g�@�����/��  ������ ����`*:�Y��$*+�+�(�'�+:�Y��$*��'�+:�Y��$*��'�+:��������������+��E��]�����4����`�������`�����`�z�@����`�g�@���Z��/�������� ����z*:�Y��$*+�+�(�'�+:�Y��$*��'�+:�Y��$*��'�+:�Y��$*�'�+:��������������+��E��_��w�����>����z�������z�����z�z�@����z�g�@����z����t��/��������/�����*��������������� ��������������S� ����*++++ c++#c&�������������������������()��*+������� ���(�Y*+�+�(,��$*��'�+����������� �$����>����(�������(.�����("�@����(%�@����(/�@����(0�@��12����,�����*:�Y��$*(��'�+:6�Z�,�Y��$*+2�+2���'�+:�)�Y��$*+2�+2���'�+:+�Y��$*�'�+:�Y��$*��'�+:�������*� �����%�*�S�y�������4�����������34�����g�@�����/��"�a5���67����\�����*8N*:6�Z�,�Y��$*+2�+2���'�+:�)�Y��$*+2�+2���'�+:+�Y��$*�'�+:�Y��$*,��'�+:�Y��$*�'�+:�Y��$*-��'�+:�������2� ����  �!�"�?$�e �o'�(�)�*�+����>�����������34��������;��� ���/���a5���<���=>�����?A� BA� PK �����N=h"��"��.���fr/orsay/lri/varna/models/export/PSExport.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.Color; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.geom.Point2D.Double; /** * @author ponty * */ public class PSExport extends SecStrDrawingProducer { public PSExport() { super(); super.setScale(0.4); } private String PSMacros() { String setFontSize = // Params [fontsize|...] "/setbasefont \n" + "{ /Helvetica-Bold findfont\n" + // => // [font|scale|...] " exch scalefont\n" + // => [scaled_font|...] " setfont \n" + // => [...] " } def\n\n"; String writeTextCentered = // Params [txt|size|...] "/txtcenter \n" + "{ dup \n" + // => [txt|txt|size|...] " stringwidth pop\n" + // => [wtxt|txt|size|...] " 2 div neg \n" + // => [-wtxt/2|txt|size|...] " 3 -1 roll \n" + // => [size|-wtxt/2|txt...] " 2 div neg\n" + // => [-size/2|-wtxt/2|txt|...] " rmoveto\n" + // => [txt|...] " show\n" + // => [...] " } def\n\n"; String drawEllipse = "/ellipse {\n" + " /endangle exch def\n" + " /startangle exch def\n" + " /yrad exch def\n" + " /xrad exch def\n" + " /y exch def\n" + " /x exch def\n" + " /savematrix matrix currentmatrix def\n" + " x y translate\n" + " xrad yrad scale\n" + " 0 0 1 startangle endangle arc\n" + " savematrix setmatrix\n" + " } def\n\n"; return setFontSize + writeTextCentered + drawEllipse; } private String EPSHeader(double minX, double maxX, double minY, double maxY) { String bbox = PSBBox(minX, minY, maxX, maxY); String init = "%!PS-Adobe-3.0\n" + "%%Pages: 1\n" + bbox + "%%EndComments\n" + "%%Page: 1 1\n"; String macros = PSMacros(); return init + macros; } private String EPSFooter() { return "showpage\n" + "%%EndPage: 1\n" + "%%EOF"; } private String PSNewPath() { return ("newpath\n"); } private String PSMoveTo(double x, double y) { return ("" + x + " " + y + " moveto\n"); } private String PSLineTo(double dx, double dy) { return ("" + dx + " " + dy + " lineto\n"); } private String PSRLineTo(double dx, double dy) { return ("" + dx + " " + dy + " rlineto\n"); } private String PSSetLineWidth(double thickness) { thickness /= 2; return ("" + thickness + " setlinewidth\n"); } private String PSStroke() { return ("stroke\n"); } private String PSArc(double x, double y, double radiusX, double radiusY, double angleFrom, double angleTo) { double centerX = x + radiusX / 2.0; double centerY = y; // return (centerX + " " + centerY + " "+ radiusX/2.0+" " + angleFrom + // " " + angleTo + " arc\n"); return (centerX + " " + centerY + " " + radiusX / 2.0 + " " + radiusY / 2.0 + " " + angleFrom + " " + angleTo + " ellipse\n"); } private String PSArc(double x, double y, double radius, double angleFrom, double angleTo) { return ("" + x + " " + y + " " + radius + " " + angleFrom + " " + angleTo + " arc\n"); } private String PSBBox(double minX, double maxX, double minY, double maxY) { String norm = ("%%BoundingBox: " + (long) Math.floor(minX) + " " + (long) Math.floor(minY) + " " + (long) Math.ceil(maxX) + " " + (long) Math.ceil(maxY) + "\n"); String high = ("%%HighResBoundingBox: " + (long) Math.floor(minX) + " " + (long) Math.floor(minY) + " " + (long) Math.ceil(maxX) + " " + (long) Math.ceil(maxY) + "\n"); return norm + high; } private String PSText(String txt) { return ("(" + txt + ") "); } @SuppressWarnings("unused") private String PSShow() { return ("show\n"); } private String PSClosePath() { return ("closepath\n"); } private String PSFill() { return ("fill\n"); } private String PSSetColor(Color col) { return ("" + (((double) col.getRed()) / 255.0) + " " + (((double) col.getGreen()) / 255.0) + " " + (((double) col.getBlue()) / 255.0) + " setrgbcolor\n"); } private String fontName(int font) { switch (font) { case (FONT_TIMES_ROMAN): return "/Times-Roman"; case (FONT_TIMES_BOLD): return "/Times-Bold"; case (FONT_TIMES_ITALIC): return "/Times-Italic"; case (FONT_TIMES_BOLD_ITALIC): return "/Times-BoldItalic"; case (FONT_HELVETICA): return "/Helvetica"; case (FONT_HELVETICA_BOLD): return "/Helvetica-Bold"; case (FONT_HELVETICA_OBLIQUE): return "/Helvetica-Oblique"; case (FONT_HELVETICA_BOLD_OBLIQUE): return "/Helvetica-BoldOblique"; case (FONT_COURIER): return "/Courier"; case (FONT_COURIER_BOLD): return "/Courier-Bold"; case (FONT_COURIER_OBLIQUE): return "/Courier-Oblique"; case (FONT_COURIER_BOLD_OBLIQUE): return "/Courier-BoldOblique"; } return "/Helvetica"; } private String PSSetFont(int font, double size) { return (fontName(font) + " findfont " + size + " scalefont setfont\n"); } public String setFontS(int font, double size) { _fontsize = (long) (0.4 * size); return PSSetFont(font, _fontsize); } public String setColorS(Color col) { super.setColorS(col); String result = PSSetColor(col); return result; } public String drawLineS(Point2D.Double p0, Point2D.Double p1, double thickness) { String tmp = ""; tmp += PSMoveTo(p0.x, p0.y); tmp += PSLineTo(p1.x, p1.y); tmp += PSSetLineWidth(thickness); tmp += PSStroke(); return tmp; } public String drawTextS(Point2D.Double p, String txt) { String tmp = ""; tmp += PSMoveTo(p.x, p.y); tmp += ("" + (_fontsize / 2.0 + 1) + " \n"); tmp += PSText(txt); tmp += (" txtcenter\n"); return tmp; } public String drawRectangleS(Point2D.Double orig, Point2D.Double dims, double thickness) { String tmp = PSNewPath(); tmp += PSMoveTo(orig.x, orig.y); tmp += PSRLineTo(0, dims.y); tmp += PSRLineTo(dims.x, 0); tmp += PSRLineTo(0, -dims.y); tmp += PSClosePath(); tmp += PSSetLineWidth(thickness); tmp += PSStroke(); return tmp; } public String drawCircleS(Point2D.Double p, double radius, double thickness) { String tmp = PSNewPath(); tmp += PSArc(p.x, p.y, radius, 0, 360); tmp += PSSetLineWidth(thickness); tmp += PSStroke(); return tmp; } public String fillCircleS(Point2D.Double p, double radius, double thickness, Color color) { String tmp = PSNewPath(); tmp += PSArc(p.x, p.y, radius, 0, 360); tmp += PSSetLineWidth(thickness); tmp += PSSetColor(color); tmp += PSFill(); return tmp; } public String footerS() { return EPSFooter(); } public String headerS(Rectangle2D.Double bb) { return EPSHeader(bb.x, bb.y, bb.x + bb.width, bb.y + bb.height); } @Override public String drawArcS(Point2D.Double origine, double width, double height, double startAngle, double endAngle) { return PSArc(origine.x, origine.y, width, height, startAngle, endAngle) + PSStroke(); } @Override public String drawPolygonS(Double[] points, double thickness) { String tmp = PSNewPath(); tmp += PSSetLineWidth(thickness); for (int i = 0; i < points.length; i++) { if (i == 0) { tmp += PSMoveTo(points[i].x, points[i].y); } else { tmp += PSLineTo(points[i].x, points[i].y); } } tmp += PSClosePath(); tmp += PSStroke(); return tmp; } @Override public String fillPolygonS(Double[] points, Color color) { Color bck = _curColor; String tmp = PSNewPath(); for (int i = 0; i < points.length; i++) { if (i == 0) { tmp += PSMoveTo(points[i].x, points[i].y); } else { tmp += PSLineTo(points[i].x, points[i].y); } } tmp += PSClosePath(); tmp += PSSetColor(color); tmp += PSFill(); tmp += PSSetColor(bck); return tmp; } }PK �����4F>M��M��5���fr/orsay/lri/varna/models/export/GraphicElement.class���1���/fr/orsay/lri/varna/models/export/GraphicElement��java/lang/Object��()V�Code �� ���LineNumberTable�LocalVariableTable�this�1Lfr/orsay/lri/varna/models/export/GraphicElement;� SourceFile�GraphicElement.java!���������������/�����*����� �������� ��� ����� � ��������PK �����nq<_ h��h��4���fr/orsay/lri/varna/models/export/GraphicElement.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; public abstract class GraphicElement { } PK �����4F>V0{��{��2���fr/orsay/lri/varna/models/export/FontCommand.class���1���,fr/orsay/lri/varna/models/export/FontCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_font�I�_size�D��(ID)V�Code �� � ��()V �� �� �� ���LineNumberTable�LocalVariableTable�this�.Lfr/orsay/lri/varna/models/export/FontCommand;�font�size�get_font�()I�get_size�()D� SourceFile�FontCommand.java�!������������������ � �� ���Y�����*� *�*(��������������� ������� ������������������������� ���/�����*���������������� ������������� ���/�����*������������"���� ��������������PK �����nq<\y]��]��1���fr/orsay/lri/varna/models/export/FontCommand.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; public class FontCommand extends GraphicElement { private int _font; private double _size; public FontCommand(int font, double size) { _font = font; _size = size; } public int get_font() { return _font; } public double get_size() { return _size; } } PK �����4F>[vy"��"��3���fr/orsay/lri/varna/models/export/ColorCommand.class���1���-fr/orsay/lri/varna/models/export/ColorCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_color�Ljava/awt/Color;��(Ljava/awt/Color;)V�Code �� �� �()V �� ���LineNumberTable�LocalVariableTable�this�/Lfr/orsay/lri/varna/models/export/ColorCommand;�c�getColor�()Ljava/awt/Color;� SourceFile�ColorCommand.java�!����������������� ���F����� *� *+� �������������� ��������� ������� �������� ���/�����*� ��������������� ��������������PK �����nq<ݻPg����2���fr/orsay/lri/varna/models/export/ColorCommand.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.Color; public class ColorCommand extends GraphicElement { Color _color; public ColorCommand(Color c) { _color = c; } public Color getColor() { return _color; } } PK �����4F>5gr����2���fr/orsay/lri/varna/models/export/LineCommand.class���1�*��,fr/orsay/lri/varna/models/export/LineCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_orig�Ljava/awt/geom/Point2D$Double;�_dest� _thickness�D��@(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)V�Code �� � ��()V �� �� �� �� �� �� �LineNumberTable�LocalVariableTable�this�.Lfr/orsay/lri/varna/models/export/LineCommand;�orig�dest� thickness�get_orig� ()Ljava/awt/geom/Point2D$Double;�get_dest� get_thickness�()D� SourceFile�LineCommand.java� InnerClasses�&�java/awt/geom/Point2D$Double�(�java/awt/geom/Point2D�Double�!������������������ ����� � �� ���l�����*� *+�*,�*)��������������� ����� ����*������������������������� ������ ���/�����*������������#���� ������������� ���/�����*������������'���� ���������� �!�� ���/�����*������������+���� ����������"����#�$��� ��%�'�)� PK �����nq}8X��X��5���fr/orsay/lri/varna/models/export/PolygonCommand.class���1�%��/fr/orsay/lri/varna/models/export/PolygonCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_points�[Ljava/awt/geom/Point2D$Double;� _thickness�D��#([Ljava/awt/geom/Point2D$Double;D)V�Code �� � ��()V �� �� �� ���LineNumberTable�LocalVariableTable�this�1Lfr/orsay/lri/varna/models/export/PolygonCommand;�points� thickness� get_points�!()[Ljava/awt/geom/Point2D$Double;� get_thickness�()D� SourceFile�PolygonCommand.java� InnerClasses�!�java/awt/geom/Point2D$Double�#�java/awt/geom/Point2D�Double�!������������������ � �� ���Y�����*� *+�*(��������������� ������� ������������������������� ���/�����*������������!���� ������������� ���/�����*������������%���� ������������������ �� �"�$� PK �����nqC;4����9���fr/orsay/lri/varna/models/export/FillPolygonCommand.class���1�%��3fr/orsay/lri/varna/models/export/FillPolygonCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_points�[Ljava/awt/geom/Point2D$Double;�_color�Ljava/awt/Color;��2([Ljava/awt/geom/Point2D$Double;Ljava/awt/Color;)V�Code �� � ��()V �� �� �� ���LineNumberTable�LocalVariableTable�this�5Lfr/orsay/lri/varna/models/export/FillPolygonCommand;�points�color� get_points�!()[Ljava/awt/geom/Point2D$Double;� get_color�()Ljava/awt/Color;� SourceFile�FillPolygonCommand.java� InnerClasses�!�java/awt/geom/Point2D$Double�#�java/awt/geom/Point2D�Double�!������������������ � �� ���Y�����*� *+�*,��������������� � ��!���� ������������������������� ���/�����*������������$���� ������������� ���/�����*������������)���� ������������������ �� �"�$� PK �����nq<9U0������8���fr/orsay/lri/varna/models/export/FillPolygonCommand.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.Color; import java.awt.geom.Point2D; public class FillPolygonCommand extends GraphicElement { private Point2D.Double[] _points; //private double _thickness; private Color _color; public FillPolygonCommand(Point2D.Double[] points, Color color) { _points = points; _color = color; } public Point2D.Double[] get_points() { return _points; } public Color get_color() { return _color; } } PK �����4F>sx��x��1���fr/orsay/lri/varna/models/export/XFIGExport.class���1��+fr/orsay/lri/varna/models/export/XFIGExport��6fr/orsay/lri/varna/models/export/SecStrDrawingProducer�_font�I�buf�Ljava/lang/StringBuffer;� _definedCols�Ljava/util/Hashtable;� Signature�:Ljava/util/Hashtable;� _nextColCode�UPPER_BOUND_COLOR_CODE� ConstantValue����()V�Code �� �� �� ����java/lang/StringBuffer �� �� ����java/util/Hashtable �� ��! � � ��# � �@4������ ��' �(�)�setScale�(D)V�LineNumberTable�LocalVariableTable�this�-Lfr/orsay/lri/varna/models/export/XFIGExport;�ensureColorDefinition�$(Ljava/awt/Color;)Ljava/lang/String; ��1 �2�3� containsKey�(Ljava/lang/Object;)Z �5�7�6�java/lang/Integer �8�9�valueOf�(I)Ljava/lang/Integer; ��; �<�=�put�8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; �?�A�@�java/awt/Color �B�C�getRed�()I �5�E �F�G� toHexString�(I)Ljava/lang/String; �I�K�J�java/lang/String �L�C�length�N�java/lang/StringBuilder�P�0 �M�R ��S�(Ljava/lang/String;)V �M�U �V�W�append�-(Ljava/lang/String;)Ljava/lang/StringBuilder; �M�Y �Z�[�toString�()Ljava/lang/String; �?�] �^�C�getGreen �?�` �a�C�getBlue�c�# �I�e �f�[� toUpperCase�h�0 �M�j �V�k�(I)Ljava/lang/StringBuilder;�m� �o� �q���col�Ljava/awt/Color;� curColorCode�RGBR�Ljava/lang/String;�RGBG�RGBB�RGBHex� getColorCode�(Ljava/awt/Color;)I ��} �~��get�&(Ljava/lang/Object;)Ljava/lang/Object; �5� ��C�intValue�getCurColorCode �� ��s� _curColor� XFIGHeader��B#FIG 3.2 Landscape Center Inches Letter 100.00 Single -2 1200 2 � drawCircleS�4(Ljava/awt/geom/Point2D$Double;DD)Ljava/lang/String;��1 3 0 �M� �V��(J)Ljava/lang/StringBuilder; �� ��C�� 7 50 -1 -1 0.000 1 0.0000 ����java/awt/geom/Point2D$Double ���x�D �� ���y�� 1 1 1 1 �p�Ljava/awt/geom/Point2D$Double;�radius� thickness� drawLineS�Q(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)Ljava/lang/String;��2 1 0 �� 7 60 -1 -1 0.000 0 0 -1 0 0 2 �p0�p1�drawRectangleS��2 2 0 �� 7 50 -1 -1 0.000 0 0 -1 0 0 5 �� �dims� drawTextS�D(Ljava/awt/geom/Point2D$Double;Ljava/lang/String;)Ljava/lang/String;��4 1 �� 40 -1 �� ��� _fontsize�� 0.0000 6 @������ �M� �V��(D)Ljava/lang/StringBuilder;@�������@��������\001 �txt� fillCircleS�D(Ljava/awt/geom/Point2D$Double;DDLjava/awt/Color;)Ljava/lang/String; �� �.�/ �I� �8��&(Ljava/lang/Object;)Ljava/lang/String;�� 0 �� �z�{�� 50 0 20 0.000 1 0.0000 �coldef�setFontS�(ID)Ljava/lang/String;?333333�font�size� setColorS �� ��/�footerS�headerS�6(Ljava/awt/geom/Rectangle2D$Double;)Ljava/lang/String; �� ��[�bb�"Ljava/awt/geom/Rectangle2D$Double;�drawArcS�6(Ljava/awt/geom/Point2D$Double;DDDD)Ljava/lang/String;��5 1 0 1 �� 7 50 0 -1 4.000 0 0 0 0 �origine�width�height� startAngle�endAngle�p1x�p1y�p2x�p2y�p3x�p3y�cx�cy� drawPolygonS�4([Ljava/awt/geom/Point2D$Double;D)Ljava/lang/String;��2 3 0 1 � 7 40 0 -1 4.000 0 0 0 0 0 �java/lang/Math �round�(D)J�points�[Ljava/awt/geom/Point2D$Double;�result�i� fillPolygonS�C([Ljava/awt/geom/Point2D$Double;Ljava/awt/Color;)Ljava/lang/String;� 2 3 0 1 0 � 35 0 0 4.000 0 0 0 0 0 � SourceFile�XFIGExport.java� InnerClasses�java/awt/geom/Point2D�Double� java/awt/geom/Rectangle2D$Double�java/awt/geom/Rectangle2D�!����������������� � �� ���� �� ���������������������o�����-*�*�*�Y��*�Y�� * �"*�$�&����*�������(��� ��� ��#�%�)�,�*�+��� ����-�,�-����.�/���������*� +�0�*�"�*�"=*� +�4�:W*Y�"`�"+�>�DN-�H��MYO�Q-�T�XN+�\�D:�H��MYO�Q�T�X:+�_�D:�H��MYO�Q�T�X:�MYb�Q-�T�T�T�X:�d:�MYg�Q�il�T�Tn�T�Xp����*���J����.� �/��0��1�'�2�1�4�9�5�A�6�R�8�[�9�d�:�w�<��=��>��@��A��B��E�+���H�����,�-������r�s����t���9��u�v��[��w�v���_�x�v���'�y�v���z�{�����X�����*� +�0�*� +�|�5�����*�������I� �J��L�+��������,�-������r�s����C�����T�����"*� *��0�*� *��|�5�����*�������P��Q� �S�+��� ����"�,�-�����[�����-���������*�������W�+��� �����,�-���������������S�MY�Q�l�T*��i�T+��l�T+�w�l�T(�l�T(��T�X����*�������\��]�-�^�O�\�+���*����S�,�-�����S������S������S����������������^�MY�Q)�l�T*��i�Tl�T+��l�T+�w�l�T,��l�T,�w�n�T�X����*�������c��d�1�e�Z�c�+���*����^�,�-�����^������^������^����������'�����û�MY�Q)�l�T*��i�T�T+��l�T+�w�l�T+�,�c�l�T+�w�l�T+�,�c�l�T+�,�cw�l�T+��l�T+�,�cw�l�T+��l�T+�w�n�T�X����*���"����j��k�,�l�Q�m�q�n��o��p��j�+���*�����,�-����������������������������������MY�Q*��i�T*��il�T*���T�*�k�l�T�*�k�l�T+��l�T+��*�kgw�l�T,�Tȶ�T�X����*�������t�!�u�>�v�\�w�|�t�+��� �����,�-�������������v��������������e*�:�MY�Ϸ�Q�T�Ҷ�T*�Զ�iֶ�T+��l�T+�w�l�T(�l�T(��T�X����*�������|��}�$�~�:��a�}�+���>����e�,�-�����e������e������e������e�r�s���]��v���������W�����*�*�(k�p����*������������+��� �����,�-�����������������/�����D����� *+�W*+�Ͱ����*��� �������+������� �,�-����� �r�s����[�����-�����p����*��������+��� �����,�-����������9�����*�����*��������+��������,�-��������������������+�9 +�w9 +�(�oc9+�w�og9+�(c9 9 c�o9�oc9�MY�Q*��i�T�l�T�l�T �il�T �il�T�il�T�il�T�il�T�in�T�X����*���6� ������ ����'��/��3��>��I��^��������+��������,�-������������������������������������� � ���� ������'�����/�����3�����>�z����I�o����������T�����+��MY�Q*��i��T+`�in�T�X:6�>�MY�Ϸ�Q+2��il�T+2�w�il�T�X:+�MY�Ϸ�Q+2��il�T+2�w�il�T�X:�MY�Ϸ�Qn�T�X:p����*���B���������"��'��,��2��Q��e��j��t������������+���4�����,�-����� ��������,� �v��/�E ���  ����w�����+�*,�N�MY�Q*,�Զ�i�T+`�in�T�X:6�>�MY�Ϸ�Q+2��il�T+2�w�il�T�X:+�MY�Ϸ�Q+2��il�T+2�w�il�T�X:�MY�Ϸ�Qn�T�X:�MY-�Ϸ�Q�T�Xp����*���B������� ����/��4��:��Y��m��r��|������������+���>�����,�-����� �����r�s�� ���v��4� �v��7�E ������������ � PK �����̕<RH����0���fr/orsay/lri/varna/models/export/XFIGExport.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.Color; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.geom.Point2D.Double; import java.util.Hashtable; public class XFIGExport extends SecStrDrawingProducer { private int _font = SecStrDrawingProducer.FONT_TIMES_ROMAN; @SuppressWarnings("unused") private StringBuffer buf = new StringBuffer(); private Hashtable _definedCols = new Hashtable(); // From XFig 3.2 file format, indexed RGB colors are in the range [32,543] private int _nextColCode = 32; private final static int UPPER_BOUND_COLOR_CODE = 543; public XFIGExport() { super(); super.setScale(20.0); } private String ensureColorDefinition(Color col) { if (!_definedCols.containsKey(col)) { if (_nextColCode < UPPER_BOUND_COLOR_CODE) { int curColorCode = _nextColCode; _definedCols.put(col, curColorCode); _nextColCode++; String RGBR = Integer.toHexString(col.getRed()); if (RGBR.length() < 2) { RGBR = "0" + RGBR; } String RGBG = Integer.toHexString(col.getGreen()); if (RGBG.length() < 2) { RGBG = "0" + RGBG; } String RGBB = Integer.toHexString(col.getBlue()); if (RGBB.length() < 2) { RGBB = "0" + RGBB; } String RGBHex = "#" + RGBR + RGBG + RGBB; RGBHex = RGBHex.toUpperCase(); return "0 " + curColorCode + " " + RGBHex + "\n"; } } return ""; } private int getColorCode(Color col) { if (_definedCols.containsKey(col)) { return _definedCols.get(col); } return 0; } private int getCurColorCode() { if (_definedCols.containsKey(_curColor)) { return _definedCols.get(_curColor); } return 0; } private String XFIGHeader() { return "#FIG 3.2\n" + "Landscape\n" + "Center\n" + "Inches\n" + "Letter \n" + "100.00\n" + "Single\n" + "-2\n" + "1200 2\n"; } public String drawCircleS(Point2D.Double p, double radius, double thickness) { return ("1 3 0 " + (long) thickness + " " + getCurColorCode() + " 7 50 -1 -1 0.000 1 0.0000 " + (long) p.x + " " + (long) -p.y + " " + (long) radius + " " + (long) radius + " 1 1 1 1\n"); } public String drawLineS(Point2D.Double p0, Point2D.Double p1, double thickness) { return ("2 1 0 " + (long) thickness + " " + getCurColorCode() + " 7 60 -1 -1 0.000 0 0 -1 0 0 2\n" + " " + (long) p0.x + " " + (long) -p0.y + " " + (long) p1.x + " " + (long) -p1.y + "\n"); } public String drawRectangleS(Point2D.Double p, Point2D.Double dims, double thickness) { return ("2 2 0 " + (long) thickness + " " + getCurColorCode() + " 7 50 -1 -1 0.000 0 0 -1 0 0 5\n" + "\t " + (long) (p.x) + " " + (long) (-p.y) + " " + (long) (p.x + dims.x) + " " + (long) (-p.y) + " " + (long) (p.x + dims.x) + " " + (long) -(p.y + dims.y) + " " + (long) (p.x) + " " + (long) -(p.y + dims.y) + " " + (long) (p.x) + " " + (long) -(p.y) + "\n"); } public String drawTextS(Point2D.Double p, String txt) { return ("4 1 " + getCurColorCode() + " 40 -1 " + _font + " " + (long) _fontsize + " 0.0000 6 " + (long) 4 * _fontsize + " " + (long) (2 * _fontsize) + " " + (long) (p.x) + " " + (long) -(p.y - 6 * _fontsize) + " " + txt + "\\001\n"); } public String fillCircleS(Point2D.Double p, double radius, double thickness, Color col) { String coldef = ensureColorDefinition(col); return (coldef + "1 3 0 " + (long) thickness + " 0 " + getColorCode(col) + " 50 0 20 0.000 1 0.0000 " + (long) p.x + " " + (long) -p.y + " " + (long) radius + " " + (long) radius + " 1 1 1 1\n"); } public String setFontS(int font, double size) { _font = font; _fontsize = 1.2 * size; return ""; } public String setColorS(Color col) { super.setColorS(col); return (ensureColorDefinition(col)); } public String footerS() { return ""; } public String headerS(Rectangle2D.Double bb) { return XFIGHeader(); } @Override public String drawArcS(Point2D.Double origine, double width, double height, double startAngle, double endAngle) { double p1x = origine.x; double p1y = -origine.y; double p2x = origine.x + width / 2.0; double p2y = -origine.y - height / 2.0; double p3x = origine.x + width; double p3y = p1y; double cx = (p1x + p3x) / 2.0; double cy = p3y + height / 2.0; return ("5 1 0 1 " + getCurColorCode() + " 7 50 0 -1 4.000 0 0 0 0 " + cx + " " + cy + " " + (int) p1x + " " + (int) p1y + " " + (int) p2x + " " + (int) p2y + " " + (int) p3x + " " + (int) p3y + "\n"); } @Override public String drawPolygonS(Double[] points, double thickness) { if (points.length > 0) { String result = "2 3 0 1 " + getCurColorCode() + " 7 40 0 -1 4.000 0 0 0 0 0 " + (points.length + 1) + "\n"; for (int i = 0; i < points.length; i++) { result += (int) Math.round(points[i].x) + " " + (int) Math.round(-points[i].y) + " "; } result += (int) Math.round(points[0].x) + " " + (int) Math.round(-points[0].y) + " "; result += "\n"; return result; } else { return ""; } } @Override public String fillPolygonS(Double[] points, Color col) { if (points.length > 0) { String coldef = ensureColorDefinition(col); String result = "2 3 0 1 0 " + getColorCode(col) + " 35 0 0 4.000 0 0 0 0 0 " + (points.length + 1) + "\n"; for (int i = 0; i < points.length; i++) { result += (int) Math.round(points[i].x) + " " + (int) Math.round(-points[i].y) + " "; } result += (int) Math.round(points[0].x) + " " + (int) Math.round(-points[0].y) + " "; result += "\n"; return coldef + result; } else { return ""; } } }PK �����4F>e����4���fr/orsay/lri/varna/models/export/CircleCommand.class���1�*��.fr/orsay/lri/varna/models/export/CircleCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_base�Ljava/awt/geom/Point2D$Double;�_radius�D� _thickness��#(Ljava/awt/geom/Point2D$Double;DD)V�Code �� � ��()V �� �� �� �� �� � ��LineNumberTable�LocalVariableTable�this�0Lfr/orsay/lri/varna/models/export/CircleCommand;�base�radius� thickness�get_base� ()Ljava/awt/geom/Point2D$Double;� get_radius�()D� get_thickness� SourceFile�CircleCommand.java� InnerClasses�&�java/awt/geom/Point2D$Double�(�java/awt/geom/Point2D�Double�!����������������� ������ � �� ���m�����*� *+�*(�*��������������� ����� ����*������������������������������� ���/�����*������������#���� ����������� �� ���/�����*������������'���� ����������!� �� ���/�����*������������+���� ����������"����#�$��� ��%�'�)� PK �����nq<1[7��7��3���fr/orsay/lri/varna/models/export/CircleCommand.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.export; import java.awt.geom.Point2D; public class CircleCommand extends GraphicElement { private Point2D.Double _base; private double _radius; private double _thickness; public CircleCommand(Point2D.Double base, double radius, double thickness) { _base = base; _radius = radius; _thickness = thickness; } public Point2D.Double get_base() { return _base; } public double get_radius() { return _radius; } public double get_thickness() { return _thickness; } } PK �����4F>;����7���fr/orsay/lri/varna/models/export/RectangleCommand.class���1�*��1fr/orsay/lri/varna/models/export/RectangleCommand��/fr/orsay/lri/varna/models/export/GraphicElement�_orig�Ljava/awt/geom/Point2D$Double;�_dims� _thickness�D��@(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)V�Code �� � ��()V �� �� �� �� �� �� �LineNumberTable�LocalVariableTable�this�3Lfr/orsay/lri/varna/models/export/RectangleCommand;�orig�dims� thickness�get_orig� ()Ljava/awt/geom/Point2D$Double;�get_dims� get_thickness�()D� SourceFile�RectangleCommand.java� InnerClasses�&�java/awt/geom/Point2D$Double�(�java/awt/geom/Point2D�Double�!������������������ ����� � �� ���l�����*� *+�*,�*)��������������� ����� ����*������������������������� ������ ���/�����*������������#���� ������������� ���/�����*������������'���� ���������� �!�� ���/�����*������������+���� ����������"����#�$��� ��%�'�)� PK �����nq������������!���fr/orsay/lri/varna/models/naView/PK �����4F>~'w����.���fr/orsay/lri/varna/models/naView/Radloop.class���1�,��(fr/orsay/lri/varna/models/naView/Radloop��java/lang/Object�radius�D� loopnumber�I�next�*Lfr/orsay/lri/varna/models/naView/Radloop;�prev��()V�Code �� � � �LineNumberTable�LocalVariableTable�this� getRadius�()D �� ��� setRadius�(D)V� getLoopnumber�()I �� ��� setLoopnumber�(I)V�getNext�,()Lfr/orsay/lri/varna/models/naView/Radloop; ��# � � �setNext�-(Lfr/orsay/lri/varna/models/naView/Radloop;)V�getPrev ��( � � �setPrev� SourceFile� Radloop.java�!����������������� � ���� � ��� �� � �����/�����*���������������� ������ ����������/�����*���������������� ������ ����������>�����*'�������� ���������������� ����������������/�����*������������"���� ������ ����������>�����*�������� ����&��'���������� ���������� �!�����/�����*�"�����������*���� ������ ����$�%�����>�����*+�"������� ����.��/���������� ������ � ���&�!�����/�����*�'�����������2���� ������ ����)�%�����>�����*+�'������� ����6��7���������� ������ � ���*����+PK �����nqL����+���fr/orsay/lri/varna/models/naView/Loop.class���1���%fr/orsay/lri/varna/models/naView/Loop��java/lang/Object� nconnection�I� connections�Ljava/util/ArrayList;� Signature�DLjava/util/ArrayList;� _connections�Ljava/util/Hashtable;�WLjava/util/Hashtable;�number�depth�mark�Z�x�D�y�radius��()V�Code �� ����java/util/ArrayList �� �� ���!�java/util/Hashtable � � ��$ � � �LineNumberTable�LocalVariableTable�this�'Lfr/orsay/lri/varna/models/naView/Loop;�getNconnection�()I ��, ���setNconnection�(I)V� setConnection�1(ILfr/orsay/lri/varna/models/naView/Connection;)V�2�java/lang/Integer �1�4 ��. � �6 �7�8�put�8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; � �: �;�<� containsKey�(Ljava/lang/Object;)Z�>�+fr/orsay/lri/varna/models/naView/Connection �=� �1�A �B�C�valueOf�(I)Ljava/lang/Integer; � �E �F�G�get�&(Ljava/lang/Object;)Ljava/lang/Object; �=�I �J�K�setNull�(Z)V�i�c�-Lfr/orsay/lri/varna/models/naView/Connection;�n�Ljava/lang/Integer;� getConnection�0(I)Lfr/orsay/lri/varna/models/naView/Connection; �=�T �U�V�isNull�()Z� addConnection � �Y �Z�*�size� getNumber ��] ��� setNumber�getDepth ��a ���setDepth�isMark ��e ���setMark�getX�()D ��j ���setX�(D)V�getY ��o ���setY� getRadius ��s ��� setRadius�toString�()Ljava/lang/String;�x�Loop:�z�java/lang/StringBuilder �|�~�}�java/lang/String �B��&(Ljava/lang/Object;)Ljava/lang/String; �y� ���(Ljava/lang/String;)V�� nconnection �y� ���append�-(Ljava/lang/String;)Ljava/lang/StringBuilder; �y� ���(I)Ljava/lang/StringBuilder; �y� �u�v�� depth �result�Ljava/lang/String;� SourceFile� Loop.java�!����� ���������� ���� �� � �� ���� ���������������������������������������Q�����*�*�Y��*� Y�"�#����%��������������&��� �����'�(����)�*�����/�����*�+����%�������!�&��� �����'�(����-�.�����>�����*�+����%��� ����%��&�&��������'�(����������/�0����������H�1Y�3N,�*�#-,�5W�0*�#-�9�*�#-�=Y�?�5W*�#�@�D�=�H����%�������*� �+� �,��/�%�1�5�3�G�5�&���*����H�'�(�����H�L�����H�M�N�� �?�O�P���Q�R����������;�1Y�3M*�#,�9�*�#,�=Y�?�5W*�#,�D�=N-�S�-����%�������9� �:��;�$�<�0�=�7�>�9�@�&���*����;�'�(�����;�L��� �2�O�P��0� �M�N���W�0�����V�����*�#*�#�X�@,�5W����%��� ����E��F�&��� �����'�(������L������M�N���[�*�����/�����*�\����%�������J�&��� �����'�(����^�.�����>�����*�\����%��� ����N��O�&��������'�(����������_�*�����/�����*�`����%�������R�&��� �����'�(����b�.�����>�����*�`����%��� ����V��W�&��������'�(����������c�V�����/�����*�d����%�������Z�&��� �����'�(����f�K�����>�����*�d����%��� ����^��_�&��������'�(����������g�h�����/�����*�i����%�������b�&��� �����'�(����k�l�����>�����*'�i����%��� ����f��g�&��������'�(����������m�h�����/�����*�n����%�������j�&��� �����'�(����p�l�����>�����*'�n����%��� ����n��o�&��������'�(����������q�h�����/�����*�r����%�������r�&��� �����'�(����t�l�����>�����*'�r����%��� ����v��w�&��������'�(����������u�v�����{�����;wL�yY+�{��*�+��L�yY+�{��*�`��L+����%�������{��|��}�9�~�&�������;�'�(����8���������PK �����nq<=2ؕ �� ��*���fr/orsay/lri/varna/models/naView/Loop.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.naView; import java.util.ArrayList; import java.util.Hashtable; public class Loop { private int nconnection; private ArrayList connections = new ArrayList(); private Hashtable _connections = new Hashtable(); private int number; private int depth; private boolean mark; private double x, y, radius; public int getNconnection() { return nconnection; } public void setNconnection(int nconnection) { this.nconnection = nconnection; } public void setConnection(int i, Connection c) { Integer n = new Integer(i); if (c != null) _connections.put(n, c); else { if (!_connections.containsKey(n)) { _connections.put(n, new Connection()); } _connections.get(i).setNull(true); } } public Connection getConnection(int i) { Integer n = new Integer(i); if (!_connections.containsKey(n)) { _connections.put(n, new Connection()); } Connection c = _connections.get(n); if (c.isNull()) return null; else return c; } public void addConnection(int i, Connection c) { _connections.put(_connections.size(),c); } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } public int getDepth() { return depth; } public void setDepth(int depth) { this.depth = depth; } public boolean isMark() { return mark; } public void setMark(boolean mark) { this.mark = mark; } public double getX() { return x; } public void setX(double x) { this.x = x; } public double getY() { return y; } public void setY(double y) { this.y = y; } public double getRadius() { return radius; } public void setRadius(double radius) { this.radius = radius; } public String toString() { String result = "Loop:"; result += " nconnection "+nconnection; result += " depth "+depth; return result; } } PK �����4F>8tD ��D ��1���fr/orsay/lri/varna/models/naView/Connection.class���1�W��+fr/orsay/lri/varna/models/naView/Connection��java/lang/Object�loop�'Lfr/orsay/lri/varna/models/naView/Loop;�region�)Lfr/orsay/lri/varna/models/naView/Region;�start�I�end�xrad�D�yrad�angle�extruded�Z�broken�_isNull��()V�Code �� ����%fr/orsay/lri/varna/models/naView/Loop �� �� ����'fr/orsay/lri/varna/models/naView/Region �� ��" �� ��$ ���LineNumberTable�LocalVariableTable�this�-Lfr/orsay/lri/varna/models/naView/Connection;�isNull�()Z�setNull�(Z)V�getLoop�)()Lfr/orsay/lri/varna/models/naView/Loop;�setLoop�*(Lfr/orsay/lri/varna/models/naView/Loop;)V� getRegion�+()Lfr/orsay/lri/varna/models/naView/Region;� setRegion�,(Lfr/orsay/lri/varna/models/naView/Region;)V�getStart�()I ��8 � � �setStart�(I)V�getEnd ��= � � �setEnd�getXrad�()D ��B � � �setXrad�(D)V�getYrad ��G �� �setYrad�getAngle ��K �� �setAngle� isExtruded ��O ��� setExtruded�isBroken ��S ��� setBroken� SourceFile�Connection.java�!����� ������������ � ���� � ���� � ����� ����� ��������������������������Z����� *�*�Y��*�Y� �!*�#����%������������� ���&��� ���� �'�(����)�*�����/�����*�#����%�������#�&��� �����'�(����+�,�����>�����*�#����%��� ����'��(�&��������'�(������)����-�.�����/�����*�����%�������,�&��� �����'�(����/�0�����>�����*+�����%��� ����0��1�&��������'�(����������1�2�����/�����*�!����%�������4�&��� �����'�(����3�4�����>�����*+�!����%��� ����8��9�&��������'�(����������5�6�����/�����*�7����%�������<�&��� �����'�(����9�:�����>�����*�7����%��� ����@��A�&��������'�(������ � ���;�6�����/�����*�<����%�������D�&��� �����'�(����>�:�����>�����*�<����%��� ����H��I�&��������'�(������ � ���?�@�����/�����*�A����%�������L�&��� �����'�(����C�D�����>�����*'�A����%��� ����P��Q�&��������'�(������ � ���E�@�����/�����*�F����%�������T�&��� �����'�(����H�D�����>�����*'�F����%��� ����X��Y�&��������'�(������� ���I�@�����/�����*�J����%�������\�&��� �����'�(����L�D�����>�����*'�J����%��� ����`��a�&��������'�(������� ���M�*�����/�����*�N����%�������d�&��� �����'�(����P�,�����>�����*�N����%��� ����h��i�&��������'�(����������Q�*�����/�����*�R����%�������l�&��� �����'�(����T�,�����>�����*�R����%��� ����p��q�&��������'�(����������U����VPK �����nq<~SA ��A ��0���fr/orsay/lri/varna/models/naView/Connection.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.naView; public class Connection { private Loop loop = new Loop(); private Region region = new Region(); // Start and end form the 1st base pair of the region. private int start, end; private double xrad, yrad, angle; // True if segment between this connection and the // next must be extruded out of the circle private boolean extruded; // True if the extruded segment must be drawn long. private boolean broken; private boolean _isNull=false; public boolean isNull() { return _isNull; } public void setNull(boolean isNull) { _isNull = isNull; } public Loop getLoop() { return loop; } public void setLoop(Loop loop) { this.loop = loop; } public Region getRegion() { return region; } public void setRegion(Region region) { this.region = region; } public int getStart() { return start; } public void setStart(int start) { this.start = start; } public int getEnd() { return end; } public void setEnd(int end) { this.end = end; } public double getXrad() { return xrad; } public void setXrad(double xrad) { this.xrad = xrad; } public double getYrad() { return yrad; } public void setYrad(double yrad) { this.yrad = yrad; } public double getAngle() { return angle; } public void setAngle(double angle) { this.angle = angle; } public boolean isExtruded() { return extruded; } public void setExtruded(boolean extruded) { this.extruded = extruded; } public boolean isBroken() { return broken; } public void setBroken(boolean broken) { this.broken = broken; } } PK �����4F>',N��N��-���fr/orsay/lri/varna/models/naView/Region.class���1�+��'fr/orsay/lri/varna/models/naView/Region��java/lang/Object�_start1�I�_end1�_start2�_end2��()V�Code �� � � �LineNumberTable�LocalVariableTable�this�)Lfr/orsay/lri/varna/models/naView/Region;� getStart1�()I �� ��� setStart1�(I)V�start1�getEnd1 �� ���setEnd1�end1� getStart2 ��! ��� setStart2�start2�getEnd2 ��& � ��setEnd2�end2� SourceFile� Region.java�!���������������������� ���� �� � �� ���/�����*� ��������������� ������������� ���/�����*���������������� ������������� ���>�����*�������� ����������������������������� ���/�����*������������ ���� ������������� ���>�����*�������� ����$��%����������������������� ���/�����*� �����������(���� ����������"��� ���>�����*� ������� ����,��-����������������#����$��� ���/�����*�%�����������0���� ����������'��� ���>�����*�%������� ����4��5����������������(����)����*PK �����nq<]3����,���fr/orsay/lri/varna/models/naView/Region.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.naView; public class Region { private int _start1, _end1, _start2, _end2; public int getStart1() { return _start1; } public void setStart1(int start1) { this._start1 = start1; } public int getEnd1() { return _end1; } public void setEnd1(int end1) { this._end1 = end1; } public int getStart2() { return _start2; } public void setStart2(int start2) { this._start2 = start2; } public int getEnd2() { return _end2; } public void setEnd2(int end2) { this._end2 = end2; } } PK �����4F>P?d��d��-���fr/orsay/lri/varna/models/naView/NAView.class���1��'fr/orsay/lri/varna/models/naView/NAView��java/lang/Object�ANUM�D� ConstantValue@Ç�����MAXITER�I���bases�Ljava/util/ArrayList;� Signature�>Ljava/util/ArrayList;�nbase�nregion� loop_count�root�'Lfr/orsay/lri/varna/models/naView/Loop;�loops�>Ljava/util/ArrayList;�regions�@Ljava/util/ArrayList;�rlphead�*Lfr/orsay/lri/varna/models/naView/Radloop;�lencut�RADIUS_REDUCTION_FACTOR?ffffff�debug�Z�angleinc�_h�_listeVARNAListener�MLjava/util/ArrayList;�noIterationFailureYet� HELIX_FACTOR�BACKBONE_DISTANCE��()V�Code ��- �)�* ��/ �� ��1 � � �3�%fr/orsay/lri/varna/models/naView/Loop �2�- ��6 ���8�(fr/orsay/lri/varna/models/naView/Radloop �7�- ��; ��?陙 ��? �� ��A �� ��C � �!�E�java/util/ArrayList �D�- ��H �$� ��J �&�!?333333 ��N �'�@;������ ��R �(��LineNumberTable�LocalVariableTable�this�)Lfr/orsay/lri/varna/models/naView/NAView;�naview_xy_coordinates�B(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)I� Exceptions�[�6fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm�}(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)I �^�`�_�java/lang/System �a�b�out�Ljava/io/PrintStream;�W �e�g�f�java/io/PrintStream �h�i�println�(Ljava/lang/String;)V �D�k �l�m�size�()I �D�o �)�p�(I)V �r�t�s�java/lang/Integer �u�v�valueOf�(I)Ljava/lang/Integer; �D�x �y�z�add�(Ljava/lang/Object;)Z �D�| �}�~�get�(I)Ljava/lang/Object;��java/lang/Short �� ��� shortValue�()S �� ��� infoStructure�(Ljava/util/ArrayList;)V �r� ��m�intValue �� �� �� � ���%fr/orsay/lri/varna/models/naView/Base ��- �� ����'fr/orsay/lri/varna/models/naView/Region ��- �� ��� read_in_bases �� ��*� infoBasesMate �� ��*� find_regions �� ��*� infoRegions �� �� �� �� �� ���construct_loop�*(I)Lfr/orsay/lri/varna/models/naView/Loop; �� ��*�infoBasesExtracted �� ��*�find_central_loop �� ��*�infoRoot �� ��*� dump_loops �� ��� traverse_loop�W(Lfr/orsay/lri/varna/models/naView/Loop;Lfr/orsay/lri/varna/models/naView/Connection;)V@Y������ �� ���getX�()D ����java/lang/Double �u��(D)Ljava/lang/Double; �� ���getY� pair_table2�x�y�i� pair_table�j�index�LocalVariableTypeTable�(Ljava/util/ArrayList;�)Ljava/util/ArrayList;�*Ljava/util/ArrayList;�-(Ljava/util/ArrayList;)V�� structure:��java/lang/StringBuilder��# �� �)�i �� ���append�(I)Ljava/lang/StringBuilder;��: �� ���-(Ljava/lang/String;)Ljava/lang/StringBuilder; �� ���-(Ljava/lang/Object;)Ljava/lang/StringBuilder;�� �� ���toString�()Ljava/lang/String; �e� ��i�print �e� �h�*�� Bases mate: �� ��m�getMate��regions:��( �� ��m� getStart1�, � �m� getStart2�; �  �m�getEnd1 �  �m�getEnd2�) �Bases extracted:�i= � � isExtracted�()Z � ��(Z)Ljava/lang/StringBuilder;� �2 �m�getNconnection �2 !�m� getNumber#� root : %� depth= �2' (�m�getDepth*� mark= �2, -�isMark/� number=1� radius= �23 4�� getRadius �6 �7�(D)Ljava/lang/StringBuilder;9� x= �2�<� y= �2�?� nconnection=� �B C�p�setMate �E FG� setExtracted�(Z)V �I JK�setX�(D)V �M NK�setY�npairs� RTS�java/lang/Boolean �uU�(Z)Ljava/lang/Boolean; �W �� RY Z� booleanValue �\ ]�p� setStart1 �_ `�p�setEnd2 �Db cd�set�'(ILjava/lang/Object;)Ljava/lang/Object; �f gh� setRegion�,(Lfr/orsay/lri/varna/models/naView/Region;)V �j k�p�setEnd1 �m n�p� setStart2p� Regions are: �er st�printf�<(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;v�-Region %d is %d-%d and %d-%d with gap of %d. �mate�nb1�mark�*Ljava/util/ArrayList;�}�+fr/orsay/lri/varna/models/naView/Connection |�- �2 �p�setNconnection �2 �p�setDepth �2 �p� setNumber �2 K� setRadius �7 �m� getLoopnumber �73 �7 �getNext�,()Lfr/orsay/lri/varna/models/naView/Radloop; � � getRegion�+()Lfr/orsay/lri/varna/models/naView/Region;�-naview:Error detected in construct_loop. i = � not found in region table. �Z� �2 � setConnection�1(ILfr/orsay/lri/varna/models/naView/Connection;)V | �setLoop�*(Lfr/orsay/lri/varna/models/naView/Loop;)V |f | �p�setStart | �p�setEnd | G� setExtruded | G� setBroken�ibase�retloop�lp�cp�-Lfr/orsay/lri/varna/models/naView/Connection;�rp�)Lfr/orsay/lri/varna/models/naView/Region;�rlp�� Root loop is #%d �D �indexOf�(Ljava/lang/Object;)I�Loop %d has %d connections: | �getLoop�)()Lfr/orsay/lri/varna/models/naView/Loop; |� Loop %d Region %d (%d-%d) | �m�getStart | �m�getEnd �2 � getConnection�0(I)Lfr/orsay/lri/varna/models/naView/Connection;�il�ilp�irp� � �*�determine_depths�maxconn�maxdepth �2 G�setMark � �depth�*(Lfr/orsay/lri/varna/models/naView/Loop;)I�count�ret�d� traverse_loop@!TD- �java/lang/Math �sin�(D)D  �cos  �sqrt | K�setXrad | K�setYrad  ��atan2�(DD)D | K�setAngle | ��getAngle �   �determine_radius�+(Lfr/orsay/lri/varna/models/naView/Loop;D)V@������� | ��getXrad | ��getYrad�Now processing loop %d � � �connected_connection�](Lfr/orsay/lri/varna/models/naView/Connection;Lfr/orsay/lri/varna/models/naView/Connection;)Z������� Icstart1 = %d �! "#�find_ic_middle�(IILfr/orsay/lri/varna/models/naView/Connection;Lfr/orsay/lri/varna/models/naView/Connection;Lfr/orsay/lri/varna/models/naView/Loop;)I%�' IC start = %d middle = %d end = %d ?������ ) *�asin@ !TD- |. /� isExtruded?!TD-?������ 5 6�abs8�!Warning from traverse_loop. Loop :� has crossed regions �< =�i�warningEmition �? @A�construct_extruded_segment�](Lfr/orsay/lri/varna/models/naView/Connection;Lfr/orsay/lri/varna/models/naView/Connection;)V �C DE�generate_region�0(Lfr/orsay/lri/varna/models/naView/Connection;)V �2I �2M�anchor_connection�xs�ys�xe�ye�xn�yn�r�radius�xc�yc�xo�yo�astart�aend�a�cpnext�acp�cpprev�n�ic�da�maxang�icstart�icend�icmiddle�icroot�done�done_all_connections�rooted�sign�midx�midy�nrx�nry�mx�my�vx�vy�dotmv�nmidx�nmidy�icstart1�icup�icdown�icnext� direction�dan�dx�dy�rr�cpx�cpy�cpnextx�cpnexty�cnx�cny�rcn�rc�lnx�lny�rl�ac�acn�sx�sy�dcp�imaxloop�indice� Determine_radius?栞pPB_ ����mindit�ci�dt�sumn�sumd�dit�end�start�imindit�rt2_2� Connected_connection� Find_ic_middle�(Infinite loop detected in find_ic_middle� Generate_region@U�����>Bad region passed to generate_region. Coordinates not defined.�l�construct_circle_segment�(II)V� Construct_circle_segment � �find_center_for_arc�(DD)V � �#� � �"�� Construct_extruded_segment �  � �minf2 � �maxf2�aend1�aend2�aave�a1�a2�dac�nstart�nend� collision� Find_center_for_arc?� oz @�������*Unexpected large magnitude discriminant = �  �acos?6C-�'Iteration failed in find_center_for_arc�b�h�hhi�hlow�disc�theta�e�phi�iter�x1�x2�warningMessage�Ljava/lang/String;� SourceFile� NAView.java�!���������������� � ������ �� ���������� ����� ����� ���������������������������������������������� �!����"�����#�����$�������%��&�!�����'������(������)�*��+��������Z*�,*��.*�0*�2Y�4�5*�7Y�9�:*�<�>*��@*�B*�DY�F�G*�I*�K�M*�O�Q����S���6� ������ ���"��'�(�)�/�*�6�-�;�3�F�5�K�7�R�8�Y��T��� ����Z�U�V����W�X��Y�����Z�����\�+��:����*�B� �]c�d+�j��DY+�j`�n:+�j�q�wW6�+�{��`�q�wW+�j*�B� *�*�{�r��*�DY*�`�n�6�*��Y��wW*��j*�DY�F�6�*��Y��wW*�`*�*�B�*�*�:*�*�B�*�*�*�DY*�`�n�6�*��2Y�4�wW*�`*�W*�B�*�*�*�B�*�*�B�*�**�5�6�J,�*�Q*�`�{��kc�¶�wW-�*�Q*�`�{��kc�¶�wW*�*�����S����0���=��>��?��@��B��C�!�B�'�D�4�F�:�G�Q�F�]�J�d�K�j�N�z�O��Q��R��Q��U��V��W��V��Z��\��]��_��a��c��d�f�g�h�i-�h;�lA�nH�oL�qP�sW�t[�vb�wf�yo�{u�|�}�{��T���f� ���U�V�����������������r�X�� ��'����7�&�� ���!�� ��� �� �� �� �����*�����������������'�������������+��������T�]ֶ�d=�;�]�Yڷ���+�{���� p� �]�+�jò�]�����S���"������� ��5��<��B��M��S��T��� ����T�U�V�����T���� �C�� ����� ����T������*��+��������`�]�d<�D�]�Yڷ���*��{������ p� �]�*��j�]�����S���*� ������ ��3��;��>��E��K��Y��_��T�������`�U�V��� �O�� ����*��+���������]�d<��]�Y�*��{����*��{���*��{���*��{� ����p� �]�*��j{�]�����S���2� ������ ��0��G��^��x��{����������T��������U�V��� ��� ����*��+��������a�]�d<�D�]�Y���*��{����p� �]�*��j�]�����S���*� ���� ����$��=��@��F��L��Z��`��T�������a�U�V��� �O�� ����*��+��X�����]�Y�*�5��*�5�޶��d�]"�d�]�Y$�*�5&�޶��d�]�Y)�*�5+��d�]�Y.�*�5�޶��d�]�Y0�*�525��d�]�Y8�*�5:5��d�]�Y;�*�5=5��d�]�Y>�*�5�޶��d����S���2� ������*��-��6��S��p�����������T��� ����U�V������������+������*�B� �]@�d*��Y��wW*��{�A*��{�D*��{��H*��{��L>=�q*��Y��wW*��{�D*��{��H*��{��L*��{�+�{�r�A+�{�r��*��'*��{�*�A*�*��{�A����S���R�����������.��=��N��_��f��u���������������������T���*����U�V��������c��� ��a�O� ����� ���������*��+��O����G*�B� �]P�d*�`>�DY�n:<�Q�wW*V<*��{��Y=�{RX*�*V�{�[*�*V�{�^QaWQaW*��{�*�*V�{�e*��{�*�*V�{�e�WQaWQaW*��{�*�*V�{�e*��{�*�*V�{�e�*��{��*�*V�{�i*�*V�{�`l*�B�*V��]o�qW�]u�Y*V`�qSY*�*V�{���qSY*�*V�{��qSY*�*V�{��qSY*�*V�{� �qSY*�*V�{�*�*V�{�d`�qSqW*YV`V*�����S����*����������!��&��0��8��=��B��d��v������������������-�J�_�s�z��������&�'(�,�1;�F�T���4���G�U�V���#$�� ��Rw� ��0x� ��!&y������ ��!&yz������Y�����Z�+��~�� ��*�B� �]{�d�2Y�4:�2Y�4:|Y~:�Y�:�7Y�9:*�*Y�Z`��{�2:*�*�::� *�� :=*��{��Y>+*��{�:*���{���o*���{�D*��{�D*��{�D*� �{�D**�� `��:��o*��{�D*� �{�D*���{�D*��{�D* *��  `��:�"�ZY�Y����`|Y~:d��� �`|Y~:d���� =*��=����S���G�����"�+�4�=�T�Z �`!�i"�o#�x$�%�#�&�(�)�*�+�,�-./)0@1A0I2R3e4x56787:;<;:>?@�A BCD"E,F9HCIMKSLYMeNnO|PQRSTUWXZ[]_`ab�T���\� ���U�V����� ��P�� ��@w� �����"���+��4��=�����*��+��|�����в�]�d�]�Y*�*�5`�qSqW<�*��{�2:�]�Y`�qSY�qSqW6�V*�¶`=*�ƶ`>�]�Y�qSY�qSYɸ�qSY̸�qSqWY:*�c����S���B���i� n�*o�/p�<q�Qr�Yq�^s�dt�su�v�w�v�s�o�z�T���R�����U�V���,�� ��s�D� ���5� ��<����d�S�����a�c�� ����*��+�� �����t*�B� �]ֶ�d�2Y�4L*=>6�G*��{�2L+�+&>+=*+�5�+&�+� +&>*+�5*�����S���J��������� �&�3�;�@�E�M�U�]�b�g�s�T���4����t�U�V����\����V� �� �T� ��#�Q�� ���*��+��������]*�B� �]ܶ�d�2Y�4L=�:*��{�2L>�*��{�2݄*�+*+*�ı����S���.� �������)�.�=�H�Q�\�T���*����]�U�V����E����C�� ��+�)�� ����+�������r*�B� �]�d+�++�+=>6�1*+϶·6�� >� �>++`����S���N��������!�#�(�*�,�2�A�F�N�T�Z�]�i�n�T���>����r�U�V�����r���*�H� ��,�F� ��A�� ��/�:�� ������Y�����Z�+��6��}�� *�B� �]�d6{*�`o9:%636|6*�#ɇkwJ#ɇk9#̇kw9#̇k9  g9 )g9   k  kc9# o# o#  #�##c,�,#Ʀ� #:%*63|*+|Y:#K*+*�>+2�o9,� \99�s*�%ɶ�{��*�%̶�{��c o9*�%ɶ�{��*�%̶�{��c o9%kg9%kg93� 60�360+0:#6/*�B�2�]�Y+�qSqW�]�Y�+���d640d6((� +d6(+(:&*&#� 64� (60&:#//+�9-6*�T*`6((+�6(+*:#+(:$$#g9qq� qc9qq-� q9-*6{**+{61{`600+�60+1:##64426506N*�B�]�YN�qSqW6/6406166�S+1:#13�661`6((+�6(+(:$*#$�//+��(61�644*01,%+ 622Y6PY6O6**�B�)�]$�Y0�qSY2�qSY1�qSqW646RR� O6*�R� 26*�P6**]+*:#,� %#JR�#&o(g9#&o(c9*�#ɶ�{�kcH*�#ɶ�{�kcL*�#̶�{�kcH*�#̶�{�kcLRV*`6((+�6(+*:#+(:$#9[#9]#$c o9q#$� q+g9qq9cq9ee9kcw9m$#g9++� +c9+#-�+0�  9o�29o�9o*�#̶�{�*�$ɶ�{��okkcH*�#̶�{�*�$ɶ�{��omkcL*�#ɶ�{�*�#̶�{��]cH*�#ɶ�{�*�#̶�{��[gLT*d6((� +d6(+(:#+*:$$9_$9a#$c o9q#$� q+g9qq9cq9eew9kc9m$#g9++� +c9+#-�+0�  9o�29o�9o*�$ɶ�{�*�#̶�{��okkcH*�$ɶ�{�*�#̶�{��omkcL*�$̶�{�*�$ɶ�{��agH*�$̶�{�*�$ɶ�{��_cLR�*P1� 6P�P�PP+�6P6R�(O0� 6O�O�OO� +d6O6RO� P��6441`6QQ+�6Q100N� QN+0:#+1:$*�$̶�{��*�#ɶ�{��g9U*�$̶�{��*�#ɶ�{��g9W*�#ɶ�{��U oc98*�#ɶ�{��W oc9:UUkWWkc9YUYo9@WYo9B8g9D:g9FUUkWWkc9YDYo9DFYo9FD@kFBkc9HH@kDg9<HBkFg9><>kc9Y<Yo9<>Yo9>*�#ɶ�{��g9U*�#ɶ�{��g9WWU9qq� qc9q*�$̶�{��g9U*�$̶�{��g9WWU9ss� sc9ssq� sc9ssqg+� 67�677kkc9L6�J8gg9L:gg9�06*+*:##6'*�'�{�*�'�{��Jc8gH*�'�{�*�'�{��Lc:gL#6'*�'�{�*�'�{��Jc8gH*�'�{�*�'�{��Lc:gL*1��**+G6*AQ600N��655b6*+*:#*`6((+�6(+(:$*�#̶�{��g9U*�#̶�{��g9WUUkWWkc9iWU9qq� qc9q*�$ɶ�{��g9U*�$ɶ�{��g9WUUkWWkc9gWU9ss� sc9ssq� sc9ssqg9S$#g9yy� yc9ySyg4+�D#-�$*�Y7�+�9��;�$#d� #/#-�*#$>�$#d6))�)*�``6)S)o96(�v#(`6''*��'*�`d6'q(kc9!igig!qgkSoc9Y*�'�{�Y!kcH*�'�{�Y!kcL(()**+6*�&3*�+*:#*#B*##�**+6)9u9w6*�*`6((+�6(+*:#+(:$)u*�#ɶ�{��*�#̶�{��cc9uw*�#ɶ�{��*�#̶�{��cc9w#-�[#`6(�E(*��(*�`d6()u*�(�{��c9uw*�(�{��c9w(($ɠ**++u)oF+w)oG����S��*������ �#�&�)�/�=�K�Z�h�o�u�������������� +, /2 D V W Z ] j w} "$%&'()+,. 2345%6(70889E:L;T<\=`>d3pAtBzCDEFGI#JKLMNOPQRSTUVWXY[\ ]^_ a#S(d.e1d6f@gGhSihhmjpkslvm{noprtuvwxyxz{z|}|~~ %(7BHMS\_gov} !"%4FKLO^sv #+3<DLO^ruvy$*/7?BUlZ`ils%,3:AQX_�lv       " * 2 : F L O ] k p z  ! " # $ # % & % ' ( ) ( * + .* 1, 8- ;. G/ J M3 Q4 _N d6 j7 r8 x9 : ; < = > ? @ A B C D E )F 0G 8H @I HJ OK \L cM kN zO P Q P R S T W X Z [ \ ] ^ _ ` a b "c 5d Oe i^ s6 k l m n o k r s t u v w x y z { | | } ~ ~ # 9 A M V a d x  u   �T��:�l�� �U�V���� ���� H��=�I���K�J���Z�K���h�sL�� �o�lM�� �u�fN�� � �"����VO��� P���Q��j PQ���R��w CR��2�ES��]�T���U���wV�� "�JW��!�/��#� �#8�/X�$�$X�$o1X�$.X�$X�$ X�$ �X�$�# Y�% Z�& ��� �' �i�� �' �� �( �[� �) [� �)�, \� �*�]��+�]��+�^��- (� �/�_� �0 3_� �0t�#`� �1`� �16)a� �2�& b� �3 c�!�4 d�!�5e�!�6 I�f� �7 O�f� �7Sg��88h��:vi��<j��>,!k��@3l��B:m��DA n��Flo��H ]�p��J k�q��L r� �N>!s� �O;$t� �P`u� �Qsv� �R O'w��Sx��U x��Uny��W y��W%(z��Y 5�7z��Yv*{��[}#|��]'}��_ ~��a���c���c���e���e V��g ��i���k ���k���m���m���o���o���oA���oI���oO���oE�"��q��q��qx��q ��q 2��s )M��s ��u ���w \��y� � �{�) � �|�  ��+������Y*�B� �]�d6|Y~:|Y~:999 9 6�+:`6+�6+:66�*�``6g9� c9-�d9�0�  9�29 ockc9  koc9 o9�-�� 96+/  o9�9k(� +k(+2� +29� +����S����)������%�*�/�;�C�I�R�U�]�d�k�r�}�������������",6@IRX�T������Y�U�V����Y����Y����/*������������D����|���5$�� �2'�� �CP����"���8!�� ��I��� ��d�� ��k�� ��F� ��=��%4X��*/�����+��������**�B� �]�d+-�+`,ɠ�����S�����������&�(�T��� ����*�U�V�����*����*X��"#��Y�����Z�+���� ���*�B� �]�d6666 �Nh��ZY-��6��6 �6 �.6 6��6  `l6����S���b�����������.�2�5�9�I�M�Z�g�j�o�u�~�����T���p� ����U�V�����_� ����`� ����H����Y��������� ���� ���\� ��x�(�� � ��c�!� �DE��Y�����Z�+��s����W*�B� �]�d+:=+���>6�> 6*�+ɶ�{���*�+̶�{����ZY`6�΄*��{�*�+ɶ�{��*�Mk+kcH*��{�*�+ɶ�{��*�Mk+kcL*��{��6*��{�*�+̶�{��*�Mk+kcH*��{�*�+̶�{��*�Mk+kcL1����S����'�� �����$�*�4�:�A�Y�q�u�x�| �!�"�#�$�#�"�%�&�'�&�%�(�)�*+*),+-C.H-I,L V1�T���f� ��W�U�V����W��?� ��*� � ��:� ��1�� ��A� ����� ���]w� ��A����Y�����Z�+��� ���*�B� �]�d*��{��*��{��gJ*��{��*��{��g9))kkc9d6�*�``6�)oJo96�o`6*��*�`d6*��{�*��{��)kocH*��{�*��{��kocL*d)oJo9*��{��)k oc9 *��{��k oc9 9 )w9 * kc9 *kc9*��{��g9*��{��g9kkc996�f`6*��*�`d6*��{�*kckcH*��{�*kckcL����S����+��=�>�B�.C�MD�[E�`F�eG�pH�yI�~J�K�L�M�N�O�P�O�Q�R�Q�KU VWX1YKZO[S\_]k^~_`abcdefgbj�T�������U�V����� ���� ��.x���My���[z��1�g�� K�h�� O�M�� S�N��_�i��k�j��~�k���l���pW���`� ���y�� ��n�� ���f�� ��]�� ��@A��Y�����Z�+����!��*�B� �]�d+J,\99)� c9)c o9 +6,6d6�*�``6,+g9� c9�*9*��{��*��{��g9 *��{��*��{��g9   k  kc9 o9  o9 2�0�`6*��*�`d6d6�*�``6*��{�*��{��& kcH*��{�*��{��& kcL*��{�*��{��& kgH*��{�*��{��& kgL666 *`6*��*�`d6*��{��*��{��g9 *��{��*��{��g9   9� c9)g9� c9+�6 d6�*�``6*��{��*��{��g9 *��{��*��{��g9   9� c9g9� c9+�6  �* )&c9*��{�*��{��cH*��{�*��{��cL6* &g9*��{�*��{��cH*��{�*��{��cL6 �  ����S��>�O��v�w�|�}�~�%�-�7�=�C�J�O�Z�e�l�t�z��������'Lq *3:BHOW`ciny(+7LOSa�T�������U�V�������X��U���������7�� �x�� �y�� 3���������z���eW]��Hs���=� ��Cy� ��Jr[� ���� �� ��� �iR� ��!� ���Y�����Z�+������*�B� �]ɶ�d'c+o9w)'c)gog9 )�9 6 c o9k))koc9 &  kog9  4�(�ZY�YϷ� 5Ѷ� 5� 9 o9'ck kcg9� 9 �94֗�]�*�I�*ض;*�I99**����S���� ������(�.�1�4�?�Q�^�h�l�{����������������� �T���z� ���U�V����[�������?��������(��� �Q�O�� �^��� ��t����W����j���4�� ����+���J����� ')�'�)����S������ �T��� ���� �U�V����� ����� �����+���J����� ')�'�)����S�������T��� ���� �U�V����� ����� ���=�i��Y�����Z�+���=����� �ZY+����S�������T������� �U�V����� �����PK �����mbl=]����,���fr/orsay/lri/varna/models/naView/NAView.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.naView; import java.util.ArrayList; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener; import fr.orsay.lri.varna.interfaces.InterfaceVARNAObservable; public class NAView { private final double ANUM = 9999.0; private final int MAXITER = 500; private ArrayList bases; private int nbase, nregion, loop_count; private Loop root = new Loop(); private ArrayList loops; private ArrayList regions; private Radloop rlphead = new Radloop(); private double lencut=0.8; private final double RADIUS_REDUCTION_FACTOR = 1.4; // show algorithm step by step private boolean debug = false; private double angleinc; private double _h; private ArrayList _listeVARNAListener = new ArrayList(); private boolean noIterationFailureYet = true; double HELIX_FACTOR = 0.6; double BACKBONE_DISTANCE = 27; public int naview_xy_coordinates(ArrayList pair_table2, ArrayList x, ArrayList y) throws ExceptionNAViewAlgorithm { if (debug) System.out.println("naview_xy_coordinates"); if (pair_table2.size() == 0) return 0; int i; ArrayList pair_table = new ArrayList(pair_table2 .size() + 1); pair_table.add(pair_table2.size()); for (int j = 0; j < pair_table2.size(); j++) { pair_table.add(pair_table2.get(j) + 1); } if (debug) { infoStructure(pair_table); } // length nbase = pair_table.get(0); bases = new ArrayList(nbase + 1); for (int index = 0; index < bases.size(); index++) { bases.add(new Base()); } regions = new ArrayList(); for (int index = 0; index < nbase + 1; index++) { regions.add(new Region()); } read_in_bases(pair_table); if (debug) infoBasesMate(); rlphead = null; find_regions(); if (debug) infoRegions(); loop_count = 0; loops = new ArrayList(nbase + 1); for (int index = 0; index < nbase + 1; index++) { loops.add(new Loop()); } construct_loop(0); if (debug) infoBasesExtracted(); find_central_loop(); if (debug) infoRoot(); if (debug) dump_loops(); traverse_loop(root, null); for (i = 0; i < nbase; i++) { x.add(100 + BACKBONE_DISTANCE * bases.get(i + 1).getX()); y.add(100 + BACKBONE_DISTANCE * bases.get(i + 1).getY()); } return nbase; } private void infoStructure(ArrayList pair_table) { System.out.println("structure:"); for (int j = 0; j < pair_table.size(); j++) { System.out.print("#" + j + ":" + pair_table.get(j) + "\t"); if (j % 10 == 0) System.out.println(); } System.out.println(); } private void infoBasesMate() { System.out.println("Bases mate:"); for (int index = 0; index < bases.size(); index++) { System.out.print("#" + index + ":" + bases.get(index).getMate() + "\t"); if (index % 10 == 0) System.out.println(); } System.out.println(); } private void infoRegions() { System.out.println("regions:"); for (int index = 0; index < regions.size(); index++) { System.out.print("(" + regions.get(index).getStart1() + "," + regions.get(index).getStart2() + ";" + regions.get(index).getEnd1() + "," + regions.get(index).getEnd2() + ")\t\t"); if (index % 5 == 0) System.out.println(); } System.out.println(); } private void infoBasesExtracted() { System.out.println("Bases extracted:"); for (int index = 0; index < bases.size(); index++) { System.out.print("i=" + index + ":" + bases.get(index).isExtracted() + "\t"); if (index % 5 == 0) System.out.println(); } System.out.println(); } private void infoRoot() { System.out.println("root" + root.getNconnection() + ";" + root.getNumber()); System.out.println("\troot : "); System.out.println("\tdepth=" + root.getDepth()); System.out.println("\tmark=" + root.isMark()); System.out.println("\tnumber=" + root.getNumber()); System.out.println("\tradius=" + root.getRadius()); System.out.println("\tx=" + root.getX()); System.out.println("\ty=" + root.getY()); System.out.println("\tnconnection=" + root.getNconnection()); } private void read_in_bases(ArrayList pair_table) { if (debug) System.out.println("read_in_bases"); int i, npairs; // Set up an origin. bases.add(new Base()); bases.get(0).setMate(0); bases.get(0).setExtracted(false); bases.get(0).setX(ANUM); bases.get(0).setY(ANUM); for (npairs = 0, i = 1; i <= nbase; i++) { bases.add(new Base()); bases.get(i).setExtracted(false); bases.get(i).setX(ANUM); bases.get(i).setY(ANUM); bases.get(i).setMate(pair_table.get(i)); if ((int) pair_table.get(i) > i) npairs++; } // must have at least 1 pair to avoid segfault if (npairs == 0) { bases.get(1).setMate(nbase); bases.get(nbase).setMate(1); } } /** * Identifies the regions in the structure. */ private void find_regions() { if (debug) System.out.println("find_regions"); int i, mate, nb1; nb1 = nbase + 1; ArrayList mark = new ArrayList(nb1); for (i = 0; i < nb1; i++) mark.add(false); nregion = 0; for (i = 0; i <= nbase; i++) { if ((mate = bases.get(i).getMate()) != 0 && !mark.get(i)) { regions.get(nregion).setStart1(i); regions.get(nregion).setEnd2(mate); mark.set(i, true); mark.set(mate, true); bases.get(i).setRegion(regions.get(nregion)); bases.get(mate).setRegion(regions.get(nregion)); for (i++, mate--; i < mate && bases.get(i).getMate() == mate; i++, mate--) { mark.set(mate, true); mark.set(i, true); bases.get(i).setRegion(regions.get(nregion)); bases.get(mate).setRegion(regions.get(nregion)); } regions.get(nregion).setEnd1(--i); regions.get(nregion).setStart2(mate + 1); if (debug) { if (nregion == 0) System.out.printf("\nRegions are:\n"); System.out.printf( "Region %d is %d-%d and %d-%d with gap of %d.\n", nregion + 1, regions.get(nregion).getStart1(), regions.get(nregion).getEnd1(), regions .get(nregion).getStart2(), regions.get( nregion).getEnd2(), regions.get(nregion) .getStart2() - regions.get(nregion).getEnd1() + 1); } nregion++; } } } /** * Starting at residue ibase, recursively constructs the loop containing * said base and all deeper bases. * * @throws ExceptionNAViewAlgorithm */ private Loop construct_loop(int ibase) throws ExceptionNAViewAlgorithm { if (debug) System.out.println("construct_loop"); int i, mate; Loop retloop = new Loop(), lp = new Loop(); Connection cp = new Connection(); Region rp = new Region(); Radloop rlp = new Radloop(); retloop = loops.get(loop_count++); retloop.setNconnection(0); //System.out.println(""+ibase+" "+nbase); //ArrayList a = new ArrayList(nbase + 1); //retloop.setConnections(a); // for (int index = 0; index < nbase + 1; index++) // retloop.getConnections().add(new Connection()); //for (int index = 0; index < nbase + 1; index++) // retloop.addConnection(index,new Connection()); retloop.setDepth(0); retloop.setNumber(loop_count); retloop.setRadius(0.0); for (rlp = rlphead; rlp != null; rlp = rlp.getNext()) if (rlp.getLoopnumber() == loop_count) retloop.setRadius(rlp.getRadius()); i = ibase; do { if ((mate = bases.get(i).getMate()) != 0) { rp = bases.get(i).getRegion(); if (!bases.get(rp.getStart1()).isExtracted()) { if (i == rp.getStart1()) { bases.get(rp.getStart1()).setExtracted(true); bases.get(rp.getEnd1()).setExtracted(true); bases.get(rp.getStart2()).setExtracted(true); bases.get(rp.getEnd2()).setExtracted(true); lp = construct_loop(rp.getEnd1() < nbase ? rp.getEnd1() + 1 : 0); } else if (i == rp.getStart2()) { bases.get(rp.getStart2()).setExtracted(true); bases.get(rp.getEnd2()).setExtracted(true); bases.get(rp.getStart1()).setExtracted(true); bases.get(rp.getEnd1()).setExtracted(true); lp = construct_loop(rp.getEnd2() < nbase ? rp.getEnd2() + 1 : 0); } else { throw new ExceptionNAViewAlgorithm( "naview:Error detected in construct_loop. i = " + i + " not found in region table.\n"); } retloop.setNconnection(retloop.getNconnection() + 1); cp = new Connection(); retloop.setConnection(retloop.getNconnection() - 1, cp); retloop.setConnection(retloop.getNconnection(), null); cp.setLoop(lp); cp.setRegion(rp); if (i == rp.getStart1()) { cp.setStart(rp.getStart1()); cp.setEnd(rp.getEnd2()); } else { cp.setStart(rp.getStart2()); cp.setEnd(rp.getEnd1()); } cp.setExtruded(false); cp.setBroken(false); lp.setNconnection(lp.getNconnection() + 1); cp = new Connection(); lp.setConnection(lp.getNconnection() - 1, cp); lp.setConnection(lp.getNconnection(), null); cp.setLoop(retloop); cp.setRegion(rp); if (i == rp.getStart1()) { cp.setStart(rp.getStart2()); cp.setEnd(rp.getEnd1()); } else { cp.setStart(rp.getStart1()); cp.setEnd(rp.getEnd2()); } cp.setExtruded(false); cp.setBroken(false); } i = mate; } if (++i > nbase) i = 0; } while (i != ibase); return retloop; } /** * Displays all the loops. */ private void dump_loops() { System.out.println("dump_loops"); int il, ilp, irp; Loop lp; Connection cp; System.out.printf("\nRoot loop is #%d\n", loops.indexOf(root) + 1); for (il = 0; il < loop_count; il++) { lp = loops.get(il); System.out.printf("Loop %d has %d connections:\n", il + 1, lp .getNconnection()); for (int i = 0; (cp = lp.getConnection(i)) != null; i++) { ilp = (loops.indexOf(cp.getLoop())) + 1; irp = (regions.indexOf(cp.getRegion())) + 1; System.out.printf(" Loop %d Region %d (%d-%d)\n", ilp, irp, cp .getStart(), cp.getEnd()); } } } /** * Find node of greatest branching that is deepest. */ private void find_central_loop() { if (debug) System.out.println("find_central_loop"); Loop lp = new Loop(); int maxconn, maxdepth, i; determine_depths(); maxconn = 0; maxdepth = -1; for (i = 0; i < loop_count; i++) { lp = loops.get(i); if (lp.getNconnection() > maxconn) { maxdepth = lp.getDepth(); maxconn = lp.getNconnection(); root = lp; } else if (lp.getDepth() > maxdepth && lp.getNconnection() == maxconn) { maxdepth = lp.getDepth(); root = lp; } } } /** * Determine the depth of all loops. */ private void determine_depths() { if (debug) System.out.println("determine_depths"); Loop lp = new Loop(); int i, j; for (i = 0; i < loop_count; i++) { lp = loops.get(i); for (j = 0; j < loop_count; j++) loops.get(j).setMark(false); lp.setDepth(depth(lp)); } } /** * Determines the depth of loop, lp. Depth is defined as the minimum * distance to a leaf loop where a leaf loop is one that has only one or no * connections. */ private int depth(Loop lp) { if (debug) System.out.println("depth"); int count, ret, d; if (lp.getNconnection() <= 1) return 0; if (lp.isMark()) return -1; lp.setMark(true); count = 0; ret = 0; for (int i = 0; lp.getConnection(i) != null; i++) { d = depth(lp.getConnection(i).getLoop()); if (d >= 0) { if (++count == 1) ret = d; else if (ret > d) ret = d; } } lp.setMark(false); return ret + 1; } /** * This is the workhorse of the display program. The algorithm is recursive * based on processing individual loops. Each base pairing region is * displayed using the direction given by the circle diagram, and the * connections between the regions is drawn by equally spaced points. The * radius of the loop is set to minimize the square error for lengths * between sequential bases in the loops. The "correct" length for base * links is 1. If the least squares fitting of the radius results in loops * being less than 1/2 unit apart, then that segment is extruded. * * The variable, anchor_connection, gives the connection to the loop * processed in an previous level of recursion. * * @throws ExceptionNAViewAlgorithm */ private void traverse_loop(Loop lp, Connection anchor_connection) throws ExceptionNAViewAlgorithm { if (debug) System.out.println(" traverse_loop"); double xs, ys, xe, ye, xn, yn, angleinc, r; double radius, xc, yc, xo, yo, astart, aend, a; Connection cp, cpnext, acp, cpprev; int i, j, n, ic; double da, maxang; int count, icstart, icend, icmiddle, icroot; boolean done, done_all_connections, rooted; int sign; double midx, midy, nrx, nry, mx, my, vx, vy, dotmv, nmidx, nmidy; int icstart1, icup, icdown, icnext, direction; double dan, dx, dy, rr; double cpx, cpy, cpnextx, cpnexty, cnx, cny, rcn, rc, lnx, lny, rl, ac, acn, sx, sy, dcp; int imaxloop = 0; angleinc = 2 * Math.PI / (nbase + 1); acp = null; icroot = -1; int indice = 0; for (ic = 0; (cp = lp.getConnection(indice)) != null; indice++, ic++) { // xs = cos(angleinc*cp.setStart(); ys = sin(angleinc*cp.setStart(); // xe = // cos(angleinc*cp.setEnd()); ye = sin(angleinc*cp.setEnd()); xs = -Math.sin(angleinc * cp.getStart()); ys = Math.cos(angleinc * cp.getStart()); xe = -Math.sin(angleinc * cp.getEnd()); ye = Math.cos(angleinc * cp.getEnd()); xn = ye - ys; yn = xs - xe; r = Math.sqrt(xn * xn + yn * yn); cp.setXrad(xn / r); cp.setYrad(yn / r); cp.setAngle(Math.atan2(yn, xn)); if (cp.getAngle() < 0.0) cp.setAngle(cp.getAngle() + 2 * Math.PI); if (anchor_connection != null && anchor_connection.getRegion() == cp.getRegion()) { acp = cp; icroot = ic; } } // remplacement d'une etiquette de goto set_radius: while (true) { determine_radius(lp, lencut); radius = lp.getRadius()/RADIUS_REDUCTION_FACTOR; if (anchor_connection == null) xc = yc = 0.0; else { xo = (bases.get(acp.getStart()).getX() + bases .get(acp.getEnd()).getX()) / 2.0; yo = (bases.get(acp.getStart()).getY() + bases .get(acp.getEnd()).getY()) / 2.0; xc = xo - radius * acp.getXrad(); yc = yo - radius * acp.getYrad(); } // The construction of the connectors will proceed in blocks of // connected connectors, where a connected connector pairs means two // connectors that are forced out of the drawn circle because they // are too close together in angle. // First, find the start of a block of connected connectors if (icroot == -1) icstart = 0; else icstart = icroot; cp = lp.getConnection(icstart); count = 0; if (debug) { System.out.printf("Now processing loop %d\n", lp.getNumber()); System.out.println(" "+lp); } done = false; do { j = icstart - 1; if (j < 0) j = lp.getNconnection() - 1; cpprev = lp.getConnection(j); if (!connected_connection(cpprev, cp)) { done = true; } else { icstart = j; cp = cpprev; } if (++count > lp.getNconnection()) { // Here everything is connected. Break on maximum angular // separation between connections. maxang = -1.0; for (ic = 0; ic < lp.getNconnection(); ic++) { j = ic + 1; if (j >= lp.getNconnection()) j = 0; cp = lp.getConnection(ic); cpnext = lp.getConnection(j); ac = cpnext.getAngle() - cp.getAngle(); if (ac < 0.0) ac += 2 * Math.PI; if (ac > maxang) { maxang = ac; imaxloop = ic; } } icend = imaxloop; icstart = imaxloop + 1; if (icstart >= lp.getNconnection()) icstart = 0; cp = lp.getConnection(icend); cp.setBroken(true); done = true; } } while (!done); done_all_connections = false; icstart1 = icstart; if (debug) System.out.printf(" Icstart1 = %d\n", icstart1); while (!done_all_connections) { count = 0; done = false; icend = icstart; rooted = false; while (!done) { cp = lp.getConnection(icend); if (icend == icroot) rooted = true; j = icend + 1; if (j >= lp.getNconnection()) { j = 0; } cpnext = lp.getConnection(j); if (connected_connection(cp, cpnext)) { if (++count >= lp.getNconnection()) break; icend = j; } else { done = true; } } icmiddle = find_ic_middle(icstart, icend, anchor_connection, acp, lp); ic = icup = icdown = icmiddle; if (debug) System.out.printf(" IC start = %d middle = %d end = %d\n", icstart, icmiddle, icend); done = false; direction = 0; while (!done) { if (direction < 0) { ic = icup; } else if (direction == 0) { ic = icmiddle; } else { ic = icdown; } if (ic >= 0) { cp = lp.getConnection(ic); if (anchor_connection == null || acp != cp) { if (direction == 0) { astart = cp.getAngle() - Math.asin(1.0 / 2.0 / radius); aend = cp.getAngle() + Math.asin(1.0 / 2.0 / radius); bases.get(cp.getStart()).setX( xc + radius * Math.cos(astart)); bases.get(cp.getStart()).setY( yc + radius * Math.sin(astart)); bases.get(cp.getEnd()).setX( xc + radius * Math.cos(aend)); bases.get(cp.getEnd()).setY( yc + radius * Math.sin(aend)); } else if (direction < 0) { j = ic + 1; if (j >= lp.getNconnection()) j = 0; cp = lp.getConnection(ic); cpnext = lp.getConnection(j); cpx = cp.getXrad(); cpy = cp.getYrad(); ac = (cp.getAngle() + cpnext.getAngle()) / 2.0; if (cp.getAngle() > cpnext.getAngle()) ac -= Math.PI; cnx = Math.cos(ac); cny = Math.sin(ac); lnx = cny; lny = -cnx; da = cpnext.getAngle() - cp.getAngle(); if (da < 0.0) da += 2 * Math.PI; if (cp.isExtruded()) { if (da <= Math.PI / 2) rl = 2.0; else rl = 1.5; } else { rl = 1.0; } bases.get(cp.getEnd()).setX( bases.get(cpnext.getStart()).getX() + rl * lnx); bases.get(cp.getEnd()).setY( bases.get(cpnext.getStart()).getY() + rl * lny); bases.get(cp.getStart()).setX( bases.get(cp.getEnd()).getX() + cpy); bases.get(cp.getStart()).setY( bases.get(cp.getEnd()).getY() - cpx); } else { j = ic - 1; if (j < 0) j = lp.getNconnection() - 1; cp = lp.getConnection(j); cpnext = lp.getConnection(ic); cpnextx = cpnext.getXrad(); cpnexty = cpnext.getYrad(); ac = (cp.getAngle() + cpnext.getAngle()) / 2.0; if (cp.getAngle() > cpnext.getAngle()) ac -= Math.PI; cnx = Math.cos(ac); cny = Math.sin(ac); lnx = -cny; lny = cnx; da = cpnext.getAngle() - cp.getAngle(); if (da < 0.0) da += 2 * Math.PI; if (cp.isExtruded()) { if (da <= Math.PI / 2) rl = 2.0; else rl = 1.5; } else { rl = 1.0; } bases.get(cpnext.getStart()).setX( bases.get(cp.getEnd()).getX() + rl * lnx); bases.get(cpnext.getStart()).setY( bases.get(cp.getEnd()).getY() + rl * lny); bases.get(cpnext.getEnd()).setX( bases.get(cpnext.getStart()).getX() - cpnexty); bases.get(cpnext.getEnd()).setY( bases.get(cpnext.getStart()).getY() + cpnextx); } } } if (direction < 0) { if (icdown == icend) { icdown = -1; } else if (icdown >= 0) { if (++icdown >= lp.getNconnection()) { icdown = 0; } } direction = 1; } else { if (icup == icstart) icup = -1; else if (icup >= 0) { if (--icup < 0) { icup = lp.getNconnection() - 1; } } direction = -1; } done = icup == -1 && icdown == -1; } icnext = icend + 1; if (icnext >= lp.getNconnection()) icnext = 0; if (icend != icstart && (!(icstart == icstart1 && icnext == icstart1))) { // Move the bases just constructed (or the radius) so that // the bisector of the end points is radius distance away // from the loop center. cp = lp.getConnection(icstart); cpnext = lp.getConnection(icend); dx = bases.get(cpnext.getEnd()).getX() - bases.get(cp.getStart()).getX(); dy = bases.get(cpnext.getEnd()).getY() - bases.get(cp.getStart()).getY(); midx = bases.get(cp.getStart()).getX() + dx / 2.0; midy = bases.get(cp.getStart()).getY() + dy / 2.0; rr = Math.sqrt(dx * dx + dy * dy); mx = dx / rr; my = dy / rr; vx = xc - midx; vy = yc - midy; rr = Math.sqrt(dx * dx + dy * dy); vx /= rr; vy /= rr; dotmv = vx * mx + vy * my; nrx = dotmv * mx - vx; nry = dotmv * my - vy; rr = Math.sqrt(nrx * nrx + nry * nry); nrx /= rr; nry /= rr; // Determine which side of the bisector the center should // be. dx = bases.get(cp.getStart()).getX() - xc; dy = bases.get(cp.getStart()).getY() - yc; ac = Math.atan2(dy, dx); if (ac < 0.0) ac += 2 * Math.PI; dx = bases.get(cpnext.getEnd()).getX() - xc; dy = bases.get(cpnext.getEnd()).getY() - yc; acn = Math.atan2(dy, dx); if (acn < 0.0) acn += 2 * Math.PI; if (acn < ac) acn += 2 * Math.PI; if (acn - ac > Math.PI) sign = -1; else sign = 1; nmidx = xc + sign * radius * nrx; nmidy = yc + sign * radius * nry; if (rooted) { xc -= nmidx - midx; yc -= nmidy - midy; } else { for (ic = icstart;;) { cp = lp.getConnection(ic); i = cp.getStart(); bases.get(i).setX( bases.get(i).getX() + nmidx - midx); bases.get(i).setY( bases.get(i).getY() + nmidy - midy); i = cp.getEnd(); bases.get(i).setX( bases.get(i).getX() + nmidx - midx); bases.get(i).setY( bases.get(i).getY() + nmidy - midy); if (ic == icend) break; if (++ic >= lp.getNconnection()) ic = 0; } } } icstart = icnext; done_all_connections = icstart == icstart1; } for (ic = 0; ic < lp.getNconnection(); ic++) { cp = lp.getConnection(ic); j = ic + 1; if (j >= lp.getNconnection()) j = 0; cpnext = lp.getConnection(j); dx = bases.get(cp.getEnd()).getX() - xc; dy = bases.get(cp.getEnd()).getY() - yc; rc = Math.sqrt(dx * dx + dy * dy); ac = Math.atan2(dy, dx); if (ac < 0.0) ac += 2 * Math.PI; dx = bases.get(cpnext.getStart()).getX() - xc; dy = bases.get(cpnext.getStart()).getY() - yc; rcn = Math.sqrt(dx * dx + dy * dy); acn = Math.atan2(dy, dx); if (acn < 0.0) acn += 2 * Math.PI; if (acn < ac) acn += 2 * Math.PI; dan = acn - ac; dcp = cpnext.getAngle() - cp.getAngle(); if (dcp <= 0.0) dcp += 2 * Math.PI; if (Math.abs(dan - dcp) > Math.PI) { if (cp.isExtruded()) { warningEmition("Warning from traverse_loop. Loop " + lp.getNumber() + " has crossed regions\n"); } else if ((cpnext.getStart() - cp.getEnd()) != 1) { cp.setExtruded(true); continue set_radius; // remplacement du goto } } if (cp.isExtruded()) { construct_extruded_segment(cp, cpnext); } else { n = cpnext.getStart() - cp.getEnd(); if (n < 0) n += nbase + 1; angleinc = dan / n; for (j = 1; j < n; j++) { i = cp.getEnd() + j; if (i > nbase) i -= nbase + 1; a = ac + j * angleinc; rr = rc + (rcn - rc) * (a - ac) / dan; bases.get(i).setX(xc + rr * Math.cos(a)); bases.get(i).setY(yc + rr * Math.sin(a)); } } } break; } for (ic = 0; ic < lp.getNconnection(); ic++) { if (icroot != ic) { cp = lp.getConnection(ic); generate_region(cp); traverse_loop(cp.getLoop(), cp); } } n = 0; sx = 0.0; sy = 0.0; for (ic = 0; ic < lp.getNconnection(); ic++) { j = ic + 1; if (j >= lp.getNconnection()) j = 0; cp = lp.getConnection(ic); cpnext = lp.getConnection(j); n += 2; sx += bases.get(cp.getStart()).getX() + bases.get(cp.getEnd()).getX(); sy += bases.get(cp.getStart()).getY() + bases.get(cp.getEnd()).getY(); if (!cp.isExtruded()) { for (j = cp.getEnd() + 1; j != cpnext.getStart(); j++) { if (j > nbase) j -= nbase + 1; n++; sx += bases.get(j).getX(); sy += bases.get(j).getY(); } } } lp.setX(sx / n); lp.setY(sy / n); } /** * For the loop pointed to by lp, determine the radius of the loop that will * ensure that each base around the loop will have a separation of at least * lencut around the circle. If a segment joining two connectors will not * support this separation, then the flag, extruded, will be set in the * first of these two indicators. The radius is set in lp. * * The radius is selected by a least squares procedure where the sum of the * squares of the deviations of length from the ideal value of 1 is used as * the error function. */ private void determine_radius(Loop lp, double lencut) { if (debug) System.out.println(" Determine_radius"); double mindit, ci, dt, sumn, sumd, radius, dit; int i, j, end, start, imindit = 0; Connection cp = new Connection(), cpnext = new Connection(); double rt2_2 = 0.7071068; do { mindit = 1.0e10; for (sumd = 0.0, sumn = 0.0, i = 0; i < lp.getNconnection(); i++) { cp = lp.getConnection(i); j = i + 1; if (j >= lp.getNconnection()) j = 0; cpnext = lp.getConnection(j); end = cp.getEnd(); start = cpnext.getStart(); if (start < end) start += nbase + 1; dt = cpnext.getAngle() - cp.getAngle(); if (dt <= 0.0) dt += 2 * Math.PI; if (!cp.isExtruded()) ci = start - end; else { if (dt <= Math.PI / 2) ci = 2.0; else ci = 1.5; } sumn += dt * (1.0 / ci + 1.0); sumd += dt * dt / ci; dit = dt / ci; if (dit < mindit && !cp.isExtruded() && ci > 1.0) { mindit = dit; imindit = i; } } radius = sumn / sumd; if (radius < rt2_2) radius = rt2_2; if (mindit * radius < lencut) { lp.getConnection(imindit).setExtruded(true); } } while (mindit * radius < lencut); if (lp.getRadius() > 0.0) radius = lp.getRadius(); else lp.setRadius(radius); } /** * Determines if the connections cp and cpnext are connected */ private boolean connected_connection(Connection cp, Connection cpnext) { if (debug) System.out.println(" Connected_connection"); if (cp.isExtruded()) { return true; } else if (cp.getEnd() + 1 == cpnext.getStart()) { return true; } else { return false; } } /** * Finds the middle of a set of connected connectors. This is normally the * middle connection in the sequence except if one of the connections is the * anchor, in which case that connection will be used. * * @throws ExceptionNAViewAlgorithm */ private int find_ic_middle(int icstart, int icend, Connection anchor_connection, Connection acp, Loop lp) throws ExceptionNAViewAlgorithm { if (debug) System.out.println(" Find_ic_middle"); int count, ret, ic, i; boolean done; count = 0; ret = -1; ic = icstart; done = false; while (!done) { if (count++ > lp.getNconnection() * 2) { throw new ExceptionNAViewAlgorithm( "Infinite loop detected in find_ic_middle"); } if (anchor_connection != null && lp.getConnection(ic) == acp) { ret = ic; } done = ic == icend; if (++ic >= lp.getNconnection()) { ic = 0; } } if (ret == -1) { for (i = 1, ic = icstart; i < (count + 1) / 2; i++) { if (++ic >= lp.getNconnection()) ic = 0; } ret = ic; } return ret; } /** * Generates the coordinates for the base pairing region of a connection * given the position of the starting base pair. * * @throws ExceptionNAViewAlgorithm */ private void generate_region(Connection cp) throws ExceptionNAViewAlgorithm { if (debug) System.out.println(" Generate_region"); int l, start, end, i, mate; Region rp; rp = cp.getRegion(); l = 0; if (cp.getStart() == rp.getStart1()) { start = rp.getStart1(); end = rp.getEnd1(); } else { start = rp.getStart2(); end = rp.getEnd2(); } if (bases.get(cp.getStart()).getX() > ANUM - 100.0 || bases.get(cp.getEnd()).getX() > ANUM - 100.0) { throw new ExceptionNAViewAlgorithm( "Bad region passed to generate_region. Coordinates not defined."); } for (i = start + 1; i <= end; i++) { l++; bases.get(i).setX( bases.get(cp.getStart()).getX() + HELIX_FACTOR * l * cp.getXrad()); bases.get(i).setY( bases.get(cp.getStart()).getY() + HELIX_FACTOR * l * cp.getYrad()); mate = bases.get(i).getMate(); bases.get(mate).setX( bases.get(cp.getEnd()).getX() + HELIX_FACTOR * l * cp.getXrad()); bases.get(mate).setY( bases.get(cp.getEnd()).getY() + HELIX_FACTOR * l * cp.getYrad()); } } /** * Draws the segment of residue between the bases numbered start through * end, where start and end are presumed to be part of a base pairing * region. They are drawn as a circle which has a chord given by the ends of * two base pairing regions defined by the connections. * * @throws ExceptionNAViewAlgorithm */ private void construct_circle_segment(int start, int end) throws ExceptionNAViewAlgorithm { if (debug) System.out.println(" Construct_circle_segment"); double dx, dy, rr, midx, midy, xn, yn, nrx, nry, mx, my, a; int l, j, i; dx = bases.get(end).getX() - bases.get(start).getX(); dy = bases.get(end).getY() - bases.get(start).getY(); rr = Math.sqrt(dx * dx + dy * dy); l = end - start; if (l < 0) l += nbase + 1; if (rr >= l) { dx /= rr; dy /= rr; for (j = 1; j < l; j++) { i = start + j; if (i > nbase) i -= nbase + 1; bases.get(i).setX( bases.get(start).getX() + dx * (double) j / (double) l); bases.get(i).setY( bases.get(start).getY() + dy * (double) j / (double) l); } } else { find_center_for_arc((l - 1), rr); dx /= rr; dy /= rr; midx = bases.get(start).getX() + dx * rr / 2.0; midy = bases.get(start).getY() + dy * rr / 2.0; xn = dy; yn = -dx; nrx = midx + _h * xn; nry = midy + _h * yn; mx = bases.get(start).getX() - nrx; my = bases.get(start).getY() - nry; rr = Math.sqrt(mx * mx + my * my); a = Math.atan2(my, mx); for (j = 1; j < l; j++) { i = start + j; if (i > nbase) i -= nbase + 1; bases.get(i).setX(nrx + rr * Math.cos(a + j * angleinc)); bases.get(i).setY(nry + rr * Math.sin(a + j * angleinc)); } } } /** * Constructs the segment between cp and cpnext as a circle if possible. * However, if the segment is too large, the lines are drawn between the two * connecting regions, and bases are placed there until the connecting * circle will fit. * * @throws ExceptionNAViewAlgorithm */ private void construct_extruded_segment(Connection cp, Connection cpnext) throws ExceptionNAViewAlgorithm { if (debug) System.out.println(" Construct_extruded_segment"); double astart, aend1, aend2, aave, dx, dy, a1, a2, ac, rr, da, dac; int start, end, n, nstart, nend; boolean collision; astart = cp.getAngle(); aend2 = aend1 = cpnext.getAngle(); if (aend2 < astart) aend2 += 2 * Math.PI; aave = (astart + aend2) / 2.0; start = cp.getEnd(); end = cpnext.getStart(); n = end - start; if (n < 0) n += nbase + 1; da = cpnext.getAngle() - cp.getAngle(); if (da < 0.0) { da += 2 * Math.PI; } if (n == 2) construct_circle_segment(start, end); else { dx = bases.get(end).getX() - bases.get(start).getX(); dy = bases.get(end).getY() - bases.get(start).getY(); rr = Math.sqrt(dx * dx + dy * dy); dx /= rr; dy /= rr; if (rr >= 1.5 && da <= Math.PI / 2) { nstart = start + 1; if (nstart > nbase) nstart -= nbase + 1; nend = end - 1; if (nend < 0) nend += nbase + 1; bases.get(nstart).setX(bases.get(start).getX() + 0.5 * dx); bases.get(nstart).setY(bases.get(start).getY() + 0.5 * dy); bases.get(nend).setX(bases.get(end).getX() - 0.5 * dx); bases.get(nend).setY(bases.get(end).getY() - 0.5 * dy); start = nstart; end = nend; } do { collision = false; construct_circle_segment(start, end); nstart = start + 1; if (nstart > nbase) nstart -= nbase + 1; dx = bases.get(nstart).getX() - bases.get(start).getX(); dy = bases.get(nstart).getY() - bases.get(start).getY(); a1 = Math.atan2(dy, dx); if (a1 < 0.0) a1 += 2 * Math.PI; dac = a1 - astart; if (dac < 0.0) dac += 2 * Math.PI; if (dac > Math.PI) collision = true; nend = end - 1; if (nend < 0) nend += nbase + 1; dx = bases.get(nend).getX() - bases.get(end).getX(); dy = bases.get(nend).getY() - bases.get(end).getY(); a2 = Math.atan2(dy, dx); if (a2 < 0.0) a2 += 2 * Math.PI; dac = aend1 - a2; if (dac < 0.0) dac += 2 * Math.PI; if (dac > Math.PI) collision = true; if (collision) { ac = minf2(aave, astart + 0.5); bases.get(nstart).setX( bases.get(start).getX() + Math.cos(ac)); bases.get(nstart).setY( bases.get(start).getY() + Math.sin(ac)); start = nstart; ac = maxf2(aave, aend2 - 0.5); bases.get(nend).setX(bases.get(end).getX() + Math.cos(ac)); bases.get(nend).setY(bases.get(end).getY() + Math.sin(ac)); end = nend; n -= 2; } } while (collision && n > 1); } } /** * Given n points to be placed equidistantly and equiangularly on a polygon * which has a chord of length, b, find the distance, h, from the midpoint * of the chord for the center of polygon. Positive values mean the center * is within the polygon and the chord, whereas negative values mean the * center is outside the chord. Also, the radial angle for each polygon side * is returned in theta. * * The procedure uses a bisection algorithm to find the correct value for * the center. Two equations are solved, the angles around the center must * add to 2*Math.PI, and the sides of the polygon excluding the chord must * have a length of 1. * * @throws ExceptionNAViewAlgorithm */ private void find_center_for_arc(double n, double b) throws ExceptionNAViewAlgorithm { if (debug) System.out.println(" Find_center_for_arc"); double h, hhi, hlow, r, disc, theta, e, phi; int iter; hhi = (n + 1.0) / Math.PI; // changed to prevent div by zero if (ih) hlow = -hhi - b / (n + 1.000001 - b); if (b < 1) // otherwise we might fail below (ih) hlow = 0; iter = 0; do { h = (hhi + hlow) / 2.0; r = Math.sqrt(h * h + b * b / 4.0); // if (r<0.5) {r = 0.5; h = 0.5*Math.sqrt(1-b*b);} disc = 1.0 - 0.5 / (r * r); if (Math.abs(disc) > 1.0) { throw new ExceptionNAViewAlgorithm( "Unexpected large magnitude discriminant = " + disc + " " + r); } theta = Math.acos(disc); // theta = 2*Math.acos(Math.sqrt(1-1/(4*r*r))); phi = Math.acos(h / r); e = theta * (n + 1) + 2 * phi - 2 * Math.PI; if (e > 0.0) { hlow = h; } else { hhi = h; } } while (Math.abs(e) > 0.0001 && ++iter < MAXITER); if (iter >= MAXITER) { if (noIterationFailureYet) { warningEmition("Iteration failed in find_center_for_arc"); noIterationFailureYet = false; } h = 0.0; theta = 0.0; } _h = h; angleinc = theta; } private double minf2(double x1, double x2) { return ((x1) < (x2)) ? (x1) : (x2); } private double maxf2(double x1, double x2) { return ((x1) > (x2)) ? (x1) : (x2); } public void warningEmition(String warningMessage) throws ExceptionNAViewAlgorithm { throw (new ExceptionNAViewAlgorithm(warningMessage)); } } PK �����4F>H����+���fr/orsay/lri/varna/models/naView/Base.class���1�8��%fr/orsay/lri/varna/models/naView/Base��java/lang/Object�mate�I�x�D�y� extracted�Z�region�)Lfr/orsay/lri/varna/models/naView/Region;��()V�Code �� ����'fr/orsay/lri/varna/models/naView/Region �� �� � � �LineNumberTable�LocalVariableTable�this�'Lfr/orsay/lri/varna/models/naView/Base;�getMate�()I �� ���setMate�(I)V�getX�()D ��% ���setX�(D)V�getY ��* � ��setY� isExtracted�()Z ��/ � � � setExtracted�(Z)V� getRegion�+()Lfr/orsay/lri/varna/models/naView/Region;� setRegion�,(Lfr/orsay/lri/varna/models/naView/Region;)V� SourceFile� Base.java�!����������������� ����� � ���� � ��� ��������B�����*�*�Y��������������������� ����������������/�����*���������������� ���������� �!�����>�����*�������� ������ ��������������������"�#�����/�����*�$�����������#���� ����������&�'�����>�����*'�$������� ����(��)��������������������(�#�����/�����*�)�����������,���� ����������+�'�����>�����*'�)������� ����0��1���������������� ����,�-�����/�����*�.�����������4���� ����������0�1�����>�����*�.������� ����8��9���������������� � ���2�3�����/�����*������������<���� ����������4�5�����>�����*+�������� ����@��A���������������� � ���6����7PK �����nq���������������fr/orsay/lri/varna/models/rna/PK �����4F>g �� ��E���fr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes.class���1�z��?fr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes��java/lang/Enum�RED�ALfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;�BLUE�GREEN�HEAT�ENERGY� ROCKNROLL�BW�_id�Ljava/lang/String;�_cm�.Lfr/orsay/lri/varna/models/rna/ModeleColorMap;� ENUM$VALUES�B[Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;��()V�Code���red ����,fr/orsay/lri/varna/models/rna/ModeleColorMap ��� redColorMap�0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; �� �!�"��V(Ljava/lang/String;ILjava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V ��$ ����'�blue ��) �*�� blueColorMap ��, ����/�green ��1 �2�� greenColorMap ��4 ��� �7�heat ��9 �:�� heatColorMap ��< � �� �?�energy ��A �B��energyColorMap ��D � �� �G� rocknroll ��I �J��rockNRollColorMap ��L � �� �O�bw ��Q �R�� bwColorMap ��T � � ��V ���LineNumberTable�LocalVariableTable ��Z �!�[�(Ljava/lang/String;I)V ��] � � ��_ ���this�id�cm�getId�()Ljava/lang/String;� getColorMap�toString�values�D()[Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes; �j�l�k�java/lang/System �m�n� arraycopy�*(Ljava/lang/Object;ILjava/lang/Object;II)V�valueOf�U(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes; ��r �o�s�5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;� SourceFile�ModeleColorMap.java� Signature�SLjava/lang/Enum;� InnerClasses�NamedColorMapTypes@1����� @����@����@����@� ���@� ���@� ���@� ������ �����������������������������Y���#�Y%&�(��+�Y-.�0��3�Y56�8��;�Y=>�@��C�YEF�H��K�YMN�P��S�Y�#SY�+SY�3SY�;SY�CSY�KSY�SS�U����W���"�������$��6��H��Z��l����X�������!�"�����\�����*+�Y*-�\*�^����W�������#��%� �&��'�X��� �����`�������a������b����c�d�����/�����*�\����W�������+�X��� �����`�����e������/�����*�^����W�������/�X��� �����`�����f�d�����/�����*�\����W�������3�X��� �����`���� �g�h�����6������UYK*Y<�YM�i,����W��������X������ �o�p�����*����� *�q�����W��������X�������t����u�v����w�x��� ����y@PK �����4F>^Sr��r��2���fr/orsay/lri/varna/models/rna/ModeleColorMap.class���17��,fr/orsay/lri/varna/models/rna/ModeleColorMap��java/lang/Object��java/lang/Cloneable��java/io/Serializable�serialVersionUID�J� ConstantValue8Fy}Y�_map�Ljava/util/Vector;� Signature�$Ljava/util/Vector;�_values�&Ljava/util/Vector;� DEFAULT_COLOR�Ljava/awt/Color;��()V�Code ����java/awt/Color ���GREEN �� ���LineNumberTable�LocalVariableTable��$�java/util/Vector �#�& �"� ��( �"�)�'(Ljava/util/Vector;Ljava/util/Vector;)V�this�.Lfr/orsay/lri/varna/models/rna/ModeleColorMap;�M(Ljava/util/Vector;Ljava/util/Vector;)V ��& ��/ �� ��1 ���map�values�LocalVariableTypeTable�addColor�(DLjava/awt/Color;)V �#�8 �9�:�toArray�()[Ljava/lang/Object; �<�>�=�java/lang/Double �?�@�valueOf�(D)Ljava/lang/Double; �B�D�C�java/util/Arrays �E�F� binarySearch�(([Ljava/lang/Object;Ljava/lang/Object;)I �#�H �I�J�insertElementAt�(Ljava/lang/Object;I)V�val�D�col�offset�I�inspoint� getMinValue�()D �#�T �U�V�size�()I �#�X �Y�Z�get�(I)Ljava/lang/Object; �<�\ �]�R� doubleValue� getMaxValue� getMinColor�()Ljava/awt/Color;� getMaxColor� getNumColors� getColorAt�(I)Ljava/awt/Color;�i� getValueAt�(I)Ljava/lang/Double;�getColorForValue�(D)Ljava/awt/Color; ��k �Q�R ��m �_�` ��o �^�R ��q �a�` ��s �t�V�getRed ��v �w�V�getGreen ��y �z�V�getBlue ��| �"�}�(III)V�result�c1�v1�c2�v2� blendCoeff�energyColorMap�0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; ��& �� ��`�brighter �� �5�6???ᙙ?ə�cm� bwColorMap �� ���white �� ���gray �� ��`�darker� greenColorMap �� ���green� blueColorMap �� ���blue� redColorMap �� ���red� heatColorMap �� ���yellow�rockNRollColorMap �� ���black@��������defaultColorMap �� ��� parseColorMap�B(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleColorMap;��[;,] ����java/lang/String ���split�'(Ljava/lang/String;)[Ljava/lang/String; �� ��� toLowerCase�()Ljava/lang/String; ����?fr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes �3��D()[Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes; �� ���getId �� ���equals�(Ljava/lang/Object;)Z �� ��� getColorMap �� ����: �<� ��� parseDouble�(Ljava/lang/String;)D �� ���decode�$(Ljava/lang/String;)Ljava/awt/Color; �� �b�V��java/lang/Exception�s�Ljava/lang/String;�data�[Ljava/lang/String;�name�p�ALfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;�data2�Ljava/lang/Double;� setMinValue�(D)V �� ���rescale�(DD)V�newMin� setMaxValue�newMax ����java/lang/Math ���max�(DD)D �#� ���set�'(ILjava/lang/Object;)Ljava/lang/Object;�minBck�maxBck�spanBck�valBck�clone �# �()Ljava/lang/Object;�1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)Z � �c�d �� � �f�g �<��getParamEncoding���java/util/Formatter �&�,  �format�<(Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;�%.2f:#%02X%02X%02X ! �java/lang/Integer �?"�(I)Ljava/lang/Integer; $ %&�out�()Ljava/lang/Appendable; �( )��toString�f�Ljava/util/Formatter; �- �� Exceptions0�$java/lang/CloneNotSupportedException �2 �� SourceFile�ModeleColorMap.java� InnerClasses�NamedColorMapTypes�!�������� � �� ���� ��������������������������������+������������ ��� ������ �!�������"������A�����*�#Y�%�#Y�%�'���� ��� ����:��;�!��� �����*�+����"�)������,����u�����*�-*+�.*,�0���� �������>��A� �B��C�!��� �����*�+������2������3���4��������2������3����5�6����������4*�0�7'�;�A6�!td6*�.-�G*�0'�;�G���� �������G��H��J��K�&�L�3�N�!���4����4�*�+�����4�K�L����4�M����$�N�O����P�O���Q�R�����M�����*�0�S�*�0�W�<�[���� �������R� �S��T�!��� �����*�+����^�R�����U�����#*�0�S�*�0*�0�Sd�W�<�[���� �������Y� �Z�!�[�!��� ����#�*�+����_�`�����L�����*�.�S�*�.�W������ �������a� �b��c�!��� �����*�+����a�`�����T�����"*�.�S�*�.*�.�Sd�W������ �������h� �i��j�!��� ����"�*�+����b�V�����2�����*�.�S���� �������p�!��� �����*�+����c�d�����@����� *�.�W����� �������u�!������� �*�+����� �e�O���f�g�����@����� *�0�W�<���� �������z�!������� �*�+����� �e�O���h�i����� ����'*�j� *�lN�'*�n� *�pN�*�0�7'�;�A6�*�.�W�N�td6*�.�W�:*�0�W�<�[9�*�.d�W�: *�0d�W�<�[9  'g go9 �Y �rk g �rkc �uk g �ukc �xk g �xkc�{N�N-���� ���R����� ������"��2��7��G��N��\��m��r������������������!��������*�+������K�L����~�����~���D��~�����~�����~���2��N�O��N��P�O��\�����m���L���l��� ��Y��L� ��M��L� � �������������Y�K*�Y�22�{��*��Y�22�{��*��Y��2�{��*��Y�2�{��*��Y22��{��*�Y22��{��*���� ���"���������6��O��g������!��� �����+��� �������S������Y�K*��*���*���� ��������������!��� �����+��� �������Y�����#�Y�K*����*���*���� ������������!��!��� �����+��� �������V����� �Y�K*����*��*���� ��������������!��� �����+��� �������V����� �Y�K*����*��*���� ��������������!��� �����+��� �������P������Y�K*��*��*���� ��������������!��� �����+��� �������d�����*�Y�K*���*��*����*���� ��������������(��!��� ���"��+��� �������$����������� ��������!������ ������r�����*�L+�@+2�M�Y:66�2N,-�˶�¶�Ι�-�Ұ�հ�Y�M>�<+2׶�:�(2�ٸ�;:2�:,�[��:+,��,�հ��h����� ���R������� ����)��7��<��F��J��R��W��a��h�t�}���� � � �!���\� ��������������6����)�����R�N��+��T�B�e�O��a�,����t��K���}��M����������B����� *'*�n����� ��� ���� �!������� �*�+����� ��L���������B����� **�j'����� ��� ���� �!������� �*�+����� ��L���������� ����c*�j9*�n9g9 )'�L)'c�J6 �2*�0 �W�<�[9 *�0 ')'g gk oc�;�W  *�0�Sȱ���� ���*� ���� �� �!!�'#�8$�S!�b'�!���R����c�*�+�����c��L����c��L���]�L�� �W�L���P�L� �$�>�e�O� �8��L� �������f�����&�Y�L+*�.�#�.+*�0�#�0+���� ������+�,�-�$.�!�������&�*�+������+��� ����������A*�+��=�(* +  �* + �*����� ������3� 4� 5�7�28�45�?:�!��� ����A�*�+�����A��+���0�e�O�������������LYM>�i�,�W,�Y*�0�WSY*�.�W��rSY*�.�W��uSY*�.�W��xSW*�,#'���� ���"���@�A� B�D�E�!F�tB�H�!���*�����*�+�����~��� �{*+���q�e�O��)������/�����*,���� ������O�!��� �����*�+��A�.����/����%�����*1���� ��������!������3���45��� ���6@PK �����|d}=s 1��1��1���fr/orsay/lri/varna/models/rna/ModeleColorMap.javapackage fr.orsay.lri.varna.models.rna; import java.awt.Color; import java.io.IOException; import java.io.Reader; import java.io.Serializable; import java.io.StreamTokenizer; import java.util.ArrayList; import java.util.Arrays; import java.util.Formatter; import java.util.Vector; public class ModeleColorMap implements Cloneable, Serializable{ /** * */ private static final long serialVersionUID = 4055062096061553106L; private Vector _map; private Vector _values; public static final Color DEFAULT_COLOR = Color.GREEN; public enum NamedColorMapTypes { RED ("red",ModeleColorMap.redColorMap()), BLUE ("blue",ModeleColorMap.blueColorMap()), GREEN ("green",ModeleColorMap.greenColorMap()), HEAT ("heat",ModeleColorMap.heatColorMap()), ENERGY ("energy",ModeleColorMap.energyColorMap()), ROCKNROLL ("rocknroll",ModeleColorMap.rockNRollColorMap()), BW ("bw",ModeleColorMap.bwColorMap()); String _id; ModeleColorMap _cm; private NamedColorMapTypes(String id, ModeleColorMap cm) { _id = id; _cm = cm; } public String getId() { return _id; } public ModeleColorMap getColorMap() { return _cm; } public String toString() { return _id; } } public ModeleColorMap() { this(new Vector(),new Vector()); } public ModeleColorMap(Vector map, Vector values) { _map = map; _values = values; } public void addColor(double val, Color col) { int offset = Arrays.binarySearch(_values.toArray(), val) ; if (offset<0) { int inspoint = (-offset)-1; _map.insertElementAt(col, inspoint); _values.insertElementAt(val,inspoint); } } public double getMinValue() { if (_values.size()>0) return _values.get(0); return 0.0; } public double getMaxValue() { if (_values.size()>0) return _values.get(_values.size()-1); return 0.0; } public Color getMinColor() { if (_map.size()>0) return _map.get(0); return DEFAULT_COLOR; } public Color getMaxColor() { if (_map.size()>0) return _map.get(_map.size()-1); return DEFAULT_COLOR; } public int getNumColors() { return (_map.size()); } public Color getColorAt(int i) { return (_map.get(i)); } public Double getValueAt(int i) { return (_values.get(i)); } public Color getColorForValue(double val) { Color result; if (val<=getMinValue()) { result = getMinColor(); } else if (val>=getMaxValue()) { result = getMaxColor(); } else { int offset = Arrays.binarySearch(_values.toArray(), val) ; if (offset>=0) { result = _map.get(offset); } else { int inspoint = (-offset)-1; Color c1 = _map.get(inspoint); double v1 = _values.get(inspoint); if (inspoint>0) { Color c2 = _map.get(inspoint-1); double v2 = _values.get(inspoint-1); double blendCoeff = (v2-val)/(v2-v1); result = new Color((int)(blendCoeff*c1.getRed()+(1.0-blendCoeff)*c2.getRed()), (int)(blendCoeff*c1.getGreen()+(1.0-blendCoeff)*c2.getGreen()), (int)(blendCoeff*c1.getBlue()+(1.0-blendCoeff)*c2.getBlue())); } else { result = c1; } } } return result; } public static ModeleColorMap energyColorMap() { ModeleColorMap cm = new ModeleColorMap(); cm.addColor(1.0,new Color(128,50,50).brighter()); cm.addColor(0.9,new Color(255,50,50).brighter()); cm.addColor(0.65,new Color(255,255,50).brighter()); cm.addColor(0.55,new Color(20,255,50).brighter()); cm.addColor(0.2,new Color(50,50,255).brighter()); cm.addColor(0.0,new Color(50,50,128).brighter()); return cm; } public static ModeleColorMap bwColorMap() { ModeleColorMap cm = new ModeleColorMap(); cm.addColor(0.0,Color.white); cm.addColor(1.0,Color.gray.darker()); return cm; } public static ModeleColorMap greenColorMap() { ModeleColorMap cm = new ModeleColorMap(); cm.addColor(0.0,Color.gray.brighter().brighter()); cm.addColor(1.0,Color.green.darker()); return cm; } public static ModeleColorMap blueColorMap() { ModeleColorMap cm = new ModeleColorMap(); cm.addColor(0.0,Color.gray.brighter().brighter()); cm.addColor(1.0,Color.blue); return cm; } public static ModeleColorMap redColorMap() { ModeleColorMap cm = new ModeleColorMap(); cm.addColor(0.0,Color.gray.brighter().brighter()); cm.addColor(1.0,Color.red); return cm; } public static ModeleColorMap heatColorMap() { ModeleColorMap cm = new ModeleColorMap(); cm.addColor(0.0,Color.yellow); cm.addColor(1.0,Color.red); return cm; } public static ModeleColorMap rockNRollColorMap() { ModeleColorMap cm = new ModeleColorMap(); cm.addColor(0.0,Color.red.brighter()); cm.addColor(1.0,Color.black); cm.addColor(2.0,Color.green.brighter()); return cm; } public static ModeleColorMap defaultColorMap() { return energyColorMap(); } public static ModeleColorMap parseColorMap(String s) { String[] data = s.split("[;,]"); if (data.length==1) { String name = data[0].toLowerCase(); for (NamedColorMapTypes p : NamedColorMapTypes.values()) { if (name.equals(p.getId().toLowerCase())) { return p.getColorMap(); } } return ModeleColorMap.defaultColorMap(); } else { ModeleColorMap cm = new ModeleColorMap(); for(int i=0;i1) return cm; } return ModeleColorMap.defaultColorMap(); } public void setMinValue(double newMin) { rescale(newMin,getMaxValue()); } public void setMaxValue(double newMax) { rescale(getMinValue(),newMax); } public void rescale(double newMin, double newMax) { double minBck = getMinValue(); double maxBck = getMaxValue(); double spanBck = maxBck-minBck; if (newMax!=newMin) { newMax = Math.max(newMax,newMin+1.0); for (int i=0;i<_values.size();i++) { double valBck = _values.get(i); _values.set(i, newMin+(newMax-newMin)*(valBck-minBck)/(spanBck)); } } } public ModeleColorMap clone() { ModeleColorMap cm = new ModeleColorMap(); cm._map = (Vector) _map.clone(); cm._values = (Vector)_values.clone(); return cm; } public boolean equals(ModeleColorMap cm) { if ( getNumColors()!=cm.getNumColors()) return false; for (int i=0;iJA!��A!��?���fr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding.class���1j��9fr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding��java/lang/Object�_clip�Ljava/awt/geom/GeneralPath;�_support�Ljava/awt/geom/Point2D$Double;� _children�Ljava/util/ArrayList;� Signature�RLjava/util/ArrayList;�_indices�*Ljava/util/ArrayList;�_p�:Lfr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion;�_r�#Lfr/orsay/lri/varna/models/rna/RNA;�_parent�;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;�this$0�,Lfr/orsay/lri/varna/models/rna/VARNASecDraw;��(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;Ljava/awt/geom/Point2D$Double;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion;Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;)V�Code �� �� �� ���()V� �java/util/ArrayList �� ��# � � ��% � � ��' �� �)�+�*�8fr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion �,�-�getLocalOutline�@(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/awt/geom/GeneralPath; ��/ �� ��1 �� ��3 �� ��5 ���LineNumberTable�LocalVariableTable�this�support�p�r�parent�addHelixEmbedding�?(Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;I)V ��@ �A�B�add�(Ljava/lang/Object;)Z �D�F�E�java/lang/Integer �G�H�valueOf�(I)Ljava/lang/Integer;�h�index�I�getShape�()Ljava/awt/geom/GeneralPath;�chooseNextMove�()I ��Q �R�S�indexOf�(Ljava/lang/Object;)I ��U �V�O�size �X�Z�Y�*fr/orsay/lri/varna/models/rna/VARNASecDraw �[�O�access$0 ��] �^�_�get�(I)Ljava/lang/Object; �D�a �b�O�intValue �X�d �e�f�_rnd�Ljava/util/Random; �h�j�i�java/util/Random �k�l�nextInt�(I)I@ !TD-@������� ��r �s�t�set�'(ILjava/lang/Object;)Ljava/lang/Object; ��v �w�x�rotate�(D)V�i�min�max� prevIndex�newIndex�rot�D� cancelMove�(I)V�delta ����java/awt/geom/Point2D$Double ���x �� ���y ����java/awt/geom/AffineTransform ���getRotateInstance�$(DDD)Ljava/awt/geom/AffineTransform; �� ��� transform�"(Ljava/awt/geom/AffineTransform;)V�angle ����java/awt/geom/GeneralPath �� ���G(Ljava/awt/geom/Point2D;Ljava/awt/geom/Point2D;)Ljava/awt/geom/Point2D; ����java/awt/geom/Point2D ���getX�()D �� ���getY �� ��� setLocation�(DD)V�a�Ljava/awt/geom/AffineTransform;�Ljava/awt/geom/Point2D;�reflectCoordinates ����!fr/orsay/lri/varna/models/rna/RNA ���get_listeBases�()Ljava/util/ArrayList; �)� ��K�_len �� ���"(D)Ljava/awt/geom/AffineTransform; �� ���getPathIterator�=(Ljava/awt/geom/AffineTransform;)Ljava/awt/geom/PathIterator; ����java/awt/geom/PathIterator ���currentSegment�([D)I �� �� ����java/lang/System ���out�Ljava/io/PrintStream; ����java/util/Arrays ���toString�([D)Ljava/lang/String; ����java/io/PrintStream ���println�(Ljava/lang/String;)V �� ���next �� ���isDone�()Z �� ���distance�(Ljava/awt/geom/Point2D;)D��java/lang/StringBuilder��DELTA: �� �� �� ���append�(D)Ljava/lang/StringBuilder;�� �� ���-(Ljava/lang/String;)Ljava/lang/StringBuilder;@D������ �� ���()Ljava/lang/String; �)� ��K�_pos1 �)� ��K�_pos2��(fr/orsay/lri/varna/models/rna/ModeleBase �� �� setCoords�!(Ljava/awt/geom/Point2D$Double;)V � �� �) ��4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;   �2fr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree   � getPortion�7(I)Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion;�:fr/orsay/lri/varna/models/rna/VARNASecDraw$UnpairedPortion   �K�_pos  �  �O�getNumPortions � �placeTerminalLoop�;(Ljava/util/ArrayList;Lfr/orsay/lri/varna/models/rna/RNA;)V�mbl�pi�Ljava/awt/geom/PathIterator;�args�[D�type�np� startLeft�endLeft�endRight� startRight�d�vx�vy�interval�n�j�mbLeft�*Lfr/orsay/lri/varna/models/rna/ModeleBase;�mbRight�center�4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion;�up�;�5Ljava/util/ArrayList;�g(Ljava/util/ArrayList;Lfr/orsay/lri/varna/models/rna/RNA;)V  7 8�O� getNumBases �X: ;<�determineRadius�((IILfr/orsay/lri/varna/models/rna/RNA;)D �> ?@� getCoords� ()Ljava/awt/geom/Point2D$Double;@P@�����@!TD- FHG�java/lang/Math IJ�cos�(D)D FL MJ�sin�rad�b�pl�pr�pm�vnx�vny�pc�circ�incrLoop�mb�dx�dy�pf]� Emb.Hel.: �)�� SourceFile�VARNASecDraw.java� InnerClasses�HelixEmbedding� PairedPortione�2fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion�Portion�RNATree�UnpairedPortion�Double� ������������������� � �� ���� ��� � �� ��������������������������� �������������@*+�*�*�Y�!�"*�Y�!�$*,�&*-�(�.*-�0*�2*�4����6���&� ��'� � ��"�$#�.$�3%�9&�7���4����@�8������@�9�����@�:�����@�;�����@�<����=�>�����\�����*�"+�?W*�$�C�?W����6������+� ,�-�7��� �����8�������I������J�K���L�M�����/�����*�.����6������1�7��� �����8�����N�O���������*�4�"*�P<*�4�"�T�Wd�*�4�"�T�=�Wd>�Q�=�*�4�$d�\�D�``=*�4�"�Td� �Wd>�*�4�$`�\�D�`d>*�4�$�\�D�`6�c`d�g`6d�mk�ok�Wo9*�4�$�C�qW*�ud����6���F���7� :�<�,=�7@�;A�@C�VD�fE�oG�I�J�K�L�M�N�P�7���p� ����8���� ��y�K��.� �z�K��=��z�K��V��z�K��4��{�K��l��{�K���T�{�K���A�|�K���2�}�K����~���������������I*�4�"*�P=*�4�$�\�D�`>t�mk�ok�Wo9*�4�$d�C�qW*�u����6������U� V�W�0X�BY�HZ�7���4����I�8������I��K�� �=�y�K���+�|�K��0��~����w�x�����O�����*'*�&�*�&�������6��� ���^�_�7��������8����������������������D*�.+�+*�&�M*�&,�,��>�*�"�\�+�*�"�T����6������c�d�e�!f�&h�5f�Cj�7���*����D�8������D�����2�:���#� �y�K��������y� ���U*�2�L*�0�*�.��M�Y�!N�G:,��6� �&�Y11�:-�?W��˶�,��,��-�T�-�\�:-�\�:-�\�:-�\�:�9��g9 ��g9 9*�0��B o9  o9 *�0�go9�Ż�Y�������6�*�0�`6*�0�d6+�\�:�Y� kkc� kkc�ö�+�\�:�Y� kkc� kkc�ö�*�0�r=�*�"�\�*�"�T*�"�T�u*�"�\��&M>�P*�0: �8 :6�!`6+�\�:,�ۄ*�0� *+*�2����6����5��n�p�r�s�&t�)v�/w�9x�D{�U|�\}�g�mt�v�~�������������)5@ju $*7KT�7�����U�8����M� ����&�:� ��/�>��9�4�K��U� ���%!���"���#���$����%����&�� ��'�� ��(���)�K�)�v�y�K�5�j*�K�@�_+,�u�*-,���y�K��c.���^�y�K��=�:/� �.01� �+*�K��)�K�$�+,�2�����M3��&�:4���� ���5���c� �%��*�"�T*�0*�0N- - :*�6*�299*�0�*�0�`d6*�0�*�0�dd6+�\�: +�\�:  =:  =: �Y � �c�oo � �c�oo�:  � �g  �o9 � �g  �o9w99�Y �kc �kc�:�6ckAc9C�ko9CAk�oko96�p`6+�\�:c9EwkKkc9 EwkKkc9"�Y� kc�"kc�:$$�����6���v�����$�+�1�D�W�j�u�������%5;EPWk�7������8������ ����;���$�:/��101��DnN���W[��K��jHO�K��u=+,� �2-,� �+P�� �$Q�� ��R�� ��&����'����S����T���U���V��%�W��5�}���8�z*�K�E�`)�K�P�UX,�k�:Y�� �&Z��"�[��$2��� ���3���������B������Y\�*�0^������6�������7��� �����8����_���`a���2���Xb��)�Xc�d�Xf�Xg� �Xh���i� PK �����y>Fac ��c ��>���fr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion.class���1���8fr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion��2fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion�_pos1�I�_pos2�_len�_r�4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;�this$0�,Lfr/orsay/lri/varna/models/rna/VARNASecDraw;��f(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;IIILfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;)V�Code �� � � �� � ��/(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;)V �� �� �� �� �� �� �� � � �LineNumberTable�LocalVariableTable�this�:Lfr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion;�pos1�pos2�len�r� getBaseList�()Ljava/util/ArrayList;� Signature�,()Ljava/util/ArrayList;�toString�()Ljava/lang/String;�,�java/lang/StringBuilder�.�H[ �+�0 � �1�(Ljava/lang/String;)V �+�3 �4�5�append�(I)Ljava/lang/StringBuilder;�7�, �+�9 �4�:�-(Ljava/lang/String;)Ljava/lang/StringBuilder;�<�][�>�] �@�B�A�2fr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree �)�* �+�B� getNumBases�()I�getLocalOutline�@(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/awt/geom/GeneralPath;�I�java/awt/geom/GeneralPath �H�K � �L�()V �N�P�O�!fr/orsay/lri/varna/models/rna/RNA �Q�&�get_listeBases �S�U�T�java/util/ArrayList �V�W�get�(I)Ljava/lang/Object;�Y�(fr/orsay/lri/varna/models/rna/ModeleBase �X�[ �\�]� getCoords� ()Ljava/awt/geom/Point2D$Double; �_�a�`�java/awt/geom/Point2D$Double �b�c�x�D �_�e �f�c�y �H�h �i�j�moveTo�(FF)V �H�l �m�j�lineTo�#Lfr/orsay/lri/varna/models/rna/RNA;�gp�Ljava/awt/geom/GeneralPath;�l�Ljava/util/ArrayList;�p1�Ljava/awt/geom/Point2D$Double;�p2�p3�p4�LocalVariableTypeTable�ALjava/util/ArrayList;� getOutline ��| �z�}�A(Lfr/orsay/lri/varna/models/rna/RNA;Z)Ljava/awt/geom/GeneralPath; �@� �z�G �H� �4��(Ljava/awt/Shape;Z)V�local�Z� SourceFile�VARNASecDraw.java� InnerClasses��*fr/orsay/lri/varna/models/rna/VARNASecDraw� PairedPortion�Portion�RNATree��java/awt/geom/Point2D�Double�!�������������������������� � ��� � ����� �����������!*+�*+�*�*�*�*������������U��O� �Q��R��S��T����4����!�� �����!�!�����!�"�����!�#�����!�$� ���%�&��'����(����,����������������Z���� ������ ����)�*����������U�+Y-�/*��26�8*�*�`d�2;�8*�*�d`�26�8*��2=�8*��?�8�C�����������_���� ����U�� ����D�E�����1�����*�h�����������d���� ������ ����F�G����R������HY�JM*��+�MN-*��R�X�Z:-*�*�`d�R�X�Z:-*�*�d`�R�X�Z:-*��R�X�Z:,�^�d�g,�^�d�k,�^�d�k,�^�d�k,�������2� ���h��i��k��l�$�m�;�n�R�o�b�p�r�q��r��s��u����R������ ������$�n����o�p����q�r��$�~�s�t��;�g�u�t��R�P�v�t��b�@�w�t��x��� ����q�y���z�G�����;�����*+�{�����������z���������� ������$�n���z�}����q�� ���+�MN-*��R�X�Z:-*�*�`d�R�X�Z:-*�*�d`�R�X�Z:-*��R�X�Z:�HY�J:�^�d�g�^�d�k�*�+�~��^�d�k�^�d�k�������6� ���~�����,��C��S��\��m��~�������������\� ����� ������$�n����������q�r����s�t��,��u�t��C�r�v�t��S�b�w�t��\�Y�o�p��x��� ����q�y�����������"���������@����_��� PK �����y>R����8���fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion.class���1�!��2fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion��java/lang/Object�this$0�,Lfr/orsay/lri/varna/models/rna/VARNASecDraw;��/(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;)V�Code �� �� �� ���()V�LineNumberTable�LocalVariableTable�this�4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion;� getBaseList�()Ljava/util/ArrayList;� Signature�,()Ljava/util/ArrayList;� getNumBases�()I� getOutline�@(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/awt/geom/GeneralPath;� SourceFile�VARNASecDraw.java� InnerClasses��*fr/orsay/lri/varna/models/rna/VARNASecDraw�Portion!��������������� ���4����� *+� *� ��������������� ���� ������������������������������ ���� PK �����y>QP �� ��8���fr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree.class���1�z��2fr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree��java/lang/Object� _portions�Ljava/util/ArrayList;� Signature�KLjava/util/ArrayList;�_numPairedPortions�I�this$0�,Lfr/orsay/lri/varna/models/rna/VARNASecDraw;��/(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;)V�Code �� � � �� � ��()V��java/util/ArrayList �� �� �� �� � � �LineNumberTable�LocalVariableTable�this�4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;� addPortion�7(Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion;)V ��# �$�%�add�(Ljava/lang/Object;)Z�'�8fr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion�p�4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion;�getNumPortions�()I ��- �.�+�size� getPortion�7(I)Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion; ��2 �3�4�get�(I)Ljava/lang/Object;�6�2fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion�i�toString�()Ljava/lang/String;�;�� �=�?�>�*fr/orsay/lri/varna/models/rna/VARNASecDraw �@� �_depth�B�java/lang/StringBuilder �D�F�E�java/lang/String �G�H�valueOf�&(Ljava/lang/Object;)Ljava/lang/String; �A�J � �K�(Ljava/lang/String;)V�M�%1$# �A�O �P�Q�append�(I)Ljava/lang/StringBuilder;�S�s �A�U �P�V�-(Ljava/lang/String;)Ljava/lang/StringBuilder; �A�X �8�9 �Z�\�[�java/lang/Character �G�]�(C)Ljava/lang/Character; �D�_ �`�a�format�9(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; ��X�d� �result�Ljava/lang/String;� getOutline�@(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/awt/geom/GeneralPath;�j�java/awt/geom/GeneralPath �i� �5�m �g�h �i�o �P�p�(Ljava/awt/Shape;Z)V�r�#Lfr/orsay/lri/varna/models/rna/RNA;�Ljava/awt/geom/GeneralPath;� SourceFile�VARNASecDraw.java� InnerClasses� PairedPortion�Portion�RNATree�!������������������ � ��� � ����� ������P�����*+�*�*�Y��*��������������� ������� ���������� �!�����[�����*�+�"W+�&� *Y�`������������� ���������������������(�)���*�+�����2�����*��,��������������� ����������/�0�����@����� *��1�5������������������� ������� �7� ���8�9���������:L*�Y�<`�<=��AY+�C�I�AYL�I*��<�NR�T�W�Y �YS�^�T�WL�AY+�C�I*��1�5�b�T�WL*��,d��AY+�C�Ic�T�WL*��,x*�Y�<d�<+�������*� ����������Q��q��~����������� �����������e�f����7� ���g�h����������1�iY�kM>�,*��1�5+�l�n*��,,�������������� ��!��/�����*����1�������1�q�r���)�e�s�� �%�7� ���t����u�v�����&�=�w��5�=�x��=�y�PK �����y>OF\ ��\ ��@���fr/orsay/lri/varna/models/rna/VARNASecDraw$UnpairedPortion.class���1�v��:fr/orsay/lri/varna/models/rna/VARNASecDraw$UnpairedPortion��2fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion�_pos�I�_len�this$0�,Lfr/orsay/lri/varna/models/rna/VARNASecDraw;��1(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;II)V�Code �� �� �� � ��/(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;)V �� �� �� ���LineNumberTable�LocalVariableTable�this�;�toString�()Ljava/lang/String;�#�java/lang/StringBuilder�%�U[ �"�' � �(�(Ljava/lang/String;)V �"�* �+�,�append�(I)Ljava/lang/StringBuilder;�.�, �"�0 �+�1�-(Ljava/lang/String;)Ljava/lang/StringBuilder;�3�] �"�5 � �!� getNumBases�()I� getOutline�@(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/awt/geom/GeneralPath;�;�java/awt/geom/GeneralPath �:�= � �>�()V �@�B�A�!fr/orsay/lri/varna/models/rna/RNA �C��get_listeBases �E�G�F�java/util/ArrayList �H�I�get�(I)Ljava/lang/Object;�K�(fr/orsay/lri/varna/models/rna/ModeleBase �J�M �N�O� getCoords� ()Ljava/awt/geom/Point2D$Double; �Q�S�R�java/awt/geom/Point2D$Double �T�U�x�D �Q�W �X�U�y �:�Z �[�\�moveTo�(FF)V �:�^ �_�\�lineTo�r�#Lfr/orsay/lri/varna/models/rna/RNA;�gp�Ljava/awt/geom/GeneralPath;�l�Ljava/util/ArrayList;�p0�Ljava/awt/geom/Point2D$Double;�i�p�LocalVariableTypeTable�ALjava/util/ArrayList;� SourceFile�VARNASecDraw.java� InnerClasses�p�*fr/orsay/lri/varna/models/rna/VARNASecDraw�Portion�UnpairedPortion�t�java/awt/geom/Point2D�Double�!������������������� ����� � �� ���_�����*+� *+�*�*������������)��%� �'��(���� ������������������������������ ���,����������������-���� ���������� �!�� ���V�����,�"Y$�&*��)-�/*�*�`d�)2�/�4�����������1���� ����,������6�7�� ���/�����*������������5���� ����������8�9�� ��������d�:Y��-�?�3�A�F�B�V�?�b�D����H����d�������d�`�a���\�b�c�� �W�d�e���G�f�g��0�2�h���F��i�g��j��� �� �W�d�k���l����m�n������o�q��o�r��Q�s�u� PK �����y>}[/(��/(��0���fr/orsay/lri/varna/models/rna/VARNASecDraw.class���1_��*fr/orsay/lri/varna/models/rna/VARNASecDraw��java/lang/Object�_vp�Lfr/orsay/lri/varna/VARNAPanel;�_depth�I�_rnd�Ljava/util/Random;� MAX_NUM_DIR��()V�Code �� ����java/util/Random �� �� � �� � � �� � ��LineNumberTable�LocalVariableTable �� �� ���this�,Lfr/orsay/lri/varna/models/rna/VARNASecDraw;� buildTree�\(IILfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;Lfr/orsay/lri/varna/models/rna/RNA;)V�$�:fr/orsay/lri/varna/models/rna/VARNASecDraw$UnpairedPortion �#�& ��'�1(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;II)V �)�+�*�2fr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree �,�-� addPortion�7(Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion;)V �/�1�0�!fr/orsay/lri/varna/models/rna/RNA �2�3�get_listeBases�()Ljava/util/ArrayList; �5�7�6�java/util/ArrayList �8�9�get�(I)Ljava/lang/Object;�;�(fr/orsay/lri/varna/models/rna/ModeleBase �:�= �>�?�getElementStructure�()I �5�A �B�?�size �)�D ��E�/(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;)V ��G �!�"�I�8fr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion �H�K ��L�f(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;IIILfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;)V�i�j�parent�4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;�r�#Lfr/orsay/lri/varna/models/rna/RNA;�i1�j1�over�Z�i2�j2�t�p�:Lfr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion;�k�l�start�len� nextPlacement�([I)[I� Exceptions�d�java/lang/Exception�f�No more placement available �c�h ��i�(Ljava/lang/String;)V�[I�prev�stop�drawTree�](DDLfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;DLfr/orsay/lri/varna/models/rna/RNA;)V@P@�����@D������ �)�t �u�v� getPortion�7(I)Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion; �x�z�y�2fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion �{�?� getNumBases �)�} �~�?�getNumPortions@!TD- �/� ���determineRadius�(IID)D ����java/lang/Math ���round�(D)J ����java/lang/System ���out�Ljava/io/PrintStream; ����java/io/PrintStream �� �println@ !TD- �� ���cos�(D)D �� ���sin �5� �H� ���_pos1 �H� ���_pos2��java/awt/geom/Point2D$Double@������� �� ���(DD)V �:� ��� setCoords�!(Ljava/awt/geom/Point2D$Double;)V �H� ���_len �H� ��P�_r �� �m�n �H� ��� getOutline�@(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/awt/geom/GeneralPath; �5� ���add�(Ljava/lang/Object;)Z �#� ���_pos �#���java/awt/geom/Area��java/awt/Shape �� ���(Ljava/awt/Shape;)V �� ��� intersect�(Ljava/awt/geom/Area;)V �� ���isEmpty�()Z �� �`�a�x0�D�y0�dir� collision�x�y� numHelices�nbHel�nbUn�totCirc�4Lfr/orsay/lri/varna/models/rna/VARNASecDraw$Portion;�radius� placement�inc�val� angleIncr�shapes�Ljava/util/ArrayList;�curH�ndir�pp�vx�vy�nx�ny�up�;�((IILfr/orsay/lri/varna/models/rna/RNA;)D� numUnpaired�circ� predrawTree�(DDLfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;DLfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;Ljava/util/ArrayList;)V� Signature�(DDLfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;DLfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;Ljava/util/ArrayList;)V �� ���9fr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding � ��(Lfr/orsay/lri/varna/models/rna/VARNASecDraw;Ljava/awt/geom/Point2D$Double;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion;Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;)V � �addHelixEmbedding�?(Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;I)V � ���;Lfr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding;�all� numUBases�nh�RLjava/util/ArrayList;�drawRNA�Z(DLfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree; � ��(Ljava/lang/Object;)VAe���� � �nextInt�(I)I � �?�chooseNextMove�java/awt/geom/GeneralPath � �" #$�getShape�()Ljava/awt/geom/GeneralPath; & '(�append�(Ljava/awt/Shape;Z)V �/* +,� _debugShape�Ljava/awt/geom/GeneralPath; .0/�fr/orsay/lri/varna/VARNAPanel 1�?�getWidth .3 4�?� getHeight .6 78�paintImmediately�(IIII)V �: ;<� cancelMove�(I)V �> �?�(D)V �A B� �reflectCoordinates �cD E� �printStackTrace�dirAngle�root�steps� prevbadness�chosen�delta�badness�s1�Ljava/awt/Shape;�s2�a�e�Ljava/lang/Exception;�access$0� SourceFile�VARNASecDraw.java� InnerClasses�HelixEmbedding� PairedPortion�Portion�RNATree�UnpairedPortion]�java/awt/geom/Point2D�Double�!������ ���������� � � ��� � ���� �� � �����@��������Y���������������:�<����������� �����<����� *�*��������������� ����� ���� �� ����!�"����{�� ��/�-�#Y*d`�%�(�.�4�:�<�666�"�.�4�:�<� 6� `�.�@�d�`d�66 �)Y*�C: d�*  �F�HY*d �J: - �(�y666�Q�.�4�:�<6�3�-�#Y*�%�(*-�F`666� �-�#Y*�%�(��������$��������*��-��0��3��6��I��O��U��w��z��}������������������������������� �����.�������/�� ����/�M����/�N����/�O�P���/�Q�R��-��S���0��T���3��U�V��z�>�W���}�;�X�� ��1�Y�P� �� �Z�[� ��s�\����<�]����o�^����l�_����`�a��b�����c���������^+d=�>6�+.d� +.>�6�� �cYe�g+\.`O�++d.`O++�������J����� � ����"�%�.�2�<�C�F�I�S�V�\����4����^�� �����^�Z�j���Y�M��� �U�k��� �R�l�V���m�n��b�����c���W� �.��=6 '9 )9 666�o�qc96�D�s:�H��o�qcc9��q�wkc9�w``6�|�o�96��s:�H��| :�co996��Oc9����o9K'�c�kc9 )�c�kc9 �5Y�:66�s:�H/.kc9 �H:"6#�"�#`6$"�#d6% �9& �9( #�qkc&kc9* #�qkc(kc9,�.$�4�:�Y*�o(k�oc,�o&k�og���.%�4�:�Y*�o(k�og,�o&k�oc��##"�N "�d�qkc �kc9# "�d�qkc �kc9%*#%"� �c�"��W�F�#�>�#: 6!�'�. �!`�4�:�Y  ��!! �ġՄ�|v�@�6 6�Y�Y�4�Ƿ�:`6 �+�Y �4�Ƿ�:!!��К�6  �@� ̄�@�  �*�:�6  ������6�M����� � ����!�*�2�>�D�S�_�l�}����������������!*2@CJPZdkr9N^fms��$) 47<����,��=�� ����=�����=�����=�Y�P���=�����=�Q�R��:��V� �7��� � 4��� � 1����.����+����"�����N�M���*�5�Z���}�����$�M���� �Z�����j������������M���Q����������M��*w�Z��@��� J��[�"M��N��#Z��S��$d��W��%k����&r����(�t���*�b���,�?���#9�%���%m�4��� p�1�N��!�h�M���@����:�N�� ����!���� ������������n������ok`�qkc9�o������� ��������4������ ������������������Q�R�����������b�����c��������� �-��'9 )9 66�o�qc96�B�s:�H��o�qcc9��q�wkc9�w`6�|*`�9 :�co996��Oc9��o9'�c�kc9 )�c�kc9 66�s:�HU.kc9�H:!6"�!�"`6#!�"d6$�9%�9' "�qkc%kc9) "�qkc'kc9+�.#�4�:�Y)�o'k�oc+�o%k�og���.$�4�:�Y)�o'k�og+�o%k�oc��""!�N !�d�qkc�kc9" !�d�qkc�kc9$�Y*�Y  �! :& &. &�W*"$!��c&  �F�#�>�#:6 �'�.� `�4�:�Y  ��  �ġՄ�|P��������6����� � ���$�,�8�>�M�W�d�r�x� � � � � ��������� $+ =!O"#%&' ()!*:+@-H/O0U2v07���~�&���� ���������������Y�P���������Q�R����O � �� �� ���� ���� � ����  ���|�����L�M���$�3�Z���r����x��j�� ���� ������M������������M����Z���D���=��[�!��N��"��S��#��W��$$����%+����'=�t���)O�b���+�h���"�N���$ �3 �&O�4���R�1�N�� ���� ��� � �����&� ����)Y*�C:*-�.�@d-�F��5Y�::�Y*�Y��HY*�J-:*- 69��@�4�:  6 ��LY : 6 �  �4�!%  �@- )��-�259 6�a�4�!:`6�<�4�!:�Y�:�Y�ɶ��К�  c9 �@�@ g�   9� 9� =� �@� :C��/�c������)��?� @�A�#B�,C�/E�QF�_G�dH�iI�lM�N�P�R�S�T�S�U�V�Z�[�]�^�`ab c(e.^;[HjRl\p`shukIww|xy{}��������� ����F�����Q�R�� �Y�P��,b ���/_G ��d H���iI����J � ��K�� ��@�Z,� ��#�M�� ��L�� ��k�M����LMN���F�N���'ON��P���QR����� ��,b �S�?�����$�����������������<�������T���UV���2���W��H�X��x�Y�)�Z��#�[��\^� PK �����y>A2]��]��/���fr/orsay/lri/varna/models/rna/VARNASecDraw.javapackage fr.orsay.lri.varna.models.rna; import java.awt.Rectangle; import java.awt.Shape; import java.awt.geom.AffineTransform; import java.awt.geom.Area; import java.awt.geom.GeneralPath; import java.awt.geom.PathIterator; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; import java.util.Random; import java.util.Stack; import java.util.Vector; import fr.orsay.lri.varna.VARNAPanel; public class VARNASecDraw { public static VARNAPanel _vp = null; public abstract class Portion { public abstract ArrayList getBaseList(); public abstract int getNumBases(); public abstract GeneralPath getOutline(RNA r); }; public class UnpairedPortion extends Portion { int _pos; int _len; public UnpairedPortion(int pos, int len) { _len = len; _pos = pos; } @Override public ArrayList getBaseList() { // TODO Auto-generated method stub return null; } public String toString() { return "U["+_pos+","+(_pos+_len-1)+"]"; } public int getNumBases() { return _len; } public GeneralPath getOutline(RNA r) { GeneralPath gp = new GeneralPath(); ArrayList l = r.get_listeBases(); Point2D.Double p0 = l.get(_pos).getCoords(); gp.moveTo((float)p0.x, (float)p0.y); for (int i=1;i<_len;i++) { Point2D.Double p = l.get(_pos+i).getCoords(); gp.lineTo((float)p.x, (float)p.y); } return gp; } }; public class PairedPortion extends Portion { int _pos1; int _pos2; int _len; RNATree _r; public PairedPortion(int pos1,int pos2, int len, RNATree r) { _pos1 = pos1; _pos2 = pos2; _len = len; _r =r; } @Override public ArrayList getBaseList() { // TODO Auto-generated method stub return null; } public String toString() { return "H["+_pos1+","+(_pos1+_len-1)+"]["+(_pos2-_len+1)+","+(_pos2)+"]\n"+_r.toString(); } @Override public int getNumBases() { return 2*_len; } public GeneralPath getLocalOutline(RNA r) { GeneralPath gp = new GeneralPath(); if (_len>0) { ArrayList l = r.get_listeBases(); Point2D.Double p1 = l.get(_pos1).getCoords(); Point2D.Double p2 = l.get(_pos1+_len-1).getCoords(); Point2D.Double p3 = l.get(_pos2-_len+1).getCoords(); Point2D.Double p4 = l.get(_pos2).getCoords(); gp.moveTo((float)p1.x, (float)p1.y); gp.lineTo((float)p2.x, (float)p2.y); gp.lineTo((float)p3.x, (float)p3.y); gp.lineTo((float)p4.x, (float)p4.y); } return gp; } public GeneralPath getOutline(RNA r) { return getOutline(r,false); } public GeneralPath getOutline(RNA r, boolean local) { ArrayList l = r.get_listeBases(); Point2D.Double p1 = l.get(_pos1).getCoords(); Point2D.Double p2 = l.get(_pos1+_len-1).getCoords(); Point2D.Double p3 = l.get(_pos2-_len+1).getCoords(); Point2D.Double p4 = l.get(_pos2).getCoords(); GeneralPath gp = new GeneralPath(); gp.moveTo((float)p1.x, (float)p1.y); gp.lineTo((float)p2.x, (float)p2.y); if (!local) gp.append(_r.getOutline(r), true); gp.lineTo((float)p3.x, (float)p3.y); gp.lineTo((float)p4.x, (float)p4.y); return gp; } }; public int _depth = 0; public class RNATree { ArrayList _portions = new ArrayList(); int _numPairedPortions=0; public RNATree() { } public void addPortion(Portion p) { _portions.add(p); if (p instanceof PairedPortion) { _numPairedPortions++; } } public int getNumPortions() { return _portions.size(); } public Portion getPortion(int i) { return _portions.get(i); } public String toString() { String result = ""; _depth++; for (int i=0;i<_portions.size();i++ ) { result += String.format("%1$#" + _depth + "s", ' '); result += _portions.get(i).toString(); if (i<_portions.size()-1) result += "\n"; } _depth--; return result; } public GeneralPath getOutline(RNA r) { GeneralPath result = new GeneralPath(); for (int i=0;i<_portions.size();i++) { result.append(_portions.get(i).getOutline(r),true); } return result; } }; private void buildTree(int i, int j, RNATree parent, RNA r) { //LinkedList s = new LinkedList(); //s.add(new BuildTreeArgs(xi, xj, xparent,xr)); //while(s.size()!=0) //{ //BuildTreeArgs a = s.removeLast(); if (i >= j) { parent.addPortion(new UnpairedPortion(i,j-i+1)); } // BasePaired if (r.get_listeBases().get(i).getElementStructure() == j) { int i1 = i; int j1 = j; boolean over = false; while( (i+1=0)&& (i+1<=j-1) && !over) { if (r.get_listeBases().get(i).getElementStructure() != j) { over = true; } else { i++;j--; } } int i2 = i; int j2 = j; RNATree t = new RNATree(); if (i0) { parent.addPortion(new UnpairedPortion(start,len)); } buildTree(k, l, parent, r); k = l + 1; start = k; len = 0; } else { len++; k++; } } if (len>0) { parent.addPortion(new UnpairedPortion(start,len)); } } } /* public void drawTree(double x0, double y0, RNATree t, double dir, RNA r, double straightness) { boolean collision = true; double x=x0; double y=y0; double multRadius = 1.0; double initCirc = r.BASE_PAIR_DISTANCE+r.LOOP_DISTANCE; for (int i=0;i shapes = new ArrayList(); for (int i=0;i0) { collision = false; for (int i=0;(i=0) && !stop) { if (p[i]==prev-1) { prev = p[i]; i--; } else { stop = true; } } if (i<0) throw new Exception("No more placement available"); p[i]++; i++; while(i shapes = new ArrayList(); int curH = 0; for (int i=0;i0) { collision = false; for (int i=0;(i _children = new ArrayList(); ArrayList _indices = new ArrayList(); PairedPortion _p; RNA _r; HelixEmbedding _parent; public HelixEmbedding(Point2D.Double support, PairedPortion p, RNA r, HelixEmbedding parent) { _support = support; _clip = p.getLocalOutline(r); _p = p; _r = r; _parent = parent; } public void addHelixEmbedding(HelixEmbedding h, int index) { _children.add(h); _indices.add(index); } public GeneralPath getShape() { return _clip; } public int chooseNextMove() { int i = _parent._children.indexOf(this); int min; int max; if (_parent._children.size() mbl = _r.get_listeBases(); if (_p._len>0) { PathIterator pi = _clip.getPathIterator(AffineTransform.getRotateInstance(0.0)); ArrayList p = new ArrayList(); while(!pi.isDone()) { double[] args = new double[6]; int type= pi.currentSegment(args); if ((type == PathIterator.SEG_MOVETO) || (type == PathIterator.SEG_LINETO)) { Point2D.Double np = new Point2D.Double(args[0],args[1]); p.add(np); System.out.println(Arrays.toString(args)); } pi.next(); } if (p.size()<4) { return; } Point2D.Double startLeft = p.get(0); Point2D.Double endLeft = p.get(1); Point2D.Double endRight = p.get(2); Point2D.Double startRight = p.get(3); double d = startLeft.distance(endLeft); double vx = endLeft.x-startLeft.x; double vy = endLeft.y-startLeft.y; double interval = 0.0; if (_p._len>1) { vx/=d; vy/=d; interval = d/((double)_p._len-1); System.out.println("DELTA: "+interval+" "+_r.LOOP_DISTANCE); } for (int n=0;n<_p._len;n++) { int i = _p._pos1 + n; int j = _p._pos2 - n; ModeleBase mbLeft = mbl.get(i); mbLeft.setCoords(new Point2D.Double(startLeft.x+n*vx*interval, startLeft.y+n*vy*interval)); ModeleBase mbRight = mbl.get(j); mbRight.setCoords(new Point2D.Double(startRight.x+n*vx*interval, startRight.y+n*vy*interval)); } } for (int i=0;i<_children.size();i++) { _children.get(i).reflectCoordinates(); } if (_children.size()>0) { Point2D.Double center = _children.get(0)._support; for (int i=0;i<_p._r.getNumPortions();i++) { Portion p = _p._r.getPortion(i); if (p instanceof UnpairedPortion) { UnpairedPortion up = (UnpairedPortion) p; for (int j=0;j mbl, RNA r) { if ((_children.size()==0)&&(_p._r.getNumPortions()==1)) { Portion p = _p._r.getPortion(0); if (p instanceof UnpairedPortion) { UnpairedPortion up = (UnpairedPortion) p; double rad = determineRadius(1,up.getNumBases(),_r); int a = _p._pos1+_p._len-1; int b = _p._pos2-(_p._len-1); ModeleBase mbLeft = mbl.get(a); ModeleBase mbRight = mbl.get(b); Point2D.Double pl = mbLeft.getCoords(); Point2D.Double pr = mbRight.getCoords(); Point2D.Double pm = new Point2D.Double((pl.x+pr.x)/2.0,(pl.y+pr.y)/2.0); double vx = (pl.x-pr.x)/pl.distance(pr); double vy = (pl.y-pr.y)/pl.distance(pr); double vnx = -vy, vny = vx; Point2D.Double pc = new Point2D.Double(pm.x+rad*vnx,pm.y+rad*vny); double circ = r.LOOP_DISTANCE*(1.0+up.getNumBases())+r.BASE_PAIR_DISTANCE; double incrLoop = Math.PI*2.0*r.LOOP_DISTANCE/circ; double angle = Math.PI*2.0*r.BASE_PAIR_DISTANCE/(2.0*circ); for (int j=0;j all) throws Exception { double x=x0; double y=y0; int numHelices = 0; int numUBases = 0; double totCirc = r.BASE_PAIR_DISTANCE+r.LOOP_DISTANCE; for (int i=0;i all = new ArrayList(); HelixEmbedding root = null; try { root = new HelixEmbedding(new Point2D.Double(0.0,0.0),new PairedPortion(0,0,0,t),r,null); predrawTree(0,0,t,0.0,r,root,all); int steps=1000; double prevbadness = 1000000000; while((steps>0)&&(prevbadness>0)) { // Generating new structure HelixEmbedding chosen = all.get(_rnd.nextInt(all.size())); int delta = chosen.chooseNextMove(); // Draw current if (_vp!=null) { GeneralPath p = new GeneralPath(); for (int i=0;i0) { chosen.cancelMove(delta); } else { prevbadness = badness; } System.out.println(badness); steps--; } if (root!=null) { root.reflectCoordinates(); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return t; }; }PK �����3F>Yָ����.���fr/orsay/lri/varna/models/rna/VARNAPoint.class���1�J��(fr/orsay/lri/varna/models/rna/VARNAPoint��java/lang/Object��java/io/Serializable�serialVersionUID�J� ConstantValuezVNZ0�x�D�y��()V�Code �� ���(DD)V�LineNumberTable�LocalVariableTable�this�*Lfr/orsay/lri/varna/models/rna/VARNAPoint; �� �� �� � � �� �� �px�py�!(Ljava/awt/geom/Point2D$Double;)V �#��$�java/awt/geom/Point2D$Double �#��p�Ljava/awt/geom/Point2D$Double;�getX�()D�getY� toPoint2D� ()Ljava/awt/geom/Point2D$Double; �#��toString�()Ljava/lang/String;�1�java/lang/StringBuilder�3�( �0�5 ��6�(Ljava/lang/String;)V �0�8 �9�:�append�(D)Ljava/lang/StringBuilder;�<�, �0�> �9�?�-(Ljava/lang/String;)Ljava/lang/StringBuilder;�A�) �0�C �.�/� SourceFile�VARNAPoint.java� InnerClasses�H�java/awt/geom/Point2D�Double�!���������� ���� �� � ����� �����������1�����*���������������� ����������������g�����*�*�*�*'�*)�������������� � � �������� ������������� ����� � ����!�����E����� *+�"+�%�������� ����� ��������� ������� �&�'���(�)�����/�����*���������������� ����������*�)�����/�����*���������������� ����������+�,�����:������#Y*�*��-�����������$���� ����������.�/�����O�����%�0Y2�4*��7;�=*��7@�=�B�����������)���� ����%������D����E�F��� ��#�G�I� PK �����nq{lT����=���fr/orsay/lri/varna/models/rna/RNA$DrawRNATemplateMethod.class���1�"��7fr/orsay/lri/varna/models/rna/RNA$DrawRNATemplateMethod��java/lang/Object�NOADJUST�I�MAXSCALINGFACTOR� NOINTERSECT�HELIXTRANSLATE��()V�Code �� �� �� �� �� �� �� � ��LineNumberTable�LocalVariableTable� �� �� �this�9Lfr/orsay/lri/varna/models/rna/RNA$DrawRNATemplateMethod;� SourceFile�RNA.java� InnerClasses� �!fr/orsay/lri/varna/models/rna/RNA�DrawRNATemplateMethod�!������ ����� ����� ����� � ������ � �� ���A������� �������������:�;�<� =�9��������� �� ���/�����*�����������9���� ������������������ ����!� PK �����c>d��'���fr/orsay/lri/varna/models/rna/RNA.class���1 ��!fr/orsay/lri/varna/models/rna/RNA��6fr/orsay/lri/varna/interfaces/InterfaceVARNAObservable��java/io/Serializable�serialVersionUID�J� ConstantValueh)˖W�FILE_TYPE_BPSEQ�I���� FILE_TYPE_CT���� FILE_TYPE_DBN����FILE_TYPE_RNAML����FILE_TYPE_UNKNOWN����DRAW_MODE_CIRCULAR�DRAW_MODE_RADIATE�DRAW_MODE_NAVIEW�DRAW_MODE_LINEAR�DRAW_MODE_VARNA_VIEW�DRAW_MODE_MOTIFVIEW����DRAW_MODE_TEMPLATE����DEFAULT_DRAW_MODE�_spaceBetweenBases�Ljava/lang/Double;� _drawMode� BASE_RADIUS� LOOP_DISTANCE�D@D�������BASE_PAIR_DISTANCE@P@������MULTILOOP_DISTANCE@A������VIRTUAL_LOOP_RADIUS�CHEM_PROB_DIST�CHEM_PROB_BASE_LENGTH�CHEM_PROB_ARROW_HEIGHT�CHEM_PROB_ARROW_WIDTH�CHEM_PROB_TRIANGLE_WIDTH�CHEM_PROB_PIN_SEMIDIAG�CHEM_PROB_DOT_RADIUS� _debugShape�Ljava/awt/geom/GeneralPath;�_drawn�Z�_bpHeightIncrement� _listeBases�Ljava/util/ArrayList;� Signature�ALjava/util/ArrayList;� _listStrands�-Lfr/orsay/lri/varna/models/rna/StructureTemp;� _structureAux�DLjava/util/ArrayList;�_listeVARNAListener�MLjava/util/ArrayList;� _normalBases�)Ljava/util/ArrayList;�_listeAnnotations�MLjava/util/ArrayList;�_listeRegionHighlights�XLjava/util/ArrayList;�_name�Ljava/lang/String;�CHEM_PROB_ARROW_THICKNESS�_strandEndsAnnotated�_ChemProbAnnotations�QLjava/util/ArrayList;�>$SWITCH_TABLE$fr$orsay$lri$varna$models$rna$ModeleStyleBP$Edge�[I�]$SWITCH_TABLE$fr$orsay$lri$varna$models$annotations$ChemProbAnnotation$ChemProbAnnotationType�R$SWITCH_TABLE$fr$orsay$lri$varna$models$templates$RNATemplate$EdgeEndPointPosition��()V�Code�Z�java/util/ArrayList �Y�\ �]�W� ��_ �F�=@������� ��c �N�&�LineNumberTable�LocalVariableTable�g�� ��i �]�j�(Ljava/lang/String;)V�this�#Lfr/orsay/lri/varna/models/rna/RNA; ��\ �o�q�p�java/lang/Double �r�s�valueOf�(D)Ljava/lang/Double; ��u �!�" ��w �#� ��y �$� @,������ ��} �0�&@>������ �� �1�&@$������ �� �2�&@������ �� �3�&@������ �� �4�&@������ �� �5�& �� �6�& �� �7�8 �� �9�:? �� �;�&��+fr/orsay/lri/varna/models/rna/StructureTemp ��\ �� �@�A �� �B�= �� �D�=��a �Y� ���add�(Ljava/lang/Object;)Z��c��g��u��t �� �H�= �� �J�= �� �L�M �� �O�: �� �P�= �� �<�= �� ��W�init�n�toString�()Ljava/lang/String; ����java/lang/String ���equals �� ��� getStructDBN�&(Lfr/orsay/lri/varna/models/rna/RNA;)V �Y� ���addAll�(Ljava/util/Collection;)Z�r� saveRNADBN�'(Ljava/lang/String;Ljava/lang/String;)V� Exceptions��7fr/orsay/lri/varna/exceptions/ExceptionWritingForbidden��java/io/FileWriter ��i��java/lang/StringBuilder��> ��i �� ���append�-(Ljava/lang/String;)Ljava/lang/StringBuilder;�� �� �� �� ��j�write �� ���getListeBasesToString �� ���(I)V �Y� ���get�(I)Ljava/lang/Object;��(fr/orsay/lri/varna/models/rna/ModeleBase �� ���getElementStructure�()I �� �r��&(Ljava/lang/Object;)Ljava/lang/String; �� ���(C)Ljava/lang/StringBuilder; �Y ��size � �W�close   �java/io/IOException  �� getMessage ��i�path�title�out�Ljava/io/FileWriter;�str�i�e�Ljava/io/IOException;�getBaseInnerColor�:(ILfr/orsay/lri/varna/models/VARNAConfig;)Ljava/awt/Color; � � getStyleBase�1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase; �-fr/orsay/lri/varna/models/rna/ModeleStyleBase  �get_base_inner_color�()Ljava/awt/Color; �" #�� getContent %'&�%fr/orsay/lri/varna/models/VARNAConfig (�:� _drawColorMap %* +,�_cm�.Lfr/orsay/lri/varna/models/rna/ModeleColorMap; �. /0�getValue�()D 243�,fr/orsay/lri/varna/models/rna/ModeleColorMap 56�getColorForValue�(D)Ljava/awt/Color; %8 9�:�_colorDashBases;�- �= >?�contains�(Ljava/lang/CharSequence;)Z %A BC�_dashBasesColor�Ljava/awt/Color; %E F�:�_colorSpecialBases �H I�� toLowerCase �YK >� %M NC�_specialBasesColor�conf�'Lfr/orsay/lri/varna/models/VARNAConfig;�result�res�getBaseOuterColor U V �get_base_outline_color�getBaseNameColor Y Z �get_base_name_color�getBasePairColor�f(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/models/VARNAConfig;)Ljava/awt/Color; %^ _C� _bondColor %a b�:�_useBaseColorsForBPs dfe�+fr/orsay/lri/varna/models/rna/ModeleStyleBP gh� getPartner5�,()Lfr/orsay/lri/varna/models/rna/ModeleBase; �j k��getIndex dm no�getColor�"(Ljava/awt/Color;)Ljava/awt/Color;�bp�-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;� bondColor�getBasePairThickness�W(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/models/VARNAConfig;)D %v w�&� _bpThickness dy z{� getThickness�(D)D� thickness� drawSymbol�t(Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;DDDDDZLfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;D)V �6fr/orsay/lri/varna/models/export/SecStrDrawingProducer  �getCurrentColor � �R�()[I �0fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge ��ordinal  � fillCircle�(DDDDLjava/awt/Color;)V  � drawCircle�(DDDD)V �java/awt/Color C�white  � fillPolygon�([D[DLjava/awt/Color;)V  � drawPolygon�([D[DD)V�8Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;�posx�posy�normx�normy�radius�isCIS�2Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;�bck�xtab�[D�ytab�ix�iy�jx�jy� drawBasePair�(Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/models/VARNAConfig;)V �java/awt/geom/Point2D$Double �&�x  �&�y �java/lang/Math {�sqrt  �]�(DD)V % � _mainBPStyle�0Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; �.fr/orsay/lri/varna/models/VARNAConfig$BP_STYLE � BP_STYLE_LW � st d � isCanonical�()Z d � isCanonicalGC@������  �drawLine�(DDDDD)V d � isWobbleUG d  d �getEdgePartner5�4()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; � }~ d �getEdgePartner3  �BP_STYLE_RNAVIZ@������  �BP_STYLE_SIMPLE�orig�Ljava/awt/geom/Point2D$Double;�dest�style�dx�dy�dist�nx�ny� radiusCircle�cx�cy�p1�p2�vdx�vdy�xcenter�ycenter� drawColorMap�b(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;)V 2 0� getMinValue 2  0� getMaxValue   �getBoundingBox�$()Ljava/awt/geom/Rectangle2D$Double; � java/awt/geom/Rectangle2D$Double 0�getMaxX % �&�_colorMapWidth % �&�_colorMapXOffset  0�getMinY % �&�_colorMapHeight %! "� �DEFAULT_COLOR_MAP_FONT_SIZE %$ %� �DEFAULT_COLOR_MAP_STRIPE_WIDTH ' (� fillRectangle %* +C�DEFAULT_COLOR_MAP_OUTLINE - ./�setColor�(Ljava/awt/Color;)V 1 2� drawRectangle %4 5C�DEFAULT_COLOR_MAP_FONT_COLOR 7 8��getCurrentFont?������ < =>�setFont�(ID)V?333333 ��\ �C �D�(D)Ljava/lang/StringBuilder; F GH�drawText�(DDLjava/lang/String;)V %J K�M�_colorMapCaption�_conf�v1�v2� xSpaceAvail� ySpaceAvail� currentBBox�"Ljava/awt/geom/Rectangle2D$Double;�xBase�yBase�ratio�val�renderRegionHighlights�y(Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;)V �YZ [\�iterator�()Ljava/util/Iterator; ^`_�java/util/Iterator ab�next�()Ljava/lang/Object;d�?fr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation cf gh�getShape�\([Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;D)Ljava/awt/geom/GeneralPath; cj k � getFillColor m n�.(Ljava/awt/geom/GeneralPath;Ljava/awt/Color;)V cp q �getOutlineColor s t�(Ljava/awt/geom/GeneralPath;D)V ^v w�hasNext� realCoords�[Ljava/awt/geom/Point2D$Double;� realCenters�ALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;�s�saveRNA�u(Ljava/lang/String;Lfr/orsay/lri/varna/models/VARNAConfig;DLfr/orsay/lri/varna/models/export/SecStrDrawingProducer;)V  �setScale�(D)V������� � � getCoords� ()Ljava/awt/geom/Point2D$Double;  0�getX  �min�(DD)D  0�getY  �max � � getCenter�!(I)Ljava/awt/geom/Point2D$Double; � �� get_drawMode � �get_listeBases�()Ljava/util/ArrayList; �   �distance�(Ljava/awt/geom/Point2D;)D % �:�_drawBackground % C�_backgroundColor  /�setBackgroundColor � WX % C�_backboneColor �\ � � getBaseNumber�(I)I � �� getDrawMode � �testDirectionality�(III)Z@v�����  �atan2@!TD-  �drawArc�%(Ljava/awt/geom/Point2D$Double;DDDD)V � � getStyleBP�/()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; % �:�_drawnNonCanonicalBP � [\ �   �round�(D)J@f����� % �:�_drawnNonPlanarBP d h� getPartner3 % �:�_comparisonMode �  � S � W�3fr/orsay/lri/varna/models/rna/ModeleBasesComparison  ��getBases % �:� _fillBase % �:�_drawOutlineBase � � % � � _numPeriod � �� isNumberDrawn�.(Lfr/orsay/lri/varna/models/rna/ModeleBase;I)Z   �get_base_number_color % �&� _distNumbers � � �(I)Ljava/lang/StringBuilder; �  �renderAnnotations�d(Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;DDLfr/orsay/lri/varna/models/VARNAConfig;)V �  % � _titleFont�Ljava/awt/Font; � java/awt/Font ��getSize % C� _titleColor  �  ��getName %" #�M�_title%�java/io/OutputStreamWriter'�java/io/FileOutputStream &�i*�UTF-8 $, �]-�+(Ljava/io/OutputStream;Ljava/lang/String;)V / 0��export $� $�scale� EPSMargin�minX�maxX�minY�maxY�x0�y0�x1�y1�xc�yc�xp�yp�norm�coords�centers� centerBck�b1�*Lfr/orsay/lri/varna/models/rna/ModeleBase;�b2�j1�j2�a1�a2�c1�c2�vn� discontinuous�b� consecutive�dir� centerSeg� centerDist� centerLoop�angle�bpcol�j�coef� baseFontSize�mb� numFontSize�basenum� titleFontSize�yTitle�fout�Ljava/io/OutputStreamWriter;�buildCaptionPosition�r(Lfr/orsay/lri/varna/models/rna/ModeleBase;DLfr/orsay/lri/varna/models/VARNAConfig;)Ljava/awt/geom/Point2D$Double;�heightEstimate�center�p� realDistance�getBPHeightIncrement�setBPHeightIncrement�d�drawChemProbAnnotation�(Lfr/orsay/lri/varna/models/export/SecStrDrawingProducer;Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;Ljava/awt/geom/Point2D$Double;DD)V npo�8fr/orsay/lri/varna/models/annotations/ChemProbAnnotation n nr s� getDirVector nu v�getNormalVector nx y0� getIntensity �{ �T n} ~�getType�S()Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; �Ofr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType�java/awt/geom/GeneralPath �\  �moveTo�(FF)V  �lineTo  �W� closePath �o 0� doubleValue�cpa�:Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;�anchor�v�base�edge� arrowTip1� arrowTip2�side1�side2�side3�side4 � �getAnnotations�4fr/orsay/lri/varna/models/annotations/TextAnnotation p  �getFont�()Ljava/awt/Font;  �getCenterPosition  ~�  b� getAncrage  {�ceil � bc  ��getTexte � �getChemProbAnnotations n �getAnchorPosition � kl�textAnnotation�6Lfr/orsay/lri/varna/models/annotations/TextAnnotation;�position� fontHeight� numPeriod� saveRNAEPS�<(Ljava/lang/String;Lfr/orsay/lri/varna/models/VARNAConfig;)V�)fr/orsay/lri/varna/models/export/PSExport �\?ٙ � }~�+Lfr/orsay/lri/varna/models/export/PSExport;� saveRNAXFIG�+fr/orsay/lri/varna/models/export/XFIGExport �\@4�������-Lfr/orsay/lri/varna/models/export/XFIGExport;� saveRNASVG�*fr/orsay/lri/varna/models/export/SVGExport �\?�������,Lfr/orsay/lri/varna/models/export/SVGExport;�getBBox  �]   �&�width  �&�height�minx�maxx�miny�maxy� realHeight�setCoord�"(ILjava/awt/geom/Point2D$Double;)V � �(IDD)V�index � � setCoords�!(Ljava/awt/geom/Point2D$Double;)V�getBaseContent�(I)Ljava/lang/String;� setCenter �  � � drawRNACircle@ !TD-?!TD-  {�cos   {�sin�drawRNAVARNAView �*fr/orsay/lri/varna/models/rna/VARNASecDraw  �\   �drawRNA�Z(DLfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree;�vs�,Lfr/orsay/lri/varna/models/rna/VARNASecDraw;� drawRNALine$�������computeHelixEndPointDirections�(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)V �Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint � getElement�F()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;!�@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix  # $�getStartPosition  & '�getEndPosition �) �U + ,-� getPosition�H()Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; /0�Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition 2 3�hypot  5 6� isFlipped� helixEndPoint�QLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;�helix�BLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;�startpos�endpos� helixVector�helixVectorLength� computeBezierTangentVectorTargetA�Hfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException C D�getOtherElementF�Kfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence EH IJ�getIn�S()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; L MJ�getOtherEndPoint EO PJ�getOutR�&Sequence is not connected to an helix. @�i EU V0�getInTangentVectorLength EX Y0�getOutTangentVectorLength E[ \0�getInTangentVectorAngle E^ _0�getOutTangentVectorAngle�endPoint� curveEndPoint�curveVectorOtherPoint�sequenceEndPointIsIn�sequence�MLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;�endPointPositionOnHelix�FLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;�endPointOnHelix�l�theta�angleFromVector�!(Ljava/awt/geom/Point2D$Double;)D n o{�acos �q kl�computeLengthIncreaseFactor�G([ILfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;)D  u vw�getIn1Is�9()Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is; y{z�5fr/orsay/lri/varna/models/templates/RNATemplate$In1Is |}� IN1_IS_5PRIME�7Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is;�basesInHelixArray�i_original_norm�computeLengthIncreaseDelta�d([ILfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;)Ljava/awt/geom/Point2D$Double;�originalVector�originalLength� actualLength� actualVector�drawHelixLikeTemplateHelix�([ILfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;DLjava/util/Map;)V�([ILfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;DLjava/util/Map;)V � java/util/Map �� containsKey  ��&(Ljava/lang/Object;)Ljava/lang/Object; � �drawLoop�F(IIDDD[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;)V � � symmetric�^(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;)V�scaleHelixOrigin�translateVectors�Ljava/util/Map;�j_original_norm�o�k�b1pos�b2pos� loopCenter�from�to�points1�points2�LocalVariableTypeTable�qLjava/util/Map;�drawOnBezierCurve�([ILjava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;)V�*fr/orsay/lri/varna/models/CubicBezierCurve  �]�|(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;I)V  0�getApproxCurveLength  � uniformParam�#([D)[Ljava/awt/geom/Point2D$Double;�basesInSequence�P0�P1�P2�P3�bezier�,Lfr/orsay/lri/varna/models/CubicBezierCurve;� curveLength�delta_t�sequenceBasesCoords�drawOnStraightLine�([ILjava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;)V�drawAlongCurve�(IILjava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;[Ljava/awt/geom/Point2D$Double;)V �java/lang/Integer �r�(I)Ljava/lang/Integer; �4fr/orsay/lri/varna/models/templates/RNATemplateAlign �intArrayFromList�(Ljava/util/List;)[I �  �  � k� firstBase�lastBase�alongBezierCurve�depth�alongBezierCurveArray�alpha�*Ljava/util/ArrayList;�points�lv�A�B�computeHelixTranslations�(Lfr/orsay/lri/varna/models/treealign/Tree;Ljava/util/Map;Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;Ljava/awt/geom/Point2D$Double;)V0(Lfr/orsay/lri/varna/models/treealign/Tree;Ljava/util/Map;Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;Ljava/awt/geom/Point2D$Double;)V �(fr/orsay/lri/varna/models/treealign/Tree /b�8fr/orsay/lri/varna/models/templates/RNANodeValueTemplate�@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair  �getHelix�D()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;  �put�8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; �6fr/orsay/lri/varna/models/templates/RNATemplateMapping � getAncestor�[(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Ljava/util/ArrayList; �   � getChildren�()Ljava/util/List; �Z�java/util/List � �tree�*Lfr/orsay/lri/varna/models/treealign/Tree;�mapping�8Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;�parentDeltaVector�nvt�:Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplate;�newDeltaVector�helixDeltaVector�subtree�fLfr/orsay/lri/varna/models/treealign/Tree;�s(Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;)Ljava/util/Map;(Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;)Ljava/util/Map;�java/util/HashMap �\�drawRNATemplate�k(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/templates/RNATemplateMapping; �7fr/orsay/lri/varna/models/rna/RNA$DrawRNATemplateMethod � �NOADJUST � �l(Lfr/orsay/lri/varna/models/templates/RNATemplate;I)Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;�template�1Lfr/orsay/lri/varna/models/templates/RNATemplate; ! "#�mapRNAWithTemplate�(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/templates/RNATemplateMapping; %'&�java/lang/System (�Ljava/io/PrintStream; * +,� showCompact�7(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/lang/String; .0/�java/io/PrintStream 1�j�println 3 4� �MAXSCALINGFACTOR������ 8:9�/fr/orsay/lri/varna/models/templates/RNATemplate ;\� rnaIterator=�Bfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement �? rsA�#Max helix length increase factor = C� reached with helix �E �F�-(Ljava/lang/Object;)Ljava/lang/StringBuilder; H I� �HELIXTRANSLATE 8K LM�toTree�,()Lfr/orsay/lri/varna/models/treealign/Tree; �O Q�ExceptionInvalidRNATemplate: S T�9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplateV�java/util/HashSet U�\ Y[Z�java/util/Arrays \]�sort�([I)V _K`� java/util/Set �b  _�  e fJ�getIn1  h iJ�getIn2 �k  m no� setLocation�(Ljava/awt/geom/Point2D;)V �q ? �s  u vw� getPartner�G(I)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; 8y z�getFirst E| }� getVertex5  J�getNextEndPoint E � getVertex3@@�����  n  � � NOINTERSECT�java/awt/geom/Line2D$Double  �]�1(Ljava/awt/geom/Point2D;Ljava/awt/geom/Point2D;)V  �intersectsLine�(Ljava/awt/geom/Line2D;)Z?�"globalIncreaseFactor increased to �globalIncreaseFactor = �helixLengthAdjustmentMethod�iter�Ljava/util/Iterator;�globalIncreaseFactor�lengthIncreaseFactor�maxLengthIncreaseFactor�maxIncreaseHelix�element�DLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;�templateAsTree�;Lfr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate;� computeCoords�alreadyDrawnHelixes�Ljava/util/Set;�lastMappedHelix�howWeGotOutOfLastHelix�howWeGotOutOfLastHelixBaseIndex�firstTimeWeMeetThisHelix�howWeGetInCurrentHelix�templateSequence�templateSequenceCandidate�beginTemplateSequence�endTemplateSequence�lines�[Ljava/awt/geom/Line2D$Double;�intersectLines�ZLjava/util/Iterator;�eLjava/util/Map;�SLjava/util/Set;�objFun�(IIDDD)D  {�asin�n1�n2�bpdist� multidist�determineRadius�(IID)D � �nbHel� nbUnpaired� startRadius@È�����@�����>h �   {�abs�xmin�xmax�ymin�ymax�numIt� precision�*(Lfr/orsay/lri/varna/models/VARNAConfig;)V�6fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm � �+(ILfr/orsay/lri/varna/models/VARNAConfig;)V � �drawRNARadiate � �W � ��W � �W� drawRNANAView �  �W � �W� drawMOTIFView�mode�java/util/Vector �\  �]� � �������!TD-  �pow@@@����� � � ��intValue�dirAngle� normalAngle�basesMultiLoop�Ljava/util/Vector;�helices�mlSize� numHelices� totalLength�multiLoopRadius�angleIncrementML�angleIncrementBP�mlCenter� baseAngle�angles�newAngle�m�'Ljava/util/Vector;������ % �:�_flatExteriorLoop � �(DZ)VCZ0�flatExteriorLoop�vx�vy �Y �" �r $&%�java/lang/Short �r'�%(Ljava/lang/String;)Ljava/lang/Short;)�'fr/orsay/lri/varna/models/naView/NAView (�\ (, -.�naview_xy_coordinates�B(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)I �0 12� getLoopBases�(I)Ljava/util/Vector; 4 5�� elementAt�X�Y� pair_table�naView�)Lfr/orsay/lri/varna/models/naView/NAView;� indicePartner�partner�loop�tmpx�tmpy� loopmember�)Ljava/util/ArrayList;�(Ljava/util/ArrayList;D�#fr/orsay/lri/varna/models/rna/Motif CF �]G�;(Lfr/orsay/lri/varna/models/rna/RNA;Ljava/util/ArrayList;)V CI J�W� listStrand CL MN� getListStrand�/()Lfr/orsay/lri/varna/models/rna/StructureTemp; �P QR� getStrand�/(I)Lfr/orsay/lri/varna/models/rna/ModeleStrand; TVU�*fr/orsay/lri/varna/models/rna/ModeleStrand WX�getMB�-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; TZ [�� sizeStrand �] ^�� sizeStruct C` a��getCentralStrand Cc d>�positionneSpecificStrand Cf g�� orderStrands Ci j�W�positionneStrand Cl m�W� ajusteStrand Co p�W� reajustement Cr s�W�deviationBasePair Cu v�W�setCenterMotif�spaceBetweenStrand�motif�%Lfr/orsay/lri/varna/models/rna/Motif;�indice� centralStrand�getAllPartners�(I)Ljava/util/ArrayList;�D(I)Ljava/util/ArrayList; � X� getBaseAt � }� getAuxBPs d v�V(Lfr/orsay/lri/varna/models/rna/ModeleBase;)Lfr/orsay/lri/varna/models/rna/ModeleBase;�me�msbps� setDrawMode�drawMode�setRNA�9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax�Bfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses � �explodeSequence�)(Ljava/lang/String;)Ljava/util/ArrayList; � �%(Ljava/util/List;Ljava/lang/String;)V�seq�([Ljava/lang/String;[I)V � �([Ljava/lang/String;[II)V�[Ljava/lang/String;�(Ljava/util/List;[I)V�)(Ljava/util/List;[I)V � � �toArray�(([Ljava/lang/Object;)[Ljava/lang/Object;�Ljava/util/List;�$Ljava/util/List;�(Ljava/util/List;[II)V�*(Ljava/util/List;[II)V� baseIndex � �W�clearAnnotations�Sequence length �* differs from that of secondary structure �. Adapting sequence length ... � �j�warningEmition�2fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide  �]�(Ljava/lang/String;II)V � ]� applyStruct�nseq�seqTmp�<(Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;)V�Q(Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;)V � � parseStruct�(Ljava/lang/String;)[I � ��length � �charAt�(I)C  �]�(CCI)V  ��set_appartenance  �� setBaseNumber � �addBP�(II)V�struct�basesOwn� array_struct�mbc�5Lfr/orsay/lri/varna/models/rna/ModeleBasesComparison;�9(Ljava/util/List;Ljava/lang/String;)V � �replace�(CC)Ljava/lang/String; � �dbnStr�parDBN�braDBN�accDBN�parStr�braStr�accStr�finStr�=(Ljava/lang/String;)Ljava/util/ArrayList;� analyzedSeq�found�buf�java/util/Stack �\  �push    b�pop�unexpectedChar�Ljava/util/Stack;�C�&Ljava/util/Stack;�getHelixInterval�(I)Ljava/awt/Point;�java/awt/Point  �]�minH�maxH�over�-(I)Ljava/util/ArrayList; �   �  � �Ljava/awt/Point;� getMultiLoop�h�*(I)Ljava/util/Vector;� startIndex�.�)�(�([I)Ljava/lang/String;�getSeq�getStructBPSEQ �! "�getNonOverlappingStruct$� "�getNonCrossingStruct �( &�msbp�mb5�mb3�j5�j3� getStructCT� saveAsBPSEQ1�3fr/orsay/lri/varna/exceptions/ExceptionExportFailed3�7fr/orsay/lri/varna/exceptions/ExceptionPermissionDenied5�# �7 � 09 �]��f�saveAsCT �= .�� saveAsDBN ��\�loadSecStrBPSEQ�(Ljava/io/Reader;)ZC�4fr/orsay/lri/varna/exceptions/ExceptionLoadingFailedE�java/io/BufferedReader DG �]H�(Ljava/io/Reader;)V DJ K��readLineM�java/util/Hashtable L�\P� Filename:R� Organism:T�Accession Number: �V W��trimY�\s+ �[ \]�split�'(Ljava/lang/String;)[Ljava/lang/String;_�# �a bc� startsWith�(Ljava/lang/String;)Ze�Citation g hi�parseInt�(Ljava/lang/String;)Ik�+Discontinuity detected between nucleotides m� and o�G! Filling in missing portions with unpaired unknown 'X' nucleotides ...6 L L L �u vi�indexOf �x y� substring{�/ L �~  L �keySet�()Ljava/util/Set; _Z Z d �]�W(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V � �applyBPs�(Ljava/util/ArrayList;)V � �j�setName �java/lang/NumberFormatException �W�printStackTrace   �java/lang/Exception B9�Ljava/io/Reader;�loadOk�fr�Ljava/io/BufferedReader;�line�strTmp�Ljava/util/Hashtable;�bpFrom�bpTo�minIndex� noWarningYet� filenameStr� organismStr�ANStr�tokens�occur�tmp�allbps�part�newStyle�!Ljava/lang/NumberFormatException;�Ljava/lang/Exception;�QLjava/util/Hashtable;>;� loadSecStrCT� ENERGY = �dG = �(E=� kcal/mol)  9�ntokens�energy�G(Ljava/util/ArrayList;)V � �)fr/orsay/lri/varna/models/rna/RNAMLParser � planarize�C(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;I)V � �2(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V � �addBPAux�planar�others�loadSecStrRNAML�"javax.xml.parsers.SAXParserFactory�;� loadSecStrDBN�> � �� loadSecStr � �(Ljava/io/Reader;I)V �! A �# A �% @A �' A�B@ D* +��mark D- .�W�reset B �i�fileType�ok�e2�6Lfr/orsay/lri/varna/exceptions/ExceptionLoadingFailed;�guessFileTypeFromExtension7�ml �9 :c�endsWith<�dbn>�faa@�ctB�bpseqD�java/io/FileNotFoundExceptionF�java/io/FileReader E�i �I 5i E L M�j�setPath�Ljava/io/FileReader;�type�;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;�set_listeBases�D(Ljava/util/ArrayList;)V�_liste�addVARNAListener�9(Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;)V�rl�6Lfr/orsay/lri/varna/interfaces/InterfaceVARNAListener;Y�4fr/orsay/lri/varna/interfaces/InterfaceVARNAListener X[ \�j�onWarningEmitted�warningMessage�applyStyleOnBases�G(Ljava/util/ArrayList;Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)V�\(Ljava/util/ArrayList;Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)V �b cd� setStyleBase�2(Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)V� basesList�/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;�correctReciprocity�([I)[I �j gh l h �Yn o�W�clear �q r��setElementStructure �t � planarSubset� initStruct�C()Ljava/util/ArrayList;�findAll�,()Ljava/util/ArrayList;�listAll� findBulge�listUp�findStem�getHelixCountOnLoop� cptHelice� justJumped�findLoop � }�findLoopForward  �(II)I�findPair  �findLoopBackward� findHelix�list�prec� find3Prime� find5Prime�get_spaceBetweenBases�()Ljava/lang/Double;�set_spaceBetweenBases�(Ljava/lang/Double;)V� betweenBases�n(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)Ljava/lang/Double;�p3�beta�findNonPairedBaseGroup�*(Ljava/lang/Integer;)Ljava/util/ArrayList;�?(Ljava/lang/Integer;)Ljava/util/ArrayList;�get_nearestBase�Ljava/lang/Integer;� nonpairedUp� nonpairedDown�getDrawn�getStructureAux�F()Ljava/util/ArrayList;�getIndexFromBaseNumber�num�addBPToStructureUsingNumbers �  � �addBPToStructure� baseNumber5� baseNumber3 � �number5�number3�index5�index3�part5�part3�removeBP�0(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V �Y ��remove � � setStyleBP�ms�m5�m3 d � setPartner5�-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)V d � setPartner3 � r�1(ILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V� getBPStyle�1(II)Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;� getSecStrBPs �  � �G(I)Ljava/util/ArrayList;�setBaseInnerColor  /�set_base_inner_color�setBaseNumbersColor  /�set_base_number_color�setBaseNameColor  /�set_base_name_color�setBaseOutlineColor  /�set_base_outline_color�O()Ljava/util/ArrayList;�removeAnnotation�9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)Z� addAnnotation�9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)V�filter�condamne�autoAnnotateStrandEnds�5'  �]�?(Ljava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V � �3' � �j�tailleListBases� endAnnotate�realposA�realposB�autoAnnotateHelices�H  �]�+(Ljava/lang/String;Ljava/util/ArrayList;I)V  � �empty�nbH�mbp�autoAnnotateTerminalLoops �T�nbT�autoAnnotateInteriorLoops� �terminal� getAnnotation�c(ILfr/orsay/lri/varna/models/rna/ModeleBase;)Lfr/orsay/lri/varna/models/annotations/TextAnnotation;�mbl�addChemProbAnnotation�=(Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;)V�S()Ljava/util/ArrayList;�setColorMapValues�D([Ljava/lang/Double;Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V �   �E([Ljava/lang/Double;Lfr/orsay/lri/varna/models/rna/ModeleColorMap;Z)V�values�[Ljava/lang/Double;�cm�adaptColorMapToValues�1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V 2  �rescale� readValues�A(Ljava/io/Reader;Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V !�java/io/StreamTokenizer G $ %�eolIsSignificant ' (�� nextToken * +�&�nval�st�Ljava/io/StreamTokenizer;�vals�curVals�tab�@Ljava/util/ArrayList;>; � 3 4�setValue � 6  �rescaleColorMap�getColorMapValues�()[Ljava/lang/Double;�value� setSequence � = ; >�(Ljava/util/List;)V�'(Ljava/util/List;)V ��  B C�j�set_c E G F�java/lang/Character �r H�(C)Ljava/lang/Character;  J K L� set_base1�(Ljava/lang/Character;)V  N O L� set_base2� eraseSequence�clone�%()Lfr/orsay/lri/varna/models/rna/RNA; T�java/io/ByteArrayOutputStream S�\ W�java/io/ObjectOutputStream V Y �] Z�(Ljava/io/OutputStream;)V V \ ] ^� writeObject�(Ljava/lang/Object;)V `�java/io/ObjectInputStream b�java/io/ByteArrayInputStream S d e f� toByteArray�()[B a h �] i�([B)V _ k �] l�(Ljava/io/InputStream;)V _ n ob� readObject q�java/lang/RuntimeException s�cannot clone class [ u w v�java/lang/Object x y�getClass�()Ljava/lang/Class; { |�java/lang/Class ~�] via serialization: � p�i�Ljava/io/ByteArrayOutputStream;�oout�Ljava/io/ObjectOutputStream;�in�Ljava/io/ObjectInputStream;� getBasesAt�-(Ljava/util/Collection;)Ljava/util/ArrayList;�o(Ljava/util/Collection<+Ljava/lang/Integer;>;)Ljava/util/ArrayList; Z �java/util/Collection�indices�Ljava/util/Collection;�mbs�,Ljava/util/Collection<+Ljava/lang/Integer;>;�getBasesBetween�(II)Ljava/util/ArrayList;�E(II)Ljava/util/ArrayList;�addHighlightRegion�D(Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)V�removeHighlightRegion�removeChemProbAnnotation�&(IILjava/awt/Color;Ljava/awt/Color;D)V � c �] �9(Ljava/util/ArrayList;Ljava/awt/Color;Ljava/awt/Color;D)V�fill�outline c �]�getHighlightRegion�Z()Ljava/util/ArrayList;�globalRotation� angleDegres�centre �  �  �](Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)Z�pi�pj�pk�test�getOrientation � �_coords�*Lfr/orsay/lri/varna/models/rna/VARNAPoint;  �(fr/orsay/lri/varna/models/rna/VARNAPoint � toPoint2D  �fr/orsay/lri/varna/views/VueUI � computeAngle�?(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)D�maxDist�hasVirtualLoops�consecutiveBPs �$java/lang/CloneNotSupportedException � Q R � �R�S   �5()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;  � HOOGSTEEN  �SUGAR  � WATSON_CRICK �java/lang/NoSuchFieldError � �T�S   �T()[Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;  � ARROW_TYPE�QLfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;  �DOT_TYPE  �PIN_TYPE  � TRIANGLE_TYPE � �U�S /  �I()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; / g�IN1 / g�IN2 / g�OUT1 / g�OUT2� SourceFile�RNA.java� InnerClasses�BP_STYLE�ChemProbAnnotationType�Edge�DrawRNATemplateMethod�BPTemp �2fr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree�RNATree�EdgeEndPointPosition�In1Is�RNATemplateElement� EdgeEndPoint�RNATemplateHelix�RNATemplateUnpairedSequence �java/awt/geom/Line2D�Double �java/awt/geom/Point2D �java/awt/geom/Rectangle2D�!�����-����� ���� �� � �� ������� �� ������� �� ������� �� ������� �� ������� �� ������� �� ������� �� ������� �� ������� �� ������� �� ������� �� ������ � �� ������!�"����#� ����$� ����%�&�� ����'��)�&�� ����*��,�&�� ����-��/�&�� ����'��0�&����1�&����2�&����3�&����4�&����5�&����6�&����7�8����9�:����;�&����<�=��>����?���@�A����B�=��>����C��D�=��>����E��F�=��>����G��H�=��>����I��J�=��>����K��L�M��� �N�&����O�:����P�=��>����Q �R�S�� �T�S�� �U�S�����V�W��X���9�������YY�[�^�`�b����d�������� J��s�e�������]�W��X���5�����*f�h����d��� �������e��� �����k�l����]�j��X�������*�m*�n�t*�v* �x*�z�|*�~�*��*��*��*��*��*�*�*��*�Y��*�YY�[�*�YY�[��^�W�^�W�^�W�^�W�^�W*�YY�[�*�YY�[�*f�*�*�YY�[�*+�*�YY�[�*�*�����d���� ������ ��������%��,��3��:��A��H��M��R��Y��d��o��z�����������������Q�����������e��������k�l�������M������X���H�����*�f�ř�*�ʰ*�����d�������� ����e��� �����k�l����]���X������*�m*�n�t*�v* �x*�z�|*�~�*��*��*��*��*��*�*�*��*�Y��*�YY�[�*�YY�[��^�W�^�W�^�W�^�W�^�W*�YY�[�*�YY�[�*f�*�*�YY�[�*+�t�t*+�v�v*�+��W*+��*+��*�����d����"������ ��������%��,��3��:��A��H��M��R��Y��d��o��z�����������������Q��������������e�������k�l������l����W��X���+����������d�������e��� �����k�l�������������X��������Y+�N,f�Ś�-�Yݷ�,����-*��- �f:6�u*������Y��.��:�F*������Y��(��:��Y��)��:*�-�- �-�N�Y- �������d���N���� ��+ �3 �9 �= �C�V�o��� �������e���H�����k�l����� �M�����M�� ���=��M��@�� ��� ����X��������x*���N*���!:,$�,)*���-1N�7,7�:<� ,@N�,D��^GJ�,LN-����d���.� ��!�"�!�#�"$�)&�B(�T)�\+�q,�v.�e���4����x�k�l�����x� ����xOP���fQC��"�VR�M��S��X���h�����*���TN-����d������2�3�2�4�e���*�����k�l������ ����OP���QC��W��X���`�����*���XN-����d��� ���8�9�e���*�����k�l������ ����OP���QC��[\��X��������0,]N,`�*�+ci��N+� +-lN-����d���"���=�>� ?�@�#?�$B�(C�.E�e���*����0�k�l�����0pq����0OP���+rC��st��X���W����� +,uxJ)����d��� ���I� J�e���*���� �k�l����� pq���� OP�� �|�&��}~��X��� ���+: .�������������V���V �+( �`o+( �`o+( �`o::( k�`og k�`ogR k�`og k�`ocR( k�`oc k�`ogR k�`oc k�`ocR( k�`oc k�`ocR k�`oc k�`ogR( k�`og k�`ocR k�`og k�`ogR �+�++� k�`o9 k�`o9 k�`o9 wk�`o9::(gcRgcR(ccRccR(gRgR �+�++����d����*��P�Q� Q�(S�-T�AV�PW�\X�_W�bZ�e\�j]�o^�_�`�a�b�cd!e;f@gMiWjbmeopp{qrstuvwxyz|}�e�������k�l��������&����&����&����&����&� ���:� ��� ��|�&��C��j���o��p��&�{��&��|�&��p�&��k��f����X������-,g9-,g9-,g-,gk-,g-,gkc9  o9 o9w9 9Y,*�xkc,*�xkcMY-*�xkg-*�xkgNòǦ*9�**�xg�o9Ιҙ�,-�,- *�xok9 *�xok9+, c,c- c-cu+, g,g- g-guקۚ�X-,c�`o9-,c�`o9+,,--u*+ ;+,,--uק::-,c�`o9-,c�`o9+,,--u�*+ �-,g9-,g9�o9�o9*+cc *+gg �Sò�>,-c�`o9,-c�`o9+uku+� WW����d���D��� ��)�<�B�I�P�U�Y�{��������"'*+9GLRZix#,2=HPXjsv�e�������k�l�������������q���OP�� �&���&��B�&� �U�&� �Y�&��|�&���&�i�F�&�x�7�&�������&���&�=�W�&�H�L��&��,�&���&����X��� ���S+)J+)99 9 9 , :+g+g9+g g96�J+go9))gkc9+)1:c66,#+&+,),,+#cg+ 0,3,,,6 9o;,+c ?oc�YA+)B�E,#c+c+c ?oc�YA+)B�E,#+c�`oc ?og+IE����d����!�������� �1�B�H�T�_�j�s�x����������,/@KOR�e������S�k�l����SLP���S��KM�&��BN�&��s�� ��x�� ��?O�&� �<P�&� �9|�&� � 3QR��1"S�&��BT�&��E�U� ��T�8U�&��_�-V�&��j�"�C��WX��X��������Q*�Y:�=]�c:,-e:+i,+il+o,+ru�����d���"������"�+�6�?�F�P�e���>����Q�k�l�����Q����Qxy����Qzy���.�{��"�$|�8��}~��������X��� �?�� )�'999 9 96&�*�&��*�xgg9 *�&��*�xggw9  *�&��*�xcc9 *�&��*�xccw9&&*�j*�:&*�:'6(*�(��g9*�(�� gw9&(YS*(:)*� * *�(����(*�d�(�*(d��:**(`��:+*�6,+�6-,��-���*:.+:/*:0+:1)*�(��0.g0.oc1/g1/oc)*�(��0.g0.oc1/g1/oc)g9) gw9'(YS((*�o,� ,*&',,6(&(d2:)&(2:*)9)9*9*9Y:+)*9,*(*(dd��6.*�(d���6/*�(���60/(�0(d��61,+g,o+g,o1**62(`&�*(d((`��62�"(d�*(d(d(��62Y)*c�`o)*c�`o:3�')k94Y342k+kc342k+kg:66�g66�c6�`66�g66�c�`6)972)6gk2)6gkko9926*gk26*gkko9;9� 9c99;� ;c9;;9g9=2;9gk�=2kc9=6�`7k�`7k9=ʧ�A*�x+kc*�x+kc*�x+kg*�x+kgׄ((*�K6(6*�(���(*�(��:))Κ� ,ҙ�*),:**,*�(���6+&(29&(29&+29&+29g9 g9"  k""kc9$ $o9 "$o9"*�v�*�v� *�v�%*YY),ק�P*�v�H+(d�*��`k9,� *�k9,gو9.Y..,kݶʄ((*�,ߙ06(*�(�d:)*),ն,)ci6*)i6+)Κ� ,ҙ�&*29&*29&+29&+29g9 g9"  k""kc9$ $o9 "$o9"*�v�*�v� *�v�%*YY),ק�P*�v�H+*d�*��`k9,� *�k9,gو9.Y..,kݶʄ((*�9*�xk9((;,�6*�o&*29&*29*�x**,**,,*�x**,,*�*�E***��6*�*�*��:+&*29&*29,�*�x**,,�**,,*�x**,,*�*��!E***�o9*�xk9**;6,*�,��6--� ,`6-**�,��,�*�,��,&,29&,29',29',29g9 g9"  k""kc9$ $o9 "$o9"9*�xk kg9*�xk"kg�*�xk kg�*�xk"kg,c*�xk kg,c*�xk"kg�YA-�E,,*�* , ,$� *, :,�`,k9-,,-;,-�`og9/*f�Ś� g�`o/*E�#,!f�Ś� g�`o/*E$Y&Y+()+:11.112�:2�Y2 � ��d����� � � �����%�9�B�G�[�e�j�~������!�"�#�$�% &(#)+*3,F-T.Z0j1z234789:<=<AFBQCa#pHwILOPQRSTUVWXYZ[\,^3_@`Mabcedoefghijk(lLmUnopqrstxy"z0{?xBPQWk|�&4:BKX`l{&-4<DLZhnv!0<BQTflz �    + 1 7 N e o y  �           0 3 B M T [ b p y      & ( ) * + -�e���d�� �k�l����  �M��� OP��� 3�&��� �� 4�&�� 5�&�� 6�&� � 7�&� � 8�&�9�&��9�&��9�&��b9�&��p9�&� o�9�&�:�&��:�&��:�&��X:�&��f:�&� y�:�&�;�&��;�&��;�&� �;�&�<�&��<�&��<�&� �<�&�F�=�&�Q�>�&��q?�&� Y@�&���&� ��&� ��&� ��&�"��&�" ��&�"�A�&�$&�A�&�$ �A�&�$�"�� �&� ?By�&� 3Cy�'�� �(#>D�)j�EF�*z�GF�+�H� �,�I� �-�J�.�K�/�L�0�~M�1� �(�)�*tN�+k�&�,QO�:�.>�� �/-P� �0,Q�:�1eR� �24S�3-T�&�4�U�6U��&�7�J�&�9�YK�&�;�4V�&�=TB� �(| q�)�WC�*�X� �+U�Y�&�,`�'Y�&�,l��&�.*� �( pq�)��� �*�P� �+�Y�&�,�'Y�&�,��&�.4Z�&�(�{� �*i�� �*z�w[F�+ \�&�* +� �, +]� �- b�QR�, p�^�&�- �y_�&�/ �`a�1 �`a�1 � �2��bc��X��B� � ����`9*+�cc9+:+:*�xk(c9 Yg cokcg cokc����d���R���1�2�3�4�$5�*6�67�?8�J9�T:�[9�\8�^:�c;�n<�x=�<�;�:�7�e���R�����k�l�����[F����d�&����OP����&��$�be��*�\f��6�Pg�&� �h0��X���/�����*�����d������B�e��� �����k�l���i��X���>�����*'�����d��� ���G�H�e��������k�l�����j�&��kl��X������3+,m,,q:,t: Y-*�|kc-*�|kc: Y *�,wkkc *�,wkkc: �b,wk9 z,|.���������������&��WY ,w*� k*�kckc ,w*� k*�kckc:Y ,w*�w k*�kckc ,w*�w k*�kckc:+ g g g g + g ggg + g ggg קY ,w*�kkg ,w*�kkg:Y ,w*� kkg ,w*� kkg:Y ,w*�kkc ,w*�kkc:Y ,w*� kkc ,w*� kkc:Y:gggggggg+,ml+ g g g g ק#Y ,w*� kkc ,w*� kkc:Y ,w*�w kkc ,w*�w kkc:Y: g ggggg+,ml�[*�,wk�n:Y kcg kcg:+ ,m����d����8��N�O�P�Q�;R�nS�xT�{T�X�Y�X�Z[/Z4\Z]^`cdcef eg(h=gBi[jpiuk~lmnopqrtw+x@wEy_zuyz{|}~2�e������3�k�l����3���3���3���35�&���37�&��%��N� �;� �n� �x|�&� ���4�r�3���B��u��~��8�E��z�]��T�8��J�"��e�� ��X���� ���*Y:�x]�:+,+�`k;: �'�: 9 *  : + (g gwEu�*Y:�"]�n:: *+ (u�ڱ����d���>�����!�4�;�D�N�\�h�������e���p� ����k�l���������5�&����7�&����OP���i��;�F� �N�[F� �\� �&� ����� � ����X���x�����*�+i�+p�+i*d�����d����������)�e��� ����*�k�l�����*[F����*� ����������X���c�����YN*+,-ͱ����d���������e���*�����k�l����� �M����OP��� ����������X���c�����YN*+,-ͱ����d���������e���*�����k�l����� �M����OP��� ����������X���c�����YN*+,-ͱ����d���������e���*�����k�l����� �M����OP��� ����X��� � �� Y����LI9996 �*� ��*�xg(I*� ��*�xg9*� ��*�xc9*� ��*�xc9  *�z+(++(g+g*�v�(*�+k�`o9 +Y c+Y g+����d����$������"�'�-�?�D�E�F�J�\�a�b�d�i�{������������������e���R��� �k�l����QR����&��"��&����&��'��&��*�� � ���&� ���X���P�����*,,����d��� ���� �e��� �����k�l������ ����f����X���t�����$*��*���Y(����d������� �#�e���*����$�k�l�����$� ����$�&����$�&����X���b�����&*���*���Y����d���������e�������&�k�l�����&� ����X���]�����!�*��*���!f����d���������e�������!�k�l�����!� ����X���\����� �*��*�������d���������e������� �k�l����� � ����X���^�����"*��*���Y����d������� ��e�������"�k�l�����"� ����X���\�����*Y(����d��� �����e���*�����k�l������ �����&�����&����X���a�����*��*���,����d������� � �e��� �����k�l������ ����f����W��X��.� ����*�*�v*�`h*�xho<6�q`t�`kk*�`ogwI*���Y(k*�tk(k*�tk*���Y*�����d���J��� �� �!�'�5�?�@�C�F�R�V�e�t�w�z���e���*�����k�l���!�� ��F�OV�&��$�}� �� �W��X���^�����*�*�v YL+*W����d�������� � �!�e��������k�l�������W��X��������h*�*�v<�P*��Y*�tkk*��Y*�tkk*����d���.� ��%�&� '�(�)�0(�3*�>+�V*�Y'�g-�e�������h�k�l��� �[� ����X���� ��+ :":%:Y:(+*..���`������������@���@���gg�#gg19,o,o(+*..�����D���������������3���3-,w-,�-,-,w4�--w--w����d���j���F� G�H�I� J�#J�HM�XN�hO�kR�{S�U�V�X�Y�\�\�`�a�b�f�gj klo�e���\� ���k�l����78������X�� 9:�� ;��<�� �=���>�&��?������@�X�� �� ���+ �d+BE:+*:(..����������������6�6�GK� NK:�)@YQS+E:+G� 6�6� T�W9� Z�]9Y:  k k-, c-, c����d���� ��� ����8�;�>�A�F�Q�Y�[�`�k�t�}����������������e��������k�l�����`8����a����b��;�c�:��A�*c�:���c�:���hc�:���Xde��t�zde���Rfg��[�h8���Ti�&���@j�&���7� � kl��X��������D**1H*� *'om*�*'omw*������d������� ���(�3�e�������D��� �8i�&�� k��X���A����� Y&(p����d�������e������� �&����� �&��rs��X���� ���n+l>,tx�,":,%:�,":,%:Y:gg19�'dko����d���.� �������$�*�3�C�S�b�e���f� ���n�k�l�����n~�S����n9:���i�� ��� ;��*�D;���<��$�J<��3�;��b� �&����X���� ���+l>,tx�,":,%:�,":,%:Y:gg19Yoo: ��'dk�9 Y  k  k: Y g g����d���:��������$�*�3�C�S�b�{���e���� ����k�l�����~�S����9:����� ��� ;��*�;���<��$�<��3���b�b�&��{�I�� ��7�&� ��� ���>����X��� ���/+l6,tx�,": ,%: �,": ,%: Y:    g   g  19    o�'k   o�'kY: w ,4�ww19ooY: �*k�`ogk �*k�`ogk�;,��0,�:cc6�u+.6+hdd.6-2: kc kc-2:�*kc�*kc6<d�-+.6+`.6`-2:-2:Y:��wwY:c�`o�'kcc�`o�'kc*`dp-,4�c`6d6d`:d`:6�d-2Sd2Shd����d��.�K�� �����%�+�4�D�T�c�t��� �!�"�#�%�'�(�)�* +(,8-E.U/e2k3q4~56789:2=>?@A CDF"G)H3I@KKLVN_O}PQRSTUVWQZ[\]^_ab_de =.i�e��`�#��/�k�l����/~�S���/9:���/By���/Cy���/�&���/��)�� ��� ;� �+;� ��<� �% <� �4� �c�&� �X��`�&��=�E� �h�|� �q�iE� �~�\G� ��V��(�G� �$E� �G� � ��"��_���Z� ��T� ��Hy��<y��&P� ���� ���/����X��b�����r+6Y,- h:  9  `o9 :6�` kR :6�+.2S����d���6� ��|�~���)�/�5�B�L�U�[�g�q�e�������r�k�l�����r�S����r����r����r����r����rBy����rCy���n�� ���Z� ��S�&� �)�I�&� �/�C���2�� ��U�y��X�� ����X���� ���p+6Y-,g-,g:6�F+.2,``okc+.2,``okc����d���������%�E�e�o�e���\� ���p�k�l�����p�S����p����p����pBy����pCy���l�� ���Q��"�M� ����X��� ���I�YY�[: 6 6 �f*� ���6  � �  � �<  Ķ�W�.  �$ �  Ķ�W  Ķ�W �   6  :  �.��* -ϧ�* -6 �  .6   `.6*� ����\ 2:2:gg9* c�`oc�`og   dz����d����$��� ��#�4�9�G�N�S�^�i�o�r�{������������  /579<H�e������I�k�l����I� ���I� ���I���I���I���I���IBy���ICy�� @�=� � �o� � ��l� � �#�O� � ���� � ���S� ��� � ��vE� � ��mG� ���R���K� �0�&���� �� @� � ��X��j� ����++k++kcJ6�Y,2*g,2*g:Y+k+k�`k+k+kg+k+kgw)o+k+k�`k+k+kc+k+kg)o:,2*c,2*c,B����d���.� �����;�?�u������e���H����f���������y����&���� ��;����"����>����X���� ���+::�h:,��S,�W-�-:� :*: Y c c:+�:�]�:*,-u�����d���>���� � � � �* �5 �>�L�Q�[�z����e���z� ����k�l������������������� �  �� � ���[9:��I�~�S��Q�)~�S��[� � ��  ���� �����������  ����>����X���� ����YN*+-,Y-����d������� �!�e���*�����k�l�������������������������������@�X���=����� *+����d������)�e������� �k�l����� ��������@�X��y� ���=*�*�v*+ N$-*)-9:2�Y:59 : +7:�g]�<:   �S- �J ��>  : - :* >9 �n�W � 9  : u�$�Y@� BB� D�- 9�;G�4+J:*-N:�":@Y�YP�R��S*�:*�: 6 �" YS  YS  *�6 ,6 UYW: : : 6+7::Z]�<: F-= :-:X ^��#6* a c�W�6�"tx� d:�)g:�tx� g:� d:Y:Y:  �Y:* Yjp9ld.62ll.62lYc�`oc�`o:* 4d`:d`:6� d2Sd 2S6� .� l.62l2l BE�7BE�,Y:* pY:*p� ::*`d r�.�-t:�E� E:�#+x:�E� E:�:�+2{l2Yk2Yk6� .� l.62l2lBE�4�/Y:*GpY:*p� ::*d r: ~: �ld.6� d.6u�d: �n-t:�E� E:�#+x:�E� E:�:�+2{l2Yk2Yk-dt:�E� E:�!:�E� E:�:�7d2ld2Ykd2Yk ���d2Y:Y:6d62l2l �? BE�4�/Y:* pY:*Np�G �<�7�2Y:*GpY:*Np� ::* � `� r��d:6�Y2`2Sd66�-`6�22��/옜�&c9$�Y�B�-6  2� �$�Y�B�-6 �r*� ��Y 2*�tk 2*�tk*� ��Y  2*�tk  2*�tk  *�-����S��d�����J�K� V�W�c�d�"e�)g�2h�7i�:j�@k�Cl�Om�Wn�`o�lp�sq�~r�s�t�u�v�k�|�~�����#/5CQ`cfirux{#*3<AHQ`gs}$04JT^it}� � !""#0&3'I(S)]-h.m0v13478;>?@ACJKLNOT UVW$Z*[/\7]A`DdIeUfcgqn|opqtuvwz~  '1;@KPYcl|#&,5EHS^clt&),;�e��6�R��=�k�l����=���=� ��,��@�����&��"��2���7��&� �:�:� �O�X� �s�49:� �~�)~�S���i�&��� ����#By�/Cy� 2�.� � c�:� r� u:� x8� {� � �39:���:��:�(~�S��8� �8� �8�*8�3�<�Q�=�g�V�&�s�E� ��G� ��x��Iy��=y��'P� �4�E� �J�qG� �}� ���� ����e��e��e���3�E� �I�lG� �v�#���� ���e� �d��e��e�/e�|d����� �E� �'�G� �Y�#��&��#�l����� ����(� �&�i� �)�5� �2�!X� ��~� � ���>��@����"��2���� �r� � ��X���� ����*�`k�`(kok�`k�`(kokcg����d���&� �������#�$�%�(�e���4����*� �����*� ����*��&����*�&����*�&����X���U����� )�*�-¯����d�������e���*���� �k�l����� � ���� � ���� �&�� ��X��������`o9kc9  c�`o9 99969� c�`o9  9 99�  gc9 �T��  9 �?��  9�*�# gg�`o�`o9 9 � 'V ����d���n�������"�'�,�/�4�7�B��O�\�i�p�}���� � � � � ����e���� ���� ������ �����&�����&�����&����&����&� ���&� �"��&��'��&��,��&��/�� ��4��&���������X���?�����*+۱����d��� �����e��������k�l�����OP���������X��������\*�v*�����R���������6���'���=���/���D���K*,ާ�&*�*�*�*� *�����d���>�����0�5�8�<�? �C!�F#�J$�M&�Q'�T)�X*�[/�e��� ����\�k�l�����\� ����\OP�����X���/�����*�v����d������3�e��� �����k�l�����X��� �%��j�*�����9  Y)S Y)S 2)�* gk�`oc 2�* gk�`oc 2)�* ck�`oc 2�* ck�`oc*`d)�'kc�'kc  6 Y: Y: �c*� ���6 �9 Y W YW Y W`6 � Y W   `6 `6�-dk�*kc9�Ddo�*�-9�-�`kok9�*�`kok9�'�-9�*�`kok9g�`o9�`�`g�'g9Y)kckc:ckckc9*�:66  d6 �  Ŷ6 SR 2kc 2kc*�����#*�����c9� c9   t6 �  Ŷ6#*�#���6$#1$1c�`o9!*#`$d�'!k #2 $2c�`oc�'!k #2 $2c�`oc!     u����d���s��:�;�?�@�A�+B�9C�AD�OC�RE�[F�iE�lG�tH�G�I�J�I�K�L�M�K�O�P�Q�S�T�U�VWX&Y/[>\ASG_P`Yacbjamfsgwhijglmnmlopqpostuvutw{|{|{}{~~!"&)47:FU\covy 4=RSUY\i�e��B� ��j�k�l����j� ���jX� ���j�&���j�&���j�&���jBy� ��jCy� ���&� �� � �� �� ��Oi� �U�{i� �P� �Y� �m �&��) �&� �&�� �&� �&�� �&� �&�rT�&�T �)@�&�45�72� �:/� �  �S�&�!�u� �#�d�� �$������ �� ���X���D����� *+����d��� ���� �e������� �k�l����� OP����X��r� ���*�*�v*�:*�:6�"YSYS*�)'cH699 'w9 '9 �22 2�* kc2 �* kg*����6�*�* k�`oc �* k�`oc'22�* kc2 �* kg6�* kc9 �* kc9 22�* kc2 �* kg�- kc9 �- kc9 *��**�d'6�r*���Y2*�tk2*�tk*���Y2*�tk2*�tk*�����d����0���� ��"�(�6�D�S�W�]�`�c�f�m�s�v�������"-DU`kn}�e���� ���k�l�����&����:��By��"Cy��%�.� ��`� ��c�&��f�&� �m�&� �s �&� ��X� ��~� ���W�������X��� ���*�v*��YY*� L�YY*� M�YY*� N6� -*����!#�W*�ڻ(Y*:-+,+W6�L*���Y+��o�k*�tk,��o�k*�tk*�6�*����6�\*���:*���:*���Yc�`oc�`o�*/:99 6 �: 3Ŷ6 *� ��:c9 c9  *���Yo o*�����d����4���� ��(�7�=�>�M�W�f�o�x�~ �� � � � � � � ��� � � �      1 @ C I Q T W ] l x { }          !�e�������k�l���6�=��(7�=��78�=��:�,� ��og9:��{�X� ���� ���;� ��H��7<�Q�u=�T�r>�&�W�o?�&� Z�DX� � l�%<� � }�@����*��6A��(7A��78B�Q�u=���W��X�������*�*�v<CY**EM,H>�a6�H,KOSi6*��Y*��Y,KOY,K\,_>�,b,e� >,h,k,n,q,t����d���n��� $� %� &� '� (� )�# *�) +�; ,�G -�P ,�S .�_ /�h .�k *�~ )� 4� 7� 9� <� @� A� B� D� E� F� G�e���H�����k�l��� �w� ���xy�� �l� ��&�XX� ��;�0z� ���+{� ��|}��>���~�X��������Y�YY�[M*N-�6�,*�W*:Y:�]�d:,-�Wu�,����d���*� �� K� L� M� N� O�% P�, Q�B R�M Q�W S�e���H����Y�k�l�����Yz� ���QQ�=���KF���E� ��,�-�=��B� q�������QQ�?��,�-�C�����X���/�����*�v����d������ X�e��� �����k�l������X���>�����*�v����d��� ��� \� ]�e��������k�l������ ����������X���L����� *+,����d��� ��� b� c�e��� ���� �k�l����� �M���� �M���������X���J�����*+,����d��� ��� i� j�e��� �����k�l����������S���������>����X���m�����*++��ƹ�,����d��� ��� o� p�e��� �����k�l����������S���� �������������>����X���w�����*++��ƹ�,����d��� ��� t� u�e���*�����k�l����������S����� ���� �������������X�������**�YY�[�+,�*�Y�+�,��+,�B,�:6�+2S++6� fSL�&,�:6�+2S,L6�*�Y+2`�W,*,����d���j��� z� {� |� }�& ~�1 �: }�= �D �K �Q �Z �d �k �r �} � � � � � � � � � � �e���f� ����k�l����������S����� ��K�8��N�� ��h�� ������� ���&� ���������>����X���� ���**�YY�[�*,:,666�++`ʟ�=Y++`:  -�Ŷ ` :�%Y�YA+ʶ��`:*��W6�.�*.ׄ����d���V��� � � � � � �% �6 �O �` �i �p � � � � � � � � � �e���z� ����k�l������M�����M�����=����S���� ���X� ��"�� ��m�[F��� [F��O�!� ��$� ���� �������������>����X���� ��w*,(())[:]:{:}:N,(:):[(]){:}::,(:):[:]:{(}):*-:*:*: : 6 �   O  6 � . �   .O   . O� . �/ .�n ..�b   .O   . O�K . �A .�8 ..�, .�# ..�   .O   . O  Y*+ ����d���j��� � �0 �] � � � � � � � � � � � � �    & P Z d o v �e���z� ��w�k�l����w���w�M��0G�M��]�M����M����S����S����S����S� ��� � ��� � ��� ���w�� ��>����X��>������YY�[L=�*{�^>f:�.*}�"�Y��*ʶ��:�>��*Ǣ��~+�W�+�YA*ʶ���W*ǡ|+����d���J��� � � � � � � � �# �- �F �L �N �h �r � � � �e���4�����M�����=�� �� ���Y�:���U�M���� ����G���������X�������+Ǽ M>Y:6�+6(�YW�b.�-� :� ,O�E)�3�Y`Ŷ6,O,O��>�+ǡw�YŶ`,����d���b��� � � � � � �' !�9 "�N #�V $�] %�e &�q (�~ )� *� ,� -� .� � 6� 7� 8� 7� ;�e���R�����k�l������M���Q�S�� �� ���f���� �� �x����~�X� ���� ���f����X��J������*�� Y*����=�f>6� 6�>6�8�*�� 6�"*����� �6ɄYY����d���Z��� ?� @� B�( C�- D�/ E�2 F�7 G�= I�? K�B L�E M�U N�[ P�n Q�q R�w T�z L� X� Y� Z� \�e���>�����k�l������ ��(�rX� ��/�a� ��2�^ � ��B�N �:��}��>��� �X��������W�YY�[M�*��,* N-6�',Ķ�W,*����Ķ�W-,����d���&� �� `� a� b� d� e�( g�2 h�I e�U j�e���4����W�k�l�����W� ���OQ�=���8f��%�0� ���� ���OQ����X�������*�� Y* M,d>,`66�P� 6>�D*����� �,*�����*����d>�66�h*�d�6*�d6�I*����� �0*�����*����`6�6Y����d���r��� n� o� q� r�& s�. t�1 u�4 v�8 w�; x�@ z�R {�X |�j }�~ � u� � � � � � � � � � � � �e���>����k�l����� �����&�� ��.� � ��1� �:��12��>����X��c�����YM�*��,>,ĶW*�����`*�p>�x*����>,ĶW`*�p>�Q,ĶW*�����`*�p>�'*����>,ĶW`*�p>,����d���N��� � � � � �$ �6 �E �T �] �i �l �u � � � � � � �e���*�����k�l������ ���Q���� ���� ���Q������X��������vfL=�d*����>��Y+����L�5��Y+����L��Y+����L*�+����d���*� �� � � � � �4 �9 �Q �f �t �e���*����v�k�l����sQ�M���o� ���OX� �����X��������ffM>�Y+.��Y,����M�7+.��Y,����M��Y,����M+,����d���&� �� � � � �' �. �F �[ �d �e���*����f�k�l�����f�S���cQ�M���_� �����X��������8fL=�&�Y+��*���!��L*�+����d������ � � �( �6 �e��� ����8�k�l����5Q�M���1� �����X��������\fL* M>�E�Y+��`#�*��%�#�,.`��L*�+����d���*� �� � � � �$ �5 �C �H �L �Z �e���*����\�k�l����YQ�M���T�S�� �P� ��&��X���~�����0*� L=�+*����O*�+����d������ � � � �. �e��� ����0�k�l��� �&Q�S�� �"� ��"��X��������\*'L=�H*��dN-c:-:i6i6+.�+.�+O+O*�+����d���2� �� � � � � �" ��) �0 �@ �F �L �Z �e���R����\�k�l����WQ�S���S� ���6)q���0*F��"�*+F��)�#,� ��0�-� ��.���X��������fL=�r�Y+��`#�*���!�#�#�`#�*����`#�`��L*�+����d���6� �� � � � � �* �- �0 �L �e �p �t � �e��� �����k�l����Q�M���}� ��/�������02�X��������S�Y+�N-�Y4�,����-�Y*6�����-�N0Y-+8����A�D��d������ � �# �= �D �E !�R #�e���4����S�k�l�����S �M����S�M�� �;:��E� ��;�������02�X��������`�Y+�N-�YA*�#�,����-�Y*<�����-�N0Y-+8����N�Q��d������ (� )�0 *�J +�Q ,�R -�_ /�e���4����`�k�l�����` �M����`�M�� �H:��R� ��>�������02�X��������l�Y+�N-�Yݷ�,����-�Y*������-�Y*�ʸ�����-�N0Y-+8����Z�]��d���"��� 4� 5�" 6�< 7�V 8�] 9�^ :�k <�e���4����l�k�l�����l �M����l�M�� �T:��^� ������X��������=�Y?L=�&�Y+��*��%��L*�+����d������ ?� @� A�- @�; C�e��� ����=�k�l����5|�M�� �1� ��@A������2B�X������=DY+FN-I:�YY�[:LYN:6 6 f: O: Q:S:U:XZ:2^<Q`d`�O`�S`�2:�W2f6 �6  d`�R �>6 *�Yj�l�`n��� p�W d`6�T2f6  � d�8Ķq�ĻYrWĶs ĶWI2^`�:^t6`w:�Y ��U�#��: 2 `�7 t6 `w:�Y ��U��: �2`�St6`w: Ǚ��Yz� ��: �YU�� ��: �i<�_t6`w: Ǚ��Y ��#��: �Y ���U���: -I:|�: :6� O* }�YY�[:�:�w]�Ŷ6Ķs:�I]�Ŷ6*� d��:*� d��:dY:�Wu�u�** =�"N-�N-�NBY-f������d��^�W�� H� J� K� L� M�# R�& S�) T�- U�2 V�7 W�< X�? Y�F Z�P [�z \� ^� _� `� a� c� d� e� f� g� h� i� j� f� l� n� l q s t- v: wL xb qp |} ~       �    4 P Z c r z    X          D U f s {            �e��~�&���k�l��������:�� ���M���=��#}���� ����M��G� � �&z� � �)w�:� �-s�M� �2n�M� �7i�M��<d�M��Pl��\� ��-� ��"�M��+� ���M� �G� ��8�M�c�S� �r�D�M���=���S��� ���=� �e� �D�7X� �U�&[F�f�F�s�q����������*���G��#}���G���C��A������2B�X��%����=DY+FN-I:�YY�[:Y:6 6 f: jU:XZ:  � 2f6 2f6  �6  d6 �   d6 �6  2: 2fW 2fW 2fW�W �H6 *�Yj�l�`n���p�WĶW�W ĶW�:<�<�lXZ:�[2:6�%�Y ��2�#��: ٻ�Y ������: -I:�d : 6� 3ŶO*  }* =�!NBY-fNY-f��I ����d����?�� � � � � �# �& �) �- �0 �7 �A �I �R �[ �a �e �l �q �{ �~ � � � � � � � � � � � � � � � � �    ( 2 9 ? E d o �               �e�������k�l��������:�� ���M���=��#��R�� ����M��[�� � �&�:� �)� � �-�M� �AV� 2�_�?�R�M�B�-� ��7�S� �"� �����������G��#����>����X��+������YY�[M�YY�[N+,-*,Y:�%]�d:*ciiu�-Y:�%]�d:*ciiu�ױ����d���*� �� � � � �/ !�E �O $�d %�z $� '�e���>�����k�l������=���}�=���u�=��/�[q��d�[q���� �����C���}�C���u�C��A������2B�X�������=иWN----:Y:Y+:� :6� O*:�YY�[: 6 �O :  6  �6 *� ��:*� ��: : �W  * =�NBYfN- ���������d����$�� ,� .� /� 0� 1� 2� 3�% 4�. 5�= ?�D B�O C�U D�[ C�f E�n G�u H�~ I� J� K� L� M� N� O� P� I� S� U� W� X� Y� Z� X� [� \� ^�e��������k�l����������:���  ��%�  ��.���D���O��S��R�� ��u�p��~�g�=� ��Y� � ��=p� ��6� � ��/� � ��![F���F���q��� ������� ��D���u�p��~�g�C� �A����� �B2�X��l�����=DY+FN-I:f:f:f:�>U:`�f�ř� :�:�wU:-I:� f�ŚǙ�%**=�NBY-f������d���Z��� d� f� g� h� i� j� k� l�' m�2 n�< o�C q�J v�U x�[ k�j z�r {�z |� }� � � �e���\� ����k�l����������:�� �z���t�M���p�M���l�M���h�M�����H�������X���?�����*+����d��� ��� � �e��������k�l���������������X��8������������������A���2���#���P���_*+ >�ͱN�*+">�N�*+$>�N�*+&>�N�DY+FN-()*-"6�:-,*-$6�:-,*- 6� : -,*-&6�:/� : *-&6�:/� : -,� :Yf0��$�.�/�3�=�>�B�L�M�Q�[�\�p�|�}���������B������B����i�|��}����������������d����5�� �$ �* �/ �0 �3 �9 �> �? �B �H �M �N �Q �W �\ �] �` �i �p �w �| �} � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �e�������k�l��������1� ��*�2�:��9�2�:��H�2�:��W�2�:��i���w�2�:���2�:���2�:������2�:���34������2�:���34������3�� 5i��X��������K*G68�*G;8�*G=8�*G?8�*GA8�����d���&� �� � � �) �+ �8 �: �G �I �e��� ����K �M����j������02BC�X��������/MEY+GM+H>*,�N,� ,J�:-+K-������"�%��d���*� �� � � � � � � ��' �, �. �e���4����/�k�l�����/ �M���-N��� O� ���P��Q��>���R�X���P�����*+�����d��� ��� � �e��������k�l�����S�=���� ����S�?��TU��X���B����� *�+�W����d��� ��� � �e������� �k�l����� VW���j��X���o�����%=�*��X+Z�*�����d������ � � �$ �e��� ����%�k�l�����%]�M���"� ��^_��>���`�X��������*>�*�+�Ŷ��,a+߱����d������ � � �) �e���*����*�k�l�����*e�=����*f���'� ���� ����*e��gh��X��������;+ M>�,+.�++..� ,+.O�++.O�,O+,����d���&� �� � � � � �# #�, (�0 �9 +�e���*����;�k�l�����;�S���6Q�S���2� ��]�������X��������\*+iL+kM*�m>�A+.�7*���,.p,.�*,.ק�,.+.� *+.s,����d���2� �� /� 1� 2� 4� 5� 7�/ 8�6 9�A :�J ;�R 4�[ ?�e���*����\�k�l�����\�S�� �Qu�S���G� ��v���X���g�����=�*���p����d������ C� D� C� F�e��� �����k�l������ ���� ����>���w�X���/�����*�����d������ I�e��� �����k�l������X���2�����*�����d������ N�e��� �����k�l���x��>���y�X��������&�YY�[L=�+Ķ�W*+����d������ R� S� T� S�$ V�e��� ����&�k�l����z�=�� �� ���� ���z��{}��>��� �X��_������YY�[M*����~>6�+*���6�,Ķ�W�6*�d>6�+*���6�,Ķ�W�6�,����d���V��� Z� [� \� ]� ^�" _�2 `�8 a�A b�G d�J ^�Z g�^ h�a i�d j�t k�z l� m� o� i� s�e���H�����k�l������ ���|�=���y� ���v �:��2�X� ��t�X� ���� ���|��}}��>��� �X��������\�YY�[M>,Ķ�W*���6�`*p>�#��� >� `*p>,����d���.� �� w� x� z� {�# |�) }�5 �F �L �U �Z �e���4����\�k�l�����\� ���T|�=�� �R� ��#�2X� ���� ���T|��~��X�������x=�*�>*���66�� `><*���6��>6�`*p>6����d���J��� � � � � �% �( �4 �9 �; �K �V �Y �\ �b �n �q �v �e���>����x�k�l�����xz� ���v� ���c� ��%�SX� ��(�P�:��}��>��� �X���:�����*����d������ �e��������k�l�����z� ��}��>��� �X��4������YY�[M�*�,>*���66�`><,Ķ�W*���6�� >6�`*p>6,����d���J��� � � � � �+ �. �4 �= �? �H �X �c �f �l �x �{ � �e���>�����k�l�����z� ���z�=���g� ��+�WX� ��.�T�:���� ���z��}��>��� �X��������8�YY�[M*���>�,Ķ�W,Ķ�W,����d������ � � � �) �6 �e���*����8�k�l�����8z� ���0�=���!X� ���� ���0��}��>��� �X��J������YY�[M�*�,>*���66�d><�,,Ķ�W*���6�� >6�*`d*p>6,����d���R��� � � � � �+ �. �4 �= �? �C �E �N �^ �i �l �r � � � �e���>�����k�l�����z� ����=���u� ��+�eX� ��.�b�:���� �����}��>��� �X������>�YY�[M*���%,Ķ�W,*���Ķ�W>*���6�;,`Ķ�W,*`���Ķ�W*`���6`*�.*`����*`���d>*���6�;,`Ķ�W,*`���Ķ�W*`���6`�.*`����*`���`,����d���z��� � � �# �9 �; �I �K �N �Y �Z �m �q � � � � � � � � ������  % <�e���4���>�k�l����>z� ��6�=��;� ��K�� ���� ��6��}��>��� �X�������v�YY�[M>�*�����>��6�+,Ķ�W*���� �YY�[*,����d���>��� � �  �  �%�( �0�3�7�:�@�J�]�e�t�e���4����v�k�l�����vz� ���n�=�� �l �:��=�7� ���� ���n��}��>��� �X��������:�YY�[M>�),Ķ�W*���� �YY�[,����d��������  �!�("�0�8%�e���*����:�k�l�����:z� ���2�=�� �.� ���� ���2����X���/�����*�t����d������)�e��� �����k�l�����X���>�����*+�t����d��� ���-�.�e��������k�l������"�� V��X�������*+g*+gŸ�nN,+g,+gŸ�n:-g�n:�8�c�n:�ȗ�g�n:ȗ����d���*� ��2�3�34�B7�E8�O9�`:�l;�z7�=�e���>����������������z�"��3�`�"��B�QV�"����>����X��1������YY�[M+>66�'*����,Ķ�W�6*�+d>�'*����,Ķ�W�6�,����d���F���B�C� D�E�F�(G�1H�7J�:E�JM�QN�TO�fP�oQ�uS�xN�V�e���>�����k�l��������{�=�� �vz� ���s�:���p�:���� ���{����X���/�����*�����d������Z�e��� �����k�l�����>����X���/�����*�����d������^�e��� �����k�l�����X���w�����)=�*����*�����d������b�c�d�b�'g�e��� ����)�k�l�����)� ���%� ����X���s�����*>*6*����d������v�w� x�y�e���4�����k�l������ ����� ���� �� �X� ����X���\�����***-����d��� �����e���*�����k�l������ ����� ����)q����X��������7>6*���:*���:dY:*����d���������� �-�6�e���R����7�k�l�����7� ����7� ���5� ���2X� ���%F�� �F��-� )q����X��s�� ���66�666�*�����*����� *-ȱ`6�9*���:�6�� � *-ȱ*-ű����d���V������ �����2�E�N�O�X�f�m�s������e���f� ����k�l������ ����� ����)q���� ���X� ���� ��U�@� ��f�%F��m�i� ����X��������X*�+J�*�+W�C+cM+N,i6-i6,�-i�"-�,i�,p-p,-����d���2� ��� ���!�'�-�C�H�M�R�W�e���>����X�k�l�����Xq���;F��!�6F��'�0� ��-�*X� ����X��������9� >=<*���N*���:dY-:*ű����d���&� ����� � ��$�0�8�e���H����9�k�l�����9� ����9X� ���� ���"F��$�F��0� )q����X��������B� 6=<*���:*���:----DZ����d���.� ����� � ��'�-�3�:�A�e���H����B�k�l�����B� ����BX� ����B)q���� ���(F��'�F����X��������.*���N*���:dY-:*ȱ����d������� ��%�-�e���>����.�k�l�����.� ����.X� �� �"F���F��%� )q����X��������=� 6=<*���:*���:--*�-�W����d���*� ����� � ��'�-�3�<�e���H����=�k�l�����=� ����=X� ����=)q���� ���#F��'�F����X�� �����pN� 6=<*�����*���N6�/*��d:ci�i�N*�-����d���:������ � ��!�0�6��D�P�\�_�n�e���H����p�k�l�����p� ����pX� ���nQq�� �� ��3�;� ��D�pq����>����X��������A�YY�[L=�-*���N-�6�� +-ζ�W*+����d���"��� � � ���+�4 �?�e���4����A�k�l����9Q�=�� �5� ���[F���� ���� ���9Q�C����>����X��������.�YY�[L*�YN�-]�dM+,�W-u�+����d���������#�,�e��� ����.�k�l����&Q�=���pq���� ���&Q�C����>����X���n������YY�[L+*Ͷ�W+*϶�W+����d������"�#�$�%�e��������k�l����Q�=���� ���Q�C��}��>����X��������G�YY�[M*�Y:�*]�dN-ci�-i� ,-�Wu�,����d������+�,�.�5/�;,�E2�e���*����G�k�l�����G� ���?Q�=���pq���� ���?Q�C��/��X��������(=�*���N-+ӄ*�����d������6�7�8�6�':�e���*����(�k�l�����(�C���%� ���[F��/��X��������(=�*���N-+ׄ*�����d������=�>�?�=�'A�e���*����(�k�l�����(�C���%� ���[F��/��X��������(=�*���N-+ۄ*�����d������D�E�F�D�'H�e���*����(�k�l�����(�C���%� ���[F��/��X��������(=�*���N-+߄*�����d������K�L�M�K�'O�e���*����(�k�l�����(�C���%� ���[F�� ���X���/�����*�����d������S�e��� �����k�l����j��X���>�����*+�����d��� ���X�Y�e��������k�l�������M����>����X���/�����*�����d������]�e��� �����k�l�����X���=����� *�+����d������b�e������� �k�l����� �����X���B����� *�+�W����d��� ���g� h�e������� �k�l����� ����j��X��������b�YY�[M*�Y:�]�N-+<� ,-�Wu�,Y:�]�N*�-Wu�����d���&� ��l�m�o�*q�0m�:t�Nv�Wt�ax�e���4����b�k�l�����b�M���Z�=������N� ����� ���Z�I���W��X���6�����*�m����d��� ���|�}�e��� �����k�l����W��X�������*��*�<=*Y*���>�v*���6*�`��6d�H*Y*���*Y*�`��`*�d�=*�d�*Y*�d��*��***�����d���R�������*�/�?�Q�Z�s�����������e���>�����k�l����� ����:��,�� ��?�`� ��Q�N� ���W��X���� ��YL+ĶW=�+Ŷ>*��*���:�6�+`ĶW��*���:+`ĶW�YY�[:6�7�W�W*�`��:*�d��:�i*Y�Y��� :   +`ĶW+������d���r��������!�,�9�@�F�T�Z�h�t�}�������������e���f� ���k�l����f��� � ��!�� ��9�[F��@�X� ��h� F��}��=���|� ���� ������f��}��?�� �W��X��1�� ��#YL+ĶW=+Ŷ>*��*���:�6�6�YY�[:��W*�`��:`*� ����d�X*�d���W*�`d���W*Y�Y ��� : +`dĶW� �+`ĶW+`ĶW+������d���v��������!�,�9�@�F�I�R�U�]�m�p���������"�e���\� ��#�k�l���f�� � ��!�� ��9�[F��@�X� ��I�� ��R���=���������f��R���?�� �W��X��t�� ��LYL+ĶW=1+Ŷ>*�*���:�6�`6�YY�[:6�F�W*���:�� �� �+ĶW6�6*������d�{�v*�d���W*�d���W*Y�Y ��� :   +dĶW��+`ĶW+α����d����!��������!�,�9�@ �F �K �T �W�Z�b�p�������� �!�"#$$&3,9.DK3�e���f� ��L�k�l���Df��9 � ��!#� ��9 [F��@X� ��K�� ��T���=��W� �:��� �����Df��T���?�� ��X�������qN*�Y:�Z]�:�E������A������������+���+,���Y:,J�u�-����d���.� ��8�9�;�#=�@@�LA�OF�YG�bH�e9�oN�e���>����q�k�l�����qO� ����qF���oQ���K���Y� �=���� ��Y� �?��  ��X���B����� *�+�W����d��� ���U� V�e������� �k�l����� ����>��� �X���/�����*�����d������Z�e��� �����k�l���  ��X���J�����*+, ����d��� ���_�`�e��� �����k�l�����  ���� ,��  ��X��������TI96�**���:-9(-I*�*�+( ����d���&� ��d�e� f�h�i�)j�3f�Ll�Sm�e���>����T�k�l�����T ,���P�&�� �K�&�� �@� ���[F��  ��X���� ���޻ Y+ "N- #�YY�[:�YY�[:- &6�M���B��������� ���)- )�n�W���W�YY�[:- &6� �W�o:6�&��Y:   d��oS**, �N-�������d���f���r� s�t�u� v�&w�)y�D|�Q}�T�\�d�m�sw�y�����������e���p� ����k�l���������� ,�� � , -��� .�=�� � /�=��&�O� ���E ���7� ��� 0�=� ������ ��� . 1�� � /A��� 0A� �  ��X��������C+�@6� *���:+2 2+*��*, 5����d���"����� ��%�9�=�B�e���>����C�k�l�����C  ����C ,����C 7�:���1� ��� [F�� 8 9��X��������4*��oL=�+*���-�nS*�+����d������� ��$�2�e��� ����4�k�l��� �)  �� �%� �� 7 ��X��������d�nM�nN6�:*���-�n:,�nM-�nN*�+-, ����d���&� ������(�8�H�W�c�e���>����d�k�l�����d ,���]�"���V�"���F� ��(� :�"�� ;�j��X���A����� *+ <����d��� �����e������� �k�l����� |�M�� ; >��>��� ?�X��Y�����=>�*���:�+ @��ƶ A�w�l+ @��ƶǞ�+ @��ʧ� D I+` @��ƶǞ�+` @��ʧ� D M�+��*�J����d���:���������.�7�?�m�����e���4�����k�l�����|���� ���X� ���[F���� ����|�� P�W��X��������[<�M*���M,�,f A�+,�!, D I, D M�*�����d���6� �������!�'�.�:�F�L�O�Z�e��� ����[�k�l����YX� ���>[F�� Q R��X��������^ SY UL VY+ XM,* [ _Y aY+ c g jN- m�L pY�Y r�* t z� }�+ �� ����0�1��d���2� �������%�)�1�2�@�P�Z�e���4����^�k�l����) ��� ��)� ��2�,��X��X���@����� *�������d�������e������� �k�l����� � �� ��>��� �X��������7�YY�[M+ �:�]�Ŷ>,*�Wu�,����d������ � �! �+ �5�e���*����7�k�l�����7 ���/ �=��!� � ��������7 ���/ �?�� ��>��� �X��������4�YY�[N6=<6�-*�W-����d���"���������)�2�e���>����4�k�l�����4� ����4� ���, �=���%� ���� ���� ���, �?�� ��X���B����� *�+�W����d��� ����  �e������� �k�l����� �{�� ��X���B����� *�+W����d��� ���$� %�e������� �k�l����� �{�� ��X���B����� *�+W����d��� ���)� *�e������� �k�l����� ��� ��X���{�����*�cY* - �W����d��� ���.�/�e���>�����k�l������ ����� ���� C���� C�����&�� ��X���X�����*�cY* �W����d��� ���4�5�e��� �����k�l������ ����� �� ��>��� �X���/�����*�����d������9�e��� �����k�l��� ��X���� ��*�+ko�nM*����nN*����n:*����n:*����n:6�*����*����n:*����*����n:*���-�*����nN*����*����n:*�.Y-g�`og�`o:6 v,*� ��gk,*� ��gkgc�n:,*� ��gk,*� ��gkcc�n: *� ��Y ,*� ��gk,*� ��gkgc�n:,*� ��gk,*� ��gkcc�n: *� ��Y   *�����d���@��D� G�J�/K�EL�[M�qO�wP�Q�R�S�T�U V&W=OLZ^[mZr]x`a`bcb`d`fgfhihfj fkl-k0q7rOqPsWtospqquvq|wxwyzyw{w|}|]�e���z� ���k�l���� �"��V�"��/6�"��E8�"��[5�"��q7�"��t�� �r �'�"���"� u� � ���X��������* :* :* : ����d����������e���H�����k�l������ ����X� ����� ��� ��� ��� ��  ��X��������2+*g,+gk+*g,+gkgJ)�����d��������&�(�e���*����2 �����2 ����2 ��(� �&�� 0��X��<�� ���HJ6�i*���:`6�C*���: :  :   9  '� H  J*�*�)����d���>������ ��#�1�;�E�N�U�X�`�o�~�e���f� ����k�l����| �&���zV�&�� �u� ���UEF�� �OX� ��1�/GF��;�%� �E�� �N��&� � ��X��������E<=�*����>`�<*�*�v�*�v� �����d���*� ��������-�5�=�D�e���*����E�k�l����C �:���)� ��� X� �A Qb������ �X���%�����* İ����d��������e������R��X���u�����= Y�W Ⱦ K* ˶O�W* ζO�W* ѶO�W*Y ư���� ��&�) �*�3�6 ��d�������s�e������T��X��������J Y�W ؾ K* ۶O�W* ߶O�W* O�W* O�W*Y ְ���� ��&�) �*�3�6 �7�@�C ��d�������s�e������U��X��������J Y�W 꾼 K* .O�W* .O�W* .O�W* .O�W*Y ���� ��&�) �*�3�6 �7�@�C ��d�������s�e������ ��� ���z�% @n @d @� �  ��  �/8 @y8 @<8 < � 8 �E8 � �  �   � PK �����c><Ƌ&�&�&���fr/orsay/lri/varna/models/rna/RNA.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Université Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Point; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.GeneralPath; import java.awt.geom.Line2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintStream; import java.io.Reader; import java.io.Serializable; import java.io.StreamTokenizer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Stack; import java.util.Vector; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.InputSource; import fr.orsay.lri.varna.exceptions.ExceptionExportFailed; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.exceptions.ExceptionWritingForbidden; import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener; import fr.orsay.lri.varna.interfaces.InterfaceVARNAObservable; import fr.orsay.lri.varna.models.CubicBezierCurve; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.annotations.ChemProbAnnotation; import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.annotations.TextAnnotation; import fr.orsay.lri.varna.models.export.PSExport; import fr.orsay.lri.varna.models.export.SVGExport; import fr.orsay.lri.varna.models.export.SecStrDrawingProducer; import fr.orsay.lri.varna.models.export.XFIGExport; import fr.orsay.lri.varna.models.naView.NAView; import fr.orsay.lri.varna.models.templates.RNANodeValue2TemplateDistance; import fr.orsay.lri.varna.models.templates.RNANodeValueTemplate; import fr.orsay.lri.varna.models.templates.RNANodeValueTemplateBasePair; import fr.orsay.lri.varna.models.templates.RNATemplate; import fr.orsay.lri.varna.models.templates.RNATemplateAlign; import fr.orsay.lri.varna.models.templates.RNATemplateDrawingAlgorithmException; import fr.orsay.lri.varna.models.templates.RNATemplateMapping; import fr.orsay.lri.varna.models.templates.RNATemplate.EdgeEndPointPosition; import fr.orsay.lri.varna.models.templates.RNATemplate.In1Is; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateHelix; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateUnpairedSequence; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement.EdgeEndPoint; import fr.orsay.lri.varna.models.treealign.RNANodeValue2; import fr.orsay.lri.varna.models.treealign.RNATree2; import fr.orsay.lri.varna.models.treealign.RNATree2Exception; import fr.orsay.lri.varna.models.treealign.Tree; import fr.orsay.lri.varna.models.treealign.TreeAlign; import fr.orsay.lri.varna.models.treealign.TreeAlignException; import fr.orsay.lri.varna.models.treealign.TreeAlignResult; import fr.orsay.lri.varna.views.VueUI; import java.lang.Math; /** * The RNA model which contain the base list and the draw algorithm mode * * @author darty * */ public class RNA extends InterfaceVARNAObservable implements Serializable{ /** * */ private static final long serialVersionUID = 7541274455751497303L; public static final int FILE_TYPE_BPSEQ = 1; public static final int FILE_TYPE_CT = 2; public static final int FILE_TYPE_DBN = 3; public static final int FILE_TYPE_RNAML = 4; public static final int FILE_TYPE_UNKNOWN = 5; /** * Selects the "Feynman diagram" drawing algorithm that places the bases on * a circle and draws the base-pairings as chords of the circle graph. */ public static final int DRAW_MODE_CIRCULAR = 1; /** * Selects the "tree drawing" algorithm. Draws each loop on a circle whose * radius depends on the number of bases involved in the loop. As some * helices can be overlapping in the result, basic interaction is provided * so that the user can "disentangle" the drawing by spinning the helices * around the axis defined by their multiloop (bulge or internal loop) * origin. This is roughly the initial placement strategy of RNAViz. * * @see RNAViz */ public static final int DRAW_MODE_RADIATE = 2; /** * Selects the NAView algorithm. */ public static final int DRAW_MODE_NAVIEW = 3; /** * Selects the linear algorithm. */ public static final int DRAW_MODE_LINEAR = 4; public static final int DRAW_MODE_VARNA_VIEW = 5; /** * Selects the RNAView algorithm. */ public static final int DRAW_MODE_MOTIFVIEW = 6; public static final int DRAW_MODE_TEMPLATE = 7; public static final int DEFAULT_DRAW_MODE = DRAW_MODE_RADIATE; private Double _spaceBetweenBases = 1.0; /** * The draw algorithm mode */ private int _drawMode = DRAW_MODE_RADIATE; public int BASE_RADIUS = 10; public static final double LOOP_DISTANCE = 40.0; // distance between base pairs in an helix public static final double BASE_PAIR_DISTANCE = 65.0; // distance between the two bases of a pair public static final double MULTILOOP_DISTANCE = 35.0; public static final double VIRTUAL_LOOP_RADIUS= 40.0; public double CHEM_PROB_DIST = 14; public double CHEM_PROB_BASE_LENGTH = 30; public double CHEM_PROB_ARROW_HEIGHT = 10; public double CHEM_PROB_ARROW_WIDTH = 5; public double CHEM_PROB_TRIANGLE_WIDTH = 2.5; public double CHEM_PROB_PIN_SEMIDIAG = 6; public double CHEM_PROB_DOT_RADIUS = 6.; public GeneralPath _debugShape = null; private boolean _drawn = false; public double _bpHeightIncrement = VARNAConfig.DEFAULT_BP_INCREMENT; /** * the base list */ protected ArrayList _listeBases; /** * the strand list */ StructureTemp _listStrands = new StructureTemp(); /** * Additional bonds and info can be specified here. */ private ArrayList _structureAux = new ArrayList(); transient private ArrayList _listeVARNAListener = new ArrayList(); static ArrayList _normalBases = new ArrayList(); { _normalBases.add("a"); _normalBases.add("c"); _normalBases.add("g"); _normalBases.add("u"); _normalBases.add("t"); } private ArrayList _listeAnnotations = new ArrayList(); private ArrayList _listeRegionHighlights = new ArrayList(); private String _name = ""; public RNA() { this(""); } public RNA(String n) { _name = n; _listeBases = new ArrayList(); _drawn = false; init(); } public String toString() { if (_name.equals("")) { return getStructDBN(); } else { return _name; } } public RNA(RNA r) { _spaceBetweenBases = r._spaceBetweenBases; _drawMode = r._drawMode; _listeBases.addAll(r._listeBases); _listeVARNAListener = (ArrayList) r._listeVARNAListener; _drawn = r._drawn; init(); } public void init() { } public void saveRNADBN(String path, String title) throws ExceptionWritingForbidden { try { FileWriter out = new FileWriter(path); if (!title.equals("")) { out.write("> " + title + "\n"); } out.write(getListeBasesToString()); out.write('\n'); String str = ""; for (int i = 0; i < _listeBases.size(); i++) { if (_listeBases.get(i).getElementStructure() == -1) { str += '.'; } else { if (_listeBases.get(i).getElementStructure() > i) { str += '('; } else { str += ')'; } } } out.write(str); out.write('\n'); out.close(); } catch (IOException e) { throw new ExceptionWritingForbidden(e.getMessage()); } } public Color getBaseInnerColor(int i, VARNAConfig conf) { Color result = _listeBases.get(i).getStyleBase() .get_base_inner_color(); String res = _listeBases.get(i).getContent(); if (conf._drawColorMap) { result = conf._cm.getColorForValue(_listeBases.get(i).getValue()); } else if ((conf._colorDashBases && (res.contains("-")))) { result = conf._dashBasesColor; } else if ((conf._colorSpecialBases && !_normalBases.contains(res.toLowerCase()))) { result = conf._specialBasesColor; } return result; } public Color getBaseOuterColor(int i, VARNAConfig conf) { Color result = _listeBases.get(i).getStyleBase() .get_base_outline_color(); return result; } public Color getBaseNameColor(int i, VARNAConfig conf) { Color result = _listeBases.get(i).getStyleBase().get_base_name_color(); return result; } public Color getBasePairColor(ModeleStyleBP bp, VARNAConfig conf) { Color bondColor = conf._bondColor; if (conf._useBaseColorsForBPs) { bondColor = _listeBases.get(bp.getPartner5().getIndex()) .getStyleBase().get_base_inner_color(); } if (bp != null) { bondColor = bp.getColor(bondColor); } return bondColor; } public double getBasePairThickness(ModeleStyleBP bp, VARNAConfig conf) { double thickness = bp.getThickness(conf._bpThickness); return thickness; } private void drawSymbol(SecStrDrawingProducer out, double posx, double posy, double normx, double normy, double radius, boolean isCIS, ModeleStyleBP.Edge e, double thickness) { Color bck = out.getCurrentColor(); switch (e) { case WATSON_CRICK: if (isCIS) { out.fillCircle(posx, posy, (radius / 2.0), thickness, bck); } else { out.drawCircle(posx, posy, (radius / 2.0), thickness); out.fillCircle(posx, posy, (radius / 2.0), thickness, Color.white); } break; case HOOGSTEEN: { double xtab[] = new double[4]; double ytab[] = new double[4]; xtab[0] = posx - radius * normx / 2.0 - radius * normy / 2.0; ytab[0] = posy - radius * normy / 2.0 + radius * normx / 2.0; xtab[1] = posx + radius * normx / 2.0 - radius * normy / 2.0; ytab[1] = posy + radius * normy / 2.0 + radius * normx / 2.0; xtab[2] = posx + radius * normx / 2.0 + radius * normy / 2.0; ytab[2] = posy + radius * normy / 2.0 - radius * normx / 2.0; xtab[3] = posx - radius * normx / 2.0 + radius * normy / 2.0; ytab[3] = posy - radius * normy / 2.0 - radius * normx / 2.0; if (isCIS) { out.fillPolygon(xtab, ytab, bck); } else { out.drawPolygon(xtab, ytab, thickness); out.fillPolygon(xtab, ytab, Color.white); } } break; case SUGAR: { double ix = radius * normx / 2.0; double iy = radius * normy / 2.0; double jx = radius * normy / 2.0; double jy = -radius * normx / 2.0; double xtab[] = new double[3]; double ytab[] = new double[3]; xtab[0] = posx - ix + jx; ytab[0] = posy - iy + jy; xtab[1] = posx + ix + jx; ytab[1] = posy + iy + jy; xtab[2] = posx - jx; ytab[2] = posy - jy; if (isCIS) { out.fillPolygon(xtab, ytab, bck); } else { out.drawPolygon(xtab, ytab, thickness); out.fillPolygon(xtab, ytab, Color.white); } } break; } } private void drawBasePair(SecStrDrawingProducer out, Point2D.Double orig, Point2D.Double dest, ModeleStyleBP style, VARNAConfig conf) { double dx = dest.x - orig.x; double dy = dest.y - orig.y; double dist = Math.sqrt((dest.x - orig.x) * (dest.x - orig.x) + (dest.y - orig.y) * (dest.y - orig.y)); dx /= dist; dy /= dist; double nx = -dy; double ny = dx; orig = new Point2D.Double(orig.x+BASE_RADIUS*dx,orig.y+BASE_RADIUS*dy); dest = new Point2D.Double(dest.x-BASE_RADIUS*dx,dest.y-BASE_RADIUS*dy); if (conf._mainBPStyle == VARNAConfig.BP_STYLE.BP_STYLE_LW) { double thickness = getBasePairThickness(style, conf); double radiusCircle = ((BASE_PAIR_DISTANCE - BASE_RADIUS) / 5.0); if (style.isCanonical()) { if (style.isCanonicalGC()) { if ((orig.x != dest.x) || (orig.y != dest.y)) { nx *= BASE_RADIUS / 4.0; ny *= BASE_RADIUS / 4.0; out .drawLine((orig.x + nx), (orig.y + ny), (dest.x + nx), (dest.y + ny), conf._bpThickness); out .drawLine((orig.x - nx), (orig.y - ny), (dest.x - nx), (dest.y - ny), conf._bpThickness); } } else if (!style.isWobbleUG()) { double cx = (dest.x + orig.x) / 2.0; double cy = (dest.y + orig.y) / 2.0; out.drawLine(orig.x, orig.y, dest.x, dest.y, conf._bpThickness); drawSymbol(out, cx, cy, nx, ny, radiusCircle, style.isCIS(), style.getEdgePartner5(), thickness); } else { out.drawLine(orig.x, orig.y, dest.x, dest.y, conf._bpThickness); } } else { ModeleStyleBP.Edge p1 = style.getEdgePartner5(); ModeleStyleBP.Edge p2 = style.getEdgePartner3(); double cx = (dest.x + orig.x) / 2.0; double cy = (dest.y + orig.y) / 2.0; out.drawLine(orig.x, orig.y, dest.x, dest.y, conf._bpThickness); if (p1 == p2) { drawSymbol(out, cx, cy, nx, ny, radiusCircle, style.isCIS(), p1, thickness); } else { double vdx = (dest.x - orig.x); double vdy = (dest.y - orig.y); vdx /= 6.0; vdy /= 6.0; drawSymbol(out, cx + vdx, cy + vdy, nx, ny, radiusCircle, style.isCIS(), p2, thickness); drawSymbol(out, cx - vdx, cy - vdy, nx, ny, radiusCircle, style.isCIS(), p1, thickness); } } } else if (conf._mainBPStyle == VARNAConfig.BP_STYLE.BP_STYLE_RNAVIZ) { double xcenter = (orig.x + dest.x) / 2.0; double ycenter = (orig.y + dest.y) / 2.0; out.fillCircle(xcenter, ycenter, 3.0 * conf._bpThickness, conf._bpThickness, out.getCurrentColor()); } else if (conf._mainBPStyle == VARNAConfig.BP_STYLE.BP_STYLE_SIMPLE) { } } private void drawColorMap(VARNAConfig _conf,SecStrDrawingProducer out) { double v1 = _conf._cm.getMinValue(); double v2 = _conf._cm.getMaxValue(); int x,y; double xSpaceAvail = 0; double ySpaceAvail = 0; double thickness = 1.0; /*ySpaceAvail = Math.min((getHeight()-rnabbox.height*scaleFactor-getTitleHeight())/2.0,scaleFactor*(_conf._colorMapHeight+VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE)); if ((int)ySpaceAvail==0) { xSpaceAvail = Math.min((getWidth()-rnabbox.width*scaleFactor)/2,scaleFactor*(_conf._colorMapWidth)+VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH); }*/ Rectangle2D.Double currentBBox = out.getBoundingBox(); double xBase = (currentBBox.getMaxX() -_conf._colorMapWidth-_conf._colorMapXOffset); //double yBase = (minY - _conf._colorMapHeight + _conf._colorMapYOffset); double yBase = (currentBBox.getMinY()-_conf._colorMapHeight-VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE); for (int i=0;i<_conf._colorMapWidth;i++) { double ratio = (((double)i)/((double)_conf._colorMapWidth-1)); double val = v1+(v2-v1)*ratio; Color c = _conf._cm.getColorForValue(val); x = (int) (xBase + i); y = (int) yBase; out.fillRectangle(x, y, VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH, _conf._colorMapHeight,c); } out.setColor(VARNAConfig.DEFAULT_COLOR_MAP_OUTLINE); out.drawRectangle(xBase,yBase, (double)_conf._colorMapWidth+VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH-1, _conf._colorMapHeight,thickness); out.setColor(VARNAConfig.DEFAULT_COLOR_MAP_FONT_COLOR); out.setFont(out.getCurrentFont(),VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE/1.5); out.drawText(xBase, yBase+_conf._colorMapHeight+VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE/1.7, ""+_conf._cm.getMinValue()); out.drawText(xBase+VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH+_conf._colorMapWidth, yBase+_conf._colorMapHeight+VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE/1.7, ""+_conf._cm.getMaxValue()); out.drawText(xBase+(VARNAConfig.DEFAULT_COLOR_MAP_STRIPE_WIDTH+_conf._colorMapWidth)/2.0, yBase-(VARNAConfig.DEFAULT_COLOR_MAP_FONT_SIZE/1.7), _conf._colorMapCaption); } private void renderRegionHighlights(SecStrDrawingProducer out, Point2D.Double[] realCoords,Point2D.Double[] realCenters) { for (HighlightRegionAnnotation r:_listeRegionHighlights) { GeneralPath s = r.getShape(realCoords,realCenters,1.0); out.setColor(r.getFillColor()); out.fillPolygon(s, r.getFillColor()); out.setColor(r.getOutlineColor()); out.drawPolygon(s, 1l); } } private void saveRNA(String path, VARNAConfig conf, double scale, SecStrDrawingProducer out) throws ExceptionWritingForbidden { out.setScale(scale); // Computing bounding boxes double EPSMargin = 40; double minX = Double.MAX_VALUE; double maxX = Double.MIN_VALUE; double minY = Double.MAX_VALUE; double maxY = Double.MIN_VALUE; double x0, y0, x1, y1, xc, yc, xp, yp, dx, dy, norm; for (int i = 0; i < _listeBases.size(); i++) { minX = Math.min(minX, (_listeBases.get(i).getCoords().getX() - BASE_RADIUS - EPSMargin)); minY = Math.min(minY, -(_listeBases.get(i).getCoords().getY() - BASE_RADIUS - EPSMargin)); maxX = Math.max(maxX, (_listeBases.get(i).getCoords().getX() + BASE_RADIUS + EPSMargin)); maxY = Math.max(maxY, -(_listeBases.get(i).getCoords().getY() + BASE_RADIUS + EPSMargin)); } // Rescaling everything Point2D.Double[] coords = new Point2D.Double[_listeBases.size()]; Point2D.Double[] centers = new Point2D.Double[_listeBases.size()]; for (int i = 0; i < _listeBases.size(); i++) { xp = (_listeBases.get(i).getCoords().getX() - minX); yp = -(_listeBases.get(i).getCoords().getY() - minY); coords[i] = new Point2D.Double(xp,yp); Point2D.Double centerBck = getCenter(i); if (get_drawMode() == RNA.DRAW_MODE_NAVIEW || get_drawMode() == RNA.DRAW_MODE_RADIATE) { if ((_listeBases.get(i).getElementStructure() != -1) && i < _listeBases.size() - 1 && i > 1) { ModeleBase b1 = get_listeBases().get(i - 1); ModeleBase b2 = get_listeBases().get(i + 1); int j1 = b1.getElementStructure(); int j2 = b2.getElementStructure(); if ((j1==-1)^(j2==-1)) { // alors la position du nombre associé doit etre décalé Point2D.Double a1 = b1.getCoords(); Point2D.Double a2 = b2.getCoords(); Point2D.Double c1 = b1.getCenter(); Point2D.Double c2 = b2.getCenter(); centerBck.x = _listeBases.get(i).getCoords().x + (c1.x-a1.x)/c1.distance(a1)+(c2.x-a2.x)/c2.distance(a2); centerBck.y = _listeBases.get(i).getCoords().y + (c1.y-a1.y)/c1.distance(a1)+(c2.y-a2.y)/c2.distance(a2); } } } xc = (centerBck.getX() - minX); yc = -(centerBck.getY() - minY); centers[i] = new Point2D.Double(xc,yc); } // Drawing background if (conf._drawBackground) out.setBackgroundColor(conf._backgroundColor); // Drawing region highlights renderRegionHighlights(out,coords,centers); // Drawing backbone out.setColor(conf._backboneColor); for (int i = 1; i < _listeBases.size(); i++) { Point2D.Double p1 = coords[i-1]; Point2D.Double p2 = coords[i]; x0 = p1.x; y0 = p1.y; x1 = p2.x; y1 = p2.y; Point2D.Double vn = new Point2D.Double(); double dist = p1.distance(p2); boolean discontinuous= (getBaseNumber(i)-getBaseNumber(i-1)!=1); int a = _listeBases.get(i-1).getElementStructure(); int b = _listeBases.get(i).getElementStructure(); boolean consecutive = (a==i)&&(b==i-1); if (dist>0){ vn.x = (x1-x0)/dist; vn.y = (y1-y0)/dist; if (consecutive && (getDrawMode()!=RNA.DRAW_MODE_LINEAR) && (getDrawMode()!=RNA.DRAW_MODE_CIRCULAR)) { int dir = 0; if (i+1=0) {dir = (testDirectionality(i-2,i-1,i)?-1:1);} Point2D.Double centerSeg = new Point2D.Double((p1.x+p2.x)/2.0,(p1.y+p2.y)/2.0); double centerDist = RNA.VIRTUAL_LOOP_RADIUS*scale; Point2D.Double centerLoop = new Point2D.Double(centerSeg.x+centerDist*dir*vn.y,centerSeg.y-centerDist*dir*vn.x); out.drawLine(centerLoop.x-5, centerLoop.y,centerLoop.x+5, centerLoop.y, 2.0); out.drawLine(centerLoop.x, centerLoop.y-5,centerLoop.x, centerLoop.y+5, 2.0); double radius = centerLoop.distance(p1); double a1 = 360.*(Math.atan2(dir*(p1.x-centerLoop.x),dir*(p1.y-centerLoop.y)))/(2.*Math.PI); double a2 = 360.*(Math.atan2(dir*(centerLoop.x-p2.x),dir*(centerLoop.y-p2.y)))/(2.*Math.PI); if (a1<0){a1+=360.;} if (a2<0){a2+=360.;} double angle = a2-a1; if (dir*(a2-a1)<0.) angle += dir*360.; out.drawArc(centerLoop, 2.*radius, 2.*radius, a1, angle); } else { out.drawLine((x0+BASE_RADIUS*vn.x), (y0+BASE_RADIUS*vn.y), (x1-BASE_RADIUS*vn.x), (y1-BASE_RADIUS*vn.y),1.0); } } } // Drawing bonds for (int i = 0; i < _listeBases.size(); i++) { if (_listeBases.get(i).getElementStructure() > i) { ModeleStyleBP style = _listeBases.get(i).getStyleBP(); if (style.isCanonical() || conf._drawnNonCanonicalBP) { Color bpcol = getBasePairColor(style, conf); out.setColor(bpcol); int j = _listeBases.get(i).getElementStructure(); x0 = coords[i].x; y0 = coords[i].y; x1 = coords[j].x; y1 = coords[j].y; dx = x1 - x0; dy = y1 - y0; norm = Math.sqrt(dx * dx + dy * dy); dx /= norm; dy /= norm; if (_drawMode == DRAW_MODE_CIRCULAR || _drawMode == DRAW_MODE_RADIATE || _drawMode == DRAW_MODE_NAVIEW) { drawBasePair(out, new Point2D.Double(x0, y0), new Point2D.Double(x1, y1), style, conf); } else if (_drawMode == DRAW_MODE_LINEAR) { double coef; double distance; if (j - i == 1) coef = _bpHeightIncrement * 2; else coef = _bpHeightIncrement * 1; distance = (int) Math.round(x1 - x0); out.drawArc(new Point2D.Double(x0, y0), distance, distance * coef, 0, 180); } } } } // Drawing additional bonds if (conf._drawnNonPlanarBP) { for (int i = 0; i < _structureAux.size(); i++) { ModeleStyleBP bp = _structureAux.get(i); out.setColor(getBasePairColor(bp, conf)); int a = bp.getPartner5().getIndex(); int b = bp.getPartner3().getIndex(); if (bp.isCanonical() || conf._drawnNonCanonicalBP) { x0 = coords[a].x; y0 = coords[a].y; x1 = coords[b].x; y1 = coords[b].y; dx = x1 - x0; dy = y1 - y0; norm = Math.sqrt(dx * dx + dy * dy); dx /= norm; dy /= norm; if ((_drawMode == DRAW_MODE_CIRCULAR) || (_drawMode == DRAW_MODE_RADIATE) || _drawMode == DRAW_MODE_NAVIEW) { drawBasePair(out, new Point2D.Double(x0, y0), new Point2D.Double(x1, y1), bp, conf); } else if (_drawMode == DRAW_MODE_LINEAR) { double coef; double distance; if (b - a == 1) coef = _bpHeightIncrement * 2; else coef = _bpHeightIncrement * 1; distance = (int) Math.round(x1 - x0); out.drawArc(new Point2D.Double(x0, y0), distance, distance * coef, 0, 180); } } } } // Drawing Bases double baseFontSize = (1.5 * BASE_RADIUS); out.setFont(PSExport.FONT_HELVETICA_BOLD, baseFontSize); if (conf._comparisonMode) { for (int i = 0; i < _listeBases.size(); i++) { x0 = coords[i].x; y0 = coords[i].y; out.fillCircle(x0, y0, BASE_RADIUS, 1l, getBaseInnerColor(i, conf)); out.setColor(getBaseOuterColor(i, conf)); out.drawCircle(x0, y0, BASE_RADIUS, 1l); out.setColor(getBaseNameColor(i, conf)); out.drawText(x0, y0, ((ModeleBasesComparison) _listeBases .get(i)).getBases()); } } else { for (int i = 0; i < _listeBases.size(); i++) { ModeleBase mb = _listeBases.get(i); x0 = coords[i].x; y0 = coords[i].y; if (conf._fillBase) { out.fillCircle(x0, y0, BASE_RADIUS, 1l, getBaseInnerColor(i, conf)); } if (conf._drawOutlineBase) { out.setColor(getBaseOuterColor(i, conf)); out.drawCircle(x0, y0, BASE_RADIUS, 1l); } out.setColor(getBaseNameColor(i, conf)); out.drawText(x0, y0, _listeBases.get(i).getContent()); } } // Drawing base numbers double numFontSize = (double) (1.5 * BASE_RADIUS); out.setFont(PSExport.FONT_HELVETICA_BOLD, numFontSize); for (int i = 0; i < _listeBases.size(); i++) { int basenum = _listeBases.get(i).getBaseNumber(); if (basenum == -1) { basenum = i + 1; } if (this.isNumberDrawn(_listeBases.get(i),conf._numPeriod)) { out.setColor(_listeBases.get(i).getStyleBase().get_base_number_color()); x0 = coords[i].x; y0 = coords[i].y; x1 = centers[i].x; y1 = centers[i].y; dx = x1 - x0; dy = y1 - y0; norm = Math.sqrt(dx * dx + dy * dy); dx /= norm; dy /= norm; out.drawLine((x0 - 1.5 * BASE_RADIUS * dx), (y0 - 1.5 * BASE_RADIUS * dy), (x0 - 2.5 * BASE_RADIUS * dx), (y0 - 2.5 * BASE_RADIUS * dy), 1); out.drawText((x0 - (conf._distNumbers+1.0) * BASE_RADIUS * dx), (y0 - (conf._distNumbers+1.0) * BASE_RADIUS * dy), "" + (basenum)); } } renderAnnotations(out, minX, minY,conf); // Draw color map if (conf._drawColorMap) { drawColorMap(conf, out); } // Drawing Title Rectangle2D.Double currentBBox = out.getBoundingBox(); double titleFontSize = (2.0*conf._titleFont.getSize()); out.setColor(conf._titleColor); out.setFont(PSExport.FONT_HELVETICA,titleFontSize); double yTitle = currentBBox.y-titleFontSize/2.0; if (!getName().equals("")) { out.drawText((maxX-minX)/2.0,yTitle, getName()); } else if (!conf._title.equals("")) { out.drawText((maxX-minX)/2.0,yTitle, getName()); } OutputStreamWriter fout; try { fout = new OutputStreamWriter(new FileOutputStream(path),"UTF-8"); fout.write(out.export()); fout.close(); } catch (IOException e) { throw new ExceptionWritingForbidden(e.getMessage()); } } Point2D.Double buildCaptionPosition(ModeleBase mb, double heightEstimate, VARNAConfig conf) { double radius = 2.0; if (isNumberDrawn(mb,conf._numPeriod)) { radius += (conf._distNumbers+1.0); } Point2D.Double center = mb.getCenter(); Point2D.Double p = mb.getCoords(); double realDistance = BASE_RADIUS*radius + heightEstimate; return new Point2D.Double(center.getX() + (p.getX() - center.getX()) * ((p.distance(center) + realDistance) / p .distance(center)), center.getY() + (p.getY() - center.getY()) * ((p.distance(center) + realDistance) / p .distance(center)) ); } public double getBPHeightIncrement() { return this._bpHeightIncrement; } public void setBPHeightIncrement(double d) { _bpHeightIncrement = d; } public static double CHEM_PROB_ARROW_THICKNESS = 2.0; private void drawChemProbAnnotation(SecStrDrawingProducer out, ChemProbAnnotation cpa, Point2D.Double anchor, double minX, double minY) { out.setColor(cpa.getColor()); Point2D.Double v = cpa.getDirVector(); Point2D.Double vn = cpa.getNormalVector(); Point2D.Double base = new Point2D.Double((anchor.x+CHEM_PROB_DIST*v.x),(anchor.y+CHEM_PROB_DIST*v.y)); Point2D.Double edge = new Point2D.Double((base.x+CHEM_PROB_BASE_LENGTH*cpa.getIntensity()*v.x),(base.y+CHEM_PROB_BASE_LENGTH*cpa.getIntensity()*v.y)); double thickness = CHEM_PROB_ARROW_THICKNESS*cpa.getIntensity(); switch (cpa.getType()) { case ARROW_TYPE: { Point2D.Double arrowTip1 = new Point2D.Double((base.x+cpa.getIntensity()*(CHEM_PROB_ARROW_WIDTH*vn.x+CHEM_PROB_ARROW_HEIGHT*v.x)), (base.y+cpa.getIntensity()*(CHEM_PROB_ARROW_WIDTH*vn.y+CHEM_PROB_ARROW_HEIGHT*v.y))); Point2D.Double arrowTip2 = new Point2D.Double((base.x+cpa.getIntensity()*(-CHEM_PROB_ARROW_WIDTH*vn.x+CHEM_PROB_ARROW_HEIGHT*v.x)), (base.y+cpa.getIntensity()*(-CHEM_PROB_ARROW_WIDTH*vn.y+CHEM_PROB_ARROW_HEIGHT*v.y))); out.drawLine(base.x-minX,minY-base.y,edge.x-minX,minY-edge.y,thickness); out.drawLine(base.x-minX,minY-base.y,arrowTip1.x-minX,minY-arrowTip1.y,thickness); out.drawLine(base.x-minX,minY-base.y,arrowTip2.x-minX,minY-arrowTip2.y,thickness); } break; case PIN_TYPE: { Point2D.Double side1 = new Point2D.Double((edge.x-cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*v.x)), (edge.y-cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*v.y))); Point2D.Double side2 = new Point2D.Double((edge.x-cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*vn.x)), (edge.y-cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*vn.y))); Point2D.Double side3 = new Point2D.Double((edge.x+cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*v.x)), (edge.y+cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*v.y))); Point2D.Double side4 = new Point2D.Double((edge.x+cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*vn.x)), (edge.y+cpa.getIntensity()*(CHEM_PROB_PIN_SEMIDIAG*vn.y))); GeneralPath p2 = new GeneralPath(); p2.moveTo((float)(side1.x-minX),(float)(minY-side1.y)); p2.lineTo((float)(side2.x-minX),(float)(minY-side2.y)); p2.lineTo((float)(side3.x-minX),(float)(minY-side3.y)); p2.lineTo((float)(side4.x-minX),(float)(minY-side4.y)); p2.closePath(); out.fillPolygon(p2, cpa.getColor()); out.drawLine(base.x-minX,minY-base.y,edge.x-minX,minY-edge.y,thickness); } break; case TRIANGLE_TYPE: { Point2D.Double arrowTip1 = new Point2D.Double((edge.x+cpa.getIntensity()*(CHEM_PROB_TRIANGLE_WIDTH*vn.x)), (edge.y+cpa.getIntensity()*(CHEM_PROB_TRIANGLE_WIDTH*vn.y))); Point2D.Double arrowTip2 = new Point2D.Double((edge.x+cpa.getIntensity()*(-CHEM_PROB_TRIANGLE_WIDTH*vn.x)), (edge.y+cpa.getIntensity()*(-CHEM_PROB_TRIANGLE_WIDTH*vn.y))); GeneralPath p2 = new GeneralPath(); p2.moveTo((float)(base.x-minX),(float)(minY-base.y)); p2.lineTo((float)(arrowTip1.x-minX),(float)(minY-arrowTip1.y)); p2.lineTo((float)(arrowTip2.x-minX),(float)(minY-arrowTip2.y)); p2.closePath(); out.fillPolygon(p2, cpa.getColor()); } break; case DOT_TYPE: { Double radius = CHEM_PROB_DOT_RADIUS*cpa.getIntensity(); Point2D.Double center = new Point2D.Double((base.x+radius*v.x)-minX,minY-(base.y+radius*v.y)); out.fillCircle(center.x, center.y, radius, thickness, cpa.getColor()); } break; } } private void renderAnnotations(SecStrDrawingProducer out, double minX, double minY, VARNAConfig conf) { for (TextAnnotation textAnnotation : getAnnotations()) { out.setColor(textAnnotation.getColor()); out.setFont(PSExport.FONT_HELVETICA_BOLD,2.0*textAnnotation.getFont().getSize()); Point2D.Double position = textAnnotation.getCenterPosition(); if (textAnnotation.getType()==TextAnnotation.BASE) { ModeleBase mb = (ModeleBase) textAnnotation.getAncrage(); double fontHeight = Math.ceil(textAnnotation.getFont().getSize()); position = buildCaptionPosition(mb,fontHeight,conf); } out.drawText(position.x-minX,-(position.y-minY), textAnnotation.getTexte()); } for (ChemProbAnnotation cpa : getChemProbAnnotations()) { Point2D.Double anchor = cpa.getAnchorPosition(); drawChemProbAnnotation(out,cpa,anchor,minX,minY); } } public boolean isNumberDrawn(ModeleBase mb, int numPeriod) { if (numPeriod <= 0 ) return false; return ((mb.getIndex() == 0) || ((mb.getBaseNumber()) % numPeriod == 0) || (mb.getIndex() == get_listeBases().size() - 1)); } public void saveRNAEPS(String path, VARNAConfig conf) throws ExceptionWritingForbidden { PSExport out = new PSExport(); saveRNA(path, conf, 0.4, out); } public void saveRNAXFIG(String path, VARNAConfig conf) throws ExceptionWritingForbidden { XFIGExport out = new XFIGExport(); saveRNA(path, conf, 20, out); } public void saveRNASVG(String path, VARNAConfig conf) throws ExceptionWritingForbidden { SVGExport out = new SVGExport(); saveRNA(path, conf, 0.5, out); } public Rectangle2D.Double getBBox() { Rectangle2D.Double result = new Rectangle2D.Double(10, 10, 10, 10); double minx, maxx, miny, maxy; minx = Double.MAX_VALUE; miny = Double.MAX_VALUE; maxx = -Double.MAX_VALUE; maxy = -Double.MAX_VALUE; for (int i = 0; i < _listeBases.size(); i++) { minx = Math.min(_listeBases.get(i).getCoords().getX() - BASE_RADIUS, minx); miny = Math.min(_listeBases.get(i).getCoords().getY() - BASE_RADIUS, miny); maxx = Math.max(_listeBases.get(i).getCoords().getX() + BASE_RADIUS, maxx); maxy = Math.max(_listeBases.get(i).getCoords().getY() + BASE_RADIUS, maxy); } result.x = minx; result.y = miny; result.width = Math.max(maxx - minx,1); result.height = Math.max(maxy - miny,1); if (_drawMode==RNA.DRAW_MODE_LINEAR) { double realHeight = _bpHeightIncrement*result.width/2.0; result.height += realHeight; result.y -= realHeight; } return result; } public void setCoord(int index, Point2D.Double p) { setCoord(index, p.x, p.y); } public void setCoord(int index, double x, double y) { if (index < _listeBases.size()) { _listeBases.get(index).setCoords(new Point2D.Double(x, y)); } } public Point2D.Double getCoords(int i) { if (i < _listeBases.size() && i >= 0) { return _listeBases.get(i).getCoords(); } return new Point2D.Double(); } public String getBaseContent(int i) { if ((i>=0)&&(i < _listeBases.size())) { return _listeBases.get(i).getContent(); } return ""; } public int getBaseNumber(int i) { if ((i>=0)&&(i < _listeBases.size())) { return _listeBases.get(i).getBaseNumber(); } return -1; } public Point2D.Double getCenter(int i) { if (i < _listeBases.size()) { return _listeBases.get(i).getCenter(); } return new Point2D.Double(); } public void setCenter(int i, double x, double y) { setCenter(i, new Point2D.Double(x,y)); } public void setCenter(int i, Point2D.Double p) { if (i < _listeBases.size()) { _listeBases.get(i).setCenter(p); } } public void drawRNACircle() { _drawn = true; _drawMode = DRAW_MODE_CIRCULAR; int radius = (int) ((3 * (_listeBases.size() + 1) * BASE_RADIUS) / (2 * Math.PI)); double angle; for (int i = 0; i < _listeBases.size(); i++) { angle = -((((double) -(i + 1)) * 2.0 * Math.PI) / ((double) (_listeBases.size() + 1)) - Math.PI / 2.0); _listeBases.get(i).setCoords( new Point2D.Double( (radius * Math.cos(angle) * _spaceBetweenBases), (radius * Math.sin(angle) * _spaceBetweenBases))); _listeBases.get(i).setCenter(new Point2D.Double(0, 0)); } } public void drawRNAVARNAView() { _drawn = true; _drawMode = DRAW_MODE_VARNA_VIEW; VARNASecDraw vs = new VARNASecDraw(); vs.drawRNA(1, this); } public void drawRNALine() { _drawn = true; _drawMode = DRAW_MODE_LINEAR; for (int i = 0; i < get_listeBases().size(); i++) { get_listeBases().get(i).setCoords( new Point2D.Double(i * _spaceBetweenBases * 20, 0)); get_listeBases().get(i).setCenter( new Point2D.Double(i * _spaceBetweenBases * 20, -10)); } } /** * IN: Argument helixEndPoint is an IN argument (will be read), * and must contain an helix edge endpoint. * * The other arguments are OUT arguments * (must be existing objects, content will be overwritten). * * OUT: The i argument will contain a vector colinear to the vector * from the helix startPosition to endPosition or the opposite * depending on there the endpoint is (the endpoint will be on the * destination side of the vector). ||i|| = 1 * * OUT: The j vector will contain an vector that is colinear * to the last/first base pair connection on the side of this endpoint. * The vector will be oriented to the side of the given endpoint. * ||j|| = 1 */ private void computeHelixEndPointDirections( EdgeEndPoint helixEndPoint, // IN Point2D.Double i, // OUT Point2D.Double j // OUT ) { RNATemplateHelix helix = (RNATemplateHelix) helixEndPoint.getElement(); Point2D.Double startpos = helix.getStartPosition(); Point2D.Double endpos = helix.getEndPosition(); Point2D.Double helixVector = new Point2D.Double(); switch (helixEndPoint.getPosition()) { case IN1: case OUT2: helixVector.x = startpos.x - endpos.x; helixVector.y = startpos.y - endpos.y; break; case IN2: case OUT1: helixVector.x = endpos.x - startpos.x; helixVector.y = endpos.y - startpos.y; break; } double helixVectorLength = Math.hypot(helixVector.x, helixVector.y); // i is the vector which is colinear to helixVector and such that ||i|| = 1 i.x = helixVector.x / helixVectorLength; i.y = helixVector.y / helixVectorLength; // Find j such that it is orthogonal to i, ||j|| = 1 // and j goes to the side where the sequence will be connected switch (helixEndPoint.getPosition()) { case IN1: case IN2: // rotation of +pi/2 j.x = - i.y; j.y = i.x; break; case OUT1: case OUT2: // rotation of -pi/2 j.x = i.y; j.y = - i.x; break; } if (helix.isFlipped()) { j.x = - j.x; j.y = - j.y; } } /** * A cubic Bezier curve can be defined by 4 points, * see http://en.wikipedia.org/wiki/Bezier_curve#Cubic_B.C3.A9zier_curves * For each of the curve end points, there is the last/first point of the * curve and a point which gives the direction and length of the tangent * vector on that side. This two points are respectively curveEndPoint * and curveVectorOtherPoint. * IN: Argument helixVector is the vector formed by the helix, * in the right direction for our sequence. * IN: Argument curveEndPoint is the position of the endpoint on the helix. * OUT: Argument curveVectorOtherPoint must be allocated * and the values will be modified. */ private void computeBezierTangentVectorTarget( EdgeEndPoint endPoint, Point2D.Double curveEndPoint, Point2D.Double curveVectorOtherPoint) throws RNATemplateDrawingAlgorithmException { boolean sequenceEndPointIsIn; RNATemplateUnpairedSequence sequence; if (endPoint.getElement() instanceof RNATemplateHelix) { sequence = (RNATemplateUnpairedSequence) endPoint.getOtherElement(); EdgeEndPointPosition endPointPositionOnHelix = endPoint.getPosition(); switch (endPointPositionOnHelix) { case IN1: case IN2: sequenceEndPointIsIn = false; break; default: sequenceEndPointIsIn = true; } EdgeEndPoint endPointOnHelix = sequenceEndPointIsIn ? sequence.getIn().getOtherEndPoint() : sequence.getOut().getOtherEndPoint(); if (endPointOnHelix == null) { throw (new RNATemplateDrawingAlgorithmException("Sequence is not connected to an helix.")); } } else { // The endpoint is on an unpaired sequence. sequence = (RNATemplateUnpairedSequence) endPoint.getElement(); if (endPoint == sequence.getIn()) { // endpoint is 5' sequenceEndPointIsIn = true; } else { sequenceEndPointIsIn = false; } } double l = sequenceEndPointIsIn ? sequence.getInTangentVectorLength() : sequence.getOutTangentVectorLength(); // Compute the absolute angle our line makes to the helix double theta = sequenceEndPointIsIn ? sequence.getInTangentVectorAngle() : sequence.getOutTangentVectorAngle(); // Compute v, the tangent vector of the Bezier curve Point2D.Double v = new Point2D.Double(); v.x = l * Math.cos(theta); v.y = l * Math.sin(theta); curveVectorOtherPoint.x = curveEndPoint.x + v.x; curveVectorOtherPoint.y = curveEndPoint.y + v.y; } /** * Compute the angle made by a vector. */ private static double angleFromVector(Point2D.Double v) { double l = Math.hypot(v.x, v.y); if (v.y > 0) { return Math.acos(v.x / l); } else if (v.y < 0) { return - Math.acos(v.x / l); } else { return v.x > 0 ? 0 : Math.PI; } } private static double angleFromVector(double x, double y) { return angleFromVector(new Point2D.Double(x, y)); } /** * Compute (actual helix length / helix length in template). */ private double computeLengthIncreaseFactor( int[] basesInHelixArray, // IN RNATemplateHelix helix // IN ) { int n = basesInHelixArray.length / 2; Point2D.Double startpos, endpos; if (helix.getIn1Is() == In1Is.IN1_IS_5PRIME) { startpos = helix.getStartPosition(); endpos = helix.getEndPosition(); } else { endpos = helix.getStartPosition(); startpos = helix.getEndPosition(); } Point2D.Double i = new Point2D.Double(); i.x = (endpos.x - startpos.x); i.y = (endpos.y - startpos.y); double i_original_norm = Math.hypot(i.x, i.y); return (LOOP_DISTANCE * (n-1)) / i_original_norm; } /** * Compute (actual helix vector - helix vector in template). */ private Point2D.Double computeLengthIncreaseDelta( int[] basesInHelixArray, // IN RNATemplateHelix helix // IN ) { int n = basesInHelixArray.length / 2; Point2D.Double startpos, endpos; if (helix.getIn1Is() == In1Is.IN1_IS_5PRIME) { startpos = helix.getStartPosition(); endpos = helix.getEndPosition(); } else { endpos = helix.getStartPosition(); startpos = helix.getEndPosition(); } Point2D.Double originalVector = new Point2D.Double(); originalVector.x = (endpos.x - startpos.x); originalVector.y = (endpos.y - startpos.y); double originalLength = Math.hypot(originalVector.x, originalVector.y); Point2D.Double u = new Point2D.Double(originalVector.x/originalLength, originalVector.y/originalLength); double actualLength = n>0 ? (LOOP_DISTANCE * (n-1)) : 0; Point2D.Double actualVector = new Point2D.Double(u.x*actualLength, u.y*actualLength); return new Point2D.Double(actualVector.x-originalVector.x, actualVector.y-originalVector.y); } /** * Draw the given helix (given as a *sorted* array of indexes) * like defined in the given template helix. * OUT: The bases positions are not changed in fact, * instead the coords and centers arrays are modified. * IN: The helix origin position is multiplied by scaleHelixOrigin. * */ private void drawHelixLikeTemplateHelix( int[] basesInHelixArray, // IN RNATemplateHelix helix, // IN Point2D.Double[] coords, // OUT Point2D.Double[] centers, // OUT double scaleHelixOrigin, // IN Map translateVectors // IN ) { int n = basesInHelixArray.length / 2; Point2D.Double startpos, endpos; if (helix.getIn1Is() == In1Is.IN1_IS_5PRIME) { startpos = helix.getStartPosition(); endpos = helix.getEndPosition(); } else { endpos = helix.getStartPosition(); startpos = helix.getEndPosition(); } // (i_x,i_y) is the vector between two consecutive bases // of the same side of an helix Point2D.Double i = new Point2D.Double(); i.x = (endpos.x - startpos.x); i.y = (endpos.y - startpos.y); double i_original_norm = Math.hypot(i.x, i.y); // change (i_x,i_y) so that its norm is 1 i.x = i.x / i_original_norm * LOOP_DISTANCE; i.y = i.y / i_original_norm * LOOP_DISTANCE; Point2D.Double j = new Point2D.Double(); j.x = - i.y; j.y = i.x; if (helix.isFlipped()) { j.x = - j.x; j.y = - j.y; } double j_original_norm = Math.hypot(j.x, j.y); // change (j_x,j_y) so that its norm is 1 j.x = j.x / j_original_norm; j.y = j.y / j_original_norm; Point2D.Double o = new Point2D.Double(); o.x = (startpos.x - j.x * BASE_PAIR_DISTANCE / 2) * scaleHelixOrigin; o.y = (startpos.y - j.y * BASE_PAIR_DISTANCE / 2) * scaleHelixOrigin; if (translateVectors != null && translateVectors.containsKey(helix)) { Point2D.Double v = translateVectors.get(helix); o.x = o.x + v.x; o.y = o.y + v.y; } for (int k=0; k= n) { v.x = j.x; v.y = j.y; } else { v.x = - j.x; v.y = - j.y; } Point2D.Double loopCenter = new Point2D.Double(); loopCenter.x = (b1pos.x + b2pos.x)/2 + v.x * LOOP_DISTANCE; loopCenter.y = (b1pos.y + b2pos.y)/2 + v.y * LOOP_DISTANCE; drawLoop(b1+1, b2-1, loopCenter.x, loopCenter.y, angleFromVector(v), coords, centers); // If the helix is flipped, we need to compute the symmetric // of the whole loop. if (helix.isFlipped()) { int from = b1+1; int to = b2-1; Point2D.Double[] points1 = new Point2D.Double[to-from+1]; Point2D.Double[] points2 = new Point2D.Double[to-from+1]; for (int b=from; b<=to; b++) { // This is an assignment by reference. points1[b-from] = coords[b]; points2[b-from] = centers[b]; } symmetric(loopCenter, v, points1); symmetric(loopCenter, v, points2); } } } } /** * A Bezier curve can be defined by four points, * see http://en.wikipedia.org/wiki/Bezier_curve#Cubic_B.C3.A9zier_curves * Here we give this four points and an array of bases indexes * (which must be indexes in this RNA sequence) which will be moved * to be on the Bezier curve. * The bases positions are not changed in fact, instead the coords and * centers arrays are modified. */ private void drawOnBezierCurve(int[] basesInSequence, Point2D.Double P0, Point2D.Double P1, Point2D.Double P2, Point2D.Double P3, Point2D.Double[] coords, Point2D.Double[] centers) { // Draw the bases of the sequence along a Bezier curve int n = basesInSequence.length; // We choose to approximate the Bezier curve by 10*n straight lines. CubicBezierCurve bezier = new CubicBezierCurve(P0, P1, P2, P3, 10*n); double curveLength = bezier.getApproxCurveLength(); double delta_t = curveLength / (n+1); double[] t = new double[n]; for (int k=0; k alongBezierCurve = new ArrayList(); for (int depth=0, i=firstBase; i<=lastBase; i++) { int k = _listeBases.get(i).getElementStructure(); if (k < 0 || k > lastBase || k < firstBase) { if (depth == 0) { alongBezierCurve.add(i); } } else { if (i < k) { if (depth == 0) { alongBezierCurve.add(i); alongBezierCurve.add(k); } depth++; } else { depth--; } } } // number of bases along the Bezier curve int n = alongBezierCurve.size(); int[] alongBezierCurveArray = RNATemplateAlign.intArrayFromList(alongBezierCurve); if (n > 0) { if (P1 != null && P2 != null) { drawOnBezierCurve(alongBezierCurveArray, P0, P1, P2, P3, coords, centers); } else { drawOnStraightLine(alongBezierCurveArray, P0, P3, coords, centers); } } // Now use the radiate algorithm to draw the helixes for (int k=0; k tree, // IN Map translateVectors, // OUT (must be initialized) RNATemplateMapping mapping, // IN Point2D.Double parentDeltaVector // IN ) { RNANodeValueTemplate nvt = tree.getValue(); Point2D.Double newDeltaVector = parentDeltaVector; if (nvt instanceof RNANodeValueTemplateBasePair) { RNATemplateHelix helix = ((RNANodeValueTemplateBasePair) nvt).getHelix(); if (! translateVectors.containsKey(helix)) { translateVectors.put(helix, parentDeltaVector); int[] basesInHelixArray; if (mapping.getAncestor(helix) != null) { basesInHelixArray = RNATemplateAlign.intArrayFromList(mapping.getAncestor(helix)); } else { basesInHelixArray = new int[0]; } Point2D.Double helixDeltaVector = computeLengthIncreaseDelta(basesInHelixArray, helix); newDeltaVector = new Point2D.Double(parentDeltaVector.x+helixDeltaVector.x, parentDeltaVector.y+helixDeltaVector.y); } } for (Tree subtree: tree.getChildren()) { computeHelixTranslations(subtree, translateVectors, mapping, newDeltaVector); } } private Map computeHelixTranslations( Tree tree, // IN RNATemplateMapping mapping // IN ) { Map translateVectors = new HashMap(); computeHelixTranslations(tree, translateVectors, mapping, new Point2D.Double(0,0)); return translateVectors; } /** * Same as below, with default helixLengthAdjustmentMethod. */ public RNATemplateMapping drawRNATemplate(RNATemplate template) throws RNATemplateDrawingAlgorithmException { return drawRNATemplate(template, DrawRNATemplateMethod.NOADJUST); } /** * What to do in case some helices are of a different length * in the template and the actual helix. * Possibles values are: * 0 - No adjustment is done. * A longer than expected helix might bump into an other helix. * 1 - Scaling factors (actual length / template length) are calculated, * the maximum scaling factor L is extracted, then all helix positions * are multiplied by L. * 2 - Same as 1, but L is computed as the minimum value such that there * are no backbone intersections. */ public static class DrawRNATemplateMethod { public static int NOADJUST = 0; public static int MAXSCALINGFACTOR = 1; public static int NOINTERSECT = 2; public static int HELIXTRANSLATE = 3; } /** * Draw this RNA like the given template. * The helixLengthAdjustmentMethod argument tells what to do in case * some helices are of a different length in the template and the * actual helix. See class DrawRNATemplateMethod above for possible values. */ public RNATemplateMapping drawRNATemplate( RNATemplate template, int helixLengthAdjustmentMethod) throws RNATemplateDrawingAlgorithmException { _drawn = true; _drawMode = DRAW_MODE_TEMPLATE; // debug // try { // RNA perfectMatchingRNA = template.toRNA(); // System.out.println("An RNA that would perfectly match this template would be:"); // System.out.println(perfectMatchingRNA.getStructDBN()); // } catch (ExceptionInvalidRNATemplate e) { // e.printStackTrace(); // } RNATemplateMapping mapping = RNATemplateAlign.mapRNAWithTemplate(this, template); System.out.println(mapping.showCompact(this)); // debug // RNATemplateAlign.printMapping(mapping, template, getSeq()); // try { // TreeGraphviz.treeToGraphvizPostscript(alignment, "alignment_graphviz.ps"); // } catch (IOException e) { // e.printStackTrace(); // } Iterator iter; double globalIncreaseFactor = 1; Map translateVectors = null; if (helixLengthAdjustmentMethod == DrawRNATemplateMethod.MAXSCALINGFACTOR) { // Compute increase factors for helices. Map lengthIncreaseFactor = new HashMap(); double maxLengthIncreaseFactor = Double.NEGATIVE_INFINITY; RNATemplateHelix maxIncreaseHelix = null; iter = template.rnaIterator(); while (iter.hasNext()) { RNATemplateElement element = iter.next(); if (element instanceof RNATemplateHelix && mapping.getAncestor(element) != null && !lengthIncreaseFactor.containsKey(element)) { RNATemplateHelix helix = (RNATemplateHelix) element; int[] basesInHelixArray = RNATemplateAlign.intArrayFromList(mapping.getAncestor(helix)); double l = computeLengthIncreaseFactor(basesInHelixArray, helix); lengthIncreaseFactor.put(helix, l); if (l > maxLengthIncreaseFactor) { maxLengthIncreaseFactor = l; maxIncreaseHelix = helix; } } } // debug System.out.println("Max helix length increase factor = " + maxLengthIncreaseFactor + " reached with helix " + maxIncreaseHelix);; globalIncreaseFactor = Math.max(1, maxLengthIncreaseFactor); } else if (helixLengthAdjustmentMethod == DrawRNATemplateMethod.HELIXTRANSLATE) { try { // Now we need to propagate this helices translations Tree templateAsTree = template.toTree(); translateVectors = computeHelixTranslations(templateAsTree, mapping); } catch (ExceptionInvalidRNATemplate e) { throw (new RNATemplateDrawingAlgorithmException("ExceptionInvalidRNATemplate: " + e.getMessage())); } } // Allocate the coords and centers arrays // We create Point2D.Double objects in it but the algorithms // we use may choose to create new Point2D.Double objects or to // modify those created here. Point2D.Double[] coords = new Point2D.Double[_listeBases.size()]; Point2D.Double[] centers = new Point2D.Double[_listeBases.size()]; for (int i = 0; i < _listeBases.size(); i++) { coords[i] = new Point2D.Double(0, 0); centers[i] = new Point2D.Double(0, 0); } boolean computeCoords = true; while (computeCoords) { computeCoords = false; // Compute coords and centers Set alreadyDrawnHelixes = new HashSet(); RNATemplateHelix lastMappedHelix = null; EdgeEndPoint howWeGotOutOfLastHelix = null; int howWeGotOutOfLastHelixBaseIndex = 0; iter = template.rnaIterator(); RNATemplateElement element = null; while (iter.hasNext()) { element = iter.next(); if (element instanceof RNATemplateHelix && mapping.getAncestor(element) != null) { // We have a mapping between an helix in the RNA sequence // and an helix in the template. RNATemplateHelix helix = (RNATemplateHelix) element; boolean firstTimeWeMeetThisHelix; int[] basesInHelixArray = RNATemplateAlign.intArrayFromList(mapping.getAncestor(helix)); Arrays.sort(basesInHelixArray); // Draw this helix if it has not already been done if (!alreadyDrawnHelixes.contains(helix)) { firstTimeWeMeetThisHelix = true; drawHelixLikeTemplateHelix(basesInHelixArray, helix, coords, centers, globalIncreaseFactor, translateVectors); alreadyDrawnHelixes.add(helix); } else { firstTimeWeMeetThisHelix = false; } EdgeEndPoint howWeGetInCurrentHelix; if (firstTimeWeMeetThisHelix) { if (helix.getIn1Is() == In1Is.IN1_IS_5PRIME) { howWeGetInCurrentHelix = helix.getIn1(); } else { howWeGetInCurrentHelix = helix.getIn2(); } } else { if (helix.getIn1Is() == In1Is.IN1_IS_5PRIME) { howWeGetInCurrentHelix = helix.getIn2(); } else { howWeGetInCurrentHelix = helix.getIn1(); } } Point2D.Double P0 = new Point2D.Double(); Point2D.Double P3 = new Point2D.Double(); if (lastMappedHelix != null) { // Now draw the RNA sequence (possibly containing helixes) // between the last template drawn helix and this one. if (lastMappedHelix == helix) { // Last helix is the same as the current one so // nothing matched (or at best a single // non-paired sequence) so we will just // use the Radiate algorithm Point2D.Double helixVector = new Point2D.Double(); computeHelixEndPointDirections(howWeGotOutOfLastHelix, helixVector, new Point2D.Double()); double angle = angleFromVector(helixVector); int b1 = basesInHelixArray[basesInHelixArray.length/2 - 1]; P0.setLocation(coords[b1]); int b2 = basesInHelixArray[basesInHelixArray.length/2]; P3.setLocation(coords[b2]); Point2D.Double loopCenter = new Point2D.Double((P0.x + P3.x)/2, (P0.y + P3.y)/2); drawLoop(b1, b2, loopCenter.x, loopCenter.y, angle, coords, centers); // If the helix is flipped, we need to compute the symmetric // of the whole loop. if (helix.isFlipped()) { Point2D.Double[] points1 = new Point2D.Double[b2-b1+1]; Point2D.Double[] points2 = new Point2D.Double[b2-b1+1]; for (int b=b1; b<=b2; b++) { // This is an assignment by reference. points1[b-b1] = coords[b]; points2[b-b1] = centers[b]; } symmetric(loopCenter, helixVector, points1); symmetric(loopCenter, helixVector, points2); } } else { // No helices matched between the last helix and // the current one, so we draw what is between // using the radiate algorithm but on the Bezier curve. int b1 = howWeGotOutOfLastHelixBaseIndex; int b2 = firstTimeWeMeetThisHelix ? basesInHelixArray[0] : basesInHelixArray[basesInHelixArray.length/2]; P0.setLocation(coords[b1]); P3.setLocation(coords[b2]); Point2D.Double P1, P2; if (howWeGotOutOfLastHelix.getOtherElement() instanceof RNATemplateUnpairedSequence && howWeGetInCurrentHelix.getOtherElement() instanceof RNATemplateUnpairedSequence) { // We will draw the bases on a Bezier curve P1 = new Point2D.Double(); computeBezierTangentVectorTarget(howWeGotOutOfLastHelix, P0, P1); P2 = new Point2D.Double(); computeBezierTangentVectorTarget(howWeGetInCurrentHelix, P3, P2); } else { // We will draw the bases on a straight line between P0 and P3 P1 = null; P2 = null; } drawAlongCurve(b1+1, b2-1, P0, P1, P2, P3, coords, centers); } } else if (basesInHelixArray[0] > 0) { // Here we draw what is before the first mapped helix. RNATemplateUnpairedSequence templateSequence; // Try to find our template sequence as the mapped element of base 0 RNATemplateElement templateSequenceCandidate = mapping.getPartner(0); if (templateSequenceCandidate != null && templateSequenceCandidate instanceof RNATemplateUnpairedSequence) { templateSequence = (RNATemplateUnpairedSequence) templateSequenceCandidate; } else { // Try other idea: first template element if it is a sequence templateSequenceCandidate = template.getFirst(); if (templateSequenceCandidate != null && templateSequenceCandidate instanceof RNATemplateUnpairedSequence) { templateSequence = (RNATemplateUnpairedSequence) templateSequenceCandidate; } else { // We don't know where to start templateSequence = null; } } if (templateSequence != null) { coords[0].setLocation(templateSequence.getVertex5()); coords[0].x *= globalIncreaseFactor; coords[0].y *= globalIncreaseFactor; } int b1 = 0; int b2 = firstTimeWeMeetThisHelix ? basesInHelixArray[0] : basesInHelixArray[basesInHelixArray.length/2]; P0.setLocation(coords[b1]); P3.setLocation(coords[b2]); Point2D.Double P1, P2; if (howWeGetInCurrentHelix.getOtherElement() instanceof RNATemplateUnpairedSequence && templateSequence != null) { // We will draw the bases on a Bezier curve P1 = new Point2D.Double(); computeBezierTangentVectorTarget(templateSequence.getIn(), P0, P1); P2 = new Point2D.Double(); computeBezierTangentVectorTarget(howWeGetInCurrentHelix, P3, P2); } else { // We will draw the bases on a straight line between P0 and P3 P1 = null; P2 = null; } drawAlongCurve(b1, b2-1, P0, P1, P2, P3, coords, centers); } lastMappedHelix = helix; howWeGotOutOfLastHelix = howWeGetInCurrentHelix.getNextEndPoint(); if (firstTimeWeMeetThisHelix) { howWeGotOutOfLastHelixBaseIndex = basesInHelixArray[basesInHelixArray.length/2-1]; } else { howWeGotOutOfLastHelixBaseIndex = basesInHelixArray[basesInHelixArray.length-1]; } } } // end template iteration // Now we need to draw what is after the last mapped helix. if (howWeGotOutOfLastHelixBaseIndex < coords.length-1 && element != null && coords.length > 1) { RNATemplateUnpairedSequence beginTemplateSequence = null; if (lastMappedHelix == null) { // No helix at all matched between the template and RNA! // So the sequence we want to draw is the full RNA. // Try to find our template sequence as the mapped element of base 0 RNATemplateElement templateSequenceCandidate = mapping.getPartner(0); if (templateSequenceCandidate != null && templateSequenceCandidate instanceof RNATemplateUnpairedSequence) { beginTemplateSequence = (RNATemplateUnpairedSequence) templateSequenceCandidate; } else { // Try other idea: first template element if it is a sequence templateSequenceCandidate = template.getFirst(); if (templateSequenceCandidate != null && templateSequenceCandidate instanceof RNATemplateUnpairedSequence) { beginTemplateSequence = (RNATemplateUnpairedSequence) templateSequenceCandidate; } else { // We don't know where to start beginTemplateSequence = null; } } if (beginTemplateSequence != null) { coords[0].setLocation(beginTemplateSequence.getVertex5()); coords[0].x *= globalIncreaseFactor; coords[0].y *= globalIncreaseFactor; } } RNATemplateUnpairedSequence endTemplateSequence; // Try to find our template sequence as the mapped element of last base RNATemplateElement templateSequenceCandidate = mapping.getPartner(coords.length-1); if (templateSequenceCandidate != null && templateSequenceCandidate instanceof RNATemplateUnpairedSequence) { endTemplateSequence = (RNATemplateUnpairedSequence) templateSequenceCandidate; } else { // Try other idea: last template element if it is a sequence templateSequenceCandidate = element; if (templateSequenceCandidate != null && templateSequenceCandidate instanceof RNATemplateUnpairedSequence) { endTemplateSequence = (RNATemplateUnpairedSequence) templateSequenceCandidate; } else { // We don't know where to end endTemplateSequence = null; } } if (endTemplateSequence != null) { coords[coords.length-1].setLocation(endTemplateSequence.getVertex3()); coords[coords.length-1].x *= globalIncreaseFactor; coords[coords.length-1].y *= globalIncreaseFactor; } if (lastMappedHelix == null && beginTemplateSequence == null && endTemplateSequence == null) { // We are extremely unlucky, as we haven't mapped // any helix not any half-unpaired sequence from the template! // Set last base position at something different // than (0,0) to prevent all bases to be drawn at (0,0). coords[coords.length-1].setLocation(1000, 1000); } Point2D.Double P0 = new Point2D.Double(); Point2D.Double P3 = new Point2D.Double(); int b1 = howWeGotOutOfLastHelixBaseIndex; int b2 = coords.length - 1; P0.setLocation(coords[b1]); P3.setLocation(coords[b2]); Point2D.Double P1, P2; if (howWeGotOutOfLastHelix != null && howWeGotOutOfLastHelix.getOtherElement() instanceof RNATemplateUnpairedSequence && endTemplateSequence != null) { // We will draw the bases on a Bezier curve P1 = new Point2D.Double(); computeBezierTangentVectorTarget(howWeGotOutOfLastHelix, P0, P1); P2 = new Point2D.Double(); computeBezierTangentVectorTarget(endTemplateSequence.getOut(), P3, P2); } else if (lastMappedHelix == null && beginTemplateSequence != null && endTemplateSequence != null) { // We will draw the bases on a Bezier curve P1 = new Point2D.Double(); computeBezierTangentVectorTarget(beginTemplateSequence.getIn(), P0, P1); P2 = new Point2D.Double(); computeBezierTangentVectorTarget(endTemplateSequence.getOut(), P3, P2); } else { // We will draw the bases on a straight line between P0 and P3 P1 = null; P2 = null; } drawAlongCurve((lastMappedHelix != null ? b1+1 : b1), b2, P0, P1, P2, P3, coords, centers); } if (helixLengthAdjustmentMethod == DrawRNATemplateMethod.NOINTERSECT && coords.length > 3) { // Are we happy with this value of globalIncreaseFactor? Line2D.Double[] lines = new Line2D.Double[coords.length-1]; for (int i=0; i 0) { // Don't increase more than a maximum value if (globalIncreaseFactor < 3) { globalIncreaseFactor += 0.1; System.out.println("globalIncreaseFactor increased to " + globalIncreaseFactor); // Compute the drawing again computeCoords = true; } } } } // debug if (helixLengthAdjustmentMethod == DrawRNATemplateMethod.MAXSCALINGFACTOR || helixLengthAdjustmentMethod == DrawRNATemplateMethod.NOINTERSECT) { System.out.println("globalIncreaseFactor = " + globalIncreaseFactor); } // Now we actually move the bases, according to arrays coords and centers // and taking in account the space between bases parameter. for (int i = 0; i < _listeBases.size(); i++) { _listeBases.get(i).setCoords( new Point2D.Double(coords[i].x * _spaceBetweenBases, coords[i].y * _spaceBetweenBases)); _listeBases.get(i).setCenter( new Point2D.Double(centers[i].x * _spaceBetweenBases, centers[i].y * _spaceBetweenBases)); } return mapping; } private static double objFun(int n1, int n2, double r, double bpdist, double multidist) { return (((double) n1) * 2.0 * Math.asin(((double) bpdist) / (2.0 * r)) + ((double) n2) * 2.0 * Math.asin(((double) multidist) / (2.0 * r)) - (2.0 * Math.PI)); } public double determineRadius(int nbHel, int nbUnpaired, double startRadius) { return determineRadius(nbHel,nbUnpaired,startRadius,BASE_PAIR_DISTANCE,MULTILOOP_DISTANCE); } public static double determineRadius(int nbHel, int nbUnpaired, double startRadius, double bpdist, double multidist) { double xmin = bpdist / 2.0; double xmax = 3.0 * multidist + 1; double x = (xmin + xmax) / 2.0; double y = 10000.0; double ymin = -1000.0; double ymax = 1000.0; int numIt = 0; double precision = 0.00001; while ((Math.abs(y) > precision) && (numIt < 10000)) { x = (xmin + xmax) / 2.0; y = objFun(nbHel, nbUnpaired, x, bpdist, multidist); ymin = objFun(nbHel, nbUnpaired, xmax, bpdist, multidist); ymax = objFun(nbHel, nbUnpaired, xmin, bpdist, multidist); if (ymin > 0.0) { xmax = xmax + (xmax - xmin); } else if ((y <= 0.0) && (ymax > 0.0)) { xmax = x; } else if ((y >= 0.0) && (ymin < 0.0)) { xmin = x; } else if (ymax < 0.0) { xmin = Math.max(xmin - (x - xmin), Math.max( bpdist / 2.0, multidist / 2.0)); xmax = x; } numIt++; } return x; } public void drawRNA(VARNAConfig conf) throws ExceptionNAViewAlgorithm { drawRNA(RNA.DEFAULT_DRAW_MODE,conf); } public void drawRNA(int mode,VARNAConfig conf) throws ExceptionNAViewAlgorithm { _drawMode = mode; switch (get_drawMode()) { case RNA.DRAW_MODE_RADIATE: drawRNARadiate(conf); break; case RNA.DRAW_MODE_LINEAR: drawRNALine(); break; case RNA.DRAW_MODE_CIRCULAR: drawRNACircle(); break; case RNA.DRAW_MODE_NAVIEW: drawRNANAView(); break; case RNA.DRAW_MODE_VARNA_VIEW: drawRNAVARNAView(); break; case RNA.DRAW_MODE_MOTIFVIEW: drawMOTIFView(); break; default: break; } } public int getDrawMode() { return _drawMode; } private void drawLoop(int i, int j, double x, double y, double dirAngle, Point2D.Double[] coords, Point2D.Double[] centers) { if (i > j) { return; } // BasePaired if (_listeBases.get(i).getElementStructure() == j) { double normalAngle = Math.PI / 2.0; centers[i] = new Point2D.Double(x, y); centers[j] = new Point2D.Double(x, y); coords[i].x = (x + BASE_PAIR_DISTANCE * Math.cos(dirAngle - normalAngle) / 2.0); coords[i].y = (y + BASE_PAIR_DISTANCE * Math.sin(dirAngle - normalAngle) / 2.0); coords[j].x = (x + BASE_PAIR_DISTANCE * Math.cos(dirAngle + normalAngle) / 2.0); coords[j].y = (y + BASE_PAIR_DISTANCE * Math.sin(dirAngle + normalAngle) / 2.0); drawLoop(i + 1, j - 1, x + LOOP_DISTANCE * Math.cos(dirAngle), y + LOOP_DISTANCE * Math.sin(dirAngle), dirAngle, coords, centers); } else { int k = i; Vector basesMultiLoop = new Vector(); Vector helices = new Vector(); int l; while (k <= j) { l = _listeBases.get(k).getElementStructure(); if (l > k) { basesMultiLoop.add(new Integer(k)); basesMultiLoop.add(new Integer(l)); helices.add(new Integer(k)); k = l + 1; } else { basesMultiLoop.add(new Integer(k)); k++; } } int mlSize = basesMultiLoop.size() + 2; int numHelices = helices.size() + 1; double totalLength = MULTILOOP_DISTANCE * (mlSize - numHelices) + BASE_PAIR_DISTANCE * numHelices; double multiLoopRadius; double angleIncrementML; double angleIncrementBP; if (mlSize > 3) { multiLoopRadius = determineRadius(numHelices, mlSize - numHelices, (totalLength) / (2.0 * Math.PI), BASE_PAIR_DISTANCE, MULTILOOP_DISTANCE ); angleIncrementML = -2.0 * Math.asin(((float) MULTILOOP_DISTANCE) / (2.0 * multiLoopRadius)); angleIncrementBP = -2.0 * Math.asin(((float) BASE_PAIR_DISTANCE) / (2.0 * multiLoopRadius)); } else { multiLoopRadius = 35.0; angleIncrementBP = -2.0 * Math.asin(((float) BASE_PAIR_DISTANCE) / (2.0 * multiLoopRadius)); angleIncrementML = (-2.0 * Math.PI - angleIncrementBP) / 2.0; } // System.out.println("MLr:"+multiLoopRadius+" iBP:"+angleIncrementBP+" iML:"+angleIncrementML); double centerDist = Math.sqrt(Math.max(Math.pow(multiLoopRadius, 2) - Math.pow(BASE_PAIR_DISTANCE / 2.0, 2), 0.0)) - LOOP_DISTANCE; Point2D.Double mlCenter = new Point2D.Double( (x + (centerDist * Math.cos(dirAngle))), (y + (centerDist * Math.sin(dirAngle)))); // Base directing angle for (multi|hairpin) loop, from the center's // perspective double baseAngle = dirAngle // U-turn + Math.PI // Account for already drawn supporting base-pair + 0.5 * angleIncrementBP // Base cannot be paired twice, so next base is at // "unpaired base distance" + 1.0 * angleIncrementML; double[] angles = new double[_listeBases.size()]; int n1 = 1; int n2 = 1; for (k = basesMultiLoop.size() - 1; k >= 0; k--) { l = basesMultiLoop.get(k).intValue(); centers[l] = mlCenter; angles[l] = baseAngle; coords[l].x = mlCenter.x + multiLoopRadius * Math.cos(baseAngle); coords[l].y = mlCenter.y + multiLoopRadius * Math.sin(baseAngle); if ((_listeBases.get(l).getElementStructure() < l) && (_listeBases.get(l).getElementStructure() != -1)) { baseAngle += angleIncrementBP; n1++; } else { baseAngle += angleIncrementML; n2++; } } // System.out.println("n1:"+n1+" n2:"+n2); double newAngle; int m, n; for (k = 0; k < helices.size(); k++) { m = helices.get(k).intValue(); n = _listeBases.get(m).getElementStructure(); newAngle = (angles[m] + angles[n]) / 2.0; drawLoop(m + 1, n - 1, (LOOP_DISTANCE * Math.cos(newAngle)) + (coords[m].x + coords[n].x) / 2.0, (LOOP_DISTANCE * Math.sin(newAngle)) + (coords[m].y + coords[n].y) / 2.0, newAngle, coords, centers); } } } public void drawRNARadiate(VARNAConfig conf) { drawRNARadiate(-1.0,conf._flatExteriorLoop); } public void drawRNARadiate(double dirAngle, boolean flatExteriorLoop) { _drawn = true; _drawMode = DRAW_MODE_RADIATE; Point2D.Double[] coords = new Point2D.Double[_listeBases.size()]; Point2D.Double[] centers = new Point2D.Double[_listeBases.size()]; for (int i = 0; i < _listeBases.size(); i++) { coords[i] = new Point2D.Double(0, 0); centers[i] = new Point2D.Double(0, 0); } if (flatExteriorLoop) { dirAngle += 1.0 - Math.PI/2.0; int i=0; double x = 0.0; double y = 0.0; double vx = -Math.sin(dirAngle); double vy = Math.cos(dirAngle); while(i<_listeBases.size()) { coords[i].x = x; coords[i].y = y; centers[i].x = x+BASE_PAIR_DISTANCE*vy; centers[i].y = y-BASE_PAIR_DISTANCE*vx; int j = _listeBases.get(i).getElementStructure(); if (j>i) { drawLoop(i, j, x+(BASE_PAIR_DISTANCE*vx/2.0), y+(BASE_PAIR_DISTANCE*vy/2.0), dirAngle, coords, centers); centers[i].x = coords[i].x+BASE_PAIR_DISTANCE*vy; centers[i].y = y-BASE_PAIR_DISTANCE*vx; i = j; x += BASE_PAIR_DISTANCE*vx; y += BASE_PAIR_DISTANCE*vy; centers[i].x = coords[i].x+BASE_PAIR_DISTANCE*vy; centers[i].y = y-BASE_PAIR_DISTANCE*vx; } x += MULTILOOP_DISTANCE*vx; y += MULTILOOP_DISTANCE*vy; i += 1; } } else { drawLoop(0, _listeBases.size() - 1, 0, 0, dirAngle, coords, centers); } for (int i = 0; i < _listeBases.size(); i++) { _listeBases.get(i).setCoords( new Point2D.Double(coords[i].x * _spaceBetweenBases, coords[i].y * _spaceBetweenBases)); _listeBases.get(i).setCenter( new Point2D.Double(centers[i].x * _spaceBetweenBases, centers[i].y * _spaceBetweenBases)); } // TODO // change les centres des bases de la premiere helice vers la boucle la // plus proche } public void drawRNANAView() throws ExceptionNAViewAlgorithm { _drawMode = DRAW_MODE_NAVIEW; _drawn = true; ArrayList X = new ArrayList(_listeBases.size()); ArrayList Y = new ArrayList(_listeBases.size()); ArrayList pair_table = new ArrayList(_listeBases.size()); for (int i = 0; i < _listeBases.size(); i++) { pair_table.add(Short.valueOf(String.valueOf(_listeBases.get(i) .getElementStructure()))); } NAView naView = new NAView(); naView.naview_xy_coordinates(pair_table, X, Y); // Updating individual base positions for (int i = 0; i < _listeBases.size(); i++) { _listeBases.get(i).setCoords( new Point2D.Double(X.get(i) * 2.5 * _spaceBetweenBases, Y .get(i) * 2.5 * _spaceBetweenBases)); } // Updating centers for (int i = 0; i < _listeBases.size(); i++) { int indicePartner = _listeBases.get(i).getElementStructure(); if (indicePartner != -1) { Point2D.Double base = _listeBases.get(i).getCoords(); Point2D.Double partner = _listeBases.get(indicePartner) .getCoords(); _listeBases.get(i).setCenter( new Point2D.Double((base.x + partner.x) / 2.0, (base.y + partner.y) / 2.0)); } else { Vector loop = getLoopBases(i); double tmpx = 0.0; double tmpy = 0.0; for (int j = 0; j < loop.size(); j++) { int partner = loop.elementAt(j); Point2D.Double loopmember = _listeBases.get(partner) .getCoords(); tmpx += loopmember.x; tmpy += loopmember.y; } _listeBases.get(i).setCenter( new Point2D.Double(tmpx / loop.size(), tmpy / loop.size())); } } } public void drawMOTIFView() { _drawn = true; _drawMode = DRAW_MODE_MOTIFVIEW; int spaceBetweenStrand =0; Motif motif = new Motif(this,get_listeBases()); motif.listStrand(); for (int i = 0; i < motif.getListStrand().sizeStruct(); i++ ){ for (int j = 0; j < motif.getListStrand().getStrand(i).sizeStrand(); j++ ){ int indice = motif.getListStrand().getStrand(i).getMB(j).getIndex(); get_listeBases().get(indice).setCoords( new Point2D.Double(0,0)); get_listeBases().get(indice).setCenter( new Point2D.Double(0, 0)); } } //Recherche du brin central int centralStrand = motif.getCentralStrand(); //Cas o l'on a un motif en toile if(centralStrand!=-1){ //On positionne le brin central motif.positionneSpecificStrand(centralStrand, spaceBetweenStrand); //On place les autres brins par rapport a ce brin central motif.orderStrands(centralStrand); } else { centralStrand = 0; motif.positionneStrand(); motif.ajusteStrand(); } motif.reajustement(); motif.deviationBasePair(); motif.setCenterMotif(); } public ArrayList getAllPartners(int indice) { ArrayList result = new ArrayList(); ModeleBase me = this.getBaseAt(indice); int i = me.getElementStructure(); if (i!= -1) { result.add(getBaseAt(i)); } ArrayList msbps = getAuxBPs(indice); for (ModeleStyleBP m : msbps) { result.add(m.getPartner(me)); } return result; } public int get_drawMode() { return _drawMode; } public void setDrawMode(int drawMode) { _drawMode = drawMode; } public void setRNA(String seq, String str) throws ExceptionFileFormatOrSyntax, ExceptionUnmatchedClosingParentheses { setRNA(RNA.explodeSequence(seq), str); } public void setRNA(String[] seq, int[] str) throws ExceptionFileFormatOrSyntax { setRNA(seq, str, 1); } public void setRNA(List seq, int[] str) throws ExceptionFileFormatOrSyntax { setRNA(seq.toArray(new String[seq.size()]), str, 1); } public void setRNA(List seq, int[] str, int baseIndex) throws ExceptionFileFormatOrSyntax { setRNA(seq.toArray(new String[seq.size()]), str, baseIndex); } public void setRNA(String[] seq, int[] str, int baseIndex) throws ExceptionFileFormatOrSyntax { clearAnnotations(); _listeBases = new ArrayList(); if (seq.length != str.length) { warningEmition("Sequence length " + seq.length + " differs from that of secondary structure " + str.length + ". \nAdapting sequence length ..."); if (seq.length < str.length) { String [] nseq = new String[str.length]; for(int i=0;ifirstRNA1stBaseSecondRNA1stBaseFirstRNA2ndBaseSecondRNA2ndBase [...] *
* Example: AAC-GUAGA--UGG * @param struct * - The super-structure * @param basesOwn * - The RNA owning bases array (each index will be:0 when common * base, 1 when first RNA alignment base, 2 when second RNA * alignment base) * @throws ExceptionUnmatchedClosingParentheses * @throws ExceptionFileFormatOrSyntax */ public void setRNA(String seq, String struct, ArrayList basesOwn) throws ExceptionUnmatchedClosingParentheses, ExceptionFileFormatOrSyntax { clearAnnotations(); _listeBases = new ArrayList(); // On "parse" la structure (repérage des points, tiret et couples // parentheses ouvrante/fermante) int[] array_struct = parseStruct(struct); int size = struct.length(); int j = 0; for (int i = 0; i < size; i++) { ModeleBase mb; if (seq.charAt(j)!=seq.charAt(j + 1)) { ModeleBasesComparison mbc = new ModeleBasesComparison(seq.charAt(j), seq.charAt(j + 1), i); mbc.set_appartenance(basesOwn.get(i)); mbc.setBaseNumber(i+1); mb = mbc; } else { mb = new ModeleBaseNucleotide(""+seq.charAt(j),i,i+1); } _listeBases.add(mb); j+=2; } for (int i = 0; i < size; i++) { if (array_struct[i]!=-1) {this.addBP(i, array_struct[i]);} j += 2; } } public void setRNA(List seq, String dbnStr) throws ExceptionUnmatchedClosingParentheses, ExceptionFileFormatOrSyntax { clearAnnotations(); String parDBN = dbnStr.replace('(', '(').replace(')', ')').replace('[', ':').replace(']', ':').replace('{', ':').replace('}', ':'); String braDBN = dbnStr.replace('(', ':').replace(')', ':').replace('[', '(').replace(']', ')').replace('{', ':').replace('}', ':'); String accDBN = dbnStr.replace('(', ':').replace(')', ':').replace('[', ':').replace(']', ':').replace('{', '(').replace('}', ')'); int[] parStr = parseStruct(parDBN); int[] braStr = parseStruct(braDBN); int[] accStr = parseStruct(accDBN); int[] finStr = new int[parStr.length]; for(int i=0;ii) { finStr[i] = parStr[i]; finStr[finStr[i]] = i; } else if (braStr[i]>i) { if ((parStr[i]==-1)&&(parStr[braStr[i]]==-1)) { finStr[i] = braStr[i]; finStr[finStr[i]] = i; } } else if (accStr[i]>i) { if ((parStr[i]==-1)&&(parStr[accStr[i]]==-1)&&(braStr[i]==-1)&&(braStr[accStr[i]]==-1)) { finStr[i] = accStr[i]; finStr[finStr[i]] = i; } } } setRNA(seq, finStr); } public static ArrayList explodeSequence(String seq) { ArrayList analyzedSeq = new ArrayList(); int i=0; while(i p = new Stack(); for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (c == '(') { p.push(new Integer(i)); } else if (c == '.' || c == '-' || c == ':') { result[i] = -1; } else if (c == ')') { if (p.size() == 0) { throw new ExceptionUnmatchedClosingParentheses(i + 1); } int j = p.pop().intValue(); result[i] = j; result[j] = i; } else { if (unexpectedChar == -1) unexpectedChar = i; break; } } if (unexpectedChar != -1) { //warningEmition("Unexpected Character at index:" + unexpectedChar); } if (p.size() != 0) { throw new ExceptionUnmatchedClosingParentheses( p.pop().intValue() + 1); } return result; } public Point getHelixInterval(int index) { if ((index < 0) || (index >= _listeBases.size())) { return new Point(index, index); } int j = _listeBases.get(index).getElementStructure(); if (j != -1) { int minH = index; int maxH = index; if (j > index) { maxH = j; } else { minH = j; } boolean over = false; while (!over) { if ((minH < 0) || (maxH >= _listeBases.size())) { over = true; } else { if (_listeBases.get(minH).getElementStructure() == maxH) { minH--; maxH++; } else { over = true; } } } minH++; maxH--; return new Point(minH, maxH); } return new Point(0, 0); } public ArrayList getHelix(int index) { ArrayList result = new ArrayList(); if ((index < 0) || (index >= _listeBases.size())) { return result; } Point p = getHelixInterval(index); for (int i =p.x;i<=p.y;i++) { result.add(i); result.add(this._listeBases.get(i).getElementStructure()); } return result; } public Point getMultiLoop(int index) { if ((index < 0) || (index >= _listeBases.size())) { return new Point(index, index); } Point h = getHelixInterval(index); int minH = h.x - 1; int maxH = h.y + 1; boolean over = false; while (!over) { if (minH < 0) { over = true; minH = 0; } else { if (_listeBases.get(minH).getElementStructure() == -1) { minH--; } else if (_listeBases.get(minH).getElementStructure() < minH) { minH = _listeBases.get(minH).getElementStructure() - 1; } else { over = true; } } } over = false; while (!over) { if (maxH > _listeBases.size() - 1) { over = true; maxH = _listeBases.size() - 1; } else { if (_listeBases.get(maxH).getElementStructure() == -1) { maxH++; } else if (_listeBases.get(maxH).getElementStructure() > maxH) { maxH = _listeBases.get(maxH).getElementStructure() + 1; } else { over = true; } } } return new Point(minH, maxH); } public Vector getLoopBases(int startIndex) { Vector result = new Vector(); if ((startIndex < 0) || (startIndex >= _listeBases.size())) { return result; } int index = startIndex; result.add(startIndex); if (_listeBases.get(index).getElementStructure() <= index) { index = (index + 1) % _listeBases.size(); } else { index = _listeBases.get(index).getElementStructure(); result.add(index); index = (index + 1) % _listeBases.size(); } while (index != startIndex) { result.add(index); if (_listeBases.get(index).getElementStructure() == -1) { index = (index + 1) % _listeBases.size(); } else { index = _listeBases.get(index).getElementStructure(); result.add(index); index = (index + 1) % _listeBases.size(); } } return result; } /** * Returns the RNA secondary structure displayed by this panel as a * well-parenthesized word, accordingly to the DBN format * * @return This panel's secondary structure */ public String getStructDBN() { String result = ""; for (int i = 0; i < _listeBases.size(); i++) { int j = _listeBases.get(i).getElementStructure(); if (j == -1) { result += "."; } else if (i > j) { result += ")"; } else { result += "("; } } return result; } public String getStructDBN(int[] str) { String result = ""; for (int i = 0; i < str.length; i++) { if (str[i] == -1) { result += "."; } else if (str[i] > i) { result += "("; } else { result += ")"; } } return result; } /** * Returns the raw nucleotides sequence for the displayed RNA * * @return The RNA sequence */ public String getSeq() { String result = ""; for (int i = 0; i < _listeBases.size(); i++) { result += ((ModeleBase) _listeBases.get(i)).getContent(); } return result; } public String getStructBPSEQ() { String result = ""; int[] str = getNonOverlappingStruct(); for (int i = 0; i < _listeBases.size(); i++) { result += (i + 1) + " " + ((ModeleBaseNucleotide) _listeBases.get(i)).getContent() + " " + (str[i] + 1) + "\n"; } return result; } public int[] getNonCrossingStruct() { int[] result = new int[_listeBases.size()]; // Adding "planar" base-pairs for (int i = 0; i < _listeBases.size(); i++) { result[i] = _listeBases.get(i).getElementStructure(); } return result; } public int[] getNonOverlappingStruct() { int[] result = getNonCrossingStruct(); // Adding additional base pairs when possible (No more than one base-pair per base) for (int i = 0; i < _structureAux.size(); i++) { ModeleStyleBP msbp = _structureAux.get(i); ModeleBase mb5 = msbp.getPartner5(); ModeleBase mb3 = msbp.getPartner3(); int j5 = mb5.getIndex(); int j3 = mb3.getIndex(); if ((result[j3]==-1) && (result[j5]==-1)) { result[j3] = j5; result[j5] = j3; } } return result; } public String getStructCT() { String result = ""; for (int i = 0; i < _listeBases.size(); i++) { result += (i + 1) + " " + ((ModeleBase) _listeBases.get(i)) .getContent() + " " + i + " " + (i + 2) + " " + (_listeBases.get(i).getElementStructure() + 1) + " " + (i + 1) + "\n"; } return result; } public void saveAsBPSEQ(String path, String title) throws ExceptionExportFailed, ExceptionPermissionDenied { try { FileWriter f = new FileWriter(path); f.write("# " + title + "\n"); f.write(this.getStructBPSEQ() + "\n"); f.close(); } catch (IOException e) { throw new ExceptionExportFailed(e.getMessage(), path); } } public void saveAsCT(String path, String title) throws ExceptionExportFailed, ExceptionPermissionDenied { try { FileWriter f = new FileWriter(path); f.write("" + _listeBases.size() + " " + title + "\n"); f.write(this.getStructCT() + "\n"); f.close(); } catch (IOException e) { throw new ExceptionExportFailed(e.getMessage(), path); } } public void saveAsDBN(String path, String title) throws ExceptionExportFailed, ExceptionPermissionDenied { try { FileWriter f = new FileWriter(path); f.write("> " + title + "\n"); f.write(getListeBasesToString() + "\n"); f.write(getStructDBN() + "\n"); f.close(); } catch (IOException e) { throw new ExceptionExportFailed(e.getMessage(), path); } } public String getListeBasesToString() { String s = new String(); for (int i = 0; i < _listeBases.size(); i++) { s += ((ModeleBaseNucleotide) _listeBases.get(i)).getContent(); } return s; } private boolean loadSecStrBPSEQ(Reader r) throws ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax { boolean loadOk = false; try { BufferedReader fr = new BufferedReader(r); String line = fr.readLine(); ArrayList seqTmp = new ArrayList(); Hashtable > strTmp = new Hashtable>(); int bpFrom; String base; int bpTo; int minIndex = -1; boolean noWarningYet = true; String title = ""; String filenameStr = "Filename:"; String organismStr = "Organism:"; String ANStr = "Accession Number:"; while (line != null) { line = line.trim(); String[] tokens = line.split("\\s+"); if ((tokens.length >= 3) && !tokens[0].contains("#")&& !line.startsWith("Organism:")&& !line.startsWith("Citation") && !line.startsWith("Filename:")&& !line.startsWith("Accession Number:")) { base = tokens[1]; seqTmp.add(base); bpFrom = (Integer.parseInt(tokens[0])); if (minIndex<0) minIndex = bpFrom; if (seqTmp.size() < (bpFrom-minIndex+1)) { if (noWarningYet) { noWarningYet = false; warningEmition("Discontinuity detected between nucleotides " + (seqTmp.size()) + " and " + (bpFrom + 1) + "!\nFilling in missing portions with unpaired unknown 'X' nucleotides ..."); } while (seqTmp.size() < (bpFrom-minIndex+1)) { //System.err.println("."); seqTmp.add("X"); } } for (int i=2;i()); strTmp.get(bpFrom).add(bpTo); } } } else if (tokens[0].startsWith("#")) { int occur = line.indexOf("#"); String tmp = line.substring(occur+1); title += tmp.trim()+" "; } else if (tokens[0].startsWith(filenameStr)) { int occur = line.indexOf(filenameStr); String tmp = line.substring(occur+filenameStr.length()); title += tmp.trim(); } else if (tokens[0].startsWith(organismStr)) { int occur = line.indexOf(organismStr); String tmp = line.substring(occur+organismStr.length()); if (title.length()!=0) { title = "/"+title; } title = tmp.trim() + title; } else if (line.contains(ANStr)) { int occur = line.indexOf(ANStr); String tmp = line.substring(occur+ANStr.length()); if (title.length()!=0) { title += " "; } title +="("+tmp.trim()+")"; } line = fr.readLine(); } if (strTmp.size() != 0) { ArrayList seq = seqTmp; int[] str = new int[seq.size()]; for (int i = 0; i < seq.size(); i++) { str[i] = -1; } setRNA(seq, str, minIndex); ArrayList allbps = new ArrayList(); for (int i:strTmp.keySet()) { for (int j: strTmp.get(i)) { ModeleBase mb = _listeBases.get(i-minIndex); ModeleBase part = _listeBases.get(j-minIndex); ModeleStyleBP newStyle = new ModeleStyleBP(mb, part); allbps.add(newStyle); } } applyBPs(allbps); setName(title); loadOk = true; } } catch (NumberFormatException e) { e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { throw new ExceptionLoadingFailed(e.getMessage(), ""); } return loadOk; } private boolean loadSecStrCT(Reader r) throws ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax { boolean loadOk = false; try { BufferedReader fr = new BufferedReader(r); String line = fr.readLine(); ArrayList seq = new ArrayList(); Vector strTmp = new Vector(); int bpFrom; String base; int bpTo; boolean noWarningYet = true; int minIndex = -1; String title = ""; while (line != null) { line = line.trim(); String[] tokens = line.split("\\s+"); if (tokens.length >= 6) { try{ bpFrom = (Integer.parseInt(tokens[0])); bpTo = (Integer.parseInt(tokens[4])); if (minIndex==-1) minIndex = bpFrom; bpFrom -= minIndex; if (bpTo!=0) bpTo -= minIndex; else bpTo = -1; base = tokens[1]; Integer.parseInt(tokens[2]); Integer.parseInt(tokens[3]); Integer.parseInt(tokens[5]); if (bpFrom != seq.size()) { if (noWarningYet) { noWarningYet = false; warningEmition("Discontinuity detected between nucleotides " + (seq.size()) + " and " + (bpFrom + 1) + "!\nFilling in missing portions with unpaired unknown 'X' nucleotides ..."); } while (bpFrom > seq.size()) { seq.add("X"); strTmp.add(-1); } } seq.add(base); strTmp.add(bpTo); } catch (NumberFormatException e) { } } if ((line.contains("ENERGY = "))||line.contains("dG = ")) { String[] ntokens = line.split("\\s+"); if (ntokens.length>=4) { String energy = ntokens[3]; for(int i=4;i allbps) { ArrayList planar = new ArrayList(); ArrayList others = new ArrayList(); //System.err.println("Sequence: "+this.getSeq()); RNAMLParser.planarize(allbps, planar, others, getSize()); //System.err.println("All:"+allbps); //System.err.println("=> Planar: "+planar); //System.err.println("=> Others: "+others); for (ModeleStyleBP mb :planar) { addBP(mb.getPartner5().getIndex(), mb.getPartner3().getIndex(), mb); } for (ModeleStyleBP mb :others) { addBPAux(mb.getPartner5().getIndex(), mb.getPartner3().getIndex(), mb); } } private boolean loadSecStrRNAML(Reader r) throws ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax { boolean loadOk = false; try { System.setProperty("javax.xml.parsers.SAXParserFactory", "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"); SAXParserFactory saxFact = javax.xml.parsers.SAXParserFactory.newInstance(); saxFact.setValidating(false); saxFact.setXIncludeAware(false); saxFact.setNamespaceAware(false); SAXParser sp = saxFact.newSAXParser(); RNAMLParser RNAMLData = new RNAMLParser(); sp.parse(new InputSource(r), RNAMLData); /*XMLReader xr = XMLReaderFactory.createXMLReader(); RNAMLParser RNAMLData = new RNAMLParser(); xr.setContentHandler(RNAMLData); xr.setErrorHandler(RNAMLData); xr.setEntityResolver(RNAMLData); xr.parse(new InputSource(r));*/ // Retrieving parsed data List seq = RNAMLData.getSequence(); //System.err.println(""+seq.size()); // Creating empty structure of suitable size int[] str = new int[seq.size()]; for (int i=0;i allbpsTmp = RNAMLData.getAllBPs(); ArrayList allbps = new ArrayList(); for (int i = 0; i < allbpsTmp.size(); i++) { RNAMLParser.BPTemp bp = allbpsTmp.get(i); int bp5 = bp.pos5; int bp3 = bp.pos3; ModeleBase mb = _listeBases.get(bp5); ModeleBase part = _listeBases.get(bp3); ModeleStyleBP newStyle = bp.createBPStyle(mb, part); allbps.add(newStyle); } applyBPs(allbps); loadOk = true; } catch (IOException ioe) { throw new ExceptionLoadingFailed( "Couldn't load file due to I/O or security policy issues.", ""); } catch (Exception ge) { ge.printStackTrace(); } return loadOk; } private boolean loadSecStrDBN(Reader r) throws ExceptionLoadingFailed, ExceptionPermissionDenied, ExceptionUnmatchedClosingParentheses, ExceptionFileFormatOrSyntax { boolean loadOk = false; try { BufferedReader fr = new BufferedReader(r); String line = fr.readLine(); String title = ""; String seqTmp = ""; String strTmp = ""; while ((line != null) && (strTmp.equals(""))) { line = line.trim(); if (!line.startsWith(">")) { if (seqTmp.equals("")) { seqTmp = line; } else { strTmp = line; } } else { title = line.substring(1).trim(); } line = fr.readLine(); } if (strTmp.length() != 0) { setRNA(seqTmp, strTmp); this.setName(title); loadOk = true; } } catch (IOException e) { throw new ExceptionLoadingFailed(e.getMessage(), ""); } return loadOk; } public void loadSecStr(Reader r) throws ExceptionFileFormatOrSyntax { loadSecStr(r,FILE_TYPE_UNKNOWN); } public void loadSecStr(Reader r, int fileType) throws ExceptionFileFormatOrSyntax { switch(fileType) { case (FILE_TYPE_DBN): { try { boolean ok = loadSecStrDBN(r); if (ok) return; } catch (Exception e) { } } break; case (FILE_TYPE_CT): { try { boolean ok = loadSecStrCT(r); if (ok) return; } catch (Exception e) { } } break; case (FILE_TYPE_BPSEQ): { try { boolean ok = loadSecStrBPSEQ(r); if (ok) return; } catch (Exception e) { } } break; case (FILE_TYPE_RNAML): { try { boolean ok = loadSecStrRNAML(r); if (ok) return; } catch (Exception e) { } } break; case (FILE_TYPE_UNKNOWN): { BufferedReader buf = new BufferedReader(r); try { buf.mark(1000000); try { boolean ok = loadSecStrCT(buf); if (ok) return; } catch (Exception e) { } buf.reset(); try { boolean ok = loadSecStrBPSEQ(buf); if (ok) return; } catch (Exception e) { } buf.reset(); try { boolean ok = loadSecStrDBN(buf); if (ok) return; } catch (Exception e) { e.printStackTrace(); } buf.reset(); try { boolean ok = loadSecStrRNAML(buf); if (ok) return; } catch (ExceptionLoadingFailed e2) { e2.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } try { boolean ok = loadSecStrRNAML(buf); if (ok) return; } catch (ExceptionLoadingFailed e2) { e2.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } buf.reset(); } catch (IOException e2) { e2.printStackTrace(); } } } throw new ExceptionFileFormatOrSyntax(""); } public static int guessFileTypeFromExtension(String path) { if (path.toLowerCase().endsWith("ml")) { return RNA.FILE_TYPE_RNAML; } else if (path.toLowerCase().endsWith("dbn")||path.toLowerCase().endsWith("faa")) { return RNA.FILE_TYPE_DBN; } else if (path.toLowerCase().endsWith("ct")) { return RNA.FILE_TYPE_CT; } else if (path.toLowerCase().endsWith("bpseq")) { return RNA.FILE_TYPE_BPSEQ; } return RNA.FILE_TYPE_UNKNOWN; } public void loadSecStr(String path) throws ExceptionExportFailed, ExceptionPermissionDenied, ExceptionLoadingFailed, ExceptionFileFormatOrSyntax, ExceptionUnmatchedClosingParentheses, FileNotFoundException { FileReader fr = null; try { fr = new FileReader(path); int type = guessFileTypeFromExtension(path); loadSecStr(fr,type); } catch (ExceptionFileFormatOrSyntax e) { if (fr != null) try {fr.close();} catch(IOException e2){} e.setPath(path); throw e; } } public void set_listeBases(ArrayList _liste) { this._listeBases = _liste; } public void addVARNAListener(InterfaceVARNAListener rl) { _listeVARNAListener.add(rl); } public void warningEmition(String warningMessage) { for (int i = 0; i < _listeVARNAListener.size(); i++) { _listeVARNAListener.get(i).onWarningEmitted(warningMessage); } } public void applyStyleOnBases(ArrayList basesList, ModeleStyleBase style) { for (int i = 1; i < basesList.size(); i++) { _listeBases.get(basesList.get(i)).setStyleBase(style); } } private int[] correctReciprocity(int[] str) { int[] result = new int[str.length]; for (int i = 0; i < str.length; i++) { if (str[i] != -1) { if (i == str[str[i]]) { result[i] = str[i]; } else { str[str[i]] = i; } } else { result[i] = -1; } } return result; } private void applyStruct(int[] str) throws ExceptionFileFormatOrSyntax { str = correctReciprocity(str); int[] planarSubset = RNAMLParser.planarize(str); _structureAux.clear(); for (int i = 0; i < planarSubset.length; i++) { if (str[i]>i) { _listeBases.get(i).setElementStructure(planarSubset[i]); if (planarSubset[i] > i) { addBP(i,planarSubset[i]); } else if ((planarSubset[i]!=str[i])) { addBPAux(i,str[i]); } } } } @SuppressWarnings("unused") private void initStruct(int size) { for (int i = 0; i < size; i++) { _listeBases.get(i).setElementStructure(-1); } } public ArrayList get_listeBases() { return _listeBases; } public int getSize() { return _listeBases.size(); } public ArrayList findAll() { ArrayList listAll = new ArrayList(); for (int i = 0; i < get_listeBases().size(); i++) { listAll.add(i); } return listAll; } public ArrayList findBulge(int index) { ArrayList listUp = new ArrayList(); if (get_listeBases().get(index).getElementStructure() == -1) { int i = index; boolean over = false; while ((i < get_listeBases().size()) && !over) { int j = get_listeBases().get(i).getElementStructure(); if (j == -1) { listUp.add(i); i++; } else { over = true; } } i = index - 1; over = false; while ((i >= 0) && !over) { int j = get_listeBases().get(i).getElementStructure(); if (j == -1) { listUp.add(i); i--; } else { over = true; } } } return listUp; } public ArrayList findStem(int index) { ArrayList listUp = new ArrayList(); int i = index; do { listUp.add(i); int j = get_listeBases().get(i).getElementStructure(); if (j == -1) { i = (i + 1) % getSize(); } else { if ((j < i) && (index <= i) && (j <= index)) { i = j; } else { i = (i + 1) % getSize(); } } } while (i != index); return listUp; } public int getHelixCountOnLoop(int indice) { int cptHelice = 0; if (indice < 0 || indice >= get_listeBases().size()) return cptHelice; int i = indice; int j = get_listeBases().get(i).getElementStructure(); // Only way to distinguish "supporting base-pair" from others boolean justJumped = false; if ((j != -1) && (j < i)) { i = j + 1; indice = i; } do { j = get_listeBases().get(i).getElementStructure(); if ((j != -1) && (!justJumped)) { i = j; justJumped = true; cptHelice++; } else { i = (i + 1) % get_listeBases().size(); justJumped = false; } } while (i != indice); return cptHelice; } public ArrayList findLoop(int indice) { return findLoopForward(indice); } public ArrayList findLoopForward(int indice) { ArrayList base = new ArrayList(); if (indice < 0 || indice >= get_listeBases().size()) return base; int i = indice; int j = get_listeBases().get(i).getElementStructure(); // Only way to distinguish "supporting base-pair" from others boolean justJumped = false; if (j != -1) { i = Math.min(i, j) + 1; indice = i; } do { base.add(i); j = get_listeBases().get(i).getElementStructure(); if ((j != -1) && (!justJumped)) { i = j; justJumped = true; } else { i = (i + 1) % get_listeBases().size(); justJumped = false; } } while (i != indice); return base; } public ArrayList findPair(int indice) { ArrayList base = new ArrayList(); int j = get_listeBases().get(indice).getElementStructure(); if (j != -1) { base.add(Math.min(indice, j)); base.add(Math.max(indice, j)); } return base; } public ArrayList findLoopBackward(int indice) { ArrayList base = new ArrayList(); if (indice < 0 || indice >= get_listeBases().size()) return base; int i = indice; int j = get_listeBases().get(i).getElementStructure(); // Only way to distinguish "supporting base-pair" from others boolean justJumped = false; if (j != -1) { i = Math.min(i, j) - 1; indice = i; } if (i < 0) { return base; } do { base.add(i); j = get_listeBases().get(i).getElementStructure(); if ((j != -1) && (!justJumped)) { i = j; justJumped = true; } else { i = (i + get_listeBases().size() - 1) % get_listeBases().size(); justJumped = false; } } while (i != indice); return base; } public ArrayList findHelix(int indice) { ArrayList list = new ArrayList(); if (get_listeBases().get(indice).getElementStructure() != -1) { list.add(indice); list.add(get_listeBases().get(indice).getElementStructure()); int i = 1, prec = get_listeBases().get(indice) .getElementStructure(); while (indice + i < get_listeBases().size() && get_listeBases().get(indice + i).getElementStructure() != -1 && get_listeBases().get(indice + i).getElementStructure() == prec - 1) { list.add(indice + i); list.add(get_listeBases().get(indice + i) .getElementStructure()); prec = get_listeBases().get(indice + i).getElementStructure(); i++; } i = -1; prec = get_listeBases().get(indice).getElementStructure(); while (indice + i >= 0 && get_listeBases().get(indice + i).getElementStructure() != -1 && get_listeBases().get(indice + i).getElementStructure() == prec + 1) { list.add(indice + i); list.add(get_listeBases().get(indice + i) .getElementStructure()); prec = get_listeBases().get(indice + i).getElementStructure(); i--; } } return list; } public ArrayList find3Prime(int indice) { ArrayList list = new ArrayList(); boolean over = false; while ((indice >= 0) && !over) { over = (get_listeBases().get(indice).getElementStructure() != -1); indice--; } indice++; if (over) { indice++; } for (int i = indice; i < get_listeBases().size(); i++) { list.add(i); if (get_listeBases().get(i).getElementStructure() != -1) { return new ArrayList(); } } return list; } public ArrayList find5Prime(int indice) { ArrayList list = new ArrayList(); for (int i = 0; i <= indice; i++) { list.add(i); if (get_listeBases().get(i).getElementStructure() != -1) { return new ArrayList(); } } return list; } public Double get_spaceBetweenBases() { return _spaceBetweenBases; } public void set_spaceBetweenBases(Double betweenBases) { _spaceBetweenBases = betweenBases; } public static Double angle(Point2D.Double p1, Point2D.Double p2, Point2D.Double p3) { Double alpha = Math.atan2(p1.y - p2.y, p1.x - p2.x); Double beta = Math.atan2(p3.y - p2.y, p3.x - p2.x); Double angle = (beta - alpha); // Correction de l'angle pour le resituer entre 0 et 2PI while (angle < 0.0 || angle > 2 * Math.PI) { if (angle < 0.0) angle += 2 * Math.PI; else if (angle > 2 * Math.PI) angle -= 2 * Math.PI; } return angle; } public ArrayList findNonPairedBaseGroup(Integer get_nearestBase) { // detection 3', 5', bulge ArrayList list = new ArrayList(); int indice = get_nearestBase; boolean nonpairedUp = true, nonpairedDown = true; while (indice < get_listeBases().size() && nonpairedUp) { if (get_listeBases().get(indice).getElementStructure() == -1) { list.add(indice); indice++; } else { nonpairedUp = false; } } indice = get_nearestBase - 1; while (indice >= 0 && nonpairedDown) { if (get_listeBases().get(indice).getElementStructure() == -1) { list.add(indice); indice--; } else { nonpairedDown = false; } } return list; } public boolean getDrawn() { return _drawn; } public ArrayList getStructureAux() { return _structureAux; } public int getIndexFromBaseNumber(int num) { for (int i = 0; i < this._listeBases.size(); i++) { if (_listeBases.get(i).getBaseNumber() == num) { return i; } } return -1; } /** * Adds a base pair to this RNA's structure. Tries to add it to the * secondary structure first, eventually adding it to the 'tertiary' * interactions if it clashes with the current secondary structure. * * @param baseNumber5 * - Base number of the origin of this base pair * @param baseNumber3 * - Base number of the destination of this base pair */ public void addBPToStructureUsingNumbers(int baseNumber5, int baseNumber3) { int i = getIndexFromBaseNumber(baseNumber5); int j = getIndexFromBaseNumber(baseNumber3); addBPToStructure(i, j); } /** * Adds a base pair to this RNA's structure. Tries to add it to the * secondary structure first, possibly adding it to the 'tertiary' * interactions if it clashes with the current secondary structure. * * @param number5 * - Base number of the origin of this base pair * @param number3 * - Base number of the destination of this base pair */ public void addBPToStructureUsingNumbers(int number5, int number3, ModeleStyleBP msbp) { addBPToStructure(getIndexFromBaseNumber(number5), getIndexFromBaseNumber(number5), msbp); } public void addBPToStructure(int index5, int index3) { int i = index5; int j = index3; ModeleBase part5 = _listeBases.get(i); ModeleBase part3 = _listeBases.get(j); ModeleStyleBP msbp = new ModeleStyleBP(part5, part3); addBPToStructure(i, j, msbp); } public void addBPToStructure(int index5, int index3, ModeleStyleBP msbp) { int i = index5; int j = index3; if (j < i) { int k = j; j = i; i = k; } if (i != -1) { if ((_listeBases.get(i).getElementStructure() != -1) || (_listeBases.get(j).getElementStructure() != -1)) { addBPAux(i, j, msbp); return; } for (int k = i + 1; k < j; k++) { ModeleBase tmp = _listeBases.get(k); int l = tmp.getElementStructure(); if (l != -1) { if ((l <= i) || (l >= j)) { addBPAux(i, j, msbp); return; } } } addBP(i, j, msbp); } } public void removeBP(ModeleStyleBP ms) { if (_structureAux.contains(ms)) { _structureAux.remove(ms); } else { ModeleBase m5 = ms.getPartner5(); ModeleBase m3 = ms.getPartner3(); int i = m5.getIndex(); int j = m3.getIndex(); if ((m5.getElementStructure()==m3.getIndex())&&(m3.getElementStructure()==m5.getIndex())) { m5.setElementStructure(-1); m3.setElementStructure(-1); m5.setStyleBP(null); m3.setStyleBP(null); } } } public void addBP(int i, int j) { if (j < i) { int k = j; j = i; i = k; } ModeleBase part5 = _listeBases.get(i); ModeleBase part3 = _listeBases.get(j); ModeleStyleBP msbp = new ModeleStyleBP(part5, part3); addBP(i, j, msbp); } public void addBP(int i, int j, ModeleStyleBP msbp) { if (j < i) { int k = j; j = i; i = k; } ModeleBase part5 = _listeBases.get(i); ModeleBase part3 = _listeBases.get(j); msbp.setPartner5(part5); msbp.setPartner3(part3); part5.setElementStructure(j, msbp); part3.setElementStructure(i, msbp); } public void addBPAux(int i, int j) { ModeleBase part5 = _listeBases.get(i); ModeleBase part3 = _listeBases.get(j); ModeleStyleBP msbp = new ModeleStyleBP(part5, part3); addBPAux(i, j, msbp); } public void addBPAux(int i, int j, ModeleStyleBP msbp) { if (j < i) { int k = j; j = i; i = k; } ModeleBase part5 = _listeBases.get(i); ModeleBase part3 = _listeBases.get(j); msbp.setPartner5(part5); msbp.setPartner3(part3); _structureAux.add(msbp); } public ModeleStyleBP getBPStyle(int i, int j) { ModeleStyleBP result = null; if (i > j) { int k = j; j = i; i = k; } if (_listeBases.get(i).getElementStructure() == j) { result = _listeBases.get(i).getStyleBP(); } for (int k = 0; k < _structureAux.size(); k++) { ModeleStyleBP bp = _structureAux.get(k); if ((bp.getPartner5().getIndex() == i) && (bp.getPartner3().getIndex() == j)) { result = bp; } } return result; } public ArrayList getSecStrBPs() { ArrayList result = new ArrayList(); for (int i=0;ii)) { result.add(mb.getStyleBP()) ; } } return result; } public ArrayList getAuxBPs() { ArrayList result = new ArrayList(); for (ModeleStyleBP bp : _structureAux) { result.add(bp); } return result; } public ArrayList getAllBPs() { ArrayList result = new ArrayList(); result.addAll(getSecStrBPs()); result.addAll(getAuxBPs()); return result; } public ArrayList getAuxBPs(int i) { ArrayList result = new ArrayList(); for (ModeleStyleBP bp : _structureAux) { if ((bp.getPartner5().getIndex() == i) || (bp.getPartner3().getIndex() == i)) { result.add(bp); } } return result; } public void setBaseInnerColor(Color c) { for (int i = 0; i < _listeBases.size(); i++) { ModeleBase mb = _listeBases.get(i); mb.getStyleBase().set_base_inner_color(c); } } public void setBaseNumbersColor(Color c) { for (int i = 0; i < _listeBases.size(); i++) { ModeleBase mb = _listeBases.get(i); mb.getStyleBase().set_base_number_color(c); } } public void setBaseNameColor(Color c) { for (int i = 0; i < _listeBases.size(); i++) { ModeleBase mb = _listeBases.get(i); mb.getStyleBase().set_base_name_color(c); } } public void setBaseOutlineColor(Color c) { for (int i = 0; i < _listeBases.size(); i++) { ModeleBase mb = _listeBases.get(i); mb.getStyleBase().set_base_outline_color(c); } } public String getName() { return _name; } public void setName(String n) { _name = n; } public ArrayList getAnnotations() { return _listeAnnotations; } public boolean removeAnnotation(TextAnnotation t) { return _listeAnnotations.remove(t); } public void addAnnotation(TextAnnotation t) { _listeAnnotations.add(t); } public void removeAnnotation(String filter) { ArrayList condamne = new ArrayList(); for (TextAnnotation t : _listeAnnotations) { if (t.getTexte().contains(filter)) { condamne.add(t); } } for (TextAnnotation t : condamne) { _listeAnnotations.remove(t); } } public void clearAnnotations() { _listeAnnotations.clear(); } private boolean _strandEndsAnnotated = false; public void autoAnnotateStrandEnds() { if (! _strandEndsAnnotated) { int tailleListBases=_listeBases.size(); boolean endAnnotate =false; addAnnotation(new TextAnnotation("5'", _listeBases.get(0))); for(int i=0; i<_listeBases.size()-1; i++){ int realposA = _listeBases.get(i).getBaseNumber(); int realposB = _listeBases.get(i+1).getBaseNumber(); if(realposB-realposA!=1){ addAnnotation(new TextAnnotation("3'", _listeBases.get(i))); addAnnotation(new TextAnnotation("5'", _listeBases.get(i+1))); if(i+1==_listeBases.size()-1){ endAnnotate=true; } } } if(!endAnnotate){ addAnnotation(new TextAnnotation("3'", _listeBases.get(tailleListBases-1))); } _strandEndsAnnotated = true; } else { removeAnnotation("3'"); removeAnnotation("5'"); _strandEndsAnnotated = false; } } public void autoAnnotateHelices() { Stack p = new Stack(); p.push(0); int nbH = 1; while(!p.empty()) { int i = p.pop(); if (i<_listeBases.size()) { ModeleBase mb = _listeBases.get(i); int j = mb.getElementStructure(); if (j==-1) { p.push(i+1); } else { if (j>i) { ModeleBase mbp = _listeBases.get(j); p.push(j+1); ArrayList h = new ArrayList(); int k = 1; while(mb.getElementStructure()==mbp.getIndex()) { h.add(mb); h.add(mbp); mb = _listeBases.get(i+k); mbp = _listeBases.get(j-k); k++; } try { addAnnotation(new TextAnnotation("H"+nbH++, h , TextAnnotation.HELIX)); } catch (Exception e) { e.printStackTrace(); } p.push(i+k); } } } } } public void autoAnnotateTerminalLoops() { Stack p = new Stack(); p.push(0); int nbT = 1; while(!p.empty()) { int i = p.pop(); if (i<_listeBases.size()) { ModeleBase mb = _listeBases.get(i); int j = mb.getElementStructure(); if (j==-1) { int k = 1; ArrayList t = new ArrayList(); while ((i+ki) { p.push(j+1); p.push(i+1); } } } } } public void autoAnnotateInteriorLoops() { Stack p = new Stack(); p.push(0); int nbT = 1; while(!p.empty()) { int i = p.pop(); if (i<_listeBases.size()) { ModeleBase mb = _listeBases.get(i); int j = mb.getElementStructure(); if (j==-1) { int k = i+1; ArrayList t = new ArrayList(); boolean terminal = true; while ((k=i)||(mb.getElementStructure()==-1))) { t.add(mb); mb = _listeBases.get(k); if ((mb.getElementStructure()==-1)||(mb.getElementStructure()i) { p.push(i+1); } } } } } @SuppressWarnings("unchecked") public TextAnnotation getAnnotation(int type, ModeleBase base) { TextAnnotation result = null; for(TextAnnotation t : _listeAnnotations) { if (t.getType()==type) { switch(type) { case(TextAnnotation.BASE): if (base == (ModeleBase) t.getAncrage()) return t; break; case(TextAnnotation.HELIX): case(TextAnnotation.LOOP): { ArrayList mbl = (ArrayList) t.getAncrage(); if (mbl.contains(base)) return t; } break; } } } return result; } private ArrayList _ChemProbAnnotations = new ArrayList(); public void addChemProbAnnotation(ChemProbAnnotation cpa) { _ChemProbAnnotations.add(cpa); } public ArrayList getChemProbAnnotations() { return _ChemProbAnnotations; } public void setColorMapValues(Double[] values, ModeleColorMap cm) { setColorMapValues(values, cm, false); } public void adaptColorMapToValues(ModeleColorMap cm) { double min = Double.MAX_VALUE; double max = Double.MIN_VALUE; for (int i=0;i> vals = new ArrayList>(); ArrayList curVals = new ArrayList(); int type = st.nextToken(); while (type != StreamTokenizer.TT_EOF) { switch(type) { case (StreamTokenizer.TT_NUMBER): curVals.add(st.nval); break; case (StreamTokenizer.TT_EOL): if (curVals.size()>0) { vals.add(curVals); curVals = new ArrayList(); } break; } type = st.nextToken(); } if (curVals.size()>0) vals.add(curVals); Double[] v = new Double[vals.size()]; for (int i=0;i tab = vals.get(i); v[i] = tab.get(tab.size()-1); } setColorMapValues(v, cm, true); } catch (IOException e) { e.printStackTrace(); } } public void setColorMapValues(Double[] values, ModeleColorMap cm, boolean rescaleColorMap) { if (values.length>0) { for (int i=0;i s) { int i = 0; int j = 0; while ((i0)?s.get(i).charAt(0):' ')); ((ModeleBasesComparison)mb).set_base2(((s.get(i+1).length()>0)?s.get(i+1).charAt(0):' ')); i+=2;j++; } else j++; } } public void eraseSequence() { int j = 0; while ((j<_listeBases.size())) { ModeleBase mb = _listeBases.get(j); if (mb instanceof ModeleBaseNucleotide) { ((ModeleBaseNucleotide)mb).set_c(""); j++; } else if (mb instanceof ModeleBasesComparison) { ((ModeleBasesComparison)mb).set_base1(' '); ((ModeleBasesComparison)mb).set_base2(' '); j++; } else j++; } } public RNA clone () { try { ByteArrayOutputStream out = new ByteArrayOutputStream (); ObjectOutputStream oout = new ObjectOutputStream (out); oout.writeObject (this); ObjectInputStream in = new ObjectInputStream ( new ByteArrayInputStream (out.toByteArray ())); return (RNA)in.readObject (); } catch (Exception e) { throw new RuntimeException ("cannot clone class [" + this.getClass ().getName () + "] via serialization: " + e.toString ()); } } public ModeleBase getBaseAt(int index) { return this._listeBases.get(index); } public ArrayList getBasesAt(Collection indices) { ArrayList mbs = new ArrayList(); for (int i: indices) { mbs.add(getBaseAt(i)); } return mbs; } public ArrayList getBasesBetween(int from, int to) { ArrayList mbs = new ArrayList(); int bck = Math.min(from, to); to = Math.max(from, to); from = bck; for (int i=from;i<=to;i++) { mbs.add(getBaseAt(i)); } return mbs; } public void addHighlightRegion(HighlightRegionAnnotation n) { _listeRegionHighlights.add(n); } public void removeHighlightRegion(HighlightRegionAnnotation n) { _listeRegionHighlights.remove(n); } public void removeChemProbAnnotation(ChemProbAnnotation a) { _ChemProbAnnotations.remove(a); } public void addHighlightRegion(int from, int to, Color fill, Color outline, double radius) { _listeRegionHighlights.add(new HighlightRegionAnnotation(getBasesBetween(from, to),fill,outline,radius)); } public void addHighlightRegion(int from, int to) { _listeRegionHighlights.add(new HighlightRegionAnnotation(getBasesBetween(from, to))); } public ArrayList getHighlightRegion() { return _listeRegionHighlights; } /** * Rotates the RNA coordinates by a certain angle * * @param angleDegres * Rotation angle, in degrees */ public void globalRotation(Double angleDegres) { if (_listeBases.size() > 0) { // angle en radian Double angle = angleDegres * Math.PI / 180; // initialisation du minimum et dumaximum Double maxX = _listeBases.get(0).getCoords().x; Double maxY = _listeBases.get(0).getCoords().y; Double minX = _listeBases.get(0).getCoords().x; Double minY = _listeBases.get(0).getCoords().y; // mise a jour du minimum et du maximum for (int i = 0; i < _listeBases.size(); i++) { if (_listeBases.get(i).getCoords().getX() < minX) minX = _listeBases.get(i).getCoords().getX(); if (_listeBases.get(i).getCoords().getY() < minY) minY = _listeBases.get(i).getCoords().getY(); if (_listeBases.get(i).getCoords().getX() > maxX) maxX = _listeBases.get(i).getCoords().getX(); if (_listeBases.get(i).getCoords().getX() > maxY) maxY = _listeBases.get(i).getCoords().getY(); } // creation du point central Point2D.Double centre = new Point2D.Double((maxX - minX) / 2, (maxY - minY) / 2); Double x, y; for (int i = 0; i < _listeBases.size(); i++) { // application de la rotation au centre de chaque base // x' = cos(theta)*(x-xc) - sin(theta)*(y-yc) + xc x = Math.cos(angle) * (_listeBases.get(i).getCenter().getX() - centre.x) - Math.sin(angle) * (_listeBases.get(i).getCenter().getY() - centre.y) + centre.x; // y' = sin(theta)*(x-xc) + cos(theta)*(y-yc) + yc y = Math.sin(angle) * (_listeBases.get(i).getCenter().getX() - centre.x) + Math.cos(angle) * (_listeBases.get(i).getCenter().getY() - centre.y) + centre.y; _listeBases.get(i).setCenter( new Point2D.Double(x, y)); // application de la rotation au coordonnees de chaque // base // x' = cos(theta)*(x-xc) - sin(theta)*(y-yc) + xc x = Math.cos(angle) * (_listeBases.get(i).getCoords().getX() - centre.x) - Math.sin(angle) * (_listeBases.get(i).getCoords().getY() - centre.y) + centre.x; // y' = sin(theta)*(x-xc) + cos(theta)*(y-yc) + yc y = Math.sin(angle) * (_listeBases.get(i).getCoords().getX() - centre.x) + Math.cos(angle) * (_listeBases.get(i).getCoords().getY() - centre.y) + centre.y; _listeBases.get(i).setCoords( new Point2D.Double(x, y)); } } } public boolean testDirectionality(int i, int j, int k) { // Which direction are we heading toward? Point2D.Double pi = getCoords(i); Point2D.Double pj = getCoords(j); Point2D.Double pk = getCoords(k); return testDirectionality(pi, pj, pk); } public static boolean testDirectionality(Point2D.Double pi, Point2D.Double pj, Point2D.Double pk) { // Which direction are we heading toward? double test = (pj.x - pi.x) * (pk.y - pj.y) - (pj.y - pi.y) * (pk.x - pj.x); return test < 0.0; } public double getOrientation() { double maxDist = Double.MIN_VALUE; double angle = 0; for(int i=0; i< _listeBases.size();i++) { ModeleBase b1 = _listeBases.get(i); for(int j=i+1; j< _listeBases.size();j++) { ModeleBase b2 = _listeBases.get(j); Point2D.Double p1 = b1._coords.toPoint2D(); Point2D.Double p2 = b2._coords.toPoint2D(); double dist = p1.distance(p2); if(dist>maxDist) { maxDist = dist; angle = VueUI.computeAngle(p1, p2); } } } return angle; } public boolean hasVirtualLoops() { boolean consecutiveBPs = false; for(int i=0;i<_listeBases.size();i++) { int j =_listeBases.get(i).getElementStructure(); if (j==i+1) { consecutiveBPs = true; } } return ((_drawMode!=DRAW_MODE_LINEAR) &&(_drawMode!=DRAW_MODE_CIRCULAR) &&(consecutiveBPs)); } } PK 4F>i 0fr/orsay/lri/varna/models/rna/ModeleStrand.class1[*fr/orsay/lri/varna/models/rna/ModeleStrandjava/lang/Object_strandLjava/util/ArrayList; SignatureALjava/util/ArrayList; hasBeenPlacedZ strandLeft strandRight levelPositionI()VCode  java/util/ArrayList       LineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/models/rna/ModeleStrand;addBase-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)V & '(add(Ljava/lang/Object;)Zmb*Lfr/orsay/lri/varna/models/rna/ModeleBase;.(ILfr/orsay/lri/varna/models/rna/ModeleBase;)V - '.(ILjava/lang/Object;)Vindex sizeStrand()I 3 41sizegetMB-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; 8 9:get(I)Ljava/lang/Object;<(fr/orsay/lri/varna/models/rna/ModeleBaseagetArrayListMB()Ljava/util/ArrayList;C()Ljava/util/ArrayList;getLevelPosition C setLevelPosition(I)VgetStrandRight()ZsetStrandRight(Z)Vbool getStrandLeft setStrandLeftsetHasBeenPlaced existInStrand(I)Z Q 01 S 56 ;U V1getIndexexisti SourceFileModeleStrand.java!    ]**Y***    !"#$B *+%W    !" )*#+L *,,    !" / )*012*2 !"56@ *7;  !" =>?@/*" !"A1/*B& !"DE>*B *+ !"=FG/*. !"HI>* 23 !"J KG/*6 !"LI>* :; !"J  G/*> !"MI>* BC !"J NO'*P=>6*RT>FGH IJH%M 4'!"'="4 W  XYZPK <#/fr/orsay/lri/varna/models/rna/ModeleStrand.javapackage fr.orsay.lri.varna.models.rna; import java.util.ArrayList; public class ModeleStrand { private ArrayList _strand = new ArrayList(); private boolean hasBeenPlaced = false; private boolean strandLeft = false; private boolean strandRight = false; private int levelPosition; public ModeleStrand(){ } public void addBase(ModeleBase mb){ this._strand.add(mb); } public void addBase(int index, ModeleBase mb){ this._strand.add(index, mb); } public int sizeStrand() { return this._strand.size(); } public ModeleBase getMB(int a) { return this._strand.get(a); } public ArrayList getArrayListMB() { return this._strand; } public int getLevelPosition(){ return this.levelPosition; } public void setLevelPosition(int a){ this.levelPosition=a; } public boolean getStrandRight(){ return this.strandRight; } public void setStrandRight(boolean bool){ this.strandRight=bool; } public boolean getStrandLeft(){ return this.strandLeft; } public void setStrandLeft(boolean bool){ this.strandLeft=bool; } public boolean hasBeenPlaced(){ return this.hasBeenPlaced; } public void setHasBeenPlaced(boolean bool){ this.hasBeenPlaced =bool; } public boolean existInStrand(int a){ int size =sizeStrand(); boolean exist=false; for (int i=0; i4949)fr/orsay/lri/varna/models/rna/Motif.class1#fr/orsay/lri/varna/models/rna/Motifjava/lang/Objectjava/io/Serializable _listStrands-Lfr/orsay/lri/varna/models/rna/StructureTemp;_spaceBetweenBasesLjava/lang/Double; _listeBasesMLjava/util/ArrayList; SignatureALjava/util/ArrayList; _ajustementI _decalageD_rna#Lfr/orsay/lri/varna/models/rna/RNA;;(Lfr/orsay/lri/varna/models/rna/RNA;Ljava/util/ArrayList;)Vg(Lfr/orsay/lri/varna/models/rna/RNA;Ljava/util/ArrayList;)VCode  ()V+fr/orsay/lri/varna/models/rna/StructureTemp    "$#java/lang/Double %&valueOf(D)Ljava/lang/Double; ( * , LineNumberTableLocalVariableTablethis%Lfr/orsay/lri/varna/models/rna/Motif;rna listeBasesLocalVariableTypeTable listStrand 6 78 getListStrand/()Lfr/orsay/lri/varna/models/rna/StructureTemp; : ;clearListStrands = >?getListBasesMotif()Ljava/util/ArrayList; ACBjava/util/ArrayList DEget(I)Ljava/lang/Object;G(fr/orsay/lri/varna/models/rna/ModeleBase FI JK getBaseNumber()IM*fr/orsay/lri/varna/models/rna/ModeleStrand L LP QRaddBase-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)V FT UV setNumStrand(I)V X YK sizeStruct [ \]isEmpty()Z L_ `?getArrayListMB bdcjava/util/Collections ef reverseOrder()Ljava/util/Comparator; bh ijsort)(Ljava/util/List;Ljava/util/Comparator;)V l mn addStrand/(Lfr/orsay/lri/varna/models/rna/ModeleStrand;)V Ap qKsizeik indice_min indice_maxab orientationZstrand,Lfr/orsay/lri/varna/models/rna/ModeleStrand;j decalerBase0(Lfr/orsay/lri/varna/models/rna/ModeleStrand;D)V L getMB-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; F KgetIndex F ] getCheckerjava/awt/geom/Point2D$Double F  getCoords ()Ljava/awt/geom/Point2D$Double; x y (DD)V F  setCoords!(Ljava/awt/geom/Point2D$Double;)V L K sizeStranddecalageindice initChecker F  setChecker(Z)VinitCheckerAll   getStrand/(I)Lfr/orsay/lri/varna/models/rna/ModeleStrand; initStrand L  setStrandLeft L setStrandRight L setHasBeenPlaced L VsetLevelPosition initInterv F setIntervDroite F setIntervGauchepositionneStrand  V setAjustement  n L ] getStrandLeft L ]getStrandRight  positionneSpecificStrand(ID)V  K getAjustementspaceBetweenStrandsdroite F  getStyleBP/()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; +fr/orsay/lri/varna/models/rna/ModeleStyleBP  getPartner3,()Lfr/orsay/lri/varna/models/rna/ModeleBase;  getPartner5 java/lang/Math abs(I)I "  doubleValue()D@I L  existInStrand(I)Z ] isCanonicalddist3dist5 part3Temp part5Temppart3part5distbouclemaxmb3*Lfr/orsay/lri/varna/models/rna/ModeleBase;mb5indicePindicePP ajusteStrand  VajusteSpecificStrand   !fr/orsay/lri/varna/models/rna/RNA   getAllPartners(I)Ljava/util/ArrayList;   setDecalage(D)V   getDecalage  }~partnermb reajustement   F K getNumStrand ! "(D)D partnerLast partnerFirstnumStrandPartnerlastfirstmbLastmbfirststrandModifiedamb ccordxIndice coordxPartnergetCentralStrand partnerStrand centralStrand orderStrands 3  5 7java/util/Hashtable 6 :<;java/lang/Integer %=(I)Ljava/lang/Integer; 6? @A containsKey(Ljava/lang/Object;)Z 6C DEput8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;@N LI J] hasBeenPlaced FL M]getIntervDroite FO P]getIntervGauche LR SKgetLevelPosition 6U DV&(Ljava/lang/Object;)Ljava/lang/Object; :X YKintValue htableLastLjava/util/Hashtable; htableFirstpreviousStrand baseStrandindexPartenaire partenairespace mbPartnerindexPreviousPartenairecoordYLastBasecoordYFirstBasedistCdistBdiff=Ljava/util/Hashtable;setCenterMotif l m?getListStrands Ao pqiterator()Ljava/util/Iterator; sutjava/util/Iterator vwnext()Ljava/lang/Object; y z]isBent@ F~  setCenter@$ s ]hasNextmsuseBPdeviationBasePair  ? listBasePair  setBent basesPaircoordXBPcoordYBPcoordXBPpartnercoordYBPpartnercoordXcoordYC()Ljava/util/ArrayList; A A Aaddresult getBaseAtindex     SourceFile Motif.java InnerClassesjava/awt/geom/Point2DDouble!    "**Y*!'*,)*++-' ()!+. "/0"1"2 3 "24n <<=>6*59*<@FH6*<`@FH6d|66LYN:6 @*< @FO*< @FS*5Wp *5Z6  ^ag*5k`>*<odOLYN:66@*<@FO*<@FS*5Wp *5Z6*<o^ag*5k-%3456 8;<#=5>>?A@DAMBSCdDtFGBJKMNOQ;TVWXYZ[W"^'_2a;c. </0:r8s6t 3u#v5wAvxyMjz{PG| lz{ixyL|}~ f6Y+6+?*<@FY*<@F*<@F(c+-* fghi)j?kSjViYfen.4f/0fz{fb|Hnd=++-qrqt. /0z{|;<-=*5*5*5Wα-wx yx,w:|. ;/08r%|D<6*5*5*5*5*5Wű-)5C.D/0ArK<==&*5*5*5ф*5W- *<J. K/0Hr5|}<*=>f**5*5Ś4*5Ț&*5=*5=*˄<*Ϟh<*5W-F 6:FKWY`cjn|.*}/0{ ty qr 86666**56 *56 *< @FԶض6 *< @FԶ޶6 6 6 6*< @FԶ:*< @FԶ:*< @F *< @FY(*< @F d6 d6d*#  d6 *< @FY(*5d `*'kkc*< @Fy*< d@Fe*5d6*5d6*<@FY*< @F*<@F*5 6*5 &  *< @FԶ *< @FY*< @F*'kc*< @F    6*56 `6`*<@FY*<d@F*<d@F*'kg*<@F 6 6**`*5-@ 0G^adg{'ASVYk%5GRShk $7.8/08r852 / ,|0 G ^ a d g{N:gsY< **5W- ./0rV?=-*5>6**5*+:o@F6** *5*5@F**<@F*<@Fg *<@FY*<@F*<@F**`*5*<@F*ϙ***5**5ʱ-Z    $.6DINm #$% )*, >-.>?/0?r<|. 3 .~*<l=>69*56*5d6*56 *+: *+ : 6  o3 o+ @F= @F6 @F>^Y*<@F*< @Fg 9,*<@F*<@Fg 9*5z*<@FY*<@F*<@F*<@FY*<@F*< @F6 x*<@FY*<@F*<@F*< @FY*< @F*<@F6 6 d*5 66*+:o@F6*<@F*<@F*<@Fg 9*<@F9*<@F9 @F@*<@FY*<@F*<@F=*<@FY*<@F*<@F*<@F*<@F  *5*5W-G01 2 3 456"768G9R:];`<p=}>?BCDCEFGFI KL,MAKDOSPdQyO|RVWXVZ[\Z]cdefh&i4lLm^npmvopqrstusy z{3y6<L\co1}.~/0wr d# b$_%Z"Mq69&G(' R( ]) `* t| LI>+ v,-3 R( ]) >+.Kw <=>666i*56*+:oA@F=*<@F<  6 6*5*5Ws-V  '2:GV`filrux.\ /0/r 0|sy|'Q2F 3 2F1V, l=>*2*46Y8:6Y8:6*56*+:o@F=T*<@F9>*<@F99BW*<@F99BW*5h66*56*5: *+: 6 :  o @F6  @F: *'Fk9  -*5 H K> N6>*5 > w9 *5  K# N w9 *5 [ K N*5 8 K0 N( w9 *5 *5 *5 Q k9  9T:W62 *5*5 9T:W*  *  *5ř*5 ŚB*5șy*5 șg*5 Q*5QI*+9T:W:@F6*59T:W9*5 9T:W9g 9*5 6*< @F*5 dg 9*<@F*5g 9ccUccg9*<@FY*<@F*<@Fc*  6*5 *5`-^W $6AIV[t(@PTVikp    07K\w"#$%&'&,-"0*1C0E4M5i4k7u8<=<ABAFIJ KL5J8MARHSXkV.l/0l0jhyWZ[N\[!|6vAk ]|~o^ d a_ ^` (0a -Jr-b "cEdkeuf_gFh34WZiN\iAkd -bj *5knM,rLL+^n:rFN-6*+:o6D@F:-Զx,-Y-c{o-}6\+ř#-Y-c-}5+Ț +ř +ș -Y-g-}*, -nY[/]5^@`OaTc_difnghfknprstrvyz{y[Y.H/0{/5@+ Oy_63 @+]K*L=;+@F>*+:@F6*<@F9*<@F9*<@F9 *<@F9 6*<@F9*<@F9  k c  3 #   +#+@FԶx+@F*<oF+oñ-Z  .ATh|!0?J. K/0F Cr)  .ATh | |3F ? BAYL=u**5>R*566*+:o@F6+*<@FW*5*5W+-: /2=ESYj|.H/0  ra|/;28=- 3=-@ *<@F-. /0 K/*-. /0V>*- ./0v/*-. /0>*'- ./0v78/*-. /0>? /*)-. /0  PK *= htgtg(fr/orsay/lri/varna/models/rna/Motif.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.geom.Point2D; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Hashtable; import java.lang.Math; public class Motif implements Serializable{ StructureTemp _listStrands = new StructureTemp(); private Double _spaceBetweenBases = 1.0; private ArrayList _listeBasesM; private int _ajustement; private double _decalage; private RNA _rna; public Motif(RNA rna, ArrayList listeBases){ this._listeBasesM = listeBases; _rna = rna; } /** * Find all the strands and store them in an arrayList. */ public void listStrand() { int i=0; int k=0; //compteur de brin int indice_min = 0; int indice_max = 0; getListStrand().clearListStrands(); while ( i < getListBasesMotif().size()-1){ int a =getListBasesMotif().get(i).getBaseNumber(); int b = getListBasesMotif().get(i+1).getBaseNumber(); if((b-a)!=1){ boolean orientation = false; indice_max=i; ModeleStrand strand = new ModeleStrand(); for(int j=indice_min; j<=indice_max;j++){ strand.addBase(getListBasesMotif().get(j)); getListBasesMotif().get(j).setNumStrand(k); if(getListStrand().sizeStruct()%2==0 || getListStrand().isEmpty()){ orientation=true; } } if(!orientation){ Collections.sort(strand.getArrayListMB(), Collections.reverseOrder()); } getListStrand().addStrand(strand); k++; indice_min=i+1; } i++; } //On s'occupe du dernier brin. Ou du seul brin de la structure. ModeleStrand strand = new ModeleStrand(); //System.out.print(getListStrand().sizeStruct()+"\n"); boolean orientation = false; for(int j=indice_min;j0){ spaceBetweenStrands=2*spaceBetweenStrands; } } } /** * Set the coordinates of all bases for one strand in particular * @param i the index of the strand in the list of strands * @param d the space which separate two strands * @return the number of adjustment executed in the same strand */ public void positionneSpecificStrand(int i, double d){ int dist3=-1; int dist5=-1; int part3Temp =-1; int part5Temp=-1; this.initChecker(getListStrand().getStrand(i)); for (int j = 0; j < getListStrand().getStrand(i).sizeStrand(); j++ ){ int indice = getListStrand().getStrand(i).getMB(j).getIndex(); int part3 = getListBasesMotif().get(indice).getStyleBP().getPartner3().getIndex(); int part5 = getListBasesMotif().get(indice).getStyleBP().getPartner5().getIndex(); int dist=0; int boucle =0; int max=0; ModeleBase mb3=getListBasesMotif().get(indice).getStyleBP().getPartner3(); ModeleBase mb5=getListBasesMotif().get(indice).getStyleBP().getPartner5(); //On positionne la première base du brin if(!getListBasesMotif().get(indice).getChecker() && j==0){ getListBasesMotif().get(indice).setCoords( new Point2D.Double(d,0)); } //On positionne les autres bases du brin, les unes par rapport aux autres if(!getListBasesMotif().get(indice).getChecker() && j!=0){ dist3=Math.abs(part3Temp-part3); dist5=Math.abs(part5Temp-part5); if(Math.abs(dist3-dist5)>=0 && dist3>=dist5 && part3!=part5 && part3Temp!=-1 && part5Temp!=-1){ dist=Math.abs(dist3-dist5); boucle++; } getListBasesMotif().get(indice).setCoords( new Point2D.Double(d,getListStrand().getStrand(i).getMB(j-1).getCoords().y +(dist+1)*_spaceBetweenBases * 50)); } //Dans un meme brin, si la paire de base a ete traitee //On reajuste la structure pour eviter d'avoir des angles non droits if(getListBasesMotif().get(indice).getChecker() && !getListBasesMotif().get(indice-1).getChecker()){ int indiceP = getListStrand().getStrand(i).getMB(j-1).getIndex(); int indicePP=getListStrand().getStrand(i).getMB(j-2).getIndex(); getListBasesMotif().get(indiceP).setCoords( new Point2D.Double(getListBasesMotif().get(indice).getCoords().x,getListBasesMotif().get(indicePP).getCoords().y)); } //On verifie si la base est impliquee dans une paire intra-brin //On reajuste les coordonnees si c'est le cas : //On place le partenaire 3' en face de son partenaire 5' if((getListStrand().getStrand(i).existInStrand(part3)&&getListStrand().getStrand(i).existInStrand(part5))&& part3!=part5 && getListBasesMotif().get(indice).getStyleBP().isCanonical() && !mb3.getChecker()){ getListBasesMotif().get(part3).setCoords(new Point2D.Double (getListBasesMotif().get(part5).getCoords().x + _spaceBetweenBases * 50,getListBasesMotif().get(part5).getCoords().y)); //positionner les nt qui constituent les boucles. if((dist>=0 && boucle>0) || (part3Temp==-1 && part3!=part5)){ max=part3Temp; if(part3Temp==-1){ max = getListStrand().getStrand(i).sizeStrand(); } for(int k=part3+1; k mb = _rna.getAllPartners(indice); // A changer plus tard pour traiter les paires de base multiples... if (mb.size()>0){ partner = mb.get(0).getIndex(); } this.setAjustement(0); this.setDecalage(0); //On verifie si la base est impliquee dans une paire inter-brin //On reajuste les coordonnees si c'est le cas if((!getListStrand().getStrand(i).existInStrand(partner)||!getListStrand().getStrand(i).existInStrand(indice))&& partner!=-1 && !mb.get(0).getChecker()){ //On change les coordonnées du nucleotide present sur le brin actuel setDecalage(getListBasesMotif().get(partner).getCoords().y - getListBasesMotif().get(indice).getCoords().y); this.getListBasesMotif().get(indice).setCoords(new Point2D.Double (this.getListBasesMotif().get(indice).getCoords().x ,this.getListBasesMotif().get(partner).getCoords().y)); this.setAjustement(getAjustement()+1); this.getListStrand().getStrand(i).getMB(j).setChecker(true); this.getListBasesMotif().get(partner).setChecker(true); } //decaler les autres bases du brin s'il y a eu reajustement if(this.getAjustement()!=0 && this.getDecalage()!=0){ this.decalerBase(this.getListStrand().getStrand(i), this.getDecalage()); } } } public void reajustement(){ this.initCheckerAll(); for (int i = 0; i < getListStrand().sizeStruct(); i++ ){ int partnerLast = -1; int partnerFirst = -1; int numStrandPartner = -1; double decalage = -1; int size = getListStrand().getStrand(i).sizeStrand(); int last = getListStrand().getStrand(i).getMB(size-1).getIndex(); int first = getListStrand().getStrand(i).getMB(0).getIndex(); ArrayList mbLast = _rna.getAllPartners(last); ArrayList mbfirst = _rna.getAllPartners(first); int strandModified = -1; //brin sur lequel les changements de coord ont t effectu if (mbLast.size()>0 && mbfirst.size()>0){ partnerLast = mbLast.get(0).getIndex(); numStrandPartner = mbLast.get(0).getNumStrand(); partnerFirst = mbfirst.get(0).getIndex(); } if(partnerLast !=-1 && partnerFirst !=-1){ decalage = Math.abs(this.getListBasesMotif().get(partnerFirst).getCoords().y -this.getListBasesMotif().get(first).getCoords().y); if(decalage == 0){ decalage = Math.abs(this.getListBasesMotif().get(partnerLast).getCoords().y -this.getListBasesMotif().get(last).getCoords().y); } if(size > getListStrand().getStrand(numStrandPartner).sizeStrand()){ //On modifiera les coord des bases prsentes sur le brin le plus court this.getListBasesMotif().get(partnerLast).setCoords(new Point2D.Double( this.getListBasesMotif().get(partnerLast).getCoords().x, this.getListBasesMotif().get(last).getCoords().y)); this.getListBasesMotif().get(partnerFirst).setCoords(new Point2D.Double( this.getListBasesMotif().get(partnerFirst).getCoords().x, this.getListBasesMotif().get(first).getCoords().y)); strandModified = numStrandPartner; } else{ this.getListBasesMotif().get(last).setCoords(new Point2D.Double( this.getListBasesMotif().get(last).getCoords().x, this.getListBasesMotif().get(partnerLast).getCoords().y)); this.getListBasesMotif().get(first).setCoords(new Point2D.Double( this.getListBasesMotif().get(first).getCoords().x, this.getListBasesMotif().get(partnerFirst).getCoords().y)); strandModified = i; } } for (int j = 0; j < this.getListStrand().getStrand(i).sizeStrand(); j++ ){ int indice = this.getListStrand().getStrand(i).getMB(j).getIndex(); int partner = -1; ArrayList amb = _rna.getAllPartners(indice); if (amb.size()>0){ partner = amb.get(0).getIndex(); } if (partner!=-1 && !this.getListBasesMotif().get(indice).getChecker()){ double dist = Math.abs(this.getListBasesMotif().get(indice).getCoords().y - this.getListBasesMotif().get(partner).getCoords().y ); double ccordxIndice = this.getListBasesMotif().get(indice).getCoords().x; double coordxPartner = this.getListBasesMotif().get(partner).getCoords().x; if(dist <= decalage && ccordxIndice != coordxPartner ){ if(strandModified == amb.get(0).getNumStrand()){ this.getListBasesMotif().get(partner).setCoords(new Point2D.Double( this.getListBasesMotif().get(partner).getCoords().x, this.getListBasesMotif().get(indice).getCoords().y)); } else{ this.getListBasesMotif().get(indice).setCoords(new Point2D.Double( this.getListBasesMotif().get(indice).getCoords().x, this.getListBasesMotif().get(partner).getCoords().y)); } } } if(partner!=-1){ this.getListBasesMotif().get(partner).setChecker(true); } this.getListBasesMotif().get(indice).setChecker(true); } } } /** * Find the central strand in a RNA star pattern * @Return the index of the strand which is the central strand in a star pattern. * @Return -1 if there is no central strand. */ public int getCentralStrand(){ int partnerStrand=-1; int partner=-1; for (int i = 0; i < getListStrand().sizeStruct(); i++ ){ int centralStrand =i; int k=0; for (int j = 0; j < getListStrand().getStrand(i).sizeStrand(); j++ ){ int indice = getListStrand().getStrand(i).getMB(j).getIndex(); ArrayList mb = _rna.getAllPartners(indice); // A changer plus tard pour traiter les paires de base multiples... if (mb.size()>0){ partner = mb.get(0).getIndex(); partnerStrand=getListBasesMotif().get(partner).getNumStrand(); if(partner!=-1 && partnerStrand!=i){ if(centralStrand!=partnerStrand){ centralStrand=partnerStrand; k++; } if(k>1){ centralStrand = i; return centralStrand; } } } } } return -1; } public void orderStrands(int centralStrand){ int partner=-1; boolean droite = false; this.initStrand(); this.initInterv(); //this.getListStrand().getStrand(centralStrand).setStrandRight(true); Hashtable htableLast = new Hashtable(); Hashtable htableFirst = new Hashtable(); //Remplissage des tables de hashage //htableLast : les clés correspondent aux brins, les valeurs correspondent //à la dernière base du brin central en interaction avec un autre brin //htableFirst : les valeurs correspondent à la permière base du brin central //en interaction avec un autre brin // On boucle sur les bases du brin central for(int j = 0; j < this.getListStrand().getStrand(centralStrand).sizeStrand(); j++ ){ int indice = this.getListStrand().getStrand(centralStrand).getMB(j).getIndex(); ArrayList mb = _rna.getAllPartners(indice); if (mb.size()>0){ partner = mb.get(0).getIndex(); } // Si la base est liée à un autre brin if (partner!=-1) { if (!htableFirst.containsKey(this.getListBasesMotif().get(partner).getNumStrand())) { htableFirst.put(this.getListBasesMotif().get(partner).getNumStrand(), j); } htableLast.put(this.getListBasesMotif().get(partner).getNumStrand(), j); } } //int comptDroite=0; //permet de savoir si un brin a été placé à droite. //int comptGauche=0; int previousStrand =-1; //On boucle sur les bases du brin central for (int j = 0; j < this.getListStrand().getStrand(centralStrand).sizeStrand(); j++ ){ int indice = this.getListStrand().getStrand(centralStrand).getMB(j).getIndex(); ModeleBase baseStrand = this.getListStrand().getStrand(centralStrand).getMB(j); //récupération du partenaire // A changer plus tard pour traiter les paires de base multiples... ArrayList mb = _rna.getAllPartners(indice); int indexPartenaire = -1; ModeleBase partenaire = null; if (mb.size()>0) { indexPartenaire = mb.get(0).getIndex(); partenaire = mb.get(0); } double space = _spaceBetweenBases*60; if(indexPartenaire!=-1 && !this.getListStrand().getStrand(partenaire.getNumStrand()).hasBeenPlaced()){ //Si la base n'est pas comprise dans un intervalle à droit et à gauche if(!baseStrand.getIntervDroite() && !baseStrand.getIntervGauche()){ if(!droite){ droite=true; getListStrand().getStrand(partenaire.getNumStrand()).setStrandRight(true); //comptDroite++; } else{ droite=false; space=-space; getListStrand().getStrand(partenaire.getNumStrand()).setStrandLeft(true); //comptGauche++; } } //Si la base est comprise dans un intervalle à droite, on place le brin à gauche else if(baseStrand.getIntervDroite() && !baseStrand.getIntervGauche()){ space=-space; getListStrand().getStrand(partenaire.getNumStrand()).setStrandLeft(true); } //Si la base est comprise dans un intervalle à gauche, on place le brin à droite else if(!baseStrand.getIntervDroite() && baseStrand.getIntervGauche()){ getListStrand().getStrand(partenaire.getNumStrand()).setStrandRight(true); } //Cas ou la base est comprise à la fois dans un intervalle à gauche et à droite //On place arbitrairement le brin (a gauche) else if (baseStrand.getIntervDroite() && baseStrand.getIntervGauche()){ space=-space; getListStrand().getStrand(partenaire.getNumStrand()).setLevelPosition(2); getListStrand().getStrand(partenaire.getNumStrand()).setStrandLeft(true); } space = getListStrand().getStrand(partenaire.getNumStrand()).getLevelPosition()*space; for(int i=htableFirst.get(partenaire.getNumStrand()); i < htableLast.get(partenaire.getNumStrand()); i++){ if(space<0){ this.getListStrand().getStrand(centralStrand).getMB(i).setIntervGauche(true); } else{ this.getListStrand().getStrand(centralStrand).getMB(i).setIntervDroite(true); } } this.positionneSpecificStrand(partenaire.getNumStrand(), space); this.ajusteSpecificStrand(partenaire.getNumStrand()); if(previousStrand!=-1 && previousStrand!=partenaire.getNumStrand()){ //System.out.println("TEST1"); if(getListStrand().getStrand(previousStrand).getStrandLeft()&& getListStrand().getStrand(partenaire.getNumStrand()).getStrandLeft()|| getListStrand().getStrand(previousStrand).getStrandRight()&& getListStrand().getStrand(partenaire.getNumStrand()).getStrandRight() && getListStrand().getStrand(partenaire.getNumStrand()).getLevelPosition() == getListStrand().getStrand(previousStrand).getLevelPosition()){ //Si le brin prcdent et le brin actuel sont du mme cot et au mme niveau (sur le mme axe vertical) //System.out.println("TEST2"); //le partenaire de la dernire base du brin centrale relie au brin prcdent. ArrayList mbPartner = _rna.getAllPartners(htableLast.get(previousStrand)); int indexPreviousPartenaire = mbPartner.get(0).getIndex(); //coord Y de la derniere base du brin prcdent en intraction avec le brin central double coordYLastBase= getListStrand().getStrand(centralStrand). getMB(htableLast.get(previousStrand)).getCoords().y; //coord Y de la premiere base du brin actuel en intraction avec le brin central double coordYFirstBase= getListStrand().getStrand(centralStrand). getMB(htableFirst.get(partenaire.getNumStrand())).getCoords().y; double dist = Math.abs(coordYLastBase-coordYFirstBase); int sizeStrand = getListStrand().getStrand(partenaire.getNumStrand()).sizeStrand(); //distance entre la 1ere base du brin partenaire en interaction avec le brin central et //et la dernire base du brin partenaire double distC = Math.abs(this.getListBasesMotif().get(indexPartenaire).getCoords().y -getListStrand().getStrand(partenaire.getNumStrand()).getMB(sizeStrand-1).getCoords().y); //distance entre la derniere base du brin prcdent en interaction avec le brin central et //et la 1ere base du brin prcdent double distB = Math.abs(this.getListBasesMotif().get(indexPreviousPartenaire).getCoords().y -getListStrand().getStrand(previousStrand).getMB(0).getCoords().y); //System.out.println("DistC:"+distC+" distB:"+distB+" dist:"+dist); if((distB+distC+1)> dist){ //System.out.println("TEST3"); //on modifie la coordonne y de la base actuelle sur le brin central double diff = (distB+distC+1) - dist; this.getListBasesMotif().get(indice).setCoords(new Point2D.Double (this.getListBasesMotif().get(indice).getCoords().x , this.getListBasesMotif().get(indice).getCoords().y+diff)); this.ajusteSpecificStrand(partenaire.getNumStrand()); } } } previousStrand = partenaire.getNumStrand(); this.getListStrand().getStrand(partenaire.getNumStrand()).setHasBeenPlaced(true); } } } public void setCenterMotif(){ for (ModeleStrand ms: this.getListStrand().getListStrands()) {//System.out.println(ms.getStrandLeft()+" "+ ms.getStrandRight()); for (ModeleBase mb : ms.getArrayListMB()) { int indice = mb.getIndex(); ArrayList amb = _rna.getAllPartners(indice); boolean useBP = (amb.size()>0); if (useBP) { ModeleBase partner = amb.get(0); if (!mb.getStyleBP().isBent()) { mb.setCenter(new Point2D.Double( (mb.getCoords().x+partner.getCoords().x)/2.0 , mb.getCoords().y)); } else {useBP = false;} } if (!useBP) { if(ms.getStrandLeft()) { mb.setCenter(new Point2D.Double( mb.getCoords().x+10.0 , mb.getCoords().y)); } else if((!ms.getStrandRight() && !ms.getStrandLeft())|| ms.getStrandRight()) {// Strandright == true OU Brin central mb.setCenter(new Point2D.Double( mb.getCoords().x-10.0 , mb.getCoords().y)); } } } } } public void deviationBasePair(){ ArrayList basesPair = listBasePair(); for (int i=0; i mb = _rna.getAllPartners(indice); int partner = mb.get(0).getIndex(); double coordXBP = getListBasesMotif().get(indice).getCoords().x; double coordYBP = getListBasesMotif().get(indice).getCoords().y; double coordXBPpartner = getListBasesMotif().get(partner).getCoords().x; double coordYBPpartner = getListBasesMotif().get(partner).getCoords().y; //System.out.println(partner+" "+indice); for(int j=0; jcoordXBPpartner)||(coordXcoordXBP)) || (coordYcoordYBPpartner)||(coordYcoordYBP)){ if(!basesPair.get(i).getStyleBP().isBent()){ basesPair.get(i).getStyleBP().setBent(1.0); } } } } } } } /** * Create an arrayList which contain all bases which are involved in a base pair. */ public ArrayList listBasePair(){ ArrayList result = new ArrayList(); for (int i = 0; i < getListStrand().sizeStruct(); i++ ){ this.initChecker(getListStrand().getStrand(i)); for (int j = 0; j < getListStrand().getStrand(i).sizeStrand(); j++ ){ int indice = this.getListStrand().getStrand(i).getMB(j).getIndex(); int partner=-1; ArrayList mb = _rna.getAllPartners(indice); if (mb.size()>0){ partner = mb.get(0).getIndex(); } // Si la base est liée à une autre base if (partner!=-1 /*&& !getListBasesMotif().get(partner).getChecker()*/ ) { result.add(getListBasesMotif().get(indice)); //getListBasesMotif().get(indice).setChecker(true); } } } return result; } public ModeleBase getBaseAt(int index) { return getListBasesMotif().get(index); } public int getAjustement(){ return this._ajustement; } public void setAjustement(int a){ this._ajustement = a; } public double getDecalage(){ return this._decalage; } public void setDecalage(double a){ this._decalage = a; } public StructureTemp getListStrand(){ return this._listStrands; } public ArrayList getListBasesMotif(){ return this._listeBasesM; } } PK 4F><Sfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES.class1:Mfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATESjava/lang/EnumNORMALOLfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES; SUBSCRIPT SUPERSCRIPTCOMMAND ENUM$VALUESP[Lfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES;()VCode  (Ljava/lang/String;I)V          LineNumberTableLocalVariableTable thisvaluesR()[Lfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES; (*)java/lang/System +, arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfc(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES; 0 -15(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileModeleBaseNucleotide.java SignatureaLjava/lang/Enum; InnerClasses82fr/orsay/lri/varna/models/rna/ModeleBaseNucleotideSTATE_SPECIAL_CHARS_STATES@0@@@@   tTYYYYYSYSYSYS!"1*+#!" $ %&6YK*Y<YM',!" -.* */!"23456 79@PK 4F>tZtT!T!8fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide.class1I2fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide(fr/orsay/lri/varna/models/rna/ModeleBaseserialVersionUIDJ ConstantValue)o_cLjava/lang/String;_indexI _subscriptsLjava/util/HashMap; Signature?Ljava/util/HashMap; _superscripts _commands;[$SWITCH_TABLE$fr$orsay$lri$varna$models$rna$ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES[I()VCodejava/util/HashMap     "  $ LineNumberTableLocalVariableTable(I)V) + ,(Ljava/lang/String;I)Vthis4Lfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide;index1-fr/orsay/lri/varna/models/rna/ModeleStyleBase 0 4 5E(Ljava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;I)Vs(Ljava/lang/String;II)V 9 :  _realIndex baseNumber=java/awt/geom/Point2D$Double < @ A(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;ZLjava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;II)Vmsb/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;4(Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;II)VF"(Ljava/awt/geom/Point2D$Double;I)V <I JKgetX()D <M NKgetY <P Q(DD)VcoordLjava/awt/geom/Point2D$Double;8(Lfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide;I)V V WX getCoords ()Ljava/awt/geom/Point2D$Double; Z [X getCenter ] ^_get_c()Ljava/lang/String; a bc getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase; e fggetElementStructure()Imb  kmljava/lang/Character novalueOf(C)Ljava/lang/Character; q rsput8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;ualphawbetaygamma{delta}epsilonzetaetathetaiotakappalambdamunuxiomicronpirhosigmatauupsilonphichipsiomegaPsiPhiSigmaPiThetaOmegaGammaDeltaLambda java/lang/Boolean n(Z)Ljava/lang/Boolean;  _colorieLjava/lang/Boolean;   C _styleBase(fr/orsay/lri/varna/models/rna/VARNAPoint !(Ljava/awt/geom/Point2D$Double;)V  _coords*Lfr/orsay/lri/varna/models/rna/VARNAPoint;  _center  _elementStructure   _valueDcoordscentercolorieZlabel elementStruct  booleanValue()Z  decode&(Ljava/lang/String;)Ljava/lang/String;set_c(Ljava/lang/String;)V_s getColorie()Ljava/lang/Boolean; setColorie(Ljava/lang/Boolean;)V getContentgetIndextoStringjava/lang/StringBuilder  append(I)Ljava/lang/StringBuilder; ( -(Ljava/lang/String;)Ljava/lang/StringBuilder;) (x,y):  -(Ljava/lang/Object;)Ljava/lang/StringBuilder; C:  _  java/lang/String  glength   Mfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES NORMALOLfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES;  charAt(I)C  ()[I   gordinal    SUBSCRIPT     SUPERSCRIPT  " #COMMAND % n&&(Ljava/lang/Object;)Ljava/lang/String; (  * +(C)Ljava/lang/StringBuilder; - ./ containsKey(Ljava/lang/Object;)Z 1 23get&(Ljava/lang/Object;)Ljava/lang/Object;stateresultbuffericC ;   = >?valuesR()[Lfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES;Ajava/lang/NoSuchFieldError SourceFileModeleBaseNucleotide.java InnerClassesSTATE_SPECIAL_CHARS_STATESGjava/awt/geom/Point2DDouble!     KYY!Y#% &'@*(*% -.&-./ ,P*+0Y23% 7 8& -.6 / 7c*+0Y23*8%B CD&*-.6 / ; 5h*+,?%OPQ&*-.6 BC/ D^*E+3*8%Z[ \&*-.BC/ ; Gq'*E0Y2?%fg"h&i& '-.'RS'/ T=**+% &-. /*%& -.>*+% &-.fg/*Ь%& -._/*\%& -.g/*Ӭ%& -._a7Y*8*Ӷ*ɶ*Ͷ%& 7-. K** LEMEN6*6+.zqq/6\_,6%L8L1EN!L'Y,$')M L 7\_-7&LLEN!L+1j,#Y,$'j0ML+1!j,#Y,$'!j0MY,$')M LN5 \^l_)#-,Y,$'#-0MY,$'-MENL#-,Y,$'#-0MY,$'-MENL#-,Y,$'#-0MY,$'-MEN!LZ L#-,Y,$'#-0MY,$'-MENY-$')N*m#-,Y,$'#-0MY,$'-M,% B  " % Hhlosvy}!%()+,./023 45>7R8V<Y?BCEFGHJKMNOP RS0UCVFWJXMZQ[[]wacdfmosu&>6 45 6 7 "89J:YW< K*!OW* OW*OW*OW*Y:@&)@*36@7@C@%&BCD E@<FH PK \=,co''7fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.geom.Point2D; import java.util.HashMap; /** * The rna base model with the first character of the nitrogenous base and it * display * * @author darty * */ public class ModeleBaseNucleotide extends ModeleBase { /** * */ private static final long serialVersionUID = -5493938366569588113L; private String _c; private int _index; /** * Creates a new rna base with the default display style and a space as * nitrogenous base */ public ModeleBaseNucleotide(int index) { this(" ", index); } /** * Creates a new rna base with the nitrogenous base * * @param c * The first character of the nitrogenous base */ public ModeleBaseNucleotide(String s, int index) { this(s, new ModeleStyleBase(), index); } /** * Creates a new rna base with the nitrogenous base * * @param s * The full label, potentially requiring further decoding */ public ModeleBaseNucleotide(String s, int index, int baseNumber) { this(s, new ModeleStyleBase(), index); _realIndex = baseNumber; } /** * Creates a new rna base with the nitrogenous base and the display style * * @param c * The first character of the nitrogenous base * @param msb * The display style */ public ModeleBaseNucleotide(String s, ModeleStyleBase msb, int index) { this(new Point2D.Double(), new Point2D.Double(), true, s, msb, -1, index); } /** * Creates a new rna base with a display style * * @param msb * The display style */ public ModeleBaseNucleotide(ModeleStyleBase msb, int index, int baseNumber) { this("", msb, index); _realIndex = baseNumber; } /** * Creates a new rna base with a space as the nitrogenous base and the * display style * * @param coord * @param index */ public ModeleBaseNucleotide(Point2D.Double coord, int index) { this(new Point2D.Double(coord.getX(), coord.getY()), new Point2D.Double(), true, "", new ModeleStyleBase(), -1, index); } /** * Creates a new rna base from another one with the same attributes * * @param mb * The base to copy */ public ModeleBaseNucleotide(ModeleBaseNucleotide mb, int index) { this( new Point2D.Double(mb.getCoords().getX(), mb.getCoords() .getY()), new Point2D.Double(mb.getCenter().getX(), mb .getCenter().getY()), true, mb.get_c(), mb .getStyleBase(), mb.getElementStructure(), index); } public ModeleBaseNucleotide(Point2D.Double coords, Point2D.Double center, boolean colorie, String label, ModeleStyleBase mb, int elementStruct, int index) { _colorie = colorie; _c = label; _styleBase = mb; _coords = new VARNAPoint(coords); _center = new VARNAPoint(center); _elementStructure = elementStruct; _index = index; _realIndex = index + 1; _value = 0.0; } public ModeleStyleBase getStyleBase() { if (_colorie) return _styleBase; return new ModeleStyleBase(); } public String get_c() { return decode(_c); } public void set_c(String _s) { this._c = _s; } public Boolean getColorie() { return _colorie; } public void setColorie(Boolean _colorie) { this._colorie = _colorie; } public int getElementStructure() { return _elementStructure; } public String getContent() { return get_c(); } public int getIndex() { return _index; } public String toString() { return ""+this._realIndex+" ("+_index+") (x,y):"+this._coords +" C:"+_center; } private enum STATE_SPECIAL_CHARS_STATES{ NORMAL,SUBSCRIPT, SUPERSCRIPT, COMMAND}; private static HashMap _subscripts = new HashMap(); private static HashMap _superscripts = new HashMap(); private static HashMap _commands = new HashMap(); { _subscripts.put('0', '\u2080'); _subscripts.put('1', '\u2081'); _subscripts.put('2', '\u2082'); _subscripts.put('3', '\u2083'); _subscripts.put('4', '\u2084'); _subscripts.put('5', '\u2085'); _subscripts.put('6', '\u2086'); _subscripts.put('7', '\u2087'); _subscripts.put('8', '\u2088'); _subscripts.put('9', '\u2089'); _subscripts.put('+', '\u208A'); _subscripts.put('-', '\u208B'); _subscripts.put('a', '\u2090'); _subscripts.put('e', '\u2091'); _subscripts.put('o', '\u2092'); _subscripts.put('i', '\u1D62'); _subscripts.put('r', '\u1D63'); _subscripts.put('u', '\u1D64'); _subscripts.put('v', '\u1D65'); _subscripts.put('x', '\u2093'); _superscripts.put('0', '\u2070'); _superscripts.put('1', '\u00B9'); _superscripts.put('2', '\u00B2'); _superscripts.put('3', '\u00B3'); _superscripts.put('4', '\u2074'); _superscripts.put('5', '\u2075'); _superscripts.put('6', '\u2076'); _superscripts.put('7', '\u2077'); _superscripts.put('8', '\u2078'); _superscripts.put('9', '\u2079'); _superscripts.put('+', '\u207A'); _superscripts.put('-', '\u207B'); _superscripts.put('i', '\u2071'); _superscripts.put('n', '\u207F'); _commands.put("alpha", '\u03B1'); _commands.put("beta", '\u03B2'); _commands.put("gamma", '\u03B3'); _commands.put("delta", '\u03B4'); _commands.put("epsilon",'\u03B5'); _commands.put("zeta", '\u03B6'); _commands.put("eta", '\u03B7'); _commands.put("theta", '\u03B8'); _commands.put("iota", '\u03B9'); _commands.put("kappa", '\u03BA'); _commands.put("lambda", '\u03BB'); _commands.put("mu", '\u03BC'); _commands.put("nu", '\u03BD'); _commands.put("xi", '\u03BE'); _commands.put("omicron",'\u03BF'); _commands.put("pi", '\u03C1'); _commands.put("rho", '\u03C2'); _commands.put("sigma", '\u03C3'); _commands.put("tau", '\u03C4'); _commands.put("upsilon",'\u03C5'); _commands.put("phi", '\u03C6'); _commands.put("chi", '\u03C7'); _commands.put("psi", '\u03C8'); _commands.put("omega", '\u03C9'); _commands.put("Psi", '\u03A8'); _commands.put("Phi", '\u03A6'); _commands.put("Sigma", '\u03A3'); _commands.put("Pi", '\u03A0'); _commands.put("Theta", '\u0398'); _commands.put("Omega", '\u03A9'); _commands.put("Gamma", '\u0393'); _commands.put("Delta", '\u0394'); _commands.put("Lambda", '\u039B'); } private static String decode(String s) { if (s.length()<=1) { return s; } STATE_SPECIAL_CHARS_STATES state = STATE_SPECIAL_CHARS_STATES.NORMAL; String result = ""; String buffer = ""; for(int i=0;i6fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge.class1O0fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edgejava/lang/Enum WATSON_CRICK2Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;SUGAR HOOGSTEEN>$SWITCH_TABLE$fr$orsay$lri$varna$models$rna$ModeleStyleBP$Edge[I ENUM$VALUES3[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;()VCode  (Ljava/lang/String;I)V        LineNumberTableLocalVariableTable thistoString()Ljava/lang/String; & '()[I ) *+ordinal()I- Watson Crick/Sugar1 Hoogsteen3values5()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; 798java/lang/System :; arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfF(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; ? <@5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; B D 45Fjava/lang/NoSuchFieldError SourceFileModeleStyleBP.java SignatureDLjava/lang/Enum; InnerClassesM+fr/orsay/lri/varna/models/rna/ModeleStyleBPEdge@1@@@   eAYYYYSYSYS ('' 1*+!' "#$j0%*(.%",.02*$,'.*0-2 0" 456YK*Y<YM6,  <=* *>  'u=AYWC K*(OW*(OW*(OW*YAE&)E*36E' GHIJK LN@PK 4F>d_.;fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity.class1I5fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericityjava/lang/EnumCIS7Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;TRANSC$SWITCH_TABLE$fr$orsay$lri$varna$models$rna$ModeleStyleBP$Stericity[I ENUM$VALUES8[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;()VCode  (Ljava/lang/String;I)V      LineNumberTableLocalVariableTable thistoString()Ljava/lang/String; " #()[I % &'ordinal()I)Cis+Trans-values:()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity; 132java/lang/System 45 arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfK(Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity; 9 6:5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; <  > ./@java/lang/NoSuchFieldError SourceFileModeleStyleBP.java SignatureILjava/lang/Enum; InnerClassesG+fr/orsay/lri/varna/models/rna/ModeleStyleBP Stericity@1@@    R.YYYSYS 761*+6  _)!*$.(*,: <#>&@ ) ./6YK*Y<YM0, 67* *8#`0;YW= K*$OW*$OW*Y;?&)?6ABCDE FH@PK 4F> D % %1fr/orsay/lri/varna/models/rna/ModeleStyleBP.class1\+fr/orsay/lri/varna/models/rna/ModeleStyleBPjava/lang/Objectjava/io/Serializablejava/lang/ComparableserialVersionUIDJ ConstantValueV5Y_isCustomColoredZ_colorLjava/awt/Color; _partner5*Lfr/orsay/lri/varna/models/rna/ModeleBase;_edge52Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; _partner3_edge3 _stericity7Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity; _thicknessD_bent PARAM_COLORLjava/lang/String; colorPARAM_THICKNESS# thickness PARAM_EDGE5&edge5 PARAM_EDGE3)edge3PARAM_STERICITY, stericityVALUE_WATSON_CRICK/wcVALUE_HOOGSTEEN2h VALUE_SUGAR5s VALUE_CIS8cis VALUE_TRANS;transgetBent()DCode @ LineNumberTableLocalVariableTablethis-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;isBent()ZsetBent(D)Vb()VM2fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide LO JP(I)V R JSW(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V UWV0fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge X WATSON_CRICK Z\[5fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity ]CIS _ J`(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;)Vpart5part3 d JK f  hji%fr/orsay/lri/varna/models/VARNAConfig kDEFAULT_BOND_COLOR m  q  s  u  w  y  { ster setStericity:(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;)VsetEdge55(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;)VesetEdge3 isCanonicalGC (fr/orsay/lri/varna/models/rna/ModeleBase  getContent()Ljava/lang/String; java/lang/String length()I  toUpperCase charAt(I)C  F isCanonical   getStericity9()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;sisjciCcj isCanonicalAU isWobbleUGisCISisTRANS Z TRANSgetEdgePartner54()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;getEdgePartner3 getPartnerV(Lfr/orsay/lri/varna/models/rna/ModeleBase;)Lfr/orsay/lri/varna/models/rna/ModeleBase;mb getPartner5,()Lfr/orsay/lri/varna/models/rna/ModeleBase; getPartner3 getIndex5 getIndex getIndex3 setPartner5-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)V setPartner3setCustomColor(Ljava/awt/Color;)VcuseDefaultColorisCustomColoredgetCustomColor()Ljava/awt/Color;getColor"(Ljava/awt/Color;)Ljava/awt/Color;  Fdef getThickness(D)D setThicknessassignParameters(Ljava/lang/String;)V ExceptionsAfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError5fr/orsay/lri/varna/exceptions/ExceptionParameterError equals(Ljava/lang/Object;)Z, split'(Ljava/lang/String;)[Ljava/lang/String;java/util/ArrayList d=java/lang/StringBuilderBad parameter: ' J append-(Ljava/lang/String;)Ljava/lang/StringBuilder;' ... toString  replaceD(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; add get(I)Ljava/lang/Object;   toLowerCase -fr/orsay/lri/varna/models/rna/ModeleStyleBase  getSafeColor$(Ljava/lang/String;)Ljava/awt/Color;     java/lang/NumberFormatException  getMessageBad inner color Syntax:  J'(Ljava/lang/String;Ljava/lang/String;)V java/lang/Double  parseDouble(Ljava/lang/String;)D  HBad value for bp thickness:   U! " HOOGSTEEN U$ %SUGAR'Bad value for edge: * , }~.Bad value for stericity:0Unknown parameter: 2 3sizeparametersValue parametersL[Ljava/lang/String; namesArrayLjava/util/ArrayList; valuesArrayparamiI!Ljava/lang/NumberFormatException;LocalVariableTypeTable)Ljava/util/ArrayList; A BCvalueOf&(Ljava/lang/Object;)Ljava/lang/String;E( G H(I)Ljava/lang/StringBuilder;J)result compareTo0(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)I O Q (Ljava/lang/Object;)I T LM SourceFileModeleStyleBP.java SignaturemLjava/lang/Object;Ljava/io/Serializable;Ljava/lang/Comparable; InnerClassesEdge Stericity!    ! "$ %' (* +- .0 13 46 79 :$<=>/*?AOB CDEF>7 *?AUB  CDGH>>*'?A Z[BCDIJK>C*LYNLYNQA _`B CDJS>R*+,TTY^A cdB CDabJ`>8*c*e*gl*np*?*+r*,t*-v*x*zA. h$ %JKj!k&l+m1n7rB>8CD8a8b8&8)8|}~>>*+zA vwBCD5>>*+vA z{BCD>>*+xA ~BCDF>d*rL*tM+M,E+>,6G CCG**YA" )3MbB4dCD\T)93/F>T*rL*tM+=,5+>,6A UUA*A" )3MRB4TCDLD))3F>T*rL*tM+=,5+>,6G UUG*A" )3MRB4TCDLD))3F>T"*vT*xT*zYA!B "CD>/*zAB CDF>8*zYAB CDF>8*zAB CD>/*vAB CD>/*xAB CD>N+*t*r*tA BCD>/*rAB CD>/*tAB CD>2*rAB CD>2*tAB CD>>*+rA BCD>>*+tA BCD>G *e*+lA B CD K>4*eA B CDF>/*eAB CD>/*lAB CD>J*ę*l+A BCD>L*p*p'A BCDH>>*'pA   BCD#>+Ѷә+׶MYNY:6Y,2:#YY2-2ѶW2ѶW,6G-ә@*:Y Y-"ә@*:Y Y-%әv:.ә *Tk1ә * T4ә *#=YY&(-(әv:.ә *T)1ә * )4ә *#)YY&(-+ә_:7ә *Y+]:ә *+FYY-(YY/--1  AA   ""(#3$:%>&V%Z'j({"+,./.012146789)8-;A<M=Z>d?q@{ABDEDFGHIJKLMO'P7O;QOR[ShTrUVXYX[\[+^B CD45678"983K:6%`;<P;<'='=Mg5g5[P5>7?"9?>u9LY+@D*rF׶*tFIL+Aab7gB9CD6KLM>[*N+N *N+Nd*P+PdAl mnBCDDALR>) *+SABUVWXYUZ@Z[@PK K'>*O(O(0fr/orsay/lri/varna/models/rna/ModeleStyleBP.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.Color; import java.io.Serializable; import java.util.ArrayList; import java.util.Random; import fr.orsay.lri.varna.exceptions.ExceptionModeleStyleBaseSyntaxError; import fr.orsay.lri.varna.exceptions.ExceptionParameterError; import fr.orsay.lri.varna.models.VARNAConfig; public class ModeleStyleBP implements Serializable, Comparable { /** * */ private static final long serialVersionUID = -1344722280822711931L; private boolean _isCustomColored = false; private Color _color = VARNAConfig.DEFAULT_BOND_COLOR; public enum Edge { WATSON_CRICK, SUGAR, HOOGSTEEN; public String toString() { switch (this) { case WATSON_CRICK: return "Watson Crick"; case SUGAR: return "Sugar"; case HOOGSTEEN: return "Hoogsteen"; } return ""; } } public enum Stericity { CIS, TRANS; public String toString() { switch (this) { case CIS: return "Cis"; case TRANS: return "Trans"; } return ""; } } private ModeleBase _partner5; private Edge _edge5; private ModeleBase _partner3; private Edge _edge3; private Stericity _stericity; private double _thickness = -1.0; private double _bent = 0.0; public double getBent() { return _bent; } public boolean isBent() { return (_bent!=0.0); } public void setBent(double b) { _bent = b; } public ModeleStyleBP() { this(new ModeleBaseNucleotide(-1), new ModeleBaseNucleotide(-1)); } public ModeleStyleBP(ModeleBase part5, ModeleBase part3) { this(part5, part3, Edge.WATSON_CRICK, Edge.WATSON_CRICK, Stericity.CIS); } //private static Random rnd = new Random(System.currentTimeMillis()); public ModeleStyleBP(ModeleBase part5, ModeleBase part3, Edge edge5, Edge edge3, Stericity ster) { _partner5 = part5; _partner3 = part3; _edge5 = edge5; _edge3 = edge3; _stericity = ster; // _edge1 = getRandomEdge(); // _edge2 = getRandomEdge(); // _stericity = getRandomStericity(); } public void setStericity(Stericity s) { _stericity = s; } public void setEdge5(Edge e) { _edge5 = e; } public void setEdge3(Edge e) { _edge3 = e; } public boolean isCanonicalGC() { String si = _partner5.getContent(); String sj = _partner3.getContent(); if ((si.length() >= 1) && (sj.length() >= 1)) { char ci = si.toUpperCase().charAt(0); char cj = sj.toUpperCase().charAt(0); if (((ci == 'G') && (cj == 'C')) || ((ci == 'C') && (cj == 'G'))) { return isCanonical() && (getStericity() == Stericity.CIS); } } return false; } public boolean isCanonicalAU() { String si = _partner5.getContent(); String sj = _partner3.getContent(); if ((si.length() >= 1) && (sj.length() >= 1)) { char ci = si.toUpperCase().charAt(0); char cj = sj.toUpperCase().charAt(0); if (((ci == 'A') && (cj == 'U')) || ((ci == 'U') && (cj == 'A'))) { return isCanonical(); } } return false; } public boolean isWobbleUG() { String si = _partner5.getContent(); String sj = _partner3.getContent(); if ((si.length() >= 1) && (sj.length() >= 1)) { char ci = si.toUpperCase().charAt(0); char cj = sj.toUpperCase().charAt(0); if (((ci == 'G') && (cj == 'U')) || ((ci == 'U') && (cj == 'G'))) { return (isCanonical()); } } return false; } public boolean isCanonical() { return (_edge5 == Edge.WATSON_CRICK) && (_edge3 == Edge.WATSON_CRICK) && (_stericity == Stericity.CIS); } public Stericity getStericity() { return _stericity; } public boolean isCIS() { return (_stericity == Stericity.CIS); } public boolean isTRANS() { return (_stericity == Stericity.TRANS); } public Edge getEdgePartner5() { return _edge5; } public Edge getEdgePartner3() { return _edge3; } public ModeleBase getPartner(ModeleBase mb) { if (mb == _partner3) return _partner5; else return _partner3; } public ModeleBase getPartner5() { return _partner5; } public ModeleBase getPartner3() { return _partner3; } public int getIndex5() { return _partner5.getIndex(); } public int getIndex3() { return _partner3.getIndex(); } public void setPartner5(ModeleBase mb) { _partner5 = mb; } public void setPartner3(ModeleBase mb) { _partner3 = mb; } public void setCustomColor(Color c) { _isCustomColored = true; _color = c; } public void useDefaultColor() { _isCustomColored = false; } public boolean isCustomColored() { return _isCustomColored; } public Color getCustomColor() { return _color; } /** * Returns the current custom color if such a color is defined to be used * (through setCustomColor), or returns the default color. * * @param def * - The default color is no custom color is defined * @return The color to be used to draw this base-pair */ public Color getColor(Color def) { if (isCustomColored()) { return _color; } else { return def; } } public double getThickness(double def) { if (_thickness > 0) return _thickness; else return def; } public void setThickness(double thickness) { _thickness = thickness; } public static final String PARAM_COLOR = "color"; public static final String PARAM_THICKNESS = "thickness"; public static final String PARAM_EDGE5 = "edge5"; public static final String PARAM_EDGE3 = "edge3"; public static final String PARAM_STERICITY = "stericity"; public static final String VALUE_WATSON_CRICK = "wc"; public static final String VALUE_HOOGSTEEN = "h"; public static final String VALUE_SUGAR = "s"; public static final String VALUE_CIS = "cis"; public static final String VALUE_TRANS = "trans"; public void assignParameters(String parametersValue) throws ExceptionModeleStyleBaseSyntaxError, ExceptionParameterError { if (parametersValue.equals("")) return; String[] parametersL = parametersValue.split(","); ArrayList namesArray = new ArrayList(); ArrayList valuesArray = new ArrayList(); String[] param; for (int i = 0; i < parametersL.length; i++) { param = parametersL[i].split("="); if (param.length != 2) throw new ExceptionModeleStyleBaseSyntaxError( "Bad parameter: '" + param[0] + "' ..."); namesArray.add(param[0].replace(" ", "")); valuesArray.add(param[1].replace(" ", "")); } for (int i = 0; i < namesArray.size(); i++) { if (namesArray.get(i).toLowerCase().equals(PARAM_COLOR)) { try { this.setCustomColor(ModeleStyleBase .getSafeColor(valuesArray.get(i))); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "Bad inner color Syntax:" + valuesArray.get(i)); } } else if (namesArray.get(i).toLowerCase().equals(PARAM_THICKNESS)) { try { this.setThickness(Double.parseDouble(valuesArray.get(i))); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "Bad value for bp thickness:" + valuesArray.get(i)); } } else if (namesArray.get(i).toLowerCase().equals(PARAM_EDGE5)) { String s = valuesArray.get(i); if (s.toLowerCase().equals(VALUE_WATSON_CRICK)) { setEdge5(Edge.WATSON_CRICK); } else if (s.toLowerCase().equals(VALUE_HOOGSTEEN)) { setEdge5(Edge.HOOGSTEEN); } else if (s.toLowerCase().equals(VALUE_SUGAR)) { setEdge5(Edge.SUGAR); } else throw new ExceptionParameterError("Bad value for edge:" + valuesArray.get(i)); } else if (namesArray.get(i).toLowerCase().equals(PARAM_EDGE3)) { String s = valuesArray.get(i); if (s.toLowerCase().equals(VALUE_WATSON_CRICK)) { setEdge3(Edge.WATSON_CRICK); } else if (s.toLowerCase().equals(VALUE_HOOGSTEEN)) { setEdge3(Edge.HOOGSTEEN); } else if (s.toLowerCase().equals(VALUE_SUGAR)) { setEdge3(Edge.SUGAR); } else throw new ExceptionParameterError("Bad value for edge:" + valuesArray.get(i)); } else if (namesArray.get(i).toLowerCase().equals(PARAM_STERICITY)) { String s = valuesArray.get(i); if (s.toLowerCase().equals(VALUE_CIS)) { setStericity(Stericity.CIS); } else if (s.toLowerCase().equals(VALUE_TRANS)) { setStericity(Stericity.TRANS); } else throw new ExceptionParameterError( "Bad value for stericity:" + valuesArray.get(i)); } else throw new ExceptionModeleStyleBaseSyntaxError( "Unknown parameter:" + namesArray.get(i)); } } public String toString() { String result = ""; result += "(" + _partner5.getIndex() + "," + _partner3.getIndex() + ")"; //result += " [" + _partner5.getElementStructure() + "," // + _partner3.getElementStructure() + "]\n"; //result += " 5':" + _partner5 + "\n"; //result += " 3':" + _partner3; return result; } public int compareTo(ModeleStyleBP mb) { if (getIndex5()!=mb.getIndex5()) { return getIndex5()-mb.getIndex5(); } return getIndex3()-mb.getIndex3(); } } PK 4F>a3fr/orsay/lri/varna/models/rna/ModeleStyleBase.class1-fr/orsay/lri/varna/models/rna/ModeleStyleBasejava/lang/Objectjava/lang/Cloneablejava/io/SerializableserialVersionUIDJ ConstantValueqH_base_outline_colorLjava/awt/Color;_base_inner_color_base_number_color_base_name_color _selectedZPARAM_INNER_COLORLjava/lang/String;fillPARAM_OUTLINE_COLORoutlinePARAM_TEXT_COLORlabelPARAM_NUMBER_COLOR!numberclone1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;Code & '(()V *  ,  .  0  2 LineNumberTableLocalVariableTablethis/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;result & :<;%fr/orsay/lri/varna/models/VARNAConfig =BASE_OUTLINE_COLOR_DEFAULT :? @BASE_INNER_COLOR_DEFAULT :B CBASE_NUMBER_COLOR_DEFAULT :E FBASE_NAME_COLOR_DEFAULTR(Ljava/awt/Color;Ljava/awt/Color;Ljava/awt/Color;Ljava/awt/Color;Ljava/awt/Font;)VinnernamefontLjava/awt/Font;(Ljava/lang/String;)V ExceptionsOAfr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxErrorQ5fr/orsay/lri/varna/exceptions/ExceptionParameterError S TLassignParametersparameterValue2(Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)V X YZget_base_outline_color()Ljava/awt/Color; \ ]Zget_base_inner_color _ `Zget_base_number_color b cZget_base_name_colormsbset_base_outline_color(Ljava/awt/Color;)Vset_base_inner_colorset_base_number_color_base_numbers_colorset_base_name_color getSafeColor$(Ljava/lang/String;)Ljava/awt/Color; npojava/awt/Color qldecode ns tgreen nv wxgetColor4(Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color;zjava/lang/NumberFormatExceptioncole!Ljava/lang/NumberFormatException; java/lang/String equals(Ljava/lang/Object;)Z, split'(Ljava/lang/String;)[Ljava/lang/String;java/util/ArrayList &=java/lang/StringBuilderBad parameter: ' 'L append-(Ljava/lang/String;)Ljava/lang/StringBuilder;' ... toString()Ljava/lang/String; N replaceD(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; add get(I)Ljava/lang/Object;  toLowerCase  kl  gf y  getMessageBad inner color Syntax: P ''(Ljava/lang/String;Ljava/lang/String;)V  jfBad name color Syntax:  hfBad numbers color Syntax:  efBad outline color Syntax:Unknown parameter: size()IparametersValue parametersL[Ljava/lang/String; namesArrayLjava/util/ArrayList; valuesArrayparamiILocalVariableTypeTable)Ljava/util/ArrayList;StyleToInteger'(Ljava/lang/String;)Ljava/lang/Integer;italic java/lang/Integer valueOf(I)Ljava/lang/Integer;boldplainsstyleLjava/lang/Integer;()Ljava/lang/Object;$java/lang/CloneNotSupportedException  "# SourceFileModeleStyleBase.java!         "#$~2Y%L+*))+*+++*--+*//+*11+33456 7(8094256*76'($h&*8*9/*>)*A-*D+*13GH IJK L%M4 &56'G$*8*+/*,)*--*+3]_ `abc4>56H!IJK'LMNP$F *%*+R3gh i4 56 U'V$m%*8*+W/*+[)*+^-*+a+3kl mno$p4%56%d6YZ$/*/3s4 56ef$>*+/3 wx456]Z$/*)3{4 56gf$>*+)3 456`Z$/*-34 56hf$>*+-3 456icZ$/*+34 56jf$>*++3 456 kl$o*mL M*ruL+y3 4*{77 |}TLMNP$+~+MYNY:6Y,2:#NYY2-2~W2~W,6f-?*;:PYY-?*:PYY- ?*§:PYYķ-?*ƧK:PYYȷNYYʷ--̡yy?PSyy30 "(3:>VZj{'+79?SU^w{4z 56"3K%`o&|}&|}U&|}&|}" $@*ݶ L-* L* LL+3"  (4<>44@%9>A"M$%*34PK nq<enn2fr/orsay/lri/varna/models/rna/ModeleStyleBase.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.Color; import java.awt.Font; import java.io.Serializable; import java.util.ArrayList; import fr.orsay.lri.varna.exceptions.ExceptionModeleStyleBaseSyntaxError; import fr.orsay.lri.varna.exceptions.ExceptionParameterError; import fr.orsay.lri.varna.models.VARNAConfig; /** * The display Style of a rna base with the base name font, the ouline, * innerline, number and name color * * @author darty * */ public class ModeleStyleBase implements Cloneable, Serializable { /** * */ private static final long serialVersionUID = -4331494086323517208L; private Color _base_outline_color, _base_inner_color, _base_number_color, _base_name_color; private boolean _selected; public ModeleStyleBase clone() { ModeleStyleBase result = new ModeleStyleBase(); result._base_inner_color = this._base_inner_color; result._base_name_color = this._base_name_color; result._base_number_color = this._base_number_color; result._base_outline_color = this._base_outline_color; result._selected = this._selected; return result; } /** * Creates a new base style with default colors and font * * @see VARNAConfig#BASE_OUTLINE_COLOR_DEFAULT * @see VARNAConfig#BASE_INNER_COLOR_DEFAULT * @see VARNAConfig#BASE_NUMBER_COLOR_DEFAULT * @see VARNAConfig#BASE_NAME_COLOR_DEFAULT * */ public ModeleStyleBase() { _base_outline_color = VARNAConfig.BASE_OUTLINE_COLOR_DEFAULT; _base_inner_color = VARNAConfig.BASE_INNER_COLOR_DEFAULT; _base_number_color = VARNAConfig.BASE_NUMBER_COLOR_DEFAULT; _base_name_color = VARNAConfig.BASE_NAME_COLOR_DEFAULT; _selected = false; } /** * Creates a new base style with custom colors and custom font * * @param outline * The out line color of the base * @param inner * The inner line color of the base * @param number * The number color of the base * @param name * The name color of the base * @param font * The name font of the base */ public ModeleStyleBase(Color outline, Color inner, Color number, Color name, Font font) { _base_outline_color = outline; _base_inner_color = inner; _base_number_color = number; _base_name_color = name; } public ModeleStyleBase(String parameterValue) throws ExceptionModeleStyleBaseSyntaxError, ExceptionParameterError { this(); assignParameters(parameterValue); } public ModeleStyleBase(ModeleStyleBase msb) { _base_outline_color = msb.get_base_outline_color(); _base_inner_color = msb.get_base_inner_color(); _base_number_color = msb.get_base_number_color(); _base_name_color = msb.get_base_name_color(); } public Color get_base_outline_color() { return _base_outline_color; } public void set_base_outline_color(Color _base_outline_color) { this._base_outline_color = _base_outline_color; } public Color get_base_inner_color() { return _base_inner_color; } public void set_base_inner_color(Color _base_inner_color) { this._base_inner_color = _base_inner_color; } public Color get_base_number_color() { return _base_number_color; } public void set_base_number_color(Color _base_numbers_color) { this._base_number_color = _base_numbers_color; } public Color get_base_name_color() { return _base_name_color; } public void set_base_name_color(Color _base_name_color) { this._base_name_color = _base_name_color; } public static final String PARAM_INNER_COLOR = "fill"; public static final String PARAM_OUTLINE_COLOR = "outline"; public static final String PARAM_TEXT_COLOR = "label"; public static final String PARAM_NUMBER_COLOR = "number"; public static Color getSafeColor(String col) { Color result; try { result = Color.decode(col); } catch (NumberFormatException e) { result = Color.getColor(col, Color.green); } return result; } public void assignParameters(String parametersValue) throws ExceptionModeleStyleBaseSyntaxError, ExceptionParameterError { if (parametersValue.equals("")) return; String[] parametersL = parametersValue.split(","); ArrayList namesArray = new ArrayList(); ArrayList valuesArray = new ArrayList(); String[] param; for (int i = 0; i < parametersL.length; i++) { param = parametersL[i].split("="); if (param.length != 2) throw new ExceptionModeleStyleBaseSyntaxError( "Bad parameter: '" + param[0] + "' ..."); namesArray.add(param[0].replace(" ", "")); valuesArray.add(param[1].replace(" ", "")); } for (int i = 0; i < namesArray.size(); i++) { if (namesArray.get(i).toLowerCase().equals(PARAM_INNER_COLOR)) { try { set_base_inner_color(getSafeColor(valuesArray.get(i))); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "Bad inner color Syntax:" + valuesArray.get(i)); } } else if (namesArray.get(i).toLowerCase().equals(PARAM_TEXT_COLOR)) { try { set_base_name_color(getSafeColor(valuesArray.get(i))); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "Bad name color Syntax:" + valuesArray.get(i)); } } else if (namesArray.get(i).toLowerCase().equals( PARAM_NUMBER_COLOR)) { try { set_base_number_color(getSafeColor(valuesArray.get(i))); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "Bad numbers color Syntax:" + valuesArray.get(i)); } } else if (namesArray.get(i).toLowerCase().equals( PARAM_OUTLINE_COLOR)) { try { set_base_outline_color(getSafeColor(valuesArray.get(i))); } catch (NumberFormatException e) { throw new ExceptionParameterError(e.getMessage(), "Bad outline color Syntax:" + valuesArray.get(i)); } } else throw new ExceptionModeleStyleBaseSyntaxError( "Unknown parameter:" + namesArray.get(i)); } } /** * Find the font style integer from a string. Return null if * the font style is unknown. * * @param s * The string to decode * @return The font style integer as Font.PLAIN. */ public static Integer StyleToInteger(String s) { Integer style; if (s.toLowerCase().equals("italic")) style = Font.ITALIC; else if (s.toLowerCase().equals("bold")) style = Font.BOLD; else if (s.toLowerCase().equals("plain")) style = Font.PLAIN; else style = null; return style; } } PK 4F>UR]@@+fr/orsay/lri/varna/models/rna/Mapping.class1%fr/orsay/lri/varna/models/rna/Mappingjava/lang/Objectjava/io/SerializableserialVersionUIDJ ConstantValues4UNKNOWNI_mappingLjava/util/Hashtable; Signature=Ljava/util/Hashtable; _invMapping()VCode  java/util/Hashtable     LineNumberTableLocalVariableTablethis'Lfr/orsay/lri/varna/models/rna/Mapping; addCouple(II)V Exceptions(.fr/orsay/lri/varna/exceptions/MappingException *,+java/lang/Integer -.valueOf(I)Ljava/lang/Integer; 0 12 containsKey(Ljava/lang/Object;)Z '4 5(I)V *4 8 9:put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;ij getPartner(I)I @ ABget&(Ljava/lang/Object;)Ljava/lang/Object; *D EFintValue()I getAncestorgetSourceElems()[I K LFsize N OPkeys()Ljava/util/Enumeration; RTSjava/util/Enumeration UV nextElement()Ljava/lang/Object; RX YZhasMoreElements()Zelems[IenLjava/util/Enumeration;aLocalVariableTypeTable,Ljava/util/Enumeration;getTargetElemsreadMappingFromAlignmentM(Ljava/lang/String;Ljava/lang/String;)Lfr/orsay/lri/varna/models/rna/Mapping;  gihjava/lang/String jFlength gl mncharAt(I)C p $%mLjava/lang/String;nmapkCbDefaultMapping+(II)Lfr/orsay/lri/varna/models/rna/Mapping; {}|java/lang/Math ~min(II)I ' printStackTracee0Lfr/orsay/lri/varna/exceptions/MappingException;DefaultOutermostMappingpileZtoString()Ljava/lang/String; { maxjava/lang/StringBuilder g -&(Ljava/lang/Object;)Ljava/lang/String; (Ljava/lang/String;)V( append-(Ljava/lang/String;)Ljava/lang/StringBuilder; -(Ljava/lang/Object;)Ljava/lang/StringBuilder;,) g -(C)Ljava/lang/String; tmpl1l2maxIndexLjava/lang/Integer;tmp1tmp2 SourceFile Mapping.java!     Q**Y*Y &#$(! "#$%&'V*)/*)/ 'Y3**Y6*Y67W**Y6*Y67W +, -!,%0=1U2! V"#V; V< =>^"*)/*)?*C 568!""#"; G>^"*)/*)?*C <=?!""#"< HI8*J L*MM>,Q*C6+O,W+ & C DEFG%H*I-F6K!48"# .[\&]^$; %_ ` &]abI8*J L*MM>,Q*C6+O,W+ & O PQRS%T*U-R6W!48"# .[\&]^$; %_ ` &]a cd&'6YeM*f+f 'Y3>66[*k6+k6-:-: ,o- :- :*f, B\]^`a!b'c/d7eSfZihjklym|bp!Rqrsrt#l; !i< $du /M_v7Ewv xy)YeM> ,ozN-,"' tv wv"y#z'|!4)s )q !t# ; # yaYeMz>6665,o,ddddo6ddƧN-,WZ' B'-=@LZ[_!Ras aq Yt#Lu I; F< C[ *MLM>66Z+Q*:*?*:C>C6Y,M+W6::*ML66 +Q*: * ?*: 2Yx:Y-: Cʧ2Y-:Yx:  C ʻY|:Y|: +W7Y, $ !/9Emv !$.DZ`i!"#]^ r  | y !L;/><rr; < _ w ` ]aPK /kl=Α &&*fr/orsay/lri/varna/models/rna/Mapping.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.io.Serializable; import java.util.Enumeration; import java.util.Hashtable; import fr.orsay.lri.varna.exceptions.MappingException; public class Mapping implements Serializable { /** * */ private static final long serialVersionUID = -3031358968555310380L; public static final int UNKNOWN = -1; Hashtable _mapping = new Hashtable(); Hashtable _invMapping = new Hashtable(); public Mapping() { } public void addCouple(int i, int j) throws MappingException { if (_mapping.containsKey(i) || _invMapping.containsKey(j)) { throw new MappingException( MappingException.MULTIPLE_PARTNERS_DEFINITION_ATTEMPT); } _mapping.put(new Integer(i), new Integer(j)); _invMapping.put(new Integer(j), new Integer(i)); } public int getPartner(int i) { if (!_mapping.containsKey(i)) return UNKNOWN; else return _mapping.get(i); } public int getAncestor(int j) { if (!_invMapping.containsKey(j)) return UNKNOWN; else return _invMapping.get(j); } public int[] getSourceElems() { int[] elems = new int[_mapping.size()]; Enumeration en = _mapping.keys(); int i = 0; while (en.hasMoreElements()) { int a = en.nextElement(); elems[i] = a; i++; } return elems; } public int[] getTargetElems() { int[] elems = new int[_invMapping.size()]; Enumeration en = _invMapping.keys(); int i = 0; while (en.hasMoreElements()) { int a = en.nextElement(); elems[i] = a; i++; } return elems; } public static Mapping readMappingFromAlignment(String m, String n) throws MappingException { Mapping map = new Mapping(); if (m.length() != n.length()) { throw new MappingException(MappingException.BAD_ALIGNMENT_INPUT); } int i = 0; int j = 0; for (int k = 0; k < m.length(); k++) { char a = m.charAt(k); char b = n.charAt(k); if ((a != '-') && (a != ':') && (b != '-') && (b != ':')) { map.addCouple(i, j); } if ((a != '-') && (a != ':')) { j++; } if ((b != '-') && (b != ':')) { i++; } } return map; } public static Mapping DefaultMapping(int n, int m) { Mapping map = new Mapping(); try { for (int i = 0; i < Math.min(n, m); i++) { map.addCouple(i, i); } } catch (MappingException e) { e.printStackTrace(); } return map; } public static Mapping DefaultOutermostMapping(int n, int m) { Mapping map = new Mapping(); try { int k = Math.min(n, m); int i = 0; int j = 0; boolean pile = true; while (i <= (k - 1) - j) { if (pile) { map.addCouple(i, i); i++; } else { map.addCouple(n - 1 - j, m - 1 - j); j++; } pile = !pile; } } catch (MappingException e) { e.printStackTrace(); } // System.println(map); return map; } public String toString() { Enumeration en = _mapping.keys(); String tmp = ""; int l1 = 0; int l2 = 0; int maxIndex = 0; while (en.hasMoreElements()) { Integer i = en.nextElement(); Integer j = _mapping.get(i); l1 = Math.max(l1,i); l2 = Math.max(l2,j); tmp += "("+i+","+j+")"; } maxIndex = Math.max(maxIndex,Math.max(l1,l2)); String tmp1 = ""; String tmp2 = ""; en = _mapping.keys(); int i = l1; int j = l2; while (en.hasMoreElements()) { Integer a = en.nextElement(); Integer b = _mapping.get(a); while(a"  6fr/orsay/lri/varna/models/rna/RNAMLParser$BPTemp.class1z0fr/orsay/lri/varna/models/rna/RNAMLParser$BPTempjava/lang/Objectpos5Ipos3edge5Ljava/lang/String;edge3 orientationthis$0+Lfr/orsay/lri/varna/models/rna/RNAMLParser;f(Lfr/orsay/lri/varna/models/rna/RNAMLParser;IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)VCode   ()V+c       ! # LineNumberTableLocalVariableTablethis2Lfr/orsay/lri/varna/models/rna/RNAMLParser$BPTemp; createBPStyle(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;)Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;+W -/.java/lang/String 01equals(Ljava/lang/Object;)Z 3540fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge 67 WATSON_CRICK2Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;9H 3; <7 HOOGSTEEN>S 3@ A7SUGARC- EGF5fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity HICIS7Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;Kt EM NITRANSP+fr/orsay/lri/varna/models/rna/ModeleStyleBP OR S(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;)Vmb5*Lfr/orsay/lri/varna/models/rna/ModeleBase;mb3e5e3 isCanonicalZstertoString()Ljava/lang/String;_java/lang/StringBuildera[ ^c d(Ljava/lang/String;)V ^f ghappend(I)Ljava/lang/StringBuilder;j, ^l gm-(Ljava/lang/String;)Ljava/lang/StringBuilder;o] ^q \] SourceFileRNAMLParser.java InnerClassesEdge Stericityx)fr/orsay/lri/varna/models/rna/RNAMLParserBPTemp!    A*+*:::**** *"$6 I< >?@AB C$D)E.F4G:H%>A&'AAA A A () 6**, 2N-*8, :N*=, ?N2N* *, 2:0* 8, ::* =, ?:2:*,* ,*B,* B, 2:2N*", D:*"J, L:D:OY+,-Q$fNOPQ"R)S5T<V@YLZT[`\h]t^|`cdefklmnps%&'TUVUW7&W79W7@W7QX7eX7yX7uX7YZ[I[I[I\]{I^Y`b*eik*eik*kik* kik*"knkp$w9xEw% I&'rst3Ou@EOv@wyPK 3F>{vrr9fr/orsay/lri/varna/models/rna/RNAMLParser$HelixTemp.class1=3fr/orsay/lri/varna/models/rna/RNAMLParser$HelixTempjava/lang/Objectpos5Ipos3lengthnameLjava/lang/String;this$0+Lfr/orsay/lri/varna/models/rna/RNAMLParser;C(Lfr/orsay/lri/varna/models/rna/RNAMLParser;IIILjava/lang/String;)VCode   ()V        LineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/models/rna/RNAMLParser$HelixTemp;toString()Ljava/lang/String;$java/lang/StringBuilder&[ #( )(Ljava/lang/String;)V #+ ,-append-(Ljava/lang/String;)Ljava/lang/StringBuilder;/, #1 ,2(I)Ljava/lang/StringBuilder;4] #6 !" SourceFileRNAMLParser.java InnerClasses;)fr/orsay/lri/varna/models/rna/RNAMLParser HelixTemp!    *+*****0+ ,-./4     !"g=#Y%'**.**0.**0.**03*53 = 789 :<PK 3F>$!66/fr/orsay/lri/varna/models/rna/RNAMLParser.class1)fr/orsay/lri/varna/models/rna/RNAMLParser"org/xml/sax/helpers/DefaultHandler _sequenceLjava/util/ArrayList; Signature)Ljava/util/ArrayList; _sequenceIDsLjava/util/Vector;'Ljava/util/Vector; _structureFLjava/util/Vector;_helicesILjava/util/Vector;_inSequenceIDsZ _inLength _inSequence_inHelix_inStrAnnotation_inBP_inBP5_inBP3_inEdge5_inEdge3 _inPosition_inBondOrientation_bufferLjava/lang/StringBuffer; _firstModelLjava/lang/String; _currentModel_id5I_id3_length_edge5_edge3 _orientation_helixID()VCode . *+0java/util/ArrayList /. 3 5java/util/Vector 4. 8 : <  > @  B ! D  F  H  J  L  N  P  R  T  V  X LineNumberTableLocalVariableTablethis+Lfr/orsay/lri/varna/models/rna/RNAMLParser;createSourceFromURL-(Ljava/lang/String;)Lorg/xml/sax/InputSource;` java/net/URL _b *c(Ljava/lang/String;)V _e fgopenConnection()Ljava/net/URLConnection; ikjjava/net/URLConnection lm setUseCaches(Z)V io pqgetInputStream()Ljava/io/InputStream;sjava/io/InputStreamReader ru *v(Ljava/io/InputStream;)Vxorg/xml/sax/InputSource wz *{(Ljava/io/Reader;)V }~java/lang/Exception +printStackTracejava/io/StringReader bpathurlLjava/net/URL; connexionLjava/net/URLConnection;rLjava/io/InputStream;inrLjava/io/InputStreamReader;eLjava/lang/Exception; resolveEntity?(Ljava/lang/String;Ljava/lang/String;)Lorg/xml/sax/InputSource; rnaml.dtd java/lang/String endsWith(Ljava/lang/String;)Z!http://varna.lri.fr/bin/rnaml.dtd  ]^publicIdsystemId startElementQ(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/xml/sax/Attributes;)V Exceptionsorg/xml/sax/SAXExceptionnumbering-table equals(Ljava/lang/Object;)Zjava/lang/StringBuffer .  helixid org/xml/sax/Attributes getValue&(Ljava/lang/String;)Ljava/lang/String;  ) seq-datalength  str-annotation base-pair base-id-5p base-id-3pedge-5pedge-3ppositionbond-orientationmolecule ()Iuri localNameqName attributesLorg/xml/sax/Attributes; endElement9(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V toString()Ljava/lang/String; trim\s+ split'(Ljava/lang/String;)[Ljava/lang/String;java/lang/Integer parseInt(Ljava/lang/String;)I *(I)V 4 add java/lang/NumberFormatExceptionjava/lang/StringBuilder . charAt(I)C  append(C)Ljava/lang/StringBuilder; /  (  0fr/orsay/lri/varna/models/rna/RNAMLParser$BPTemp  "#  $#  &  '  *f(Lfr/orsay/lri/varna/models/rna/RNAMLParser;IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V java/lang/System errLjava/io/PrintStream; java/io/PrintStream  println(Ljava/lang/Object;)V"3fr/orsay/lri/varna/models/rna/RNAMLParser$HelixTemp $ %# !& *'C(Lfr/orsay/lri/varna/models/rna/RNAMLParser;IIILjava/lang/String;)Vcontenttokens[Ljava/lang/String;resultsi!Ljava/lang/NumberFormatException;jbp2Lfr/orsay/lri/varna/models/rna/RNAMLParser$BPTemp;h5Lfr/orsay/lri/varna/models/rna/RNAMLParser$HelixTemp;posLocalVariableTypeTable characters([CII)V 8 *6 : ;,(Ljava/lang/String;)Ljava/lang/StringBuffer;ch[Cstartlecture startDocument endDocument C D+ postProcessdiscardStacking 4G HIget(I)Ljava/lang/Object; K L  orientationNcPt 4R Ssizeresult getSequence()Ljava/util/List;&()Ljava/util/List;isSelfCrossing([I)Z[java/util/Stack Z.^java/awt/Point ]` *a(II)V Z Zd efpop()Ljava/lang/Object; ]h i#x ]k l#y Zn oppush&(Ljava/lang/Object;)Ljava/lang/Object; Zr stempty()Zstr[I intervalsLjava/util/Stack;pLjava/awt/Point;k#Ljava/util/Stack;debugPrintArray([Ljava/lang/Object;)V[ b,  ,(Ljava/lang/Object;)Ljava/lang/StringBuffer;]  out  c[Ljava/lang/Object;s planarize([I)[I  XY[[S java/lang/Math min(II)Itab backtrackthetantmpC(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;I)V(Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;I)Vjava/util/Hashtable . / iterator()Ljava/util/Iterator; java/util/Iterator fnext+fr/orsay/lri/varna/models/rna/ModeleStyleBP   getPartner5,()Lfr/orsay/lri/varna/models/rna/ModeleBase; (fr/orsay/lri/varna/models/rna/ModeleBase getIndex  valueOf(I)Ljava/lang/Integer;   containsKey  put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;  Hp  thasNext /G   getPartner3 /R  keySet()Ljava/util/Set;  java/util/Set  intValue / containsinputplanarothers index2BPsLjava/util/Hashtable;msbp-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;vinumBPmbnbDLjava/util/ArrayList;nLjava/util/Hashtable;>; 4  #pos3  #pos5  E+Discard stacking => b  -(Ljava/lang/Object;)Ljava/lang/StringBuilder; ! !+ ! #ID2Indexab newStructure=Ljava/util/Hashtable;sLjava/util/Hashtable;>;getBaseNumbers()Ljava/util/Vector;)()Ljava/util/Vector; getAllBPsH()Ljava/util/Vector; SourceFileRNAMLParser.java InnerClassesBPTemp HelixTemp!      ! "#$#%#& ' ( ) *+,t*-*/Y12*4Y67*4Y69*4Y6;*=?*=A*C*E*G*I*K*M*O*Q*S*U*WYN|}~%06<AFKPUZ_dinsZ t[\]^,FM_Y+aM,dN-h-n:rYt:wYyN-|wYY=y/0}Y*  &015ZHF[\F D & 1,g!, *wYY=yY Z ![\! ! ,tx-*C*Y^-#*W*Y*5-*E*Y-**Y- *G-ö *I-Ŷ*I *W*K-Ƕ*I *W*M-ɶ*Q*Y-˶*S*Ye-Ͷ*O*YI-϶*U*Y--Ѷ$:*?Ӛ *?*AY) %*5ENSajo}#1:?MVakqwZ>x[\x x x xa , -s*C*:::4Y6:6%Y2W :*A*? *7*6-*E*:::/Y1:696#Y2W2ӡք*A*? *2*-϶&*U*::**}- *Gl-öF*I*A*?SY** * ***:*9W -/*W!Y** * *#*%:*;W-Ŷ *K-Ƕ *M-)**::*#*-Ͷ<*::6*K * *M * *X-ɶ&*Q*::**,-˶#*S*::**6KNY:N '06NPU`kqy   $ * 2;CLQ\z !"# $%&''.(5)<*B,I-O/W0`1e2n3u4{56789:;?Z[\   b( 'R)*0I+ 3-,#P-v( f)*]+A,#0.#( z/0 12( '0( 5"3#n( ( 40I+ ]+56,|Y+7:* *9WYC DEFZ4[\<=>## ? @+,+YIZ [\A+,3*BY LMZ [\E+,M4Y6L=2*9FN-JM-JO +-W*9Q*+9Y"QR ST3U9RGXLYZ*M[\ET  =,# /04 ET UVW,/*2Y\Z [\ XY,IZY\L+]Y*d_bW}+c]M,g,jj*,g.+]Y,g`,j_mWG,g>,j6*.6 +]Y`d_mW+]Y`_mW+qYB`abc$d/e9fRhWi]jbkolqnobtZ>uvwx$ryzW?,#]9.#b4{#4 w|}~,@YM> ,9W,+2W+,9W,ݶY& y z{|~$z-5?Z*@[\@u 5 ,# , ***< M> ,O,N:6606-2V2V`,,66`6-2-`25V2V*.6  g ` Y6 ` d -`2 d5`6  ` - `25`6  -25-2 V2 VdgXZY\:]Yd_bWc]:gjg2j5',gO]Yg`j_mWUg6j6 g2j56 , O, O]Y` d_mW]Y ` _mWq\,Y2  ")14:AIRdnu{  ):=GTfnZuv #Tv,#)14#77,#>&.#r#x,#.#j{# S# )wxGyzK,#D.# 4{# 4 )w| ,uY:*:K:6/Y1W/W::6606 2 V2 V  `66  `6  2  `2 5V 2 V  /: 6   :  ˶6k d ]6 `d `2d5`6` `2 5`6 2 5 2 V 2  V   Ρr  d"ZY\:]Yd_bWc]:  g j g2 j5]Y g` j_mWq g6  j6  g2 j56  / :  ˶6+ W]Y `d_mW]Y` _mWqHϹ: Q 6  /:  :  : + ٚ , W  Y> (5GZdltw} +.9JSboz     '>HOdw!%Z.# <(2,#l{tswp#z6,#&.# #,# .#  #  x n{#.W#7wxyz g,# `.# 'P# >9 H/{#?,# 0  4H  7w|0 D+,*7Q24Y6L=+Y`W*2Ρ*+7YL=+*7FW*7Q*9N!-M,,d,,d-*Y*9=[*;F!N6=-`d6-dd6Y*M:*9W-*;QYM*9:[N-6,,/Y1W,/-ٚ,/-W4Y6N,Ϲ:C6,/::-W*-9Y)) +,-&,4/95A6F7Z6h:}<=:ABEFGJKMNGE U(V?XEYQZb[{\V^_aca_fiZ[\'+  ,#AC%,#}/0f,#I12F.#,#!# /0(?M0EG,#^ 1,#/04*'+ A(^ ,/*7YlZ [\,/*9YpZ [\    ! PK ]>EpFF.fr/orsay/lri/varna/models/rna/RNAMLParser.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.Point; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.Collections; import java.util.Hashtable; import java.util.List; import java.util.Stack; import java.util.Vector; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class RNAMLParser extends DefaultHandler { public class HelixTemp { public int pos5, pos3, length; public String name; public HelixTemp(int pos5, int pos3, int length, String name) { this.pos3 = pos3; this.pos5 = pos5; this.length = length; this.name = name; } public String toString() { return ("[" + name + "," + pos5 + "," + pos3 + "," + length + "]"); } } public class BPTemp { public int pos5, pos3; public String edge5, edge3, orientation; public BPTemp(int pos5, int pos3, String edge5, String edge3, String orientation) { if (edge3==null) {edge3="+";} if (edge5==null) {edge5="+";} if (orientation==null) {orientation="c";} this.pos5 = pos5; this.pos3 = pos3; this.edge5 = edge5; this.edge3 = edge3; this.orientation = orientation; } public ModeleStyleBP createBPStyle(ModeleBase mb5, ModeleBase mb3) { ModeleStyleBP.Edge e5, e3; @SuppressWarnings("unused") boolean isCanonical = false; if (edge5.equals("W")) { e5 = ModeleStyleBP.Edge.WATSON_CRICK; } else if (edge5.equals("H")) { e5 = ModeleStyleBP.Edge.HOOGSTEEN; } else if (edge5.equals("S")) { e5 = ModeleStyleBP.Edge.SUGAR; } else { e5 = ModeleStyleBP.Edge.WATSON_CRICK; } if (edge3.equals("W")) { e3 = ModeleStyleBP.Edge.WATSON_CRICK; } else if (edge3.equals("H")) { e3 = ModeleStyleBP.Edge.HOOGSTEEN; } else if (edge3.equals("S")) { e3 = ModeleStyleBP.Edge.SUGAR; } else { e3 = ModeleStyleBP.Edge.WATSON_CRICK; } if ((edge5.equals("+") && edge3.equals("+")) || (edge5.equals("-") && edge3.equals("-"))) { e3 = ModeleStyleBP.Edge.WATSON_CRICK; e5 = ModeleStyleBP.Edge.WATSON_CRICK; } ModeleStyleBP.Stericity ster; if (orientation.equals("c")) { ster = ModeleStyleBP.Stericity.CIS; } else if (orientation.equals("t")) { ster = ModeleStyleBP.Stericity.TRANS; } else { ster = ModeleStyleBP.Stericity.CIS; } return (new ModeleStyleBP(mb5, mb3, e5, e3, ster)); } public String toString() { return ("[" + pos5 + "," + pos3 + "," + edge5 + "," + edge3 + "," + orientation + "]"); } } private ArrayList _sequence = new ArrayList(); private Vector _sequenceIDs = new Vector(); private Vector _structure = new Vector(); private Vector _helices = new Vector(); @SuppressWarnings("unused") private boolean _inSequenceIDs, _inLength, _inSequence, _inHelix, _inStrAnnotation, _inBP, _inBP5, _inBP3, _inEdge5, _inEdge3, _inPosition, _inBondOrientation; private StringBuffer _buffer; private String _firstModel = ""; private String _currentModel = ""; private int _id5, _id3, _length; String _edge5, _edge3, _orientation, _helixID; public RNAMLParser() { super(); _inSequenceIDs = false; _inSequence = false; _inStrAnnotation = false; _inBP = false; _inBP5 = false; _inBP3 = false; _inPosition = false; _inEdge5 = false; _inEdge3 = false; _inBondOrientation = false; _inHelix = false; } public InputSource createSourceFromURL(String path) { URL url = null; try { url = new URL(path); URLConnection connexion = url.openConnection(); connexion.setUseCaches(false); InputStream r = connexion.getInputStream(); InputStreamReader inr = new InputStreamReader(r); return new InputSource(inr); } catch(Exception e) { e.printStackTrace(); } return new InputSource(new StringReader("")); } public InputSource resolveEntity(String publicId, String systemId) { //System.out.println("[crade]"); if (systemId.endsWith("rnaml.dtd")) return createSourceFromURL("http://varna.lri.fr/bin/rnaml.dtd"); else return new InputSource(new StringReader("")); } public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals("numbering-table")) { _inSequenceIDs = true; _buffer = new StringBuffer(); } else if (qName.equals("helix")) { _inHelix = true; _buffer = new StringBuffer(); _helixID = attributes.getValue("id"); } else if (qName.equals("seq-data")) { _inSequence = true; _buffer = new StringBuffer(); } else if (qName.equals("length")) { _inLength = true; _buffer = new StringBuffer(); } else if (qName.equals("str-annotation")) { _inStrAnnotation = true; } else if (qName.equals("base-pair")) { _inBP = true; } else if (qName.equals("base-id-5p")) { if (_inBP || _inHelix) { _inBP5 = true; } } else if (qName.equals("base-id-3p")) { if (_inBP || _inHelix) { _inBP3 = true; } } else if (qName.equals("edge-5p")) { _inEdge5 = true; _buffer = new StringBuffer(); } else if (qName.equals("edge-3p")) { _inEdge3 = true; _buffer = new StringBuffer(); } else if (qName.equals("position")) { _inPosition = true; _buffer = new StringBuffer(); } else if (qName.equals("bond-orientation")) { _inBondOrientation = true; _buffer = new StringBuffer(); } else if (qName.equals("molecule")) { String id = (attributes.getValue("id")); if (_firstModel.length()==0) { _firstModel = id; } _currentModel = id; } else { // We don't care too much about the rest ... } } public void endElement(String uri, String localName, String qName) throws SAXException { if (qName.equals("numbering-table")) { _inSequenceIDs = false; String content = _buffer.toString(); content = content.trim(); String[] tokens = content.split("\\s+"); Vector results = new Vector(); for (int i = 0; i < tokens.length; i++) { try { results.add(new Integer(Integer.parseInt(tokens[i]))); } catch (NumberFormatException e) { e.printStackTrace(); } } if (_currentModel == _firstModel) { _sequenceIDs = results; } _buffer = null; } else if (qName.equals("seq-data")) { _inSequence = false; String content = _buffer.toString(); content = content.trim(); String[] tokens = content.split("\\s+"); ArrayList results = new ArrayList(); for (int i = 0; i < tokens.length; i++) { for(int j=0;j result = new Vector(); for (int i = 0; i < _structure.size(); i++) { BPTemp bp = _structure.get(i); if (bp.orientation.equals("c") || bp.orientation.equals("t")) { result.add(bp); } } _structure = result; } public List getSequence() { return _sequence; } public static boolean isSelfCrossing(int[] str) { Stack intervals = new Stack(); intervals.add(new Point(0, str.length - 1)); while (!intervals.empty()) { Point p = intervals.pop(); if (p.x <= p.y) { if (str[p.x] == -1) { intervals.push(new Point(p.x + 1, p.y)); } else { int i = p.x; int j = p.y; int k = str[i]; if ((k <= i) || (k > j)) { return true; } else { intervals.push(new Point(i + 1, k - 1)); intervals.push(new Point(k + 1, j)); } } } } return false; } @SuppressWarnings("unused") private void debugPrintArray(Object[] str) { StringBuffer s = new StringBuffer("["); for (int i = 0; i < str.length; i++) { if (i != 0) { s.append(","); } s.append(str[i]); } s.append("]"); System.out.println(s.toString()); } /** * Computes and returns a maximal planar subset of the current structure. * @param str A sequence of base-pairing positions * @return A sequence of non-crossing base-pairing positions */ public static int[] planarize(int[] str) { if (!isSelfCrossing(str)) { return str; } int length = str.length; int[] result = new int[length]; for (int i = 0; i < result.length; i++) { result[i] = -1; } short[][] tab = new short[length][length]; short[][] backtrack = new short[length][length]; int theta = 3; for (int i = 0; i < result.length; i++) { for (int j = i; j < Math.min(i + theta, result.length); j++) { tab[i][j] = 0; backtrack[i][j] = -1; } } for (int n = theta; n < length; n++) { for (int i = 0; i < length - n; i++) { int j = i + n; tab[i][j] = tab[i + 1][j]; backtrack[i][j] = -1; int k = str[i]; if ((k != -1) && (k <= j) && (i < k)) { int tmp = 1; if (i + 1 <= k - 1) { tmp += tab[i + 1][k - 1]; } if (k + 1 <= j) { tmp += tab[k + 1][j]; } if (tmp > tab[i][j]) { tab[i][j] = (short) tmp; backtrack[i][j] = (short) k; } } } } Stack intervals = new Stack(); intervals.add(new Point(0, length - 1)); while (!intervals.empty()) { Point p = intervals.pop(); if (p.x <= p.y) { if (backtrack[p.x][p.y] == -1) { result[p.x] = -1; intervals.push(new Point(p.x + 1, p.y)); } else { int i = p.x; int j = p.y; int k = backtrack[p.x][p.y]; result[i] = k; result[k] = i; intervals.push(new Point(i + 1, k - 1)); intervals.push(new Point(k + 1, j)); } } } return result; } public static void planarize(ArrayList input, ArrayList planar, ArrayList others, int length) { //System.err.println("Planarize: Length:"+length); Hashtable> index2BPs = new Hashtable>(); for(ModeleStyleBP msbp : input) { int i = msbp.getPartner5().getIndex(); if (!index2BPs.containsKey(i)) { index2BPs.put(i,new ArrayList()); } index2BPs.get(i).add(msbp); } //System.err.println(index2BPs); short[][] tab = new short[length][length]; short[][] backtrack = new short[length][length]; int theta = 3; for (int i = 0; i < length; i++) { for (int j = i; j < Math.min(i + theta, length); j++) { tab[i][j] = 0; backtrack[i][j] = -1; } } for (int n = theta; n < length; n++) { for (int i = 0; i < length - n; i++) { int j = i + n; tab[i][j] = tab[i + 1][j]; backtrack[i][j] = -1; if (index2BPs.containsKey(i)) { ArrayList vi = index2BPs.get(i); //System.err.print("."); for (int numBP=0;numBP tab[i][j]) { tab[i][j] = (short) tmp; backtrack[i][j] = (short) numBP; } } } } } } //System.err.println("DP table: "+tab[0][length-1]); // Backtracking Stack intervals = new Stack(); intervals.add(new Point(0, length - 1)); while (!intervals.empty()) { Point p = intervals.pop(); if (p.x <= p.y) { if (backtrack[p.x][p.y] == -1) { intervals.push(new Point(p.x + 1, p.y)); } else { int i = p.x; int j = p.y; int nb = backtrack[p.x][p.y]; ModeleStyleBP mb = index2BPs.get(i).get(nb); int k = mb.getPartner3().getIndex(); planar.add(mb); intervals.push(new Point(i + 1, k - 1)); intervals.push(new Point(k + 1, j)); } } } // Remaining base pairs for(int i:index2BPs.keySet()) { ArrayList vi = index2BPs.get(i); for(ModeleStyleBP mb: vi) { if (!planar.contains(mb)) { others.add(mb); } } } } private void postProcess() { // First, check if base numbers were specified if (_sequenceIDs.size()==0) { Vector results = new Vector(); for (int i = 0; i < _sequence.size(); i++) { results.add(new Integer(i+1)); } _sequenceIDs = results; } //System.err.println("IDs: "+_sequenceIDs); //System.err.println("Before remapping: "+_structure); // Then, build inverse mapping ID => index Hashtable ID2Index = new Hashtable(); for (int i=0;i<_sequenceIDs.size();i++) { ID2Index.put(_sequenceIDs.get(i), i); } // Translate BP coordinates into indices for (BPTemp bp : _structure) { bp.pos3 = bp.pos3-1; bp.pos5 = bp.pos5-1; } //System.err.println("After remapping: "+_structure); discardStacking(); System.err.println("Discard stacking => "+_structure); // Add helices... for (int i=0;i<_helices.size();i++) { HelixTemp h = _helices.get(i); for (int j=0;j "+_structure); // Eliminate redundancy Hashtable> index2BPs = new Hashtable>(); for(BPTemp msbp : _structure) { int i = msbp.pos5; if (!index2BPs.containsKey(i)) { index2BPs.put(i,new ArrayList()); } if (!index2BPs.get(i).contains(msbp.pos3)) {index2BPs.get(i).add(msbp);} } Vector newStructure = new Vector(); for (int i: index2BPs.keySet()) { for (BPTemp bp: index2BPs.get(i)) { newStructure.add(bp); } } _structure = newStructure; //System.err.println("After Postprocess => "+_structure); } public Vector getBaseNumbers() { return _sequenceIDs; } public Vector getAllBPs() { return _structure; } }PK 4F>V%9fr/orsay/lri/varna/models/rna/ModeleBasesComparison.class13fr/orsay/lri/varna/models/rna/ModeleBasesComparison(fr/orsay/lri/varna/models/rna/ModeleBaseserialVersionUIDJ ConstantValue5t0{a_base1Ljava/lang/Character;_base2 _appartenanceI_indexFIRST_RNA_COLORLjava/awt/Color;SECOND_RNA_COLORBOTH_RNA_COLORDEFAULT_RNA_COLOR()VCode#FFDD99 java/awt/Color decode$(Ljava/lang/String;)Ljava/awt/Color; ! ##99DDFF % '#99DD99 )  + ,white . LineNumberTableLocalVariableTable(I)V 4 15(CCI)Vthis5Lfr/orsay/lri/varna/models/rna/ModeleBasesComparison;index(Ljava/awt/geom/Point2D;I)V;java/awt/geom/Point2D$Double =?>java/awt/geom/Point2D @AgetX()D =C DAgetY :F 1G(DD)V I 1J(CCLjava/awt/geom/Point2D;I)VcoordsLjava/awt/geom/Point2D; N 1O(CCII)Vbase1Cbase2T-fr/orsay/lri/varna/models/rna/ModeleStyleBase SV 1 X 1YN(Ljava/awt/geom/Point2D;CCZLfr/orsay/lri/varna/models/rna/ModeleStyleBase;II)V :VelementStructure V ^  `bajava/lang/Boolean cdvalueOf(Z)Ljava/lang/Boolean; f gh_colorieLjava/lang/Boolean; jlkjava/lang/Character cm(C)Ljava/lang/Character; o q s tu _styleBase/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;w(fr/orsay/lri/varna/models/rna/VARNAPoint vF z {|_coords*Lfr/orsay/lri/varna/models/rna/VARNAPoint; ~ _elementStructure  colorieZmb getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase; `  booleanValue()Z get_colored()Ljava/lang/Boolean; set_colored(Ljava/lang/Boolean;)Vcolored get_base1()Ljava/lang/Character; set_base1(Ljava/lang/Character;)V get_base2 set_base2getBases()Ljava/lang/String;java/lang/StringBuilder java/lang/String c&(Ljava/lang/Object;)Ljava/lang/String; 1(Ljava/lang/String;)V append-(Ljava/lang/String;)Ljava/lang/StringBuilder; toString getContent  getElementStructure()IsetElementStructure structureget_appartenanceset_appartenance  S set_base_inner_color(Ljava/awt/Color;)V getColorie setColoriegetIndex SourceFileModeleBasesComparison.java InnerClassesDouble!        O "$&(*-/FGHI!012B *  3/ T U0 67 819[ *  :Y+<+BEH/ `a0 67KL815U *M/ lm0* 67 PQ RQ 81J{!*:Y-<-BESYUW/}~ 04!67!PQ!RQ!KL!81Os*:YZSYUW/0467PQRQ[81YH*\*]*_e*in*ip*r*vY+<+Bxy*}*/* ; "(;AG0RH67HKLHPQHRQHHuH[H8I*e*rSYU/ 0 67/*e/0 67>*+e/ 067h/*n/0 67>*+n/ 067 /*p/0 67>*+p/ 067 IY*n*p/0 67/*/ 0 67/*}/0 672>*}/ 067/*]/'0 672E*(1* *$ *-*]/& 3456#7(85:?<D=0E67E /*e/@0 67>*+e/ DE067gh/*/H0 67 := PK Vm=j""8fr/orsay/lri/varna/models/rna/ModeleBasesComparison.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.Color; import java.awt.geom.Point2D; /** * The RNA base comparison model. In each bases we'll place two * characters representing nitrogenous bases of both RNA that have to be * compared. So, in each base in the comparison model, we'll have a couple of * bases, with the same coordinates on the final drawing. * * @author Masson * */ public class ModeleBasesComparison extends ModeleBase { /* * LOCAL FIELDS */ /** * */ private static final long serialVersionUID = -2733063250714562463L; /** * The base of the first RNA associated with the base of the second RNA. */ private Character _base1; /** * The base of the second RNA associated with the base of the first RNA. */ private Character _base2; /** * This ModeleBasesComparison owning statement. It's value will be 0 if this * base is common for both RNA that had been compared, 1 if this base is * related to the first RNA, 2 if related to the second. Default is -1. */ private int _appartenance = -1; /** * This base's offset in the sequence */ private int _index; /* * -> END LOCAL FIELDS <-- */ public static Color FIRST_RNA_COLOR = Color.decode("#FFDD99"); public static Color SECOND_RNA_COLOR = Color.decode("#99DDFF"); public static Color BOTH_RNA_COLOR = Color.decode("#99DD99"); public static Color DEFAULT_RNA_COLOR = Color.white; /* * CONSTRUCTORS */ /** * Creates a new comparison base with the default display style and no * nitrogenous bases. */ public ModeleBasesComparison(int index) { this(' ', ' ', index); } /** * Creates a new comparison base at the specified coordinates, with the * default display style and no nitrogenous bases. * * @param coords * - The coordinates in which the comparison base has to be * placed. */ public ModeleBasesComparison(Point2D coords, int index) { this(' ', ' ', new Point2D.Double(coords.getX(), coords.getY()), index); } /** * Creates a new comparison base with the specified nitrogenous bases. * * @param base1 * - The first RNA' nitrogenous base * @param base2 * - The second RNA' nitrogenous base */ public ModeleBasesComparison(char base1, char base2, int index) { this(base1, base2, -1, index); } /** * Creates a new comparison base with the specified nitrogenous bases, at * the specified coordinates. * * @param base1 * - The first RNA' nitrogenous base * @param base2 * - The second RNA' nitrogenous base * @param coords * - The coordinates in which the comparison base has to be * placed. */ public ModeleBasesComparison(char base1, char base2, Point2D coords, int index) { this(new Point2D.Double(coords.getX(), coords.getY()), base1, base2, true, new ModeleStyleBase(), -1, index); } /** * Creates a new comparison base with the specified nitrogenous bases. * * @param base1 * - The first RNA' nitrogenous base * @param base2 * - The second RNA' nitrogenous base */ public ModeleBasesComparison(char base1, char base2, int elementStructure, int index) { this(new Point2D.Double(), base1, base2, true, new ModeleStyleBase(), elementStructure, index); } /** * Creates a new comparison base with the specified nitrogenous bases. * * @param coords * - This base's XY coordinates * @param base1 * - The first RNA' nitrogenous base * @param base2 * - The second RNA' nitrogenous base * @param colorie * - Whether or not this base will be drawn * @param mb * - The drawing style for this base * @param elementStructure * - The index of a bp partner in the secondary structure * @param index * - Index of this base in its initial sequence */ public ModeleBasesComparison(Point2D coords, char base1, char base2, boolean colorie, ModeleStyleBase mb, int elementStructure, int index) { _colorie = colorie; _base1 = base1; _base2 = base2; _styleBase = mb; _coords = new VARNAPoint(coords.getX(), coords.getY()); _elementStructure = elementStructure; _index = index; } /* * -> END CONSTRUCTORS <-- */ /* * GETTERS & SETTERS */ /** * Return the display style associated to this comparison base. * * @return The display style associated to this comparison base. */ public ModeleStyleBase getStyleBase() { if (_colorie) return _styleBase; return new ModeleStyleBase(); } /** * Allows to know if this comparison base is colored. * * @return TRUE if this comparison base is colored, else FALSE. */ public Boolean get_colored() { return _colorie; } /** * Sets the coloration authorization of this comparison base. * * @param colored * - TRUE if this comparison base has to be colored, else FALSE. */ public void set_colored(Boolean colored) { this._colorie = colored; } /** * Return the base of the first RNA in this comparison base. * * @return The base of the first RNA in this comparison base. */ public Character get_base1() { return _base1; } /** * Sets the base of the first RNA in this comparison base. * * @param _base1 * - The base of the first RNA in this comparison base. */ public void set_base1(Character _base1) { this._base1 = _base1; } /** * Return the base of the second RNA in this comparison base. * * @return The base of the second RNA in this comparison base. */ public Character get_base2() { return _base2; } /** * Sets the base of the second RNA in this comparison base. * * @param _base2 * - The base of the second RNA in this comparison base. */ public void set_base2(Character _base2) { this._base2 = _base2; } /* * --> END GETTERS & SETTERS <-- */ /** * Gets the string representation of the two bases in this * ModeleBasesComparison. * * @return the string representation of the two bases in this * ModeleBasesComparison. */ public String getBases() { return String.valueOf(_base1) + String.valueOf(_base2); } public String getContent() { return getBases(); } /** * Gets this InterfaceBase assiociated structure element. * * @return this InterfaceBase assiociated structure element. */ public int getElementStructure() { return _elementStructure; } /** * Sets this InterfaceBase assiociated structure element. * * @param structure * - This new assiociated structure element. */ public void setElementStructure(int structure) { _elementStructure = structure; } /** * Gets this base's related RNA. * * @return 0 if this base is common for both RNA
* 1 if this base is related to the first RNA
* 2 if this base is related to the second RNA */ public int get_appartenance() { return _appartenance; } /** * Sets this base's related RNA. * * @param _appartenance * : 0 if this base is common for both RNA
* 1 if this base is related to the first RNA
* 2 if this base is related to the second RNA. */ public void set_appartenance(int _appartenance) { if (_appartenance == 0) { this.getStyleBase().set_base_inner_color(BOTH_RNA_COLOR); } else if (_appartenance == 1) { this.getStyleBase().set_base_inner_color(FIRST_RNA_COLOR); } else if (_appartenance == 2) { this.getStyleBase().set_base_inner_color(SECOND_RNA_COLOR); } else { this.getStyleBase().set_base_inner_color(DEFAULT_RNA_COLOR); } this._appartenance = _appartenance; } public Boolean getColorie() { return _colorie; } public void setColorie(Boolean _colorie) { this._colorie = _colorie; } public int getIndex() { return _index; } } PK 3F>d`$1fr/orsay/lri/varna/models/rna/StructureTemp.class1B+fr/orsay/lri/varna/models/rna/StructureTempjava/lang/Objectjava/io/SerializableserialVersionUIDJ ConstantValue _structLjava/util/ArrayList; SignatureCLjava/util/ArrayList;()VCode  java/util/ArrayList   LineNumberTableLocalVariableTablethis-Lfr/orsay/lri/varna/models/rna/StructureTemp; addStrand/(Lfr/orsay/lri/varna/models/rna/ModeleStrand;)V ! "#add(Ljava/lang/Object;)Zms,Lfr/orsay/lri/varna/models/rna/ModeleStrand; sizeStruct()I ) *'size getStrand/(I)Lfr/orsay/lri/varna/models/rna/ModeleStrand; . /0get(I)Ljava/lang/Object;2*fr/orsay/lri/varna/models/rna/ModeleStrandaIgetListStrands()Ljava/util/ArrayList;E()Ljava/util/ArrayList;clearListStrands : ;clearisEmpty()Z ? <= SourceFileStructureTemp.java!   B**Y  B *+ W    $%&'2*( +,@ *-1  34567/*  86*9 $% <=2*>( @APK v<~J0fr/orsay/lri/varna/models/rna/StructureTemp.javapackage fr.orsay.lri.varna.models.rna; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; public class StructureTemp implements Serializable{ /** * */ private static final long serialVersionUID = -436852923461989105L; private ArrayList _struct = new ArrayList(); public StructureTemp(){ } public void addStrand(ModeleStrand ms){ this._struct.add(ms); } public int sizeStruct() { return this._struct.size(); } public ModeleStrand getStrand(int a) { return this._struct.get(a); } public ArrayList getListStrands() { return _struct; } public void clearListStrands() { this._struct.clear(); } public boolean isEmpty() { return this._struct.isEmpty(); } } PK 4F>mV.fr/orsay/lri/varna/models/rna/ExtendedMB.class1"(fr/orsay/lri/varna/models/rna/ExtendedMB(fr/orsay/lri/varna/models/rna/ModeleBase intervDroiteZ intervGauche()VCode      LineNumberTableLocalVariableTablethis*Lfr/orsay/lri/varna/models/rna/ExtendedMB;getIntervGaucheEx()ZsetIntervGaucheEx(Z)VboolgetIntervDroiteExsetIntervDroiteEx getContent()Ljava/lang/String;getIndex()I SourceFileExtendedMB.java!  E* * *     /*  >*  /*   >*   ,!  ,'  !PK Pq.fr/orsay/lri/varna/models/rna/ModeleBase.class1(fr/orsay/lri/varna/models/rna/ModeleBasejava/lang/Objectjava/io/Serializablejava/lang/Comparable_styleBP-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;_checkedZ intervDroite intervGauche _numStrandI _styleBase/Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;_colorieLjava/lang/Boolean;_coords*Lfr/orsay/lri/varna/models/rna/VARNAPoint;_center_elementStructure_valueD _realIndex()VCode   " $  & (-fr/orsay/lri/varna/models/rna/ModeleStyleBase ' + -java/lang/Boolean ,/ 0(Z)V 2 4(fr/orsay/lri/varna/models/rna/VARNAPoint 3 7  9  ; LineNumberTableLocalVariableTablethis*Lfr/orsay/lri/varna/models/rna/ModeleBase;getIndex()I getContent()Ljava/lang/String; getStyleBase1()Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;getValue()D I setValue(D)Vd setStyleBase2(Lfr/orsay/lri/varna/models/rna/ModeleStyleBase;)V 'P Nbase getColorie()Ljava/lang/Boolean; setColorie(Ljava/lang/Boolean;)VgetElementStructure X setElementStructure(I)V\+fr/orsay/lri/varna/models/rna/ModeleStyleBP [ _ Y`1(ILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V structure c type getStyleBP/()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; setStyleBP0(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V getBaseNumber setBaseNumberbn getCoords ()Ljava/awt/geom/Point2D$Double;ojava/awt/geom/Point2D$Double 3q rx 3t uy nw x(DD)V setCoords!(Ljava/awt/geom/Point2D$Double;)V nq ntcoordsLjava/awt/geom/Point2D$Double; getCenter setCentercenter getNumStrand setNumStranda getChecker()Z   setCheckerboolgetIntervGauchesetIntervGauchegetIntervDroitesetIntervDroite compareTo-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)I  @Aothernombre1nombre2(Ljava/lang/Object;)I   SourceFileModeleBase.java SignaturejLjava/lang/Object;Ljava/io/Serializable;Ljava/lang/Comparable; InnerClassesjava/awt/geom/Point2DDouble!     F**!*#*%*'Y)**,Y.1*3Y56*3Y58*:<* $ &,16*;5@@OE= F>?@ABCDE/**<_= >?FG/*H<d= >?JK>*'H< ij=>?LMNE *'Y+O*< t u= >? QRS/*1<}= >?TU>*+1< =>?VA/*W<= >?YZE *]^<  = >? aY`Q *W*,b< =  >? a d ef/*b<= >?gh>*+b< =>?d iA/*:<= >?jZ>*:< =>?klm@nY*6p*6sv<= >?yzS*6+{p*6+|s< =>?}~m@nY*8p*8sv<= >?zS*8+{p*8+|s< =>?~A/*%<= >?Z>*%< =>?/*<= >?0>*< =>? /*#<= >?0>*#< =>? /*!<= >?0>*!< =>? r+=*>< =*>?? A) *+<= n PK l=-fr/orsay/lri/varna/models/rna/ModeleBase.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.models.rna; import java.awt.geom.Point2D; import java.io.Serializable; /** * The abstract rna base model * * @author darty * */ public abstract class ModeleBase implements Serializable, java.lang.Comparable { private ModeleStyleBP _styleBP; private boolean _checked; private boolean intervDroite = false; private boolean intervGauche = false; /** * Numero du brin auquel la base appartient. */ private int _numStrand = -1; /** * The base style. */ protected ModeleStyleBase _styleBase = new ModeleStyleBase(); /** * TRUE if this InterfaceBase has to be colored, else FALSE. */ protected Boolean _colorie = new Boolean(true); /** * The coordinate representation of this InterfaceBase on the final graphic. */ protected VARNAPoint _coords = new VARNAPoint(); /** * The nearest loop center of this InterfaceBase. */ protected VARNAPoint _center = new VARNAPoint(); /** * The structure information associated with this InterfaceBase. It value * is:
* -1 if the structure element associated is a point or a dash.
* If the structure associated is an opening bracket, it'll be the index of * the closing bracket associated with this opening bracket.
* If the structure associated is a closing bracket, it'll be the index of * the opening bracket associated with this closing bracket. */ protected int _elementStructure; protected double _value; protected int _realIndex = -1; /** * The internal index for this Base */ public abstract int getIndex(); public abstract String getContent(); /** * Gets this InterfaceBase style. * * @return this InterfaceBase style. */ public ModeleStyleBase getStyleBase() { return _styleBase; } public double getValue() { return _value; } public void setValue(double d) { _value = d; } /** * Sets this InterfaceBase style. * * @param base * - This InterfaceBase new style. */ public void setStyleBase(ModeleStyleBase base) { _styleBase = new ModeleStyleBase(base); } /** * Gets this InterfaceBase color statement. * * @return TRUE if this InterfaceBase has to be colored, else FALSE. */ public Boolean getColorie() { return _colorie; } /** * Sets this InterfaceBase color statement. * * @param _colorie * - TRUE if you want this InterfaceBase to be colored, else * FALSE */ public void setColorie(Boolean _colorie) { this._colorie = _colorie; } /** * Gets this InterfaceBase associated structure element. * * @return this InterfaceBase associated structure element. */ public int getElementStructure() { return _elementStructure; } /** * Sets this InterfaceBase assiocated structure element. * * @param structure * - This new assiocated structure element. */ public void setElementStructure(int structure) { setElementStructure(structure, new ModeleStyleBP()); } /** * Sets this InterfaceBase associated structure element. * * @param structure * - This new associated structure element. * @param type * - The type of this base pair. */ public void setElementStructure(int structure, ModeleStyleBP type) { _elementStructure = structure; _styleBP = type; } /** * Gets the base pair type for this element. * * @return the base pair type for this element. */ public ModeleStyleBP getStyleBP() { return _styleBP; } /** * Sets the base pair type for this element. * * @param type * - The new base pair type for this element. */ public void setStyleBP(ModeleStyleBP type) { _styleBP = type; } public int getBaseNumber() { return _realIndex; } public void setBaseNumber(int bn) { _realIndex = bn; } public Point2D.Double getCoords() { return new Point2D.Double(_coords.x,_coords.y); } public void setCoords(Point2D.Double coords) { this._coords.x = coords.x; this._coords.y = coords.y; } public Point2D.Double getCenter() { return new Point2D.Double(_center.x,_center.y); } public void setCenter(Point2D.Double center) { this._center.x = center.x; this._center.y = center.y; } public int getNumStrand(){ return (this._numStrand); } public void setNumStrand(int a){ this._numStrand=a; } public boolean getChecker (){ return (this._checked); } public void setChecker(boolean bool){ this._checked=bool; } public boolean getIntervGauche(){ return (this.intervGauche); } public void setIntervGauche(boolean bool){ this.intervGauche=bool; } public boolean getIntervDroite(){ return (this.intervDroite); } public void setIntervDroite(boolean bool){ this.intervDroite=bool; } public int compareTo(ModeleBase other) { int nombre1 = ((ModeleBase) other).getIndex(); int nombre2 = this.getIndex(); if (nombre1 > nombre2) return -1; else if(nombre1 == nombre2) return 0; else return 1; } } PK 3F>$fr/orsay/lri/varna/models/templates/PK 3F>Cfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToTree.class1=fr/orsay/lri/varna/models/templates/RNATemplate$ConvertToTreejava/lang/ObjectremovedHelixesLjava/util/Set; SignatureSLjava/util/Set;iterLjava/util/Iterator;ZLjava/util/Iterator; knownHelixesthis$01Lfr/orsay/lri/varna/models/templates/RNATemplate;C(Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/util/Set;)VV(Ljava/util/Set;)VCode    ()V /fr/orsay/lri/varna/models/templates/RNATemplate access$1d(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/templates/RNATemplate;  ! rnaIterator()Ljava/util/Iterator; # %java/util/HashSet $ (  * LineNumberTableLocalVariableTablethis?Lfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToTree;LocalVariableTypeTableconvert,()Lfr/orsay/lri/varna/models/treealign/Tree; Exceptions49fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplateh()Lfr/orsay/lri/varna/models/treealign/Tree;7(fr/orsay/lri/varna/models/treealign/Tree 6 6: ;<setValue(Ljava/lang/Object;)V > ?@ makeChildren-(Lfr/orsay/lri/varna/models/treealign/Tree;)Vroot*Lfr/orsay/lri/varna/models/treealign/Tree;fLfr/orsay/lri/varna/models/treealign/Tree;i(Lfr/orsay/lri/varna/models/treealign/Tree;)V 6F GH getChildren()Ljava/util/List; JLKjava/util/Iterator MNnext()Ljava/lang/Object;PBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementR@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix TVU java/util/Set WXcontains(Ljava/lang/Object;)Z TZ [Xadd Q] ^_ getLength()IaHelix length < 1 3c d(Ljava/lang/String;)VfFfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair e ei jksetHelixE(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;)V em nosetPositionInHelix(I)V qZrjava/util/List 6t uNgetValuew@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair vy z{getHelixD()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;}}Unexpected helix. Looks like there still are pseudoknots even after we removed them so something is wrong about the template. v vi vmKfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence ]Non-paired sequence length < 1@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence   setSequenceP(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;)VKWe have an endpoint which is neither an helix nor a sequence. What is that?)Unexpected end of template endpoint list. java/util/NoSuchElementExceptionfatherchildrenLjava/util/List;elementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;helixBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;firstPartOfHelixZ helixLengthI firstPositionafterLastPositionivalueHLfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair;child lastChildBLfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair;sequenceMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence; seqLengthBLfr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence;e"Ljava/util/NoSuchElementException;xLjava/util/List;>; SourceFileRNATemplate.java InnerClasses ConvertToTreeRNATemplateElementRNATemplateHelixRNATemplateUnpairedSequence     {%*+**+"*$Y&'*,)+ ,%-.%/ %01235f6Y8L+9*+=++ ,-. AB/  AC?@23D +EM*"ION-Q^-Q:*)S*'S 6*'YW6\6 3Y`b6h66 9eYg:  h  l6Y8:   9+E pW  Ƨ=*'S'+sv+svx 3Y|b*'YW\6 3Y`b+:6>vY~:6Y8:  9E pW :*=-L-:6 3YbY:6Y8:9,pWD3YbN+s3Yb+9-;AMPW]gt     #!)"2#9$@%I&P'](a!k+t0{1267:;<=>@CFGI,-.BU>P{WttWG@ * B a#NB&E2/IB C<#B/>CC #NCIC C"OQPK 3F>i5E%zzBfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToXml.class1V;connectionsXmlElementLorg/w3c/dom/Element;documentLorg/w3c/dom/Document;this$01Lfr/orsay/lri/varna/models/templates/RNATemplate;4(Lfr/orsay/lri/varna/models/templates/RNATemplate;)VCode    ()Vjava/util/HashMap   LineNumberTableLocalVariableTablethis>Lfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToXml;addConnectionIfNecessaryT(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V #%$Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint &' isConnected()Z #) *+ getElementF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; #- ./ getPositionH()Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; #1 2+getOtherElement #4 56getOtherEndPointS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; 8 :edge <>=org/w3c/dom/Document ?@ createElement)(Ljava/lang/String;)Lorg/w3c/dom/Element;BfromDendpoint FHG java/util/Map IJget&(Ljava/lang/Object;)Ljava/lang/Object;Ljava/lang/String NPOorg/w3c/dom/Element QR setAttribute'(Ljava/lang/String;Ljava/lang/String;)VTposition VXWDfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition YZtoString()Ljava/lang/String; N\ ]^ appendChild&(Lorg/w3c/dom/Node;)Lorg/w3c/dom/Node;`to b endPointQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;e1DLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;p1FLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;e2p2 xmlElementfromXmlElement toXmlElement toXMLDocument()Lorg/w3c/dom/Document; Exceptionsr4fr/orsay/lri/varna/exceptions/ExceptionXMLGenerationt9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate vxw(javax/xml/parsers/DocumentBuilderFactory yz newInstance,()Ljavax/xml/parsers/DocumentBuilderFactory; v| }~newDocumentBuilder%()Ljavax/xml/parsers/DocumentBuilder; !javax/xml/parsers/DocumentBuilder o newDocument RNATemplate <\elementsedges /fr/orsay/lri/varna/models/templates/RNATemplate access$0I(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Ljava/util/Collection; java/util/Collection iterator()Ljava/util/Iterator; java/util/Iterator next()Ljava/lang/Object;Bfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix F  containsKey(Ljava/lang/Object;)Zjava/lang/StringBuilderH ID (Ljava/lang/String;)V append(I)Ljava/lang/StringBuilder; X F put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;Kfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequenceS ID KWe have an endpoint which is neither an helix nor a sequence. What is that? s 'hasNexthelixidlength  getLength()I java/lang/Integer Y(I)Ljava/lang/String;flipped ' isFlipped java/lang/Boolean Y(Z)Ljava/lang/String; ' hasCaptioncaption Z getCaption startPositionx getStartPosition ()Ljava/awt/geom/Point2D$Double; java/awt/geom/Point2D$Double D java/lang/Double Y(D)Ljava/lang/String;y  endPosition getEndPosition 6getOut1  !  6getOut2sequence vertex5    getVertex5 vertex3   getVertex3inTangentVectorangle  getInTangentVectorAngle()D  getInTangentVectorLengthoutTangentVector  getOutTangentVectorAngle ! "getOutTangentVectorLength $ %6getOut'ParserConfigurationException: )+*.javax/xml/parsers/ParserConfigurationException ,Z getMessage . /-(Ljava/lang/String;)Ljava/lang/StringBuilder; qfactory*Ljavax/xml/parsers/DocumentBuilderFactory;builder#Ljavax/xml/parsers/DocumentBuilder;rootelementsXmlElement nextHelixInextNonPairedSequencetemplateElementBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;MLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;elementXmlNameLjava/lang/String;startPositionXmlElementendPositionXmlElementvertex5XmlElementvertex3XmlElementinTangentVectorXmlElementoutTangentVectorXmlElemente0Ljavax/xml/parsers/ParserConfigurationException;r(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToXml;)V I  SourceFileRNATemplate.java InnerClasses ConvertToXmlEdgeEndPointPositionRNATemplateElement EdgeEndPointRNATemplateHelixRNATemplateUnpairedSequenceTjava/awt/geom/Point2DDouble    C*+**Y    !j++"+(M+,N+0:+3,:*79;:*7A;:C*,EKMS-UM[W*7_;:C*EKMSUM[W*a[WB $1>Tak x   \ cdefghif$jh1k >-l x/m nopqs uL+{M*,7*7;N*7-W*7;:-[W**7;a-*a[W66*::;: * p* YWM;: * 0* YW sYc*:`:*EK:: *7;:M ŸɹM иӹM ؙ ݹM*7;:   M  M [W*7;:   M  M [W* * H6: *7;:M ɹM*7;:   M  M [W*7 ;:    M   M [W*7;:   M  M [W*7;:   M   M [W* # sY[W*7LqYY&+(-0)"H (5>MX [!^"{#$%&')*+,-0"6,7<9D:K;X<c=t>?@CDEFIJKLN"O.P6Q=RKSVTgVuWXY\]^_bcde"h0iBjSk]miosq}6tuv12 34o5 5W6 [78^98{:f1; 1< ,Q:f<A=>Xk Kk s k K; 2? 2@ =,< u2A 2B -C 0-D EFG&*+HJKL:MVN@O#PQRSU PK 3F>EAJfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition.class1:Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPositionjava/lang/EnumIN1FLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;IN2OUT1OUT2 ENUM$VALUESG[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;()VCode  (Ljava/lang/String;I)V          LineNumberTableLocalVariableTable thisvaluesI()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; (*)java/lang/System +, arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfZ(Ljava/lang/String;)Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; 0 -15(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileRNATemplate.java SignatureXLjava/lang/Enum; InnerClasses8/fr/orsay/lri/varna/models/templates/RNATemplateEdgeEndPointPosition@1@@@@   xTYYYYYSYSYSYS! 4"1*+#!" $ %&6YK*Y<YM',!" -.* */!"23456 79@PK 3F>;;fr/orsay/lri/varna/models/templates/RNATemplate$In1Is.class125fr/orsay/lri/varna/models/templates/RNATemplate$In1Isjava/lang/Enum IN1_IS_5PRIME7Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is; IN1_IS_3PRIME ENUM$VALUES8[Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is;()VCode  (Ljava/lang/String;I)V       LineNumberTableLocalVariableTable thisvalues:()[Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is; "!java/lang/System #$ arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfK(Ljava/lang/String;)Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is; ( %)5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileRNATemplate.java SignatureILjava/lang/Enum; InnerClasses0/fr/orsay/lri/varna/models/templates/RNATemplateIn1Is@1@@   R.Y YYSYS _^ 1*+^   6YK*Y<YM, %& * *'*+,-. /1@PK 3F>[v##Afr/orsay/lri/varna/models/templates/RNATemplate$LoadFromXml.class1p;fr/orsay/lri/varna/models/templates/RNATemplate$LoadFromXmljava/lang/Object xmlDocumentLorg/w3c/dom/Document; elementNamesLjava/util/Map; SignaturegLjava/util/Map;this$01Lfr/orsay/lri/varna/models/templates/RNATemplate;J(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lorg/w3c/dom/Document;)VCode   ()Vjava/util/HashMap     LineNumberTableLocalVariableTablethis=Lfr/orsay/lri/varna/models/templates/RNATemplate$LoadFromXml; pointFromXml5(Lorg/w3c/dom/Element;)Ljava/awt/geom/Point2D$Double;#java/awt/geom/Point2D$Double "&x (*)org/w3c/dom/Element +, getAttribute&(Ljava/lang/String;)Ljava/lang/String; .0/java/lang/Double 12 parseDouble(Ljava/lang/String;)D "4 &5D7y "9 75xmlPointLorg/w3c/dom/Element;pointLjava/awt/geom/Point2D$Double;vectorLengthFromXml(Lorg/w3c/dom/Element;)DAlength xmlVectorvectorAngleFromXmlEangleendPointFromXmlh(Lorg/w3c/dom/Element;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; ExceptionsJ1fr/orsay/lri/varna/exceptions/ExceptionXmlLoadingLendpointNPjava/lang/StringBuilderRMissing endpoint attribute on OT U(Ljava/lang/String;)V OW XYappend-(Ljava/lang/Object;)Ljava/lang/StringBuilder; O[ \]toString()Ljava/lang/String; IT`positionbMissing position attribute on dfe java/util/Map gh containsKey(Ljava/lang/Object;)Z dj klget&(Ljava/lang/Object;)Ljava/lang/Object;nBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement prqDfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition stvalueOfZ(Ljava/lang/String;)Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;v"Could not compute relativePosition mx yzgetEndPointFromPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;|%Edge is connected on unkown element: O~ X-(Ljava/lang/String;)Ljava/lang/StringBuilder;xmlEdgeEndPoint elementIdLjava/lang/String;positionOnElementtemplateElementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;relativePositionFLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; connectErrMsg(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;Ljava/lang/String;)Ljava/lang/String;Error while connecting [Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint to  because: v1QLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;v2reasonconnect(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V%Invalid edge: missing endpoint v1 =  v2 =  isConnected()Z&Second vertex is already connected to getOtherElementF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; [  %First vertex is already connected to  connectToT(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V+A vertex is on two edges at the same time: Cfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected ] getMessageExceptionInvalidRNATemplate: 9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplateeELfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected;;Lfr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate;loadelements org/w3c/dom/Document getElementsByTagName*(Ljava/lang/String;)Lorg/w3c/dom/NodeList; org/w3c/dom/NodeList item(I)Lorg/w3c/dom/Node; (  getChildNodes()Lorg/w3c/dom/NodeList; ( ] getTagNamehelix@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelixid F(Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/lang/String;)Vflipped java/lang/Boolean  parseBoolean(Ljava/lang/String;)Z  setFlipped(Z)V java/lang/Integer parseInt(Ljava/lang/String;)I  setLength(I)Vcaption (  hasAttribute U setCaption d put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; startPosition  !  setStartPosition!(Ljava/awt/geom/Point2D$Double;)V  endPosition   setEndPosition   getLength()IsequenceKfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence  inTangentVector  >?  setInTangentVectorLength(D)V  C? " #setInTangentVectorAngle%outTangentVector ' (setOutTangentVectorLength * +setOutTangentVectorAngle-vertex5 / 0 setVertex52vertex3 4 5 setVertex37edges9edge;from = FG?toA(Invalid edge: missing "from" declarationC&Invalid edge: missing "to" declaration E  xmlElementsxmlElementsChildrenLorg/w3c/dom/NodeList;iIxmlElementsChildLorg/w3c/dom/Node;xmlTemplateElementtagNameBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;xmlHelixChildrenj xmlHelixChildxmlHelixChildElementhelixChildTagNameMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;xmlSequenceChildrenxmlSequenceChildxmlSequenceChildElementsequenceChildTagNamexmlEdgesxmlEdgesChildren xmlEdgesChildxmlTemplateEdgexmlEdgeChildren xmlEdgeChildxmlEdgeChildElementedgeChildTagName SourceFileRNATemplate.java InnerClassesf/fr/orsay/lri/varna/models/templates/RNATemplateEdgeEndPointPosition LoadFromXmlRNATemplateElement EdgeEndPointRNATemplateHelixRNATemplateUnpairedSequencenjava/awt/geom/Point2DDouble     Z*+**Y*,  !r("Y$M,+%'-3,+6'-8,& ((:; <=>?@ +@'-  B;C?@ +D'-  B;FGHI3+K'M, ,MIYOYQS+VZ^+_'N- -MIYOYaS+VZ^*,c/*,im:-o: IYu^wIYOY{S,}Z^6  +4>Vcrx}>; 4srx)OYS+}},}}-}Z !%*))))HIN+,$IYOYS+V},VZ^,'IY*+,OYS,}Z^+'IY*+,OYS+}Z^+,;NIYOYS-}Z^NIYOYS-}Z^2 )0T[4HIz*(L+M>,:((::զ׻Y*ٹ':޹'@''*ٹ'W:6 R :  (< (:  :  *  *    Y*ٹ':@'*ٹ'W:6  :  (~ (:  :  * * !M $* &* ), ,* . 1* 3   f,  *6(M,N6-:((:8::: 6 L  :  (6 (:  :  :* <: > * <:    IY@^IYB^*D- =&I!*29BI_p %;Lajp{      07=G O!V"c#i$r%x&'()*+,-%12345;8F;GHIJ*KL9M;BN_OdPH^QJ ARL 2S; )T ;UjVHmQJ {WL tX; kY 0Z;7[H:IJG\LV];fir^H uXQJ ;_L ,`; #a bcd:peg@ehmeimjekel"mo PK 3F>XK}3 Bfr/orsay/lri/varna/models/templates/RNATemplate$MakeEdgeList.class1g;this$01Lfr/orsay/lri/varna/models/templates/RNATemplate;4(Lfr/orsay/lri/varna/models/templates/RNATemplate;)VCode   ()Vjava/util/LinkedList   LineNumberTableLocalVariableTablethis>Lfr/orsay/lri/varna/models/templates/RNATemplate$MakeEdgeList;addEdgeIfNecessaryT(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V ! Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint "# isConnected()Z %'&java/util/List ()add(Ljava/lang/Object;)ZendPointQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;make()Ljava/util/List;e()Ljava/util/List; 021/fr/orsay/lri/varna/models/templates/RNATemplate 34access$0I(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Ljava/util/Collection; 687java/util/Collection 9:iterator()Ljava/util/Iterator; <>=java/util/Iterator ?@next()Ljava/lang/Object;BBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementD@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix CF GHgetIn1S()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; J  CL MHgetIn2OKfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence NQ RHgetIn <T U#hasNextelementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;helixBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;sequenceMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;r(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$MakeEdgeList;)V ^  SourceFileRNATemplate.java InnerClasses MakeEdgeListRNATemplateElement EdgeEndPointRNATemplateHelixRNATemplateUnpairedSequence    C*+**Y    O+*+$W*+,-. [*/5M@,;AL+C+CN*-EI*-KI+N+NN*-PI,S** !&.9@EMV*[3VW&XYEZ[ \ &*+]_`a*0bA0cAdC0eN0fPK 3F>M50 0 Afr/orsay/lri/varna/models/templates/RNATemplate$RNAIterator.class1l;fr/orsay/lri/varna/models/templates/RNATemplate$RNAIteratorjava/lang/Objectjava/util/IteratoriterLjava/util/Iterator; SignaturegLjava/util/Iterator;this$01Lfr/orsay/lri/varna/models/templates/RNATemplate;R$SWITCH_TABLE$fr$orsay$lri$varna$models$templates$RNATemplate$EdgeEndPointPosition[I4(Lfr/orsay/lri/varna/models/templates/RNATemplate;)VCode   ()V /fr/orsay/lri/varna/models/templates/RNATemplate vertexIterator()Ljava/util/Iterator;  LineNumberTableLocalVariableTablethis=Lfr/orsay/lri/varna/models/templates/RNATemplate$RNAIterator;hasNext()Z & #$nextF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; &+ java/util/NoSuchElementException * . '/()Ljava/lang/Object;1Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint 3 4()[I 06 78 getPositionH()Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; :<;Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition =>ordinal()I 0@ A( getElementcurrentEndPointQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;removeF'java/lang/UnsupportedOperationException E I '( K  :M NOvaluesI()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; :Q RSIN1FLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; :U VSIN2 :X YSOUT1 :[ \SOUT2^java/lang/NoSuchFieldErrorq(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNAIterator;)V a  SourceFileRNATemplate.javalLjava/lang/Object;Ljava/util/Iterator; InnerClassesEdgeEndPointPosition RNAIteratoriBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementRNATemplateElement EdgeEndPoint     @*+**+  !"#$4 *%  !"'(N*) *Y,*-0L2+59."*-0L+?<I N!"2BCD2EYG !"A'/%*H  4JJYWL K*P9OW*T9OW*W9OW*Z9OW*YJ]&)]*36]7@C] _&*+` bc de":f@ghj0hkPK 3F>D$(Ufr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint.class1kOfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPointjava/lang/Object otherEndPointQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;this$1DLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;G(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)VCode    ()VLineNumberTableLocalVariableTablethisgetNextEndPointS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; Bfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement access$0(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;  (Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;getPreviousEndPoint !  getPositionH()Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; % &'getPositionFromEndPoint(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; getElementF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;getOtherEndPoint , getOtherElement / () disconnect isConnected()Z connectToT(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V Exceptions7Cfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected99fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate 6 < =>access$1w(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Lfr/orsay/lri/varna/models/templates/RNATemplate; @BA/fr/orsay/lri/varna/models/templates/RNATemplate =Cd(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/templates/RNATemplate; E FGgetParentTemplate3()Lfr/orsay/lri/varna/models/templates/RNATemplate;IFElements from different templates cannot be connected with each other. 8K L(Ljava/lang/String;)VtoString()Ljava/lang/String;Pjava/lang/StringBuilderREdge endpoint on element OK U MN OW XYappend-(Ljava/lang/String;)Ljava/lang/StringBuilder;[ at position ] "# _U`Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition OU(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V d  SourceFileRNATemplate.java InnerClassesEdgeEndPointPositionRNATemplateElement EdgeEndPoint!   8 *+ *    6 * *   6 * *   "# 6 * *$  () 2*  * /*+ -) =*+ *+.  0 K*+*++*+*+,. 12 5 *+5  34568 ?*+ ++ 6Y:* ;?+.D 8YHJ*+++*+ABD*E4G9H>I??MN S)OYQS* TVZV*\^VaM ) b &*+cefg_@h@@ijPK 3F>ÇOLLHfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement.class1pBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementjava/lang/Object_idIelementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;this$01Lfr/orsay/lri/varna/models/templates/RNATemplate;getName()Ljava/lang/String;Codejava/lang/StringBuilder RNATemplate  (Ljava/lang/String;)V    append(I)Ljava/lang/StringBuilder;   toStringLineNumberTableLocalVariableTablethis4(Lfr/orsay/lri/varna/models/templates/RNATemplate;)V $ & '()V )+*/fr/orsay/lri/varna/models/templates/RNATemplate ,-access$2()I )/ 01access$3(I)V 3  )5 67access$0I(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Ljava/util/Collection; 9;:java/util/Collection <=add(Ljava/lang/Object;)ZdisconnectFromAnygetIn1EndPointS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;getParentTemplate3()Lfr/orsay/lri/varna/models/templates/RNATemplate; )D EFaccess$1d(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/templates/RNATemplate;getNextEndPoint(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;getPreviousEndPointgetEndPointFromPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;getPositionFromEndPoint(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; connectTo(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V ExceptionsRCfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnectedT9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate V JK XZYOfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint N[T(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V positionHereFLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; otherEndPointQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; endPointHere(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)V c NO otherElementpositionOnOtherElement(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;w(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Lfr/orsay/lri/varna/models/templates/RNATemplate; SourceFileRNATemplate.java InnerClasseslDfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPositionEdgeEndPointPositionRNATemplateElement EdgeEndPoint!   >Y* !" a'*+#*%*(Y`.**2+4*8W  '!>'?@AB 2*#C !GHIHJKLMNOPQS \ *+UN-,Wgh i * ! \] ^_`_NaPQQS i,-U:*+bvwx 4!\]de]^_6f %*2 Eg %*# hijk)m@)nXoPK 3F>Q3Ffr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix.class1@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelixBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementlengthI startPositionLjava/awt/geom/Point2D$Double; endPositionflippedZin1Is7Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is;captionLjava/lang/String;in1QLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;out1in2out2_namethis$01Lfr/orsay/lri/varna/models/templates/RNATemplate;R$SWITCH_TABLE$fr$orsay$lri$varna$models$templates$RNATemplate$EdgeEndPointPosition[I isFlipped()ZCode  LineNumberTableLocalVariableTablethisBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix; setFlipped(Z)VgetIn1Is9()Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is; ( setIn1Is:(Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is;)V getCaption()Ljava/lang/String; .  setCaption(Ljava/lang/String;)V hasCaptionF(Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/lang/String;)V 5  7 284(Lfr/orsay/lri/varna/models/templates/RNATemplate;)V:Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint 9< 2=(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V ?  A  C  E  G nametoStringKjava/lang/StringBuilderM Helix @ JO 20 QSRjava/lang/Object TUhashCode()I WYXjava/lang/Integer Z[ toHexString(I)Ljava/lang/String; J] ^_append-(Ljava/lang/String;)Ljava/lang/StringBuilder;a len= c  Je ^f(I)Ljava/lang/StringBuilder;h caption= Jj I,getName Jm 2n()V getLength setLength(I)VgetStartPosition ()Ljava/awt/geom/Point2D$Double; u setStartPosition!(Ljava/awt/geom/Point2D$Double;)VgetEndPosition z setEndPositiongetIn1S()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;getOut1getIn2getOut2disconnectFromAny  |} 9 n disconnect  }  ~}  }getNextEndPoint(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; 9 }getOtherEndPointendpointgetPreviousEndPointgetIn1EndPointgetEndPointFromPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;  ()[I Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition UordinalpositionFLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;getPositionFromEndPoint(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; IN1 IN2 OUT1 OUT2endPoint   valuesI()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;java/lang/NoSuchFieldError SourceFileRNATemplate.java InnerClasses/fr/orsay/lri/varna/models/templates/RNATemplateEdgeEndPointPosition5fr/orsay/lri/varna/models/templates/RNATemplate$In1IsIn1IsRNATemplateElement EdgeEndPointRNATemplateHelixjava/awt/geom/Point2D$Doublejava/awt/geom/Point2DDouble!     /* !"#$>*  !" %&/*' !")*>*+'  !" +,/*- !"/0>*+-  !"15 *-  !"23S*+4*+6**'*-*9Y*;>*9Y*;@*9Y*;B*9Y*;D*,F*  &3@M S!"SHI,Y/JYLN*PV\`\*bdg\*-\i /!"k,<JYl*F\i !"oU/*b !"pq>*b  !"rs/*t !"vw>*+t  !"xs/*y !"{w>*+y  !" |}/*> !"~}/*@ !"}/*B !"}/*D !"nW**** !"c+*>*@+*B*D+ !"$ !"c+*@*>+*D*B+*+ ,-/ !"}/*>5 !">+.4 %*/****:(<->2@7B<D >!">2+*>+*B+*@+*D& JK LMN O$P,Q0S 2!"2JYW K*OW*OW*OW*OW*Y&)*367@C 2@@9 PK 3F>P  Qfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence.class1Kfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequenceBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementlengthIdefaultTangentVectorAngleD ConstantValue?!TD-defaultTangentVectorLength@YinTangentVectorAngleinTangentVectorLengthoutTangentVectorAngleoutTangentVectorLengthvertex5Ljava/awt/geom/Point2D$Double;vertex3inQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;out_nameLjava/lang/String;this$01Lfr/orsay/lri/varna/models/templates/RNATemplate;R$SWITCH_TABLE$fr$orsay$lri$varna$models$templates$RNATemplate$EdgeEndPointPosition[I getVertex5 ()Ljava/awt/geom/Point2D$Double;Code # LineNumberTableLocalVariableTablethisMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence; setVertex5!(Ljava/awt/geom/Point2D$Double;)V getVertex3 ,  setVertex3F(Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/lang/String;)V 1  3 .44(Lfr/orsay/lri/varna/models/templates/RNATemplate;)V 6  8  :  < >Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint =@ .A(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)V C  E  G nametoString()Ljava/lang/String;Ljava/lang/StringBuilderN Sequence @ KP .Q(Ljava/lang/String;)V SUTjava/lang/Object VWhashCode()I Y[Zjava/lang/Integer \] toHexString(I)Ljava/lang/String; K_ `aappend-(Ljava/lang/String;)Ljava/lang/StringBuilder;c len= e  Kg `h(I)Ljava/lang/StringBuilder; Kj IJgetName Km .n()V getLength setLength(I)VgetInTangentVectorAngle()DsetInTangentVectorAngle(D)VgetInTangentVectorLengthsetInTangentVectorLengthgetOutTangentVectorAnglesetOutTangentVectorAnglegetOutTangentVectorLengthsetOutTangentVectorLengthgetInS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;getOutdisconnectFromAny  |} = n disconnect  ~}getNextEndPoint(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; = }getOtherEndPointendpointgetPreviousEndPointgetIn1EndPointgetEndPointFromPosition(Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;  ()[I Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition WordinalpositionFLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;getPositionFromEndPoint(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; IN1 OUT1endPoint   valuesI()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; IN2 OUT2java/lang/NoSuchFieldError SourceFileRNATemplate.java InnerClasses/fr/orsay/lri/varna/models/templates/RNATemplateEdgeEndPointPositionRNATemplateElement EdgeEndPointRNATemplateUnpairedSequencejava/awt/geom/Point2D$Doublejava/awt/geom/Point2DDouble!       !/*"$% &'()!>*+"$ %&'* !/*+$% &'-)!>*++$ %&'./!F*+0*+2* 5* 7* 9* ;*=Y*?B*=Y*?D*,F$&  rstu&3@%F&'FHIJ!M#KYMO*RX^b^*dfi$% #&'kJ!<KYl*F^i$% &'oW!/*d$% &'pq!>*d$ %&'rs!/*5$% &'tu!>*'5$ %&'vs!/*7$% &'wu!>*'7$ %&'xs!/*9$% &'yu!>*'9$ %&'zs!/*;$% &'{u!>*';$ %&'|}!/*B$% &'~}!/*D$% &'n!A**$% &'!N+*B*D+$ %&'!N+*D*B+$ %&'}!/*B$% &'!p0+.&&!**$$). %0&'0!^+*B+*D$ %&'!JYW K*OW*OW*OW*OW*Y&)*367@C$a%*@= PK 3F>l8]]Gfr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnots.class1Afr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnotsjava/lang/Object helixesSeqLjava/util/ArrayList; SignatureYLjava/util/ArrayList; helixesStruct*Ljava/util/ArrayList;helixesStructWithoutPseudoKnots[Ithis$01Lfr/orsay/lri/varna/models/templates/RNATemplate;$assertionsDisabledZ()VCode/fr/orsay/lri/varna/models/templates/RNATemplate java/lang/Class desiredAssertionStatus()Z  LineNumberTableLocalVariableTable4(Lfr/orsay/lri/varna/models/templates/RNATemplate;)V #  % thisCLfr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnots; initArrays Exceptions+9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate-java/util/ArrayList ,% 0  2 4java/util/Hashtable 3% 7 89 rnaIterator()Ljava/util/Iterator; ;=<java/util/Iterator >?next()Ljava/lang/Object;ABfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementC@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix ,E FGadd(Ljava/lang/Object;)Z ,I JKsize()I MON java/util/Map PG containsKey MR STget&(Ljava/lang/Object;)Ljava/lang/Object;Vjava/lang/Integer UX YKintValue U[ \]valueOf(I)Ljava/lang/Integer; ,_ S`(I)Ljava/lang/Object;b*We met an helix 3 times. Is there a cycle? *d e(Ljava/lang/String;)V ,g hiset'(ILjava/lang/Object;)Ljava/lang/Object; Mk lmput8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ;o phasNext knownHelixesLjava/util/Map;iterLjava/util/Iterator;elementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;indexIotherOccurenceIndexLocalVariableTypeTablefLjava/util/Map;ZLjava/util/Iterator;isSelfCrossingjava/util/Stack ~%java/awt/Point (II)V ~E ~ ?pop xx xy ~ Tpush ~ empty intervalsLjava/util/Stack;pLjava/awt/Point;ijk#Ljava/util/Stack;removePseudoKnotsAux  }  [[Sjava/lang/AssertionError % B K getLengthlengthresulttab backtrackntmpmakeSet()Ljava/util/Set;U()Ljava/util/Set;java/util/HashSet % E java/util/SetremovedHelixesLjava/util/Set;SLjava/util/Set;removePseudoKnots  (    w(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnots;)V  ! SourceFileRNATemplate.java InnerClassesRNATemplateElementRNATemplateHelixRemovePseudoKnots     1 !4 *+"*$  &'()**,Y./*,Y.13Y5L*"6M,:@N-B*/-BDW*/Hd6+-LN+-QUW6*1ZDW*1^UW *Yac*1ZfW+-BZjW*1ZDW,naN, -./&0)132:3F4Q5[7j8w9:>BE0J>&'qr&st3uvQqwxj<yxzq{&s|}d~YL+Y*1HdW+M,,*1,^UW+Y,`,WR,>,6*1^UW6 +Y`dW+Y`W+lBQRS!T)U4VIWbYgZm[}\]_`Se>&')gJxmDx}4xz  *8**1H <**1^UWO**1H< M> ,O,N:62V,66`6-2-`25V2V*1^UW6 Yng*/^B6 `d -`2d5`6 ` -`25`6  -25-2 V2Vd@1~Y:YdW:25',OY`WO66256 , O, OY` dWY `Wb*,3opqr-q<xDzH{M|Q{Zaiox $0:EQZctw&'#xDxH JxailxxxxxSx cEx>x4x z c6YL=!*.+*/^BW*+ (4 6&'. *xz .)*? ***°  &' &*+ű@BPK 3F>ojjDfr/orsay/lri/varna/models/templates/RNATemplate$VertexIterator.class1?>fr/orsay/lri/varna/models/templates/RNATemplate$VertexIteratorjava/lang/Objectjava/util/IteratorendpointQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;this$01Lfr/orsay/lri/varna/models/templates/RNATemplate;4(Lfr/orsay/lri/varna/models/templates/RNATemplate;)VCode   ()V /fr/orsay/lri/varna/models/templates/RNATemplate getFirstEndPointS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;  LineNumberTableLocalVariableTablethis@Lfr/orsay/lri/varna/models/templates/RNATemplate$VertexIterator;hasNext()Znext# java/util/NoSuchElementException " &('Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint )getNextEndPointcurrentEndPointremove-'java/lang/UnsupportedOperationException ,()Ljava/lang/Object; 1 !t(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$VertexIterator;)V 4  SourceFileRNATemplate.java SignatureyLjava/lang/Object;Ljava/util/Iterator; InnerClasses;Bfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElementRNATemplateElement EdgeEndPointVertexIterator    @*+**+     5 *  ! b* "Y$*L*+%+ *+ 2,Y. A!/ %*0 2 &*+356789:<&:=>PK 3F>u););5fr/orsay/lri/varna/models/templates/RNATemplate.class1/fr/orsay/lri/varna/models/templates/RNATemplatejava/lang/ObjectelementsLjava/util/Collection; Signature\Ljava/util/Collection;template1Lfr/orsay/lri/varna/models/templates/RNATemplate;NEXT_IDIR$SWITCH_TABLE$fr$orsay$lri$varna$models$templates$RNATemplate$EdgeEndPointPosition[I()VCode  LineNumberTableLocalVariableTable  java/util/ArrayList     thisisEmpty()Z $&%java/util/Collection !"getFirstF()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; * +,getFirstEndPointS()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint; .0/Ofr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint 1( getElement3java/util/HashSet 2 6 7,getAnyEndPoint 9;: java/util/Set <=contains(Ljava/lang/Object;)Z 9? @=add .B C,getPreviousEndPointknownEndPointsLjava/util/Set;currentEndPointQLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;previousEndPointLocalVariableTypeTablebLjava/util/Set;getAny $M NOiterator()Ljava/util/Iterator; QSRjava/util/Iterator TUnext()Ljava/lang/Object;WBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement & Z K( V\ ],getIn1EndPoint rnaIterator\()Ljava/util/Iterator;a;fr/orsay/lri/varna/models/templates/RNATemplate$RNAIterator `c dq(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$RNAIterator;)VclassicIteratorvertexIteratori()Ljava/util/Iterator;i>fr/orsay/lri/varna/models/templates/RNATemplate$VertexIterator hk lt(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$VertexIterator;)V makeEdgeList()Ljava/util/List;e()Ljava/util/List;qLfr/orsay/lri/varna/models/templates/RNATemplate$MakeEdgeList;connectedComponentIsCyclicT(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint;)ZendPoint isConnected@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelixKfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence Q "hasNext . ,getNextEndPoint 9 size()InelementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; nextEndPointcheckIsValidTemplate Exceptions9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplateThe template is empty. (Ljava/lang/String;)V  }"&The template is a non-connected graph.  z{The template is cyclic.toTree,()Lfr/orsay/lri/varna/models/treealign/Tree;h()Lfr/orsay/lri/varna/models/treealign/Tree;   computeIn1IsAfr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnots w(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lfr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnots;)V removePseudoKnots()Ljava/util/Set;=fr/orsay/lri/varna/models/templates/RNATemplate$ConvertToTree C(Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/util/Set;)V convertpseudoKnotKillerCLfr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnots;removedHelixes converter?Lfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToTree;SLjava/util/Set;toRNA%()Lfr/orsay/lri/varna/models/rna/RNA;  java/util/HashMap   ^O ~  getLength  java/util/Map = containsKey  get&(Ljava/lang/Object;)Ljava/lang/Object;  (I)Ljava/lang/Object;java/lang/Integer intValue valueOf(I)Ljava/lang/Integer;  set'(ILjava/lang/Object;)Ljava/lang/Object; ? put8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; KWe have an endpoint which is neither an helix nor a sequence. What is that? 4fr/orsay/lri/varna/models/templates/RNATemplateAlign intArrayFromList(Ljava/util/List;)[Ijava/lang/String java/util/Arrays fill(([Ljava/lang/Object;Ljava/lang/Object;)V!fr/orsay/lri/varna/models/rna/RNA   setRNA([Ljava/lang/String;[I)Vjava/lang/RuntimeExceptionHBug in toRNA(): setRNA() threw an ExceptionFileFormatOrSyntax exception.  9fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntaxstrLjava/util/ArrayList;helixesLjava/util/Map;iterLjava/util/Iterator;helixBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix; firstBase helixMembersiindexOfAssociatedBasesequenceMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence; strAsArray seqAsArray[Ljava/lang/String;rna#Lfr/orsay/lri/varna/models/rna/RNA;e;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;*Ljava/util/ArrayList;}Ljava/util/Map;>;ZLjava/util/Iterator; toXMLFile(Ljava/io/File;)V%4fr/orsay/lri/varna/exceptions/ExceptionXMLGeneration ' () toXMLDocument()Lorg/w3c/dom/Document;+!javax/xml/transform/dom/DOMSource *- .(Lorg/w3c/dom/Node;)V0'javax/xml/transform/stream/StreamResult /2 # 465&javax/xml/transform/TransformerFactory 78 newInstance*()Ljavax/xml/transform/TransformerFactory; 4: ;<newTransformer#()Ljavax/xml/transform/Transformer;>indent@yes BDCjavax/xml/transform/Transformer EFsetOutputProperty'(Ljava/lang/String;Ljava/lang/String;)V BH IJ transform;(Ljavax/xml/transform/Source;Ljavax/xml/transform/Result;)VLjava/lang/StringBuilderN#TransformerConfigurationException: K QSR5javax/xml/transform/TransformerConfigurationException TU getMessage()Ljava/lang/String; KW XYappend-(Ljava/lang/String;)Ljava/lang/StringBuilder; K[ \UtoString $_&TransformerFactoryConfigurationError: aSb8javax/xml/transform/TransformerFactoryConfigurationErrordTransformerException: fSg(javax/xml/transform/TransformerExceptionfileLjava/io/File; xmlDocumentLorg/w3c/dom/Document;sourceLjavax/xml/transform/Source;resultLjavax/xml/transform/Result; transformer!Ljavax/xml/transform/Transformer;7Ljavax/xml/transform/TransformerConfigurationException;:Ljavax/xml/transform/TransformerFactoryConfigurationError;*Ljavax/xml/transform/TransformerException;vLfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToXml; fromXMLFileA(Ljava/io/File;)Lfr/orsay/lri/varna/models/templates/RNATemplate;1fr/orsay/lri/varna/exceptions/ExceptionXmlLoading (javax/xml/parsers/DocumentBuilderFactory 7,()Ljavax/xml/parsers/DocumentBuilderFactory;  #setIgnoringElementContentWhitespace(Z)V  newDocumentBuilder%()Ljavax/xml/parsers/DocumentBuilder; !javax/xml/parsers/DocumentBuilder parse&(Ljava/io/File;)Lorg/w3c/dom/Document;  fromXMLDocumentI(Lorg/w3c/dom/Document;)Lfr/orsay/lri/varna/models/templates/RNATemplate;ParserConfigurationException: S.javax/xml/parsers/ParserConfigurationException ~SAXException: Sorg/xml/sax/SAXException IOException: Sjava/io/IOExceptionfactory*Ljavax/xml/parsers/DocumentBuilderFactory;builder#Ljavax/xml/parsers/DocumentBuilder;0Ljavax/xml/parsers/ParserConfigurationException;Lorg/xml/sax/SAXException;Ljava/io/IOException; ;fr/orsay/lri/varna/models/templates/RNATemplate$LoadFromXml  getClass()Ljava/lang/Class;  J(Lfr/orsay/lri/varna/models/templates/RNATemplate;Lorg/w3c/dom/Document;)V  loadloader=Lfr/orsay/lri/varna/models/templates/RNATemplate$LoadFromXml;  fO  ()[I .  getPositionH()Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition; Dfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition ordinal 5fr/orsay/lri/varna/models/templates/RNATemplate$In1Is  IN1_IS_5PRIME7Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is; ~ setIn1Is:(Lfr/orsay/lri/varna/models/templates/RNATemplate$In1Is;)V   IN1_IS_3PRIME knownHelicestemplateElementgLjava/util/Iterator; removeElementG(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Z $; V disconnectFromAny $ =removeaccess$0I(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Ljava/util/Collection;access$1d(Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/templates/RNATemplate;access$2access$3(I)V    valuesI()[Lfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;  IN1FLfr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition;  IN2  OUT1  OUT2java/lang/NoSuchFieldError SourceFileRNATemplate.java InnerClasses ConvertToTree ConvertToXmlEdgeEndPointPositionIn1Is LoadFromXml MakeEdgeList RNAIteratorRNATemplateElement EdgeEndPointRNATemplateHelixRNATemplateUnpairedSequenceRemovePseudoKnotsVertexIterator!  ) 9K**Y**9=9  !"4 *#C  '(2*)-P  +,?*#2Y4L*5M+,8,+,>W,AN-,-M2 ] ^`ac%f'h/i4j8k:m<b*? )DE$FG4HGI )DJK(R *#*LPVy z|  7,C*X*Y[   ^O_4 `Y*b  eO_4 *L  fOg4 hY*j  mnoGpY*rL+u    xyz{12Y4M+N,-8,->W-A:N* VW YZ\]$^)_+a.X41 1|G)DE 'FG$ HGI )DJ}"@*X<*LN$-PVM,~  ,-ٻ2Y4M*)N,-8,->W-: N,Rkl p q"r)s/t6u9qBzJ{O}Y\djoru|x> { "J<DEO7FGj GI J<DJz8*X Y* Y**5 Y"-7 8 "*Y*L+MY*,N-*" EI . ^*YLYM*N-PV:~~:6,V+6,:6 3d d׶6 +  `ܶW+ ܶW  ̧+6Y:6 +ܶW `ܶW  ,W?-:66+ܶW Y-+::Y::YBKN( '/6=HN[au$*29BNP[^ R  J  E'6= NM [@ ^: u ; 2 $ #  *42,BP I4 R J  E![@2"#$P*&M*Y,,N/Y+1:39:=?A-GZM$YKYMO,PVZ]M$YKY^O,`VZ]M$YKYcO,eVZ]36Q3Sa3pf6  +67STpq\ hi1jk(lmno pq7rTsqt()$GuY*wL+z   { |}~pL++M,*N-L~YKYO+VZL~YKYO+VZL~YKYO+VZ6S. AB CDEFG6H7ISJTKHphi jk7T ~gYLY+YW*M,+QRST jk F**L2Y4Ms+P.N--:~[~:,8I-¶.2**˶ѧ ն,>W+Fln opqr$s,t3u>wAwhzp{s~{p> }Ef|G$`3QI }d *++*+W  %*=%*$% JYW K*OW*OW*OW*OW*Y&)*367@C9j u@@p` V .V ~  hPK m>4fr/orsay/lri/varna/models/templates/RNATemplate.javapackage fr.orsay.lri.varna.models.templates; import java.awt.Point; import java.awt.geom.Point2D; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; import java.util.Stack; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import fr.orsay.lri.varna.exceptions.ExceptionEdgeEndpointAlreadyConnected; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.exceptions.ExceptionXMLGeneration; import fr.orsay.lri.varna.exceptions.ExceptionXmlLoading; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement.EdgeEndPoint; import fr.orsay.lri.varna.models.treealign.Tree; /** * A model for RNA templates. * A template is a way to display an RNA secondary structure. * * @author Raphael Champeimont */ public class RNATemplate { /** * The list of template elements. */ private Collection elements = new ArrayList(); /** * Tells whether the template contains elements. */ public boolean isEmpty() { return elements.isEmpty(); } /** * The first endpoint (in sequence order) of the template. * If there are multiple connected components, the first elements of one * connected component will be returned. * If the template contains no elements, null is returned. * If there is a cycle, an arbitrary endpoint will be returned * (as it then does not make sense to define the first endpoint). * Time: O(n) */ public RNATemplateElement getFirst() { return getFirstEndPoint().getElement(); } /** * The first endpoint edge endpoint (in sequence order) of the template. * If there are multiple connected components, the first elements of one * connected component will be returned. * If the template contains no elements, null is returned. * If there is a cycle, an arbitrary endpoint will be returned * (as it then does not make sense to define the first endpoint). * Time: O(n) */ public EdgeEndPoint getFirstEndPoint() { if (elements.isEmpty()) { return null; } else { Set knownEndPoints = new HashSet(); EdgeEndPoint currentEndPoint = getAnyEndPoint(); while (true) { if (knownEndPoints.contains(currentEndPoint)) { // There is a cycle in the template, so we stop there // to avoid looping infinitely. return currentEndPoint; } knownEndPoints.add(currentEndPoint); EdgeEndPoint previousEndPoint = currentEndPoint.getPreviousEndPoint(); if (previousEndPoint == null) { return currentEndPoint; } else { currentEndPoint = previousEndPoint; } } } } /** * Return an arbitrary element of the template, * null if empty. * Time: O(1) */ public RNATemplateElement getAny() { if (elements.isEmpty()) { return null; } else { return elements.iterator().next(); } } /** * Return an arbitrary endpoint of the template, * null if empty. * Time: O(1) */ public EdgeEndPoint getAnyEndPoint() { if (isEmpty()) { return null; } else { return getAny().getIn1EndPoint(); } } /** * Variable containing "this", used by the internal class * to access this object. */ private final RNATemplate template = this; /** * To get an iterator of this class, use rnaIterator(). * See rnaIterator() for documentation. */ private class RNAIterator implements Iterator { private Iterator iter = vertexIterator(); public boolean hasNext() { return iter.hasNext(); } public RNATemplateElement next() { if (! hasNext()) { throw (new NoSuchElementException()); } EdgeEndPoint currentEndPoint = iter.next(); switch (currentEndPoint.getPosition()) { // We skip "IN" endpoints, so that we don't return elements twice case IN1: case IN2: // We get the corresponding "OUT" endpoint currentEndPoint = iter.next(); break; } return currentEndPoint.getElement(); } public void remove() { throw (new UnsupportedOperationException()); } } /** * Iterates over the elements of the template, in the sequence order. * Helixes will be given twice. * Only one connected component will be iterated on. * Note that if there is a cycle, the iterator may return a infinite * number of elements. */ public Iterator rnaIterator() { return new RNAIterator(); } /** * Iterates over all elements (each endpoint is given only once) * in an arbitrary order. */ public Iterator classicIterator() { return elements.iterator(); } private class VertexIterator implements Iterator { private EdgeEndPoint endpoint = getFirstEndPoint(); public boolean hasNext() { return (endpoint != null); } public EdgeEndPoint next() { if (endpoint == null) { throw (new NoSuchElementException()); } EdgeEndPoint currentEndPoint = endpoint; endpoint = currentEndPoint.getNextEndPoint(); return currentEndPoint; } public void remove() { throw (new UnsupportedOperationException()); } } /** * Iterates over the elements edge endpoints of the template, * in the sequence order. * Only one connected component will be iterated on. * Note that if there is a cycle, the iterator may return a infinite * number of elements. */ public Iterator vertexIterator() { return new VertexIterator(); } private class MakeEdgeList { List list = new LinkedList(); private void addEdgeIfNecessary(EdgeEndPoint endPoint) { if (endPoint.isConnected()) { list.add(endPoint); } } public List make() { for (RNATemplateElement element: elements) { if (element instanceof RNATemplateHelix) { RNATemplateHelix helix = (RNATemplateHelix) element; addEdgeIfNecessary(helix.getIn1()); addEdgeIfNecessary(helix.getIn2()); } else if (element instanceof RNATemplateUnpairedSequence) { RNATemplateUnpairedSequence sequence = (RNATemplateUnpairedSequence) element; addEdgeIfNecessary(sequence.getIn()); } } return list; } } /** * Return over all edges in an arbitrary order. * For each edge, the first (5' side) endpoint will be given. */ public List makeEdgeList() { MakeEdgeList listMaker = new MakeEdgeList(); return listMaker.make(); } private class RemovePseudoKnots { /** * The elements of the template as an array, in the order of the * RNA sequence. Note that helixes will appear twice, * and non-paired sequences don't appear. */ private ArrayList helixesSeq; /** * For any i, * j = helixesStruct[i] is the index in helixesSeq * where the same helix also appears. * It means we have for all i: * helixesSeq[helixesStruct[i]] == helixesSeq[i] */ private ArrayList helixesStruct; /** * The same as helixesStruct, but without the pseudoknots, * ie. helixesStructWithoutPseudoKnots[i] may be -1 * even though helixesStruct[i] != -1 . */ private int[] helixesStructWithoutPseudoKnots; private void initArrays() throws ExceptionInvalidRNATemplate { helixesSeq = new ArrayList(); helixesStruct = new ArrayList(); Map knownHelixes = new Hashtable(); Iterator iter = rnaIterator(); while (iter.hasNext()) { RNATemplateElement element = iter.next(); if (element instanceof RNATemplateHelix) { helixesSeq.add((RNATemplateHelix) element); int index = helixesSeq.size() - 1; if (knownHelixes.containsKey(element)) { // This is the second time we meet this helix. int otherOccurenceIndex = knownHelixes.get(element); helixesStruct.add(otherOccurenceIndex); if (helixesStruct.get(otherOccurenceIndex) != -1) { throw (new ExceptionInvalidRNATemplate("We met an helix 3 times. Is there a cycle?")); } // Now we know the partner of the other part of // the helix. helixesStruct.set(otherOccurenceIndex, index); } else { // This is the first time we meet this helix. // Remember its index knownHelixes.put((RNATemplateHelix) element, index); // For the moment we don't know where the other part // of the helix is, but this will be found later. helixesStruct.add(-1); } } } } /** * Tells whether there is a pseudoknot. * Adapted from RNAMLParser.isSelfCrossing() */ private boolean isSelfCrossing() { Stack intervals = new Stack(); intervals.add(new Point(0, helixesStruct.size() - 1)); while (!intervals.empty()) { Point p = intervals.pop(); if (p.x <= p.y) { if (helixesStruct.get(p.x) == -1) { intervals.push(new Point(p.x + 1, p.y)); } else { int i = p.x; int j = p.y; int k = helixesStruct.get(i); if ((k <= i) || (k > j)) { return true; } else { intervals.push(new Point(i + 1, k - 1)); intervals.push(new Point(k + 1, j)); } } } } return false; } /** * We compute helixesStructWithoutPseudoKnots * from helixesStruct by replacing values by -1 * for the helixes we cut (the bases are become non-paired). * We try to cut as few base pairs as possible. */ private void removePseudoKnotsAux() { if (!isSelfCrossing()) { helixesStructWithoutPseudoKnots = new int[helixesStruct.size()]; for (int i=0; i tab[i][j]) { tab[i][j] = (short) tmp; backtrack[i][j] = (short) k; } } } } // debug //RNATemplateTests.printShortMatrix(tab); Stack intervals = new Stack(); intervals.add(new Point(0, length - 1)); while (!intervals.empty()) { Point p = intervals.pop(); if (p.x <= p.y) { if (backtrack[p.x][p.y] == -1) { result[p.x] = -1; intervals.push(new Point(p.x + 1, p.y)); } else { int i = p.x; int j = p.y; int k = backtrack[i][j]; result[i] = k; result[k] = i; intervals.push(new Point(i + 1, k - 1)); intervals.push(new Point(k + 1, j)); } } } helixesStructWithoutPseudoKnots = result; } } private Set makeSet() { Set removedHelixes = new HashSet(); for (int i=0; i removePseudoKnots() throws ExceptionInvalidRNATemplate { initArrays(); removePseudoKnotsAux(); // debug //printIntArrayList(helixesStruct); //printIntArray(helixesStructWithoutPseudoKnots); return makeSet(); } } private class ConvertToTree { private Set removedHelixes; public ConvertToTree(Set removedHelixes) { this.removedHelixes = removedHelixes; } private Iterator iter = template.rnaIterator(); private Set knownHelixes = new HashSet(); public Tree convert() throws ExceptionInvalidRNATemplate { Tree root = new Tree(); // No value, this is a fake node because we need a root. root.setValue(null); makeChildren(root); return root; } private void makeChildren(Tree father) throws ExceptionInvalidRNATemplate { List> children = father.getChildren(); while (true) { try { RNATemplateElement element = iter.next(); if (element instanceof RNATemplateHelix) { RNATemplateHelix helix = (RNATemplateHelix) element; if (removedHelixes.contains(helix)) { // Helix was removed boolean firstPartOfHelix; if (knownHelixes.contains(helix)) { firstPartOfHelix = false; } else { knownHelixes.add(helix); firstPartOfHelix = true; } int helixLength = helix.getLength(); // Maybe we could allow helixes of length 0? // If we want to then this code can be changed in the future. if (helixLength < 1) { throw (new ExceptionInvalidRNATemplate("Helix length < 1")); } int firstPosition = firstPartOfHelix ? 0 : helixLength; int afterLastPosition = firstPartOfHelix ? helixLength : 2*helixLength; for (int i=firstPosition; i child = new Tree(); child.setValue(value); father.getChildren().add(child); } } else { // We have an non-removed helix if (knownHelixes.contains(helix)) { if ((! (father.getValue() instanceof RNANodeValueTemplateBasePair)) || ((RNANodeValueTemplateBasePair) father.getValue()).getHelix() != helix) { // We have already met this helix, so unless it is our father, // we have a pseudoknot (didn't we remove them???). throw (new ExceptionInvalidRNATemplate("Unexpected helix. Looks like there still are pseudoknots even after we removed them so something is wrong about the template.")); } else { // As we have found the father, we have finished our work // with the children. return; } } else { knownHelixes.add(helix); int helixLength = helix.getLength(); // Maybe we could allow helixes of length 0? // If we want to then this code can be changed in the future. if (helixLength < 1) { throw (new ExceptionInvalidRNATemplate("Helix length < 1")); } Tree lastChild = father; for (int i=0; i child = new Tree(); child.setValue(value); lastChild.getChildren().add(child); lastChild = child; } // Now we put what follows as children of lastChild makeChildren(lastChild); } } } else if (element instanceof RNATemplateUnpairedSequence) { RNATemplateUnpairedSequence sequence = (RNATemplateUnpairedSequence) element; int seqLength = sequence.getLength(); // Maybe we could allow sequences of length 0? // If we want to then this code can be changed in the future. if (seqLength < 1) { throw (new ExceptionInvalidRNATemplate("Non-paired sequence length < 1")); } RNANodeValueTemplateSequence value = new RNANodeValueTemplateSequence(); value.setSequence(sequence); Tree child = new Tree(); child.setValue(value); children.add(child); } else { throw (new ExceptionInvalidRNATemplate("We have an endpoint which is neither an helix nor a sequence. What is that?")); } } catch (NoSuchElementException e) { // We are at the end of elements so if everything is ok // the father must be the root. if (father.getValue() == null) { return; // Work finished. } else { throw (new ExceptionInvalidRNATemplate("Unexpected end of template endpoint list.")); } } } } } /** * Tells whether the connected component to which endPoint belongs to * is cyclic. */ public boolean connectedComponentIsCyclic(EdgeEndPoint endPoint) { Set knownEndPoints = new HashSet(); EdgeEndPoint currentEndPoint = endPoint; while (true) { if (knownEndPoints.contains(currentEndPoint)) { return true; } knownEndPoints.add(currentEndPoint); EdgeEndPoint previousEndPoint = currentEndPoint.getPreviousEndPoint(); if (previousEndPoint == null) { return false; } else { currentEndPoint = previousEndPoint; } } } /** * Tells whether the template elements are all connected, ie. if the * graph (edge endpoints being vertices) is connected. */ public boolean isConnected() { if (isEmpty()) { return true; } // Count all vertices int n = 0; for (RNATemplateElement element: elements) { if (element instanceof RNATemplateHelix) { n += 4; } else if (element instanceof RNATemplateUnpairedSequence) { n += 2; } } // Now try reaching all vertices Set knownEndPoints = new HashSet(); EdgeEndPoint currentEndPoint = getFirstEndPoint(); while (true) { if (knownEndPoints.contains(currentEndPoint)) { // We are back to our original endpoint, so stop break; } knownEndPoints.add(currentEndPoint); EdgeEndPoint nextEndPoint = currentEndPoint.getNextEndPoint(); if (nextEndPoint == null) { break; } else { currentEndPoint = nextEndPoint; } } // The graph is connected iff the number of reached vertices // is equal to the total number of vertices. return (knownEndPoints.size() == n); } /** * Checks whether this template is a valid RNA template, ie. * it is non-empty, it does not contain a cycle and all elements are in one * connected component. */ public void checkIsValidTemplate() throws ExceptionInvalidRNATemplate { if (isEmpty()) { throw (new ExceptionInvalidRNATemplate("The template is empty.")); } if (! isConnected()) { throw (new ExceptionInvalidRNATemplate("The template is a non-connected graph.")); } // Now we know the graph is connected. if (connectedComponentIsCyclic(getAnyEndPoint())) { throw (new ExceptionInvalidRNATemplate("The template is cyclic.")); } } /** * Make a tree of the template. For this, we will remove pseudoknots, * taking care to remove as few base pair links as possible. * Requires the template to be valid and will check the validity * (will call checkIsValidTemplate()). * Calling this method will automatically call computeIn1Is(). */ public Tree toTree() throws ExceptionInvalidRNATemplate { // Compute the helix in1Is fields. // We also rely on computeIn1Is() for checking the template validity. computeIn1Is(); // Remove pseudoknots RemovePseudoKnots pseudoKnotKiller = new RemovePseudoKnots(); Set removedHelixes = pseudoKnotKiller.removePseudoKnots(); // Convert to tree ConvertToTree converter = new ConvertToTree(removedHelixes); return converter.convert(); } /** * Generate an RNA sequence that exactly matches the template. * Requires the template to be valid and will check the validity * (will call checkIsValidTemplate()). */ public RNA toRNA() throws ExceptionInvalidRNATemplate { // First, we check this is a valid template checkIsValidTemplate(); ArrayList str = new ArrayList(); Map> helixes = new HashMap>(); Iterator iter = rnaIterator(); while (iter.hasNext()) { RNATemplateElement element = iter.next(); if (element instanceof RNATemplateHelix) { RNATemplateHelix helix = (RNATemplateHelix) element; int n = helix.getLength(); if (helixes.containsKey(helix)) { int firstBase = str.size(); ArrayList helixMembers = helixes.get(helix); for (int i = 0; i < n; i++) { int indexOfAssociatedBase = helixMembers.get(n-1-i); str.set(indexOfAssociatedBase, firstBase + i); str.add(indexOfAssociatedBase); } } else { int firstBase = str.size(); ArrayList helixMembers = new ArrayList(); for (int i = 0; i < n; i++) { // We don't known yet where the associated base is str.add(-1); helixMembers.add(firstBase + i); } helixes.put(helix, helixMembers); } } else if (element instanceof RNATemplateUnpairedSequence) { RNATemplateUnpairedSequence sequence = (RNATemplateUnpairedSequence) element; int n = sequence.getLength(); for (int i=0; i elementNames = new HashMap(); private Element connectionsXmlElement; private Document document; private void addConnectionIfNecessary(EdgeEndPoint endPoint) { if (endPoint != null && endPoint.isConnected()) { RNATemplateElement e1 = endPoint.getElement(); EdgeEndPointPosition p1 = endPoint.getPosition(); RNATemplateElement e2 = endPoint.getOtherElement(); EdgeEndPointPosition p2 = endPoint.getOtherEndPoint().getPosition(); Element xmlElement = document.createElement("edge"); { Element fromXmlElement = document.createElement("from"); fromXmlElement.setAttribute("endpoint", elementNames.get(e1)); fromXmlElement.setAttribute("position", p1.toString()); xmlElement.appendChild(fromXmlElement); } { Element toXmlElement = document.createElement("to"); toXmlElement.setAttribute("endpoint", elementNames.get(e2)); toXmlElement.setAttribute("position", p2.toString()); xmlElement.appendChild(toXmlElement); } connectionsXmlElement.appendChild(xmlElement); } } public Document toXMLDocument() throws ExceptionXMLGeneration, ExceptionInvalidRNATemplate { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.newDocument(); Element root = document.createElement("RNATemplate"); document.appendChild(root); Element elementsXmlElement = document.createElement("elements"); root.appendChild(elementsXmlElement); connectionsXmlElement = document.createElement("edges"); root.appendChild(connectionsXmlElement); // First pass, we create a mapping between java references and names (strings) { int nextHelix = 1; int nextNonPairedSequence = 1; for (RNATemplateElement templateElement: elements) { if (templateElement instanceof RNATemplateHelix) { RNATemplateHelix helix = (RNATemplateHelix) templateElement; if (! elementNames.containsKey(helix)) { elementNames.put(helix, "H ID " + nextHelix); nextHelix++; } } else if (templateElement instanceof RNATemplateUnpairedSequence) { RNATemplateUnpairedSequence sequence = (RNATemplateUnpairedSequence) templateElement; if (! elementNames.containsKey(sequence)) { elementNames.put(sequence, "S ID " + nextNonPairedSequence); nextNonPairedSequence++; } } else { throw (new ExceptionInvalidRNATemplate("We have an endpoint which is neither an helix nor a sequence. What is that?")); } } } // Now we generate the XML document for (RNATemplateElement templateElement: elements) { String elementXmlName = elementNames.get(templateElement); Element xmlElement; if (templateElement instanceof RNATemplateHelix) { RNATemplateHelix helix = (RNATemplateHelix) templateElement; xmlElement = document.createElement("helix"); xmlElement.setAttribute("id", elementXmlName); xmlElement.setAttribute("length", Integer.toString(helix.getLength())); xmlElement.setAttribute("flipped", Boolean.toString(helix.isFlipped())); if (helix.hasCaption()) { xmlElement.setAttribute("caption", helix.getCaption()); } { Element startPositionXmlElement = document.createElement("startPosition"); startPositionXmlElement.setAttribute("x", Double.toString(helix.getStartPosition().x)); startPositionXmlElement.setAttribute("y", Double.toString(helix.getStartPosition().y)); xmlElement.appendChild(startPositionXmlElement); } { Element endPositionXmlElement = document.createElement("endPosition"); endPositionXmlElement.setAttribute("x", Double.toString(helix.getEndPosition().x)); endPositionXmlElement.setAttribute("y", Double.toString(helix.getEndPosition().y)); xmlElement.appendChild(endPositionXmlElement); } addConnectionIfNecessary(helix.getOut1()); addConnectionIfNecessary(helix.getOut2()); } else if (templateElement instanceof RNATemplateUnpairedSequence) { RNATemplateUnpairedSequence sequence = (RNATemplateUnpairedSequence) templateElement; xmlElement = document.createElement("sequence"); xmlElement.setAttribute("id", elementXmlName); xmlElement.setAttribute("length", Integer.toString(sequence.getLength())); { Element vertex5XmlElement = document.createElement("vertex5"); vertex5XmlElement.setAttribute("x", Double.toString(sequence.getVertex5().x)); vertex5XmlElement.setAttribute("y", Double.toString(sequence.getVertex5().y)); xmlElement.appendChild(vertex5XmlElement); } { Element vertex3XmlElement = document.createElement("vertex3"); vertex3XmlElement.setAttribute("x", Double.toString(sequence.getVertex3().x)); vertex3XmlElement.setAttribute("y", Double.toString(sequence.getVertex3().y)); xmlElement.appendChild(vertex3XmlElement); } { Element inTangentVectorXmlElement = document.createElement("inTangentVector"); inTangentVectorXmlElement.setAttribute("angle", Double.toString(sequence.getInTangentVectorAngle())); inTangentVectorXmlElement.setAttribute("length", Double.toString(sequence.getInTangentVectorLength())); xmlElement.appendChild(inTangentVectorXmlElement); } { Element outTangentVectorXmlElement = document.createElement("outTangentVector"); outTangentVectorXmlElement.setAttribute("angle", Double.toString(sequence.getOutTangentVectorAngle())); outTangentVectorXmlElement.setAttribute("length", Double.toString(sequence.getOutTangentVectorLength())); xmlElement.appendChild(outTangentVectorXmlElement); } addConnectionIfNecessary(sequence.getOut()); } else { throw (new ExceptionInvalidRNATemplate("We have an endpoint which is neither an helix nor a sequence. What is that?")); } elementsXmlElement.appendChild(xmlElement); } return document; } catch (ParserConfigurationException e) { throw (new ExceptionXMLGeneration("ParserConfigurationException: " + e.getMessage())); } } } public void toXMLFile(File file) throws ExceptionXMLGeneration, ExceptionInvalidRNATemplate { try { Document xmlDocument = toXMLDocument(); Source source = new DOMSource(xmlDocument); Result result = new StreamResult(file); Transformer transformer; transformer = TransformerFactory.newInstance().newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.transform(source, result); } catch (TransformerConfigurationException e) { throw (new ExceptionXMLGeneration("TransformerConfigurationException: " + e.getMessage())); } catch (TransformerFactoryConfigurationError e) { throw (new ExceptionXMLGeneration("TransformerFactoryConfigurationError: " + e.getMessage())); } catch (TransformerException e) { throw (new ExceptionXMLGeneration("TransformerException: " + e.getMessage())); } } public Document toXMLDocument() throws ExceptionXMLGeneration, ExceptionInvalidRNATemplate { ConvertToXml converter = new ConvertToXml(); return converter.toXMLDocument(); } private class LoadFromXml { private Document xmlDocument; private Map elementNames = new HashMap(); public LoadFromXml(Document xmlDocument) { this.xmlDocument = xmlDocument; } private Point2D.Double pointFromXml(Element xmlPoint) { Point2D.Double point = new Point2D.Double(); point.x = Double.parseDouble(xmlPoint.getAttribute("x")); point.y = Double.parseDouble(xmlPoint.getAttribute("y")); return point; } private double vectorLengthFromXml(Element xmlVector) { return Double.parseDouble(xmlVector.getAttribute("length")); } private double vectorAngleFromXml(Element xmlVector) { return Double.parseDouble(xmlVector.getAttribute("angle")); } /** * Takes an element of the form: * * and returns the corresponding EdgeEndPoint object. */ private EdgeEndPoint endPointFromXml(Element xmlEdgeEndPoint) throws ExceptionXmlLoading { String elementId = xmlEdgeEndPoint.getAttribute("endpoint"); if (elementId == null || elementId == "") throw (new ExceptionXmlLoading ("Missing endpoint attribute on " + xmlEdgeEndPoint)); String positionOnElement = xmlEdgeEndPoint.getAttribute("position"); if (positionOnElement == null || positionOnElement == "") throw (new ExceptionXmlLoading ("Missing position attribute on " + xmlEdgeEndPoint)); if (elementNames.containsKey(elementId)) { RNATemplateElement templateElement = elementNames.get(elementId); EdgeEndPointPosition relativePosition = EdgeEndPointPosition.valueOf(positionOnElement); if (relativePosition == null) throw (new ExceptionXmlLoading ("Could not compute relativePosition")); return templateElement.getEndPointFromPosition(relativePosition); } else { throw (new ExceptionXmlLoading("Edge is connected on unkown element: " + elementId)); } } private String connectErrMsg(EdgeEndPoint v1, EdgeEndPoint v2, String reason) { return "Error while connecting\n" + v1.toString() + " to\n" + v2.toString() + " because:\n" + reason; } private void connect(EdgeEndPoint v1, EdgeEndPoint v2) throws ExceptionXmlLoading { if (v1 == null || v2 == null) { throw (new ExceptionXmlLoading("Invalid edge: missing endpoint\n v1 = " + v1 + "\n v2 = " + v2)); } if (v2.isConnected()) { throw (new ExceptionXmlLoading(connectErrMsg(v1, v2, "Second vertex is already connected to " + v2.getOtherElement().toString()))); } if (v1.isConnected()) { throw (new ExceptionXmlLoading(connectErrMsg(v1, v2, "First vertex is already connected to " + v1.getOtherElement().toString()))); } try { v1.connectTo(v2); } catch (ExceptionEdgeEndpointAlreadyConnected e) { throw (new ExceptionXmlLoading("A vertex is on two edges at the same time: " + e.getMessage())); } catch (ExceptionInvalidRNATemplate e) { throw (new ExceptionXmlLoading("ExceptionInvalidRNATemplate: " + e.getMessage())); } } public void load() throws ExceptionXmlLoading { // First part: we load all elements from the XML tree Element xmlElements = (Element) xmlDocument.getElementsByTagName("elements").item(0); { NodeList xmlElementsChildren = xmlElements.getChildNodes(); for (int i=0; i iter = vertexIterator(); Set knownHelices = new HashSet(); while (iter.hasNext()) { EdgeEndPoint endPoint = iter.next(); RNATemplateElement templateElement = endPoint.getElement(); if (templateElement instanceof RNATemplateHelix) { RNATemplateHelix helix = (RNATemplateHelix) templateElement; if (! knownHelices.contains(helix)) { // first time we meet this helix switch (endPoint.getPosition()) { case IN1: case OUT1: helix.setIn1Is(In1Is.IN1_IS_5PRIME); break; case IN2: case OUT2: helix.setIn1Is(In1Is.IN1_IS_3PRIME); break; } knownHelices.add(helix); } } } } /** * Remove the element from the template. * The element is automatically disconnected from any other element. * Returns true if and only if the element was present in the template, * otherwise nothing was done. */ public boolean removeElement(RNATemplateElement element) throws ExceptionInvalidRNATemplate { if (elements.contains(element)) { element.disconnectFromAny(); elements.remove(element); return true; } else { return false; } } /** * Position of an endpoint on an endpoint. * Not all values make sense for any endpoint. * For an helix, all four make sense, but for a non-paired * sequence, only IN1 and OUT1 make sense. */ public enum EdgeEndPointPosition { IN1, IN2, OUT1, OUT2; } private static int NEXT_ID = 1; /** * An endpoint of an RNA template, * it can be an helix or a sequence of non-paired bases. * * You cannot create an object of this class directly, * use RNATemplateHelix or RNATemplateUnpairedSequence instead. * * @author Raphael Champeimont */ public abstract class RNATemplateElement { public int _id = NEXT_ID++; public String getName() {return "RNATemplate"+_id; } /** * This variable is just there so that "this" can be accessed by a name * from the internal class EdgeEndPoint. */ private final RNATemplateElement element = this; /** * When the endpoint is created, it is added to the list of elements * in this template. To remove it, call RNATemplate.removeElement(). */ public RNATemplateElement() { elements.add(this); } /** * Disconnect this endpoint from any other elements it may be connected to. */ public abstract void disconnectFromAny(); /** * Get the the IN endpoint in the case of a sequence * and the IN1 endpoint in the case of an helix. */ public abstract EdgeEndPoint getIn1EndPoint(); /** * Returns the template to which this endpoint belongs. */ public RNATemplate getParentTemplate() { return template; } /** * Provided endpoint is an endpoint of this endpoint, get the next * endpoint, either on this same endpoint, or or the connected endpoint. * Note that you should use the getNextEndPoint() method of the endpoint * itself directly. */ protected abstract EdgeEndPoint getNextEndPoint(EdgeEndPoint endpoint); /** * Provided endpoint is an endpoint of this endpoint, get the previous * endpoint, either on this same endpoint, or or the connected endpoint. * Note that you should use the getPreviousEndPoint() method of the endpoint * itself directly. */ protected abstract EdgeEndPoint getPreviousEndPoint(EdgeEndPoint endpoint); /** * An edge endpoint is where an edge can connect. */ public class EdgeEndPoint { private EdgeEndPoint() { } /** * Get the next endpoint. If this endpoint is an "in" endpoint, * returns the corresponding "out" endpoint. If this endpoint * is an "out" endpoint, return the connected endpoint if there is * one, otherwise return null. */ public EdgeEndPoint getNextEndPoint() { return element.getNextEndPoint(this); } /** * Same as getNextEndPoint(), but with the previous endpoint. */ public EdgeEndPoint getPreviousEndPoint() { return element.getPreviousEndPoint(this); } /** * Get the position on the endpoint where this endpoint is. */ public EdgeEndPointPosition getPosition() { return element.getPositionFromEndPoint(this); } private EdgeEndPoint otherEndPoint; /** * Returns the endpoint on which this edge endpoint is. */ public RNATemplateElement getElement() { return element; } /** * Returns the other endpoint of the edge. * Will be null if there is no edge connecter to this endpoint. */ public EdgeEndPoint getOtherEndPoint() { return otherEndPoint; } /** * Returns the endpoint at the other endpoint of the edge. * Will be null if there is no edge connecter to this endpoint. */ public RNATemplateElement getOtherElement() { return (otherEndPoint != null) ? otherEndPoint.getElement() : null; } /** * Disconnect this endpoint from the other, ie. delete the edge * between them. Note that this will modify both endpoints, and that * x.disconnect() is equivalent to x.getOtherEndPoint().disconnect(). * If this endpoint is not connected, does nothing. */ public void disconnect() { if (otherEndPoint != null) { otherEndPoint.otherEndPoint = null; otherEndPoint = null; } } /** * Tells whether this endpoint is connected with an edge to * an other endpoint. */ public boolean isConnected() { return (otherEndPoint != null); } /** * Create an edge between two edge endpoints. * This is a symmetric operation and it will modify both endpoints. * It means x.connectTo(y) is equivalent to y.connectTo(x). * The edge endpoint must be free (ie. not yet connected). * Also, elements connected together must belong to the same template. */ public void connectTo(EdgeEndPoint otherEndPoint) throws ExceptionEdgeEndpointAlreadyConnected, ExceptionInvalidRNATemplate { if (this.otherEndPoint != null || otherEndPoint.otherEndPoint != null) { throw (new ExceptionEdgeEndpointAlreadyConnected()); } if (template != otherEndPoint.getElement().getParentTemplate()) { throw (new ExceptionInvalidRNATemplate("Elements from different templates cannot be connected with each other.")); } this.otherEndPoint = otherEndPoint; otherEndPoint.otherEndPoint = this; } public String toString() { return "Edge endpoint on element " + element.toString() + " at position " + getPosition().toString(); } } /** * Get the EdgeEndPoint object corresponding to the the given * position on this endpoint. */ public abstract EdgeEndPoint getEndPointFromPosition(EdgeEndPointPosition position); /** * The inverse of getEndPointFromPosition. */ public abstract EdgeEndPointPosition getPositionFromEndPoint(EdgeEndPoint endPoint); /** * Connect the endpoint at position positionHere of this endpoint * to the otherEndPoint. */ public void connectTo( EdgeEndPointPosition positionHere, EdgeEndPoint otherEndPoint) throws ExceptionEdgeEndpointAlreadyConnected, ExceptionInvalidRNATemplate { EdgeEndPoint endPointHere = getEndPointFromPosition(positionHere); endPointHere.connectTo(otherEndPoint); } /** * Connect the endpoint at position positionHere of this endpoint * to the endpoint of otherElement at position positionOnOtherElement. * @throws ExceptionInvalidRNATemplate * @throws ExceptionEdgeEndpointAlreadyConnected, ExceptionEdgeEndpointAlreadyConnected */ public void connectTo( EdgeEndPointPosition positionHere, RNATemplateElement otherElement, EdgeEndPointPosition positionOnOtherElement) throws ExceptionEdgeEndpointAlreadyConnected, ExceptionEdgeEndpointAlreadyConnected, ExceptionInvalidRNATemplate { EdgeEndPoint otherEndPoint = otherElement.getEndPointFromPosition(positionOnOtherElement); connectTo(positionHere, otherEndPoint); } } /** * An helix in an RNA template. * * @author Raphael Champeimont */ public class RNATemplateHelix extends RNATemplateElement { /** * Number of base pairs in the helix. */ private int length; /** * Position of the helix start point, * ie. the middle in the line [x,y] where (x,y) * x is the base at the IN1 edge endpoint and * y is the base at the OUT2 edge endpoint. */ private Point2D.Double startPosition; /** * Position of the helix end point, * ie. the middle in the line [x,y] where (x,y) * x is the base at the OUT1 edge endpoint and * y is the base at the IN2 edge endpoint. */ private Point2D.Double endPosition; /** * Tells whether the helix is flipped. */ private boolean flipped = false; public boolean isFlipped() { return flipped; } public void setFlipped(boolean flipped) { this.flipped = flipped; } /** * For an helix, tells us whether IN1/OUT1 is the 5' strand * (the first strand we meet if we follow the RNA sequence) * or the 3' strand (the second we meet if we follow the RNA sequence). * This information cannot be known locally, we need the complete * template to compute it, see RNATemplate.computeIn1Is(). */ private In1Is in1Is = null; public In1Is getIn1Is() { return in1Is; } public void setIn1Is(In1Is in1Is) { this.in1Is = in1Is; } /** * A string displayed on the helix. */ private String caption = null; public String getCaption() { return caption; } public void setCaption(String caption) { this.caption = caption; } public boolean hasCaption() { return caption != null; } /** * If we go through all bases of the RNA from first to last, * we will pass twice through this helix. On time, we arrive * from in1, and leave by out2, and the other time we arrive from * in2 and leave by out2. * Whether we go through in1/out1 or in2/out2 the first time * is written in the in1Is field. */ private final EdgeEndPoint in1, out1, in2, out2; private String _name; public RNATemplateHelix(String name) { in1 = new EdgeEndPoint(); out1 = new EdgeEndPoint(); in2 = new EdgeEndPoint(); out2 = new EdgeEndPoint(); _name = name; } public String toString() { return "Helix @" + Integer.toHexString(hashCode()) + " len=" + length + " caption=" + caption; } public String getName() {return ""+_name; } public int getLength() { return length; } public void setLength(int length) { this.length = length; } public Point2D.Double getStartPosition() { return startPosition; } public void setStartPosition(Point2D.Double startPosition) { this.startPosition = startPosition; } public Point2D.Double getEndPosition() { return endPosition; } public void setEndPosition(Point2D.Double endPosition) { this.endPosition = endPosition; } public EdgeEndPoint getIn1() { return in1; } public EdgeEndPoint getOut1() { return out1; } public EdgeEndPoint getIn2() { return in2; } public EdgeEndPoint getOut2() { return out2; } public void disconnectFromAny() { getIn1().disconnect(); getIn2().disconnect(); getOut1().disconnect(); getOut2().disconnect(); } protected EdgeEndPoint getNextEndPoint(EdgeEndPoint endpoint) { if (endpoint == in1) { return out1; } else if (endpoint == in2) { return out2; } else { return endpoint.getOtherEndPoint(); } } protected EdgeEndPoint getPreviousEndPoint(EdgeEndPoint endpoint) { if (endpoint == out1) { return in1; } else if (endpoint == out2) { return in2; } else { return endpoint.getOtherEndPoint(); } } public EdgeEndPoint getIn1EndPoint() { return in1; } public EdgeEndPoint getEndPointFromPosition( EdgeEndPointPosition position) { switch (position) { case IN1: return getIn1(); case IN2: return getIn2(); case OUT1: return getOut1(); case OUT2: return getOut2(); default: return null; } } public EdgeEndPointPosition getPositionFromEndPoint( EdgeEndPoint endPoint) { if (endPoint == in1) { return EdgeEndPointPosition.IN1; } else if (endPoint == in2) { return EdgeEndPointPosition.IN2; } else if (endPoint == out1) { return EdgeEndPointPosition.OUT1; } else if (endPoint == out2) { return EdgeEndPointPosition.OUT2; } else { return null; } } } /** * A sequence of non-paired bases in an RNA template. * * @author Raphael Champeimont */ public class RNATemplateUnpairedSequence extends RNATemplateElement { /** * Number of (non-paired) bases. */ private int length; private static final double defaultTangentVectorAngle = Math.PI / 2; private static final double defaultTangentVectorLength = 100; /** * The sequence is drawn along a cubic Bezier curve. * The curve can be defined by 2 vectors, one for the start of the line * and the other for the end. They are the tangents to the line at * the beginning and the end of the line. * Each vector can be defined by its length and its absolute angle. * The angles are given in radians. */ private double inTangentVectorAngle = defaultTangentVectorAngle, inTangentVectorLength = defaultTangentVectorLength, outTangentVectorAngle = defaultTangentVectorAngle, outTangentVectorLength = defaultTangentVectorLength; /** * Position of the begginning (at the "in" endpoint) of the line. * It is only useful when the sequence is not yet connected to an helix. * (Otherwise we can deduce it from this helix position). */ private Point2D.Double vertex5; /** * Position of the end (at the "out" endpoint) of the line. * It is only useful when the sequence is not yet connected to an helix. * (Otherwise we can deduce it from this helix position). */ private Point2D.Double vertex3; public Point2D.Double getVertex5() { return vertex5; } public void setVertex5(Point2D.Double vertex5) { this.vertex5 = vertex5; } public Point2D.Double getVertex3() { return vertex3; } public void setVertex3(Point2D.Double vertex3) { this.vertex3 = vertex3; } /** * The helixes connected on both sides. * They must be helixes because only helixes have absolute positions, * and the positions of the starting and ending points of the sequence * are those stored in the helixes. */ private final EdgeEndPoint in, out; private String _name; public RNATemplateUnpairedSequence(String name) { in = new EdgeEndPoint(); out = new EdgeEndPoint(); _name = name; } public String toString() { return "Sequence @" + Integer.toHexString(hashCode()) + " len=" + length; } public String getName() {return ""+_name; } public int getLength() { return length; } public void setLength(int length) { this.length = length; } public double getInTangentVectorAngle() { return inTangentVectorAngle; } public void setInTangentVectorAngle(double inTangentVectorAngle) { this.inTangentVectorAngle = inTangentVectorAngle; } public double getInTangentVectorLength() { return inTangentVectorLength; } public void setInTangentVectorLength(double inTangentVectorLength) { this.inTangentVectorLength = inTangentVectorLength; } public double getOutTangentVectorAngle() { return outTangentVectorAngle; } public void setOutTangentVectorAngle(double outTangentVectorAngle) { this.outTangentVectorAngle = outTangentVectorAngle; } public double getOutTangentVectorLength() { return outTangentVectorLength; } public void setOutTangentVectorLength(double outTangentVectorLength) { this.outTangentVectorLength = outTangentVectorLength; } public EdgeEndPoint getIn() { return in; } public EdgeEndPoint getOut() { return out; } public void disconnectFromAny() { getIn().disconnect(); getOut().disconnect(); } protected EdgeEndPoint getNextEndPoint(EdgeEndPoint endpoint) { if (endpoint == in) { return out; } else { return endpoint.getOtherEndPoint(); } } protected EdgeEndPoint getPreviousEndPoint(EdgeEndPoint endpoint) { if (endpoint == out) { return in; } else { return endpoint.getOtherEndPoint(); } } public EdgeEndPoint getIn1EndPoint() { return in; } public EdgeEndPoint getEndPointFromPosition( EdgeEndPointPosition position) { switch (position) { case IN1: return getIn(); case OUT1: return getOut(); default: return null; } } public EdgeEndPointPosition getPositionFromEndPoint( EdgeEndPoint endPoint) { if (endPoint == in) { return EdgeEndPointPosition.IN1; } else if (endPoint == out) { return EdgeEndPointPosition.OUT1; } else { return null; } } } } PK 3F>(q+00>fr/orsay/lri/varna/models/templates/RNANodeValueTemplate.class18fr/orsay/lri/varna/models/templates/RNANodeValueTemplatejava/lang/Object=fr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue()VCode  LineNumberTableLocalVariableTablethis:Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplate;toString()Ljava/lang/String;  toGraphvizNodeName SourceFileRNANodeValueTemplate.java! /*    /*  PK oq<+OO=fr/orsay/lri/varna/models/templates/RNANodeValueTemplate.javapackage fr.orsay.lri.varna.models.templates; import fr.orsay.lri.varna.models.treealign.GraphvizDrawableNodeValue; /** * An node from an RNA template is either a sequence of non-paired bases, * a base pair originally belonging to an helix, * or a single base originally belonging to an helix but which was broken * in order to remove pseudoknots. * * @author Raphael Champeimont */ public abstract class RNANodeValueTemplate implements GraphvizDrawableNodeValue { public String toString() { return toGraphvizNodeName(); } public abstract String toGraphvizNodeName(); } PK 3F>1NNEfr/orsay/lri/varna/models/templates/RNATemplateMappingException.class1?fr/orsay/lri/varna/models/templates/RNATemplateMappingExceptionjava/lang/ExceptionserialVersionUIDJ ConstantValue3(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethisALfr/orsay/lri/varna/models/templates/RNATemplateMappingException;messageLjava/lang/String;()V   SourceFile RNATemplateMappingException.java!  >*+    3*  PK oq<{^Dfr/orsay/lri/varna/models/templates/RNATemplateMappingException.javapackage fr.orsay.lri.varna.models.templates; /** * This exception is thrown when we discover that a template is invalid * (it contains impossible connections between elements). * * @author Raphael Champeimont */ public class RNATemplateMappingException extends Exception { private static final long serialVersionUID = -201638492590138354L; public RNATemplateMappingException(String message) { super(message); } public RNATemplateMappingException() { } } PK 3F> e<fr/orsay/lri/varna/models/templates/RNATemplateMapping.class16fr/orsay/lri/varna/models/templates/RNATemplateMappingjava/lang/ObjectmapLjava/util/Map; SignaturehLjava/util/Map;invmapLjava/util/Map;>;distanceD()VCode  java/util/HashMap     LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/models/templates/RNATemplateMapping; getDistance()D   setDistance(D)V addCoupleH(ILfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)V Exceptions'?fr/orsay/lri/varna/models/templates/RNATemplateMappingException )+*java/lang/Integer ,-valueOf(I)Ljava/lang/Integer; /10 java/util/Map 23 containsKey(Ljava/lang/Object;)Z5java/lang/StringBuilder7Base index already in mapping: 49 :(Ljava/lang/String;)V 4< =>append(I)Ljava/lang/StringBuilder; 4@ ABtoString()Ljava/lang/String; &9EInvalid base index: /G HIput8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;Kjava/util/ArrayList J /N OPget&(Ljava/lang/Object;)Ljava/lang/Object; JR S3add baseIndexItemplateElementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; showCompact7(Lfr/orsay/lri/varna/models/rna/RNA;)Ljava/lang/String; /[ \]keySet()Ljava/util/Set; _a` java/util/Set bciterator()Ljava/util/Iterator; egfjava/util/Iterator hinext()Ljava/lang/Object; )k lmintValue()IoBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement nq rBgetNamet@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix vxwjava/lang/String ,y&(Ljava/lang/Object;)Ljava/lang/String;{ ( 4} =~-(Ljava/lang/String;)Ljava/lang/StringBuilder; s B getCaption) !fr/orsay/lri/varna/models/rna/RNA  getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; (fr/orsay/lri/varna/models/rna/ModeleBase mgetElementStructure:5':3' 15fr/orsay/lri/varna/applications/templateEditor/Couple '(Ljava/lang/Object;Ljava/lang/Object;)V G N firstLjava/lang/Object; java/lang/Math min(II)I second max e hasNext()Z [strandloop5' v endsWith(Ljava/lang/String;)Z3' v replaceD(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String; dummyID 1  4 =-(Ljava/lang/Object;)Ljava/lang/StringBuilder;-: Kfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequencealignment distance = 4 =(D)Ljava/lang/StringBuilder;r#Lfr/orsay/lri/varna/models/rna/RNA;rangesLjava/util/HashMap;itkLjava/lang/String;mb*Lfr/orsay/lri/varna/models/rna/ModeleBase;c7Lfr/orsay/lri/varna/applications/templateEditor/Couple;resulttypec3LocalVariableTypeTableLjava/util/HashMap;>;_Lfr/orsay/lri/varna/applications/templateEditor/Couple; getPartnerG(I)Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; getAncestor[(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Ljava/util/ArrayList;p(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Ljava/util/ArrayList;getSourceElemsAsSet&()Ljava/util/Set;getTargetElemsAsSetW()Ljava/util/Set; SourceFileRNATemplateMapping.java InnerClasses/fr/orsay/lri/varna/models/templates/RNATemplateRNATemplateElementRNATemplateHelixRNATemplateUnpairedSequence!    Q**Y*Y /*" !">*' &' #$%&*(.&Y4Y68;?C&Y4YD8;?C*(,FW*,.*,JYLFW*,MJ(QW& /0(2,3D5S6`7r9: TUVWXY ZYM*Z^:d)j>*(Mn:p:sh4Yu8z|s||?:+:4Yu8|?:4Yu8|?:,,Y((W,:)j()j( N,^:dv:,:*Mn:s:s,: 4Y-u8Ķ||ƶ||ƶ|˶|Ͷ| ˶| ϶|?NMљE4Y-u8Ķ||ƶ||ƶ|˶|϶|?N4Y-u8Ӷ|*ն?N-z?@)B;CBDJFpGwHIKMNOPQ @ST0V;WNX_Yg[q]^ac3T=fXgZZR)U;WBw8.D0;NW_c *R.;c _#*(.*(Mnpq!s##TUY*+.*+MJ VW]4 *Z  ]4 *Z  nsPK >ϩ##;fr/orsay/lri/varna/models/templates/RNATemplateMapping.javapackage fr.orsay.lri.varna.models.templates; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Set; import fr.orsay.lri.varna.applications.templateEditor.Couple; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateHelix; /** * A RNATemplateMapping is a mapping between bases in an RNA sequence * and elements in a RNA template. * A base is mapped to only one template element * but a template element can be mapped to several bases. * This class is designed to be similar to the Mapping class. * * @author Raphael Champeimont */ public class RNATemplateMapping { private Map map = new HashMap(); private Map> invmap = new HashMap>(); /** * Alignment distance. */ private double distance; public double getDistance() { return distance; } public void setDistance(double distance) { this.distance = distance; } /** * Tell this mapping object that this base index and this element are * mapped with each other. This will throw RNATemplateMappingException * and do nothing if the base index is already in the mapping. */ public void addCouple(int baseIndex, RNATemplateElement templateElement) throws RNATemplateMappingException { if (map.containsKey(baseIndex)) { throw (new RNATemplateMappingException("Base index already in mapping: " + baseIndex)); } if (baseIndex < 0) { throw (new RNATemplateMappingException("Invalid base index: " + baseIndex)); } map.put(baseIndex, templateElement); if (!invmap.containsKey(templateElement)) { invmap.put(templateElement, new ArrayList()); } invmap.get(templateElement).add(baseIndex); } public String showCompact(RNA r) { HashMap > ranges = new HashMap >(); for(int i:map.keySet()) { RNATemplateElement t = map.get(i); String k = t.getName(); if (t instanceof RNATemplate.RNATemplateHelix) { k += " (" + ((RNATemplateHelix) t).getCaption() + ")"; ModeleBase mb = r.getBaseAt(i); if (mb.getElementStructure()>i) k = k+":5'"; else k = k+":3'"; } if (!ranges.containsKey(k)) { ranges.put(k, new Couple(Integer.MAX_VALUE,Integer.MIN_VALUE)); } Couple c = ranges.get(k); c.first = Math.min(c.first, i); c.second = Math.max(c.second, i); } String result = ""; for(String k:ranges.keySet()) { Couple c = ranges.get(k); RNATemplateElement t = map.get(c.first); String type = ((t instanceof RNATemplate.RNATemplateHelix)?"strand":"loop"); if (t instanceof RNATemplate.RNATemplateHelix) { if (k.endsWith("5'")) { Couple c3 = ranges.get(k.replace("5'", "3'")); result += "dummyID\t1\t"+k.replace(":5'", "")+"\t"+type+"\t"+c.first+"-"+c.second+":"+c3.first+"-"+c3.second+"\n"; } } else if (t instanceof RNATemplate.RNATemplateUnpairedSequence) { result += "dummyID\t1\t"+k+"\t"+type+"\t"+c.first+"-"+c.second+"\n"; } } result += "alignment distance = " + distance; return result; } /** * If the given base index is in the mapping, return the * corresponding template element, otherwise return null. */ public RNATemplateElement getPartner(int baseIndex) { if (map.containsKey(baseIndex)) { return map.get(baseIndex); } else { return null; } } /** * If the given template element is in the mapping, return an ArrayList * containing the corresponding base indexes, otherwise return null. * Note that you should not modify the returned ArrayList because * no copy is made, so if you modify it this mapping object will * contain inconsistent data. */ public ArrayList getAncestor(RNATemplateElement templateElement) { if (invmap.containsKey(templateElement)) { return invmap.get(templateElement); } else { return null; } } /** * Return a set containing all the base indexes in the mapping. * You should not modify the returned set. */ public Set getSourceElemsAsSet() { return map.keySet(); } /** * Return a set containing all the template elements in the mapping. * You should not modify the return set. */ public Set getTargetElemsAsSet() { return invmap.keySet(); } } PK 3F> Gfr/orsay/lri/varna/models/templates/RNANodeValue2TemplateDistance.class1~Afr/orsay/lri/varna/models/templates/RNANodeValue2TemplateDistancejava/lang/ObjectDfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric()VCode  LineNumberTableLocalVariableTablethisCLfr/orsay/lri/varna/models/templates/RNANodeValue2TemplateDistance;delete6(Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;)D 1fr/orsay/lri/varna/models/treealign/RNANodeValue2  isSingleNode()Z  getNode4()Lfr/orsay/lri/varna/models/treealign/RNANodeValue; 0fr/orsay/lri/varna/models/treealign/RNANodeValue !getRightBasePosition()I@ % &'getNodes()Ljava/util/List; )+*java/util/List ,!sizev3Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;insert=(Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplate;)D2@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence 14 56 getSequenceO()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence; 8:9Kfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence ;! getLength=Ffr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair:Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplate;fp(Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplate;)D B /0 D  FHGjava/lang/Math IJabs(I)IN@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair <P Q!getPositionInHelix <S TUgetHelixD()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix; W:X@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix Z [\ getOrigin;()Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; ^`_7fr/orsay/lri/varna/models/treealign/RNANodeValue$Origin abBASE_FROM_HELIX_STRAND59Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; ^d ebBASE_FROM_HELIX_STRAND3v1v2brokenBasePairHLfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair;strand5onTemplateSideZstrand3onTemplateSidestrand5onRNASidestrand3onRNASide'(Ljava/lang/Object;Ljava/lang/Object;)Dq8fr/orsay/lri/varna/models/templates/RNANodeValueTemplate s ?@ SourceFile"RNANodeValue2TemplateDistance.java SignatureLjava/lang/Object;Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric; InnerClassesz/fr/orsay/lri/varna/models/templates/RNATemplateRNATemplateHelixRNATemplateUnpairedSequenceOrigin! /*    t(+++"+$(   ((-./0 r&++1+137+<" #%' () +". &&->?@ + *,A, *+C+',1+$(,137dEK+,MK,<k,?@IAPCRFVI]JbKwLMNOPRVY Rf.g>bchiwNjkBlk.mknkA?o - *+,pr  tuvwxWy{8y|^}@PK oq { public double delete(RNANodeValue2 v) { if (v == null) { // deleting nothing costs nothing return 0; } else { if (v.isSingleNode()) { if (v.getNode().getRightBasePosition() < 0) { // delete one base (that comes from a broken base pair) return 1; } else { // delete a base pair return 2; } } else { // delete a sequence return v.getNodes().size(); } } } public double insert(RNANodeValueTemplate v) { if (v == null) { // inserting nothing costs nothing return 0; } else { if (v instanceof RNANodeValueTemplateSequence) { return ((RNANodeValueTemplateSequence) v).getSequence().getLength(); } else if (v instanceof RNANodeValueTemplateBrokenBasePair) { // insert one base return 1; } else { // this is a base pair // delete the base pair return 2; } } } public double f(RNANodeValue2 v1, RNANodeValueTemplate v2) { if (v1 == null) { return insert(v2); } else if (v2 == null) { return delete(v1); } else if (!v1.isSingleNode()) { // v1 is a sequence if (v2 instanceof RNANodeValueTemplateSequence) { // the cost is the difference between the sequence lengths return Math.abs(v1.getNodes().size() - ((RNANodeValueTemplateSequence) v2).getSequence().getLength()); } else { // a sequence cannot be changed in something else return Double.POSITIVE_INFINITY; } } else if (v1.getNode().getRightBasePosition() >= 0) { // v1 is a base pair if (v2 instanceof RNANodeValueTemplateBasePair) { // ok, a base pair can be mapped to a base pair return 0; } else { // a base pair cannot be changed in something else return Double.POSITIVE_INFINITY; } } else { // v1 is a broken base pair if (v2 instanceof RNANodeValueTemplateBrokenBasePair) { RNANodeValueTemplateBrokenBasePair brokenBasePair = ((RNANodeValueTemplateBrokenBasePair) v2); boolean strand5onTemplateSide = brokenBasePair.getPositionInHelix() < brokenBasePair.getHelix().getLength(); boolean strand3onTemplateSide = ! strand5onTemplateSide; boolean strand5onRNASide = (v1.getNode().getOrigin() == RNANodeValue.Origin.BASE_FROM_HELIX_STRAND5); boolean strand3onRNASide = (v1.getNode().getOrigin() == RNANodeValue.Origin.BASE_FROM_HELIX_STRAND3); if ((strand5onTemplateSide && strand5onRNASide) || (strand3onTemplateSide && strand3onRNASide)) { // Ok they can be mapped together return 0.0; } else { // A base on a 5' strand of an helix // cannot be mapped to base on a 3' strand of an helix return Double.POSITIVE_INFINITY; } } else { return Double.POSITIVE_INFINITY; } } } } PK 3F>n55:fr/orsay/lri/varna/models/templates/RNATemplateAlign.class14fr/orsay/lri/varna/models/templates/RNATemplateAlignjava/lang/Object()VCode  LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/models/templates/RNATemplateAlign;canBePartOfAnHelix6(Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;)Z 1fr/orsay/lri/varna/models/treealign/RNANodeValue2  isSingleNode()Z  getNode4()Lfr/orsay/lri/varna/models/treealign/RNANodeValue; 0fr/orsay/lri/varna/models/treealign/RNANodeValue getRightBasePosition()I leftNodeValue3Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;canBePartOfASequencecanBePartOfABrokenHelixmakeTemplateMapping(Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;Lfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/templates/RNATemplateMapping; Exceptions(?fr/orsay/lri/varna/models/templates/RNATemplateMappingException Signature(Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;Lfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;,6fr/orsay/lri/varna/models/templates/RNATemplateMapping + /103fr/orsay/lri/varna/models/treealign/TreeAlignResult 23 getAlignment,()Lfr/orsay/lri/varna/models/treealign/Tree; /5 67 getDistance()D +9 :; setDistance(D)V=java/util/LinkedList < <@ ABadd(Ljava/lang/Object;)Z <D EFgetLast()Ljava/lang/Object;H(fr/orsay/lri/varna/models/treealign/Tree <J KF removeLast GM NFgetValueP/fr/orsay/lri/varna/models/treealign/AlignedNode OR S3 getLeftNode OU V3 getRightNodeX8fr/orsay/lri/varna/models/templates/RNANodeValueTemplateZ@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair \  Y^ _`getHelixD()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix; b cgetLeftBasePosition +e fg addCoupleH(ILfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)V ikjjava/util/List lmiterator()Ljava/util/Iterator; oqpjava/util/Iterator rFnext ot uhasNext iw xclearz@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence | " y~  getSequenceO()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;  getNodes()Ljava/util/List; i@ G  getChildren i size i get(I)Ljava/lang/Object; < isEmptyFfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair  # ^ + getTargetElemsAsSet()Ljava/util/Set; k java/util/SetBfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelixjava/util/HashSet +  getAncestor[(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement;)Ljava/util/ArrayList; (Ljava/util/Collection;)V kjava/lang/Integer intValue java/lang/System outLjava/io/PrintStream;java/lang/StringBuilderPK: (Ljava/lang/String;)V append-(Ljava/lang/Object;)Ljava/lang/StringBuilder; aligned with -(Ljava/lang/String;)Ljava/lang/StringBuilder; (I)Ljava/lang/StringBuilder; toString()Ljava/lang/String; java/io/PrintStream println !fr/orsay/lri/varna/models/rna/RNA  getAuxBPs(I)Ljava/util/ArrayList; kjava/util/ArrayList+fr/orsay/lri/varna/models/rna/ModeleStyleBP  getPartner5,()Lfr/orsay/lri/varna/models/rna/ModeleBase;2fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide getIndex  getPartner3 valueOf(I)Ljava/lang/Integer; Bcontains alignResult5Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;rna#Lfr/orsay/lri/varna/models/rna/RNA;mapping8Lfr/orsay/lri/varna/models/templates/RNATemplateMapping; alignment*Lfr/orsay/lri/varna/models/treealign/Tree; currentHelixBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;remainingNodesLjava/util/LinkedList;nodesInSameHelixLjava/util/List;nodeleftNode rightNoderightNodeValue:Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplate;helixvsequenceMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence; nodeValue2Lfr/orsay/lri/varna/models/treealign/RNANodeValue;childrennIi tempPKMappingchildelementDLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement; basesInHelixLjava/util/HashSet; baseIndexbaseOKZ auxBasePairsLjava/util/ArrayList; auxBasePair-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;partner5partner3LocalVariableTypeTableLfr/orsay/lri/varna/models/treealign/TreeAlignResult;Lfr/orsay/lri/varna/models/treealign/Tree;>;Ljava/util/LinkedList;>;>;ELjava/util/List;_Lfr/orsay/lri/varna/models/treealign/Tree;fLfr/orsay/lri/varna/models/treealign/Tree;Ljava/util/List;>;>;(Ljava/util/HashSet;DLjava/util/ArrayList; printMapping~(Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/lang/String;)V +-,/fr/orsay/lri/varna/models/templates/RNATemplate .m rnaIterator  1 23printIntArrayList(Ljava/util/ArrayList;)V 6 9;:java/lang/String <=charAt(I)C ? @(C)Ljava/lang/StringBuilder; B CprintEG no matchtemplate1Lfr/orsay/lri/varna/models/templates/RNATemplate;Ljava/lang/String;iterLjava/util/Iterator;AZLjava/util/Iterator;*Ljava/util/ArrayList;alignRNAWithTemplate(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;SHfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/treealign/TreeAlignResult; VXW,fr/orsay/lri/varna/models/treealign/RNATree2 YZRNATree2FromRNAO(Lfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/treealign/Tree; +\ ]3toTree_-fr/orsay/lri/varna/models/treealign/TreeAlignaAfr/orsay/lri/varna/models/templates/RNANodeValue2TemplateDistance ` ^d eI(Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric;)V ^g hialign(Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;kRNATree2Exception: mon5fr/orsay/lri/varna/models/treealign/RNATree2Exception p getMessage RsExceptionInvalidRNATemplate: uov9fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplatexTreeAlignException: zo{6fr/orsay/lri/varna/models/treealign/TreeAlignException rnaAsTreetemplateAsTree treeAlign/Lfr/orsay/lri/varna/models/treealign/TreeAlign;resulte7Lfr/orsay/lri/varna/models/treealign/RNATree2Exception;;Lfr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate;8Lfr/orsay/lri/varna/models/treealign/TreeAlignException;Lfr/orsay/lri/varna/models/treealign/TreeAlign;mapRNAWithTemplate(Lfr/orsay/lri/varna/models/rna/RNA;Lfr/orsay/lri/varna/models/templates/RNATemplate;)Lfr/orsay/lri/varna/models/templates/RNATemplateMapping;  PQ  $% ' printStackTraceRNATemplateMappingException: 'oALfr/orsay/lri/varna/models/templates/RNATemplateMappingException; printIntArray([I)V[I-(Ljava/util/ArrayList;)VprintShortMatrix([[S)V Begin matrix End matrixM[[SjintArrayFromList(Ljava/util/List;)[I)(Ljava/util/List;)[Il%Ljava/util/List; SourceFileRNATemplateAlign.java InnerClassesRNATemplateElementRNATemplateHelixKfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequenceRNATemplateUnpairedSequence! /* "  C*** &  ! "9* * *  ! #C*** .  ! $%&')* +Y-M*.N,*48:::-?WCG:IWLOQ:LOT: ^LVL:   L LW:  Y} [u Y]:  :, a d,  dh:+n: , a d,  dsv yX {P:v y}: Lh:n: , a ds`:vS [4", ad, d' W:v :v:  6  ) d6   G?W  :v":-?W+Y-:|CG:IW:6Wd6  G?W  : : h:  nG:  LOQ:  LOT:  L L:LLW:c[:: ad h:n:ads vS:  vF' a d' W:  v :  v s:n::Y:  :  n6 Yö ȶ˶6 + :  :]n:66  #6 '   6 s , d sCs , y:; <@A!F*G1H4I>JDLQM^NkOuRTVWXYZ[_`a_cdef!g(h2iSj^ikmnnxstwx| H%.1;AHQV_qy-<FPS]ej|!)?LY`mpsz + !*>Q^ uI !  h ! 29 S   > 5   .;oHb QY  \ ( %    !uN-!  ! ){ ?NLA Y4   !!*"> Q#^$ > % !;o Hb %("  # $& ){' ()M+*N~-n:/*:R0466-Y5,78>˶AҲDϧ F-s :&+0=dnz RHIJKLp&]M77  :4 KN&]MO PQ&R)Tg}*UM+[N^Y`Ybc:,-f:MRYYj,lŶ˷qMRYYr,tŶ˷qMRYYw,yŶ˷q%&m%Cu%`z . %& '(#)&*'+C,D-`.a/ \ }}HI!| } ~#'Da*!|# }$ ~# &R/*+M,*N-M,RYY,Ŷ˷q ' 89 :;<= 4//HI    u1<Y5*.ȶ˶A*Dϱ GHG'J0K 1M%  23)5<!Y5*7˶A*4ݲDϱ QR Q+T4U 5M)  5MO U<:=!Y5*25ȶ˶A*2ݲDτ*Ʋϱ & [ \]^.]9`B\KbTc U @ )  )0*-*< M>,*O, "kl mno$n,q.s *0 #    0+++PK >fe8e89fr/orsay/lri/varna/models/templates/RNATemplateAlign.javapackage fr.orsay.lri.varna.models.templates; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import fr.orsay.lri.varna.exceptions.ExceptionInvalidRNATemplate; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateElement; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateHelix; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateUnpairedSequence; import fr.orsay.lri.varna.models.treealign.AlignedNode; import fr.orsay.lri.varna.models.treealign.RNANodeValue; import fr.orsay.lri.varna.models.treealign.RNANodeValue2; import fr.orsay.lri.varna.models.treealign.RNATree2; import fr.orsay.lri.varna.models.treealign.RNATree2Exception; import fr.orsay.lri.varna.models.treealign.Tree; import fr.orsay.lri.varna.models.treealign.TreeAlign; import fr.orsay.lri.varna.models.treealign.TreeAlignException; import fr.orsay.lri.varna.models.treealign.TreeAlignResult; /** * This class is about the alignment between a tree of RNANodeValue2 * and a tree of RNANodeValueTemplate. * * @author Raphael Champeimont */ public class RNATemplateAlign { // We check this node can be part of a non-broken helix. private static boolean canBePartOfAnHelix(RNANodeValue2 leftNodeValue) { return (leftNodeValue != null) && leftNodeValue.isSingleNode() && leftNodeValue.getNode().getRightBasePosition() > 0; } private static boolean canBePartOfASequence(RNANodeValue2 leftNodeValue) { return (leftNodeValue != null) && !leftNodeValue.isSingleNode(); } private static boolean canBePartOfABrokenHelix(RNANodeValue2 leftNodeValue) { return (leftNodeValue != null) && leftNodeValue.isSingleNode() && leftNodeValue.getNode().getRightBasePosition() < 0; } /** * This method takes an alignment between a tree of RNANodeValue2 * of RNANodeValue and a tree of RNANodeValue2 of RNANodeValueTemplate, * and the original RNA object that was used to create the first tree * in the alignment. * It returns the corresponding RNATemplateMapping. */ public static RNATemplateMapping makeTemplateMapping(TreeAlignResult alignResult, RNA rna) throws RNATemplateMappingException { RNATemplateMapping mapping = new RNATemplateMapping(); Tree> alignment = alignResult.getAlignment(); mapping.setDistance(alignResult.getDistance()); // Map sequences and helices together, without managing pseudoknots { RNATemplateHelix currentHelix = null; LinkedList>> remainingNodes = new LinkedList>>(); // The reason why this algorithm is not trivial is that we may have // a longer helix on the RNA side than on the template side, in which // case some nodes on the RNA side are going to be alone while we // would want them to be part of the helix. List nodesInSameHelix = new LinkedList(); remainingNodes.add(alignment); while (!remainingNodes.isEmpty()) { Tree> node = remainingNodes.getLast(); remainingNodes.removeLast(); Tree leftNode = node.getValue().getLeftNode(); Tree rightNode = node.getValue().getRightNode(); if (leftNode != null && leftNode.getValue() != null) { RNANodeValue2 leftNodeValue = leftNode.getValue(); // We have a real left (RNA side) node if (rightNode != null && rightNode.getValue() != null) { // We have a real right (template side) node RNANodeValueTemplate rightNodeValue = rightNode.getValue(); if (rightNodeValue instanceof RNANodeValueTemplateBasePair && canBePartOfAnHelix(leftNodeValue)) { RNATemplateHelix helix = ((RNANodeValueTemplateBasePair) rightNodeValue).getHelix(); currentHelix = helix; mapping.addCouple(leftNodeValue.getNode().getLeftBasePosition(), helix); mapping.addCouple(leftNodeValue.getNode().getRightBasePosition(), helix); // Maybe we have marked nodes as part of the same helix // when we didn't know yet which helix it was. for (RNANodeValue2 v: nodesInSameHelix) { mapping.addCouple(v.getNode().getLeftBasePosition(), helix); mapping.addCouple(v.getNode().getRightBasePosition(), helix); } nodesInSameHelix.clear(); } else if (rightNodeValue instanceof RNANodeValueTemplateSequence && canBePartOfASequence(leftNodeValue)) { currentHelix = null; nodesInSameHelix.clear(); RNATemplateUnpairedSequence sequence = ((RNANodeValueTemplateSequence) rightNodeValue).getSequence(); for (RNANodeValue nodeValue: leftNode.getValue().getNodes()) { mapping.addCouple(nodeValue.getLeftBasePosition(), sequence); } } else { currentHelix = null; nodesInSameHelix.clear(); } } else { // We have no right (template side) node if (canBePartOfAnHelix(leftNodeValue)) { if (currentHelix != null) { // We may be in this case if the RNA sequence // contains a longer helix than in the template mapping.addCouple(leftNodeValue.getNode().getLeftBasePosition(), currentHelix); mapping.addCouple(leftNodeValue.getNode().getRightBasePosition(), currentHelix); } else { // Maybe this left node is part of an helix // which is smaller in the template nodesInSameHelix.add(leftNodeValue); } } else { currentHelix = null; nodesInSameHelix.clear(); } } } else { currentHelix = null; nodesInSameHelix.clear(); } // If this node has children, add them in the stack List>> children = node.getChildren(); int n = children.size(); if (n > 0) { for (int i=n-1; i>=0; i--) { // We add the children in their reverse order so they // are given in the original order by the iterator remainingNodes.add(children.get(i)); } } else { // We will now stop going down, so there is no reason // the current helix will still be the same currentHelix = null; nodesInSameHelix.clear(); } } } // Now recover pseudoknots (broken helices) { // First create a temporary mapping with broken helices LinkedList>> remainingNodes = new LinkedList>>(); remainingNodes.add(alignment); RNATemplateMapping tempPKMapping = new RNATemplateMapping(); while (!remainingNodes.isEmpty()) { Tree> node = remainingNodes.getLast(); remainingNodes.removeLast(); List>> children = node.getChildren(); int n = children.size(); if (n > 0) { for (int i=n-1; i>=0; i--) { // We add the children in their reverse order so they // are given in the original order by the iterator remainingNodes.add(children.get(i)); } List nodesInSameHelix = new LinkedList(); RNATemplateHelix currentHelix = null; for (Tree> child: node.getChildren()) { Tree leftNode = child.getValue().getLeftNode(); Tree rightNode = child.getValue().getRightNode(); if (leftNode != null && leftNode.getValue() != null) { RNANodeValue2 leftNodeValue = leftNode.getValue(); // We have a real left (RNA side) node if (rightNode != null && rightNode.getValue() != null) { // We have a real right (template side) node RNANodeValueTemplate rightNodeValue = rightNode.getValue(); if (rightNodeValue instanceof RNANodeValueTemplateBrokenBasePair && canBePartOfABrokenHelix(leftNodeValue)) { RNATemplateHelix helix = ((RNANodeValueTemplateBrokenBasePair) rightNodeValue).getHelix(); currentHelix = helix; tempPKMapping.addCouple(leftNodeValue.getNode().getLeftBasePosition(), helix); // Maybe we have marked nodes as part of the same helix // when we didn't know yet which helix it was. for (RNANodeValue2 v: nodesInSameHelix) { tempPKMapping.addCouple(v.getNode().getLeftBasePosition(), helix); } nodesInSameHelix.clear(); } else { currentHelix = null; nodesInSameHelix.clear(); } } else { // We have no right (template side) node if (canBePartOfABrokenHelix(leftNodeValue)) { if (currentHelix != null) { // We may be in this case if the RNA sequence // contains a longer helix than in the template tempPKMapping.addCouple(leftNodeValue.getNode().getLeftBasePosition(), currentHelix); } else { // Maybe this left node is part of an helix // which is smaller in the template nodesInSameHelix.add(leftNodeValue); } } else { currentHelix = null; nodesInSameHelix.clear(); } } } else { currentHelix = null; nodesInSameHelix.clear(); } } } } // As parts of broken helices were aligned independently, // we need to check for consistency, ie. keep only bases for // which the associated base is also aligned with the same helix. for (RNATemplateElement element: tempPKMapping.getTargetElemsAsSet()) { RNATemplateHelix helix = (RNATemplateHelix) element; HashSet basesInHelix = new HashSet(tempPKMapping.getAncestor(helix)); for (int baseIndex: basesInHelix) { System.out.println("PK: " + helix + " aligned with " + baseIndex); boolean baseOK = false; // Search for an associated base aligned with the same helix ArrayList auxBasePairs = rna.getAuxBPs(baseIndex); for (ModeleStyleBP auxBasePair: auxBasePairs) { int partner5 = ((ModeleBaseNucleotide) auxBasePair.getPartner5()).getIndex(); int partner3 = ((ModeleBaseNucleotide) auxBasePair.getPartner3()).getIndex(); if (baseIndex == partner5) { if (basesInHelix.contains(partner3)) { baseOK = true; break; } } else if (baseIndex == partner3) { if (basesInHelix.contains(partner5)) { baseOK = true; break; } } } if (baseOK) { // Add it to the real mapping mapping.addCouple(baseIndex, helix); } } } } return mapping; } public static void printMapping(RNATemplateMapping mapping, RNATemplate template, String sequence) { Iterator iter = template.rnaIterator(); while (iter.hasNext()) { RNATemplateElement element = iter.next(); System.out.println(element.toString()); ArrayList A = mapping.getAncestor(element); if (A != null) { RNATemplateAlign.printIntArrayList(A); for (int n=A.size(), i=0; i alignRNAWithTemplate(RNA rna, RNATemplate template) throws RNATemplateDrawingAlgorithmException { try { Tree rnaAsTree = RNATree2.RNATree2FromRNA(rna); Tree templateAsTree = template.toTree(); TreeAlign treeAlign = new TreeAlign(new RNANodeValue2TemplateDistance()); TreeAlignResult result = treeAlign.align(rnaAsTree, templateAsTree); return result; } catch (RNATree2Exception e) { throw (new RNATemplateDrawingAlgorithmException("RNATree2Exception: " + e.getMessage())); } catch (ExceptionInvalidRNATemplate e) { throw (new RNATemplateDrawingAlgorithmException("ExceptionInvalidRNATemplate: " + e.getMessage())); } catch (TreeAlignException e) { throw (new RNATemplateDrawingAlgorithmException("TreeAlignException: " + e.getMessage())); } } /** * Map an RNA with an RNATemplate using tree alignment. */ public static RNATemplateMapping mapRNAWithTemplate(RNA rna, RNATemplate template) throws RNATemplateDrawingAlgorithmException { try { TreeAlignResult alignResult = RNATemplateAlign.alignRNAWithTemplate(rna, template); RNATemplateMapping mapping = RNATemplateAlign.makeTemplateMapping(alignResult, rna); return mapping; } catch (RNATemplateMappingException e) { e.printStackTrace(); throw (new RNATemplateDrawingAlgorithmException("RNATemplateMappingException: " + e.getMessage())); } } /** * Print an integer array. */ public static void printIntArray(int[] A) { for (int i=0; i A) { for (int i=0; i l) { if (l != null) { int n = l.size(); int[] result = new int[n]; for (int i=0; is<<Nfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException.class1Hfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException7fr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithmserialVersionUIDJ ConstantValueA@q(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethisJLfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException;messageLjava/lang/String; SourceFile)RNATemplateDrawingAlgorithmException.java!  >*+  PK oq<@Mfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException.javapackage fr.orsay.lri.varna.models.templates; import fr.orsay.lri.varna.exceptions.ExceptionDrawingAlgorithm; /** * Exception thrown in case of failure of the template-based * RNA drawing algorithm. * * @author Raphael Champeimont */ public class RNATemplateDrawingAlgorithmException extends ExceptionDrawingAlgorithm { private static final long serialVersionUID = 1701307036024533400L; public RNATemplateDrawingAlgorithmException(String message) { super(message); } } PK 3F>7&&Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair.class1;Ffr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair8fr/orsay/lri/varna/models/templates/RNANodeValueTemplatehelixBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;positionInHelixI()VCode  LineNumberTableLocalVariableTablethisHLfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair;toGraphvizNodeName()Ljava/lang/String;java/lang/StringBuilderBH[  (Ljava/lang/String;)V     append(I)Ljava/lang/StringBuilder;"] $ %-(Ljava/lang/String;)Ljava/lang/StringBuilder; ' (toStringgetHelixD()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix; , setHelixE(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;)VgetPositionInHelix()IsetPositionInHelix(I)V SourceFile'RNANodeValueTemplateBrokenBasePair.java InnerClasses7@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix9/fr/orsay/lri/varna/models/templates/RNATemplateRNATemplateHelix!  /*    CY*!#& )* /*+  -. >*++ $%/0 /*( 12 >* ,-345 68:PK Pq<.|wwKfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair.javapackage fr.orsay.lri.varna.models.templates; import fr.orsay.lri.varna.models.templates.RNATemplate.RNATemplateHelix; /** * See RNANodeValueTemplate. * * @author Raphael Champeimont */ public class RNANodeValueTemplateBrokenBasePair extends RNANodeValueTemplate { /** * The original template element this node came from. */ private RNATemplateHelix helix; /** * The position (in the 5' to 3' order) * of this base in the original helix. */ private int positionInHelix; public String toGraphvizNodeName() { return "BH[" + positionInHelix + "]"; } public RNATemplateHelix getHelix() { return helix; } public void setHelix(RNATemplateHelix helix) { this.helix = helix; } public int getPositionInHelix() { return positionInHelix; } public void setPositionInHelix(int positionInHelix) { this.positionInHelix = positionInHelix; } } PK 3F>(Ffr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair.class1;@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair8fr/orsay/lri/varna/models/templates/RNANodeValueTemplatehelixBLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;positionInHelixI()VCode  LineNumberTableLocalVariableTablethisBLfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair;toGraphvizNodeName()Ljava/lang/String;java/lang/StringBuilderH[  (Ljava/lang/String;)V     append(I)Ljava/lang/StringBuilder;"] $ %-(Ljava/lang/String;)Ljava/lang/StringBuilder; ' (toStringgetHelixD()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix; , setHelixE(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix;)VgetPositionInHelix()IsetPositionInHelix(I)V SourceFile!RNANodeValueTemplateBasePair.java InnerClasses7@fr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix9/fr/orsay/lri/varna/models/templates/RNATemplateRNATemplateHelix!  /*    CY*!#& )* /*+! -. >*++ %&/0 /*) 12 >* -.345 68:PK PqgFfr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence.class17@fr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence8fr/orsay/lri/varna/models/templates/RNANodeValueTemplatesequenceMLfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;()VCode  LineNumberTableLocalVariableTablethisBLfr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence;toGraphvizNodeName()Ljava/lang/String;java/lang/StringBuilderS(len=  (Ljava/lang/String;)V   Kfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence   getLength()I " #$append(I)Ljava/lang/StringBuilder;&) ( #)-(Ljava/lang/String;)Ljava/lang/StringBuilder; + ,toString getSequenceO()Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence; setSequenceP(Lfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence;)V SourceFile!RNANodeValueTemplateSequence.java InnerClasses5/fr/orsay/lri/varna/models/templates/RNATemplateRNATemplateUnpairedSequence! /*    FY*!%'*  -. /*  /0 >*+  ! 123 46PK Pq3R::,fr/orsay/lri/varna/models/templates/TODO.txtTODO for the template-based RNA drawing algorithm: - Calculer le tableau centers[] entirement dans l'algo de trac. - RNATemplateAlign.multiPassMap() is currently just an alias for singlePassMap(), but it should me multi-pass. - Decalage des helices en absence de PK - Ellipses pour non-appariees - couts affinePK 3F>$fr/orsay/lri/varna/models/treealign/PK 3F>: 999fr/orsay/lri/varna/models/treealign/TreeAlignResult.class1'3fr/orsay/lri/varna/models/treealign/TreeAlignResultjava/lang/Object alignment*Lfr/orsay/lri/varna/models/treealign/Tree; SignaturewLfr/orsay/lri/varna/models/treealign/Tree;>;distanceD()VCode  LineNumberTableLocalVariableTablethis5Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;LocalVariableTypeTableOLfr/orsay/lri/varna/models/treealign/TreeAlignResult; getAlignment,()Lfr/orsay/lri/varna/models/treealign/Tree;y()Lfr/orsay/lri/varna/models/treealign/Tree;>;   setAlignment-(Lfr/orsay/lri/varna/models/treealign/Tree;)Vz(Lfr/orsay/lri/varna/models/treealign/Tree;>;)V getDistance()D !  setDistance(D)V SourceFileTreeAlignResult.javaNLjava/lang/Object;!   A*    A*   Z*+  A*   "# P*'    $%&PK oq<E8fr/orsay/lri/varna/models/treealign/TreeAlignResult.javapackage fr.orsay.lri.varna.models.treealign; /** * The result of aligning a tree T1 with a tree T2. * On the resulting tree, each node has a value * of type AlignedNode. * @author Raphael Champeimont */ public class TreeAlignResult { private Tree> alignment; private double distance; public Tree> getAlignment() { return alignment; } public void setAlignment(Tree> alignment) { this.alignment = alignment; } public double getDistance() { return distance; } public void setDistance(double distance) { this.distance = distance; } } PK 3F>O7[[Cfr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMapping.class1=fr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMappingjava/lang/Objectm'Lfr/orsay/lri/varna/models/rna/Mapping;sequenceAligner6Lfr/orsay/lri/varna/models/treealign/ExampleDistance3;()VCode  4fr/orsay/lri/varna/models/treealign/ExampleDistance3   LineNumberTableLocalVariableTablethis?Lfr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMapping;convertS(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/rna/Mapping; Exceptions.fr/orsay/lri/varna/exceptions/MappingException Signature(Lfr/orsay/lri/varna/models/treealign/Tree;>;)Lfr/orsay/lri/varna/models/rna/Mapping;%fr/orsay/lri/varna/models/rna/Mapping  "  $ %&convertSubTree-(Lfr/orsay/lri/varna/models/treealign/Tree;)Vtree*Lfr/orsay/lri/varna/models/treealign/Tree;LocalVariableTypeTableLfr/orsay/lri/varna/models/treealign/Tree;>;(Lfr/orsay/lri/varna/models/treealign/Tree;>;)V -/.(fr/orsay/lri/varna/models/treealign/Tree 01getValue()Ljava/lang/Object;3/fr/orsay/lri/varna/models/treealign/AlignedNode 25 67 getLeftNode,()Lfr/orsay/lri/varna/models/treealign/Tree; 29 :7 getRightNode<1fr/orsay/lri/varna/models/treealign/RNANodeValue2 ;> ?@ isSingleNode()Z ;B CDgetNode4()Lfr/orsay/lri/varna/models/treealign/RNANodeValue; FHG0fr/orsay/lri/varna/models/treealign/RNANodeValue IJgetLeftBasePosition()I FL MJgetRightBasePosition O PQ addCouple(II)V S TUalignSequenceNodes(Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;)Lfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult; WYXHfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult Z[ getAlignment()[[I ;] ^_getNodes()Ljava/util/List; acbjava/util/List deget(I)Ljava/lang/Object; -g h_ getChildren aj kliterator()Ljava/util/Iterator; npojava/util/Iterator q1next ns t@hasNext alignedNode1Lfr/orsay/lri/varna/models/treealign/AlignedNode;leftNode rightNodev13Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;v2vsn12Lfr/orsay/lri/varna/models/treealign/RNANodeValue;vsn2l1Ir1l2r2sequenceAlignment[[Ilib1b2childLfr/orsay/lri/varna/models/treealign/AlignedNode;_Lfr/orsay/lri/varna/models/treealign/Tree;B(Lfr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMapping;)V   SourceFile RNATree2.java InnerClassesSequenceAlignResult,fr/orsay/lri/varna/models/treealign/RNATree2ConvertToMapping   B* *Ytvt  c*Y !*+#*!y z{'() '*%&+ I+,2M,4N,8:- -,;:,;:=b=ZA:A:E6 K6 E6 K6   *!  N  *!  N=={*RV:266 W2 .6 2 .6  < 6\ `FE6 \ `FE6 *!  N  +fi:m-:*#r  %/?FMT[bis~ 8>HII'(Auv <w(6x(%yz/{zFP|}MI~}TB [; b4 i- ha^ H ?   8()4I'*Au <w6x8*  %*tW PK 3F>ZZ12fr/orsay/lri/varna/models/treealign/RNATree2.class1,fr/orsay/lri/varna/models/treealign/RNATree2java/lang/ObjectE$SWITCH_TABLE$fr$orsay$lri$varna$models$treealign$RNANodeValue$Origin[I()VCode  LineNumberTableLocalVariableTablethis.Lfr/orsay/lri/varna/models/treealign/RNATree2;RNATree2FromRNAO(Lfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/treealign/Tree; Exceptions5fr/orsay/lri/varna/models/treealign/RNATree2Exception Signature(Lfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/treealign/Tree; +fr/orsay/lri/varna/models/treealign/RNATree RNATreeFromRNA  RNATree2FromRNATreeV(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/treealign/Tree;rna#Lfr/orsay/lri/varna/models/rna/RNA;fullTree*Lfr/orsay/lri/varna/models/treealign/Tree;LocalVariableTypeTable^Lfr/orsay/lri/varna/models/treealign/Tree;(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/treealign/Tree;((fr/orsay/lri/varna/models/treealign/Tree ' '+ ,-setValue(Ljava/lang/Object;)V '/ 01 getChildren()Ljava/util/List; 3 45RNAForest2FromRNAForest"(Ljava/util/List;)Ljava/util/List; '7 89replaceChildrenListBy(Ljava/util/List;)V originalTreenewTree_Lfr/orsay/lri/varna/models/treealign/Tree;&RNAForest2FromRNAForestCommitNonPaired#(Ljava/util/List;Ljava/util/List;)V(Ljava/util/List;>;Ljava/util/List;)V ACBjava/util/List DEsize()IG1fr/orsay/lri/varna/models/treealign/RNANodeValue2 FI J(Z)V FL M1getNodes AO PQaddAll(Ljava/util/Collection;)Z AS TUadd(Ljava/lang/Object;)Z AW XclearforestLjava/util/List;consecutiveNonPairedBasesgroupOfConsecutiveBases3Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;groupOfConsecutiveBasesNodeqLjava/util/List;>;DLjava/util/List;(Ljava/util/List;>;)Ljava/util/List;>;cjava/util/ArrayList b fjava/util/LinkedList e Ai jkiterator()Ljava/util/Iterator; monjava/util/Iterator pqnext()Ljava/lang/Object; 's tqgetValuev0fr/orsay/lri/varna/models/treealign/RNANodeValue ux yEgetRightBasePosition{%Non-paired base cannot have children. } ~(Ljava/lang/String;)V  ()[I u  getOrigin;()Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; 7fr/orsay/lri/varna/models/treealign/RNANodeValue$Origin Eordinal  => F setNode5(Lfr/orsay/lri/varna/models/treealign/RNANodeValue;)V6Origin is BASE_PAIR_FROM_HELIX but this is not a pair. m hasNext()ZoriginalForest pairedBasepairedBaseNodepLjava/util/List;>;mappingFromAlignmentS(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/rna/Mapping;.fr/orsay/lri/varna/exceptions/MappingException(Lfr/orsay/lri/varna/models/treealign/Tree;>;)Lfr/orsay/lri/varna/models/rna/Mapping;=fr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMapping B(Lfr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMapping;)V convert alignment converter?Lfr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMapping;Lfr/orsay/lri/varna/models/treealign/Tree;>;   values<()[Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; BASE_FROM_HELIX_STRAND39Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; BASE_FROM_HELIX_STRAND5 BASE_FROM_UNPAIRED_REGION BASE_PAIR_FROM_HELIXjava/lang/NoSuchFieldError SourceFile RNATree2.java InnerClassesOriginConvertToMapping!  /*     T *L+   !"#$ "% & v'Y)L+*+*.26+ !# $% :#;#$:%;< =>? 9+@2FYHM,K+NW'Y)N-,**-RW+V "* +,-%.*/2082 *9YZ9[Z&\]%^#$ 9Y_9[`%^< 45a BbYdLeYgM*h:l'N-ruw-.@ Yz|-ru.oeT+,FYH:-ru'Y):*+RWa,-ruRWPY|C+,FYH:-ru'Y):*-.26+RW+,+ v567&84:@;J>M>xE}HIJKLMOPRSY\]^_`a 7fh RZYZ[Z&:#(]#1]#$>Y_[`&:%<<  YYL+* p q # $  JYW K*OW*OW*OW*OW*Y&)*367@C  u@ PK oq RNATree2FromRNA(RNA rna) throws RNATree2Exception { Tree fullTree = RNATree.RNATreeFromRNA(rna); return RNATree2FromRNATree(fullTree); } /** * Convert from RNANodeValue model to RNANodeValue2 model, * ie. compact consecutive non-paired bases. */ public static Tree RNATree2FromRNATree(Tree originalTree) throws RNATree2Exception { Tree newTree = new Tree(); // Root in original tree is fake, so may a fake root newTree.setValue(null); newTree.replaceChildrenListBy(RNAForest2FromRNAForest(originalTree.getChildren())); return newTree; } private static void RNAForest2FromRNAForestCommitNonPaired(List> forest, List consecutiveNonPairedBases) { // add the group of non-paired bases if there is one if (consecutiveNonPairedBases.size() > 0) { RNANodeValue2 groupOfConsecutiveBases = new RNANodeValue2(false); groupOfConsecutiveBases.getNodes().addAll(consecutiveNonPairedBases); Tree groupOfConsecutiveBasesNode = new Tree(); groupOfConsecutiveBasesNode.setValue(groupOfConsecutiveBases); forest.add(groupOfConsecutiveBasesNode); consecutiveNonPairedBases.clear(); } } private static List> RNAForest2FromRNAForest(List> originalForest) throws RNATree2Exception { List> forest = new ArrayList>(); List consecutiveNonPairedBases = new LinkedList(); for (Tree originalTree: originalForest) { if (originalTree.getValue().getRightBasePosition() == -1) { // non-paired base if (originalTree.getChildren().size() > 0) { throw (new RNATree2Exception("Non-paired base cannot have children.")); } switch (originalTree.getValue().getOrigin()) { case BASE_FROM_HELIX_STRAND5: case BASE_FROM_HELIX_STRAND3: // This base is part of a broken base pair // if we have gathered some non-paired bases, add a node with // the group of them RNAForest2FromRNAForestCommitNonPaired(forest, consecutiveNonPairedBases); // now add the node RNANodeValue2 pairedBase = new RNANodeValue2(true); pairedBase.setNode(originalTree.getValue()); Tree pairedBaseNode = new Tree(); pairedBaseNode.setValue(pairedBase); forest.add(pairedBaseNode); break; case BASE_FROM_UNPAIRED_REGION: consecutiveNonPairedBases.add(originalTree.getValue()); break; case BASE_PAIR_FROM_HELIX: throw (new RNATree2Exception("Origin is BASE_PAIR_FROM_HELIX but this is not a pair.")); } } else { // paired bases // if we have gathered some non-paired bases, add a node with // the group of them RNAForest2FromRNAForestCommitNonPaired(forest, consecutiveNonPairedBases); // now add the node RNANodeValue2 pairedBase = new RNANodeValue2(true); pairedBase.setNode(originalTree.getValue()); Tree pairedBaseNode = new Tree(); pairedBaseNode.setValue(pairedBase); pairedBaseNode.replaceChildrenListBy(RNAForest2FromRNAForest(originalTree.getChildren())); forest.add(pairedBaseNode); } } // if there we have some non-paired bases, add them grouped RNAForest2FromRNAForestCommitNonPaired(forest, consecutiveNonPairedBases); return forest; } /** * Convert an RNA tree (with RNANodeValue2) alignment into a Mapping. */ public static Mapping mappingFromAlignment(Tree> alignment) throws MappingException { ConvertToMapping converter = new ConvertToMapping(); return converter.convert(alignment); } private static class ConvertToMapping { private Mapping m; ExampleDistance3 sequenceAligner = new ExampleDistance3(); public Mapping convert(Tree> tree) throws MappingException { m = new Mapping(); convertSubTree(tree); return m; } private void convertSubTree(Tree> tree) throws MappingException { AlignedNode alignedNode = tree.getValue(); Tree leftNode = alignedNode.getLeftNode(); Tree rightNode = alignedNode.getRightNode(); if (leftNode != null && rightNode != null) { RNANodeValue2 v1 = leftNode.getValue(); RNANodeValue2 v2 = rightNode.getValue(); if (v1.isSingleNode() && v2.isSingleNode()) { // we have aligned (x,y) with (x',y') // so we map x with x' and y with y' RNANodeValue vsn1 = v1.getNode(); RNANodeValue vsn2 = v2.getNode(); int l1 = vsn1.getLeftBasePosition(); int r1 = vsn1.getRightBasePosition(); int l2 = vsn2.getLeftBasePosition(); int r2 = vsn2.getRightBasePosition(); if (l1 >= 0 && l2 >= 0) { m.addCouple(l1, l2); } if (r1 >= 0 && r2 >= 0) { m.addCouple(r1, r2); } } else if (!v1.isSingleNode() && !v2.isSingleNode()) { // We have aligned x1 x2 ... xn with y1 y2 ... ym. // So we will now (re-)compute this sequence alignment. int[][] sequenceAlignment = sequenceAligner.alignSequenceNodes(v1, v2).getAlignment(); int l = sequenceAlignment[0].length; for (int i=0; i> child: tree.getChildren()) { convertSubTree(child); } } } } PK 3F>f߉ 5fr/orsay/lri/varna/models/treealign/AlignedNode.class1N/fr/orsay/lri/varna/models/treealign/AlignedNodejava/lang/Object=fr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValueleftNode*Lfr/orsay/lri/varna/models/treealign/Tree; SignatureDLfr/orsay/lri/varna/models/treealign/Tree; rightNodeDLfr/orsay/lri/varna/models/treealign/Tree;()VCode  LineNumberTableLocalVariableTablethis1Lfr/orsay/lri/varna/models/treealign/AlignedNode;LocalVariableTypeTablecLfr/orsay/lri/varna/models/treealign/AlignedNode; getLeftNode,()Lfr/orsay/lri/varna/models/treealign/Tree;F()Lfr/orsay/lri/varna/models/treealign/Tree;   setLeftNode-(Lfr/orsay/lri/varna/models/treealign/Tree;)VG(Lfr/orsay/lri/varna/models/treealign/Tree;)V getRightNodeF()Lfr/orsay/lri/varna/models/treealign/Tree; #  setRightNodeG(Lfr/orsay/lri/varna/models/treealign/Tree;)VmaybeNodeToGraphvizNodeName>(Lfr/orsay/lri/varna/models/treealign/Tree;)Ljava/lang/String;(Lfr/orsay/lri/varna/models/treealign/Tree<+Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;>;)Ljava/lang/String; *,+(fr/orsay/lri/varna/models/treealign/Tree -.getValue()Ljava/lang/Object; 0 12toGraphvizNodeName()Ljava/lang/String;4_treelLfr/orsay/lri/varna/models/treealign/Tree<+Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;>;8java/lang/StringBuilder:( 7< =(Ljava/lang/String;)V ? &' 7A BCappend-(Ljava/lang/String;)Ljava/lang/StringBuilder;E,G) 7I J2toString SourceFileAlignedNode.javaLjava/lang/Object;Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;!      A*    A*   Z*+    !A*"  $ %Z*+"   &' (m++)+)/3"55612q-7Y9;**>@D@**">@F@H+,)+ - -KL MPK <е4fr/orsay/lri/varna/models/treealign/AlignedNode.javapackage fr.orsay.lri.varna.models.treealign; /** * The type of node values in an alignment. * Contains a reference to both original nodes. * This class implements GraphvizDrawableNodeValue but it will only work * if the original nodes implement it. * @author Raphael Champeimont * @param The type of values in the original first tree. * @param The type of values in the original second tree. */ public class AlignedNode implements GraphvizDrawableNodeValue { private Tree leftNode; private Tree rightNode; public Tree getLeftNode() { return leftNode; } public void setLeftNode(Tree leftNode) { this.leftNode = leftNode; } public Tree getRightNode() { return rightNode; } public void setRightNode(Tree rightNode) { this.rightNode = rightNode; } private String maybeNodeToGraphvizNodeName(Tree tree) { return (tree != null && tree.getValue() != null) ? tree.getValue().toGraphvizNodeName() : "_"; } /** * This method will work only if the left and right node * already implement GraphvizDrawableNodeValue. */ @SuppressWarnings("unchecked") public String toGraphvizNodeName() { return "(" + maybeNodeToGraphvizNodeName((Tree) leftNode) + "," + maybeNodeToGraphvizNodeName((Tree) rightNode) + ")"; } } PK 3F>', , 7fr/orsay/lri/varna/models/treealign/RNANodeValue2.class1y1fr/orsay/lri/varna/models/treealign/RNANodeValue2java/lang/Object=fr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue singleNodeZnode2Lfr/orsay/lri/varna/models/treealign/RNANodeValue;nodesLjava/util/List; SignatureDLjava/util/List;(Z)VCode  ()V  0fr/orsay/lri/varna/models/treealign/RNANodeValue   java/util/ArrayList   LineNumberTableLocalVariableTablethis3Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;getNode4()Lfr/orsay/lri/varna/models/treealign/RNANodeValue;(Cfr/orsay/lri/varna/models/treealign/RNANodeValue2WrongTypeException 'setNode5(Lfr/orsay/lri/varna/models/treealign/RNANodeValue;)VgetNodes()Ljava/util/List;F()Ljava/util/List;computeSequence()[C 243java/util/List 56size()I 28 9:get(I)Ljava/lang/Object; < =>getLeftNucleotide()Ljava/lang/String; @BAjava/lang/String CDcharAt(I)CnIsequence[CisetNodes(Ljava/util/List;)VG(Ljava/util/List;)VLocalVariableTypeTable isSingleNode()ZtoString R S>toGraphvizNodeName RV 2X YZiterator()Ljava/util/Iterator; \^]java/util/Iterator _`next()Ljava/lang/Object;bjava/lang/StringBuilder @d efvalueOf&(Ljava/lang/Object;)Ljava/lang/String; ah i(Ljava/lang/String;)Vk am noappend-(Ljava/lang/String;)Ljava/lang/StringBuilder; aq P> \s tOhasNextsLjava/lang/String; SourceFileRNANodeValue2.java!    x,****Y*Y!& '() ++-",#$,%&F**'Y)!45 7" #$*+X* *+ 'Y)!<=?A"#$ ,- .F**'Y)!HI K" #$/0C*7*1<M>,*7;?U,'Y)!"RSTUV1U9X;Z"*C#$*EF&GH"IFJK Lj* *+ 'Y)!_`bd"#$ M  NO/*!g" #$P>/*Q!k" #$S>d* *TUL*WN=-[M+UaY+cgjlpLaY+cg,TlpL-r+!& oprs)t/uCwYsby" d#$Ruv)0 wxPK Ik=7 6fr/orsay/lri/varna/models/treealign/RNANodeValue2.javapackage fr.orsay.lri.varna.models.treealign; import java.util.ArrayList; import java.util.List; /** * In this model, nodes are either: * 1. a couple of paired bases, and in that case they may have children, * in this case singleNode is true * 2. a single base that comes from a broken base pair * (broken during planarization), without children, * in this case singleNode is true * 3. a list of consecutive non-paired bases, without children. * in this case singleNode is false * Note that case 2 happens only if original sequences contained * pseudoknots, otherwise this case can be ignored. * * @author Raphael Champeimont * */ public class RNANodeValue2 implements GraphvizDrawableNodeValue { /** * Says whether we have a single node or a list of nodes. */ private boolean singleNode = true; /** * Defined if singleNode is true. */ private RNANodeValue node; /** * Defined if singleNode is false; */ private List nodes; public RNANodeValue2(boolean singleNode) { this.singleNode = singleNode; if (singleNode) { node = new RNANodeValue(); } else { nodes = new ArrayList(); } } /** * In case of a single node, return it. * Will throw RNANodeValue2WrongTypeException if singleNode = false. */ public RNANodeValue getNode() { if (singleNode) { return node; } else { throw (new RNANodeValue2WrongTypeException()); } } public void setNode(RNANodeValue node) { if (singleNode) { this.node = node; } else { throw (new RNANodeValue2WrongTypeException()); } } /** * In case of multiple nodes, return them. * Will throw RNANodeValue2WrongTypeException if singleNode = true. */ public List getNodes() { if (!singleNode) { return nodes; } else { throw (new RNANodeValue2WrongTypeException()); } } /** * In case of multiple nodes, return the sequence of nucleotides. */ public char[] computeSequence() { if (!singleNode) { final int n = nodes.size(); char[] sequence = new char[n]; for (int i=0; i nodes) { if (!singleNode) { this.nodes = nodes; } else { throw (new RNANodeValue2WrongTypeException()); } } public boolean isSingleNode() { return singleNode; } public String toString() { return toGraphvizNodeName(); } public String toGraphvizNodeName() { if (singleNode) { return node.toGraphvizNodeName(); } else { String s = ""; for (RNANodeValue node: nodes) { if (s != "") { s += " "; } s += node.toGraphvizNodeName(); } return s; } } } PK 3F>0vvJfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric.class1 Dfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetricjava/lang/Objectf'(Ljava/lang/Object;Ljava/lang/Object;)D Signature(TValueType1;TValueType2;)D SourceFile%TreeAlignLabelDistanceAsymmetric.javaNLjava/lang/Object;   PK oq< {{Ifr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric.javapackage fr.orsay.lri.varna.models.treealign; public interface TreeAlignLabelDistanceAsymmetric { /** * Returns the substitution cost between v1 and v2. * We use the convention that a null reference is a blank, * ie. f(x, null) is the cost of deleting x * and f(null, x) is the cost of inserting x. * We won't use f(null, null). * We suppose f is such that: * f(x,x) = 0 * 0 <= f(x,y) < +infinity * You may also want to have the triangle inequality, * although the alignment algorithm does not require it: * f(x,z) <= f(x,y) + f(y,z) */ public double f(ValueType1 x, ValueType2 y); } PK 3F>]ee@fr/orsay/lri/varna/models/treealign/Tree$DFSPrefixIterator.class1\:fr/orsay/lri/varna/models/treealign/Tree$DFSPrefixIteratorjava/lang/Objectjava/util/IteratorremainingNodesLjava/util/LinkedList; SignatureGLjava/util/LinkedList;>;this$0*Lfr/orsay/lri/varna/models/treealign/Tree;hasNext()ZCode   java/util/LinkedList isEmptyLineNumberTableLocalVariableTablethis; java/util/NoSuchElementException ! "#()V % &'getLast()Ljava/lang/Object;)(fr/orsay/lri/varna/models/treealign/Tree + ,' removeLast (. /0 getChildren()Ljava/util/List; 243java/util/List 56size()I 28 9:get(I)Ljava/lang/Object; < =>add(Ljava/lang/Object;)Z currentNodechildrenLjava/util/List;nIiLocalVariableTypeTable/Lfr/orsay/lri/varna/models/treealign/Tree;ALjava/util/List;>;-(Lfr/orsay/lri/varna/models/treealign/Tree;)V J ! ! (N OPaccess$0V(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/treealign/Tree;removeS'java/lang/UnsupportedOperationException R! V  SourceFile Tree.javaWLjava/lang/Object;Ljava/util/Iterator;>; InnerClassesDFSPrefixIterator!    :*  V* Y *$(L**W+-M,1>d6*,7(;W+* %*19LT4V9? *,@A1%BC6DCE9?F*,@G"HW!*+I*K*YL*+M;W ~ !Q#2RYT A'%*UWX YZ ([PK 3F>R" .fr/orsay/lri/varna/models/treealign/Tree.class1j(fr/orsay/lri/varna/models/treealign/Treejava/lang/Objectjava/lang/IterablechildrenLjava/util/List; SignatureALjava/util/List;>;valueLjava/lang/Object;TT;tree*Lfr/orsay/lri/varna/models/treealign/Tree;/Lfr/orsay/lri/varna/models/treealign/Tree;getValue()Ljava/lang/Object;()TT;Code  LineNumberTableLocalVariableTablethisLocalVariableTypeTablesetValue(Ljava/lang/Object;)V(TT;)V getChildren()Ljava/util/List;C()Ljava/util/List;>; " replaceChildrenListBy(Ljava/util/List;)VD(Ljava/util/List;>;)V(Ljava/lang/Iterable;)VH(Ljava/lang/Iterable;>;)V * &+()V - ./iterator()Ljava/util/Iterator; 132java/util/Iterator 4next 687java/util/List 9:add(Ljava/lang/Object;)Z 1< =>hasNext()ZLjava/lang/Iterable;childELjava/lang/Iterable;>; * D Fjava/util/ArrayList E* rootDegree()I 6K LIsize countNodes 6- P MIcountI computeDegree U SImax maxCandidatetoGraphvizNodeId()Ljava/lang/String; [ \YtoStringG()Ljava/util/Iterator;>;_:fr/orsay/lri/varna/models/treealign/Tree$DFSPrefixIterator ^a &b-(Lfr/orsay/lri/varna/models/treealign/Tree;)Vaccess$0V(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/treealign/Tree; SourceFile Tree.javamLjava/lang/Object;Ljava/lang/Iterable;>; InnerClassesDFSPrefixIterator!        A*   Z*+     A*!   #$ %Z*+! 23 &' (-*)+,N-0M*!,5W-;;<=#<,? --? @ --A @&+]*B**C*EYG!D EF  HIF *!JL    MI+<*!NN-0M,O`<-;VWX W)Z +)QR@+@SI;*!J<*!NN-0M,T6<-;c d!e'f-g0d9j*; 1VR!@' WR;!@XYA*Zq  ./ ]E ^Y*`v    cd%*Cef gh ^iPK oq<`CC-fr/orsay/lri/varna/models/treealign/Tree.javapackage fr.orsay.lri.varna.models.treealign; import java.util.*; /** * An object of this class is a rooted tree, where children are ordered. * The tree is iterable, and the default iterator is DFS * (depth-first search), with the fathers given before the children. * * @param The type of values on nodes. * @author Raphael Champeimont */ public class Tree implements Iterable> { private List> children; private T value; private Tree tree = this; public T getValue() { return value; } public void setValue(T value) { this.value = value; } /** * Returns the list of children. * The return list has a O(1) access time to any of its elements * (ie. it is like an array and unlike a linked list) */ public List> getChildren() { return children; } /** * This method replaces the list of children of a tree with the list given * as argument. Be careful, because it means the list will be kept as a * reference (it will not be copied) so if you later modify the list * you passed as an argument here, it will modify the list of children. * Note that the List object you give must have a 0(1) access time to * elements (because someone calling getChildren() can expect that property). * This method may be useful if you have already built a list of children * and you don't want to use this.getChildren.addAll() to avoid a O(n) copy. * In that case you would simply call the constructor that takes no argument * to create an empty tree and then call replaceChildrenListBy(children) * where children is the list of children you have built. * @param children the new list of children */ public void replaceChildrenListBy(List> children) { this.children = children; } /** * Creates a tree, with the given set of children. * The given set is any collection that implements Iterable. * The set is iterated on and its elements are copied (as references). */ public Tree(Iterable> children) { this(); for (Tree child: children) { this.children.add(child); } } /** * Creates a tree, with an empty list of children. */ public Tree() { children = new ArrayList>(); } /** * Returns the number of children of the root node. */ public int rootDegree() { return children.size(); } /** * Count the nodes in the tree. * Time: O(n) * @return the number of nodes in the tree */ public int countNodes() { int count = 1; for (Tree child: children) { count += child.countNodes(); } return count; } /** * Compute the tree degree, ie. the max over nodes of the node degree. * Time: O(n) * @return the maximum node degree */ public int computeDegree() { int max = children.size(); for (Tree child: children) { int maxCandidate = child.computeDegree(); if (maxCandidate > max) { max = maxCandidate; } } return max; } /** * Returns a string unique to this node. */ public String toGraphvizNodeId() { return super.toString(); } public Iterator> iterator() { return (new DFSPrefixIterator()); } /** * An iterator that returns the nodes in prefix (fathers before * children) DFS (go deep first) order. */ public class DFSPrefixIterator implements Iterator> { private LinkedList> remainingNodes = new LinkedList>(); public boolean hasNext() { return !remainingNodes.isEmpty(); } public Tree next() { if (remainingNodes.isEmpty()) { throw (new NoSuchElementException()); } Tree currentNode = remainingNodes.getLast(); remainingNodes.removeLast(); List> children = currentNode.getChildren(); int n = children.size(); // The children access is in O(1) so this loop is O(n) for (int i=n-1; i>=0; i--) { // We add the children is their reverse order so they // are given in the original order by the iterator remainingNodes.add(children.get(i)); } return currentNode; } public DFSPrefixIterator() { remainingNodes.add(tree); } public void remove() { throw (new UnsupportedOperationException()); } } } PK 3F>6T;zz6fr/orsay/lri/varna/models/treealign/TreeGraphviz.class10fr/orsay/lri/varna/models/treealign/TreeGraphvizjava/lang/Object()VCode  LineNumberTableLocalVariableTablethis2Lfr/orsay/lri/varna/models/treealign/TreeGraphviz;treeToGraphvizPostscriptQ(Lfr/orsay/lri/varna/models/treealign/Tree;Ljava/lang/String;Ljava/lang/String;)V Exceptionsjava/io/IOException Signature(Lfr/orsay/lri/varna/models/treealign/Tree<+Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;>;Ljava/lang/String;Ljava/lang/String;)V  treeToGraphvizP(Lfr/orsay/lri/varna/models/treealign/Tree;Ljava/lang/String;)Ljava/lang/String;java/io/BufferedWriterjava/io/FileWriter  (Ljava/lang/String;)V ! "(Ljava/io/Writer;)V $&%java/lang/Runtime '( getRuntime()Ljava/lang/Runtime;*dot -Tps $, -.exec'(Ljava/lang/String;)Ljava/lang/Process;0java/io/OutputStreamWriter 243java/lang/Process 56getOutputStream()Ljava/io/OutputStream; /8 9(Ljava/io/OutputStream;)V;java/io/BufferedReader=java/io/InputStreamReader 2? @AgetInputStream()Ljava/io/InputStream; <C D(Ljava/io/InputStream;)V :F G(Ljava/io/Reader;)V 2I JAgetErrorStream L Mwrite O PcloseRjava/lang/StringBuilder TVUjava/lang/String WXvalueOf&(Ljava/lang/Object;)Ljava/lang/String; Q[ Q] ^_append-(Ljava/lang/String;)Ljava/lang/StringBuilder; Qa bctoString()Ljava/lang/String; :e fcreadLine hjijava/lang/System klerrLjava/io/PrintStream; npojava/io/PrintStream qprintln 2s tuwaitFor()I wyxjava/lang/InterruptedException zprintStackTracetree*Lfr/orsay/lri/varna/models/treealign/Tree;filenameLjava/lang/String;titlegraphvizSourcefbwLjava/io/BufferedWriter;procLjava/lang/Process;bwbrLjava/io/BufferedReader;brelinee Ljava/lang/InterruptedException;LocalVariableTypeTablelLfr/orsay/lri/varna/models/treealign/Tree<+Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;>;?(Lfr/orsay/lri/varna/models/treealign/Tree;Ljava/lang/String;)V(Lfr/orsay/lri/varna/models/treealign/Tree<+Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;>;Ljava/lang/String;)V  treeToGraphvizFile  (Lfr/orsay/lri/varna/models/treealign/Tree<+Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;>;Ljava/lang/String;)Ljava/lang/String; digraph "" {  subtreeToGraphviz>(Lfr/orsay/lri/varna/models/treealign/Tree;)Ljava/lang/String;} (Lfr/orsay/lri/varna/models/treealign/Tree<+Lfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue;>;)Ljava/lang/String; (fr/orsay/lri/varna/models/treealign/Tree ctoGraphvizNodeId" " [label=" getValue()Ljava/lang/Object;=fr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue ctoGraphvizNodeNamenull"]  getChildren()Ljava/util/List; java/util/List iterator()Ljava/util/Iterator; java/util/Iterator next" -> "" hasNext()ZsmyIdchild SourceFileTreeGraphviz.java!/*    *,NYY+ :#)+:Y/Y17 ::YBE::Y the type of values in the tree */ public class TreeGraphviz { /** * Generates a PostScript file using graphviz. * The dot command must be available. */ public static void treeToGraphvizPostscript(Tree tree, String filename, String title) throws IOException { // generate graphviz source String graphvizSource = treeToGraphviz(tree, title); // open output file BufferedWriter fbw; fbw = new BufferedWriter(new FileWriter(filename)); // execute graphviz Process proc = Runtime.getRuntime().exec("dot -Tps"); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream())); BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream())); BufferedReader bre = new BufferedReader(new InputStreamReader(proc.getErrorStream())); bw.write(graphvizSource); bw.close(); { String line = null; while ((line = br.readLine()) != null) { fbw.write(line + "\n"); } } { String line = null; while ((line = bre.readLine()) != null) { System.err.println(line); } } // wait for graphviz to end try { proc.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } // close file fbw.close(); } /** * Like treeToGraphvizPostscript(Tree,String,String) but with the title * equal to the filename. */ public static void treeToGraphvizPostscript(Tree tree, String filename) throws IOException { treeToGraphvizPostscript(tree, filename, filename); } /** * Creates a graphviz source file from a Tree. * @param title the title of the graph */ public static void treeToGraphvizFile(Tree tree, String filename, String title) throws IOException { BufferedWriter bw; bw = new BufferedWriter(new FileWriter(filename)); bw.write(treeToGraphviz(tree, filename)); bw.close(); } /** * Like treeToGraphvizFile(Tree,String,String) but with the title * equal to the filename. */ public static void treeToGraphvizFile(Tree tree, String filename) throws IOException { treeToGraphvizFile(tree, filename, filename); } /** * Creates a graphviz source from a Tree. * @param title the title of the graph */ public static String treeToGraphviz(Tree tree, String title) { return "digraph \"" + title + "\" {\n" + subtreeToGraphviz(tree) + "}\n"; } private static String subtreeToGraphviz(Tree tree) { String s = ""; String myId = tree.toGraphvizNodeId(); s += "\"" + myId + "\" [label=\"" + ((tree.getValue() != null) ? tree.getValue().toGraphvizNodeName() : "null") + "\"]\n"; for (Tree child: tree.getChildren()) { s += "\"" + myId + "\" -> \"" + child.toGraphvizNodeId() + "\"\n"; s += subtreeToGraphviz(child); } return s; } } PK 3F>3Ifr/orsay/lri/varna/models/treealign/RNANodeValue2WrongTypeException.class1Cfr/orsay/lri/varna/models/treealign/RNANodeValue2WrongTypeExceptionjava/lang/NullPointerExceptionserialVersionUIDJ ConstantValueg~>0()VCode  LineNumberTableLocalVariableTablethisELfr/orsay/lri/varna/models/treealign/RNANodeValue2WrongTypeException; SourceFile$RNANodeValue2WrongTypeException.java!  /*  PK oq<SHfr/orsay/lri/varna/models/treealign/RNANodeValue2WrongTypeException.javapackage fr.orsay.lri.varna.models.treealign; /** * @author Raphael Champeimont * */ public class RNANodeValue2WrongTypeException extends NullPointerException { private static final long serialVersionUID = -2709057098523675088L; } PK 3F>;fr/orsay/lri/varna/models/treealign/RNATree2Exception.class15fr/orsay/lri/varna/models/treealign/RNATree2Exceptionjava/lang/ExceptionserialVersionUIDJ ConstantValue=A+aB(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/models/treealign/RNATree2Exception;messageLjava/lang/String; SourceFileRNATree2Exception.java!  >*+    PK oq<){ :fr/orsay/lri/varna/models/treealign/RNATree2Exception.javapackage fr.orsay.lri.varna.models.treealign; /** * @author Raphael Champeimont * */ public class RNATree2Exception extends Exception { private static final long serialVersionUID = 2034802149835891010L; public RNATree2Exception(String message) { super(message); } } PK 3F>.Cfr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue.class1 =fr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValuejava/lang/ObjecttoGraphvizNodeName()Ljava/lang/String; SourceFileGraphvizDrawableNodeValue.javaPK oqI=fr/orsay/lri/varna/models/treealign/RNANodeValue$Origin.class1:7fr/orsay/lri/varna/models/treealign/RNANodeValue$Originjava/lang/EnumBASE_PAIR_FROM_HELIX9Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin;BASE_FROM_HELIX_STRAND5BASE_FROM_HELIX_STRAND3BASE_FROM_UNPAIRED_REGION ENUM$VALUES:[Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin;()VCode  (Ljava/lang/String;I)V          LineNumberTableLocalVariableTable thisvalues<()[Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; (*)java/lang/System +, arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOfM(Ljava/lang/String;)Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; 0 -15(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; SourceFileRNANodeValue.java SignatureKLjava/lang/Enum; InnerClasses80fr/orsay/lri/varna/models/treealign/RNANodeValueOrigin@1@@@@   TYYYYYSYSYSYS! '4"1*+#!" $ %&6YK*Y<YM',!" -.* */!"23456 79@PK 3F>p= 6fr/orsay/lri/varna/models/treealign/RNANodeValue.class1^0fr/orsay/lri/varna/models/treealign/RNANodeValuejava/lang/Object=fr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValueleftBasePositionIrightBasePositionleftNucleotideLjava/lang/String;rightNucleotideorigin9Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin;()VCode      _    LineNumberTableLocalVariableTablethis2Lfr/orsay/lri/varna/models/treealign/RNANodeValue; getOrigin;()Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; setOrigin<(Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin;)VcomesFromAnHelixgetLeftNucleotide()Ljava/lang/String;setLeftNucleotide(Ljava/lang/String;)VgetRightNucleotidesetRightNucleotidegetLeftBasePosition()IsetLeftBasePosition(I)VgetRightBasePositionsetRightBasePositiontoGraphvizNodeName 798java/lang/String :;equals(Ljava/lang/Object;)Z = >*toString @BAjava/lang/Integer >C(I)Ljava/lang/String;Ejava/lang/StringBuilderG( DI , DK LMappend(I)Ljava/lang/StringBuilder;O, DQ LR-(Ljava/lang/String;)Ljava/lang/StringBuilder;T) D= W 5* SourceFileRNANodeValue.java InnerClasses\7fr/orsay/lri/varna/models/treealign/RNANodeValue$OriginOrigin!     b ******  !!  "#$%/* $! "#&'>*+ '(!"#()*/* -! "#+,>*+ 01!"# -*/* 3! "#.,>*+ 67!"# /0/* 9! "#12>* <=!"#30/* ?! "#42>* BC!"# 5**6V*6E***<*?DYFH*JNP*JSPU*DYFH*PNP*PSPU & F GH I(J-L5OZR_U! "#>*/*V [! "#XYZ []@PK 'k=Sɮ 5fr/orsay/lri/varna/models/treealign/RNANodeValue.javapackage fr.orsay.lri.varna.models.treealign; /** * We use the following convention: If the node is marked by a couple (n,m) * these integers are stored in leftBasePosition and rightBasePosition * (ie. we have a pair of bases), if only * one value is present, it is stored in leftBasePosition and rightBasePosition * contains -1 (ie. we have a non-paired base). * The right and left nucleotides follow the same rule, but are optional, * and '_' is used as undefined instead of -1. * Note that it is part of the contract of this class that default * values are -1 and _. * * @author Raphael Champeimont */ public class RNANodeValue implements GraphvizDrawableNodeValue { private int leftBasePosition = -1; private int rightBasePosition = -1; private String leftNucleotide = "_"; private String rightNucleotide = "_"; public enum Origin { BASE_PAIR_FROM_HELIX, BASE_FROM_HELIX_STRAND5, BASE_FROM_HELIX_STRAND3, BASE_FROM_UNPAIRED_REGION; } /** * Used to store the origin of this base / base pair. */ private Origin origin = null; public Origin getOrigin() { return origin; } public void setOrigin(Origin comesFromAnHelix) { this.origin = comesFromAnHelix; } public String getLeftNucleotide() { return leftNucleotide; } public void setLeftNucleotide(String leftNucleotide) { this.leftNucleotide = leftNucleotide; } public String getRightNucleotide() { return rightNucleotide; } public void setRightNucleotide(String rightNucleotide) { this.rightNucleotide = rightNucleotide; } public int getLeftBasePosition() { return leftBasePosition; } public void setLeftBasePosition(int leftBasePosition) { this.leftBasePosition = leftBasePosition; } public int getRightBasePosition() { return rightBasePosition; } public void setRightBasePosition(int rightBasePosition) { this.rightBasePosition = rightBasePosition; } public String toGraphvizNodeName() { if (rightNucleotide.equals("_")) { if (leftNucleotide.equals("_")) { if (rightBasePosition == -1) { if (leftBasePosition == -1) { return super.toString(); } else { return Integer.toString(leftBasePosition); } } else { return "(" + leftBasePosition + "," + rightBasePosition + ")"; } } else { return leftNucleotide; } } else { return "(" + leftNucleotide + "," + rightNucleotide + ")"; } } public String toString() { return toGraphvizNodeName(); } } PK 3F>@yPQQ:fr/orsay/lri/varna/models/treealign/ExampleDistance2.class144fr/orsay/lri/varna/models/treealign/ExampleDistance2java/lang/ObjectCfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceSymmetric()VCode  LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/models/treealign/ExampleDistance2;fi(Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;)D 1fr/orsay/lri/varna/models/treealign/RNANodeValue2  isSingleNode()Z  getNodes()Ljava/util/List; java/util/List !size()I@ %'&java/lang/Math ()abs(I)Iv13Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;v2'(Ljava/lang/Object;Ljava/lang/Object;)D /  SourceFileExampleDistance2.java SignatureLjava/lang/Object;Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceSymmetric;! /*    +,,,"+>,+,,+d$+`,",,` F    '+6=Ubfj q!~# *+,+A- - *+,.  0123PK oq { public double f(RNANodeValue2 v1, RNANodeValue2 v2) { if (v1 == null) { if (v2 == null) { return 0; } else if (!v2.isSingleNode()) { // v2 is a list of bases return v2.getNodes().size(); } else { // v2 is a single node return 2; } } else if (!v1.isSingleNode()) { // v1 is a list of bases if (v2 == null) { return v1.getNodes().size(); } else if (!v2.isSingleNode()) { // v2 is a list of bases return Math.abs(v2.getNodes().size() - v1.getNodes().size()); } else { // v2 is a single node return 2 + v1.getNodes().size(); } } else { // v1 is a single node // all the same as when v1 == null if (v2 == null) { return 2; } else if (!v2.isSingleNode()) { // v2 is a list of bases return 2 + v2.getNodes().size(); } else { // v2 is a single node return 0; } } } } PK 3F>L++;fr/orsay/lri/varna/models/treealign/TreeAlign$Aligner.class1 5fr/orsay/lri/varna/models/treealign/TreeAlign$Alignerjava/lang/Object treeData18Lfr/orsay/lri/varna/models/treealign/TreeAlign$TreeData; Signature`Lfr/orsay/lri/varna/models/treealign/TreeAlign.TreeData; treeData2`Lfr/orsay/lri/varna/models/treealign/TreeAlign.TreeData;DF1[[[[FDF2 DF1Decisions1[[[[B DF1Decisions2[[[[S DF2Decisions1 DF2Decisions2DT[[F DTDecisions1[[B DTDecisions2[[SDLDET1[FDET2DEF1DEF2this$0/Lfr/orsay/lri/varna/models/treealign/TreeAlign;computeAlignmentP1 (IIIIIII)VCode )  +-,6fr/orsay/lri/varna/models/treealign/TreeAlign$TreeData ./children[[I 1  3  5  8  : +< =>degrees[I @  +B CDsizeI F H  J  L  N LineNumberTableLocalVariableTablethis7Lfr/orsay/lri/varna/models/treealign/TreeAlign$Aligner;ism_ijtn_jDFxDFL DFLDecisions1 DFLDecisions2i_sj_tpqi_pj_qminF decision1 decision2 minCandidatebest_kkdalign()F Exceptionso6fr/orsay/lri/varna/models/treealign/TreeAlignExceptionq@fr/orsay/lri/varna/models/treealign/TreeAlign$ConvertTreeToArray s ! pu vwj(Lfr/orsay/lri/varna/models/treealign/TreeAlign;Lfr/orsay/lri/varna/models/treealign/TreeAlign$TreeData;)V py z{convert()V }         -fr/orsay/lri/varna/models/treealign/TreeAlign access$0w(Lfr/orsay/lri/varna/models/treealign/TreeAlign;)Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric; Dfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric f'(Ljava/lang/Object;Ljava/lang/Object;)D + values[Ljava/lang/Object;  "#best_rr(Lfr/orsay/lri/varna/models/treealign/TreeAlign;Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/treealign/Tree;)Vs(Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/treealign/Tree;)V  v{ +u + tree*Lfr/orsay/lri/varna/models/treealign/Tree;T1T2LocalVariableTypeTable8Lfr/orsay/lri/varna/models/treealign/Tree;8Lfr/orsay/lri/varna/models/treealign/Tree;computeForestAlignment(IIIIII)Ljava/util/List;(IIIIII)Ljava/util/List;>;>;java/util/ArrayList   treeInserted-(I)Lfr/orsay/lri/varna/models/treealign/Tree; java/util/List add(Ljava/lang/Object;)Z   treeDeletedjava/lang/Error1TreeAlignSymmetric bug: both s and t are non-zero v(Ljava/lang/String;)V   computeTreeAlignment.(II)Lfr/orsay/lri/varna/models/treealign/Tree;(fr/orsay/lri/varna/models/treealign/Tree /fr/orsay/lri/varna/models/treealign/AlignedNode  setLeftNode-(Lfr/orsay/lri/varna/models/treealign/Tree;)V + nodes+[Lfr/orsay/lri/varna/models/treealign/Tree;  setRightNode setValue(Ljava/lang/Object;)V replaceChildrenListBy(Ljava/util/List;)Vjava/lang/StringBuilderTreeAlign: decision1 = append(I)Ljava/lang/StringBuilder; toString()Ljava/lang/String;resultLjava/util/List; insertedNodeinsertedNodeValue1Lfr/orsay/lri/varna/models/treealign/AlignedNode; deletedNodedeletedNodeValueLjava/util/List;>;>;wLfr/orsay/lri/varna/models/treealign/Tree;>;KLfr/orsay/lri/varna/models/treealign/AlignedNode;z(I)Lfr/orsay/lri/varna/models/treealign/Tree;>;  getChildren()Ljava/util/List;root alignedNode{(II)Lfr/orsay/lri/varna/models/treealign/Tree;>; TreeAlign: DTDecisions1[i][j] = computeAlignment,()Lfr/orsay/lri/varna/models/treealign/Tree;y()Lfr/orsay/lri/varna/models/treealign/Tree;>; SourceFileTreeAlign.java InnerClassesAlignerConvertTreeToArrayTreeData      !"#$/d`d`%:2 Qd`d`&: d`d`': *(*2.6 *0*2.6 6 , d`2 d20*2*(*2 .0bQ  6 /2 d`2 d0*4*0*2 .0bQ  6 *(*2 .66*0*2.66866 d2d`0*20b8 86 d`2d0*40b8 86 d2d0*720b8 866866Md2d0*92*(*2.2 d`2*0;.0b8 86 *?*(A20b88666866N d2d0*E2*0*2.2*(;.2d`0b8 86*?2*0A0b8866 d`2d`Q  d`2d`T  d`2d`V  **92 S*G2  S*I2  S$*E2 S*K2  S*M2  SO.K+ =#R$j&p'&*+*./0134 5 9&:.;2<5BNCVDZE]LuKwMNOWXYZ[Z\]^Yabcde klmn&oNnQpYq]ramkuvwxy}~0. #.PL!/QR/SD/TD/UD/VD/WD/XD/YDZ+[ =\ R]D j^D m2_D 6`D _D aD`DbDcd eD fD&gdNgdwgdgd~hDTiDjdgdhDUiDQjdklmn$ pY*r*(txpY*r*0tx**(A*0A%7**(A*0A&|**(A*0A'~**(A`*0A`%?**(A2**0A4**(A**0A**(A*0AE**(A*0AK**(A*0AM**0A*(A9**0A*(AG**0A*(AI*?*(A2*0A*rQ<}*(;.=* Q>*\0*2*(*2.0bQ*?2*0A*r*(2Q*2*0*?2*0A0bQ*(A~<}*0;.=* Q>*\0*4*0*2.0bQ*?*(A2*r*02Q*4*0*?*(A20bQ*0A~<*(;.=>*0;.6*?2*r*(2*02Q6*6**726Q6866=*72*0*2.0*4*0*2.0f8 86*40b8*720!*72Q*|2T*~2V6866=*7*(*2.20*2*(*2.0f8 86*20b8*720!*72Q*|2T*~2V*E2*0*2.2208&*92*(*2.2208 8*?20b8*720*72Q*|2T*0A*(A*7*(Ad2*0Ad0OVU$:Pf "8[`jqv!Faot~,48<FQ_ir}"&BER`js PQR]SDjmUDs$iDVDmXD$iDqSD~UDVDXDTDWDgd~DDD,jdgd}DCDjdgd?gdE.gdv$4*+r**+Y+(*(,*+Y+0*0-O +P 4QR4444$d d9Y:6**0*2.Wd6Y:6**(*2.WN*K2*0*2.2d`2d`36*M2*0*2.2d`2d`56[L*G2*(*2.2d`2d`36*I2*(*2.2d`2d`56 Y"Mz.*d:  **(*2.W *d:  **0*2.W *dd:  **(*2.*0*2.ŹW *dd: *0*2.6 Y: Y:   *0 2   * *0; .dö  W *dd: *(*2.6 Y: Y:  *( 2    * *(; .dö  W YYO60: ="F#O$U%m$v'y*},+.-/10325 7D;U<l=oBCDIJKPRST UV W'YC[M]PbcdpeyfghikmorPQRSDTD_DVDWD`D-&iDO*R$iD'eD&eD eDiDiD iDU  ' f WbD N  E cf pYaD yP G p -O*U  ' f N  E cf yP G $ZYMYN-*(2-,-6 ,**(*2.W*(;.,O& }~"'-GXP4ZQRZSDRJ*.DRJ$ZYMYN--*02,-6 ,**0*2.W*0;.,O& "'-GXP4ZQRZVDRJ*.DRJ$*|23.YNY:*02-6K*~25!-**0*2.ŹW-**0*2.W*0;.-YNY:*(2-6K*~25!-**(*2.ŹW-**(*2.W*(;.-YNY:*(2*02-**(;.d*0;.d:--YY*|23O!$,5;IOUb #46>GUciPz QRSDVD,5xRYDxYD>SGJ.H,5xx>SGJ.$A**(Ad*0AdŰOP QR p + PK 3F>FĮU U Ffr/orsay/lri/varna/models/treealign/TreeAlign$ConvertTreeToArray.class1|@fr/orsay/lri/varna/models/treealign/TreeAlign$ConvertTreeToArrayjava/lang/Object nextNodeIndexItreeData8Lfr/orsay/lri/varna/models/treealign/TreeAlign$TreeData; Signature_Lfr/orsay/lri/varna/models/treealign/TreeAlign.TreeData;this$0/Lfr/orsay/lri/varna/models/treealign/TreeAlign;j(Lfr/orsay/lri/varna/models/treealign/TreeAlign;Lfr/orsay/lri/varna/models/treealign/TreeAlign$TreeData;)Vb(Lfr/orsay/lri/varna/models/treealign/TreeAlign.TreeData;)VCode   ()V    LineNumberTableLocalVariableTablethisBLfr/orsay/lri/varna/models/treealign/TreeAlign$ConvertTreeToArray;LocalVariableTypeTableiLfr/orsay/lri/varna/models/treealign/TreeAlign.ConvertTreeToArray;convertTreeToArrayAux0(Lfr/orsay/lri/varna/models/treealign/Tree;[II)V Exceptions$6fr/orsay/lri/varna/models/treealign/TreeAlignException=(Lfr/orsay/lri/varna/models/treealign/Tree;[II)V ')((fr/orsay/lri/varna/models/treealign/Tree *+ getChildren()Ljava/util/List; -/.java/util/List 01size()I -3 45iterator()Ljava/util/Iterator; 798java/util/Iterator :;next()Ljava/lang/Object; = ! 7? @AhasNext()Z CED6fr/orsay/lri/varna/models/treealign/TreeAlign$TreeData Fdegree CH IJnodes+[Lfr/orsay/lri/varna/models/treealign/Tree; CL MNdegrees[I 'P Q;getValue CS TUvalues[Ljava/lang/Object; CW XYchildren[[Isubtree*Lfr/orsay/lri/varna/models/treealign/Tree;siblingIndexes siblingNumberLjava/util/List;numberOfChildrenchildrenIndexesmyIndexichildvLjava/lang/Object;7Lfr/orsay/lri/varna/models/treealign/Tree;ILjava/util/List;>; TValueType;convert Ck l[tree 'n o1 countNodes Cq 0N rootIndex SourceFileTreeAlign.java0Ljava/lang/Object; InnerClassesy-fr/orsay/lri/varna/models/treealign/TreeAlignConvertTreeToArrayTreeData      p*+***,db _c  !"# % +&:,6 :662:  6': * < >*B *B*6*Y`*G+S*KO+O:*RS,O*VSRklmnpq3r=s@qJwVx_{e|o}zp Z[\N]X^_`Na/b3 c[ de4ZfXg3 cf dhi"#n*B**jmp**p'G**prV**p K**pR L**j+<& *;K\`mn`sN ntu vwxzCx{PK 3F>%pp<fr/orsay/lri/varna/models/treealign/TreeAlign$TreeData.class146fr/orsay/lri/varna/models/treealign/TreeAlign$TreeDatajava/lang/Objecttree*Lfr/orsay/lri/varna/models/treealign/Tree; Signature7Lfr/orsay/lri/varna/models/treealign/Tree;sizeIdegreedegrees[Inodes+[Lfr/orsay/lri/varna/models/treealign/Tree;8[Lfr/orsay/lri/varna/models/treealign/Tree;children[[Ivalues[Ljava/lang/Object; [TValueType;this$0/Lfr/orsay/lri/varna/models/treealign/TreeAlign;2(Lfr/orsay/lri/varna/models/treealign/TreeAlign;)VCode    ()V ! # LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/models/treealign/TreeAlign$TreeData;LocalVariableTypeTable_Lfr/orsay/lri/varna/models/treealign/TreeAlign.TreeData;j(Lfr/orsay/lri/varna/models/treealign/TreeAlign;Lfr/orsay/lri/varna/models/treealign/TreeAlign$TreeData;)V ,  SourceFileTreeAlign.java0Ljava/lang/Object; InnerClasses2-fr/orsay/lri/varna/models/treealign/TreeAlignTreeData    X*+** *"$ &,% &'( &)*&*++$%-./0 13PK 3F>.GG3fr/orsay/lri/varna/models/treealign/TreeAlign.class1-fr/orsay/lri/varna/models/treealign/TreeAlignjava/lang/Object labelDistFLfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric; Signature`Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric;I(Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric;)Vc(Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric;)VCode  ()V  LineNumberTableLocalVariableTablethis/Lfr/orsay/lri/varna/models/treealign/TreeAlign;LocalVariableTypeTableILfr/orsay/lri/varna/models/treealign/TreeAlign;align(Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/treealign/TreeAlignResult; Exceptions6fr/orsay/lri/varna/models/treealign/TreeAlignException(Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;3fr/orsay/lri/varna/models/treealign/TreeAlignResult "5fr/orsay/lri/varna/models/treealign/TreeAlign$Aligner !$ %(Lfr/orsay/lri/varna/models/treealign/TreeAlign;Lfr/orsay/lri/varna/models/treealign/Tree;Lfr/orsay/lri/varna/models/treealign/Tree;)V !' (()F * +, setDistance(D)V !. /0computeAlignment,()Lfr/orsay/lri/varna/models/treealign/Tree; 2 34 setAlignment-(Lfr/orsay/lri/varna/models/treealign/Tree;)VT1*Lfr/orsay/lri/varna/models/treealign/Tree;T2result5Lfr/orsay/lri/varna/models/treealign/TreeAlignResult;aligner7Lfr/orsay/lri/varna/models/treealign/TreeAlign$Aligner;8Lfr/orsay/lri/varna/models/treealign/Tree;8Lfr/orsay/lri/varna/models/treealign/Tree;OLfr/orsay/lri/varna/models/treealign/TreeAlignResult;QLfr/orsay/lri/varna/models/treealign/TreeAlign.Aligner;distanceFromAlignment-(Lfr/orsay/lri/varna/models/treealign/Tree;)Fz(Lfr/orsay/lri/varna/models/treealign/Tree;>;)F DFE(fr/orsay/lri/varna/models/treealign/Tree GHgetValue()Ljava/lang/Object;J/fr/orsay/lri/varna/models/treealign/AlignedNode IL M0 getLeftNode IO P0 getRightNode RTSDfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric UVf'(Ljava/lang/Object;Ljava/lang/Object;)D DX YZ getChildren()Ljava/util/List; \^]java/util/List _`iterator()Ljava/util/Iterator; bdcjava/util/Iterator eHnext g @A bi jkhasNext()Z alignmentoriginalT1NodeoriginalT2NodedFchildwLfr/orsay/lri/varna/models/treealign/Tree;>;access$0w(Lfr/orsay/lri/varna/models/treealign/TreeAlign;)Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric; SourceFileTreeAlign.javaNLjava/lang/Object; InnerClassesAligner{@fr/orsay/lri/varna/models/treealign/TreeAlign$ConvertTreeToArrayConvertTreeToArray~6fr/orsay/lri/varna/models/treealign/TreeAlign$TreeDataTreeData!  b * *+XY Z     )Y N!Y*+,#:-&)--1-'4))56)76!89:;4))5<)7=!8>:?@AB &l+CIKM+CINN*, ,C- -CQ8+W[:aD:*fb8h*  &2:T_i>lll6 am6Vn6:2opT q64lllr am<Vn=T qrst %*Juvwx!yz|}PK oq<΅aa2fr/orsay/lri/varna/models/treealign/TreeAlign.javapackage fr.orsay.lri.varna.models.treealign; import java.util.*; /** * Tree alignment algorithm. * This class implements the tree alignment algorithm * for ordered trees explained in article: * T. Jiang, L. Wang, K. Zhang, * Alignment of trees - an alternative to tree edit, * Theoret. Comput. Sci. 143 (1995). * Other references: * - Claire Herrbach, Alain Denise and Serge Dulucq. * Average complexity of the Jiang-Wang-Zhang pairwise tree alignment * algorithm and of a RNA secondary structure alignment algorithm. * Theoretical Computer Science 411 (2010) 2423-2432. * * Our implementation supposes that the trees will never have more * than 32000 nodes and that the total distance will never require more * significant digits that a float (single precision) has. * * @author Raphael Champeimont * @param The type of values on nodes in the first tree. * @param The type of values on nodes in the second tree. */ public class TreeAlign { private class TreeData { /** * The tree. */ public Tree tree; /** * The tree size (number of nodes). */ public int size = -1; /** * The number of children of a node is called the node degree. * This variable is the maximum node degree in the tree. */ public int degree = -1; /** * The number of children of a node is called the node degree. * degree[i] is the degree of node i, with i being an index in nodes. */ public int[] degrees; /** * The trees as an array of its nodes (subtrees rooted at each node * in fact), in postorder. */ public Tree[] nodes; /** * children[i] is the array of children (as indexes in nodes) * of i (an index in nodes) */ public int[][] children; /** * Values of nodes. */ public ValueType[] values; } /** * The distance function between labels. */ private TreeAlignLabelDistanceAsymmetric labelDist; /** * Create a TreeAlignSymmetric object, which can align trees. * The distance function will be called only once on every pair * of nodes. The result is then kept in a matrix, so you need not manage * yourself a cache of f(value1, value2). * Note that it is permitted to have null values on nodes, * so comparing a node with a non-null value with a node with a null * value will give the same cost as to insert the first node. * This can be useful if you tree has "fake" nodes. * @param labelDist The label distance. */ public TreeAlign(TreeAlignLabelDistanceAsymmetric labelDist) { this.labelDist = labelDist; } private class ConvertTreeToArray { private int nextNodeIndex = 0; private TreeData treeData; public ConvertTreeToArray(TreeData treeData) { this.treeData = treeData; } private void convertTreeToArrayAux( Tree subtree, int[] siblingIndexes, int siblingNumber) throws TreeAlignException { // We want it in postorder, so first we put the children List> children = subtree.getChildren(); int numberOfChildren = children.size(); int[] childrenIndexes = new int[numberOfChildren]; int myIndex = -1; { int i = 0; for (Tree child: children) { convertTreeToArrayAux(child, childrenIndexes, i); i++; } } // Compute the maximum degree if (numberOfChildren > treeData.degree) { treeData.degree = numberOfChildren; } // Now we add the node (root of the given subtree). myIndex = nextNodeIndex; nextNodeIndex++; treeData.nodes[myIndex] = subtree; // Record how many children I have treeData.degrees[myIndex] = numberOfChildren; // Store my value in an array ValueType v = subtree.getValue(); treeData.values[myIndex] = v; // Tell the caller my index siblingIndexes[siblingNumber] = myIndex; // Record my children indexes treeData.children[myIndex] = childrenIndexes; } /** * Reads: treeData.tree * Computes: treeData.nodes, treeData.degree, treeData.degrees * treeData.fathers, treeData.children, treeData.size, * treeData.values * Converts a tree to an array of nodes, in postorder. * We also compute the maximum node degree in the tree. * @throws TreeAlignException */ @SuppressWarnings("unchecked") public void convert() throws TreeAlignException { treeData.degree = 0; treeData.size = treeData.tree.countNodes(); // we didn't write new Tree[treeData.size] because // java does not support generics with arrays treeData.nodes = new Tree[treeData.size]; treeData.children = new int[treeData.size][]; treeData.degrees = new int[treeData.size]; treeData.values = (ValueType[]) new Object[treeData.size]; int rootIndex[] = new int[1]; convertTreeToArrayAux(treeData.tree, rootIndex, 0); } } /** * For arrays that take at least O(|T1|*|T2|) we take care * not to use too big data types. */ private class Aligner { /** * The first tree. */ private TreeData treeData1; /** * The second tree. */ private TreeData treeData2; /** * DF1[i][j_t] is DFL for (i,j,s,t) with s=0. * See description of DFL in Aligner.computeAlignmentP1(). * DF1 and DF2 are the "big" arrays, ie. those that may the space * complexity what it is. */ private float[][][][] DF1; /** * DF2[j][i_s] is DFL for (i,j,s,t) with t=0. * See description of DFL in Aligner.computeAlignmentP1(). */ private float[][][][] DF2; /** * This arrays have the same shape as respectively DF1. * They are used to remember which term in the minimum won, so that * we can compute the alignment. * Decision1 is a case number (< 10) * and Decision2 is a child index, hence the types. */ private byte[][][][] DF1Decisions1; private short[][][][] DF1Decisions2; /** * This arrays have the same shape as respectively DF2. * They are used to remember which term in the minimum won, so that * we can compute the alignment. */ private byte[][][][] DF2Decisions1; private short[][][][] DF2Decisions2; /** * Distances between subtrees. * DT[i][j] is the distance between the subtree rooted at i in the first tree * and the subtree rooted at j in the second tree. */ private float[][] DT; /** * This array has the same shape as DT, but is used to remember which * case gave the minimum, so that we can later compute the alignment. */ private byte[][] DTDecisions1; private short[][] DTDecisions2; /** * Distances between labels. * DL[i][j] is the distance labelDist.f(value(T1[i]), value(T2[i])). * By convention, we say that value(T1[|T1|]) = null * and value(T2[|T2|]) = null */ private float[][] DL; /** * DET1[i] is the distance between the empty tree and T1[i] * (the subtree rooted at node i in the first tree). */ private float[] DET1; /** * Same as DET1, but for second tree. */ private float[] DET2; /** * DEF1[i] is the distance between the empty forest and F1[i] * (the forest of children of node i in the first tree). */ private float[] DEF1; /** * Same as DEF1, but for second tree. */ private float[] DEF2; /** * @param i node in T1 * @param s number of first child of i to consider * @param m_i degree of i * @param j node in T2 * @param t number of first child of j to consider * @param n_j degree of j * @param DFx which array to fill (DF1 or DF2) */ private void computeAlignmentP1(int i, int s, int m_i, int j, int t, int n_j, int DFx) { /** * DFL[pr][qr] is D(F1[i_s, i_p], F2[j_t, j_q]) * where p=s+pr-1 and q=t+qr-1 (ie. pr=p-s+1 and qr=q-t+1) * By convention, F1[i_s, i_{s-1}] and F2[j_t, j_{t-1}] are the * empty forests. * Said differently, DFL[pr][qr] is the distance between the forest * of the pr first children of i, starting with child s * (first child is s = 0), and the forest of the qr first children * of j, starting with child t (first child is t = 0). * This array is allocated for a fixed value of (i,j,s,t). */ float[][] DFL; /** * Same shape as DFL, but to remember which term gave the min, * so that we can later compute the alignment. */ byte[][] DFLDecisions1; short[][] DFLDecisions2; DFL = new float[m_i-s+2][n_j-t+2]; DFL[0][0] = 0; // D(empty forest, empty forest) = 0 DFLDecisions1 = new byte[m_i-s+2][n_j-t+2]; DFLDecisions2 = new short[m_i-s+2][n_j-t+2]; // Compute indexes of i_s and j_t because we will need them int i_s = m_i != 0 ? treeData1.children[i][s] : -1; int j_t = n_j != 0 ? treeData2.children[j][t] : -1; for (int p=s; p(treeData1)).convert(); (new ConvertTreeToArray(treeData2)).convert(); // Allocate necessary arrays DT = new float[treeData1.size][treeData2.size]; DTDecisions1 = new byte[treeData1.size][treeData2.size]; DTDecisions2 = new short[treeData1.size][treeData2.size]; DL = new float[treeData1.size+1][treeData2.size+1]; DET1 = new float[treeData1.size]; DET2 = new float[treeData2.size]; DEF1 = new float[treeData1.size]; DEF2 = new float[treeData2.size]; DF1 = new float[treeData1.size][treeData2.size][][]; DF1Decisions1 = new byte[treeData1.size][treeData2.size][][]; DF1Decisions2 = new short[treeData1.size][treeData2.size][][]; DF2 = new float[treeData2.size][treeData1.size][][]; DF2Decisions1 = new byte[treeData2.size][treeData1.size][][]; DF2Decisions2 = new short[treeData2.size][treeData1.size][][]; DL[treeData1.size][treeData2.size] = (float) labelDist.f(null, null); for (int i=0; i T1, Tree T2) { treeData1 = new TreeData(); treeData1.tree = T1; treeData2 = new TreeData(); treeData2.tree = T2; } /** Align F1[i_s,i_p] with F2[j_t,j_q]. * If p = s-1, by convention it means F1[i_s,i_p] = empty forest. * Idem for q=t-1. */ private List>> computeForestAlignment(int i, int s, int p, int j, int t, int q) { if (p == s-1) { // left forest is the empty forest List>> result = new ArrayList>>(); for (int k=t; k<=q; k++) { result.add(treeInserted(treeData2.children[j][k])); } return result; } else { if (q == t-1) { // right forest is the empty forest List>> result = new ArrayList>>(); for (int k=s; k<=p; k++) { result.add(treeDeleted(treeData1.children[i][k])); } return result; } else { // both forests are non-empty int decision1, k; if (s == 0) { decision1 = DF1Decisions1 [i] [treeData2.children[j][t]] [p-s+1] [q-t+1]; k = DF1Decisions2 [i] [treeData2.children[j][t]] [p-s+1] [q-t+1]; } else if (t == 0) { decision1 = DF2Decisions1 [j] [treeData1.children[i][s]] [p-s+1] [q-t+1]; k = DF2Decisions2 [j] [treeData1.children[i][s]] [p-s+1] [q-t+1]; } else { throw (new Error("TreeAlignSymmetric bug: both s and t are non-zero")); } switch (decision1) { case 1: { List>> result; result = computeForestAlignment(i, s, p-1, j, t, q); result.add(treeDeleted(treeData1.children[i][p])); return result; } case 2: { List>> result; result = computeForestAlignment(i, s, p, j, t, q-1); result.add(treeInserted(treeData2.children[j][q])); return result; } case 3: { List>> result; result = computeForestAlignment(i, s, p-1, j, t, q-1); result.add(computeTreeAlignment(treeData1.children[i][p], treeData2.children[j][q])); return result; } case 4: { List>> result; result = computeForestAlignment(i, s, k-1, j, t, q-1); int j_q = treeData2.children[j][q]; Tree> insertedNode = new Tree>(); AlignedNode insertedNodeValue = new AlignedNode(); insertedNodeValue.setLeftNode(null); insertedNodeValue.setRightNode((Tree) treeData2.nodes[j_q]); insertedNode.setValue(insertedNodeValue); insertedNode.replaceChildrenListBy(computeForestAlignment(i, k, p, j_q, 0, treeData2.degrees[j_q]-1)); result.add(insertedNode); return result; } case 5: { List>> result; result = computeForestAlignment(i, s, p-1, j, t, k-1); int i_p = treeData1.children[i][p]; Tree> deletedNode = new Tree>(); AlignedNode deletedNodeValue = new AlignedNode(); deletedNodeValue.setLeftNode((Tree) treeData1.nodes[i_p]); deletedNodeValue.setRightNode(null); deletedNode.setValue(deletedNodeValue); deletedNode.replaceChildrenListBy(computeForestAlignment(i_p, 0, treeData1.degrees[i_p]-1, j, k, q)); result.add(deletedNode); return result; } default: throw (new Error("TreeAlign: decision1 = " + decision1)); } } } } /** * Align T1[i] with the empty tree. * @return the alignment */ private Tree> treeDeleted(int i) { Tree> root = new Tree>(); AlignedNode alignedNode = new AlignedNode(); alignedNode.setLeftNode(treeData1.nodes[i]); alignedNode.setRightNode(null); root.setValue(alignedNode); for (int r = 0; r> treeInserted(int j) { Tree> root = new Tree>(); AlignedNode alignedNode = new AlignedNode(); alignedNode.setLeftNode(null); alignedNode.setRightNode(treeData2.nodes[j]); root.setValue(alignedNode); for (int r = 0; r> computeTreeAlignment(int i, int j) { switch (DTDecisions1[i][j]) { case 1: { Tree> root = new Tree>(); // Compute the value of the node AlignedNode alignedNode = new AlignedNode(); alignedNode.setLeftNode(null); alignedNode.setRightNode(treeData2.nodes[j]); root.setValue(alignedNode); // Compute the children for (int r = 0; r> root = new Tree>(); // Compute the value of the node AlignedNode alignedNode = new AlignedNode(); alignedNode.setLeftNode(treeData1.nodes[i]); alignedNode.setRightNode(null); root.setValue(alignedNode); // Compute the children for (int r = 0; r> root = new Tree>(); // Compute the value of the node AlignedNode alignedNode = new AlignedNode(); alignedNode.setLeftNode(treeData1.nodes[i]); alignedNode.setRightNode(treeData2.nodes[j]); root.setValue(alignedNode); // Compute the children List>> children = computeForestAlignment(i, 0, treeData1.degrees[i]-1, j, 0, treeData2.degrees[j]-1); root.replaceChildrenListBy(children); return root; } default: throw (new Error("TreeAlign: DTDecisions1[i][j] = " + DTDecisions1[i][j])); } } public Tree> computeAlignment() { return computeTreeAlignment(treeData1.size-1, treeData2.size-1); } } /** * Align T1 with T2, computing both the distance and the alignment. * Time: O(|T1|*|T2|*(deg(T1)+deg(T2))^2) * Space: O(|T1|*|T2|*(deg(T1)+deg(T2))) * Average (over possible trees) time: O(|T1|*|T2|) * @param T1 The first tree. * @param T2 The second tree. * @return The distance and the alignment. * @throws TreeAlignException */ public TreeAlignResult align(Tree T1, Tree T2) throws TreeAlignException { TreeAlignResult result = new TreeAlignResult(); Aligner aligner = new Aligner(T1, T2); result.setDistance(aligner.align()); result.setAlignment(aligner.computeAlignment()); return result; } /** * Takes a alignment, and compute the distance between the two * original trees. If you have called align(), the result object already * contains the distance D and the alignment A. If you call * distanceFromAlignment on the alignment A it will compute the distance D. */ public float distanceFromAlignment(Tree> alignment) { Tree originalT1Node; Tree originalT2Node; originalT1Node = alignment.getValue().getLeftNode(); originalT2Node = alignment.getValue().getRightNode(); float d = (float) labelDist.f( originalT1Node != null ? originalT1Node.getValue() : null, originalT2Node != null ? originalT2Node.getValue() : null); for (Tree> child: alignment.getChildren()) { d += distanceFromAlignment(child); } return d; } } PK 3F>5<fr/orsay/lri/varna/models/treealign/TreeAlignException.class16fr/orsay/lri/varna/models/treealign/TreeAlignExceptionjava/lang/ExceptionserialVersionUIDJ ConstantValuel47G(Ljava/lang/String;)VCode  LineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/models/treealign/TreeAlignException;messageLjava/lang/String; SourceFileTreeAlignException.java!  >*+    PK oq<\;fr/orsay/lri/varna/models/treealign/TreeAlignException.javapackage fr.orsay.lri.varna.models.treealign; /** * @author Raphael Champeimont * */ public class TreeAlignException extends Exception { private static final long serialVersionUID = 7782935062930780231L; public TreeAlignException(String message) { super(message); } } PK 3F>l Bfr/orsay/lri/varna/models/treealign/RNATree$ConvertToMapping.class1k()VCode  LineNumberTableLocalVariableTablethis>Lfr/orsay/lri/varna/models/treealign/RNATree$ConvertToMapping;convertS(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/rna/Mapping; Exceptions.fr/orsay/lri/varna/exceptions/MappingException Signature(Lfr/orsay/lri/varna/models/treealign/Tree;>;)Lfr/orsay/lri/varna/models/rna/Mapping;%fr/orsay/lri/varna/models/rna/Mapping     convertSubTree-(Lfr/orsay/lri/varna/models/treealign/Tree;)Vtree*Lfr/orsay/lri/varna/models/treealign/Tree;LocalVariableTypeTableLfr/orsay/lri/varna/models/treealign/Tree;>;(Lfr/orsay/lri/varna/models/treealign/Tree;>;)V &('(fr/orsay/lri/varna/models/treealign/Tree )*getValue()Ljava/lang/Object;,/fr/orsay/lri/varna/models/treealign/AlignedNode +. /0 getLeftNode,()Lfr/orsay/lri/varna/models/treealign/Tree; +2 30 getRightNode50fr/orsay/lri/varna/models/treealign/RNANodeValue 47 89getLeftBasePosition()I 4; <9getRightBasePosition > ?@ addCouple(II)V &B CD getChildren()Ljava/util/List; FHGjava/util/List IJiterator()Ljava/util/Iterator; LNMjava/util/Iterator O*next LQ RShasNext()Z alignedNode1Lfr/orsay/lri/varna/models/treealign/AlignedNode;leftNode rightNodev12Lfr/orsay/lri/varna/models/treealign/RNANodeValue;v2l1Ir1l2r2childLfr/orsay/lri/varna/models/treealign/AlignedNode;^Lfr/orsay/lri/varna/models/treealign/Tree;A(Lfr/orsay/lri/varna/models/treealign/RNATree$ConvertToMapping;)V   SourceFile RNATree.java InnerClassesi+fr/orsay/lri/varna/models/treealign/RNATreeConvertToMapping  /*  }  c*Y*+*    !"  #$  +%+M,-N,1:-a\-%4:%4:66:666 :6  * = * =+AE:K&:*P J %/6=DKU`ju z  !TU V!W!%PXY/FZY6?[\=8]\D1^\ K*_\ `!"4 #Ta VbWb`#c %*d } efg hj PK 3F>})?fr/orsay/lri/varna/models/treealign/RNATree$ConvertToTree.class19fr/orsay/lri/varna/models/treealign/RNATree$ConvertToTreejava/lang/Objectrna#Lfr/orsay/lri/varna/models/rna/RNA;iI toTreeAux-(I)Lfr/orsay/lri/varna/models/treealign/Tree; Signaturea(I)Lfr/orsay/lri/varna/models/treealign/Tree;Code(fr/orsay/lri/varna/models/treealign/Tree  ()V   getChildren()Ljava/util/List;  setValue(Ljava/lang/Object;)V   ! !fr/orsay/lri/varna/models/rna/RNA "#getSize()I %  ' () getBaseAt-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase; +-,(fr/orsay/lri/varna/models/rna/ModeleBase .#getElementStructure00fr/orsay/lri/varna/models/treealign/RNANodeValue / /3 45setLeftBasePosition(I)V /7 85setRightBasePosition :<;7fr/orsay/lri/varna/models/treealign/RNANodeValue$Origin =>BASE_PAIR_FROM_HELIX9Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin; /@ AB setOrigin<(Lfr/orsay/lri/varna/models/treealign/RNANodeValue$Origin;)VD2fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide CF GHget_c()Ljava/lang/String; /J KLsetLeftNucleotide(Ljava/lang/String;)V /N OLsetRightNucleotide Q SUTjava/util/List VWadd(Ljava/lang/Object;)Z :Y Z>BASE_FROM_UNPAIRED_REGION \ ]^ getAuxBPs(I)Ljava/util/ArrayList; `bajava/util/ArrayList cditerator()Ljava/util/Iterator; fhgjava/util/Iterator ijnext()Ljava/lang/Object;l+fr/orsay/lri/varna/models/rna/ModeleStyleBP kn op isCanonical()Z kr st getPartner5,()Lfr/orsay/lri/varna/models/rna/ModeleBase; Cv w#getIndex ky zt getPartner3 :| }>BASE_FROM_HELIX_STRAND5 : >BASE_FROM_HELIX_STRAND3 java/lang/System errLjava/io/PrintStream;java/lang/StringBuilderWarning: Base index is L append(I)Ljava/lang/StringBuilder;5 but neither endpoint matches it (edge endpoints are -(Ljava/lang/String;)Ljava/lang/StringBuilder; and ). HtoString java/io/PrintStream Lprintln f phasNextLineNumberTableLocalVariableTablethis;Lfr/orsay/lri/varna/models/treealign/RNATree$ConvertToTree;depthtree*Lfr/orsay/lri/varna/models/treealign/Tree;childrenLjava/util/List;lengthbase*Lfr/orsay/lri/varna/models/rna/ModeleBase;indexOfAssociatedBase childValue2Lfr/orsay/lri/varna/models/treealign/RNANodeValue;child auxBasePairsLjava/util/ArrayList; auxBasePair-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;partner5partner3LocalVariableTypeTable^Lfr/orsay/lri/varna/models/treealign/Tree;pLjava/util/List;>;DLjava/util/ArrayList;&(Lfr/orsay/lri/varna/models/rna/RNA;)V  SourceFile RNATree.java InnerClassesOrigin+fr/orsay/lri/varna/models/treealign/RNATree ConvertToTree    _ûYM,N,*6**$&:*6*$s/Y1:*$269?C$CEI*&CEM*Y$`$*`P:-RW *Y$`$Y:/Y1:*$2CCEIX?**$[:  _:  ek:  mw qCu6  xCu6 *$ {?I*$ ~?5Y*$   q-RW*Y$`$*$`,,+, .012+32475@7I8R9Y:a<i=v>@ABCFGKLMNOUVWX Y-Z:[C\N]W^b`Wfgh1l +2Ig | -g :Z 4   O**$*+o$ pq:/@ PK 3F>v1fr/orsay/lri/varna/models/treealign/RNATree.class17+fr/orsay/lri/varna/models/treealign/RNATreejava/lang/Object()VCode  LineNumberTableLocalVariableTablethis-Lfr/orsay/lri/varna/models/treealign/RNATree;RNATreeFromRNAO(Lfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/treealign/Tree; Signature(Lfr/orsay/lri/varna/models/rna/RNA;)Lfr/orsay/lri/varna/models/treealign/Tree;9fr/orsay/lri/varna/models/treealign/RNATree$ConvertToTree  &(Lfr/orsay/lri/varna/models/rna/RNA;)V   toTreeAux-(I)Lfr/orsay/lri/varna/models/treealign/Tree;rna#Lfr/orsay/lri/varna/models/rna/RNA; converter;Lfr/orsay/lri/varna/models/treealign/RNATree$ConvertToTree;mappingFromAlignmentS(Lfr/orsay/lri/varna/models/treealign/Tree;)Lfr/orsay/lri/varna/models/rna/Mapping; Exceptions#.fr/orsay/lri/varna/exceptions/MappingException(Lfr/orsay/lri/varna/models/treealign/Tree;>;)Lfr/orsay/lri/varna/models/rna/Mapping;&Lfr/orsay/lri/varna/models/treealign/RNATree$ConvertToMapping;LocalVariableTypeTableLfr/orsay/lri/varna/models/treealign/Tree;>; SourceFile RNATree.java InnerClassesConvertToMapping ConvertToTree!/*   GY*L+      !"$Y%Y'L+** y z -. /0 -1234%5 6 PK c*= OO0fr/orsay/lri/varna/models/treealign/RNATree.javapackage fr.orsay.lri.varna.models.treealign; import java.util.ArrayList; import java.util.List; import fr.orsay.lri.varna.exceptions.MappingException; import fr.orsay.lri.varna.models.rna.Mapping; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; /** * This class contains all functions that are specific to trees * (class Tree) of RNA. * * @author Raphael Champeimont * */ public class RNATree { /** * Convert an RNA object into a RNA tree. * The root node will have a null value because it is a fake * node added to have a tree (otherwise we would have a forest). */ public static Tree RNATreeFromRNA(RNA rna) { ConvertToTree converter = new ConvertToTree(rna); return converter.toTreeAux(0); } private static class ConvertToTree { private RNA rna; private int i = 0; /** Starts at the current position i in the sequence and converts the sequence * to a tree. * @return the created tree */ public Tree toTreeAux(int depth) { Tree tree = new Tree(); List> children = tree.getChildren(); // No value because it is a fake root tree.setValue(null); int length = rna.getSize(); while (i < length) { ModeleBase base = rna.getBaseAt(i); int indexOfAssociatedBase = base.getElementStructure(); if (indexOfAssociatedBase >= 0) { if (indexOfAssociatedBase > i) { // left parenthesis, we must analyze the children RNANodeValue childValue = new RNANodeValue(); childValue.setLeftBasePosition(i); childValue.setRightBasePosition(indexOfAssociatedBase); childValue.setOrigin(RNANodeValue.Origin.BASE_PAIR_FROM_HELIX); if (base instanceof ModeleBaseNucleotide) { childValue.setLeftNucleotide(((ModeleBaseNucleotide) base).get_c()); childValue.setRightNucleotide(((ModeleBaseNucleotide) rna.getBaseAt(indexOfAssociatedBase)).get_c()); } i++; Tree child = toTreeAux(depth+1); child.setValue(childValue); children.add(child); } else { // right parenthesis, we have finished analyzing the children i++; break; } } else { // we have a non-paired base Tree child = new Tree(); RNANodeValue childValue = new RNANodeValue(); childValue.setLeftBasePosition(i); if (base instanceof ModeleBaseNucleotide) { childValue.setLeftNucleotide(((ModeleBaseNucleotide) base).get_c()); } // Even in this case (getElementStructure() < 0) // this base may still come from an helix which may have // been broken to remove a pseudoknot. childValue.setOrigin(RNANodeValue.Origin.BASE_FROM_UNPAIRED_REGION); ArrayList auxBasePairs = rna.getAuxBPs(i); for (ModeleStyleBP auxBasePair: auxBasePairs) { if (auxBasePair.isCanonical()) { int partner5 = ((ModeleBaseNucleotide) auxBasePair.getPartner5()).getIndex(); int partner3 = ((ModeleBaseNucleotide) auxBasePair.getPartner3()).getIndex(); if (i == partner5) { childValue.setOrigin(RNANodeValue.Origin.BASE_FROM_HELIX_STRAND5); } else if (i == partner3) { childValue.setOrigin(RNANodeValue.Origin.BASE_FROM_HELIX_STRAND3); } else { System.err.println("Warning: Base index is " + i + " but neither endpoint matches it (edge endpoints are " + partner5 + " and " + partner3 + ")."); } } } child.setValue(childValue); children.add(child); i++; } } return tree; } public ConvertToTree(RNA rna) { this.rna = rna; } } /** * Convert an RNA tree alignment into a Mapping. */ public static Mapping mappingFromAlignment(Tree> alignment) throws MappingException { ConvertToMapping converter = new ConvertToMapping(); return converter.convert(alignment); } private static class ConvertToMapping { private Mapping m; public Mapping convert(Tree> tree) throws MappingException { m = new Mapping(); convertSubTree(tree); return m; } private void convertSubTree(Tree> tree) throws MappingException { AlignedNode alignedNode = tree.getValue(); Tree leftNode = alignedNode.getLeftNode(); Tree rightNode = alignedNode.getRightNode(); if (leftNode != null && rightNode != null) { RNANodeValue v1 = leftNode.getValue(); RNANodeValue v2 = rightNode.getValue(); int l1 = v1.getLeftBasePosition(); int r1 = v1.getRightBasePosition(); int l2 = v2.getLeftBasePosition(); int r2 = v2.getRightBasePosition(); if (l1 >= 0 && l2 >= 0) { m.addCouple(l1, l2); } if (r1 >= 0 && r2 >= 0) { m.addCouple(r1, r2); } } for (Tree> child: tree.getChildren()) { convertSubTree(child); } } } } PK 3F>Lm44Nfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult.class1)Hfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResultjava/lang/ObjectdistanceD alignment[[Ithis$06Lfr/orsay/lri/varna/models/treealign/ExampleDistance3;9(Lfr/orsay/lri/varna/models/treealign/ExampleDistance3;)VCode   ()VLineNumberTableLocalVariableTablethisJLfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult; getDistance()D   setDistance(D)V getAlignment()[[I   setAlignment([[I)V SourceFileExampleDistance3.java InnerClasses'4fr/orsay/lri/varna/models/treealign/ExampleDistance3SequenceAlignResult!   4 *+*4   /*9  >*' <= /*G !" >*+ JK#$% &(PK 3F>k~~:fr/orsay/lri/varna/models/treealign/ExampleDistance3.class14fr/orsay/lri/varna/models/treealign/ExampleDistance3java/lang/ObjectCfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceSymmetric()VCode  LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/models/treealign/ExampleDistance3;fi(Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;)D 1fr/orsay/lri/varna/models/treealign/RNANodeValue2  isSingleNode()Z  getNodes()Ljava/util/List; java/util/List !size()I@ % &'alignSequenceNodes(Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;)Lfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult; )+*Hfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult ,- getDistance()D / 01getNode4()Lfr/orsay/lri/varna/models/treealign/RNANodeValue; 3540fr/orsay/lri/varna/models/treealign/RNANodeValue 67getLeftNucleotide()Ljava/lang/String; 39 :7getRightNucleotide <>=java/lang/String ?@equals(Ljava/lang/Object;)Z?v13Lfr/orsay/lri/varna/models/treealign/RNANodeValue2;v2l1Ljava/lang/String;r1l2r2 L MNcomputeSequence()[C P QRalignSequencesP([C[C)Lfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult;A[CB )W X9(Lfr/orsay/lri/varna/models/treealign/ExampleDistance3;)VZ[[D\[[I )^ _` setDistance(D)V b cdcomputeAlignment([[D[[I[C[C)[[I )f gh setAlignment([[I)VresultJLfr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult;laIlbF decisionsdD substCostijmindecisionmatchdeleteinsert alignment|java/util/ArrayList {~ (I)V java/lang/Integer valueOf(I)Ljava/lang/Integer; { @addjava/lang/Errorjava/lang/StringBuilder$Bug in ExampleDistance3: decision = (Ljava/lang/String;)V append(I)Ljava/lang/StringBuilder; 7toString { { get(I)Ljava/lang/Object; !intValue AlignmentALjava/util/ArrayList; AlignmentBlLocalVariableTypeTable*Ljava/util/ArrayList;'(Ljava/lang/Object;Ljava/lang/Object;)D   SourceFileExampleDistance3.java SignatureLjava/lang/Object;Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceSymmetric; InnerClassesSequenceAlignResult! /*    t+,,,"+0,+, *+,$(+`,",,`+.2N+.8:,.2:,.8:-; A; Ac ^   '+6=GT!X"\#c$p&x'()-.- HCDEDx>FG5HG,IG#JG&' m+KN,K:*-O UV W 4CDEDST UTQR &)Y*VN+6,6``Y:``[:99 6  2 kR  6 2  kR  6 6  d2 d1+ d4, d4c9 d2 1c9 69 69 2 d1c9 69 2 R 2 O  ~  n-21]*+,a: - e- "a c def-g0h3i9jEiOkUlakkmqnwrstuvxy{|}~nm$ &&ST&UT ij klmlnZ-o\0pq3rq 6sl Rtl nsl ttl uq1uqvl5vlXwqJxq#yqz\ cd  i{Y-`}:{Y-`}:-66,2.6  x>[dWdWVdWW9WdWYY %]dWWWdW6  [: 68 2 ddO 2 ddO   '"'*3P]jmps $*C\f z iinZio\iSTiUTZK"Gsl'Btl3vl Nl $Ei\ ZKA - *+,   )PK =k=\KK9fr/orsay/lri/varna/models/treealign/ExampleDistance3.javapackage fr.orsay.lri.varna.models.treealign; import java.util.ArrayList; /** * * * @author Raphael Champeimont */ public class ExampleDistance3 implements TreeAlignLabelDistanceSymmetric { public double f(RNANodeValue2 v1, RNANodeValue2 v2) { if (v1 == null) { if (v2 == null) { return 0; } else if (!v2.isSingleNode()) { // v2 is a list of bases // We insert all bases, with a cost of 1 for each base. return v2.getNodes().size(); } else { // v2 is a single node return 2; } } else if (!v1.isSingleNode()) { // v1 is a list of bases if (v2 == null) { return v1.getNodes().size(); } else if (!v2.isSingleNode()) { // v2 is a list of bases // We compute the sequence distance return alignSequenceNodes(v1, v2).getDistance(); } else { // v2 is a single node return 2 + v1.getNodes().size(); } } else { // v1 is a single node // all the same as when v1 == null if (v2 == null) { return 2; } else if (!v2.isSingleNode()) { // v2 is a list of bases return 2 + v2.getNodes().size(); } else { // v2 is a single node String l1 = v1.getNode().getLeftNucleotide(); String r1 = v1.getNode().getRightNucleotide(); String l2 = v2.getNode().getLeftNucleotide(); String r2 = v2.getNode().getRightNucleotide(); // We have cost(subst((x,y) to (x',y'))) = 1 // when x != x' and y != y'. // It means it is less than substituting 2 non-paired bases return (!l1.equals(l2) ? 0.5 : 0) + (!r1.equals(r2) ? 0.5 : 0); } } } public class SequenceAlignResult { private double distance; private int[][] alignment; public double getDistance() { return distance; } public void setDistance(double distance) { this.distance = distance; } /** The result array is a matrix of height 2 * and width at most length(sequence A) + length(sequence B). * with result[0] is the alignment for A * and result[1] the alignment for B. * The alignment consists int the indexes of the original * bases positions, with -1 when there is no match. */ public int[][] getAlignment() { return alignment; } public void setAlignment(int[][] alignment) { this.alignment = alignment; } } /** * Align two sequences contained in nodes. * Both nodes have to be non-single nodes, otherwise an * RNANodeValue2WrongTypeException exception will be thrown. */ public SequenceAlignResult alignSequenceNodes(RNANodeValue2 v1, RNANodeValue2 v2) { char[] A = v1.computeSequence(); char[] B = v2.computeSequence(); return alignSequences(A, B); } /** * Align sequences using the Needleman-Wunsch algorithm. * Time: O(A.length * B.length) * Space: O(A.length * B.length) * Space used by the returned object: O(A.length + B.length) */ public SequenceAlignResult alignSequences(char[] A, char[] B) { SequenceAlignResult result = new SequenceAlignResult(); final int la = A.length; final int lb = B.length; double[][] F = new double[la+1][lb+1]; int[][] decisions = new int[la+1][lb+1]; final double d = 1; // insertion/deletion cost final double substCost = 1; // substitution cost for (int i=0; i<=la; i++) F[i][0] = d*i; for (int j=0; j<=lb; j++) F[0][j] = d*j; for (int i=1; i<=la; i++) for (int j=1; j<=lb; j++) { double min; int decision; double match = F[i-1][j-1] + (A[i-1] == B[j-1] ? 0 : substCost); double delete = F[i-1][j] + d; if (match < delete) { decision = 1; min = match; } else { decision = 2; min = delete; } double insert = F[i][j-1] + d; if (insert < min) { decision = 3; min = insert; } F[i][j] = min; decisions[i][j] = decision; } result.setDistance(F[la][lb]); int[][] alignment = computeAlignment(F, decisions, A, B); result.setAlignment(alignment); return result; } private int[][] computeAlignment(double[][] F, int[][] decisions, char[] A, char[] B) { // At worst the alignment will be of length (A.length + B.length) ArrayList AlignmentA = new ArrayList(A.length + B.length); ArrayList AlignmentB = new ArrayList(A.length + B.length); int i = A.length; int j = B.length; while (i > 0 && j > 0) { int decision = decisions[i][j]; switch (decision) { case 1: AlignmentA.add(i-1); AlignmentB.add(j-1); i = i - 1; j = j - 1; break; case 2: AlignmentA.add(i-1); AlignmentB.add(-1); i = i - 1; break; case 3: AlignmentA.add(-1); AlignmentB.add(j-1); j = j - 1; break; default: throw (new Error("Bug in ExampleDistance3: decision = " + decision)); } } while (i > 0) { AlignmentA.add(i-1); AlignmentB.add(-1); i = i - 1; } while (j > 0) { AlignmentA.add(-1); AlignmentB.add(j-1); j = j - 1; } // Convert the ArrayLists to the right format: // We need to reverse the list and change the numbering of int l = AlignmentA.size(); int[][] result = new int[2][l]; for (i=0; iu;Ifr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceSymmetric.class1 Cfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceSymmetricjava/lang/ObjectDfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric SourceFile$TreeAlignLabelDistanceSymmetric.java SignatureLjava/lang/Object;Lfr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric;  PK oq */ public interface TreeAlignLabelDistanceSymmetric extends TreeAlignLabelDistanceAsymmetric { } PK 3F>fr/orsay/lri/varna/views/PK 3F>.mL -fr/orsay/lri/varna/views/VueBPThickness.class1'fr/orsay/lri/varna/views/VueBPThicknessjava/lang/Object javax/swing/event/ChangeListener_vpLfr/orsay/lri/varna/VARNAPanel;_msbpLjava/util/ArrayList; SignatureDLjava/util/ArrayList;_thicknessSliderLjavax/swing/JSlider;panelLjavax/swing/JPanel;_backupThicknesses)Ljava/util/ArrayList;FACTORD7(Lfr/orsay/lri/varna/VARNAPanel;Ljava/util/ArrayList;)Vf(Lfr/orsay/lri/varna/VARNAPanel;Ljava/util/ArrayList;)VCode  ()Vjava/util/ArrayList    @$ $  &  ( * +backupThicknesses-javax/swing/JSlider / 01get(I)Ljava/lang/Object;3+fr/orsay/lri/varna/models/rna/ModeleStyleBP 25 67 getThickness(D)D ,9 :(IIII)V <  ,> ?@setMajorTickSpacing(I)V ,B CD setPaintTicks(Z)V ,F GDsetPaintLabelsIjava/awt/Dimension HK L(II)V ,N OPsetPreferredSize(Ljava/awt/Dimension;)VRjavax/swing/JLabel TVUjava/lang/String WXvalueOf(D)Ljava/lang/String; QZ [(Ljava/lang/String;)V Q] ^_getPreferredSize()Ljava/awt/Dimension; Ha bcheightI QNf3fr/orsay/lri/varna/controlers/ControleurSliderLabel eh i(Ljavax/swing/JLabel;D)V ,k lmaddChangeListener%(Ljavax/swing/event/ChangeListener;)Vojavax/swing/JPanel n r tjava/awt/FlowLayout sv @ nx yz setLayout(Ljava/awt/LayoutManager;)V| Thickness: n~ add*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis)Lfr/orsay/lri/varna/views/VueBPThickness;vpmsbpthicknessLabelLjavax/swing/JLabel;labelZLocalVariableTypeTable java/lang/Double W(D)Ljava/lang/Double;  (Ljava/lang/Object;)Z  size()IirestoreThicknesses  doubleValue()D 2  setThickness(D)VgetPanel()Ljavax/swing/JPanel; , getValueget_vp!()Lfr/orsay/lri/varna/VARNAPanel; stateChanged"(Ljavax/swing/event/ChangeEvent;)V fr/orsay/lri/varna/VARNAPanel repainteLjavax/swing/event/ChangeEvent; SourceFileVueBPThickness.java!        **Y*!#*+%*,'*)*,Yd,.24*#k8;*; =*;A*;E*;HY2JMQY,.24SYN-HY2-\`Jd*;eY-*#ogj*;*j*nYpq*qsYuwQY{Y:*q}W*q*;}W*q-}W".*,/0 1$3-4556495=4B3E6N7V8^9q;u<;=>=?@?ACDFHIJK4 v   +v.< **'.24W*'۱NOPON-R.+cp0<"*'.2*.*'ٱUV!U/X0-c/*q[ 68*;*#o_ /*%c 6=!*'.2*;*#o*'*%ghih g.k5l 66,cPK qq<66,fr/orsay/lri/varna/views/VueBPThickness.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Dimension; import java.awt.FlowLayout; import java.util.ArrayList; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurSliderLabel; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; public class VueBPThickness implements ChangeListener { private VARNAPanel _vp; ArrayList _msbp; private JSlider _thicknessSlider; private JPanel panel; private ArrayList _backupThicknesses = new ArrayList(); private double FACTOR = 10.0; public VueBPThickness(VARNAPanel vp, ArrayList msbp) { _vp = vp; _msbp = msbp; backupThicknesses(); _thicknessSlider = new JSlider(JSlider.HORIZONTAL, 1, 100, (int) (msbp.get(0).getThickness( VARNAConfig.DEFAULT_BP_THICKNESS) * FACTOR)); _thicknessSlider.setMajorTickSpacing(10); _thicknessSlider.setPaintTicks(true); _thicknessSlider.setPaintLabels(false); _thicknessSlider.setPreferredSize(new Dimension(500, 50)); JLabel thicknessLabel = new JLabel(String.valueOf(msbp.get(0) .getThickness(VARNAConfig.DEFAULT_BP_THICKNESS))); thicknessLabel.setPreferredSize(new Dimension(50, thicknessLabel .getPreferredSize().height)); _thicknessSlider.addChangeListener(new ControleurSliderLabel( thicknessLabel, 1.0 / FACTOR)); _thicknessSlider.addChangeListener(this); panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT)); JLabel labelZ = new JLabel("Thickness:"); panel.add(labelZ); panel.add(_thicknessSlider); panel.add(thicknessLabel); } private void backupThicknesses() { for (int i = 0; i < _msbp.size(); i++) { this._backupThicknesses.add(_msbp.get(i).getThickness( VARNAConfig.DEFAULT_BP_THICKNESS)); } } public void restoreThicknesses() { for (int i = 0; i < _msbp.size(); i++) { _msbp.get(i).setThickness(_backupThicknesses.get(i)); } } public JPanel getPanel() { return panel; } public double getThickness() { return (double) _thicknessSlider.getValue() / FACTOR; } public VARNAPanel get_vp() { return _vp; } public void stateChanged(ChangeEvent e) { for (int i = 0; i < _msbp.size(); i++) { _msbp.get(i).setThickness( ((double) _thicknessSlider.getValue()) / FACTOR); } _vp.repaint(); } } PK 3F>o o (fr/orsay/lri/varna/views/VueBorder.class1"fr/orsay/lri/varna/views/VueBorderjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;borderHeightSliderLjavax/swing/JSlider;borderWidthSliderpanelLjavax/swing/JPanel;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  javax/swing/JPanel   java/awt/GridLayout  (II)V  ! setLayout(Ljava/awt/LayoutManager;)V#java/awt/FlowLayout "% &(I)V(javax/swing/JSlider *,+fr/orsay/lri/varna/VARNAPanel -. getHeight()I *0 12 getBorderSize()Ljava/awt/Dimension; 465java/awt/Dimension 78heightI ': ;(IIII)V =  '? @&setMajorTickSpacing 'B C&setMinorTickSpacing 'E FG setPaintTicks(Z)V 'I JGsetPaintLabelsLjavax/swing/JLabel NPOjava/lang/String QRvalueOf(I)Ljava/lang/String; KT U(Ljava/lang/String;)V KW X2getPreferredSize 4 K[ \]setPreferredSize(Ljava/awt/Dimension;)V_3fr/orsay/lri/varna/controlers/ControleurSliderLabel ^a b(Ljavax/swing/JLabel;Z)V 'd efaddChangeListener%(Ljavax/swing/event/ChangeListener;)Vh.fr/orsay/lri/varna/controlers/ControleurBorder gj k'(Lfr/orsay/lri/varna/views/VueBorder;)V *m n.getWidth 4p q8width s uWidth:wHeight: y z{add*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis$Lfr/orsay/lri/varna/views/VueBorder;vppuppdownborderHeightLabelLjavax/swing/JLabel;borderWidthLabellabelWlabelHgetPanel()Ljavax/swing/JPanel; getDimension ' .getValueget_vp!()Lfr/orsay/lri/varna/VARNAPanel; SourceFileVueBorder.java!   **+YMYN*Y*Y,"Y$-"Y$*'Y*)l d*/39<*<2>*< A*<D*<HKY*/3MS:4Y2V3YZ*<^Y`c*<gY*ic*'Y*ll d*/o9r*r2>*r A*rD*rHKY*/oMS:4Y2V3YZ*r^Y`c*rgY*icKYtS:KYvS:,xW,*rxW,xW-xW-*<xW-xW*,xW*-xW|5'( *+,$-4.@/L1S2l1o4x567898:;:<=<>@A@C DEF"G&H3G8I@JKINKVL\K_MnOyPRSTVWXZ[\}R~  8yLA/*|_} ~2H4Y*r*<Y|c dc} ~-.2*<|h} ~n.2*r|l} ~/*|p} ~PK qq<$l'fr/orsay/lri/varna/views/VueBorder.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSlider; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurBorder; import fr.orsay.lri.varna.controlers.ControleurSliderLabel; public class VueBorder { private VARNAPanel _vp; private JSlider borderHeightSlider, borderWidthSlider; private JPanel panel; public VueBorder(VARNAPanel vp) { _vp = vp; JPanel pup = new JPanel(); JPanel pdown = new JPanel(); panel = new JPanel(); panel.setLayout(new GridLayout(2, 1)); pup.setLayout(new FlowLayout(FlowLayout.LEFT)); pdown.setLayout(new FlowLayout(FlowLayout.LEFT)); borderHeightSlider = new JSlider(JSlider.HORIZONTAL, 0, _vp.getHeight() / 2 - 10, _vp.getBorderSize().height); // Turn on labels at major tick marks. borderHeightSlider.setMajorTickSpacing(50); borderHeightSlider.setMinorTickSpacing(10); borderHeightSlider.setPaintTicks(true); borderHeightSlider.setPaintLabels(true); JLabel borderHeightLabel = new JLabel(String.valueOf(_vp .getBorderSize().height)); borderHeightLabel.setPreferredSize(new Dimension(50, borderHeightLabel .getPreferredSize().height)); borderHeightSlider.addChangeListener(new ControleurSliderLabel( borderHeightLabel, false)); borderHeightSlider.addChangeListener(new ControleurBorder(this)); borderWidthSlider = new JSlider(JSlider.HORIZONTAL, 0, _vp.getWidth() / 2 - 10, _vp.getBorderSize().width); // Turn on labels at major tick marks. borderWidthSlider.setMajorTickSpacing(50); borderWidthSlider.setMinorTickSpacing(10); borderWidthSlider.setPaintTicks(true); borderWidthSlider.setPaintLabels(true); JLabel borderWidthLabel = new JLabel(String .valueOf(_vp.getBorderSize().width)); borderWidthLabel.setPreferredSize(new Dimension(50, borderWidthLabel .getPreferredSize().height)); borderWidthSlider.addChangeListener(new ControleurSliderLabel( borderWidthLabel, false)); borderWidthSlider.addChangeListener(new ControleurBorder(this)); JLabel labelW = new JLabel("Width:"); JLabel labelH = new JLabel("Height:"); pup.add(labelW); pup.add(borderWidthSlider); pup.add(borderWidthLabel); pdown.add(labelH); pdown.add(borderHeightSlider); pdown.add(borderHeightLabel); panel.add(pup); panel.add(pdown); } public JPanel getPanel() { return panel; } public Dimension getDimension() { return new Dimension(borderWidthSlider.getValue(), borderHeightSlider .getValue()); } public int getHeight() { return borderHeightSlider.getValue(); } public int getWidth() { return borderWidthSlider.getValue(); } public VARNAPanel get_vp() { return _vp; } } PK 3F>'t7 7 3fr/orsay/lri/varna/views/VueBPHeightIncrement.class1-fr/orsay/lri/varna/views/VueBPHeightIncrementjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;panelLjavax/swing/JPanel; spaceSliderLjavax/swing/JSlider;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  javax/swing/JPanel   javax/swing/JSlider fr/orsay/lri/varna/VARNAPanel getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !#"!fr/orsay/lri/varna/models/rna/RNA $%getBPHeightIncrement()D@Y )+*java/lang/Math ,-round(D)J /10java/lang/String 23valueOf(J)Ljava/lang/String; 576java/lang/Integer 28'(Ljava/lang/String;)Ljava/lang/Integer; 5: ;<intValue()I > ?(IIII)V A C DEsetMajorTickSpacing(I)V G HI setPaintTicks(Z)V K LIsetPaintLabelsNjavax/swing/JLabel /P 2Q(D)Ljava/lang/String; MS T(Ljava/lang/String;)VVjava/awt/Dimension MX YZgetPreferredSize()Ljava/awt/Dimension; U\ ]^heightI U` a(II)V Mc desetPreferredSize(Ljava/awt/Dimension;)Vg3fr/orsay/lri/varna/controlers/ControleurSliderLabel fi j(Ljavax/swing/JLabel;Z)V l mnaddChangeListener%(Ljavax/swing/event/ChangeListener;)Vp9fr/orsay/lri/varna/controlers/ControleurBPHeightIncrement or s2(Lfr/orsay/lri/varna/views/VueBPHeightIncrement;)Vujava/awt/FlowLayout tw E y z{ setLayout(Ljava/awt/LayoutManager;)V} HeighInc:  add*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis/Lfr/orsay/lri/varna/views/VueBPHeightIncrement;vp spaceLabelLjavax/swing/JLabel;labelSget_vp!()Lfr/orsay/lri/varna/VARNAPanel;getPanel()Ljavax/swing/JPanel; getIncrement()Ljava/lang/Double;  <getValue java/lang/Double 2(D)Ljava/lang/Double; SourceFileVueBPHeightIncrement.java!    **+*Y*Y + &k(.49=@*@B*@F*@JMY+ &kORM,UY2,W[_b*@fY,hk*@oY*qk*Y*tYvxMY|RN*-~W**@~W*,~Wn&' (*,-+9*<.E/M0U2Y3g2k4r5|46768:;=?@AB*kv /*E  /*I  :*@&oM PK qq5]c c -fr/orsay/lri/varna/views/VueManualInput.class1}'fr/orsay/lri/varna/views/VueManualInputjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;panelLjavax/swing/JPanel;tseqLjavax/swing/JTextField;tstr"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V     buildViewLineNumberTableLocalVariableTablethis)Lfr/orsay/lri/varna/views/VueManualInput;vpjavax/swing/JPanel   "java/awt/GridLayout !$ %(II)V ' () setLayout(Ljava/awt/LayoutManager;)V+java/awt/FlowLayout *- .(I)V0MonoSpaced-PLAIN-12 243 java/awt/Font 56decode#(Ljava/lang/String;)Ljava/awt/Font;8javax/swing/JLabel: Sequence: 7< =(Ljava/lang/String;)V?javax/swing/JTextField ACBfr/orsay/lri/varna/VARNAPanel DEgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; GIH!fr/orsay/lri/varna/models/rna/RNA JKgetListeBasesToString()Ljava/lang/String; >< N P Structure: GR SK getStructDBN U Wjava/awt/Dimension >Y Z[getPreferredSize()Ljava/awt/Dimension; V] ^_heightI V$ >b cdsetPreferredSize(Ljava/awt/Dimension;)V >f ghsetFont(Ljava/awt/Font;)V j kladd*(Ljava/awt/Component;)Ljava/awt/Component;puppdown_textFieldsFontLjava/awt/Font;lseqLjavax/swing/JLabel;lstrgetPanel()Ljavax/swing/JPanel;setPanel(Ljavax/swing/JPanel;)VgetTseq()Ljavax/swing/JTextField;getTstr SourceFileVueManualInput.java!   N**+*&' ( )*YYLYM*!Y#&+*Y,&,*Y,&/1N7Y9;:*>Y*@FLM7YO;:*>Y*@QLT*TVY*TX\`a*MVY*MX\`a*T-e*M-e+iW+*MiW,iW,*TiW*+iW*,iWr, -./+071C3I5T6i7t89:;:<=>=?@ABCDEFG>mnIopTqrtsrtu/*J vw>*+ NOxy/*MR zy/*TV {|PK qq ,fr/orsay/lri/varna/views/VueManualInput.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import fr.orsay.lri.varna.VARNAPanel; public class VueManualInput { private VARNAPanel _vp; private JPanel panel; private JTextField tseq, tstr; public VueManualInput(VARNAPanel vp) { _vp = vp; buildView(); } private void buildView() { panel = new JPanel(); JPanel pup = new JPanel(); JPanel pdown = new JPanel(); panel.setLayout(new GridLayout(2, 1)); pup.setLayout(new FlowLayout(FlowLayout.LEFT)); pdown.setLayout(new FlowLayout(FlowLayout.LEFT)); Font _textFieldsFont = Font.decode("MonoSpaced-PLAIN-12"); JLabel lseq = new JLabel("Sequence:"); tseq = new JTextField(_vp.getRNA().getListeBasesToString()); JLabel lstr = new JLabel("Structure:"); tstr = new JTextField(_vp.getRNA().getStructDBN()); tstr .setPreferredSize(new Dimension(400, tstr.getPreferredSize().height)); tseq .setPreferredSize(new Dimension(400, tseq.getPreferredSize().height)); tstr.setFont(_textFieldsFont); tseq.setFont(_textFieldsFont); pup.add(lseq); pup.add(tseq); pdown.add(lstr); pdown.add(tstr); panel.add(pup); panel.add(pdown); } public JPanel getPanel() { return panel; } public void setPanel(JPanel panel) { this.panel = panel; } public JTextField getTseq() { return tseq; } public JTextField getTstr() { return tstr; } } PK 3F>75fr/orsay/lri/varna/views/VueHighlightRegionEdit.class13/fr/orsay/lri/varna/views/VueHighlightRegionEditjava/lang/Object javax/swing/event/ChangeListenerjava/awt/event/ActionListener_vpLfr/orsay/lri/varna/VARNAPanel; _fromSliderLjavax/swing/JSlider; _toSliderpanelLjavax/swing/JPanel;_anALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;CONTROL_HEIGHTI TITLE_WIDTH CONTROL_WIDTHfillShowLjavax/swing/JButton; outlineShowradLjavax/swing/JSpinner;_backup()VCode   "  $ LineNumberTableLocalVariableTablec(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)V * ',javax/swing/JButton +* /  1  3  5  7 9javax/swing/JSlider ;=<fr/orsay/lri/varna/VARNAPanel >?getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; ACB!fr/orsay/lri/varna/models/rna/RNA DEgetSize()I 8G 'H(IIII)V J 8L MNsetMajorTickSpacing(I)V 8P QR setPaintTicks(Z)V 8T URsetPaintLabelsWjava/awt/Dimension VY 'Z(II)V 8\ ]^setPreferredSize(Ljava/awt/Dimension;)V ` 8b cdaddChangeListener%(Ljavax/swing/event/ChangeListener;)Vfjavax/swing/JPanel e* i kjava/awt/FlowLayout jm 'N eo pq setLayout(Ljava/awt/LayoutManager;)Vsjavax/swing/JLabeluFrom: rw 'x(Ljava/lang/String;)V r\ e{ |}add*(Ljava/awt/Component;)Ljava/awt/Component;To: Outline color: + RsetContentAreaFilled + R setOpaque +\ ?fr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation getOutlineColor()Ljava/awt/Color; +  setBackground(Ljava/awt/Color;)V + addActionListener"(Ljava/awt/event/ActionListener;)Voutline + xsetActionCommand Fill color:  getFillColorfillRadius: javax/swing/SpinnerNumberModel  getRadius()D@I? '(DDDD)Vjavax/swing/JSpinner '(Ljavax/swing/SpinnerModel;)V   \ bjava/awt/GridLayout Ythis1Lfr/orsay/lri/varna/views/VueHighlightRegionEdit;vpanfrompl1Ljavax/swing/JLabel;topoutlinepfillpradiuspjm Ljavax/swing/SpinnerNumberModel;jpgetPanel()Ljavax/swing/JPanel;getAngle 8 EgetValueget_vp!()Lfr/orsay/lri/varna/VARNAPanel;show()Z E getMinIndex E getMaxIndex 8 NsetValue  Edit region annotation javax/swing/JOptionPane showConfirmDialog=(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;II)I ; repaintacceptZfromto stateChanged"(Ljavax/swing/event/ChangeEvent;)V javax/swing/event/ChangeEvent  getSource()Ljava/lang/Object;  equals(Ljava/lang/Object;)Z A getBasesBetween(II)Ljava/util/ArrayList;  setBases(Ljava/util/ArrayList;)V  java/lang/Double    doubleValue    setRadius(D)VeLjavax/swing/event/ChangeEvent;valLjava/lang/Object;actionPerformed(Ljava/awt/event/ActionEvent;)V java/awt/event/ActionEvent getActionCommand()Ljava/lang/String; java/lang/StringChoose new outline color !#"javax/swing/JColorChooser $% showDialogH(Ljava/awt/Component;Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; ' (setOutlineColor*Choose new fill color , - setFillColorLjava/awt/event/ActionEvent;cLjava/awt/Color; SourceFileVueHighlightRegionEdit.java!       =2F!ȳ#%#$ %&'( *)*+Y-.*+Y-0*2*,4*+6*8Y+:@dFI*I K*IO*IS*IVY#X[*8Y+:@dF_*_ K*_O*_S*_VY#X[*_*a*I*a*eYgh*hjYlneYgNrYtv:VY!Xy-zW-*_zWeYg:rY~v:VY!XyzW*IzWeYg:rYv:VY!Xy*0*0*0VY#X*0,*0**0zW*0zWeYg:rYv:VY!Xy*.*.*.VY#X*.,*.**.zW*.zWeYg:rYv:VY!XyY*4: *Y *VY#XzW*zW**eYg:  Yn -zW zW zW zW zW*h zW%F*&'+$,)-@.I/Q0Y1m345679:<=?@ABCEF$G6H>IHKQL\MnNvO~PQRSTUWXYZ[\ ]^_&`.a8cAdLe^fughijkmnopqrstu&p   Q0Au @ /*h%x& 3 *Iχ%|&  /*6%& ?<*4=*4>*_*I*6*<*6%2  "*-.46=&*?= 5-E+*I+*_t*_=*I>2+*_*Iܧ+*I *_*_=*I>*4*6:*6.+* *M,*4, %F&+9DRZbj}&4i&a{+$**4 M,8*4,&-+!*)*4 M, *4,+*0*4*.*4*6%2 "-9KOWesz&*{{./0K /012PK pq<)4fr/orsay/lri/varna/views/VueHighlightRegionEdit.javapackage fr.orsay.lri.varna.views; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import javax.swing.JButton; import javax.swing.JColorChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.rna.ModeleBase; public class VueHighlightRegionEdit implements ChangeListener, ActionListener { private VARNAPanel _vp; private JSlider _fromSlider; private JSlider _toSlider; private JPanel panel; private HighlightRegionAnnotation _an; private static int CONTROL_HEIGHT = 50; private static int TITLE_WIDTH = 70; private static int CONTROL_WIDTH = 200; private JButton fillShow = new JButton(); private JButton outlineShow = new JButton(); JSpinner rad; public VueHighlightRegionEdit(VARNAPanel vp, HighlightRegionAnnotation an) { _an = an; _vp = vp; _toSlider = new JSlider(JSlider.HORIZONTAL, 0,vp.getRNA().getSize()-1,0); _toSlider.setMajorTickSpacing(10); _toSlider.setPaintTicks(true); _toSlider.setPaintLabels(true); _toSlider.setPreferredSize(new Dimension(CONTROL_WIDTH, CONTROL_HEIGHT)); _fromSlider = new JSlider(JSlider.HORIZONTAL, 0,vp.getRNA().getSize()-1,0); _fromSlider.setMajorTickSpacing(10); _fromSlider.setPaintTicks(true); _fromSlider.setPaintLabels(true); _fromSlider.setPreferredSize(new Dimension(CONTROL_WIDTH, CONTROL_HEIGHT)); _fromSlider.addChangeListener(this); _toSlider.addChangeListener(this); panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT)); JPanel fromp = new JPanel(); JLabel l1 = new JLabel("From: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); fromp.add(l1); fromp.add(_fromSlider); JPanel top = new JPanel(); l1 = new JLabel("To: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); top.add(l1); top.add(_toSlider); JPanel outlinep = new JPanel(); l1 = new JLabel("Outline color: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); outlineShow.setContentAreaFilled(false); outlineShow.setOpaque(true); outlineShow.setPreferredSize(new Dimension(CONTROL_WIDTH,CONTROL_HEIGHT)); outlineShow.setBackground(an.getOutlineColor()); outlineShow.addActionListener(this); outlineShow.setActionCommand("outline"); outlinep.add(l1); outlinep.add(outlineShow); JPanel fillp = new JPanel(); l1 = new JLabel("Fill color: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); fillShow.setContentAreaFilled(false); fillShow.setOpaque(true); fillShow.setPreferredSize(new Dimension(CONTROL_WIDTH,CONTROL_HEIGHT)); fillShow.setBackground(an.getFillColor()); fillShow.addActionListener(this); fillShow.setActionCommand("fill"); fillp.add(l1); fillp.add(fillShow); JPanel radiusp = new JPanel(); l1 = new JLabel("Radius: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); SpinnerNumberModel jm = new SpinnerNumberModel(_an.getRadius(),1.0,50.0,0.1); rad = new JSpinner(jm); rad.setPreferredSize(new Dimension(CONTROL_WIDTH,CONTROL_HEIGHT)); radiusp.add(l1); radiusp.add(rad); rad.addChangeListener(this); JPanel jp = new JPanel(); jp.setLayout(new GridLayout(5,1)); jp.add(fromp); jp.add(top); jp.add(outlinep); jp.add(fillp); jp.add(radiusp); panel.add(jp); } public JPanel getPanel() { return panel; } public double getAngle() { return _toSlider.getValue(); } public VARNAPanel get_vp() { return _vp; } HighlightRegionAnnotation _backup = null; public boolean show() { boolean accept = false; int from = _an.getMinIndex(); int to = _an.getMaxIndex(); _fromSlider.setValue(from); _toSlider.setValue(to ); if (JOptionPane.showConfirmDialog(_vp, getPanel(), "Edit region annotation", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) { accept = true; } _vp.repaint(); return accept; } public void stateChanged(ChangeEvent e) { if ((e.getSource()==_toSlider)||(e.getSource()==_fromSlider)) { int from = _fromSlider.getValue(); int to = _toSlider.getValue(); if (from>to) { if (e.getSource().equals(_fromSlider)) { _toSlider.setValue(from); } else if (e.getSource().equals(_toSlider)) { _fromSlider.setValue(to); } } from = _fromSlider.getValue(); to = _toSlider.getValue(); _an.setBases(_vp.getRNA().getBasesBetween(from, to)); _vp.repaint(); } else if (e.getSource().equals(rad)) { Object val = rad.getValue(); if (val instanceof Double) { _an.setRadius(((Double)val).doubleValue()); } } } public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("outline")) { Color c = JColorChooser.showDialog(getPanel(), "Choose new outline color", _an.getOutlineColor()); if (c!= null) { _an.setOutlineColor(c); } } else if (e.getActionCommand().equals("fill")) { Color c = JColorChooser.showDialog(getPanel(), "Choose new fill color", _an.getFillColor()); if (c!= null) { _an.setFillColor(c); } } outlineShow.setBackground(_an.getOutlineColor()); fillShow.setBackground(_an.getFillColor()); _vp.repaint(); } } PK 3F>cmzz0fr/orsay/lri/varna/views/VueGlobalRotation.class1w*fr/orsay/lri/varna/views/VueGlobalRotationjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;rotationSliderLjavax/swing/JSlider;panelLjavax/swing/JPanel;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  javax/swing/JSlider  (IIII)V    setMajorTickSpacing(I)V  ! setPaintTicks(Z)V # $!setPaintLabels&java/awt/Dimension %( )(II)V + ,-setPreferredSize(Ljava/awt/Dimension;)V/javax/swing/JLabel 132java/lang/String 45valueOf(I)Ljava/lang/String; .7 8(Ljava/lang/String;)V .: ;<getPreferredSize()Ljava/awt/Dimension; %> ?@heightI .+C3fr/orsay/lri/varna/controlers/ControleurSliderLabel BE F(Ljavax/swing/JLabel;Z)V H IJaddChangeListener%(Ljavax/swing/event/ChangeListener;)VL6fr/orsay/lri/varna/controlers/ControleurGlobalRotation KN ON(Lfr/orsay/lri/varna/views/VueGlobalRotation;Lfr/orsay/lri/varna/VARNAPanel;)VQjavax/swing/JPanel P T Vjava/awt/FlowLayout UX  PZ [\ setLayout(Ljava/awt/LayoutManager;)V^Rotation (degrees): P` abadd*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis,Lfr/orsay/lri/varna/views/VueGlobalRotation;vp rotationLabelLjavax/swing/JLabel;labelZgetPanel()Ljavax/swing/JPanel;getAngle()D p qrgetValue()Iget_vp!()Lfr/orsay/lri/varna/VARNAPanel; SourceFileVueGlobalRotation.java!   g**+*Yh*<**"*%Y2'*.Y06M,%Y2,9='A*BY,DG*KY*+MG*PYRS*SUYWY.Y]6N*S-_W*S*_W*S,_WcZ&' ()%*-+5,H.T/[0e/h1p2u1x3568:;<=d*efgTwhijikl /*Sc@d efmn 3 *ocDd  efst /*cHd efuvPK a*>e /fr/orsay/lri/varna/views/VueGlobalRotation.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Dimension; import java.awt.FlowLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSlider; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurGlobalRotation; import fr.orsay.lri.varna.controlers.ControleurSliderLabel; public class VueGlobalRotation { private VARNAPanel _vp; private JSlider rotationSlider; private JPanel panel; public VueGlobalRotation(VARNAPanel vp) { _vp = vp; rotationSlider = new JSlider(JSlider.HORIZONTAL, -360, 360, 0); rotationSlider.setMajorTickSpacing(60); rotationSlider.setPaintTicks(true); rotationSlider.setPaintLabels(true); rotationSlider.setPreferredSize(new Dimension(500, 50)); JLabel rotationLabel = new JLabel(String.valueOf(0)); rotationLabel.setPreferredSize(new Dimension(50, rotationLabel .getPreferredSize().height)); rotationSlider.addChangeListener(new ControleurSliderLabel( rotationLabel, false)); rotationSlider.addChangeListener(new ControleurGlobalRotation(this,vp)); panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT)); JLabel labelZ = new JLabel("Rotation (degrees):"); panel.add(labelZ); panel.add(rotationSlider); panel.add(rotationLabel); } public JPanel getPanel() { return panel; } public double getAngle() { return rotationSlider.getValue(); } public VARNAPanel get_vp() { return _vp; } } PK 3F>zƷ_ _ )fr/orsay/lri/varna/views/VueStyleBP.class1t#fr/orsay/lri/varna/views/VueStyleBPjava/lang/Objectjava/awt/event/ActionListener_vpLfr/orsay/lri/varna/VARNAPanel;_cmbLjavax/swing/JComboBox;panelLjavax/swing/JPanel;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V   .fr/orsay/lri/varna/models/VARNAConfig$BP_STYLE values3()[Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; fr/orsay/lri/varna/VARNAPanel   getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; "$#%fr/orsay/lri/varna/models/VARNAConfig %& _mainBPStyle0Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;(javax/swing/JComboBox '* +([Ljava/lang/Object;)V - '/ 01setSelectedIndex(I)V '3 45addActionListener"(Ljava/awt/event/ActionListener;)V7javax/swing/JPanel 6 : <java/awt/FlowLayout ;> 1 6@ AB setLayout(Ljava/awt/LayoutManager;)VDjavax/swing/JLabelFBase pair style: CH I(Ljava/lang/String;)V 6K LMadd*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis%Lfr/orsay/lri/varna/views/VueStyleBP;vpstyles1[Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;bckiIlabelZLjavax/swing/JLabel;getPanel()Ljavax/swing/JPanel;getStyle2()Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; '_ `agetSelectedItem()Ljava/lang/Object;get_vp!()Lfr/orsay/lri/varna/VARNAPanel;actionPerformed(Ljava/awt/event/ActionEvent;)V g hi setBPStyle3(Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;)V k lrepainteLjava/awt/event/ActionEvent;newSel SourceFileVueStyleBP.java InnerClassesBP_STYLE!   **+M+!N*'Y,),6,2- *,.,*,*2*6Y89*9;Y=?CYEG:*9JW*9*,JWNB&' ( )*!+',/-8+B/J1U2d4o6y78O>PQR ySTqU&$VWoXYZ[/*9N;O PQ\]5 *,^N?O  PQbc/*NCO PQdem*,^M*,f*jNGHG IJKO PQmn o&pqr "s@PK qq<?!v v (fr/orsay/lri/varna/views/VueStyleBP.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.models.VARNAConfig; public class VueStyleBP implements ActionListener { private VARNAPanel _vp; private JComboBox _cmb; private JPanel panel; public VueStyleBP(VARNAPanel vp) { _vp = vp; VARNAConfig.BP_STYLE[] styles = VARNAConfig.BP_STYLE.values(); VARNAConfig.BP_STYLE bck = vp.getConfig()._mainBPStyle; _cmb = new JComboBox(styles); for (int i = 0; i < styles.length; i++) { if (styles[i] == bck) _cmb.setSelectedIndex(i); } _cmb.addActionListener(this); panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT)); JLabel labelZ = new JLabel("Base pair style: "); panel.add(labelZ); panel.add(_cmb); } public JPanel getPanel() { return panel; } public VARNAConfig.BP_STYLE getStyle() { return (VARNAConfig.BP_STYLE) _cmb.getSelectedItem(); } public VARNAPanel get_vp() { return _vp; } public void actionPerformed(ActionEvent e) { VARNAConfig.BP_STYLE newSel = (VARNAConfig.BP_STYLE) _cmb .getSelectedItem(); _vp.setBPStyle(newSel); _vp.repaint(); } } PK 3F>1fr/orsay/lri/varna/views/VueColorMapStyle$1.class19+fr/orsay/lri/varna/views/VueColorMapStyle$1java/lang/Objectjava/awt/event/FocusListenerthis$0+Lfr/orsay/lri/varna/views/VueColorMapStyle;.(Lfr/orsay/lri/varna/views/VueColorMapStyle;)VCode    ()VLineNumberTableLocalVariableTablethis-Lfr/orsay/lri/varna/views/VueColorMapStyle$1; focusGained(Ljava/awt/event/FocusEvent;)V )fr/orsay/lri/varna/views/VueColorMapStyle access$0E(Lfr/orsay/lri/varna/views/VueColorMapStyle;)Ljavax/swing/JTextField;  javax/swing/JTextField !"setSelectionStart(I)V $ %&getText()Ljava/lang/String; (*)java/lang/String +,length()I . /"setSelectionEndarg0Ljava/awt/event/FocusEvent; focusLost SourceFileVueColorMapStyle.javaEnclosingMethod 7init InnerClasses0  8 *+ * C   _#* * * #'-F G"H##012 5K0134568 PK 3F>?j1fr/orsay/lri/varna/views/VueColorMapStyle$2.class16+fr/orsay/lri/varna/views/VueColorMapStyle$2java/lang/Objectjava/util/Comparatorthis$0+Lfr/orsay/lri/varna/views/VueColorMapStyle;.(Lfr/orsay/lri/varna/views/VueColorMapStyle;)VCode    ()VLineNumberTableLocalVariableTablethis-Lfr/orsay/lri/varna/views/VueColorMapStyle$2;compare(Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;)I ?fr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes getId()Ljava/lang/String;  java/lang/String !" compareTo(Ljava/lang/String;)Iarg0ALfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;arg1'(Ljava/lang/Object;Ljava/lang/Object;)I (  SourceFileVueColorMapStyle.java SignaturekLjava/lang/Object;Ljava/util/Comparator;EnclosingMethod/)fr/orsay/lri/varna/views/VueColorMapStyle 1init InnerClasses4,fr/orsay/lri/varna/models/rna/ModeleColorMapNamedColorMapTypes0  8 *+ * O   J +,Q   #$ %$A& - *+,')*+,-.0235@PK 3F>0edee/fr/orsay/lri/varna/views/VueColorMapStyle.class1)fr/orsay/lri/varna/views/VueColorMapStylejavax/swing/JPaneljava/awt/event/ActionListenerjava/awt/event/ItemListener !java/beans/PropertyChangeListener_vpLfr/orsay/lri/varna/VARNAPanel;_gp3Lfr/orsay/lri/varna/components/GradientEditorPanel;_cbLjavax/swing/JComboBox;_codeLjavax/swing/JTextField;_backup.Lfr/orsay/lri/varna/models/rna/ModeleColorMap;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V   initLineNumberTableLocalVariableTablethis+Lfr/orsay/lri/varna/views/VueColorMapStyle;vp&javax/swing/JLabel("Click gradient to add new color... %* +(Ljava/lang/String;)V-1fr/orsay/lri/varna/components/GradientEditorPanel /10fr/orsay/lri/varna/VARNAPanel 23 getColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; 576,fr/orsay/lri/varna/models/rna/ModeleColorMap 83clone ,: ;1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V =  ? Ajava/awt/Dimension @C D(II)V ,F GHsetPreferredSize(Ljava/awt/Dimension;)V ,J KLaddPropertyChangeListener&(Ljava/beans/PropertyChangeListener;)VN Param. code: Pjavax/swing/JTextFieldR O* U WMonospaced-PLAIN-12 Y[Z java/awt/Font \]decode#(Ljava/lang/String;)Ljava/awt/Font; O_ `asetFont(Ljava/awt/Font;)V Oc de setEditable(Z)Vg+fr/orsay/lri/varna/views/VueColorMapStyle$1 fi j.(Lfr/orsay/lri/varna/views/VueColorMapStyle;)V Ol mnaddFocusListener!(Ljava/awt/event/FocusListener;)V prq?fr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes stvaluesD()[Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;v+fr/orsay/lri/varna/views/VueColorMapStyle$2 ui y{zjava/util/Arrays |}sort,([Ljava/lang/Object;Ljava/util/Comparator;)Vjava/lang/Object p1 5 equals1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)Zjava/lang/String Custom... *javax/swing/JComboBox ([Ljava/lang/Object;)V   setSelectedIndex(I)V p getId()Ljava/lang/String; O +setText java/lang/Integer valueOf(I)Ljava/lang/Integer; setSelectedItem(Ljava/lang/Object;)V ,1 5 getParamEncoding addItemListener (Ljava/awt/event/ItemListener;)Vjavax/swing/BoxLayout (Ljava/awt/Container;I)V   setLayout(Ljava/awt/LayoutManager;)V  add*(Ljava/awt/Component;)Ljava/awt/Component;  gradientCaptionLjavax/swing/JLabel; codePanelLjavax/swing/JPanel; codeCaptionpalettesB[Lfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes; finalArray[Ljava/lang/Object;selectedIicustomLjava/lang/String; cancelChanges / ; setColorMapactionPerformed(Ljava/awt/event/ActionEvent;)VeLjava/awt/event/ActionEvent; refreshCode  getItemAt(I)Ljava/lang/Object;  getItemCount()I , repaintnALfr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes;oLjava/lang/Object;niitemStateChanged(Ljava/awt/event/ItemEvent;)V java/awt/event/ItemEvent getStateChange getItem()Ljava/lang/Object; ,  arg0Ljava/awt/event/ItemEvent;propertyChange#(Ljava/beans/PropertyChangeEvent;)V java/beans/PropertyChangeEvent getPropertyNamePaletteChanged (Ljava/lang/Object;)Z Ljava/beans/PropertyChangeEvent;access$0E(Lfr/orsay/lri/varna/views/VueColorMapStyle;)Ljavax/swing/JTextField; SourceFileVueColorMapStyle.java InnerClassesNamedColorMapTypes!    N**+* 12 3 4!"#$ %Y')L*,Y*.49<**.>*<@Y,FBE*<*IYM%YM)N*OYQST*TVX^*Tb*TfY*hko:uY*wx`~:66)2*.62SջY:S*Y**T2#*d*T*<**,Y,,-W,*TW*Y***W*+W**<W*,W &8 9:*;=<E>M?W@dApBxCNOTUVXZ]V_`abd ei*j;lCoPpVq_sltuu{vwx!\ "# M>W41: **>̱ | }!  "#232*< ! "#5 !"##<M>6*:p!p:*<<M*d*T,**T*<**<*<ܱ B "49INYdu!>"#C&",+&+M,p,pN*<-4*  '+!*,"#, a!+**d*   !!"#!%*T ,!p5@fuPK 4*=PE.fr/orsay/lri/varna/views/VueColorMapStyle.javapackage fr.orsay.lri.varna.views; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Arrays; import java.util.Comparator; import javax.swing.BoxLayout; import javax.swing.JColorChooser; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.components.GradientEditorPanel; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.ModeleColorMap; import fr.orsay.lri.varna.models.rna.ModeleColorMap.NamedColorMapTypes; public class VueColorMapStyle extends JPanel implements ActionListener, ItemListener, PropertyChangeListener { private VARNAPanel _vp; private GradientEditorPanel _gp; private JComboBox _cb; private JTextField _code; private ModeleColorMap _backup; public VueColorMapStyle(VARNAPanel vp) { super(); _vp = vp; init(); } private void init() { JLabel gradientCaption = new JLabel("Click gradient to add new color..."); _gp = new GradientEditorPanel(_vp.getColorMap().clone()); _backup = _vp.getColorMap(); _gp.setPreferredSize(new Dimension(300,70)); _gp.addPropertyChangeListener(this); JPanel codePanel = new JPanel(); JLabel codeCaption = new JLabel("Param. code: "); _code = new JTextField(""); _code.setFont(Font.decode("Monospaced-PLAIN-12")); _code.setEditable(false); _code.addFocusListener(new FocusListener(){ public void focusGained(FocusEvent arg0) { _code.setSelectionStart(0); _code.setSelectionEnd(_code.getText().length()); } public void focusLost(FocusEvent arg0) { } }); NamedColorMapTypes[] palettes = ModeleColorMap.NamedColorMapTypes.values(); Arrays.sort(palettes,new Comparator(){ public int compare(ModeleColorMap.NamedColorMapTypes arg0, ModeleColorMap.NamedColorMapTypes arg1) { return arg0.getId().compareTo(arg1.getId()); } }); Object[] finalArray = new Object[palettes.length+1]; int selected = -1; for (int i=0;iҎbQ@>@>&fr/orsay/lri/varna/views/VueMenu.class1S fr/orsay/lri/varna/views/VueMenujavax/swing/JPopupMenuserialVersionUIDJ ConstantValue_vpLfr/orsay/lri/varna/VARNAPanel;_controlerMenu.Lfr/orsay/lri/varna/controlers/ControleurMenu;_itemOptionSpecialBaseColoredLjavax/swing/JCheckBoxMenuItem;_itemShowWarnings_itemOptionGapsBaseColored_itemOptionBondsColored _itemShowNCBP_itemShowOnlyPlanar_itemFlatExteriorLoop_itemShowColorMap_dashBasesColorLjavax/swing/JMenuItem; _disabledLjava/util/ArrayList; Signature/Ljava/util/ArrayList; _rotation_bpHeightIncrement _spawnOriginLjava/awt/Point; _subMenuBasesLjavax/swing/JMenu;_selectionMenuIndexLjava/awt/Component;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode ) %*()V,javax/swing/JCheckBoxMenuItem.Custom colored +0 %1(Ljava/lang/String;Z)V 3 5 Show warnings 7  9 ;Use base color for base-pairs = ?Show non-canonical BPs A CHide tertiary BPs E GFlat exterior loop I KShow color map M Ojava/util/ArrayList N) R Tjava/awt/Point SV %W(II)V Y  [ #$ ] _,fr/orsay/lri/varna/controlers/ControleurMenu ^a %bD(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/views/VueMenu;)V d LineNumberTableLocalVariableTablethis"Lfr/orsay/lri/varna/views/VueMenu;vpaddTitleljavax/swing/JSeparator k)ojavax/swing/JLabelqjava/lang/StringBuilders pu %v(Ljava/lang/String;)V px yzappend-(Ljava/lang/String;)Ljava/lang/StringBuilder; p| }~toString()Ljava/lang/String; nu n getFont()Ljava/awt/Font;  java/awt/Font  deriveFont(I)Ljava/awt/Font; getSize()I (F)Ljava/awt/Font; n setFont(Ljava/awt/Font;)V n  getForeground()Ljava/awt/Color; java/awt/Color brighter n  setForeground(Ljava/awt/Color;)V  add*(Ljava/awt/Component;)Ljava/awt/Component; N (Ljava/lang/Object;)ZtitleLjava/lang/String;keepZsepLjavax/swing/JSeparator; titleItemLjavax/swing/JLabel; previousFontLjava/awt/Font; futureFontcurrentLjava/awt/Color;futureconfigMenuItemR(Ljavax/swing/JMenuItem;Ljava/lang/String;Ljava/lang/String;Ljava/awt/Container;)V  S(Ljavax/swing/JMenuItem;Ljava/lang/String;Ljava/lang/String;Ljava/awt/Container;Z)Vmicommand keyStrokeparLjava/awt/Container; javax/swing/JMenuItem vsetActionCommand addActionListener"(Ljava/awt/event/ActionListener;)V java/lang/String equals javax/swing/KeyStroke  getKeyStroke+(Ljava/lang/String;)Ljavax/swing/KeyStroke; setAccelerator(Ljavax/swing/KeyStroke;)V java/awt/ContainerdisabledcreateMenuItemd(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/awt/Container;Z)Ljavax/swing/JMenuItem; ucaptionc(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/awt/Container;)Ljavax/swing/JMenuItem;   updateDialog N get(I)Ljava/lang/Object;javax/swing/JComponent fr/orsay/lri/varna/VARNAPanel  isModifiable()Z  setVisible(Z)V N size getColorSpecialBases + setState  getShowWarnings  getColorGapsBases  isComparisonMode +   setEnabled        getDrawMode    getUseBaseColorsForBPs  getShowNonCanonicalBP  getShowNonPlanarBP  !getColorMapVisible # $getFlatExteriorLoopiIjLjavax/swing/JComponent;buildPopupMenu+File - j1 / 0*fileMenu 2 3* exportMenu5Print...7print9 control P ; = >* addSeparator@Display B C*viewMenu E F* displayMenuHEdit J K*editStructMenu M N* redrawMenu P Q*colorClassesMenu S T*annotationMenu V W* aboutMenuYjavax/swing/JMenu[ Annotations Xu^New`HerebannotationsaddPositiondBasefannotationsaddBasehLoopjannotationsaddLooplHelixnannotationsaddHelix XqRegionsannotationsaddRegionu Chem. prob.wannotationsaddChemProb Xy z0(Ljavax/swing/JMenuItem;)Ljavax/swing/JMenuItem;|Edit from list...~annotationseditRemove from list...annotationsremove X= Auto 5'/3'annotationsautoextremites control alt Q Auto helicesannotationsautohelices control QAuto interior loopsannotationsautointerior alt shift QAuto terminal loopsannotationsautoterminalcontrol shift Q ysubmenuAnnotationsaddAnnotationsNew... userInput control NOpen...file control OSave...saveas control SSave as DBN (Vienna)dbnBPSEQbpseqCTct submenuSaveExportSVGsvgXFIGxfigEPSepsPNGpngJPEGjpeg submenuExport Base Pairs BP style...bpstylecontrol shift Pshownc control W  shownp control ENon-standard basesspecialbasecolored control JColorspecialBasesColorcontrol shift J 'Gaps' basesdashbasecolored control DdashBasesColorcontrol shift D RNA styleToggle 'Gaspin' modegaspinalt GBackbone color backbone  control KTitle Set TitlesetTitle control TFont titleDisplaycontrol shift T titleColor control alt T  Color map"toggleshowcolormap$control shift L&Caption(colormapcaption*control shift C,Style.... colormapstyle0 control L2Edit values...4colormapvalues6shift L8Load values...:colormaploadvalues<control shift K>Misc@ Num. period.B numPeriodD control MFBackground colorH backgroundJ control GsubMenuBasePairssubMenuNSBasessubMenuGapsBases submenuStyle submenuTitlesubmenuColorMap submenuMiscS BasePairs...U editallbpsWRedrawY Algorithm[Linear]line_ control 1aCircularccirculare control 2gRadiateiradiatek control 3mNAViewonaviewq control 4sBP height incrementubpheightincrementw control Hyflat{ control F}Space between basesspaceBetweenBasescontrol shift SResetresetcontrol shift R submenuRedrawsubmenuAlgorithms warningMenu showwarningsViewZoom25%zoom2550%zoom50100%zoom100150%zoom150200%zoom200Customzoom control Z Rotation...rotation control R Border size borderSize control B submenuView zoomDisplayaddSelectionMenu(Ljavax/swing/JMenuItem;)V  getComponentCount  insert(Ljava/awt/Component;I)VsremoveSelectionMenu  remove(Ljava/awt/Component;)VColors  !"By BaseeachKind control UBy BP eachCoupleshift U By PositioneachBasealt UaddColorOptions(Ljavax/swing/JMenu;)V Fill Color X ~getActionCommand  valueOf&(Ljava/lang/Object;)Ljava/lang/String; ,InnerColor Stroke Color ,OutlineColor Label Color ,NameColorBP Color,BPColor BP Thickness ,BPThickness Number Color ,NumberColorsubmenu About VARNAabout control AaddAnnotationMenu   (Ljavax/swing/JMenu;Z)Vmenu  Annotation  get_selectedAnnotation8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation; 4fr/orsay/lri/varna/models/annotations/TextAnnotation ~getTexte  length   substring(II)Ljava/lang/String;...  Annotation: "Add$ annotationadd&annotationedit(Remove*annotationremove existingAnnotdebuttextemenuAnnotationgetSerialVersionUID()Jget_vp!()Lfr/orsay/lri/varna/VARNAPanel;get_controleurMenu0()Lfr/orsay/lri/varna/controlers/ControleurMenu; get_itemOptionSpecialBaseColored!()Ljavax/swing/JCheckBoxMenuItem;get_itemShowWarningsget_itemOptionDashBaseColoredset_controleurMenu1(Lfr/orsay/lri/varna/controlers/ControleurMenu;)V set_itemOptionSpecialBaseColored"(Ljavax/swing/JCheckBoxMenuItem;)VoptionSpecialBaseColoredset_itemShowWarnings showWarningsset_itemOptionDashBaseColoredoptionDashBaseColored get_rotation()Ljavax/swing/JMenuItem; set_rotationget_itemOptionBondsColoredset_itemOptionBondsColoredoptionBondsColoredshow(Ljava/awt/Component;II)V K HIinvokerxy getSpawnPoint()Ljava/awt/Point; SourceFile VueMenu.java!   !"#$'%&'S*(*+Y-/2*+Y4/6*+Y-/8*+Y:/<*+Y>/@*+YB/D*+YF/H*+YJ/L*NYPQ*SYUX*Z*+\*^Y*\*`ce~M33 4556 7!7%8.9/93:<;=;A<J=K=O>X?Y?]@fBgBkCtFKXNOPfghi j1'5 kYmNnYpYrt+w{:: b:::*W*-W*Q-W*QWeBST!V(W.X6W;ZB[I\S^Z_a`gakbtc~ef\ ghw!^(W;DI6S,'] *+,-ehf4 gh    '8+,+*c--ʶ̚ +-Ѷ *Q+W+We& lm nop"q'r0s7tf>8gh88888'Y+:*,-ex yzfHgh '] *+,-e~f4 gh    *'<*QM,*\*Q*2*\*6*\*8*\*8*\ * *\**\**\*<*\*@*\*D*\*L*\*H*\"*H*\ eJ*8FTbpf gh(%& '()*'**,*.*1*468*:W*<*?,*A*DkYmL*+W*Q+W*G,*I*L*O*R*Q*@W*Q*DW*UeR #+/3;AJRVZ^bnz~fgh;DT*'uXYZ\LXY]\M*_a,:W*ce,:W*gi,:W*km,:WkYmN,-oW*pr,:W*tv,:W+,xW*{}+:W*+:W+*+:W*+:W*+:W*+:W*+WeR $2@NV\jx~f*gh ""V0*'l**W**W**WXY\L*+:W*+:W*+:W*+We&  0;IWekflgh;1"3*'`XY\L*+:W*+:W+*+:W+*+:W*+:W*+We* '+9=KY_f`gh U"F*'  XY׷\L*+:W**@+**D+XY\M**2,*,:WXY\N**8-**-: kYm:*QWXY\:*W+xW,xW-xWoW*  WXY \:*W*W*W*QWXY\:**L!#*%')W*+-/W*135W*79;W*QWXY=\:*?AC:W*EGI:WxW*W*W*We) )8CRal{ /9EVg x }   f\ gh K"CL"lM"]GN"O"EP">Q"K*'>*RT*We f ghN*'-XYV\L*Q+WXYX\M*Q,W*Z\^,W*`bd,W*fhj,W*lnp,W+,xW**rtv+:**Hxz+*|~+W*+W*+We>" #%&((8)H*X+h.n125689f gh ""*'>**6*e >?f ghC*'XY\LXY\M*,:W*,:W*,:W*,:W*,:W*,:W+,xW**+:+*+:W*+We:C FG$H2I@JNK\LkMqNOPRTf gh ""'Z*+Z*Q+W*+*de[\]^fgh*'K*Z**Z*Zeabcef ghQ*']*XYȷ\*Q*ʶW**W**W**W**ʶWeijk-l@mSn\of ]gh'/*pY+tw{+W*pY+tw{+W*pY+tw{+W+*pY+tw{+W*pY+tw{+W+*pY+tw{+We& u#vFwixmyz{|}fgh"W*'F*<**:Wef gh'?*+e fgh " 'w NR:*\ : :pYtw{:pYtw{NXY-\:'*!pY+t#w{W*GpY+t%w{W*'pY+t)w{W+xWe> !(DWaefHgh "+ K,?-ax." /0'" ef12'/*\ef gh34'/*cef gh56'/*2ef gh76'/*6ef gh86'/*8ef gh9:'>*+ce fgh ;<'>*+2e fgh=><'>*+6e fgh?@<'>*+8e fghABC'/*ef ghD'>*+e fghE6'/*<ef ghF<'>*+<e fghGHI'e*SYUX*+Je f*ghL$M&N&OP'/*Xef ghQRPK '>)]BB%fr/orsay/lri/varna/views/VueMenu.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Font; import java.awt.Point; import java.awt.event.KeyEvent; import java.util.ArrayList; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.JSeparator; import javax.swing.KeyStroke; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurMenu; import fr.orsay.lri.varna.models.rna.RNA; public class VueMenu extends JPopupMenu { /** * */ private static final long serialVersionUID = 1L; private VARNAPanel _vp; private ControleurMenu _controlerMenu; private JCheckBoxMenuItem _itemOptionSpecialBaseColored = new JCheckBoxMenuItem( "Custom colored", false); private JCheckBoxMenuItem _itemShowWarnings = new JCheckBoxMenuItem( "Show warnings", false); private JCheckBoxMenuItem _itemOptionGapsBaseColored = new JCheckBoxMenuItem( "Custom colored", false); private JCheckBoxMenuItem _itemOptionBondsColored = new JCheckBoxMenuItem( "Use base color for base-pairs", false); private JCheckBoxMenuItem _itemShowNCBP = new JCheckBoxMenuItem( "Show non-canonical BPs", true); private JCheckBoxMenuItem _itemShowOnlyPlanar = new JCheckBoxMenuItem( "Hide tertiary BPs", false); private JCheckBoxMenuItem _itemFlatExteriorLoop = new JCheckBoxMenuItem( "Flat exterior loop", false); private JCheckBoxMenuItem _itemShowColorMap = new JCheckBoxMenuItem( "Show color map", false); private JMenuItem _dashBasesColor; private ArrayList _disabled = new ArrayList(); private JMenuItem _rotation; private JMenuItem _bpHeightIncrement; private Point _spawnOrigin = new Point(-1,-1); public VueMenu(VARNAPanel vp) { _vp = vp; _controlerMenu = new ControleurMenu(_vp, this); } private void addTitle(String title, boolean keep) { JSeparator sep = new JSeparator(); JLabel titleItem = new JLabel(" " + title); // titleItem.setAlignmentX(0.5f); Font previousFont = titleItem.getFont(); Font futureFont = previousFont.deriveFont(Font.BOLD).deriveFont( (float) previousFont.getSize() + 1.0f); titleItem.setFont(futureFont); Color current = titleItem.getForeground(); Color future = current.brighter().brighter(); // titleItem.setBackground(future); titleItem.setForeground(future); add(titleItem); add(sep); if (!keep) { _disabled.add(sep); _disabled.add(titleItem); } } private void configMenuItem(JMenuItem mi, String command, String keyStroke, Container par) { configMenuItem(mi,command,keyStroke,par,false); } private void configMenuItem(JMenuItem mi, String command, String keyStroke, Container par, boolean disabled) { mi.setActionCommand(command); mi.addActionListener(_controlerMenu); if (keyStroke!=null) if (!keyStroke.equals("")) mi.setAccelerator(KeyStroke.getKeyStroke(keyStroke)); if (disabled) { _disabled.add(mi);} par.add(mi); } private JMenuItem createMenuItem(String caption, String command, String keyStroke, Container par, boolean disabled) { JMenuItem mi = new JMenuItem(caption); configMenuItem(mi, command,keyStroke, par, disabled); return mi; } private JMenuItem createMenuItem(String caption, String command, String keyStroke, Container par) { return createMenuItem(caption, command, keyStroke, par,false); } public void updateDialog() { for (int i = 0; i < _disabled.size(); i++) { JComponent j = _disabled.get(i); j.setVisible(_vp.isModifiable()); } _itemOptionSpecialBaseColored.setState(_vp.getColorSpecialBases()); _itemShowWarnings.setState(_vp.getShowWarnings()); _itemOptionGapsBaseColored.setState(_vp.getColorGapsBases()); _itemOptionGapsBaseColored.setEnabled(_vp.isComparisonMode()); _dashBasesColor.setEnabled(_vp.isComparisonMode()); _rotation.setEnabled(_vp.getDrawMode() != RNA.DRAW_MODE_LINEAR); _bpHeightIncrement.setEnabled(_vp.getDrawMode() == RNA.DRAW_MODE_LINEAR); _itemOptionBondsColored.setState(_vp.getUseBaseColorsForBPs()); _itemShowNCBP.setState(_vp.getShowNonCanonicalBP()); _itemShowOnlyPlanar.setState(!_vp.getShowNonPlanarBP()); _itemShowColorMap.setState(_vp.getColorMapVisible()); _itemFlatExteriorLoop.setState(_vp.getFlatExteriorLoop()); _itemFlatExteriorLoop.setEnabled(_vp.getDrawMode() == RNA.DRAW_MODE_RADIATE); } /** * Builds the popup menu */ public void buildPopupMenu() { addTitle("File", true); fileMenu(); exportMenu(); createMenuItem("Print...", "print", "control P", this); addSeparator(); addTitle("Display", true); viewMenu(); displayMenu(); JSeparator sep = new JSeparator(); add(sep); _disabled.add(sep); addTitle("Edit", false); editStructMenu(); redrawMenu(); colorClassesMenu(); annotationMenu(); _disabled.add(_itemShowNCBP); _disabled.add(_itemShowOnlyPlanar); aboutMenu(); } private void annotationMenu() { JMenu submenuAnnotations = new JMenu("Annotations"); JMenu addAnnotations = new JMenu("New"); createMenuItem("Here", "annotationsaddPosition", "", addAnnotations); createMenuItem("Base", "annotationsaddBase", "", addAnnotations); createMenuItem("Loop", "annotationsaddLoop", "", addAnnotations); createMenuItem("Helix", "annotationsaddHelix", "", addAnnotations); JSeparator sep = new JSeparator(); addAnnotations.add(sep); createMenuItem("Region", "annotationsaddRegion", "", addAnnotations); createMenuItem("Chem. prob.", "annotationsaddChemProb", "", addAnnotations); submenuAnnotations.add(addAnnotations); createMenuItem("Edit from list...", "annotationsedit", "", submenuAnnotations); createMenuItem("Remove from list...", "annotationsremove", "", submenuAnnotations); submenuAnnotations.addSeparator(); createMenuItem("Auto 5'/3'", "annotationsautoextremites", "control alt Q", submenuAnnotations); createMenuItem("Auto helices", "annotationsautohelices", "control Q", submenuAnnotations); createMenuItem("Auto interior loops", "annotationsautointerior", "alt shift Q", submenuAnnotations); createMenuItem("Auto terminal loops", "annotationsautoterminal", "control shift Q", submenuAnnotations); add(submenuAnnotations); } private void fileMenu() { createMenuItem("New...", "userInput", "control N", this,true); createMenuItem("Open...", "file", "control O", this,true); createMenuItem("Save...", "saveas", "control S", this,true); JMenu submenuSave = new JMenu("Save as"); createMenuItem("DBN (Vienna)", "dbn", "", submenuSave); createMenuItem("BPSEQ", "bpseq", "", submenuSave); createMenuItem("CT", "ct", "", submenuSave); add(submenuSave); } private void exportMenu() { // Export menu JMenu submenuExport = new JMenu("Export"); createMenuItem("SVG", "svg", "", submenuExport); createMenuItem("XFIG", "xfig", "", submenuExport); submenuExport.addSeparator(); createMenuItem("EPS", "eps", "", submenuExport); submenuExport.addSeparator(); createMenuItem("PNG", "png", "", submenuExport); createMenuItem("JPEG", "jpeg", "", submenuExport); add(submenuExport); } private void displayMenu() { // SubMenu Base-pairs JMenu subMenuBasePairs = new JMenu("Base Pairs"); createMenuItem("BP style...", "bpstyle", "control shift P", subMenuBasePairs); configMenuItem(_itemShowNCBP, "shownc", "control W", subMenuBasePairs); configMenuItem(_itemShowOnlyPlanar, "shownp", "control E", subMenuBasePairs); // SubMenu Non standard Bases JMenu subMenuNSBases = new JMenu("Non-standard bases"); configMenuItem(_itemOptionSpecialBaseColored, "specialbasecolored", "control J", subMenuNSBases); createMenuItem("Color", "specialBasesColor", "control shift J", subMenuNSBases); // SubMenu Gaps Bases JMenu subMenuGapsBases = new JMenu("'Gaps' bases"); configMenuItem(_itemOptionGapsBaseColored, "dashbasecolored", "control D", subMenuGapsBases); _dashBasesColor = createMenuItem("Color", "dashBasesColor", "control shift D", subMenuGapsBases); // Removable separator JSeparator sep = new JSeparator(); _disabled.add(sep); // Style menu JMenu submenuStyle = new JMenu("RNA style"); createMenuItem("Toggle 'Gaspin' mode", "gaspin", "alt G", submenuStyle,true); submenuStyle.add(subMenuBasePairs); submenuStyle.addSeparator(); submenuStyle.add(subMenuNSBases); submenuStyle.add(subMenuGapsBases); submenuStyle.add(sep); createMenuItem("Backbone color", "backbone", "control K", submenuStyle,true); // Submenu Title JMenu submenuTitle = new JMenu("Title"); createMenuItem("Set Title", "setTitle", "control T", submenuTitle, true); createMenuItem("Font", "titleDisplay", "control shift T", submenuTitle, true); createMenuItem("Color", "titleColor", "control alt T", submenuTitle, true); _disabled.add(submenuTitle); // Color map menu JMenu submenuColorMap = new JMenu("Color map"); configMenuItem(_itemShowColorMap, "toggleshowcolormap", "control shift L", submenuColorMap, false); createMenuItem("Caption", "colormapcaption", "control shift C", submenuColorMap,true); createMenuItem("Style...", "colormapstyle", "control L", submenuColorMap,false); submenuColorMap.addSeparator(); createMenuItem("Edit values...", "colormapvalues", "shift L", submenuColorMap,true); createMenuItem("Load values...", "colormaploadvalues", "control shift K", submenuColorMap,true); _disabled.add(submenuColorMap); // Menu Misc JMenu submenuMisc = new JMenu("Misc"); createMenuItem("Num. period.", "numPeriod", "control M", submenuMisc); createMenuItem("Background color", "background", "control G", submenuMisc); submenuMisc.add(submenuTitle); // Main menu add(submenuStyle); add(submenuColorMap); add(submenuMisc); } private void editStructMenu() { createMenuItem("BasePairs...","editallbps","",this,true); } private void redrawMenu() { JMenu submenuRedraw = new JMenu("Redraw"); _disabled.add(submenuRedraw); JMenu submenuAlgorithms = new JMenu("Algorithm"); _disabled.add(submenuAlgorithms); createMenuItem("Linear","line","control 1",submenuAlgorithms,true); createMenuItem("Circular","circular","control 2",submenuAlgorithms,true); createMenuItem("Radiate","radiate","control 3",submenuAlgorithms,true); createMenuItem("NAView","naview","control 4",submenuAlgorithms,true); //createMenuItem("VARNAView","varnaview","control 5",submenuAlgorithms,true); //createMenuItem("MOTIFView","motifview","control 6",submenuAlgorithms,true); submenuRedraw.add(submenuAlgorithms); // Sets the height increment in LINEAR_MODE type of drawing _bpHeightIncrement = createMenuItem("BP height increment","bpheightincrement","control H",submenuRedraw); configMenuItem(_itemFlatExteriorLoop, "flat", "control F", submenuRedraw, true); // Item pour le r�glage de l'espace entre chaques bases createMenuItem("Space between bases","spaceBetweenBases","control shift S",submenuRedraw,true); createMenuItem("Reset","reset","control shift R",submenuRedraw,true); add(submenuRedraw); } @SuppressWarnings("unused") private void warningMenu() { // Menu showWarning configMenuItem(_itemShowWarnings, "showwarnings", "", this, true); } private void viewMenu() { // View menu JMenu submenuView = new JMenu("View"); // Zoom submenu JMenu zoomDisplay = new JMenu("Zoom"); createMenuItem("25%","zoom25","",zoomDisplay); createMenuItem("50%","zoom50","",zoomDisplay); createMenuItem("100%","zoom100","",zoomDisplay); createMenuItem("150%","zoom150","",zoomDisplay); createMenuItem("200%","zoom200","",zoomDisplay); createMenuItem("Custom","zoom","control Z",zoomDisplay); submenuView.add(zoomDisplay); _rotation = createMenuItem("Rotation...","rotation","control R",submenuView); submenuView.addSeparator(); createMenuItem("Border size","borderSize","control B",submenuView); add(submenuView); } JMenu _subMenuBases; private Component _selectionMenuIndex = null; public void addSelectionMenu(JMenuItem s) { _selectionMenuIndex = s; _disabled.add(s); insert(s, getComponentCount() - 2); } public void removeSelectionMenu() { if (_selectionMenuIndex != null) { this.remove(_selectionMenuIndex); _selectionMenuIndex = null; } } private void colorClassesMenu() { // Menu Bases _subMenuBases = new JMenu("Colors"); _disabled.add(_subMenuBases); createMenuItem("By Base","eachKind","control U",_subMenuBases,true); createMenuItem("By BP","eachCouple","shift U",_subMenuBases,true); createMenuItem("By Position","eachBase","alt U",_subMenuBases,true); add(_subMenuBases); } /** * add default color options to a menu */ public void addColorOptions(JMenu submenu) { createMenuItem("Fill Color",submenu.getActionCommand() + ",InnerColor","",submenu,true); createMenuItem("Stroke Color",submenu.getActionCommand() + ",OutlineColor","",submenu,true); createMenuItem("Label Color",submenu.getActionCommand() + ",NameColor","",submenu,true); submenu.addSeparator(); createMenuItem("BP Color",submenu.getActionCommand() + ",BPColor","",submenu,true); createMenuItem("BP Thickness",submenu.getActionCommand() + ",BPThickness","",submenu,true); submenu.addSeparator(); createMenuItem("Number Color",submenu.getActionCommand() + ",NumberColor","",submenu,true); } private void aboutMenu() { addSeparator(); createMenuItem("About VARNA", "about", "control A", this); } public void addAnnotationMenu(JMenu menu) { addAnnotationMenu(menu, false); } public void addAnnotationMenu(JMenu menu, boolean existingAnnot) { String title = "Annotation"; if (existingAnnot) { String debut = ""; String texte = _vp.get_selectedAnnotation().getTexte(); if (texte.length() < 5) debut = texte; else debut = texte.substring(0, 5) + "..."; title = "Annotation: " + debut; } JMenu menuAnnotation = new JMenu(title); if (!existingAnnot) createMenuItem("Add",menu.getActionCommand() + "annotationadd","",menuAnnotation,true); createMenuItem("Edit",menu.getActionCommand() + "annotationedit","",menuAnnotation,true); createMenuItem("Remove",menu.getActionCommand() + "annotationremove","",menuAnnotation,true); menu.add(menuAnnotation); } public static long getSerialVersionUID() { return serialVersionUID; } public VARNAPanel get_vp() { return _vp; } public ControleurMenu get_controleurMenu() { return _controlerMenu; } public JCheckBoxMenuItem get_itemOptionSpecialBaseColored() { return _itemOptionSpecialBaseColored; } public JCheckBoxMenuItem get_itemShowWarnings() { return _itemShowWarnings; } public JCheckBoxMenuItem get_itemOptionDashBaseColored() { return _itemOptionGapsBaseColored; } public void set_controleurMenu(ControleurMenu menu) { _controlerMenu = menu; } public void set_itemOptionSpecialBaseColored( JCheckBoxMenuItem optionSpecialBaseColored) { _itemOptionSpecialBaseColored = optionSpecialBaseColored; } public void set_itemShowWarnings(JCheckBoxMenuItem showWarnings) { _itemShowWarnings = showWarnings; } public void set_itemOptionDashBaseColored( JCheckBoxMenuItem optionDashBaseColored) { _itemOptionGapsBaseColored = optionDashBaseColored; } public JMenuItem get_rotation() { return _rotation; } public void set_rotation(JMenuItem _rotation) { this._rotation = _rotation; } public JCheckBoxMenuItem get_itemOptionBondsColored() { return _itemOptionBondsColored; } public void set_itemOptionBondsColored(JCheckBoxMenuItem optionBondsColored) { _itemOptionBondsColored = optionBondsColored; } public void show(Component invoker,int x,int y) { _spawnOrigin = new Point(x,y); super.show(invoker,x,y); } public Point getSpawnPoint() { return _spawnOrigin ; } }PK 3F>~bY Y )fr/orsay/lri/varna/views/PrintPanel.class1#fr/orsay/lri/varna/views/PrintPaneljavax/swing/JPaneljava/awt/print/Printable()VCode  LineNumberTableLocalVariableTablethis%Lfr/orsay/lri/varna/views/PrintPanel;paintComponent(Ljava/awt/Graphics;)V  java/awt/Graphics2D  drawPage(Ljava/awt/Graphics2D;)VgLjava/awt/Graphics;g2Ljava/awt/Graphics2D;print2(Ljava/awt/Graphics;Ljava/awt/print/PageFormat;I)I Exceptions"java/awt/print/PrinterException $&%java/awt/print/PageFormat '( getImageableX()D $* +( getImageableY - ./ translate(DD)V1 java/awt/geom/Rectangle2D$Double $3 4(getImageableWidth $6 7(getImageableHeight 09 :(DDDD)V < =>draw(Ljava/awt/Shape;)VpfLjava/awt/print/PageFormat;pageI D EFgetFontRenderContext#()Ljava/awt/font/FontRenderContext;H java/awt/FontJSerif GL M(Ljava/lang/String;II)VOjava/awt/geom/GeneralPath N Rjava/awt/font/TextLayoutTHello QV WE(Ljava/lang/String;Ljava/awt/Font;Ljava/awt/font/FontRenderContext;)V@R []\java/awt/geom/AffineTransform ^_getTranslateInstance#(DD)Ljava/awt/geom/AffineTransform; Qa bc getOutline1(Ljava/awt/geom/AffineTransform;)Ljava/awt/Shape; Ne fgappend(Ljava/awt/Shape;Z)ViWorld@b m n>clippjava/awt/geom/Point2D$Double or / t uvgetWidth()I x yv getHeight{java/awt/geom/Line2D$Double z} ~1(Ljava/awt/geom/Point2D;Ljava/awt/geom/Point2D;)Vcontext!Ljava/awt/font/FontRenderContext;fLjava/awt/Font; clipShapeLjava/awt/geom/GeneralPath;layoutLjava/awt/font/TextLayout; transformLjava/awt/geom/AffineTransform;outlineLjava/awt/Shape;NLINESpLjava/awt/geom/Point2D;ixDyq SourceFilePrintTest.java InnerClassesjava/awt/geom/Line2DDoublejava/awt/geom/Point2Djava/awt/geom/Rectangle2D  /*  x  Z*++M*, z{ |}   ! 8+:,#,),0Y,2,58;* &  &-06 4888?@8AB + +CMGYIHKNNYP:QYS-,U:XZ:`:dQYh-,U:jZ:`:d+;+l26oYq: 6 C*sh h2l9 *wh1 dh2l9 oY  q:+zY |;  2 Z(1:BOXaiouy (1:yYBN JB .  z o 0 PK 3F>8p$qq(fr/orsay/lri/varna/views/PrintTest.class1""fr/orsay/lri/varna/views/PrintTestjava/lang/Object()VCode  LineNumberTableLocalVariableTablethis$Lfr/orsay/lri/varna/views/PrintTest;main([Ljava/lang/String;)V'fr/orsay/lri/varna/views/PrintTestFrame  javax/swing/JFrame setDefaultCloseOperation(I)V  showargs[Ljava/lang/String;frameLjavax/swing/JFrame; SourceFilePrintTest.java!/* 2  RYL++ 56 78   !PK 3F>Ti299/fr/orsay/lri/varna/views/PrintTestFrame$1.class1E)fr/orsay/lri/varna/views/PrintTestFrame$1java/lang/Objectjava/awt/event/ActionListenerthis$0)Lfr/orsay/lri/varna/views/PrintTestFrame;,(Lfr/orsay/lri/varna/views/PrintTestFrame;)VCode    ()VLineNumberTableLocalVariableTablethis+Lfr/orsay/lri/varna/views/PrintTestFrame$1;actionPerformed(Ljava/awt/event/ActionEvent;)V java/awt/print/PrinterJob  getPrinterJob()Ljava/awt/print/PrinterJob;  'fr/orsay/lri/varna/views/PrintTestFrame !"access$0P(Lfr/orsay/lri/varna/views/PrintTestFrame;)Lfr/orsay/lri/varna/views/PrintPanel; $ %& setPrintable(Ljava/awt/print/Printable;)V ( )*access$1[(Lfr/orsay/lri/varna/views/PrintTestFrame;)Ljavax/print/attribute/PrintRequestAttributeSet; , -. printDialog3(Ljavax/print/attribute/PrintRequestAttributeSet;)Z 0 12print3(Ljavax/print/attribute/PrintRequestAttributeSet;)V 465javax/swing/JOptionPane 78showMessageDialog)(Ljava/awt/Component;Ljava/lang/Object;)V:java/awt/print/PrinterExceptioneventLjava/awt/event/ActionEvent;jobLjava/awt/print/PrinterJob; exception!Ljava/awt/print/PrinterException; SourceFilePrintTest.javaEnclosingMethod InnerClasses0  8 *+ * O   5M,* #,* '+,* '/ M* ,3(+9& RSTU+W,X0Y1X4[*55;<'=>,?@ABCD PK 3F>P8__/fr/orsay/lri/varna/views/PrintTestFrame$2.class1/)fr/orsay/lri/varna/views/PrintTestFrame$2java/lang/Objectjava/awt/event/ActionListenerthis$0)Lfr/orsay/lri/varna/views/PrintTestFrame;,(Lfr/orsay/lri/varna/views/PrintTestFrame;)VCode    ()VLineNumberTableLocalVariableTablethis+Lfr/orsay/lri/varna/views/PrintTestFrame$2;actionPerformed(Ljava/awt/event/ActionEvent;)V java/awt/print/PrinterJob  getPrinterJob()Ljava/awt/print/PrinterJob;  'fr/orsay/lri/varna/views/PrintTestFrame !"access$1[(Lfr/orsay/lri/varna/views/PrintTestFrame;)Ljavax/print/attribute/PrintRequestAttributeSet; $ %& pageDialogM(Ljavax/print/attribute/PrintRequestAttributeSet;)Ljava/awt/print/PageFormat;eventLjava/awt/event/ActionEvent;jobLjava/awt/print/PrinterJob; SourceFilePrintTest.javaEnclosingMethod InnerClasses0  8 *+ * `   WM,* #Wbcd '( )*+,-. PK 3F>@G-fr/orsay/lri/varna/views/PrintTestFrame.class1a'fr/orsay/lri/varna/views/PrintTestFramejavax/swing/JFramecanvas%Lfr/orsay/lri/varna/views/PrintPanel; attributes0Ljavax/print/attribute/PrintRequestAttributeSet;WIDTHI ConstantValue,HEIGHT()VCode   PrintTest  setTitle(Ljava/lang/String;)V  setSize(II)V   getContentPane()Ljava/awt/Container;"#fr/orsay/lri/varna/views/PrintPanel ! % 'Center )+*java/awt/Container ,-add)(Ljava/awt/Component;Ljava/lang/Object;)V/2javax/print/attribute/HashPrintRequestAttributeSet . 2 4javax/swing/JPanel 37javax/swing/JButton9Print 6;  3= ,>*(Ljava/awt/Component;)Ljava/awt/Component;@)fr/orsay/lri/varna/views/PrintTestFrame$1 ?B C,(Lfr/orsay/lri/varna/views/PrintTestFrame;)V 6E FGaddActionListener"(Ljava/awt/event/ActionListener;)VI Page setupK)fr/orsay/lri/varna/views/PrintTestFrame$2 JBNNorthLineNumberTableLocalVariableTablethis)Lfr/orsay/lri/varna/views/PrintTestFrame; contentPaneLjava/awt/Container; buttonPanelLjavax/swing/JPanel; printButtonLjavax/swing/JButton;pageSetupButtonaccess$0P(Lfr/orsay/lri/varna/views/PrintTestFrame;)Lfr/orsay/lri/varna/views/PrintPanel;access$1[(Lfr/orsay/lri/varna/views/PrintTestFrame;)Ljavax/print/attribute/PrintRequestAttributeSet; SourceFilePrintTest.java InnerClasses       ***,,*L*!Y#$+*$&(*.Y013Y5M6Y8:N,-= 1) return Printable.NO_SUCH_PAGE; Graphics2D g2 = (Graphics2D) g; g2.translate(pf.getImageableX(), pf.getImageableY()); g2.draw(new Rectangle2D.Double(0, 0, pf.getImageableWidth(), pf .getImageableHeight())); drawPage(g2); return Printable.PAGE_EXISTS; } /** * This method draws the page both on the screen and the printer graphics * context. * * @param g2 * the graphics context */ public void drawPage(Graphics2D g2) { FontRenderContext context = g2.getFontRenderContext(); Font f = new Font("Serif", Font.PLAIN, 72); GeneralPath clipShape = new GeneralPath(); TextLayout layout = new TextLayout("Hello", f, context); AffineTransform transform = AffineTransform.getTranslateInstance(0, 72); Shape outline = layout.getOutline(transform); clipShape.append(outline, false); layout = new TextLayout("World", f, context); transform = AffineTransform.getTranslateInstance(0, 144); outline = layout.getOutline(transform); clipShape.append(outline, false); g2.draw(clipShape); g2.clip(clipShape); final int NLINES = 50; Point2D p = new Point2D.Double(0, 0); for (int i = 0; i < NLINES; i++) { double x = (2 * getWidth() * i) / NLINES; double y = (2 * getHeight() * (NLINES - 1 - i)) / NLINES; Point2D q = new Point2D.Double(x, y); g2.draw(new Line2D.Double(p, q)); } } }PK 3F>O 'fr/orsay/lri/varna/views/VueBases.class1!fr/orsay/lri/varna/views/VueBasesjavax/swing/JPanelserialVersionUIDJ ConstantValue KIND_MODEIALL_MODE COUPLE_MODE_mode_vpLfr/orsay/lri/varna/VARNAPanel;dataLjava/util/ArrayList; Signature;Ljava/util/ArrayList;revdataLjava/util/Hashtable;MLjava/util/Hashtable;tableLjavax/swing/JTable;specialTableModel.Lfr/orsay/lri/varna/components/BaseTableModel;#(Lfr/orsay/lri/varna/VARNAPanel;I)VCode#java/awt/GridLayout "% &(II)V ( )(Ljava/awt/LayoutManager;)V+java/util/ArrayList *- .()V 0 2java/util/Hashtable 1- 5  7  9  ; <.kindMode > ?.allMode A B. coupleModeLineNumberTableLocalVariableTablethis#Lfr/orsay/lri/varna/views/VueBases;vpmodelocateOrAddList8(Ljava/lang/String;)Lfr/orsay/lri/varna/models/BaseList; 1L MN containsKey(Ljava/lang/Object;)ZP"fr/orsay/lri/varna/models/BaseList OR S(Ljava/lang/String;)V 1U VWput8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; *Y ZNadd 1\ ]^get&(Ljava/lang/Object;)Ljava/lang/Object;captionLjava/lang/String;mbl$Lfr/orsay/lri/varna/models/BaseList; dfefr/orsay/lri/varna/VARNAPanel ghgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; jlk!fr/orsay/lri/varna/models/rna/RNA mnget_listeBases()Ljava/util/ArrayList; *p ]q(I)Ljava/lang/Object;s(fr/orsay/lri/varna/models/rna/ModeleBase ru vwgetElementStructure()I ry z{ getContent()Ljava/lang/String;}java/lang/StringBuilder java/lang/String valueOf&(Ljava/lang/Object;)Ljava/lang/String; |R- | append-(Ljava/lang/String;)Ljava/lang/StringBuilder; | {toString  IJ O addBase-(Lfr/orsay/lri/varna/models/rna/ModeleBase;)V * wsize  . createView pairStringijtmp1tmp2bl |- | (I)Ljava/lang/StringBuilder;mb*Lfr/orsay/lri/varna/models/rna/ModeleBase;,fr/orsay/lri/varna/components/BaseTableModel (Ljava/util/ArrayList;)V  javax/swing/JTable !(Ljavax/swing/table/TableModel;)V  java/awt/Dimension % "setPreferredScrollableViewportSize(Ljava/awt/Dimension;)Vjavax/swing/JScrollPane (Ljava/awt/Component;)Vjava/awt/Color+fr/orsay/lri/varna/components/ColorRenderer (Z)V setDefaultRenderer9(Ljava/lang/Class;Ljavax/swing/table/TableCellRenderer;)V4fr/orsay/lri/varna/components/BaseSpecialColorEditor &(Lfr/orsay/lri/varna/views/VueBases;)V setDefaultEditor7(Ljava/lang/Class;Ljavax/swing/table/TableCellEditor;)V  Z*(Ljava/awt/Component;)Ljava/awt/Component;  . UIvueBases scrollPaneLjavax/swing/JScrollPane; javax/swing/JComponent  setOpaqueBase Colors Edition javax/swing/JOptionPane showMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)VnewContentPaneLjavax/swing/JComponent;getMode getDataAt'(I)Lfr/orsay/lri/varna/models/BaseList;getData=()Ljava/util/ArrayList;get_vp!()Lfr/orsay/lri/varna/VARNAPanel;getTable()Ljavax/swing/JTable;setTable(Ljavax/swing/JTable;)VgetSpecialTableModel0()Lfr/orsay/lri/varna/components/BaseTableModel;setSpecialTableModel1(Lfr/orsay/lri/varna/components/BaseTableModel;)V SourceFile VueBases.java!       !i*"Y$'**Y,/*1Y34*+6?'3*8*:*8*=*8*@C>I @B#J(KDMINMOPQURYS\UaVeWh[D iEFiGiH IJ!3*4+KOY+QM*4+,TW*/,XW*4+[OC_ abc'eD 3EF3_`abB.!C=*6ciort>|*6ciorx:*6ciorx:|Y~L*+:*6cior*6cior*6ci\*C2 jlmn5oKpeqlrsjvwDHEFe3` ~ 5c`KM`l,b?.!H<0*6ciorM*|YN-,*6ci*Cz{|*}/zCGD*HEFA *b<.!B<**6ciorM,xN*-:,*6ci*C"#)=AD4BEF;  `#b.!k*Y*/*Y**Y,Y*L*YĶ*Y*Ͷ*+W*ױC& 2>O`fjDkEF>-.![*L+*6+C DEFw!/*8CD EF!@ */oOCD EF n!/*/CD EF!/*6CD EF!/*CD EF!>*+C DEF!/*CD EF!>*+C DEFPK qq<(2&fr/orsay/lri/varna/views/VueBases.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.util.ArrayList; import java.util.Hashtable; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.components.BaseSpecialColorEditor; import fr.orsay.lri.varna.components.BaseTableModel; import fr.orsay.lri.varna.components.ColorRenderer; import fr.orsay.lri.varna.models.BaseList; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; public class VueBases extends JPanel { /** * */ private static final long serialVersionUID = 1L; /** * for bases by kind */ public final static int KIND_MODE = 1; /** * for all bases */ public final static int ALL_MODE = 2; /** * for base pairs by king */ public final static int COUPLE_MODE = 3; private int _mode; private VARNAPanel _vp; private ArrayList data = new ArrayList(); private Hashtable revdata = new Hashtable(); private JTable table; private BaseTableModel specialTableModel; public VueBases(VARNAPanel vp, int mode) { super(new GridLayout(1, 0)); _vp = vp; switch (mode) { case (KIND_MODE): _mode = KIND_MODE; kindMode(); break; case (ALL_MODE): _mode = ALL_MODE; allMode(); break; case (COUPLE_MODE): _mode = COUPLE_MODE; coupleMode(); break; default: break; } } private BaseList locateOrAddList(String caption) { if (!revdata.containsKey(caption)) { BaseList mbl = new BaseList(caption); revdata.put(caption,mbl); data.add(mbl); } return revdata.get(caption); } private void coupleMode() { String pairString; for (int i = 0; i < _vp.getRNA().get_listeBases().size(); i++) { int j = _vp.getRNA().get_listeBases().get(i).getElementStructure(); if (j > i) { String tmp1 = (_vp.getRNA().get_listeBases().get(i).getContent()); String tmp2 = (_vp.getRNA().get_listeBases().get(j).getContent()); pairString = tmp1 +"-"+ tmp2; BaseList bl = locateOrAddList(pairString); bl.addBase(_vp.getRNA().get_listeBases().get(i)); bl.addBase(_vp.getRNA().get_listeBases().get(j)); } } createView(); } private void allMode() { for (int i = 0; i < _vp.getRNA().get_listeBases().size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get(i); BaseList bl = locateOrAddList(""+i); bl.addBase(mb); } createView(); } private void kindMode() { for (int i = 0; i < _vp.getRNA().get_listeBases().size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get(i); String tmp1 = (mb.getContent()); BaseList bl = locateOrAddList(tmp1); bl.addBase(mb); } createView(); } private void createView() { specialTableModel = new BaseTableModel(data); table = new JTable(specialTableModel); table.setPreferredScrollableViewportSize(new Dimension(500, 300)); // TODO: Find equivalent in JRE 1.5 //table.setFillsViewportHeight(true); // Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); // Set up renderer and editor for the Favorite Color column. table.setDefaultRenderer(Color.class, new ColorRenderer(true)); table.setDefaultEditor(Color.class, new BaseSpecialColorEditor(this)); // Add the scroll pane to this panel. add(scrollPane); UIvueBases(); } /** * Create the GUI and show it. For thread safety, this method should be * invoked from the event-dispatching thread. */ public void UIvueBases() { // Create and set up the content pane. JComponent newContentPane = this; newContentPane.setOpaque(true); // content panes must be opaque JOptionPane.showMessageDialog(_vp, newContentPane, "Base Colors Edition", JOptionPane.PLAIN_MESSAGE); } public int getMode() { return _mode; } public BaseList getDataAt(int i) { return data.get(i); } public ArrayList getData() { return data; } public VARNAPanel get_vp() { return _vp; } public JTable getTable() { return table; } public void setTable(JTable table) { this.table = table; } public BaseTableModel getSpecialTableModel() { return specialTableModel; } public void setSpecialTableModel(BaseTableModel specialTableModel) { this.specialTableModel = specialTableModel; } } PK 3F>#l#l#,fr/orsay/lri/varna/views/VueAnnotation.class1&fr/orsay/lri/varna/views/VueAnnotationjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;ySliderLjavax/swing/JSlider;xSlider colorButtonLjavax/swing/JButton;textAreaLjavax/swing/JTextArea;panelLjavax/swing/JPanel;textAnnotation6Lfr/orsay/lri/varna/models/annotations/TextAnnotation;textAnnotationSavevueFont"Lfr/orsay/lri/varna/views/VueFont;_controleurVueAnnotation7Lfr/orsay/lri/varna/controlers/ControleurVueAnnotation; newAnnotationZlimitedpositionLjava/awt/geom/Point2D$Double;rotationSlider#(Lfr/orsay/lri/varna/VARNAPanel;Z)VCode !#"fr/orsay/lri/varna/VARNAPanel $%getExtendedRNABBox$()Ljava/awt/geom/Rectangle2D$Double; ')( java/awt/geom/Rectangle2D$Double *+xD '- .+width@ '2 3+y '5 6+height 8 9%(Lfr/orsay/lri/varna/VARNAPanel;IIZ)VLineNumberTableLocalVariableTablethis(Lfr/orsay/lri/varna/views/VueAnnotation;vp"(Lfr/orsay/lri/varna/VARNAPanel;)V A $(Lfr/orsay/lri/varna/VARNAPanel;II)VIE4fr/orsay/lri/varna/models/annotations/TextAnnotationG DI J(Ljava/lang/String;DD)V L MZ(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/TextAnnotation;ZZ)VY(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/TextAnnotation;Z)V DP QRgetType()I textAnnot U V()V X  Z  \  ^  D` abclone8()Lfr/orsay/lri/varna/models/annotations/TextAnnotation; d  !f ghgetListeAnnotations()Ljava/util/ArrayList; jlkjava/util/ArrayList mncontains(Ljava/lang/Object;)Z !p qr addAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)Vt5fr/orsay/lri/varna/controlers/ControleurVueAnnotation sv w+(Lfr/orsay/lri/varna/views/VueAnnotation;)V y  D{ |}getCenterPosition ()Ljava/awt/geom/Point2D$Double;  javax/swing/JPanel U  java/awt/GridLayout (II)V  setLayout(Ljava/awt/LayoutManager;)Vjava/awt/FlowLayout (I)Vjavax/swing/JSlider 2java/awt/geom/Point2D$Double java/lang/Math min(II)I max (IIII)V   setMajorTickSpacing setMinorTickSpacing  setPaintTicks(Z)V setPaintLabelsjava/awt/Dimension getPreferredSize()Ljava/awt/Dimension; 6C setPreferredSize(Ljava/awt/Dimension;)Vjavax/swing/JLabel java/lang/String valueOf(D)Ljava/lang/String; (Ljava/lang/String;)V 3fr/orsay/lri/varna/controlers/ControleurSliderLabel (Ljavax/swing/JLabel;Z)V addChangeListener%(Ljavax/swing/event/ChangeListener;)V )  Y:X: add*(Ljava/awt/Component;)Ljava/awt/Component;java/awt/BorderLayout Ujavax/swing/JTextArea D getTexte()Ljava/lang/String;  addCaretListener$(Ljavax/swing/event/CaretListener;)V getSize /javax/swing/plaf/basic/BasicBorders$FieldBorder java/awt/Color blackLjava/awt/Color; C(Ljava/awt/Color;Ljava/awt/Color;Ljava/awt/Color;Ljava/awt/Color;)V   setBorder(Ljavax/swing/border/Border;)VText:Center   )(Ljava/awt/Component;Ljava/lang/Object;)V North fr/orsay/lri/varna/views/VueFont D getFont()Ljava/awt/Font;   (Ljava/awt/Font;)V      getBoxPolice()Ljavax/swing/JComboBox; javax/swing/JComboBox  !addActionListener"(Ljava/awt/event/ActionListener;)V  # $% getSizeSlider()Ljavax/swing/JSlider;  ' ( getStylesBox*javax/swing/JButton, Set color ) / 1setcolor )3 4setActionCommand D6 78getColor()Ljava/awt/Color; ): ;< setForeground(Ljava/awt/Color;)V )  ? @AgetPanel()Ljavax/swing/JPanel; DC DEgetAngleInDegres()D G  I J(I)Ljava/lang/String;LRotation (degrees): N O setEnabled Q RSrequestFocusInWindow()Zreduitepypx yValueLabelLjavax/swing/JLabel; xValueLabellabelYlabelX panelTexteborderLjavax/swing/border/Border; labelTexte fontAndColor rotationPanel rotationLabellabelZ applyFont   Dg hsetFontupdate k dV m nRgetValue Dp qr setAncrage(DD)V t ugetText Dw xsetTexte Dz {|setAngleInDegres(D)V !~ VclearSelection ! VrepaintgetTextAnnotationget_vp!()Lfr/orsay/lri/varna/VARNAPanel;show ! rset_selectedAnnotation ! VhighlightSelectedAnnotation ?Add/edit annotation javax/swing/JOptionPane showConfirmDialog=(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;II)I  iV ! removeAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)Zjava/lang/ExceptionImpossible de supprimer  !  errorDialog(Ljava/lang/Exception;)V D rcopy ! VresetAnnotationHighlight isLimited setLimitedisNewAnnotation updateColor D <setColorc SourceFileVueAnnotation.java InnerClassesjava/awt/geom/Point2DDoublejava/awt/geom/Rectangle2D#javax/swing/plaf/basic/BasicBorders FieldBorder!    /*++ &+ ,/oc+ 1+ 4/oc7:EFGH*I.J; /<=/>/??*+@: RS;<=>BU *+7: \];* <= > *C 3C9k *+DYFHK: fg;4<=>*C3CN`*+,,OK: qr;*<=>SM t*T*W*Y*+[*,]**]_c*[e,i*[*]o*sY*ux**]z~Y:Y:*Y*YYY*Y*[ 4*[ 4*~*[ 1g**d***Y*Y*~*[ 1g·:Y2˴*Y϶**x*Y*[ ,*[ ,*~*[ &g**d***׻Y*׶Y*~֎*[ &g·:Y2˴*׻Y϶**xһYٷ: Y۷:  W*WW W*׶WWY:  Y*Y*]**x* Y: * Y:  *   * W* Y,**x*"*x*&*x*)Y+-.*.02*.,59*.*x=Y:*>W*.W*WY:*Yh*]BF*F<*F*F*FY2YH:Y2˴*FY϶*F*xһYK:W*FWW*W*M*M*FM*PW:w $2=IT]fq#16>ILP]ho{ *5@KS]emw$2@NXcnw &2:DL S [ c ks;t<=t>tStTt]UfV6>WXqYX@4ZX K)[X \ ]^ _X w`abX2BcXdV=*]*ef: ; <=iVg*j*]O0*]*׶l*[ &c*l*[ 1co*]*sv*]*Fly*[}*[:. -8;I X!_"f#; g<=@A/*:&; <=b/*]:.; <=/*[:2; <=V*[*]*[*[* *?*Y-*[*[*]"*[Y*]*c*[*[*[:B@ ABCDB%E,G3H;IIJ]LhOoPwQ~R; <=S/*W:U; <=>*W: YZ;<=S/*Y:]; <=<M*.+9*]+:abd;<= '  PK qq * if validate, just update the annoted text *

* if cancelled : remove the annoted text if it was a new one, otherwise * cancel modifications *

* */ public void show() { _vp.set_selectedAnnotation(textAnnotation); _vp.highlightSelectedAnnotation(); if (JOptionPane.showConfirmDialog(_vp, getPanel(), "Add/edit annotation", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) { update(); } else { if (newAnnotation) { _vp.set_selectedAnnotation(null); if (!_vp.removeAnnotation(textAnnotation)) _vp.errorDialog(new Exception("Impossible de supprimer")); } else { textAnnotation.copy(textAnnotationSave); } } _vp.resetAnnotationHighlight(); _vp.set_selectedAnnotation(null); _vp.repaint(); } public boolean isLimited() { return limited; } public void setLimited(boolean limited) { this.limited = limited; } public boolean isNewAnnotation() { return this.newAnnotation; } public void updateColor(Color c) { colorButton.setForeground(c); textAnnotation.setColor(c); } } PK 3F>ӱY Y 3fr/orsay/lri/varna/views/VueSpaceBetweenBases.class1-fr/orsay/lri/varna/views/VueSpaceBetweenBasesjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;panelLjavax/swing/JPanel; spaceSliderLjavax/swing/JSlider;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  javax/swing/JPanel   javax/swing/JSlider fr/orsay/lri/varna/VARNAPanel getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !#"!fr/orsay/lri/varna/models/rna/RNA $%get_spaceBetweenBases()Ljava/lang/Double; ')(java/lang/Double *+ doubleValue()D@Y /10java/lang/Math 23round(D)J 576java/lang/String 89valueOf(J)Ljava/lang/String; ;=<java/lang/Integer 8>'(Ljava/lang/String;)Ljava/lang/Integer; ;@ ABintValue()I D E(IIII)V G I JKsetMajorTickSpacing(I)V M NO setPaintTicks(Z)V Q ROsetPaintLabelsTjavax/swing/JLabel 5V 8W(D)Ljava/lang/String; SY Z(Ljava/lang/String;)V\java/awt/Dimension S^ _`getPreferredSize()Ljava/awt/Dimension; [b cdheightI [f g(II)V Si jksetPreferredSize(Ljava/awt/Dimension;)Vm3fr/orsay/lri/varna/controlers/ControleurSliderLabel lo p(Ljavax/swing/JLabel;Z)V r staddChangeListener%(Ljavax/swing/event/ChangeListener;)Vv9fr/orsay/lri/varna/controlers/ControleurSpaceBetweenBases ux y2(Lfr/orsay/lri/varna/views/VueSpaceBetweenBases;)V{java/awt/FlowLayout z} K   setLayout(Ljava/awt/LayoutManager;)VSpace:  add*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis/Lfr/orsay/lri/varna/views/VueSpaceBetweenBases;vp spaceLabelLjavax/swing/JLabel;labelSget_vp!()Lfr/orsay/lri/varna/VARNAPanel;getPanel()Ljavax/swing/JPanel;getSpace  BgetValue ' 8(D)Ljava/lang/Double; SourceFileVueSpaceBetweenBases.java!    **+*Y*Y * &,k.4:?CF*FH*FL*FPSY,* &kUXM,[Y2,]aeh*FlY,nq*FuY*wq*Y*zY|~SYXN*-W**FW*,Wr%& ')*&+/*?)B-K.S/[1b2s1w3~4356579:<>?@A*wv /*D  /*H % :*F,oL PK qq<  2fr/orsay/lri/varna/views/VueSpaceBetweenBases.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Dimension; import java.awt.FlowLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSlider; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurSliderLabel; import fr.orsay.lri.varna.controlers.ControleurSpaceBetweenBases; public class VueSpaceBetweenBases { private VARNAPanel _vp; private JPanel panel; private JSlider spaceSlider; public VueSpaceBetweenBases(VARNAPanel vp) { _vp = vp; panel = new JPanel(); spaceSlider = new JSlider(JSlider.HORIZONTAL, 10, 200, Integer .valueOf(String.valueOf(Math.round(_vp.getRNA() .get_spaceBetweenBases() * 100)))); // Turn on labels at major tick marks. spaceSlider.setMajorTickSpacing(30); spaceSlider.setPaintTicks(true); spaceSlider.setPaintLabels(true); JLabel spaceLabel = new JLabel(String.valueOf(100.0 * _vp.getRNA() .get_spaceBetweenBases())); spaceLabel.setPreferredSize(new Dimension(50, spaceLabel .getPreferredSize().height)); spaceSlider.addChangeListener(new ControleurSliderLabel(spaceLabel, false)); spaceSlider.addChangeListener(new ControleurSpaceBetweenBases(this)); panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT)); JLabel labelS = new JLabel("Space:"); panel.add(labelS); panel.add(spaceSlider); panel.add(spaceLabel); } public VARNAPanel get_vp() { return _vp; } public JPanel getPanel() { return panel; } public Double getSpace() { return spaceSlider.getValue() / 100.0; } } PK 3F># +fr/orsay/lri/varna/views/VueNumPeriod.class1%fr/orsay/lri/varna/views/VueNumPeriodjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;panelLjavax/swing/JPanel;numPeriodSliderLjavax/swing/JSlider;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  javax/swing/JPanel    fr/orsay/lri/varna/VARNAPanel getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; ! !fr/orsay/lri/varna/models/rna/RNA "#get_listeBases()Ljava/util/ArrayList; %'&java/util/ArrayList ()size()I+javax/swing/JSlider - .) getNumPeriod 021java/lang/Math 34min(II)I *6 7(IIII)V 9 *; <=setMajorTickSpacing(I)V *? @=setMinorTickSpacing *B CD setPaintTicks(Z)V *F GDsetPaintLabelsIjavax/swing/JLabel K LMget_spaceBetweenBases()Ljava/lang/Double; OQPjava/lang/String RSvalueOf&(Ljava/lang/Object;)Ljava/lang/String; HU V(Ljava/lang/String;)VXjava/awt/Dimension HZ [\getPreferredSize()Ljava/awt/Dimension; W^ _`heightI Wb c(II)V He fgsetPreferredSize(Ljava/awt/Dimension;)Vi3fr/orsay/lri/varna/controlers/ControleurSliderLabel hk l(Ljavax/swing/JLabel;Z)V *n opaddChangeListener%(Ljavax/swing/event/ChangeListener;)Vr1fr/orsay/lri/varna/controlers/ControleurNumPeriod qt u*(Lfr/orsay/lri/varna/views/VueNumPeriod;)Vwjava/awt/FlowLayout vy = { |} setLayout(Ljava/awt/LayoutManager;)V NumPeriod:  add*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis'Lfr/orsay/lri/varna/views/VueNumPeriod;vp maxPeriodnumLabelLjavax/swing/JLabel;labelSget_vp!()Lfr/orsay/lri/varna/VARNAPanel;getPanel()Ljavax/swing/JPanel; * )getValue SourceFileVueNumPeriod.java!   **+*Y*$=**Y*,/58*8 :*8>*8A*8EHY*JNTN-WY2-Y]ad*8hY-jm*8qY*sm*Y*vYxzHY~T:*W**8W*-Wr%& ')"**+8*;-D.L/T0\2`3j2q4x546768:;=?@AB4"`qx  /*E  /*I .) 2*8M PK qq6K(fr/orsay/lri/varna/views/VueBPType.class1"fr/orsay/lri/varna/views/VueBPTypejava/lang/Objectjava/awt/event/ActionListener_vpLfr/orsay/lri/varna/VARNAPanel;_msbp-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;_edge5Ljavax/swing/JComboBox;_edge3 _stericitypanelLjavax/swing/JPanel;O(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)VCode  ()V    0fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge  values5()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; "$#+fr/orsay/lri/varna/models/rna/ModeleStyleBP %&getEdgePartner54()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;(javax/swing/JComboBox '* +([Ljava/lang/Object;)V - '/ 01setSelectedIndex(I)V "3 4&getEdgePartner3 6 8:95fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity ;:()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity; "= >? getStericity9()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity; A  'C DEaddActionListener"(Ljava/awt/event/ActionListener;)VGjavax/swing/JPanel F J Ljava/awt/FlowLayout KN 1 FP QR setLayout(Ljava/awt/LayoutManager;)VTjavax/swing/JLabelV 5' edge: SX Y(Ljava/lang/String;)V[ 3' edge: ] Stericity: F_ `aadd*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis$Lfr/orsay/lri/varna/views/VueBPType;vpmsbpedges3[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;bck2Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;iIsters8[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;bcks7Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;label5Ljavax/swing/JLabel;label3labelSgetPanel()Ljavax/swing/JPanel;getEdge5 'z {|getSelectedItem()Ljava/lang/Object;getEdge3get_vp!()Lfr/orsay/lri/varna/VARNAPanel;actionPerformed(Ljava/awt/event/ActionEvent;)V  x& " setEdge55(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;)V  }& " setEdge3 = "  setStericity:(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;)V fr/orsay/lri/varna/VARNAPanel repainteLjava/awt/event/ActionEvent; SourceFileVueBPType.java InnerClassesEdge Stericity!     L**+*,N,!:*'Y-),6-2 *,.-,2:*'Y-)56-2 *5.-7:,<:*'Y)@62 *@.*,*B*5*B*@*B*FYHI*IKYMOSYUW:SYZW:SY\W: *I^W*I*,^W*I^W*I*5^W*I ^W*I*@^Wb&)* +-./$0*132<0F5L6X7^8g9p7z<=>?@A?DEFHIKLM OPQ)R5S?TKUc LdeLfLg :hi4jk'lm[lmnopq!lmYrsNts Cus vw/*IbXc dex&5 *,yb\c  de}&5 *5yb`c  de>?5 *@y8bdc  de~/*bhc dem)*******bl mn!o(pc)de)"@8"@PK qq<58 'fr/orsay/lri/varna/views/VueBPType.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JPanel; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; public class VueBPType implements ActionListener { private VARNAPanel _vp; ModeleStyleBP _msbp; private JComboBox _edge5; private JComboBox _edge3; private JComboBox _stericity; private JPanel panel; public VueBPType(VARNAPanel vp, ModeleStyleBP msbp) { _vp = vp; _msbp = msbp; ModeleStyleBP.Edge[] edges = ModeleStyleBP.Edge.values(); ModeleStyleBP.Edge bck = msbp.getEdgePartner5(); _edge5 = new JComboBox(edges); for (int i = 0; i < edges.length; i++) { if (edges[i] == bck) _edge5.setSelectedIndex(i); } bck = msbp.getEdgePartner3(); _edge3 = new JComboBox(edges); for (int i = 0; i < edges.length; i++) { if (edges[i] == bck) _edge3.setSelectedIndex(i); } ModeleStyleBP.Stericity[] sters = ModeleStyleBP.Stericity.values(); ModeleStyleBP.Stericity bcks = msbp.getStericity(); _stericity = new JComboBox(sters); for (int i = 0; i < sters.length; i++) { if (sters[i] == bcks) _stericity.setSelectedIndex(i); } _edge5.addActionListener(this); _edge3.addActionListener(this); _stericity.addActionListener(this); panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT)); JLabel label5 = new JLabel("5' edge: "); JLabel label3 = new JLabel("3' edge: "); JLabel labelS = new JLabel("Stericity: "); panel.add(label5); panel.add(_edge5); panel.add(label3); panel.add(_edge3); panel.add(labelS); panel.add(_stericity); } public JPanel getPanel() { return panel; } public ModeleStyleBP.Edge getEdge5() { return (ModeleStyleBP.Edge) _edge5.getSelectedItem(); } public ModeleStyleBP.Edge getEdge3() { return (ModeleStyleBP.Edge) _edge3.getSelectedItem(); } public ModeleStyleBP.Stericity getStericity() { return (ModeleStyleBP.Stericity) _stericity.getSelectedItem(); } public VARNAPanel get_vp() { return _vp; } public void actionPerformed(ActionEvent e) { _msbp.setEdge5(getEdge5()); _msbp.setEdge3(getEdge3()); _msbp.setStericity(getStericity()); _vp.repaint(); } } PK 3F>;88&fr/orsay/lri/varna/views/VueJPEG.class1_ fr/orsay/lri/varna/views/VueJPEGjava/lang/Object qualitySliderLjavax/swing/JSlider; scaleSliderpanelLjavax/swing/JPanel;(ZZ)VCode  ()Vjavax/swing/JSlider  (IIII)V    setMajorTickSpacing(I)V   setPaintTicks(Z)V  !setPaintLabels#java/awt/Dimension "% &(II)V ( )*setPreferredSize(Ljava/awt/Dimension;)V , .javax/swing/JPanel - 1  3java/awt/GridLayout 2% -6 78 setLayout(Ljava/awt/LayoutManager;)V:java/awt/FlowLayout 9< >javax/swing/JLabel@ Resolution: =B C(Ljava/lang/String;)VEQuality: -G HIadd*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis"Lfr/orsay/lri/varna/views/VueJPEG; showQualityZ showScalepuppdownnbPanelsIlseqLjavax/swing/JLabel;lstrgetQualitySlider()Ljavax/swing/JSlider;getScaleSlidergetPanel()Ljavax/swing/JPanel; SourceFile VueJPEG.java!   ** *Y dK****"Y2$'*YXd+*+"Y2$'*+d*+*+*-Y/0-Y/N-Y/:6*02Y45-9Y;59Y;5=Y?A:=YDA:-FW-*+FWFW*FW *0-FW *0FWJ!%&'(&).*A+S,f-o.w/0123456789:<=>?@ABCEF)HKR*LM*NO*POQ R STIUV>WVXY /*JKK LMZY /*+JOK LM[\ /*0JSK LM]^PK qq㭫:fr/orsay/lri/varna/views/VueAboutPanel$AboutAnimator.class1^4fr/orsay/lri/varna/views/VueAboutPanel$AboutAnimatorjava/lang/Thread_vpLfr/orsay/lri/varna/VARNAPanel; _structuresLjava/util/ArrayList; Signature)Ljava/util/ArrayList; _sequences_periodI_overZthis$0(Lfr/orsay/lri/varna/views/VueAboutPanel;J(Lfr/orsay/lri/varna/views/VueAboutPanel;Lfr/orsay/lri/varna/VARNAPanel;)VCode    ()Vjava/util/ArrayList      " $  & LineNumberTableLocalVariableTablethis6Lfr/orsay/lri/varna/views/VueAboutPanel$AboutAnimator;vpaddRNA'(Ljava/lang/String;Ljava/lang/String;)V / 01add(Ljava/lang/Object;)ZseqLjava/lang/String;str gracefulStoprun 8 9:sleep(J)V < =>get(I)Ljava/lang/Object;@java/lang/String BDCfr/orsay/lri/varna/VARNAPanel E-drawRNAInterpolated I JKsize()I MONjava/lang/InterruptedException PprintStackTrace ROS5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthie Ljava/lang/InterruptedException;7Lfr/orsay/lri/varna/exceptions/ExceptionNonEqualLength; SourceFileVueAboutPanel.java InnerClasses\&fr/orsay/lri/varna/views/VueAboutPanel AboutAnimator     }1*+**Y*Y*е!*#*,%'~ xyz&{+(1)*1+,-Y*+.W*,.W' ( )*234354*#' ( )*6X<>*!7*;?M*;?N*%,-AF7`*Hp<*#L+LL+QGJMGRR': %.4@JKRSW(>X)*HT '23%43KUVSUWXYZ []PK 3F>7,fr/orsay/lri/varna/views/VueAboutPanel.class1&fr/orsay/lri/varna/views/VueAboutPaneljavax/swing/JPanelserialVersionUIDJ ConstantValue>ϓtIRJ_anim6Lfr/orsay/lri/varna/views/VueAboutPanel$AboutAnimator; _textPanelLjavax/swing/JPanel; _textAreaLjavax/swing/JTextArea;()VCode    initLineNumberTableLocalVariableTablethis(Lfr/orsay/lri/varna/views/VueAboutPanel; javax/swing/BorderFactory !createEtchedBorder()Ljavax/swing/border/Border; # $% setBorder(Ljavax/swing/border/Border;)V'java/awt/BorderLayout & * +, setLayout(Ljava/awt/LayoutManager;)V .0/java/awt/Color 12WHITELjava/awt/Color; 4 56 setBackground(Ljava/awt/Color;)V8VARNA 3.8 Created by: Kevin Darty, Alain Denise and Yann Ponty Contact: ponty@lri.fr VARNA is freely distributed under the terms of the GNU GPL 3.0 license. Supported by the BRASERO project (ANR-06-BLAN-0045) :javax/swing/JTextArea 9 =  9? @AsetText(Ljava/lang/String;)V 9C DE setEditable(Z)V G 4 * K LM getBackground()Ljava/awt/Color; O PQcreateMatteBorder6(IIIILjava/awt/Color;)Ljavax/swing/border/MatteBorder; # T UVadd*(Ljava/awt/Component;)Ljava/awt/Component;Xfr/orsay/lri/varna/VARNAPanelZ GGGGAAAACCCC\ ((((....)))) W^ _'(Ljava/lang/String;Ljava/lang/String;)V Wa bE setModifiabledjava/awt/Dimension cf g(II)V Wi jksetPreferredSize(Ljava/awt/Dimension;)Vm4fr/orsay/lri/varna/views/VueAboutPanel$AboutAnimator lo pJ(Lfr/orsay/lri/varna/views/VueAboutPanel;Lfr/orsay/lri/varna/VARNAPanel;)V r tGGGGAAGGGGAAAACCCCAACCCCv((((..((((....))))..)))) lx y_addRNA{$GGGGAAGGGGAAGGGGAAAACCCCAACCCCAACCCC}$((((..((((..((((....))))..))))..))))TGGGGAGGGGAAAACCCCAGGGGAGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCACCCCAGGGGAAAACCCCACCCCT((((.((((....)))).((((.((((....)))).((((....)))).((((....)))).)))).((((....)))).))))GGGGGGGGAAAACCCCAGGGGAAAACCCCAGGGGGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCGGGGAAAACCCCACCCCAGGGGAAAACCCCAGGGGAAAACCCCCCCC((((((((....)))).((((....)))).((((((((....)))).((((....)))).((((....)))).((((....))))((((....)))).)))).((((....)))).((((....))))))))$GGGGAAGGGGAAAACCCCAGGGGAAAACCCCACCCC$((((..((((....)))).((((....)))).))))0GGGGAGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCACCCC0((((.((((....)))).((((....)))).((((....)))).))))9GGGGAGGGGAAAAAAACCCCAGGGGAAAAAAACCCCAGGGGAAAAAAACCCCACCCC9((((.((((.......)))).((((.......)))).((((.......)))).)))) l startWest  U)(Ljava/awt/Component;Ljava/lang/Object;)VCenter5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLengthmessageLjava/lang/String;vpLfr/orsay/lri/varna/VARNAPanel; gracefulStop l  SourceFileVueAboutPanel.java InnerClasses AboutAnimator!  ; **,-.  "*"*&Y()*-37L*9Y;<*<+>*<B*YF*F-H*F&Y(I*F*JNR*F*<SWWYY[]M,`,cYddeh*lY*,nq*qsuw*qz|w*q~w*qw*qY[w*qw*qw*qw*q*,**FL12346C'D/E7GBHLIZJdKkJnLzNOPSTUVUWXWY[\Z]_`^abcbdedfhigjl mnp 6*q st  lPK qq< Z''+fr/orsay/lri/varna/views/VueAboutPanel.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.util.ArrayList; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JTextArea; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.models.VARNAConfig; public class VueAboutPanel extends JPanel { /** * */ private static final long serialVersionUID = 4525998278180950602L; private AboutAnimator _anim; private JPanel _textPanel; private JTextArea _textArea; public VueAboutPanel() { init(); } private void init() { try { setBorder(BorderFactory.createEtchedBorder()); setLayout(new BorderLayout()); setBackground(Color.WHITE); String message = "VARNA " + VARNAConfig.MAJOR_VERSION + "." + VARNAConfig.MINOR_VERSION + "\n" + "\n" + "Created by: Kevin Darty, Alain Denise and Yann Ponty\n" + "Contact: ponty@lri.fr\n" + "\n" + "VARNA is freely distributed under the terms of the GNU GPL 3.0 license.\n" + "\n" + "Supported by the BRASERO project (ANR-06-BLAN-0045)\n"; _textArea = new JTextArea(); _textArea.setText(message); _textArea.setEditable(false); _textPanel = new JPanel(); _textPanel.setBackground(Color.WHITE); _textPanel.setLayout(new BorderLayout()); _textPanel.setBorder(BorderFactory.createMatteBorder(0, 15, 0, 15, getBackground())); _textPanel.add(_textArea); VARNAPanel vp = new VARNAPanel("GGGGAAAACCCC", "((((....))))"); vp.setModifiable(false); vp.setPreferredSize(new Dimension(100, 100)); // vp.setBorder(BorderFactory.createLineBorder(Color.gray)); _anim = new AboutAnimator(vp); _anim .addRNA("GGGGAAGGGGAAAACCCCAACCCC", "((((..((((....))))..))))"); _anim.addRNA("GGGGAAGGGGAAGGGGAAAACCCCAACCCCAACCCC", "((((..((((..((((....))))..))))..))))"); _anim .addRNA( "GGGGAGGGGAAAACCCCAGGGGAGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCACCCCAGGGGAAAACCCCACCCC", "((((.((((....)))).((((.((((....)))).((((....)))).((((....)))).)))).((((....)))).))))"); _anim .addRNA( "GGGGGGGGAAAACCCCAGGGGAAAACCCCAGGGGGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCGGGGAAAACCCCACCCCAGGGGAAAACCCCAGGGGAAAACCCCCCCC", "((((((((....)))).((((....)))).((((((((....)))).((((....)))).((((....)))).((((....))))((((....)))).)))).((((....)))).((((....))))))))"); _anim.addRNA("GGGGAAAACCCC", "((((....))))"); _anim.addRNA("GGGGAAGGGGAAAACCCCAGGGGAAAACCCCACCCC", "((((..((((....)))).((((....)))).))))"); _anim.addRNA("GGGGAGGGGAAAACCCCAGGGGAAAACCCCAGGGGAAAACCCCACCCC", "((((.((((....)))).((((....)))).((((....)))).))))"); _anim .addRNA( "GGGGAGGGGAAAAAAACCCCAGGGGAAAAAAACCCCAGGGGAAAAAAACCCCACCCC", "((((.((((.......)))).((((.......)))).((((.......)))).))))"); _anim.start(); add(vp, BorderLayout.WEST); add(_textPanel, BorderLayout.CENTER); } catch (ExceptionNonEqualLength e) { } } public void gracefulStop() { _anim.gracefulStop(); } private class AboutAnimator extends Thread { VARNAPanel _vp; ArrayList _structures = new ArrayList(); ArrayList _sequences = new ArrayList(); int _period = 2000; boolean _over = false; public AboutAnimator(VARNAPanel vp) { super(); _vp = vp; } public void addRNA(String seq, String str) { _sequences.add(seq); _structures.add(str); } public void gracefulStop() { _over = true; } public void run() { try { int i = 0; while (!_over) { sleep(_period); String seq = _sequences.get(i); String str = _structures.get(i); _vp.drawRNAInterpolated(seq, str); sleep(500); i = (i + 1) % _sequences.size(); } } catch (InterruptedException e) { e.printStackTrace(); } catch (ExceptionNonEqualLength e) { e.printStackTrace(); } } } } PK 3F>xH H &fr/orsay/lri/varna/views/VueZoom.class1 fr/orsay/lri/varna/views/VueZoomjava/lang/Object javax/swing/event/ChangeListener_vpLfr/orsay/lri/varna/VARNAPanel; zoomSliderLjavax/swing/JSlider;zoomAmountSliderpanelLjavax/swing/JPanel;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  javax/swing/JPanel   java/awt/GridLayout  (II)V ! "# setLayout(Ljava/awt/LayoutManager;)V%java/awt/FlowLayout $' ((I)V*javax/swing/JSlider ,.-fr/orsay/lri/varna/VARNAPanel /0getZoom()D@Y )4 5(IIII)V 7 )9 :(setMajorTickSpacing )< =(setMinorTickSpacing )? @A setPaintTicks(Z)V )C DAsetPaintLabelsFjava/awt/Dimension )H IJgetPreferredSize()Ljava/awt/Dimension; EL MNheightI E )Q RSsetPreferredSize(Ljava/awt/Dimension;)VU,fr/orsay/lri/varna/controlers/ControleurZoom TW X%(Lfr/orsay/lri/varna/views/VueZoom;)V )Z [\addChangeListener%(Ljavax/swing/event/ChangeListener;)V^javax/swing/JLabel `bajava/lang/String cdvalueOf(D)Ljava/lang/String; ]f g(Ljava/lang/String;)V ]H ]Qk3fr/orsay/lri/varna/controlers/ControleurSliderLabel jm n(Ljavax/swing/JLabel;Z)V ,p q0getZoomIncrement s uZoom:w Increment: y z{add*(Ljava/awt/Component;)Ljava/awt/Component;LineNumberTableLocalVariableTablethis"Lfr/orsay/lri/varna/views/VueZoom;vppuppdownzoomValueLabelLjavax/swing/JLabel;zoomAmountValueLabellabelZlabelAgetPanel()Ljavax/swing/JPanel; ) getValue()I getZoomAmountget_vp!()Lfr/orsay/lri/varna/VARNAPanel; stateChanged"(Ljavax/swing/event/ChangeEvent;)V  0 , setZoomIncrement(D)VeLjavax/swing/event/ChangeEvent; SourceFile VueZoom.java!   D **+YMYN*Y*Y ,$Y& -$Y& *)Y2p*+1k36*6ж8*6;*6>*6B*6EY*6GKOP*6TY*VY]Y*+_e:EY2hKOi*6jYlY*)Ye*o1k3r*r28*r ;*r>*rB*rEY*rGKOP]Y*o_e:EY2hKOi*rjYlY*r*Y]Yte:]Yve:,xW,*6xW,xW-xW-*rxW-xW*,xW*-xW|=)* ,-.$/40@1L3R4T5f3i7s8}9:;<;=?@A@BCBEFGHG EJK L(M0N;OHNKQORVQ^SfTqStU|VUWYZ\]^_`abcd}R~  ^LA/*|g} ~/07 *61o|k}  ~07 *r1o|o}  ~/*|s} ~D **| w x} ~ PK qq<..%fr/orsay/lri/varna/views/VueZoom.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.controlers.ControleurSliderLabel; import fr.orsay.lri.varna.controlers.ControleurZoom; import fr.orsay.lri.varna.models.VARNAConfig; public class VueZoom implements ChangeListener { private VARNAPanel _vp; private JSlider zoomSlider, zoomAmountSlider; private JPanel panel; public VueZoom(VARNAPanel vp) { _vp = vp; JPanel pup = new JPanel(); JPanel pdown = new JPanel(); panel = new JPanel(); panel.setLayout(new GridLayout(2, 1)); pup.setLayout(new FlowLayout(FlowLayout.LEFT)); pdown.setLayout(new FlowLayout(FlowLayout.LEFT)); zoomSlider = new JSlider(JSlider.HORIZONTAL, (int) (VARNAConfig.MIN_ZOOM * 100), (int) (VARNAConfig.MAX_ZOOM * 100), (int) (_vp.getZoom() * 100)); // Turn on labels at major tick marks. zoomSlider.setMajorTickSpacing(2000); zoomSlider.setMinorTickSpacing(500); zoomSlider.setPaintTicks(true); zoomSlider.setPaintLabels(true); zoomSlider.setPreferredSize(new Dimension(250, zoomSlider .getPreferredSize().height)); zoomSlider.addChangeListener(new ControleurZoom(this)); JLabel zoomValueLabel = new JLabel(String.valueOf(_vp.getZoom())); zoomValueLabel.setPreferredSize(new Dimension(50, zoomValueLabel .getPreferredSize().height)); zoomSlider.addChangeListener(new ControleurSliderLabel(zoomValueLabel, true)); zoomAmountSlider = new JSlider(JSlider.HORIZONTAL, (int) (VARNAConfig.MIN_AMOUNT * 100), (int) (VARNAConfig.MAX_AMOUNT * 100), (int) (_vp .getZoomIncrement() * 100)); // Turn on labels at major tick marks. zoomAmountSlider.setMajorTickSpacing(50); zoomAmountSlider.setMinorTickSpacing(10); zoomAmountSlider.setPaintTicks(true); zoomAmountSlider.setPaintLabels(true); zoomAmountSlider.setPreferredSize(new Dimension(200, zoomAmountSlider .getPreferredSize().height)); JLabel zoomAmountValueLabel = new JLabel(String.valueOf(_vp .getZoomIncrement())); zoomAmountValueLabel.setPreferredSize(new Dimension(50, zoomAmountValueLabel.getPreferredSize().height)); zoomAmountSlider.addChangeListener(new ControleurSliderLabel( zoomAmountValueLabel, true)); zoomAmountSlider.addChangeListener(this); JLabel labelZ = new JLabel("Zoom:"); JLabel labelA = new JLabel("Increment:"); pup.add(labelZ); pup.add(zoomSlider); pup.add(zoomValueLabel); pdown.add(labelA); pdown.add(zoomAmountSlider); pdown.add(zoomAmountValueLabel); panel.add(pup); panel.add(pdown); } public JPanel getPanel() { return panel; } public double getZoom() { return zoomSlider.getValue() / 100.0; } public double getZoomAmount() { return zoomAmountSlider.getValue() / 100.0; } public VARNAPanel get_vp() { return _vp; } public void stateChanged(ChangeEvent e) { _vp.setZoomIncrement(getZoomAmount()); } } PK 3F>(4fr/orsay/lri/varna/views/VueChemProbAnnotation.class1..fr/orsay/lri/varna/views/VueChemProbAnnotationjava/lang/Object javax/swing/event/ChangeListenerjava/awt/event/ActionListener java/awt/event/ItemListener_vpLfr/orsay/lri/varna/VARNAPanel;panelLjavax/swing/JPanel;_an:Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;CONTROL_HEIGHTI TITLE_WIDTH CONTROL_WIDTHcolorLjavax/swing/JButton; intensityLjavax/swing/JSpinner;outwardLjavax/swing/JComboBox;type_backupALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;()VCode "  $  & LineNumberTableLocalVariableTable\(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;)V , ).javax/swing/JButton -, 1 3javax/swing/JComboBox5java/lang/String7Inward9Outward 2; )<([Ljava/lang/Object;)V >  @BAOfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType CDvaluesT()[Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; F  H  J  L Njavax/swing/JPanel M, Q Sjava/awt/FlowLayout RU )V(I)V MX YZ setLayout(Ljava/awt/LayoutManager;)V\javax/swing/JLabel^Color: [` )a(Ljava/lang/String;)Vcjava/awt/Dimension be )f(II)V [h ijsetPreferredSize(Ljava/awt/Dimension;)V -l mnsetContentAreaFilled(Z)V -p qn setOpaque -h tvu8fr/orsay/lri/varna/models/annotations/ChemProbAnnotation wxgetColor()Ljava/awt/Color; -z {| setBackground(Ljava/awt/Color;)V -~ addActionListener"(Ljava/awt/event/ActionListener;)Voutline - asetActionCommand M add*(Ljava/awt/Component;)Ljava/awt/Component; Intensity: javax/swing/SpinnerNumberModel t  getIntensity()D?zG{@$ )(DDDD)Vjavax/swing/JSpinner )(Ljavax/swing/SpinnerModel;)V   addChangeListener%(Ljavax/swing/event/ChangeListener;)V Direction: 2 addItemListener (Ljava/awt/event/ItemListener;)VType: java/awt/GridLayout ethis0Lfr/orsay/lri/varna/views/VueChemProbAnnotation;vpanoutlinepl1Ljavax/swing/JLabel;radiuspjm Ljavax/swing/SpinnerNumberModel;dirptypepjpgetPanel()Ljavax/swing/JPanel;get_vp!()Lfr/orsay/lri/varna/VARNAPanel;show()Z java/lang/Double valueOf(D)Ljava/lang/Double; setValue(Ljava/lang/Object;)V t getTypeS()Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; 2 setSelectedItem t isOut   Edit chemical probing annotation javax/swing/JOptionPane showConfirmDialog=(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;II)I fr/orsay/lri/varna/VARNAPanel repaintacceptZ stateChanged"(Ljavax/swing/event/ChangeEvent;)V javax/swing/event/ChangeEvent  getSource()Ljava/lang/Object;  equals(Ljava/lang/Object;)Z getValue  doubleValue t  setIntensity(D)VeLjavax/swing/event/ChangeEvent;valLjava/lang/Object;actionPerformed(Ljava/awt/event/ActionEvent;)V java/awt/event/ActionEvent getActionCommand()Ljava/lang/String; 4 Choose new outline color  javax/swing/JColorChooser  showDialogH(Ljava/awt/Component;Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color; t |setColorLjava/awt/event/ActionEvent;cLjava/awt/Color;itemStateChanged(Ljava/awt/event/ItemEvent;)V java/awt/event/ItemEvent  getItem t! "nsetOut t$ %&setTypeT(Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType;)VLjava/awt/event/ItemEvent;tQLfr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType; SourceFileVueChemProbAnnotation.java InnerClassesChemProbAnnotationType!       =2!F#ȳ%')* +$()* > *+*-Y/0*2Y4Y6SY8S:=*2Y?:E*G*,I*+K*MYOP*PRYTWMYON[Y]_:bY#!dg*0k*0o*0bY%!dr*0*Isy*0*}*0-W-*0WMYO:[Y_:bY#!dgY*I:*YW*W**MYO:[Y_:bY#!dg*=*W*=WMYO:[Y_:bY#!dg*E*W*EWMYO:  YW -W W W W*P W'01,.(/6p;2@3E5P6_9g:r;<=>?@ABCFGHIJ#K+L5M=OFPQQcRkSsT}VWXYZ[_`abcdef(f  grFx8  /*P'i(  /*K'm(  d<**I¶*0*Isy*E*I̶*=*Iә68*K*ښ<*K'2 stu!v/wGyOzR{SyY}[b(db 3+*'*M,Ù*I,ö*K'+2( 33 @+ !* *Is M, *I,*0*Isy*K' "*8?( @@  Z+*=%*I+8 *K/+*E$+@+@M*I,#*K'" #-BJRY( ZZ'J()*+, @t-@PK qq< --3fr/orsay/lri/varna/views/VueChemProbAnnotation.java package fr.orsay.lri.varna.views; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; import javax.swing.JButton; import javax.swing.JColorChooser; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.models.annotations.ChemProbAnnotation; import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.rna.ModeleBase; public class VueChemProbAnnotation implements ChangeListener, ActionListener, ItemListener { private VARNAPanel _vp; private JPanel panel; private ChemProbAnnotation _an; private static int CONTROL_HEIGHT = 50; private static int TITLE_WIDTH = 70; private static int CONTROL_WIDTH = 200; private JButton color = new JButton(); JSpinner intensity; JComboBox outward = new JComboBox(new String[]{"Inward","Outward"}); JComboBox type = new JComboBox(ChemProbAnnotation.ChemProbAnnotationType.values()); public VueChemProbAnnotation(VARNAPanel vp, ChemProbAnnotation an) { _an = an; _vp = vp; panel = new JPanel(); panel.setLayout(new FlowLayout(FlowLayout.LEFT)); JPanel outlinep = new JPanel(); JLabel l1 = new JLabel("Color: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); color.setContentAreaFilled(false); color.setOpaque(true); color.setPreferredSize(new Dimension(CONTROL_WIDTH,CONTROL_HEIGHT)); color.setBackground(_an.getColor()); color.addActionListener(this); color.setActionCommand("outline"); outlinep.add(l1); outlinep.add(color); JPanel radiusp = new JPanel(); l1 = new JLabel("Intensity: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); SpinnerNumberModel jm = new SpinnerNumberModel(_an.getIntensity(),0.01,10.0,0.01); intensity = new JSpinner(jm); radiusp.add(l1); radiusp.add(intensity); intensity.addChangeListener(this); JPanel dirp = new JPanel(); l1 = new JLabel("Direction: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); outward.addItemListener(this); dirp.add(l1); dirp.add(outward); JPanel typep = new JPanel(); l1 = new JLabel("Type: "); l1.setPreferredSize(new Dimension(TITLE_WIDTH,CONTROL_HEIGHT)); type.addItemListener(this); typep.add(l1); typep.add(type); JPanel jp = new JPanel(); jp.setLayout(new GridLayout(4,1)); jp.add(outlinep); jp.add(radiusp); jp.add(dirp); jp.add(typep); panel.add(jp); } public JPanel getPanel() { return panel; } public VARNAPanel get_vp() { return _vp; } HighlightRegionAnnotation _backup = null; public boolean show() { boolean accept = false; intensity.setValue(_an.getIntensity()); color.setBackground(_an.getColor()); type.setSelectedItem(_an.getType()); outward.setSelectedItem((_an.isOut()?"Inward":"Outward")); if (JOptionPane.showConfirmDialog(_vp, getPanel(), "Edit chemical probing annotation", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) { accept = true; } _vp.repaint(); return accept; } public void stateChanged(ChangeEvent e) { if (e.getSource().equals(intensity)) { Object val = intensity.getValue(); if (val instanceof Double) { _an.setIntensity(((Double)val).doubleValue()); _vp.repaint(); } } } public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("outline")) { Color c = JColorChooser.showDialog(getPanel(), "Choose new outline color", _an.getColor()); if (c!= null) { _an.setColor(c); } } color.setBackground(_an.getColor()); _vp.repaint(); } public void itemStateChanged(ItemEvent e) { if (e.getSource()==outward) { _an.setOut(!e.getItem().equals("Outward")); _vp.repaint(); } else if ((e.getSource()==type)&&(e.getItem() instanceof ChemProbAnnotation.ChemProbAnnotationType)) { ChemProbAnnotation.ChemProbAnnotationType t = (ChemProbAnnotation.ChemProbAnnotationType) e.getItem(); _an.setType(t); _vp.repaint(); } } } PK 3F>o@v <fr/orsay/lri/varna/views/VueBaseValues$ValueTableModel.class16fr/orsay/lri/varna/views/VueBaseValues$ValueTableModel$javax/swing/table/AbstractTableModelthis$0(Lfr/orsay/lri/varna/views/VueBaseValues;+(Lfr/orsay/lri/varna/views/VueBaseValues;)VCode    ()VLineNumberTableLocalVariableTablethis8Lfr/orsay/lri/varna/views/VueBaseValues$ValueTableModel; getColumnName(I)Ljava/lang/String; &fr/orsay/lri/varna/views/VueBaseValues access$0?(Lfr/orsay/lri/varna/views/VueBaseValues;)Ljava/util/ArrayList; java/util/ArrayList  get(I)Ljava/lang/Object; "$#java/lang/Object %&toString()Ljava/lang/String;colI getRowCount()I , -access$1 / 0*sizegetColumnCount getValueAt(II)Ljava/lang/Object;5(fr/orsay/lri/varna/models/rna/ModeleBase7java/lang/Integer 49 :* getBaseNumber 6< =(I)V?java/lang/String 4A B& getContent >D E(Ljava/lang/String;)VGjava/lang/Double 4I JKgetValue()D FM N(D)V P QRaccess$2I(Lfr/orsay/lri/varna/views/VueBaseValues;)Lfr/orsay/lri/varna/VARNAPanel; TVUfr/orsay/lri/varna/VARNAPanel WX getColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; Z\[,fr/orsay/lri/varna/models/rna/ModeleColorMap ]^getColorForValue(D)Ljava/awt/Color;`N/Arowmb*Lfr/orsay/lri/varna/models/rna/ModeleBase;isCellEditable(II)Z g iValue >k lmequals(Ljava/lang/Object;)Z setValueAt(Ljava/lang/Object;II)V Fq rK doubleValue 4t uNsetValue Tw xygetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; {}|!fr/orsay/lri/varna/models/rna/RNA ~rescaleColorMap1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V T repaint  fireTableCellUpdated(II)VvalueLjava/lang/Object;getColumnClass(I)Ljava/lang/Class;  23 " getClass()Ljava/lang/Class;cc(Lfr/orsay/lri/varna/views/VueBaseValues;Lfr/orsay/lri/varna/views/VueBaseValues$ValueTableModel;)V   SourceFileVueBaseValues.java InnerClassesValueTableModel   4 *+ * P   C* !R'()* 5 * +.T  1* 5 * .U  23 [* +4N6Y-8;>Y-@CFY-HL* OS-HY_* WXZ\$^0`5bAdFfXh*[[a(['(Lbcde W*fhjl mn a('(no M*fhjB* +4+Fps* Ov* OSz* O*q s%t<uFvLx*MMMa(M'( > *z  ( &*+P PK 3F>%mtt,fr/orsay/lri/varna/views/VueBaseValues.class1&fr/orsay/lri/varna/views/VueBaseValuesjavax/swing/JPanel$javax/swing/event/TableModelListenertableLjavax/swing/JTable;_tm8Lfr/orsay/lri/varna/views/VueBaseValues$ValueTableModel;_vpLfr/orsay/lri/varna/VARNAPanel;dataLjava/util/ArrayList; SignatureALjava/util/ArrayList;_backup)Ljava/util/ArrayList;columns)Ljava/util/ArrayList;"(Lfr/orsay/lri/varna/VARNAPanel;)VCodejava/awt/GridLayout  (II)V  (Ljava/awt/LayoutManager;)V ! # $%init()VLineNumberTableLocalVariableTablethis(Lfr/orsay/lri/varna/views/VueBaseValues;vp,java/lang/Object.Number0Base2Value4Preview6java/util/ArrayList 58 % :  5< =>add(Ljava/lang/Object;)Z @  B  DFEfr/orsay/lri/varna/VARNAPanel GHgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; JLK!fr/orsay/lri/varna/models/rna/RNA MNget_listeBases()Ljava/util/ArrayList; 5P QRget(I)Ljava/lang/Object;T(fr/orsay/lri/varna/models/rna/ModeleBase SV WXgetValue()D Z\[java/lang/Double ]^valueOf(D)Ljava/lang/Double; 5` absize()Id6fr/orsay/lri/varna/views/VueBaseValues$ValueTableModel cf gc(Lfr/orsay/lri/varna/views/VueBaseValues;Lfr/orsay/lri/varna/views/VueBaseValues$ValueTableModel;)V i kjavax/swing/JTable jm n!(Ljavax/swing/table/TableModel;)V p rjava/awt/Colort+fr/orsay/lri/varna/components/ColorRenderer sv w(Z)V jy z{setDefaultRenderer9(Ljava/lang/Class;Ljavax/swing/table/TableCellRenderer;)V}java/awt/Dimension | j "setPreferredScrollableViewportSize(Ljava/awt/Dimension;)V j getModel ()Ljavax/swing/table/TableModel; javax/swing/table/TableModel addTableModelListener)(Ljavax/swing/event/TableModelListener;)Vjavax/swing/JScrollPane (Ljava/awt/Component;)V  =*(Ljava/awt/Component;)Ljava/awt/Component;col[Ljava/lang/Object;iImb*Lfr/orsay/lri/varna/models/rna/ModeleBase; scrollPaneLjavax/swing/JScrollPane; cancelChanges Z X doubleValue S setValue(D)V D  getColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; J rescaleColorMap1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V tableChanged&(Ljavax/swing/event/TableModelEvent;)V !javax/swing/event/TableModelEvent bgetType j %repainte#Ljavax/swing/event/TableModelEvent;access$0?(Lfr/orsay/lri/varna/views/VueBaseValues;)Ljava/util/ArrayList;access$1access$2I(Lfr/orsay/lri/varna/views/VueBaseValues;)Lfr/orsay/lri/varna/VARNAPanel; SourceFileVueBaseValues.java InnerClassesValueTableModel!   W*Y*+ *"&& '()'()* $%+Y-SY/SY1SY3SL*5Y79=*9+2;W+*5Y7?*5Y7A=0* CIOSN*A-;W*?-UY;W* CI_*cY*eh*jY*hlo*oqsYux*o|Y,,~*o*Y*oM*,W&R-.$/)14/=4H5S6X8j9s:6<=>?@BCD'>()&UAj%O<** CIOSM,*?OZ* CI_* C* &HJK)H=MNN' O();K+ *o&'()%*9&!'%*A&'%* &' cPK qq<U+fr/orsay/lri/varna/views/VueBaseValues.javapackage fr.orsay.lri.varna.views; import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.beans.PropertyChangeEvent; import java.beans.PropertyVetoException; import java.beans.VetoableChangeListener; import java.util.ArrayList; import java.util.Vector; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.components.ColorRenderer; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.models.rna.ModeleColorMap; import fr.orsay.lri.varna.models.rna.RNA; public class VueBaseValues extends JPanel implements TableModelListener { private JTable table; private ValueTableModel _tm; private VARNAPanel _vp; private ArrayList data; private ArrayList _backup; private ArrayList columns; public VueBaseValues(VARNAPanel vp) { super(new GridLayout(1, 0)); _vp = vp; init(); } private void init() { Object[] col = {"Number","Base","Value","Preview"}; columns = new ArrayList(); for (int i = 0; i < col.length; i++) { columns.add(col[i]); } _backup = new ArrayList(); data = new ArrayList(); for (int i = 0; i < _vp.getRNA().get_listeBases().size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get(i); data.add(mb); _backup.add(mb.getValue()); } _tm = new ValueTableModel(); table = new JTable(_tm); table.setDefaultRenderer(Color.class, new ColorRenderer(true)); table.setPreferredScrollableViewportSize(new Dimension(300, 300)); table.getModel().addTableModelListener(this); JScrollPane scrollPane = new JScrollPane(table); this.add(scrollPane); } public void cancelChanges() { for (int i = 0; i < _vp.getRNA().get_listeBases().size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get(i); mb.setValue(_backup.get(i)); } _vp.getRNA().rescaleColorMap(_vp.getColorMap()); } private class ValueTableModel extends AbstractTableModel { public String getColumnName(int col) { return columns.get(col).toString(); } public int getRowCount() { return data.size(); } public int getColumnCount() { return columns.size(); } public Object getValueAt(int row, int col) { ModeleBase mb = data.get(row); if (col==0) { return new Integer(mb.getBaseNumber()); } else if (col==1) { return new String(mb.getContent()); } else if (col==2) { return new Double(mb.getValue()); } else if (col==3) { return _vp.getColorMap().getColorForValue(mb.getValue()); } return "N/A"; } public boolean isCellEditable(int row, int col) { if (getColumnName(col).equals("Value")) return true; return false; } public void setValueAt(Object value, int row, int col) { if (getColumnName(col).equals("Value")) { data.get(row).setValue(((Double)value)); _vp.getRNA().rescaleColorMap(_vp.getColorMap()); _vp.repaint(); fireTableCellUpdated(row, col); } } public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } } public void tableChanged(TableModelEvent e) { if (e.getType() == TableModelEvent.UPDATE) { table.repaint(); } } } PK 3F>[wŭ'fr/orsay/lri/varna/views/Imprimer.class1f!fr/orsay/lri/varna/views/Imprimerjava/lang/Objectjava/awt/print/PrintablephraseLjava/lang/String;(Ljava/lang/String;)VCode  ()V  LineNumberTableLocalVariableTablethis#Lfr/orsay/lri/varna/views/Imprimer;print2(Ljava/awt/Graphics;Ljava/awt/print/PageFormat;I)Ijava/awt/Graphics2D java/awt/Color blueLjava/awt/Color;  !"setPaint(Ljava/awt/Paint;)V$ java/awt/Font&Serif #( )(Ljava/lang/String;II)V + ,-setFont(Ljava/awt/Font;)V / 0) drawStringgLjava/awt/Graphics;pfLjava/awt/print/PageFormat; indexPageIg2Ljava/awt/Graphics2D;main([Ljava/lang/String;)V <>=java/awt/print/PrinterJob ?@ getPrinterJob()Ljava/awt/print/PrinterJob;B'Ceci est un teste d'impression en java! D <F GH setPrintable(Ljava/awt/print/Printable;)V <J KL printDialog()Z <N  PRQjava/lang/System STerrLjava/io/PrintStream;Vimpossible d'imprimer XZYjava/io/PrintStream [ println]java/lang/Exceptionargs[Ljava/lang/String;tacheLjava/awt/print/PrinterJob;eLjava/lang/Exception; SourceFile Imprimer.java!  F * *+ !   5+:#Y%@'**`.$%& '(%)3*45512534556 )78 9: *;L+YACE+I+M MOUW \* ./ 0/89; <!=)? *^_&`a!bcdePK qq 0) return NO_SUCH_PAGE; Graphics2D g2 = (Graphics2D) g; g2.setPaint(Color.blue); g2.setFont(new Font("Serif", Font.PLAIN, 64)); g2.drawString(phrase, 96, 144); return PAGE_EXISTS; } public static void main(String args[]) { PrinterJob tache = PrinterJob.getPrinterJob(); tache.setPrintable(new Imprimer( "Ceci est un teste d'impression en java!")); // printDialog affiche la fenetre de sélection de l’imprimante, // etc... // il retourne true si on clique sur "Ok", false si on clique sur // "Annuler" //System.out.println(PrinterJob.getPrinterJob()); if (!tache.printDialog()) return; try { tache.print(); } catch (Exception e) { System.err.println("impossible d'imprimer"); } } }PK 3F>?J# &fr/orsay/lri/varna/views/VueFont.class1 fr/orsay/lri/varna/views/VueFontjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;fontLjava/awt/Font; stylesBoxLjavax/swing/JComboBox; boxPolicepanelLjavax/swing/JPanel; sizeSliderLjavax/swing/JSlider;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V    init  buildViewVPTitleLineNumberTableLocalVariableTablethis"Lfr/orsay/lri/varna/views/VueFont;vp(Ljava/awt/Font;)V %  ' ( buildViewFontf +-,java/awt/GraphicsEnvironment ./getLocalGraphicsEnvironment ()Ljava/awt/GraphicsEnvironment; +1 23getAvailableFontFamilyNames()[Ljava/lang/String;5javax/swing/JComboBox 47 8([Ljava/lang/Object;)V : <javax/swing/JSlider ;> ?(IIII)V A  ;C DEsetMajorTickSpacing(I)V ;G HEsetMinorTickSpacing ;J KL setPaintTicks(Z)V ;N OLsetPaintLabelsQjava/lang/StringSPlainUItalicWBold Y [javax/swing/JPanel Z ^ Z` abadd*(Ljava/awt/Component;)Ljava/awt/Component;geLjava/awt/GraphicsEnvironment;polices[Ljava/lang/String;styles ikj java/awt/Font lm getFamily()Ljava/lang/String; 4o pqsetSelectedItem(Ljava/lang/Object;)V is tugetSize()I ;w xEsetValue iz {ugetStyle } ~styleIntToString(I)Ljava/lang/String; fr/orsay/lri/varna/VARNAPanel  getTitleFont()Ljava/awt/Font;styleIntI getStylesBox()Ljavax/swing/JComboBox; getBoxPolicegetPanel()Ljavax/swing/JPanel; getSizeSlider()Ljavax/swing/JSlider;getFont  4 ugetSelectedIndex  4 getSelectedItem()Ljava/lang/Object;  ; ugetValue i (Ljava/lang/String;II)Vstyle SourceFile VueFont.java!    V**+**&' ( )* !"#V**+$**&,- . /0 !)*L+0M*4Y,69*;YX=@*@ B*@F*@I*@MPYRSYTSYVSN*4Y-6X*ZY\]*]*9_W*]*@_W*]*X_WB435 68&:/;7<?=G?[@gBrC~DEF* !cd ef[<gf(e/*9*$hn*@*$rv*X**$y|nIJK.L / !v8*9*hn*@*rv*X**y|nOP"Q'R4Q7S 8 !~l($!RTVRVXZ"\%^( !(/*Xc  !/*9g  !/*]k  !/*@o  !K*(#<< <<iY*P*. t v"w%y'z*|,}/1@G4K !"',1PK qqww0fr/orsay/lri/varna/views/VueBPList$Actions.class1I*fr/orsay/lri/varna/views/VueBPList$Actionsjava/lang/Enum ACTION_DELETE,Lfr/orsay/lri/varna/views/VueBPList$Actions;ACTION_EDIT_STYLE8$SWITCH_TABLE$fr$orsay$lri$varna$views$VueBPList$Actions[I ENUM$VALUES-[Lfr/orsay/lri/varna/views/VueBPList$Actions;()VCode  (Ljava/lang/String;I)V      LineNumberTableLocalVariableTable thistoString()Ljava/lang/String; " #()[I % &'ordinal()I)Delete+ Edit Style-N/Avalues/()[Lfr/orsay/lri/varna/views/VueBPList$Actions; 132java/lang/System 45 arraycopy*(Ljava/lang/Object;ILjava/lang/Object;II)VvalueOf@(Ljava/lang/String;)Lfr/orsay/lri/varna/views/VueBPList$Actions; 9 6:5(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum; <  > ./@java/lang/NoSuchFieldError SourceFileVueBPList.java Signature>Ljava/lang/Enum; InnerClassesG"fr/orsay/lri/varna/views/VueBPListActions@1@@    V.YYYSYS1 201*+0  _)!*$.(*,6 9#;&= ) ./6YK*Y<YM0, 67* *8#`0;YW= K*$OW*$OW*Y;?&)?0ABCDE FH@PK 3F>?9d5fr/orsay/lri/varna/views/VueBPList$BPTableModel.class1/fr/orsay/lri/varna/views/VueBPList$BPTableModel$javax/swing/table/AbstractTableModelserialVersionUIDJ ConstantValuethis$0$Lfr/orsay/lri/varna/views/VueBPList;'(Lfr/orsay/lri/varna/views/VueBPList;)VCode   ()VLineNumberTableLocalVariableTablethis1Lfr/orsay/lri/varna/views/VueBPList$BPTableModel; getColumnName(I)Ljava/lang/String; "fr/orsay/lri/varna/views/VueBPList access$0;(Lfr/orsay/lri/varna/views/VueBPList;)Ljava/util/ArrayList; !#"java/util/ArrayList $%get(I)Ljava/lang/Object; ')(java/lang/Object *+toString()Ljava/lang/String;colI getRowCount()I 1 2access$1 !4 5/sizegetColumnCount getValueAt(II)Ljava/lang/Object;:+fr/orsay/lri/varna/models/rna/ModeleStyleBP<java/lang/Boolean 9> ?@ getPartner3,()Lfr/orsay/lri/varna/models/rna/ModeleBase; BDC(fr/orsay/lri/varna/models/rna/ModeleBase E/getElementStructure 9G H@ getPartner5 BJ K/getIndex ;M N(Z)VPjava/lang/StringRjava/lang/StringBuilder Q BU V/ getBaseNumber QX YZappend(I)Ljava/lang/StringBuilder;\- Q^ Y_-(Ljava/lang/String;)Ljava/lang/StringBuilder; Ba b+ getContent Q) Oe f(Ljava/lang/String;)V 9h ijgetEdgePartner54()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; 9l mjgetEdgePartner3 9o pq getStericity9()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity; sut*fr/orsay/lri/varna/views/VueBPList$Actions vw ACTION_DELETE,Lfr/orsay/lri/varna/views/VueBPList$Actions;yN/Arowmb-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;isCellEditable(II)Z setValueAt(Ljava/lang/Object;II)V0fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge 9 setEdge55(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;)V 9 setEdge35fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity 9  setStericity:(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;)V  fireTableCellUpdated(II)V  access$2E(Lfr/orsay/lri/varna/views/VueBPList;)Lfr/orsay/lri/varna/VARNAPanel; fr/orsay/lri/varna/VARNAPanel repaintvalueLjava/lang/Object;getColumnClass(I)Ljava/lang/Class;  78 ' getClass()Ljava/lang/Class;cX(Lfr/orsay/lri/varna/views/VueBPList;Lfr/orsay/lri/varna/views/VueBPList$BPTableModel;)V   SourceFileVueBPList.java InnerClassesEdge StericityActions BPTableModel   4 *+*z  C* &,-./5 *03  6/5 *3  78@*0 9N!;Y-=A-FIL.OYQYS-FTW[]-F`]cd.OYQYS-=TW[]-=`]cd-g-k-nrxB16af*z-,-{|}~_  z-,-` S*0 9:+"+ +**. $05AFOU_4```z-`,-@{|> *  - &*+z"9@9@s@PK 3F>i(((fr/orsay/lri/varna/views/VueBPList.class1["fr/orsay/lri/varna/views/VueBPListjavax/swing/JPanel$javax/swing/event/TableModelListenerjava/awt/event/ActionListenertableLjavax/swing/JTable;_tm1Lfr/orsay/lri/varna/views/VueBPList$BPTableModel;_vpLfr/orsay/lri/varna/VARNAPanel;dataLjava/util/ArrayList; SignatureDLjava/util/ArrayList;_backup)Ljava/util/ArrayList;columns)Ljava/util/ArrayList;"(Lfr/orsay/lri/varna/VARNAPanel;)VCodejava/awt/GridLayout  (II)V  !(Ljava/awt/LayoutManager;)V #  % &'init()VLineNumberTableLocalVariableTablethis$Lfr/orsay/lri/varna/views/VueBPList;vp.java/lang/Object0Delete2Sec.Str.4 5' partner6 3' partner85' edge:3' edge<Remove>java/util/ArrayList =@ ' B  =D EFadd(Ljava/lang/Object;)Z H  J  LNMfr/orsay/lri/varna/VARNAPanel OPgetRNA%()Lfr/orsay/lri/varna/models/rna/RNA; RTS!fr/orsay/lri/varna/models/rna/RNA UV getAllBPs()Ljava/util/ArrayList; =X YZiterator()Ljava/util/Iterator; \^]java/util/Iterator _`next()Ljava/lang/Object;b+fr/orsay/lri/varna/models/rna/ModeleStyleBP \d efhasNext()Z hjijava/util/Collections klsort(Ljava/util/List;)Vn/fr/orsay/lri/varna/views/VueBPList$BPTableModel mp qX(Lfr/orsay/lri/varna/views/VueBPList;Lfr/orsay/lri/varna/views/VueBPList$BPTableModel;)V s ujavax/swing/JTable tw x!(Ljavax/swing/table/TableModel;)V z |java/awt/Color~+fr/orsay/lri/varna/components/ColorRenderer } (Z)V t setDefaultRenderer9(Ljava/lang/Class;Ljavax/swing/table/TableCellRenderer;)V*fr/orsay/lri/varna/views/VueBPList$Actions,fr/orsay/lri/varna/components/ActionRenderer @0fr/orsay/lri/varna/models/rna/ModeleStyleBP$Edgejavax/swing/DefaultCellEditorjavax/swing/JComboBox values5()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge; ([Ljava/lang/Object;)V (Ljavax/swing/JComboBox;)V t setDefaultEditor7(Ljava/lang/Class;Ljavax/swing/table/TableCellEditor;)V5fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity :()[Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;*fr/orsay/lri/varna/components/ActionEditor "(Ljava/awt/event/ActionListener;)Vjava/awt/Dimension  t "setPreferredScrollableViewportSize(Ljava/awt/Dimension;)V t getModel ()Ljavax/swing/table/TableModel; javax/swing/table/TableModel addTableModelListener)(Ljavax/swing/event/TableModelListener;)V t  setRowHeight(I)Vjavax/swing/JScrollPane (Ljava/awt/Component;)V  E*(Ljava/awt/Component;)Ljava/awt/Component;   setOpaque  'doLayoutBase pairs Edition javax/swing/JOptionPane showMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)Vcol[Ljava/lang/Object;iIms-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; scrollPaneLjavax/swing/JScrollPane; cancelChanges R Vget_listeBases = get(I)Ljava/lang/Object;(fr/orsay/lri/varna/models/rna/ModeleBasejava/lang/Double  doubleValue()D setValue(D)V = size()I L  getColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; R rescaleColorMap1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)Vmb*Lfr/orsay/lri/varna/models/rna/ModeleBase; tableChanged&(Ljavax/swing/event/TableModelEvent;)V !javax/swing/event/TableModelEvent getType t 'repainte#Ljavax/swing/event/TableModelEvent;actionPerformed(Ljava/awt/event/ActionEvent;)V  java/lang/System outLjava/io/PrintStream;java/lang/StringBuilder @ java/awt/event/ActionEvent toString()Ljava/lang/String;  append-(Ljava/lang/String;)Ljava/lang/StringBuilder;  !#"java/io/PrintStream $%println(Ljava/lang/String;)V ' (getActionCommand*- ,.-java/lang/String /0split'(Ljava/lang/String;)[Ljava/lang/String; 243java/lang/Integer 56parseInt(Ljava/lang/String;)I ,8 9Fequals L; <= getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; ?A@fr/orsay/lri/varna/views/VueUI BC UIRemoveBP0(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V =E Fremove mH IfireTableRowsDeletedarg0Ljava/awt/event/ActionEvent;data2[Ljava/lang/String;rowaccess$0;(Lfr/orsay/lri/varna/views/VueBPList;)Ljava/util/ArrayList;access$1access$2E(Lfr/orsay/lri/varna/views/VueBPList;)Lfr/orsay/lri/varna/VARNAPanel; SourceFileVueBPList.java InnerClassesEdge StericityActions BPTableModel!   W*Y*+"*$(C DEF)*+,&'%k-Y/SY1SY3SY5SY7SY9SY;SL*=Y?A=*A+2CW+*=Y?G*=Y?I*"KQWN-[aM*I,CW-c*Ig*mY*or*tY*rvy*y{}Y*yY*yYY*yYY*yY**yY*y**yY*yM*,W***"*α(nJ*K5L:NELNQYRdSUSWXY[\^_ `b.c;eDgPhVi[j_ljn)4k*+*A7 P'O<**"KM,*G*"Kݶ*"K*"(rtu)r=wNx) O*+;K+ *y()*+   c Y+ +&)+M,,d21>,2/7.*Ia:*":>*IDW*rG(& ",7DPYb)4c*+cJK"ALM,7NDOP%*A(-)QP%*I(+)RS%*"(*)TUV"aW@aX@Y@mZPK v(> y'fr/orsay/lri/varna/views/VueBPList.javapackage fr.orsay.lri.varna.views; import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyVetoException; import java.beans.VetoableChangeListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Vector; import javax.swing.DefaultCellEditor; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.AbstractTableModel; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.components.ActionEditor; import fr.orsay.lri.varna.components.ActionRenderer; import fr.orsay.lri.varna.components.ColorRenderer; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.models.rna.ModeleColorMap; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; public class VueBPList extends JPanel implements TableModelListener, ActionListener { private JTable table; private BPTableModel _tm; private VARNAPanel _vp; private ArrayList data; private ArrayList _backup; private ArrayList columns; public enum Actions{ ACTION_DELETE, ACTION_EDIT_STYLE; public String toString() { switch(this) { case ACTION_DELETE: return "Delete"; case ACTION_EDIT_STYLE: return "Edit Style"; } return "N/A"; } }; public VueBPList(VARNAPanel vp) { super(new GridLayout(1, 0)); _vp = vp; init(); } private void init() { Object[] col = {"Delete","Sec.Str.","5' partner","3' partner","5' edge","3' edge","Remove"}; columns = new ArrayList(); for (int i = 0; i < col.length; i++) { columns.add(col[i]); } _backup = new ArrayList(); data = new ArrayList(); for (ModeleStyleBP ms: _vp.getRNA().getAllBPs()) { data.add(ms); } Collections.sort(data); _tm = new BPTableModel(); table = new JTable(_tm); table.setDefaultRenderer(Color.class, new ColorRenderer(true)); table.setDefaultRenderer(Actions.class, new ActionRenderer()); table.setDefaultEditor(ModeleStyleBP.Edge.class, new DefaultCellEditor(new JComboBox(ModeleStyleBP.Edge.values()))); table.setDefaultEditor(ModeleStyleBP.Stericity.class, new DefaultCellEditor(new JComboBox(ModeleStyleBP.Stericity.values()))); table.setDefaultEditor(Actions.class, new ActionEditor(this)); table.setPreferredScrollableViewportSize(new Dimension(500, 500)); table.getModel().addTableModelListener(this); table.setRowHeight(25); JScrollPane scrollPane = new JScrollPane(table); add(scrollPane); setOpaque(true); // content panes must be opaque this.doLayout(); JOptionPane.showMessageDialog(_vp, this, "Base pairs Edition", JOptionPane.PLAIN_MESSAGE); } public void cancelChanges() { for (int i = 0; i < _vp.getRNA().get_listeBases().size(); i++) { ModeleBase mb = _vp.getRNA().get_listeBases().get(i); mb.setValue(_backup.get(i)); } _vp.getRNA().rescaleColorMap(_vp.getColorMap()); } private class BPTableModel extends AbstractTableModel { /** * */ private static final long serialVersionUID = 1L; public String getColumnName(int col) { return columns.get(col).toString(); } public int getRowCount() { return data.size(); } public int getColumnCount() { return columns.size(); } public Object getValueAt(int row, int col) { ModeleStyleBP mb = data.get(row); if (col==0) { return new Boolean(mb.getPartner3().getElementStructure()==mb.getPartner5().getIndex()); } else if (col==1) { return new String(""+mb.getPartner5().getBaseNumber()+"-"+mb.getPartner5().getContent()); } else if (col==2) { return new String(""+mb.getPartner3().getBaseNumber()+"-"+mb.getPartner3().getContent()); } else if (col==3) { return mb.getEdgePartner5(); } else if (col==4) { return mb.getEdgePartner3(); } else if (col==5) { return mb.getStericity(); } else if (col==6) { return Actions.ACTION_DELETE; } return "N/A"; } public boolean isCellEditable(int row, int col) { if ( col == 3 || col ==4 || col ==5 || col ==6) return true; return false; } public void setValueAt(Object value, int row, int col) { if ( col == 3 || col ==4 || col ==5) { ModeleStyleBP mb = data.get(row); if ( col == 3) { mb.setEdge5((ModeleStyleBP.Edge)value); } else if ( col == 4) { mb.setEdge3((ModeleStyleBP.Edge)value); } else if ( col == 5) { mb.setStericity((ModeleStyleBP.Stericity)value); } fireTableCellUpdated(row, col); _vp.repaint(); } } public Class getColumnClass(int c) { return getValueAt(0, c).getClass(); } } public void tableChanged(TableModelEvent e) { if (e.getType() == TableModelEvent.UPDATE) { table.repaint(); } } public void actionPerformed(ActionEvent arg0) { System.out.println(""+arg0.toString()); String[] data2 = arg0.getActionCommand().split("-"); int row = Integer.parseInt(data2[data2.length-1]); if (data2[0].equals("Delete")) { ModeleStyleBP ms = data.get(row); _vp.getVARNAUI().UIRemoveBP(ms); data.remove(row); _tm.fireTableRowsDeleted(row, row); } } } PK 3F>4fr/orsay/lri/varna/views/VueLoadColorMapValues.class1.fr/orsay/lri/varna/views/VueLoadColorMapValuesjavax/swing/JPaneljava/awt/event/ActionListenerserialVersionUIDJ ConstantValue ´_vpLfr/orsay/lri/varna/VARNAPanel;urlCBLjavax/swing/JRadioButton;fileCBurlAuxLjavax/swing/JPanel;fileAuxlLjava/awt/CardLayout;inputurlTxtLjavax/swing/JTextField;fileTxtloadLjavax/swing/JButton;"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  !()V#javax/swing/JRadioButton%URL "' ((Ljava/lang/String;)V * ,File .  0  2 4java/awt/CardLayout 3 7  9 ;javax/swing/JTextField : >  @ Bjavax/swing/JButtonD Choose file A' G  I K L!initLineNumberTableLocalVariableTablethis0Lfr/orsay/lri/varna/views/VueLoadColorMapValues;vpSjava/awt/GridLayout RU V(II)V X YZ setLayout(Ljava/awt/LayoutManager;)V "\ ]^addActionListener"(Ljava/awt/event/ActionListener;)V`javax/swing/ButtonGroup _ _c deadd(Ljavax/swing/AbstractButton;)Vgjavax/swing/JLabeliChoose input source: f' l dm*(Ljava/awt/Component;)Ljava/awt/Component; Xpjava/awt/Dimension oU :s tusetPreferredSize(Ljava/awt/Dimension;)Vwfile y dz)(Ljava/awt/Component;Ljava/lang/Object;)V|url "~ getModel()Ljavax/swing/ButtonModel; _  setSelected(Ljavax/swing/ButtonModel;Z)V A\ lchoicegroupLjavax/swing/ButtonGroup;actionPerformed(Ljava/awt/event/ActionEvent;)V java/awt/event/ActionEvent  getSource()Ljava/lang/Object; "  isSelected()Z 3 show)(Ljava/awt/Container;Ljava/lang/String;)Vjavax/swing/JFileChooser showSaveDialog(Ljava/awt/Component;)I getSelectedFile()Ljava/io/File;  java/io/File getAbsolutePath()Ljava/lang/String; : (setTexteLjava/awt/event/ActionEvent;fcLjavax/swing/JFileChooser; getReader()Ljava/io/Reader; Exceptionsjava/io/IOException java/net/URL : getText ' openConnection()Ljava/net/URLConnection; java/net/URLConnection  setUseCaches(Z)V getInputStream()Ljava/io/InputStream;java/io/InputStreamReader (Ljava/io/InputStream;)Vjava/io/FileReader 'Ljava/net/URL; connexionLjava/net/URLConnection;rLjava/io/InputStream; SourceFileVueLoadColorMapValues.java!   w**"Y$&)*"Y+&-*Y/*Y1*3Y56*Y8*:Y<=*:Y<?*AYCEF*+H*JM6 $)*+),4-?.J/U0`1m&r'v(NwOPwQ L!*RYTWYL*)*[*-*[_YaM,*)b,*-b+fYhjkW+*)kW+*-kW*8*6n*=oY,qr*?oY,qr*/*=kW*1*?kW*1*FkW*8*1vx*8*/{x,*-}*F**+W**8WM^5 678%9-:5;=<K=T>]?h@{ABCDEFGHIJKN OP-`+"-*)*6*8{>*6*8v.+A$YM,*H*?,M& N PR$V4Y>[F\Q^_aN `OP`F@*)*Y*=L+M,,NY-ͰY*?ҰMe ghi#j(k1oN*@OP|( PK qq%#PRR$fr/orsay/lri/varna/views/VueUI.class1fr/orsay/lri/varna/views/VueUIjava/lang/Object_vpLfr/orsay/lri/varna/VARNAPanel;_fileChooserDirectoryLjava/io/File;_undoableEditSupport&Ljavax/swing/undo/UndoableEditSupport; _varnaFilter9Lfr/orsay/lri/varna/applications/FileNameExtensionFilter; _bpseqFilter _ctFilter _dbnFilter _jpgFilter _pngFilter _epsFilter _svgFilter _xfigFilter"(Lfr/orsay/lri/varna/VARNAPanel;)VCode  ()V  7fr/orsay/lri/varna/applications/FileNameExtensionFilter VARNA Session File"varna$VARNA & '9(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V ) +BPSeq (CRW) File-bpseq/BPSEQ 1 3Connect (MFold) File5ct7CT 9  ;"Dot-bracket notation (Vienna) File=dbn?DBNAfaaCFAA E F](Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V H  J JPEG PictureLjpegNjpgPJPGRJPEG T  V PNG PictureXpngZPNG \  ^EPS File`epsbEPS d  f SVG PicturehsvgjSVG l  n XFig DiagrampfigrxfigtFIGvXFIG x  z |$javax/swing/undo/UndoableEditSupport {~ (Ljava/lang/Object;)V  LineNumberTableLocalVariableTablethis Lfr/orsay/lri/varna/views/VueUI;vpaddUndoableEditListener!(Ljavax/swing/undo/UndoManager;)V { +(Ljavax/swing/event/UndoableEditListener;)VmanagerLjavax/swing/undo/UndoManager;UIToggleColorMap fr/orsay/lri/varna/VARNAPanel  isModifiable()Z getColorMapVisible setColorMapVisible(Z)V repaintUIToggleFlatExteriorLoop getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; !fr/orsay/lri/varna/models/rna/RNA  get_drawMode()I/fr/orsay/lri/varna/models/VARNAEdits$RedrawEdit getFlatExteriorLoop $(ILfr/orsay/lri/varna/VARNAPanel;Z)V { postEdit"(Ljavax/swing/undo/UndoableEdit;)V setFlatExteriorLoop reset drawRNA'(Lfr/orsay/lri/varna/models/rna/RNA;I)V UIRadiate #(ILfr/orsay/lri/varna/VARNAPanel;)V UIMOTIFViewUILine UICircularUINAView UIVARNAViewUIResetsavePath(Ljavax/swing/JFileChooser;)V javax/swing/JFileChooser getCurrentDirectory()Ljava/io/File;jfcLjavax/swing/JFileChooser;loadPath setCurrentDirectory(Ljava/io/File;)VUIFile Exceptions5fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength  setFileSelectionMode(I)VOpen... setDialogTitle(Ljava/lang/String;)V  showOpenDialog(Ljava/awt/Component;)I  getSelectedFile  java/io/File getAbsolutePath()Ljava/lang/String; java/lang/String  toLowerCase.varna  endsWith(Ljava/lang/String;)Z    loadSecStr    drawRNAInterpolated&(Lfr/orsay/lri/varna/models/rna/RNA;)V   getConfig)()Lfr/orsay/lri/varna/models/VARNAConfig; %fr/orsay/lri/varna/models/VARNAConfig clone  fireUINewStructureM(Lfr/orsay/lri/varna/models/VARNAConfig;Lfr/orsay/lri/varna/models/rna/RNA;)V   loadSession:(Ljava/lang/String;)Lfr/orsay/lri/varna/models/FullBackup;  $fr/orsay/lri/varna/models/FullBackup !"config'Lfr/orsay/lri/varna/models/VARNAConfig; $ %&rna#Lfr/orsay/lri/varna/models/rna/RNA; ( )* errorDialog(Ljava/lang/Exception;)V,3fr/orsay/lri/varna/exceptions/ExceptionExportFailed.7fr/orsay/lri/varna/exceptions/ExceptionPermissionDenied04fr/orsay/lri/varna/exceptions/ExceptionLoadingFailed29fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax4Bfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses6java/io/FileNotFoundExceptionfcpathLjava/lang/String;rbck&Lfr/orsay/lri/varna/models/FullBackup;e15Lfr/orsay/lri/varna/exceptions/ExceptionExportFailed;9Lfr/orsay/lri/varna/exceptions/ExceptionPermissionDenied;6Lfr/orsay/lri/varna/exceptions/ExceptionLoadingFailed;;Lfr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax;DLfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses;eLjava/io/FileNotFoundException;UISetColorMapStyleG)fr/orsay/lri/varna/views/VueColorMapStyle FI KChoose color map style MONjavax/swing/JOptionPane PQshowConfirmDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)I FS TU getColorMap0()Lfr/orsay/lri/varna/models/rna/ModeleColorMap; W XY setColorMap1(Lfr/orsay/lri/varna/models/rna/ModeleColorMap;)V F[ \ cancelChangescms+Lfr/orsay/lri/varna/views/VueColorMapStyle;UILoadColorMapValuesa.fr/orsay/lri/varna/views/VueLoadColorMapValues `IdLoad base values `f gh getReader()Ljava/io/Reader; j kl readValues(Ljava/io/Reader;)Vnjava/io/IOException0Lfr/orsay/lri/varna/views/VueLoadColorMapValues;Ljava/io/IOException;UISetColorMapValuess&fr/orsay/lri/varna/views/VueBaseValues rIvChoose base values r[(Lfr/orsay/lri/varna/views/VueBaseValues; UIManualInput{java/text/ParseException}'fr/orsay/lri/varna/views/VueManualInput |I | getPanel()Ljavax/swing/JPanel;Input sequence/structure  getSize  | getTseq()Ljavax/swing/JTextField; javax/swing/JTextField getText | getTstr  setRNA'(Ljava/lang/String;Ljava/lang/String;)V  +(ILfr/orsay/lri/varna/models/VARNAConfig;)V 1 printStackTrace 6fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm manualInput)Lfr/orsay/lri/varna/views/VueManualInput;cfg8Lfr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm; UISetTitle Input title  getTitle M showInputDialogL(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;  setTitleresUISetColorMapCaptionInput new color map caption  getColorMapCaption  setColorMapCaptionUISetBaseCharacter  isComparisonMode Input base  get_listeBases()Ljava/util/ArrayList;  getNearestBase()Ljava/lang/Integer; java/lang/Integer intValue java/util/ArrayList get(I)Ljava/lang/Object;3fr/orsay/lri/varna/models/rna/ModeleBasesComparison  getBases  length  charAt(I)C java/lang/Character valueOf(C)Ljava/lang/Character;   set_base1(Ljava/lang/Character;)V   set_base22fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide  get_c  set_cUIExport7fr/orsay/lri/varna/exceptions/ExceptionWritingForbidden3fr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding   add(Ljava/lang/Object;)Z  UIChooseOutputFile)(Ljava/util/ArrayList;)Ljava/lang/String;   lastIndexOf(I)I     substring(I)Ljava/lang/String;.eps  equals   saveRNAEPS<(Ljava/lang/String;Lfr/orsay/lri/varna/models/VARNAConfig;)V.svg   saveRNASVG.fig   saveRNAXFIG!.png # $ saveToPNG & ' saveToJPEGvLjava/util/ArrayList;destextLowerLocalVariableTypeTablePLjava/util/ArrayList; UIExportJPEG 0 1M(Lfr/orsay/lri/varna/applications/FileNameExtensionFilter;)Ljava/lang/String;UIPrint 465,fr/orsay/lri/varna/applications/VARNAPrinter 78printComponent(Ljava/awt/Component;)V UIExportPNG UIExportXFIG UIExportEPS UIExportSVG UISaveAsDBN ? @A getVARNAUI"()Lfr/orsay/lri/varna/views/VueUI; C D saveAsDBNname UISaveAsCT H IsaveAsCT UISaveAsBPSEQ L M saveAsBPSEQUISaveAs P Q saveSessionfiltre Signatured(Ljava/util/ArrayList;)Ljava/lang/String;V"javax/swing/filechooser/FileFilter X YZaddChoosableFileFilter'(Ljavax/swing/filechooser/FileFilter;)V \ ]size_Save... a bshowSaveDialog d ef getPopupMenu$()Lfr/orsay/lri/varna/views/VueMenu; hji fr/orsay/lri/varna/views/VueMenu klget_controleurMenu0()Lfr/orsay/lri/varna/controlers/ControleurMenu; npo,fr/orsay/lri/varna/controlers/ControleurMenu qr getExtension"(Ljava/io/File;)Ljava/lang/String; t uv getFileFilter&()Ljavax/swing/filechooser/FileFilter; x yz getExtensions()[Ljava/lang/String; |~}java/util/Arrays asList%([Ljava/lang/Object;)Ljava/util/List;java/util/Collection  addAll(Ljava/util/Collection;)Z  containsjava/lang/StringBuilder  &(Ljava/lang/Object;)Ljava/lang/String;  .  append-(Ljava/lang/String;)Ljava/lang/StringBuilder;  toString absolutePathiI extensionf$Ljavax/swing/filechooser/FileFilter;listeExtension)Ljava/util/ArrayList; UISetBorder"fr/orsay/lri/varna/views/VueBorder I   getBorderSize()Ljava/awt/Dimension;  drawBBox   drawBorder Set new border size   setBorderSize(Ljava/awt/Dimension;)Vborder$Lfr/orsay/lri/varna/views/VueBorder; oldBorderLjava/awt/Dimension;UISetBackgroundChoose new background color   getBackground()Ljava/awt/Color; javax/swing/JColorChooser  showDialogH(Ljava/awt/Component;Ljava/lang/String;Ljava/awt/Color;)Ljava/awt/Color;   setBackground(Ljava/awt/Color;)VcLjava/awt/Color;UIZoomIn  getZoom()D  getZoomIncrement  getTranslation()Ljava/awt/Point;@N java/lang/Math min(DD)Djava/awt/Point  x  y  (II)V java/lang/Double (D)Ljava/lang/Double;  setZoom  setTranslation(Ljava/awt/Point;)V  checkTranslation _actualZoomD _actualAmount_actualTranslationLjava/awt/Point;newZoomrationewTrans UIZoomOut?   max UICustomZoom  fr/orsay/lri/varna/views/VueZoom  I  Set zoom  setZoomIncrement(D)Vzoom"Lfr/orsay/lri/varna/views/VueZoom;oldZoom oldZoomAmountUIGlobalRotation*fr/orsay/lri/varna/views/VueGlobalRotation I Rotates the whole RNA ! "getAngle $ rotation,Lfr/orsay/lri/varna/views/VueGlobalRotation; ( )*globalRotation(Ljava/lang/Double;)V,2fr/orsay/lri/varna/models/VARNAEdits$RotateRNAEdit +. /#(DLfr/orsay/lri/varna/VARNAPanel;)Vd UISetBPStyle3#fr/orsay/lri/varna/views/VueStyleBP 2I 6 78 getBPStyle2()Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE; 2;Set main base pair style = >? setBPStyle3(Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;)Vbpstyle%Lfr/orsay/lri/varna/views/VueStyleBP;0Lfr/orsay/lri/varna/models/VARNAConfig$BP_STYLE;UISetTitleColorEChoose new title color G H getTitleColor J K setTitleColorUISetBackboneColorNChoose new backbone color P QgetBackboneColor S TsetBackboneColorUISetTitleFontW fr/orsay/lri/varna/views/VueFont VI V[New Title font V] ^_getFont()Ljava/awt/Font; a bc setTitleFont(Ljava/awt/Font;)Vfont"Lfr/orsay/lri/varna/views/VueFont;UISetSpaceBetweenBasesh-fr/orsay/lri/varna/views/VueSpaceBetweenBases gI k lmget_spaceBetweenBases()Ljava/lang/Double; gpSet the space between each base r s*set_spaceBetweenBases u  vsbb/Lfr/orsay/lri/varna/views/VueSpaceBetweenBases;oldSpaceLjava/lang/Double;UISetBPHeightIncrement|-fr/orsay/lri/varna/views/VueBPHeightIncrement {I  getBPHeightIncrement {)Set the vertical increment in linear mode   doubleValue  setBPHeightIncrement/Lfr/orsay/lri/varna/views/VueBPHeightIncrement;UISetNumPeriod   getNumPeriod%fr/orsay/lri/varna/views/VueNumPeriod I Set new numbering period   setNumPeriod oldNumPeriodvnp'Lfr/orsay/lri/varna/views/VueNumPeriod;UIEditBasePair(fr/orsay/lri/varna/models/rna/ModeleBase  getElementStructure   getStyleBP/()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP; +fr/orsay/lri/varna/models/rna/ModeleStyleBP getEdgePartner54()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;  getEdgePartner3   getStericity9()Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;"fr/orsay/lri/varna/views/VueBPType  O(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V Set base pair L/W type  setEdge55(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;)V  setEdge3   setStericity:(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;)Vmb*Lfr/orsay/lri/varna/models/rna/ModeleBase;msbp-Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;bck52Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge;bck3bcks7Lfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity;vbpt$Lfr/orsay/lri/varna/views/VueBPType;UIColorBasePairChoose custom base pair color   _bondColor  getColor"(Ljava/awt/Color;)Ljava/awt/Color;  setCustomColorUIThicknessBasePair'fr/orsay/lri/varna/views/VueBPThickness  7(Lfr/orsay/lri/varna/VARNAPanel;Ljava/util/ArrayList;)V Set base pair(s) thickness  restoreThicknessesbases)Lfr/orsay/lri/varna/views/VueBPThickness;DLjava/util/ArrayList; fr/orsay/lri/varna/views/VueJPEG  (ZZ)V Set resolution  getScaleSlider()Ljavax/swing/JSlider; javax/swing/JSlider getValue@Yjava/awt/image/BufferedImage  getWidth  round(D)J    getHeight   (III)V  createGraphics()Ljava/awt/Graphics2D;java/awt/geom/AffineTransform    setToScale(DD)V java/awt/Graphics2D  setTransform"(Ljava/awt/geom/AffineTransform;)V  !"_drawBackgroundZ $ %&paintComponent(Ljava/awt/Graphics;Z)V ( )dispose  ,.-javax/imageio/ImageIO /0writeA(Ljava/awt/image/RenderedImage;Ljava/lang/String;Ljava/io/File;)Z mfilename"Lfr/orsay/lri/varna/views/VueJPEG;scalemyImageLjava/awt/image/BufferedImage;g2Ljava/awt/Graphics2D;AFLjava/awt/geom/AffineTransform;<Set resolution/quality?zG{ @ %A(Ljava/awt/Graphics;)VC*javax/imageio/stream/FileImageOutputStream BE  ,G HIgetImageWritersByFormatName((Ljava/lang/String;)Ljava/util/Iterator; KMLjava/util/Iterator NOnext()Ljava/lang/Object;Qjavax/imageio/ImageWriter PS TUgetDefaultWriteParam!()Ljavax/imageio/ImageWriteParam; WYXjavax/imageio/ImageWriteParam ZsetCompressionMode \ ]getQualitySliderB W` absetCompressionQuality(F)V Pd e setOutputgjavax/imageio/IIOImage fi jU(Ljava/awt/image/RenderedImage;Ljava/util/List;Ljavax/imageio/metadata/IIOMetadata;)V Pl /m^(Ljavax/imageio/metadata/IIOMetadata;Ljavax/imageio/IIOImage;Ljavax/imageio/ImageWriteParam;)V Bo pclose mr s getMessage +u out,Ljavax/imageio/stream/FileImageOutputStream;writerLjavax/imageio/ImageWriter;paramsLjavax/imageio/ImageWriteParam; myIIOImageLjavax/imageio/IIOImage;UIToggleShowNCBP  getShowNonCanonicalBP  setShowNonCanonicalBPUIToggleColorSpecialBases  getColorSpecialBases  setColorNonStandardBasesUIToggleColorGapsBases  getColorGapsBases  setColorGapsBasesUIToggleShowNonPlanar  getShowNonPlanarBP  setShowNonPlanarBPUIToggleShowWarnings  getShowWarnings  setShowWarningsUIPickSpecialBasesColorChoose new special bases color  getNonStandardBasesColor  setNonStandardBasesColorUIPickGapsBasesColorChoose new gaps bases color  getGapsBasesColor  setGapsBasesColorUIBaseTypeColor!fr/orsay/lri/varna/views/VueBases  #(Lfr/orsay/lri/varna/VARNAPanel;I)VUIToggleModifiable   setModifiableUIBasePairTypeColorUIBaseAllColorUIAbout&fr/orsay/lri/varna/views/VueAboutPanel About VARNA 3.8 M showMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)V   gracefulStopabout(Lfr/orsay/lri/varna/views/VueAboutPanel;UIAutoAnnotateHelices  autoAnnotateHelicesUIAutoAnnotateStrandEnds  autoAnnotateStrandEndsUIAutoAnnotateInteriorLoops  autoAnnotateInteriorLoopsUIAutoAnnotateTerminalLoops  autoAnnotateTerminalLoops UIAnnotationRemoveFromAnnotation9(Lfr/orsay/lri/varna/models/annotations/TextAnnotation;)V  set_selectedAnnotation  getListeAnnotations  removetextAnnotation6Lfr/orsay/lri/varna/models/annotations/TextAnnotation;UIAnnotationEditFromAnnotation 4fr/orsay/lri/varna/models/annotations/TextAnnotation getType&fr/orsay/lri/varna/views/VueAnnotation  Y(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/TextAnnotation;Z)V  Z(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/TextAnnotation;ZZ)V  showvue(Lfr/orsay/lri/varna/views/VueAnnotation;UIAnnotationAddFromStructure(ILjava/util/ArrayList;)Vjava/lang/Exception.(ILjava/util/ArrayList;)V  ?(Ljava/lang/String;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V    iterator()Ljava/util/Iterator; K hasNext  +(Ljava/lang/String;Ljava/util/ArrayList;I)VUnknown structure type type listeIndex textAnnot listeBaseLjava/lang/Integer;*Ljava/util/ArrayList;ALjava/util/ArrayList;UIAnnotationEditFromStructure    getAnnotationc(ILfr/orsay/lri/varna/models/rna/ModeleBase;)Lfr/orsay/lri/varna/models/annotations/TextAnnotation; " taUIAnnotationRemoveFromStructure & UIAnnotationsAddPosition)java/awt/geom/Point2D$Double (+  - ./panelToLogicPoint>(Ljava/awt/geom/Point2D$Double;)Ljava/awt/geom/Point2D$Double; (1  (3  5 6$(Lfr/orsay/lri/varna/VARNAPanel;II)VpLjava/awt/geom/Point2D$Double; annotationAddUIAnnotationsAddBase < => getBaseAtJ(Ljava/awt/geom/Point2D$Double;)Lfr/orsay/lri/varna/models/rna/ModeleBase; @ AgetIndex C DsetSelectedBaseUIAnnotationsAddLoop G HI getLoopBases(I)Ljava/util/Vector; K LM getBasesAt-(Ljava/util/Collection;)Ljava/util/ArrayList; O PQ setSelection(Ljava/util/Collection;)V Ljava/util/Vector;mbsLjava/lang/Exception;'Ljava/util/Vector;extractMaxContiguousPortion,(Ljava/util/ArrayList;)Ljava/util/ArrayList;(Ljava/util/ArrayList;)Ljava/util/ArrayList;mtab+[Lfr/orsay/lri/varna/models/rna/ModeleBase;bestcurrentUIAnnotationsAddRegion a bc getSelection&()Lfr/orsay/lri/varna/models/BaseList; egf"fr/orsay/lri/varna/models/BaseList  i WXk?fr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation jm n(Ljava/util/ArrayList;)V p qraddHighlightRegionD(Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)Vt/fr/orsay/lri/varna/views/VueHighlightRegionEdit sv wc(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;)V sy  { |rremoveHighlightRegion ~ clearSelection regionAnnotALfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation;1Lfr/orsay/lri/varna/views/VueHighlightRegionEdit;UIAnnotationsAddChemProb  =-(I)Lfr/orsay/lri/varna/models/rna/ModeleBase;   getCoords ()Ljava/awt/geom/Point2D$Double; ( distance(Ljava/awt/geom/Point2D;)D8fr/orsay/lri/varna/models/annotations/ChemProbAnnotation  W(Lfr/orsay/lri/varna/models/rna/ModeleBase;Lfr/orsay/lri/varna/models/rna/ModeleBase;)V  addChemProbAnnotation=(Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;)V.fr/orsay/lri/varna/views/VueChemProbAnnotation  \(Lfr/orsay/lri/varna/VARNAPanel;Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;)V y  removeChemProbAnnotationm1m2:Lfr/orsay/lri/varna/models/annotations/ChemProbAnnotation;0Lfr/orsay/lri/varna/views/VueChemProbAnnotation;UIAnnotationsAddHelix   findHelix(I)Ljava/util/ArrayList;UIToggleGaspinMode  toggleDrawOutlineBase  toggleFillBaseUIAnnotationsAdd IUIEditAllBasePairs"fr/orsay/lri/varna/views/VueBPList IUIAnnotationsRemove,fr/orsay/lri/varna/views/VueListeAnnotations UIAnnotationsEditUIAddBP2(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V  addBPToStructure.fr/orsay/lri/varna/models/VARNAEdits$AddBPEdit  Q(IILfr/orsay/lri/varna/models/rna/ModeleStyleBP;Lfr/orsay/lri/varna/VARNAPanel;)Vjms UIRemoveBP0(Lfr/orsay/lri/varna/models/rna/ModeleStyleBP;)V1fr/orsay/lri/varna/models/VARNAEdits$RemoveBPEdit   getIndex5   getIndex3   removeBPUIShiftBaseCoord(Ljava/util/ArrayList;DD)V/(Ljava/util/ArrayList;DD)V  setCoord(IDD)V   getCenter   setCenter3fr/orsay/lri/varna/models/VARNAEdits$BasesShiftEdit  9(Ljava/util/ArrayList;DDLfr/orsay/lri/varna/VARNAPanel;)Vindicesdxdyindex6(Ljava/util/ArrayList;Ljava/awt/geom/Point2D$Double;)VK(Ljava/util/ArrayList;Ljava/awt/geom/Point2D$Double;)V  dvUIMoveSingleBase7fr/orsay/lri/varna/models/VARNAEdits$SingleBaseMoveEdit  %(IDDLfr/orsay/lri/varna/VARNAPanel;)Vnxny"(ILjava/awt/geom/Point2D$Double;)V  UISetBaseCenter    UIUndo  undoUIRedo  redoUIMoveHelixAtom    getHelixInterval(I)Ljava/awt/Point;    getMultiLoop   shouldFlip"(ILjava/awt/geom/Point2D$Double;)Z   UIFlipHelix2fr/orsay/lri/varna/models/VARNAEdits$HelixFlipEdit  2(Ljava/awt/Point;Lfr/orsay/lri/varna/VARNAPanel;)V  UIRotateHelixAtom ! "fireLayoutChangednewPosindexTohmlprojectz(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)Ljava/awt/geom/Point2D$Double;OOxCOCnormOXOXXCOCPCP 3 4!(I)Ljava/awt/geom/Point2D$Double; 6 78sqrt(D)D : '( <  > 4hBeghEndABABnormABPCenterhABACAPsignCsignP M NOtestDirectionality(III)Z Q RS computeAngle?(Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;)D@@!TD-? [ \8normalizeAngle^4fr/orsay/lri/varna/models/VARNAEdits$HelixRotateEdit ]` aF(DDDDLjava/awt/Point;Ljava/awt/Point;Lfr/orsay/lri/varna/VARNAPanel;)V c deUIRotateEverything'(DDDDLjava/awt/Point;Ljava/awt/Point;)V prevIndex nextIndexoldPos limitLoopLeftlimitLoopRight limitLeft limitRight helixStart helixStopisDirectcenterbasepLimRpHelRpNewpOldpHelLpLimLminDeltamaxDeltadelta distanceMax distanceMin ~  rotateHelix$(Ljava/awt/geom/Point2D$Double;IID)Vjava/util/Vector      \  8cos  8sinover nextBases prevBasesradius anglePrev angleNextnewAngleknewXnewY  \angle  8asin@ !TD-dist   rotatePoint](Ljava/awt/geom/Point2D$Double;Ljava/awt/geom/Point2D$Double;D)Ljava/awt/geom/Point2D$Double;oldpnewpoldcnewcoldAngle SourceFile VueUI.java InnerClasses.fr/orsay/lri/varna/models/VARNAConfig$BP_STYLEBP_STYLE$fr/orsay/lri/varna/models/VARNAEdits AddBPEditBasesShiftEdit HelixFlipEditHelixRotateEdit RedrawEdit RemoveBPEdit RotateRNAEditSingleBaseMoveEdit0fr/orsay/lri/varna/models/rna/ModeleStyleBP$EdgeEdge5fr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity Stericityjava/awt/geom/Point2DDouble!         ks***Y!#%(*Y*,.%0*Y246%8*Y:<>@BDG*YIKMOQDS*YUWY%[*Y]_a%c*Yegi%k*YmoqsuDw*+y*{Y*y} WS [ [\]]^+_,_0`<a=aAbQdRdVeffgfkgwhxh|ijjkllmXYZA *+ ^_ ^(*y *y*y*yc d e'g (n*yf*yX*Y*y*y*y*y*y*y*y*y"j kl:mPnWofpmr ny;*y3*Y*y*y*y*y*yu vw$x3y:{ ;{=*y5*Y*y*y*y*y*y~ %5< =y;*y3*Y*y*y*y*y*y $3: ;y;*y3*Y*y*y*y*y*y $3: ;y;*y3*Y*y*y*y*y*y $3: ;y;*y3*Y*y*y*y*y*y $3: ;M*yE*Y*y*y*y*y*y*y*y &-EL MA *+̵  L* +*ձ*yлYL++*++*y*++M,4YN-,*y-*y*y -*yc*y,N*y--#HM*y,'=?=@=A=BCDEz.FY*yHL*y+JL*y+RV+Z )-. "]^_;`Y*ybL*y+cL"*y*y+ei M*y,'.1m& #12: ; /]o2Cpqh rY*ytL*y+uL+w   ]xyz=*y|Y*y~L*y+Lg*yWYMYN,++,*y-*y,*y-,*yM,M,3|13|J "(3;CUdlu "#%)>v;D:&C<"CAC0*y(*y*yL+*y+*y", -.-/ 0(1/409x0*y(*y*yL+*y+*y7 89 :(;/>09*y*y*y*y*yǶ˶ֶظL+*y*yǶ˶+۞ +ާ *y*yǶ˶+ +ާ *yT*y*y*yǶ˶L+(*y*yǶ˶+*ynA BCD%E8C<F@GJHTGZHqI{JIJKOPQORSTSTUY <q9)9 +-ݻYL+*cW+*kW+*wW+*SW+*[W*+M,,,. N- *y,*y s-*y,*y T- -q*y,*y ,-  *,"-M -K*,%Zrstu#v,w5x;y?zI{LzM}W~lv*();*9M+9, (-.+S**S/L+*+%   *926*y3  9+S**[/L+*+"   *9:+` **w/L+*y+*y    *9;+` **c/L+*y+*y    *9<+` **k/L+*y+*y    *9=+-f&*y>*G/L+*y+*yB%&E9F+-f&*y>*8/L+*y+*yG%&E9J+-f&*y>*0/L+*y+*yK%&E9N+-[YL+*0W+*GW+*8W+*(W*+M,,,. N-,*y,*yKY-4*y,*yG;-< -@*y,*yB-! *y,ON#,26@CDMbk*()2*9Dt+9, (-1lYM,+W*, R  (),  (-STYM*,N6,+UW+[,,^,*y`y*,,N*ycg,m:,s:KY:w{W$Y-N-^ ".3:EJR\ceks|~  RR)79eV9kP|?),R-|?]Y*yL*yM*y*y*y*y+L *y,*y*y*y6  $+37=EMU\ ] QIr&*y*yL+*y+*y!"!#$%%'&  k*yH*yJ*y:')k9'o9Ykk: *y*y *y*y>*+,-.-$/*081B0G2S3\5c6j7Hkc[R$G*AG$   k*yH*yJ*y:')o9'o9Ykk: *y *y*y*y>:;<=>=$?*@8AB@GBPC\EcFjGHkc[R$G*AG$  b Y*y L*yI*y9*y*y*y+L*y(*y*y*y6 J KLM%N,O7P8O>QIRRTZUaV*b VNEV*yö[H*y*yY*yL*y+L *+ w#*y*y. \]^_+`3a7`=bFdNeUgV+*%&}9*y1*yö[!*y''*+Y'*y-j kl%m8p9901F*yö[82Y*y4L*y5M*y+9:L*y,<*y& tuv$w,x0w6y>zE} F)@A$!;BC0*y(*yD*yFL+*y+I*y"  (/0L0*y(*yM*yOL+*y+R*y"  (/0U;*y3VY*yXL*y+YZL*y+\`*y" "(3:;$defT*yLgY*yiL*yjM*y+noL#*y,q*y*yt*y.  !),-3>LS T=vw!2xyzT*yL{Y*y}L*y~M*y+L#*y,*y*yt*y.  !),-3>LS T=v!2xyF*yö[8*y<Y*yM*y,L*y*y& $,06>E F-$!'}*yu*y*yǶ˶L+R+M,N,:,:Y*y,:*yL,-,,*yJ %-27=CQZ^diou|H}%W2J7E=?C9Q+\*yT*y*yǶ˶L+1+M*y,*y ӶָN-,-*y: %-26:GKOT[*\%62)Kn*yf*y*yǶ˶L+C+MYN-,WY*y-:*yL*yB %-2:@NWZ[afm4n%H2;:3)N, :3$+YM*y,L,oNY*y-k*y-k ::Y:--*y*y #'YY+*+W :1mZ     , 0 8< ARS X_hu|R29 L3,4yX^56_W78hN9:Cp'+0 YM*y,;L, =N,oNY*y-k*y-k ::Y:--*y?BYY+*D:KFJP:R:  V ,[^n_cfYh:   kn:+Yq+tm~ !"!$&%0'@(D)L*P(U*f+g(l,s-|./023456789:;< ? 29 L3-4y@4yl56s78|9:SvwDxy=z{ |} Cp~^(*y *y*y*yB C D'F (P*y*y*yIJK P*y*y*yNOP ^(*y *y*y*yS T U'W (P*y*y*yZ[\ .*y*yL+*y+*y*y& _`a_bcd&e-g.~.*y*yL+*y+*y*y"jkjlmn&o-q.H*y*yt uw E*y*y z{ H*y*y~  H*y*y  aYL*y++ɱR*y*y*y  R*y*y*y  R*y*y*y  R*y*y*y  j&*y*y*y+W*y %&&,+Y*y+MY*y+M,'+*,,'Sc;(XY*y,̶˶NY*y-:Y:,:*J:*y˶W һYNY*y-:|Y:,:*J:*y˶W һYNY*y-:*yY'f#>BQVYbw!&): ;;;)Bb_)_)Q!w, ;b__S@*y8*y,̶˶N*y-: *!" %&49?4@@@)&4 #, @$S@*y8*y,̶˶N*y-: *%" %&49?4@@@)&4 #, @':*y2*y(Y*,NY*y-0-24: */494:::7849:O*yG*y(Y*;N-0*y-?BY-:Y*y:" !,9I N >OOO19I9E?u*ym*y(Y*;N-V*y-?F:*yJ:Y:*yNY*y:N-R lo2  !1?NWgopt!\ uuuR1;(S?-T)Ng9pCU,1;(V?-TWXSY*yM> ,S,+:JN,-?-S YNY:62,2,2W[-[NY:,[-[N-N%&'& (4);(E*M+V,\.c/p2|34,79;RZ)[\4MV])VM^)Y9, ZMV]VM^_0*y|*y`dN-[*y(Y*;:-W**-hhN*y-NjY-l:*yosY*yu:x *yz*y}:A BCE0F7HAIIJSK\LkMsN|OQHn)0ZS0k9, n *y *y*y(Y*,N*y(Y*;::?d*y?d:?`*y<*y?`: :--:Y:WW*yNY:*yY*y:*y*y}^TU+V?WBXLY_Zs\]_ceijklmnopq rtf +78?B]&\[)69, \[?u*ym*y(Y*;N-V*y-?:*yJ:Y:*yNY*y:N-R lo2 x z{!}1~?NWgopt\ uuuR1;()?-T)Ng9pCU,1;(?-TZ *y*y*y*y   [*yY*yL+ 9G*y *y  H*y*y  H*y*y  4*y,*y-*Y-*yö*y ,3*4444|8*y0*Y+++*yҶ*y+*y %0788S7 *y+:cJ̶6*y:: *y 0(c 2c*yݴ0(cݴ2c *Y+(*y*y*  "07Rs}H)"Q0C7<08 , Sb*+,0,2   )8,  J*yB*y::*Y(*y*y(*y 4BI>JJJJ2+08P*,0,2   8\*(Y(* *]*y*y,  786*y  6*y   9*y*yö[z*y>*y :*y:64)*,&**Y*y *,*y B034ARY^c l r H#84b$AU%RD&Y='(C (Y-0+0g-2+2g*:,00k,22kc9(Y,0k,2k*:(Y00g22g*:(Y00g22g*: (Y+0 0c+2 2c*:  2 I"h$%&f )8*8+8,82u-I^.8h?/8 08 18 +=+>*y2:*y2:(Y00g22g*:00k22kc59: (Y0o2o*: `6 N*y 2: *y *   9;*y =: *y> *   9  >-. /0$1C2_5c6|789:;7= %? @A8$B8CC8_wDcs)8 |Z*8 T :E8 F8 *y N*y-2:*y-2:*y-`2:(Y22g00gw*:(Y00g22g*:(Y,00g,22g*: 00k22kc9 0 0k2 2kc9   k* C EF,G>I^J}KLMRz E8 %A8,B8>+8^|G8}]H8@I8 'J K )**y N*y-:6-6-6w*y6-6--6'*y6*y2:*y-L6d*y2: *y2: *y2: *y2: *y-2: *y-2:a*y2: *y2: *y2: *y2: *y-2: *y-2:*y-: P PcTo9 Pg9 Pg9,Pg9Pg9Pg9 Pg9 Vc9 Vc9 Vc9 Vc9 Vc9 Vc9*gXcZ9*gXgZ9! !Vc9!!*gZ9# #Vc9###!(#!g9%#Vgg9''% 9#!9#*]Y#-*y_*#-bZVY Z[#\)]/^2_D`G_IaXb\dtexghihk^npqrst uv*w=yNz_{m|{}~"%-58@HKS[^fnqy)j$***#8 %&#)f/gI]mh8Pi8 Ni8 ?j8 _j8  1k8 mk8 #l8 {l8 *m8 m8 :n8n8So"vp8aqUrIs>t2u&vwxy!mz#{%|'de]$*y   L6 *y : *   '}6 *y 2:*y 2:  P)g9 P)g9 P)g9 P)g9 d6Y:? 6 1*yYW6  »Y:6  `6L*yö[ 6 1*yYW6   9 *gZ9*gZ9*gZ9*gZ96}̶6 )c`k`oc9)c`k`og9 0kc9  2kc9"*y "ل6}̶6 )c`k`og9)c`k`oc9 0kc9  2kc9"*y "ل&I%*035FIZkp{  %7;>PSV[dit"(7<HQWcloV"zqwr% & o" 5xp8 Id" ZSm8kBn8{ssvvSSdIt 3To3h  "7h  ",VV\8;*' \z$ 'VcH') 'VgH'V)g' " $$$q RS/*+I+2*2g(o9+0*0g g9$,*/p8/78)# s6i*y2:*+:*y;93*y: *+ : *y> 2 #$%&-'9)K*N)P+[,i#r/f ssp8sssoU8J8P8 [8  \,+9,2+2go9,0+0g g9+0)ckc9 +2)ckc9 (Y  *346&7.:?;P=R\\p8\78\UD? P  b @   ]   +  @@( PK \>i֣//#fr/orsay/lri/varna/views/VueUI.java/* VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat 490 Universit� Paris-Sud 91405 Orsay Cedex France This file is part of VARNA version 3.1. VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Point; import java.awt.Toolkit; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.awt.image.BufferedImage; import java.awt.image.FilteredImageSource; import java.awt.image.ImageFilter; import java.awt.image.ImageProducer; import java.awt.image.RGBImageFilter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.text.ParseException; import java.util.ArrayList; import java.util.Arrays; import java.util.Vector; import javax.imageio.IIOImage; import javax.imageio.ImageIO; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.stream.FileImageOutputStream; import javax.swing.JColorChooser; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import javax.swing.undo.UndoManager; import javax.swing.undo.UndoableEditSupport; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.applications.FileNameExtensionFilter; import fr.orsay.lri.varna.applications.VARNAPrinter; import fr.orsay.lri.varna.applications.templateEditor.TemplateEdits; import fr.orsay.lri.varna.applications.templateEditor.TemplatePanel; import fr.orsay.lri.varna.exceptions.ExceptionExportFailed; import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax; import fr.orsay.lri.varna.exceptions.ExceptionJPEGEncoding; import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed; import fr.orsay.lri.varna.exceptions.ExceptionNAViewAlgorithm; import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength; import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied; import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses; import fr.orsay.lri.varna.exceptions.ExceptionWritingForbidden; import fr.orsay.lri.varna.models.FullBackup; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.VARNAEdits; import fr.orsay.lri.varna.models.annotations.ChemProbAnnotation; import fr.orsay.lri.varna.models.annotations.HighlightRegionAnnotation; import fr.orsay.lri.varna.models.annotations.TextAnnotation; import fr.orsay.lri.varna.models.rna.ModeleBase; import fr.orsay.lri.varna.models.rna.ModeleBaseNucleotide; import fr.orsay.lri.varna.models.rna.ModeleBasesComparison; import fr.orsay.lri.varna.models.rna.ModeleStyleBP; import fr.orsay.lri.varna.models.rna.RNA; public class VueUI { private VARNAPanel _vp; private File _fileChooserDirectory = null; private UndoableEditSupport _undoableEditSupport; public VueUI(VARNAPanel vp) { _vp = vp; _undoableEditSupport = new UndoableEditSupport(_vp); } public void addUndoableEditListener(UndoManager manager) { _undoableEditSupport.addUndoableEditListener(manager); } public void UIToggleColorMap() { if (_vp.isModifiable()) { _vp.setColorMapVisible(!_vp.getColorMapVisible()); _vp.repaint(); } } public void UIToggleFlatExteriorLoop() { if (_vp.isModifiable() && _vp.getRNA().get_drawMode() == RNA.DRAW_MODE_RADIATE) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(RNA.DRAW_MODE_RADIATE,_vp,!_vp.getFlatExteriorLoop())); _vp.setFlatExteriorLoop(!_vp.getFlatExteriorLoop()); _vp.reset(); _vp.drawRNA(_vp.getRNA(), RNA.DRAW_MODE_RADIATE); _vp.repaint(); } } public void UIRadiate() { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(RNA.DRAW_MODE_RADIATE,_vp)); _vp.reset(); _vp.drawRNA(_vp.getRNA(), RNA.DRAW_MODE_RADIATE); _vp.repaint(); } } public void UIMOTIFView() { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(RNA.DRAW_MODE_MOTIFVIEW,_vp)); _vp.reset(); _vp.drawRNA(_vp.getRNA(), RNA.DRAW_MODE_MOTIFVIEW); _vp.repaint(); } } public void UILine() { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(RNA.DRAW_MODE_LINEAR,_vp)); _vp.reset(); _vp.drawRNA(_vp.getRNA(), RNA.DRAW_MODE_LINEAR); _vp.repaint(); } } public void UICircular() { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(RNA.DRAW_MODE_CIRCULAR,_vp)); _vp.reset(); _vp.drawRNA(_vp.getRNA(), RNA.DRAW_MODE_CIRCULAR); _vp.repaint(); } } public void UINAView() { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(RNA.DRAW_MODE_NAVIEW,_vp)); _vp.reset(); _vp.drawRNA(_vp.getRNA(), RNA.DRAW_MODE_NAVIEW); _vp.repaint(); } } public void UIVARNAView() { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(RNA.DRAW_MODE_VARNA_VIEW,_vp)); _vp.reset(); _vp.drawRNA(_vp.getRNA(), RNA.DRAW_MODE_VARNA_VIEW); _vp.repaint(); } } public void UIReset() { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RedrawEdit(_vp.getRNA().get_drawMode(),_vp)); _vp.reset(); _vp.drawRNA(_vp.getRNA(), _vp.getRNA().get_drawMode()); _vp.repaint(); } } private void savePath(JFileChooser jfc) { _fileChooserDirectory = jfc.getCurrentDirectory(); } private void loadPath(JFileChooser jfc) { if (_fileChooserDirectory != null) { jfc.setCurrentDirectory(_fileChooserDirectory); } } public void UIFile() throws ExceptionNonEqualLength { if (_vp.isModifiable()) { JFileChooser fc = new JFileChooser(); fc.setFileSelectionMode(JFileChooser.OPEN_DIALOG); fc.setDialogTitle("Open..."); loadPath(fc); if (fc.showOpenDialog(_vp) == JFileChooser.APPROVE_OPTION) { try { savePath(fc); String path = fc.getSelectedFile().getAbsolutePath(); if (!path.toLowerCase().endsWith(".varna")) { RNA r = new RNA(); r.loadSecStr(path); _vp.drawRNAInterpolated(r); _vp.fireUINewStructure(_vp.getConfig().clone(),r); _vp.repaint(); } else { FullBackup bck = _vp.loadSession(path); _vp.fireUINewStructure(bck.config,bck.rna); } } catch (ExceptionExportFailed e1) { _vp.errorDialog(e1); } catch (ExceptionPermissionDenied e1) { _vp.errorDialog(e1); } catch (ExceptionLoadingFailed e1) { _vp.errorDialog(e1); } catch (ExceptionFileFormatOrSyntax e1) { _vp.errorDialog(e1); } catch (ExceptionUnmatchedClosingParentheses e1) { _vp.errorDialog(e1); } catch (FileNotFoundException e) { _vp.errorDialog(e); } } } } public void UISetColorMapStyle() { VueColorMapStyle cms = new VueColorMapStyle(_vp); if (JOptionPane.showConfirmDialog(_vp, cms, "Choose color map style", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { _vp.setColorMap(cms.getColorMap()); } else { cms.cancelChanges(); } } public void UILoadColorMapValues() { VueLoadColorMapValues cms = new VueLoadColorMapValues(_vp); if (JOptionPane.showConfirmDialog(_vp, cms, "Load base values", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { try { _vp.setColorMapVisible(true); _vp.readValues(cms.getReader()); } catch (IOException e) { _vp.errorDialog(e); } } } public void UISetColorMapValues() { VueBaseValues cms = new VueBaseValues(_vp); if (JOptionPane.showConfirmDialog(_vp, cms, "Choose base values", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { } else { cms.cancelChanges(); } } public void UIManualInput() throws ParseException, ExceptionNonEqualLength { if (_vp.isModifiable()) { VueManualInput manualInput = new VueManualInput(_vp); if (JOptionPane.showConfirmDialog(_vp, manualInput.getPanel(), "Input sequence/structure", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { if (_vp.getRNA().getSize() == 0) { } try { RNA r = new RNA(); VARNAConfig cfg = new VARNAConfig(); r.setRNA(manualInput.getTseq().getText(),manualInput.getTstr().getText()); r.drawRNA(_vp.getRNA().get_drawMode(), cfg); _vp.drawRNAInterpolated(r); _vp.fireUINewStructure(cfg,r); _vp.repaint(); } catch (ExceptionFileFormatOrSyntax e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ExceptionNAViewAlgorithm e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } public void UISetTitle() { if (_vp.isModifiable()) { String res = JOptionPane.showInputDialog(_vp, "Input title", _vp .getTitle()); if (res != null) { _vp.setTitle(res); _vp.repaint(); } } } public void UISetColorMapCaption() { if (_vp.isModifiable()) { String res = JOptionPane.showInputDialog(_vp, "Input new color map caption", _vp.getColorMapCaption()); if (res != null) { _vp.setColorMapCaption(res); _vp.repaint(); } } } public void UISetBaseCharacter() { if (_vp.isModifiable()) { if (_vp.isComparisonMode()) { String res = JOptionPane.showInputDialog(_vp, "Input base", ((ModeleBasesComparison) _vp.getRNA().get_listeBases() .get(_vp.getNearestBase())).getBases()); if (res != null) { ((ModeleBasesComparison) _vp.getRNA().get_listeBases().get( _vp.getNearestBase())).set_base1(((res.length()>0)?res.charAt(0):' ')); ((ModeleBasesComparison) _vp.getRNA().get_listeBases().get( _vp.getNearestBase())).set_base2(((res.length()>1)?res.charAt(1):' ')); _vp.repaint(); } } else { String res = JOptionPane.showInputDialog(_vp, "Input base", ((ModeleBaseNucleotide) _vp.getRNA().get_listeBases() .get(_vp.getNearestBase())).get_c()); if (res != null) { ((ModeleBaseNucleotide) _vp.getRNA().get_listeBases().get( _vp.getNearestBase())).set_c(res); _vp.repaint(); } } } } FileNameExtensionFilter _varnaFilter = new FileNameExtensionFilter( "VARNA Session File", "varna", "VARNA"); FileNameExtensionFilter _bpseqFilter = new FileNameExtensionFilter( "BPSeq (CRW) File", "bpseq", "BPSEQ"); FileNameExtensionFilter _ctFilter = new FileNameExtensionFilter( "Connect (MFold) File", "ct", "CT"); FileNameExtensionFilter _dbnFilter = new FileNameExtensionFilter( "Dot-bracket notation (Vienna) File", "dbn", "DBN", "faa", "FAA"); FileNameExtensionFilter _jpgFilter = new FileNameExtensionFilter( "JPEG Picture", "jpeg", "jpg", "JPG", "JPEG"); FileNameExtensionFilter _pngFilter = new FileNameExtensionFilter( "PNG Picture", "png", "PNG"); FileNameExtensionFilter _epsFilter = new FileNameExtensionFilter( "EPS File", "eps", "EPS"); FileNameExtensionFilter _svgFilter = new FileNameExtensionFilter( "SVG Picture", "svg", "SVG"); FileNameExtensionFilter _xfigFilter = new FileNameExtensionFilter( "XFig Diagram", "fig", "xfig", "FIG", "XFIG"); public void UIExport() throws ExceptionExportFailed, ExceptionPermissionDenied, ExceptionWritingForbidden, ExceptionJPEGEncoding { ArrayList v = new ArrayList(); v.add(_epsFilter); v.add(_svgFilter); v.add(_xfigFilter); v.add(_jpgFilter); v.add(_pngFilter); String dest = UIChooseOutputFile(v); if (dest != null) { String extLower = dest.substring(dest.lastIndexOf('.')) .toLowerCase(); // System.out.println(extLower); if (extLower.equals(".eps")) { _vp.getRNA().saveRNAEPS(dest, _vp.getConfig()); } else if (extLower.equals(".svg")) { _vp.getRNA().saveRNASVG(dest, _vp.getConfig()); } else if (extLower.equals(".fig") || extLower.equals("xfig")) { _vp.getRNA().saveRNAXFIG(dest, _vp.getConfig()); } else if (extLower.equals(".png")) { saveToPNG(dest); } else if (extLower.equals("jpg") || extLower.equals("jpeg")) { saveToJPEG(dest); } } } public void UIExportJPEG() throws ExceptionJPEGEncoding, ExceptionExportFailed { String dest = UIChooseOutputFile(_jpgFilter); if (dest != null) { saveToJPEG(dest); } } public void UIPrint() { VARNAPrinter.printComponent(_vp); } public void UIExportPNG() throws ExceptionExportFailed { String dest = UIChooseOutputFile(_pngFilter); if (dest != null) { saveToPNG(dest); } } public void UIExportXFIG() throws ExceptionExportFailed, ExceptionWritingForbidden { String dest = UIChooseOutputFile(_xfigFilter); if (dest != null) { _vp.getRNA().saveRNAXFIG(dest, _vp.getConfig()); } } public void UIExportEPS() throws ExceptionExportFailed, ExceptionWritingForbidden { String dest = UIChooseOutputFile(_epsFilter); if (dest != null) { _vp.getRNA().saveRNAEPS(dest, _vp.getConfig()); } } public void UIExportSVG() throws ExceptionExportFailed, ExceptionWritingForbidden { String dest = UIChooseOutputFile(_svgFilter); if (dest != null) { _vp.getRNA().saveRNASVG(dest, _vp.getConfig()); } } public void UISaveAsDBN() throws ExceptionExportFailed, ExceptionPermissionDenied { String name = _vp.getVARNAUI().UIChooseOutputFile(_dbnFilter); if (name != null) _vp.getRNA().saveAsDBN(name, _vp.getTitle()); } public void UISaveAsCT() throws ExceptionExportFailed, ExceptionPermissionDenied { String name = _vp.getVARNAUI().UIChooseOutputFile(_ctFilter); if (name != null) _vp.getRNA().saveAsCT(name, _vp.getTitle()); } public void UISaveAsBPSEQ() throws ExceptionExportFailed, ExceptionPermissionDenied { String name = _vp.getVARNAUI().UIChooseOutputFile(_bpseqFilter); if (name != null) _vp.getRNA().saveAsBPSEQ(name, _vp.getTitle()); } public void UISaveAs() throws ExceptionExportFailed, ExceptionPermissionDenied { ArrayList v = new ArrayList(); v.add(_bpseqFilter); v.add(_dbnFilter); v.add(_ctFilter); v.add(_varnaFilter); String dest = UIChooseOutputFile(v); if (dest != null) { String extLower = dest.substring(dest.lastIndexOf('.')) .toLowerCase(); if (extLower.endsWith("bpseq")) { _vp.getRNA().saveAsBPSEQ(dest, _vp.getTitle()); } else if (extLower.endsWith("ct")) { _vp.getRNA().saveAsCT(dest, _vp.getTitle()); } else if (extLower.endsWith("dbn") || extLower.endsWith("faa")) { _vp.getRNA().saveAsDBN(dest, _vp.getTitle()); } else if (extLower.endsWith("varna")) { _vp.saveSession(dest); } } } public String UIChooseOutputFile(FileNameExtensionFilter filtre) { ArrayList v = new ArrayList(); v.add(filtre); return UIChooseOutputFile(v); } /** * Opens a save dialog with right extensions and return the absolute path * * @param filtre * Allowed extensions * @return null if the user doesn't approve the save dialog,
* absolutePath if the user approve the save dialog */ public String UIChooseOutputFile(ArrayList filtre) { JFileChooser fc = new JFileChooser(); loadPath(fc); String absolutePath = null; // applique le filtre for (int i = 0; i < filtre.size(); i++) { fc.addChoosableFileFilter(filtre.get(i)); } // en mode open dialog pour voir les autres fichiers avec la meme // extension fc.setFileSelectionMode(JFileChooser.OPEN_DIALOG); fc.setDialogTitle("Save..."); // Si l'utilisateur a valider if (fc.showSaveDialog(_vp) == JFileChooser.APPROVE_OPTION) { savePath(fc); absolutePath = fc.getSelectedFile().getAbsolutePath(); String extension = _vp.getPopupMenu().get_controleurMenu() .getExtension(fc.getSelectedFile()); FileFilter f = fc.getFileFilter(); if (f instanceof FileNameExtensionFilter) { ArrayList listeExtension = new ArrayList(); listeExtension.addAll(Arrays .asList(((FileNameExtensionFilter) f).getExtensions())); // si l'extension du fichier ne fait pas partie de la liste // d'extensions acceptées if (!listeExtension.contains(extension)) { absolutePath += "." + listeExtension.get(0); } } } return absolutePath; } public void UISetBorder() { VueBorder border = new VueBorder(_vp); Dimension oldBorder = _vp.getBorderSize(); _vp.drawBBox(true); _vp.drawBorder(true); _vp.repaint(); if (JOptionPane.showConfirmDialog(_vp, border.getPanel(), "Set new border size", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { _vp.setBorderSize(oldBorder); } _vp.drawBorder(false); _vp.drawBBox(false); _vp.repaint(); } public void UISetBackground() { Color c = JColorChooser.showDialog(_vp, "Choose new background color", _vp.getBackground()); if (c != null) { _vp.setBackground(c); _vp.repaint(); } } public void UIZoomIn() { double _actualZoom = _vp.getZoom(); double _actualAmount = _vp.getZoomIncrement(); Point _actualTranslation = _vp.getTranslation(); double newZoom = Math.min(VARNAConfig.MAX_ZOOM, _actualZoom * _actualAmount); double ratio = newZoom / _actualZoom; Point newTrans = new Point((int) (_actualTranslation.x * ratio), (int) (_actualTranslation.y * ratio)); _vp.setZoom(newZoom); _vp.setTranslation(newTrans); // verification que la translation ne pose pas de problemes _vp.checkTranslation(); _vp.repaint(); } public void UIZoomOut() { double _actualZoom = _vp.getZoom(); double _actualAmount = _vp.getZoomIncrement(); Point _actualTranslation = _vp.getTranslation(); double newZoom = Math.max(_actualZoom / _actualAmount, VARNAConfig.MIN_ZOOM); double ratio = newZoom / _actualZoom; Point newTrans = new Point((int) (_actualTranslation.x * ratio), (int) (_actualTranslation.y * ratio)); _vp.setTranslation(newTrans); _vp.setZoom(newZoom); // verification que la translation ne pose pas de problemes _vp.checkTranslation(); _vp.repaint(); } public void UICustomZoom() { VueZoom zoom = new VueZoom(_vp); double oldZoom = _vp.getZoom(); double oldZoomAmount = _vp.getZoomIncrement(); _vp.drawBBox(true); _vp.repaint(); if (JOptionPane.showConfirmDialog(_vp, zoom.getPanel(), "Set zoom", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { _vp.setZoom(oldZoom); _vp.setZoomIncrement(oldZoomAmount); } _vp.drawBBox(false); _vp.repaint(); } public void UIGlobalRotation() { if (_vp.getRNA().get_listeBases().size() > 0) { _vp.drawBBox(true); _vp.repaint(); VueGlobalRotation rotation = new VueGlobalRotation(_vp); if (JOptionPane.showConfirmDialog(_vp, rotation.getPanel(), "Rotates the whole RNA", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { UIGlobalRotation(-rotation.getAngle()); } _vp.drawBBox(false); _vp.repaint(); } } public void UIGlobalRotation(double d) { if (_vp.isModifiable()) { if (_vp.getRNA().get_listeBases().size() > 0) { _vp.globalRotation(d); _undoableEditSupport.postEdit(new VARNAEdits.RotateRNAEdit(d,_vp)); } } } public void UISetBPStyle() { if (_vp.getRNA().get_listeBases().size() > 0) { VueStyleBP bpstyle = new VueStyleBP(_vp); VARNAConfig.BP_STYLE bck = _vp.getBPStyle(); if (JOptionPane.showConfirmDialog(_vp, bpstyle.getPanel(), "Set main base pair style", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { _vp.setBPStyle(bck); _vp.repaint(); } } } public void UISetTitleColor() { if (_vp.isModifiable()) { Color c = JColorChooser.showDialog(_vp, "Choose new title color", _vp.getTitleColor()); if (c != null) { _vp.setTitleColor(c); _vp.repaint(); } } } public void UISetBackboneColor() { if (_vp.isModifiable()) { Color c = JColorChooser.showDialog(_vp, "Choose new backbone color", _vp.getBackboneColor()); if (c != null) { _vp.setBackboneColor(c); _vp.repaint(); } } } public void UISetTitleFont() { if (_vp.isModifiable()) { VueFont font = new VueFont(_vp); if (JOptionPane.showConfirmDialog(_vp, font.getPanel(), "New Title font", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { _vp.setTitleFont(font.getFont()); _vp.repaint(); } } } public void UISetSpaceBetweenBases() { if (_vp.isModifiable()) { VueSpaceBetweenBases vsbb = new VueSpaceBetweenBases(_vp); Double oldSpace = _vp.getRNA().get_spaceBetweenBases(); if (JOptionPane.showConfirmDialog(_vp, vsbb.getPanel(), "Set the space between each base", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { _vp.getRNA().set_spaceBetweenBases(oldSpace); _vp.drawRNA(_vp.getRNA()); _vp.repaint(); } } } public void UISetBPHeightIncrement() { if (_vp.isModifiable()) { VueBPHeightIncrement vsbb = new VueBPHeightIncrement(_vp); Double oldSpace = _vp.getBPHeightIncrement(); if (JOptionPane.showConfirmDialog(_vp, vsbb.getPanel(), "Set the vertical increment in linear mode", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { _vp.setBPHeightIncrement(oldSpace); _vp.drawRNA(_vp.getRNA()); _vp.repaint(); } } } public void UISetNumPeriod() { if (_vp.getRNA().get_listeBases().size() != 0) { int oldNumPeriod = _vp.getNumPeriod(); VueNumPeriod vnp = new VueNumPeriod(_vp); if (JOptionPane.showConfirmDialog(_vp, vnp.getPanel(), "Set new numbering period", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { _vp.setNumPeriod(oldNumPeriod); _vp.repaint(); } } } public void UIEditBasePair() { if (_vp.isModifiable()) { ModeleBase mb = _vp.getRNA().get_listeBases().get( _vp.getNearestBase()); if (mb.getElementStructure() != -1) { ModeleStyleBP msbp = mb.getStyleBP(); ModeleStyleBP.Edge bck5 = msbp.getEdgePartner5(); ModeleStyleBP.Edge bck3 = msbp.getEdgePartner3(); ModeleStyleBP.Stericity bcks = msbp.getStericity(); VueBPType vbpt = new VueBPType(_vp, msbp); if (JOptionPane.showConfirmDialog(_vp, vbpt.getPanel(), "Set base pair L/W type", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { msbp.setEdge5(bck5); msbp.setEdge3(bck3); msbp.setStericity(bcks); _vp.repaint(); } } } } public void UIColorBasePair() { if (_vp.isModifiable()) { ModeleBase mb = _vp.getRNA().get_listeBases().get( _vp.getNearestBase()); if (mb.getElementStructure() != -1) { ModeleStyleBP msbp = mb.getStyleBP(); Color c = JColorChooser.showDialog(_vp, "Choose custom base pair color", msbp.getColor(_vp .getConfig()._bondColor)); if (c != null) { msbp.setCustomColor(c); _vp.repaint(); } } } } public void UIThicknessBasePair() { if (_vp.isModifiable()) { ModeleBase mb = _vp.getRNA().get_listeBases().get( _vp.getNearestBase()); if (mb.getElementStructure() != -1) { ModeleStyleBP msbp = mb.getStyleBP(); ArrayList bases = new ArrayList(); bases.add(msbp); VueBPThickness vbpt = new VueBPThickness(_vp, bases); if (JOptionPane.showConfirmDialog(_vp, vbpt.getPanel(), "Set base pair(s) thickness", JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION) { vbpt.restoreThicknesses(); _vp.repaint(); } } } } public void saveToPNG(String filename) throws ExceptionExportFailed { VueJPEG jpeg = new VueJPEG(true, false); if (JOptionPane.showConfirmDialog(_vp, jpeg.getPanel(), "Set resolution", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { Double scale = jpeg.getScaleSlider().getValue() / 100.0; BufferedImage myImage = new BufferedImage((int) Math.round(_vp .getWidth() * scale), (int) Math.round(_vp.getHeight() * scale), BufferedImage.TRANSLUCENT); Graphics2D g2 = myImage.createGraphics(); AffineTransform AF = new AffineTransform(); AF.setToScale(scale, scale); g2.setTransform(AF); _vp.paintComponent(g2,!_vp.getConfig()._drawBackground); g2.dispose(); try { ImageIO.write(myImage, "PNG", new File(filename)); } catch (IOException e) { e.printStackTrace(); } } } public void saveToJPEG(String filename) throws ExceptionJPEGEncoding, ExceptionExportFailed { VueJPEG jpeg = new VueJPEG(true, true); if (JOptionPane.showConfirmDialog(_vp, jpeg.getPanel(), "Set resolution/quality", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) { Double scale; if (jpeg.getScaleSlider().getValue() == 0) scale = 1. / 100.; else scale = jpeg.getScaleSlider().getValue() / 100.; BufferedImage myImage = new BufferedImage((int) Math.round(_vp .getWidth() * scale), (int) Math.round(_vp.getHeight() * scale), BufferedImage.TYPE_INT_RGB); Graphics2D g2 = myImage.createGraphics(); AffineTransform AF = new AffineTransform(); AF.setToScale(scale, scale); g2.setTransform(AF); _vp.paintComponent(g2); try { FileImageOutputStream out = new FileImageOutputStream(new File(filename)); ImageWriter writer = ImageIO.getImageWritersByFormatName("jpeg").next(); ImageWriteParam params = writer.getDefaultWriteParam(); params.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); params.setCompressionQuality(jpeg.getQualitySlider().getValue() / 100.0f); writer.setOutput(out); IIOImage myIIOImage = new IIOImage(myImage, null, null); writer.write(null, myIIOImage, params); out.close(); } catch (IOException e) { throw new ExceptionExportFailed(e.getMessage(), filename); } } } public void UIToggleShowNCBP() { if (_vp.isModifiable()) { _vp.setShowNonCanonicalBP(!_vp.getShowNonCanonicalBP()); _vp.repaint(); } } public void UIToggleColorSpecialBases() { _vp.setColorNonStandardBases(!_vp.getColorSpecialBases()); _vp.repaint(); } public void UIToggleColorGapsBases() { _vp.setColorGapsBases(!_vp.getColorGapsBases()); _vp.repaint(); } public void UIToggleShowNonPlanar() { if (_vp.isModifiable()) { _vp.setShowNonPlanarBP(!_vp.getShowNonPlanarBP()); _vp.repaint(); } } public void UIToggleShowWarnings() { _vp.setShowWarnings(!_vp.getShowWarnings()); _vp.repaint(); } public void UIPickSpecialBasesColor() { Color c = JColorChooser.showDialog(_vp, "Choose new special bases color", _vp .getNonStandardBasesColor()); if (c != null) { _vp.setNonStandardBasesColor(c); _vp.setColorNonStandardBases(true); _vp.repaint(); } } public void UIPickGapsBasesColor() { Color c = JColorChooser.showDialog(_vp, "Choose new gaps bases color", _vp.getGapsBasesColor()); if (c != null) { _vp.setGapsBasesColor(c); _vp.setColorGapsBases(true); _vp.repaint(); } } public void UIBaseTypeColor() { if (_vp.isModifiable()) { new VueBases(_vp, VueBases.KIND_MODE); } } public void UIToggleModifiable() { _vp.setModifiable(!_vp.isModifiable()); } public void UIBasePairTypeColor() { if (_vp.isModifiable()) { new VueBases(_vp, VueBases.COUPLE_MODE); } } public void UIBaseAllColor() { if (_vp.isModifiable()) { new VueBases(_vp, VueBases.ALL_MODE); } } public void UIAbout() { VueAboutPanel about = new VueAboutPanel(); JOptionPane.showMessageDialog(_vp, about, "About VARNA " + VARNAConfig.MAJOR_VERSION + "." + VARNAConfig.MINOR_VERSION, JOptionPane.PLAIN_MESSAGE); about.gracefulStop(); } public void UIAutoAnnotateHelices() { if (_vp.isModifiable()) { _vp.getRNA().autoAnnotateHelices(); _vp.repaint(); } } public void UIAutoAnnotateStrandEnds() { if (_vp.isModifiable()) { _vp.getRNA().autoAnnotateStrandEnds(); _vp.repaint(); } } public void UIAutoAnnotateInteriorLoops() { if (_vp.isModifiable()) { _vp.getRNA().autoAnnotateInteriorLoops(); _vp.repaint(); } } public void UIAutoAnnotateTerminalLoops() { if (_vp.isModifiable()) { _vp.getRNA().autoAnnotateTerminalLoops(); _vp.repaint(); } } public void UIAnnotationRemoveFromAnnotation(TextAnnotation textAnnotation) { if (_vp.isModifiable()) { _vp.set_selectedAnnotation(null); _vp.getListeAnnotations().remove(textAnnotation); _vp.repaint(); } } public void UIAnnotationEditFromAnnotation(TextAnnotation textAnnotation) { VueAnnotation vue; if (textAnnotation.getType() == TextAnnotation.POSITION) vue = new VueAnnotation(_vp, textAnnotation, false); else vue = new VueAnnotation(_vp, textAnnotation, true, false); vue.show(); } public void UIAnnotationAddFromStructure(int type, ArrayList listeIndex) throws Exception { TextAnnotation textAnnot; ArrayList listeBase; VueAnnotation vue; switch (type) { case TextAnnotation.BASE: textAnnot = new TextAnnotation("", _vp.getRNA().get_listeBases() .get(listeIndex.get(0))); vue = new VueAnnotation(_vp, textAnnot, true); vue.show(); break; case TextAnnotation.LOOP: listeBase = new ArrayList(); for (Integer i : listeIndex) { listeBase.add(_vp.getRNA().get_listeBases().get(i)); } textAnnot = new TextAnnotation("", listeBase, type); vue = new VueAnnotation(_vp, textAnnot, true); vue.show(); break; case TextAnnotation.HELIX: listeBase = new ArrayList(); for (Integer i : listeIndex) { listeBase.add(_vp.getRNA().get_listeBases().get(i)); } textAnnot = new TextAnnotation("", listeBase, type); vue = new VueAnnotation(_vp, textAnnot, true); vue.show(); break; default: _vp.errorDialog(new Exception("Unknown structure type")); break; } } public void UIAnnotationEditFromStructure(int type, ArrayList listeIndex) { if (_vp.isModifiable()) { ModeleBase mb = _vp.getRNA().get_listeBases() .get(listeIndex.get(0)); TextAnnotation ta = _vp.getRNA().getAnnotation(type, mb); if (ta != null) UIAnnotationEditFromAnnotation(ta); } } public void UIAnnotationRemoveFromStructure(int type, ArrayList listeIndex) { if (_vp.isModifiable()) { ModeleBase mb = _vp.getRNA().get_listeBases() .get(listeIndex.get(0)); TextAnnotation ta = _vp.getRNA().getAnnotation(type, mb); if (ta != null) UIAnnotationRemoveFromAnnotation(ta); } } public void UIAnnotationsAddPosition(int x, int y) { if (_vp.isModifiable()) { Point2D.Double p = _vp.panelToLogicPoint(new Point2D.Double(x, y)); VueAnnotation annotationAdd = new VueAnnotation(_vp, (int) p.x, (int) p.y); annotationAdd.show(); } } public void UIAnnotationsAddBase(int x, int y) { if (_vp.isModifiable()) { ModeleBase mb = _vp.getBaseAt(new Point2D.Double(x, y)); if(mb!=null) { _vp.setSelectedBase(mb.getIndex()); TextAnnotation textAnnot = new TextAnnotation("", mb); VueAnnotation annotationAdd = new VueAnnotation(_vp, textAnnot,true); annotationAdd.show(); } } } public void UIAnnotationsAddLoop(int x, int y) { if (_vp.isModifiable()) { try { ModeleBase mb = _vp.getBaseAt(new Point2D.Double(x, y)); if(mb!=null) { Vector v = _vp.getRNA().getLoopBases(mb.getIndex()); ArrayList mbs = _vp.getRNA().getBasesAt(v); TextAnnotation textAnnot; textAnnot = new TextAnnotation("", mbs,TextAnnotation.LOOP); _vp.setSelection(mbs); VueAnnotation annotationAdd = new VueAnnotation(_vp, textAnnot,true); annotationAdd.show(); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } private ArrayList extractMaxContiguousPortion(ArrayList m) { ModeleBase[] tab = new ModeleBase[_vp.getRNA().getSize()]; for(int i=0;i best = new ArrayList(); ArrayList current = new ArrayList(); for(int i=0;ibest.size()) best = current; current = new ArrayList(); } } if (current.size()>best.size()) { best = current; } return best; } public void UIAnnotationsAddRegion(int x, int y) { if (_vp.isModifiable()) { ArrayList mb = _vp.getSelection().getBases(); if (mb.size()==0) { ModeleBase m = _vp.getBaseAt(new Point2D.Double(x, y)); mb.add(m); } mb = extractMaxContiguousPortion(extractMaxContiguousPortion(mb)); _vp.setSelection(mb); HighlightRegionAnnotation regionAnnot = new HighlightRegionAnnotation(mb); _vp.addHighlightRegion(regionAnnot); VueHighlightRegionEdit annotationAdd = new VueHighlightRegionEdit(_vp,regionAnnot); if (!annotationAdd.show()) { _vp.removeHighlightRegion(regionAnnot); } _vp.clearSelection(); } } public void UIAnnotationsAddChemProb(int x, int y) { if (_vp.isModifiable() && _vp.getRNA().getSize()>1) { Point2D.Double p = _vp.panelToLogicPoint(new Point2D.Double(x, y)); ModeleBase m1 = _vp.getBaseAt(new Point2D.Double(x, y)); ModeleBase best = null; if (m1.getIndex()-1>=0) { best = _vp.getRNA().getBaseAt(m1.getIndex()-1);} if (m1.getIndex()+1<_vp.getRNA().getSize()) { ModeleBase m2 = _vp.getRNA().getBaseAt(m1.getIndex()+1); if (best==null) { best = m2; } else { if (best.getCoords().distance(p)>m2.getCoords().distance(p)) { best = m2; } } } ArrayList tab = new ArrayList(); tab.add(m1); tab.add(best); _vp.setSelection(tab); ChemProbAnnotation regionAnnot = new ChemProbAnnotation(m1,best); _vp.getRNA().addChemProbAnnotation(regionAnnot); VueChemProbAnnotation annotationAdd = new VueChemProbAnnotation(_vp,regionAnnot); if (!annotationAdd.show()) { _vp.getRNA().removeChemProbAnnotation(regionAnnot); } _vp.clearSelection(); } } public void UIAnnotationsAddHelix(int x, int y) { if (_vp.isModifiable()) { try { ModeleBase mb = _vp.getBaseAt(new Point2D.Double(x, y)); if(mb!=null) { ArrayList v = _vp.getRNA().findHelix(mb.getIndex()); ArrayList mbs = _vp.getRNA().getBasesAt(v); TextAnnotation textAnnot; textAnnot = new TextAnnotation("", mbs,TextAnnotation.HELIX); _vp.setSelection(mbs); VueAnnotation annotationAdd = new VueAnnotation(_vp, textAnnot,true); annotationAdd.show(); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public void UIToggleGaspinMode() { if (_vp.isModifiable()) { _vp.toggleDrawOutlineBase(); _vp.toggleFillBase(); _vp.repaint(); } } public void UIAnnotationsAdd() { if (_vp.isModifiable()) { VueAnnotation annotationAdd = new VueAnnotation(_vp); annotationAdd.show(); } } public void UIEditAllBasePairs() { if (_vp.isModifiable()) { new VueBPList(_vp); } } public void UIAnnotationsRemove() { if (_vp.isModifiable()) { new VueListeAnnotations(_vp, VueListeAnnotations.REMOVE); } } public void UIAnnotationsEdit() { if (_vp.isModifiable()) { new VueListeAnnotations(_vp, VueListeAnnotations.EDIT); } } public void UIAddBP(int i, int j, ModeleStyleBP ms) { if (_vp.isModifiable()) { _vp.getRNA().addBPToStructure(i, j, ms); _undoableEditSupport.postEdit(new VARNAEdits.AddBPEdit(i,j,ms,_vp)); _vp.repaint(); } } public void UIRemoveBP(ModeleStyleBP ms) { if (_vp.isModifiable()) { _undoableEditSupport.postEdit(new VARNAEdits.RemoveBPEdit(ms.getIndex5(),ms.getIndex3(),ms,_vp)); _vp.getRNA().removeBP(ms); _vp.repaint(); } } public void UIShiftBaseCoord(ArrayList indices, double dx, double dy) { if (_vp.isModifiable()) { for (int index:indices) { ModeleBase mb = _vp.getRNA().getBaseAt(index); Point2D.Double d = mb.getCoords(); _vp.getRNA().setCoord(index, d.x+dx,d.y+dy); _vp.getRNA().setCenter(index, mb.getCenter().x+dx,mb.getCenter().y+dy); } _undoableEditSupport.postEdit(new VARNAEdits.BasesShiftEdit(indices,dx,dy,_vp)); _vp.repaint(); } } public void UIShiftBaseCoord(ArrayList indices, Point2D.Double dv) { UIShiftBaseCoord(indices, dv.x,dv.y); } public void UIMoveSingleBase(int index, double nx, double ny) { if (_vp.isModifiable()) { ModeleBase mb = _vp.getRNA().getBaseAt(index); Point2D.Double d = mb.getCoords(); _undoableEditSupport.postEdit(new VARNAEdits.SingleBaseMoveEdit(index,nx,ny,_vp)); _vp.getRNA().setCoord(index, nx,ny); _vp.repaint(); } } public void UIMoveSingleBase(int index, Point2D.Double dv) { UIMoveSingleBase(index, dv.x,dv.y); } public void UISetBaseCenter(int index, double x, double y) { UISetBaseCenter(index, new Point2D.Double(x, y)); } public void UISetBaseCenter(int index, Point2D.Double p) { if (_vp.isModifiable()) { _vp.getRNA().setCenter(index, p); } } public void UIUndo() { _vp.undo(); } public void UIRedo() { _vp.redo(); } /** * Move a helix of the rna * * @param index * :the index of the selected base * @param newPos * :the new xy coordinate, within the logical system of coordinates */ public void UIMoveHelixAtom(int index, Point2D.Double newPos) { if (_vp.isModifiable() && (index >= 0) && (index < _vp.getRNA().get_listeBases().size())) { int indexTo = _vp.getRNA().get_listeBases().get(index) .getElementStructure(); Point h = _vp.getRNA().getHelixInterval(index); Point ml = _vp.getRNA().getMultiLoop(h.x); int i = ml.x; if (indexTo != -1) { if (i == 0) { if (shouldFlip(index, newPos)) { UIFlipHelix(h); _undoableEditSupport.postEdit(new VARNAEdits.HelixFlipEdit(h,_vp)); } } else { UIRotateHelixAtom(index, newPos); } } _vp.fireLayoutChanged(); } } private Point2D.Double project(Point2D.Double O, Point2D.Double Ox, Point2D.Double C) { Point2D.Double OC = new Point2D.Double(C.x - O.x, C.y - O.y); // Projection of OC on OI => OX double normOX = (Ox.x * OC.x + Ox.y * OC.y); Point2D.Double OX = new Point2D.Double((normOX * Ox.x), (normOX * Ox.y)); // Portion of OC orthogonal to Ox => XC Point2D.Double XC = new Point2D.Double(OC.x - OX.x, OC.y - OX.y); // Reflexive image of C with respect to Ox => CP Point2D.Double OCP = new Point2D.Double(OX.x - XC.x, OX.y - XC.y); Point2D.Double CP = new Point2D.Double(O.x + OCP.x, O.y + OCP.y); return CP; } /** * Flip an helix around its supporting base */ public void UIFlipHelix(Point h) { int hBeg=h.x; int hEnd=h.y; Point2D.Double A = _vp.getRNA().getCoords(hBeg); Point2D.Double B = _vp.getRNA().getCoords(hEnd); Point2D.Double AB = new Point2D.Double(B.x - A.x, B.y - A.y); double normAB = Math.sqrt(AB.x * AB.x + AB.y * AB.y); // Creating a coordinate system centered on A and having // unit x-vector Ox. Point2D.Double O = A; Point2D.Double Ox = new Point2D.Double(AB.x / normAB, AB.y / normAB); for (int i = hBeg + 1; i < hEnd; i++) { Point2D.Double P = _vp.getRNA().getCoords(i); _vp.getRNA().setCoord(i, project(O, Ox, P)); Point2D.Double Center = _vp.getRNA().getCenter(i); _vp.getVARNAUI().UISetBaseCenter(i, project(O, Ox, Center)); } } /** * Tests if an helix needs to be flipped. */ boolean shouldFlip(int index, Point2D.Double P) { Point h = _vp.getRNA().getHelixInterval(index); Point2D.Double A = _vp.getRNA().getCoords(h.x); Point2D.Double B = _vp.getRNA().getCoords(h.y); Point2D.Double C = _vp.getRNA().getCoords(h.x + 1); // Creating a vector that is orthogonal to AB Point2D.Double hAB = new Point2D.Double(B.y - A.y, -(B.x - A.x)); Point2D.Double AC = new Point2D.Double(C.x - A.x, C.y - A.y); Point2D.Double AP = new Point2D.Double(P.x - A.x, P.y - A.y); double signC = (hAB.x * AC.x + hAB.y * AC.y); double signP = (hAB.x * AP.x + hAB.y * AP.y); // Now, the product signC*signP is negative iff the mouse and the first // base inside // the helix are on different sides of the end of the helix => Flip the // helix! return (signC * signP < 0.0); } public void UIRotateHelixAtom(int index, Point2D.Double newPos) { Point h = _vp.getRNA().getHelixInterval(index); Point ml = _vp.getRNA().getMultiLoop(h.x); int i = ml.x; int prevIndex = h.x; int nextIndex = h.y; while (i <= ml.y) { int j = _vp.getRNA().get_listeBases().get(i) .getElementStructure(); if ((j != -1) && (i < h.x)) { prevIndex = i; } if ((j != -1) && (i > h.y) && (nextIndex == h.y)) { nextIndex = i; } if ((j > i) && (j < ml.y)) { i = _vp.getRNA().get_listeBases().get(i) .getElementStructure(); } else { i++; } } Point2D.Double oldPos = _vp.getRNA().getCoords(index); Point2D.Double limitLoopLeft, limitLoopRight, limitLeft, limitRight, helixStart, helixStop; boolean isDirect = _vp.getRNA().testDirectionality(ml.x, ml.y, h.x); if (isDirect) { limitLoopLeft = _vp.getRNA().getCoords(ml.y); limitLoopRight = _vp.getRNA().getCoords(ml.x); limitLeft = _vp.getRNA().getCoords(prevIndex); limitRight = _vp.getRNA().getCoords(nextIndex); helixStart = _vp.getRNA().getCoords(h.x); helixStop = _vp.getRNA().getCoords(h.y); } else { limitLoopLeft = _vp.getRNA().getCoords(ml.x); limitLoopRight = _vp.getRNA().getCoords(ml.y); limitLeft = _vp.getRNA().getCoords(nextIndex); limitRight = _vp.getRNA().getCoords(prevIndex); helixStart = _vp.getRNA().getCoords(h.y); helixStop = _vp.getRNA().getCoords(h.x); } Point2D.Double center = _vp.getRNA().get_listeBases().get( h.x).getCenter(); double base = (computeAngle(center, limitLoopRight) + computeAngle( center, limitLoopLeft)) / 2.0; double pLimR = computeAngle(center, limitLeft) - base; double pHelR = computeAngle(center, helixStart) - base; double pNew = computeAngle(center, newPos) - base; double pOld = computeAngle(center, oldPos) - base; double pHelL = computeAngle(center, helixStop) - base; double pLimL = computeAngle(center, limitRight) - base; while (pLimR < 0.0) pLimR += 2.0 * Math.PI; while (pHelR < pLimR) pHelR += 2.0 * Math.PI; while ((pNew < pHelR)) pNew += 2.0 * Math.PI; while ((pOld < pHelR)) pOld += 2.0 * Math.PI; while ((pHelL < pOld)) pHelL += 2.0 * Math.PI; while ((pLimL < pHelL)) pLimL += 2.0 * Math.PI; double minDelta = normalizeAngle((pLimR - pHelR) + 0.25); double maxDelta = normalizeAngle((pLimL - pHelL) - 0.25); while (maxDelta < minDelta) maxDelta += 2.0 * Math.PI; double delta = normalizeAngle(pNew - pOld); while (delta < minDelta) delta += 2.0 * Math.PI; if (delta > maxDelta) { double distanceMax = delta - maxDelta; double distanceMin = minDelta - (delta - 2.0 * Math.PI); if (distanceMin < distanceMax) { delta = minDelta; } else { delta = maxDelta; } } _undoableEditSupport.postEdit(new VARNAEdits.HelixRotateEdit(delta,base,pLimL,pLimR,h,ml,_vp)); UIRotateEverything(delta, base, pLimL, pLimR, h, ml); } public void UIRotateEverything(double delta, double base, double pLimL, double pLimR, Point h, Point ml) { boolean isDirect = _vp.getRNA().testDirectionality(ml.x, ml.y, h.x); Point2D.Double center = _vp.getRNA().get_listeBases().get( h.x).getCenter(); rotateHelix(center, h.x, h.y, delta); // Re-assigns unpaired atoms boolean over = false; Point2D.Double helixStart = _vp.getRNA().getCoords(h.x); Point2D.Double helixStop = _vp.getRNA().getCoords(h.y); double pHelR,pHelL; if (isDirect) { pHelR = computeAngle(center, helixStop) - base; pHelL = computeAngle(center, helixStart) - base; } else { pHelL = computeAngle(center, helixStop) - base; pHelR = computeAngle(center, helixStart) - base; } int i = h.x - 1; Vector nextBases = new Vector(); while (!over) { if (i < 0) { over = true; } else { if (_vp.getRNA().get_listeBases().get(i) .getElementStructure() == -1) { nextBases.add(new Integer(i)); } else { over = true; } } i--; } Vector prevBases = new Vector(); over = false; i = h.y + 1; while (!over) { if (i >= _vp.getRNA().get_listeBases().size()) { over = true; } else { if (_vp.getRNA().get_listeBases().get(i) .getElementStructure() == -1) { prevBases.add(new Integer(i)); } else { over = true; } } i++; } double radius = center.distance(helixStart); double anglePrev, angleNext; double newAngle; if (isDirect) { anglePrev = normalizeAngle(pLimL - pHelR); angleNext = normalizeAngle(pHelL - pLimR); } else { anglePrev = normalizeAngle(pHelL - pLimR); angleNext = normalizeAngle(pLimL - pHelR); } for (i = 0; i < prevBases.size(); i++) { int k = prevBases.get(i).intValue(); if (isDirect) { newAngle = base + pHelR + ((i + 1) * anglePrev) / (prevBases.size() + 1); } else { newAngle = base + pHelL - ((i + 1) * anglePrev) / (prevBases.size() + 1); } double newX = center.x + radius * Math.cos(newAngle); double newY = center.y + radius * Math.sin(newAngle); _vp.getRNA().setCoord(k, newX, newY); } for (i = 0; i < nextBases.size(); i++) { int k = nextBases.get(i).intValue(); if (isDirect) { newAngle = base + pHelL - ((i + 1) * angleNext) / (nextBases.size() + 1); } else { newAngle = base + pHelR + ((i + 1) * angleNext) / (nextBases.size() + 1); } double newX = center.x + radius * Math.cos(newAngle); double newY = center.y + radius * Math.sin(newAngle); _vp.getRNA().setCoord(k, newX, newY); } } private double normalizeAngle(double angle) { return normalizeAngle(angle, 0.0); } private double normalizeAngle(double angle, double base) { while (angle < base) { angle += 2.0 * Math.PI; } while (angle >= (2.0 * Math.PI) - base) { angle -= 2.0 * Math.PI; } return angle; } public static double computeAngle(Point2D.Double center, Point2D.Double p) { double dist = center.distance(p); double angle = Math.asin((p.y - center.y) / dist); if (p.x - center.x < 0) { angle = Math.PI - angle; } return angle; } private void rotateHelix(Point2D.Double center, int i, int j, double angle) { for (int k = i; k <= j; k++) { Point2D.Double oldp = _vp.getRNA().getCoords(k); Point2D.Double newp = rotatePoint(center, oldp, angle); _vp.getRNA().setCoord(k, newp); if ((k != i) && (k != j)) { Point2D.Double oldc = _vp.getRNA().get_listeBases().get(k) .getCenter(); Point2D.Double newc = rotatePoint(center, oldc, angle); _vp.getVARNAUI().UISetBaseCenter(k,newc); } } } private Point2D.Double rotatePoint(Point2D.Double center, Point2D.Double p, double angle) { double dist = p.distance(center); double oldAngle = Math.asin((p.y - center.y) / dist); if (p.x - center.x < 0) { oldAngle = Math.PI - oldAngle; } double newX = (center.x + dist * Math.cos(oldAngle + angle)); double newY = (center.y + dist * Math.sin(oldAngle + angle)); return new Point2D.Double(newX, newY); } } PK 3F>6  2fr/orsay/lri/varna/views/VueListeAnnotations.class1,fr/orsay/lri/varna/views/VueListeAnnotationsjavax/swing/JPanelserialVersionUIDJ ConstantValueREMOVEIEDIT_vpLfr/orsay/lri/varna/VARNAPanel;dataLjava/util/ArrayList; Signature)Ljava/util/ArrayList;tableLjavax/swing/JTable;typespecialTableModel4Lfr/orsay/lri/varna/components/AnnotationTableModel;#(Lfr/orsay/lri/varna/VARNAPanel;I)VCodejava/awt/GridLayout  !(II)V # $(Ljava/awt/LayoutManager;)V &  ( *java/util/ArrayList ), -()V /  132fr/orsay/lri/varna/VARNAPanel 45getListeAnnotations()Ljava/util/ArrayList; )7 89addAll(Ljava/util/Collection;)Z 1; <=getRNA%()Lfr/orsay/lri/varna/models/rna/RNA; ?A@!fr/orsay/lri/varna/models/rna/RNA B5getHighlightRegion ?D E5getChemProbAnnotations G H- createViewLineNumberTableLocalVariableTablethis.Lfr/orsay/lri/varna/views/VueListeAnnotations;vpO2fr/orsay/lri/varna/components/AnnotationTableModel NQ R(Ljava/util/ArrayList;)V T Vjavax/swing/JTable UX Y!(Ljavax/swing/table/TableModel;)V [ ]8fr/orsay/lri/varna/controlers/ControleurTableAnnotations \_ `7(Ljavax/swing/JTable;Lfr/orsay/lri/varna/VARNAPanel;I)V Ub cdaddMouseListener!(Ljava/awt/event/MouseListener;)V Uf ghaddMouseMotionListener'(Ljava/awt/event/MouseMotionListener;)Vjjavax/swing/JScrollPane il m(Ljava/awt/Component;)V o pqadd*(Ljava/awt/Component;)Ljava/awt/Component; s t-UIvueListeAnnotationsctrl:Lfr/orsay/lri/varna/controlers/ControleurTableAnnotations; scrollPaneLjavax/swing/JScrollPane; z|{javax/swing/JComponent }~ setOpaque(Z)VAnnotation edition javax/swing/JOptionPane showMessageDialog<(Ljava/awt/Component;Ljava/lang/Object;Ljava/lang/String;I)VnewContentPaneLjavax/swing/JComponent;getData+()Ljava/util/ArrayList;setData,(Ljava/util/ArrayList;)VLocalVariableTypeTableget_vp!()Lfr/orsay/lri/varna/VARNAPanel;getTable()Ljavax/swing/JTable;setTable(Ljavax/swing/JTable;)VgetSpecialTableModel6()Lfr/orsay/lri/varna/components/AnnotationTableModel;setSpecialTableModel7(Lfr/orsay/lri/varna/components/AnnotationTableModel;)V SourceFileVueListeAnnotations.java!     Z*Y"*%*+'*)Y+.*.*'06W*.*':>6W*.*':C6W*FI& I JKL"M1NCOUPYQJ ZKLZMZ H-Y*NY*.PS*UY*SWZ\Y*Z*'*%^L*Z+a*Z+eiY*ZkM*,nW*rI. TUV&W.V2X:YB^N`TbXcJ YKL2'uvN wxt-[*L+y*'+Ijkl mlnJKL5/*.IqJ KLRP*+.I uvJKL /*'IyJ KL/*ZI}J KL>*+ZI JKL/*SIJ KL>*+SI JKLPK qq<^"E̫1fr/orsay/lri/varna/views/VueListeAnnotations.java/* * VARNA is a tool for the automated drawing, visualization and annotation * of the secondary structure of RNA, designed as a companion software for * web servers and databases. Copyright (C) 2008 Kevin Darty, Alain Denise * and Yann Ponty. electronic mail : Yann.Ponty@lri.fr paper mail : LRI, bat * 490 Universit Paris-Sud 91405 Orsay Cedex France * * This file is part of VARNA version 3.1. VARNA version 3.1 is free * software: you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * VARNA version 3.1 is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. * * You should have received a copy of the GNU General Public License along * with VARNA version 3.1. If not, see http://www.gnu.org/licenses. */ package fr.orsay.lri.varna.views; import java.awt.GridLayout; import java.util.ArrayList; import javax.swing.JComponent; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import fr.orsay.lri.varna.VARNAPanel; import fr.orsay.lri.varna.components.AnnotationTableModel; import fr.orsay.lri.varna.controlers.ControleurTableAnnotations; /** * a view for all annoted texts on the VARNAPanel * * @author Darty@lri.fr * */ public class VueListeAnnotations extends JPanel { /** * */ private static final long serialVersionUID = 1L; /** * if this view is for removing annoted texts */ public static final int REMOVE = 0; /** * if this view is for editing annoted texts */ public static final int EDIT = 1; private VARNAPanel _vp; private ArrayList data; private JTable table; private int type; private AnnotationTableModel specialTableModel; /** * creates the view * * @param vp * @param type * (REMOVE or EDIT) */ public VueListeAnnotations(VARNAPanel vp, int type) { super(new GridLayout(1, 0)); this.type = type; _vp = vp; data = new ArrayList(); data.addAll(_vp.getListeAnnotations()); data.addAll(_vp.getRNA().getHighlightRegion()); data.addAll(_vp.getRNA().getChemProbAnnotations()); createView(); } private void createView() { specialTableModel = new AnnotationTableModel(data); table = new JTable(specialTableModel); ControleurTableAnnotations ctrl = new ControleurTableAnnotations(table, _vp, type); table.addMouseListener(ctrl); table.addMouseMotionListener(ctrl); // table.setPreferredScrollableViewportSize(new Dimension(500, 100)); // TODO: Find equivalent in JRE 1.5 // table.setFillsViewportHeight(true); // Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); add(scrollPane); UIvueListeAnnotations(); } /** * Create the GUI and show it. For thread safety, this method should be * invoked from the event-dispatching thread. */ public void UIvueListeAnnotations() { JComponent newContentPane = this; newContentPane.setOpaque(true); JOptionPane.showMessageDialog(_vp, newContentPane, "Annotation edition", JOptionPane.PLAIN_MESSAGE); } public ArrayList getData() { return data; } public void setData(ArrayList data) { this.data = data; } public VARNAPanel get_vp() { return _vp; } public JTable getTable() { return table; } public void setTable(JTable table) { this.table = table; } public AnnotationTableModel getSpecialTableModel() { return specialTableModel; } public void setSpecialTableModel(AnnotationTableModel specialTableModel) { this.specialTableModel = specialTableModel; } } PK mq<{"EE LICENSE.txt GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS PK qq PK ksk=9c!XXTODO.txtFonctionnalites ajouter : RNAML : Inclure dans .jar num base dans angle => produit vectoriel deplacement dans l'algo NAView identique a celui de l'aglo Radial =>besoin de creer des centre de rotation en mode NAView faire un export de tte les info de varna en xml qui sauvegarde ttes les info (seq, struct, couleurs et coords) faire un import du fichier xml pour charge les modif apporte a l'arn Limiter la hauteur des arcs au strict necessaire en mode Line pour le dessin Ex: Dans (.(((...)))..(((...))).), la boucle exterieure n'a pas besoin d'tre hauteur 22, seulement hauteur 4, pour ne pas rentrer en conflit avec les arcs dessins en dessous. A la limite, on pourrait la dessiner hauteur 5 pour marquer la difference entre les helices dans cette reprsentation. Courbes de bzier en reprsentation circulaire. PK 4j=p||BugsAndProblems - Ajouter message d'erreur lors du chargement - Grer affichage partiel/hybridisation Problemes connus : probleme de focus => gene raccourcis clavier. //cadre mal placé pour le mode Line donc deplacement spécial probleme lors de l'affichage d'un ARN sans base dans le AboutVarna, lors d'un click droit sur la figure, il est possible de redemander un aboutVarna.PK@g?A,6@META-INF/MANIFEST.MFPK@g?66META-INF/JALVIEW.SFPK@g?3 nMETA-INF/JALVIEW.DSAPK 4j=rq.projectPK 4j=k rVARNALinks.csvPK 4j=3@ {.classpathPK e}=sv9 9 |VARNA.jsPK 4F>prr VARNA.classPK n={aKK VARNA.javaPK 4F>(fr/PK 4F> Ifr/orsay/PK 4F> pfr/orsay/lri/PK 4F>fr/orsay/lri/varna/PK ;y>\7#̼fr/orsay/lri/varna/VARNAPanel.classPK ;y>; "fr/orsay/lri/varna/VARNAPanel.javaPK f> fr/orsay/lri/varna/applications/PK 4F>t!2fr/orsay/lri/varna/applications/VARNAPrinter.classPK W*=f1fr/orsay/lri/varna/applications/VARNAPrinter.javaPK F>dx]]4fr/orsay/lri/varna/applications/NussinovDemo$1.classPK F>/K;;4fr/orsay/lri/varna/applications/NussinovDemo$2.classPK F>!Ջ112Sfr/orsay/lri/varna/applications/NussinovDemo.classPK B>ɧN221.fr/orsay/lri/varna/applications/NussinovDemo.javaPK 4F>_ i5nBfr/orsay/lri/varna/applications/AlignmentDemo$1.classPK 4F>u F3Gfr/orsay/lri/varna/applications/AlignmentDemo.classPK ;m="##2gfr/orsay/lri/varna/applications/AlignmentDemo.javaPK 4F>$_ _ =Hfr/orsay/lri/varna/applications/FileNameExtensionFilter.classPK pq D%%6)fr/orsay/lri/varna/applications/VARNAConsoleDemo.classPK pq *  0fr/orsay/lri/varna/applications/VARNAGUI$1.classPK 4F>? ]e e 0fr/orsay/lri/varna/applications/VARNAGUI$2.classPK 4F>@q0fr/orsay/lri/varna/applications/VARNAGUI$3.classPK 4F>*]0fr/orsay/lri/varna/applications/VARNAGUI$4.classPK 4F>dF;fr/orsay/lri/varna/applications/VARNAGUI$BackupHolder.classPK 4F>Vl99.vfr/orsay/lri/varna/applications/VARNAGUI.classPK IP>!8wAA-x?fr/orsay/lri/varna/applications/VARNAGUI.javaPK 4F>Fa 0FF5fr/orsay/lri/varna/applications/VARNAOnlineDemo.classPK pq<Ý4<fr/orsay/lri/varna/applications/VARNAOnlineDemo.javaPK 4F>M5656.fr/orsay/lri/varna/applications/VARNAcmd.classPK 0Wy=& 4 4-fr/orsay/lri/varna/applications/VARNAcmd.javaPK 4F> RNYgg9)fr/orsay/lri/varna/applications/SuperpositionDemo$1.classPK 4F>UV9/fr/orsay/lri/varna/applications/SuperpositionDemo$2.classPK 4F> Cs1178fr/orsay/lri/varna/applications/SuperpositionDemo.classPK VC>/|VK6K66jjfr/orsay/lri/varna/applications/SuperpositionDemo.javaPK 4F>/ fr/orsay/lri/varna/applications/templateEditor/PK 4F>BYVfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAddTemplateEdit.classPK 4F><. . \|fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementAttachTemplateEdit.classPK 4F>#. . \$fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementDetachTemplateEdit.classPK 4F>4J? ? ^̽fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementEdgeMoveTemplateEdit.classPK 4F>$9E\fr/orsay/lri/varna/applications/templateEditor/TemplateEdits$ElementRemoveTemplateEdit.classPK 4F>*IIXfr/orsay/lri/varna/applications/templateEditor/TemplateEdits$HelixFlipTemplateEdit.classPK 4F>XЯBzfr/orsay/lri/varna/applications/templateEditor/TemplateEdits.classPK ,)i?m6m6CDfr/orsay/lri/varna/applications/templateEditor/TemplateEditor.classPK >4(;//B*fr/orsay/lri/varna/applications/templateEditor/TemplateEditor.javaPK 4F>ȕXXBwYfr/orsay/lri/varna/applications/templateEditor/TemplatePanel.classPK m>H^FFAdfr/orsay/lri/varna/applications/templateEditor/TemplatePanel.javaPK 4F>W%%Cfr/orsay/lri/varna/applications/templateEditor/MouseControler.classPK m>KkB fr/orsay/lri/varna/applications/templateEditor/MouseControler.javaPK 4F>h_^;fr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement$RelativePosition.classPK 4F>h<a00MwDfr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement.classPK U p=p|f(f(Lufr/orsay/lri/varna/applications/templateEditor/GraphicalTemplateElement.javaPK 4F>;fr/orsay/lri/varna/applications/templateEditor/Couple.classPK pq<|dT)oo:פfr/orsay/lri/varna/applications/templateEditor/Couple.javaPK 4F>}@@Cfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion.classPK m>F22Bfr/orsay/lri/varna/applications/templateEditor/UnpairedRegion.javaPK 4F>^}xPP:j fr/orsay/lri/varna/applications/templateEditor/Helix.classPK m> (Wn=M=M9gk fr/orsay/lri/varna/applications/templateEditor/Helix.javaPK 4F>tO? fr/orsay/lri/varna/applications/templateEditor/Connection.classPK pq<> fr/orsay/lri/varna/applications/templateEditor/Connection.javaPK 4F>hhJ fr/orsay/lri/varna/applications/templateEditor/TemplateEditorPanelUI.classPK e fr/orsay/lri/varna/components/PK 4F>kpFQxx2 fr/orsay/lri/varna/components/ActionRenderer.classPK p(>Kr1 fr/orsay/lri/varna/components/ActionRenderer.javaPK 4F>|,GDf fr/orsay/lri/varna/components/ReorderableJList$RJLTransferable.classPK 4F>Q*+P fr/orsay/lri/varna/components/ReorderableJList$ReorderableListCellRenderer.classPK 4F>Bym4G fr/orsay/lri/varna/components/ReorderableJList.classPK \>Ê3 fr/orsay/lri/varna/components/ReorderableJList.javaPK 4F>AAA0: fr/orsay/lri/varna/components/VARNAConsole.classPK oqIZ7U fr/orsay/lri/varna/components/GradientEditorPanel.classPK oq<&&6t fr/orsay/lri/varna/components/GradientEditorPanel.javaPK 4F>amPe0D fr/orsay/lri/varna/components/ActionEditor.classPK (>j3->>/ fr/orsay/lri/varna/components/ActionEditor.javaPK 4F>nn14 fr/orsay/lri/varna/components/ColorRenderer.classPK Vo(>ff0 fr/orsay/lri/varna/components/ColorRenderer.javaPK 4F> 2 fr/orsay/lri/varna/components/BaseTableModel.classPK oq<*AZ 1 fr/orsay/lri/varna/components/BaseTableModel.javaPK 4F>Ɛ : fr/orsay/lri/varna/components/BaseSpecialColorEditor.classPK oq<=Q 9 fr/orsay/lri/varna/components/BaseSpecialColorEditor.javaPK 4F>0TT8 fr/orsay/lri/varna/components/AnnotationTableModel.classPK oq<+R 7D fr/orsay/lri/varna/components/AnnotationTableModel.javaPK 4F> fr/orsay/lri/varna/controlers/PK 4F>ˍ+OO9 fr/orsay/lri/varna/controlers/ControleurSliderLabel.classPK pq<CC8 fr/orsay/lri/varna/controlers/ControleurSliderLabel.javaPK 4F>< fr/orsay/lri/varna/controlers/ControleurBlinkingThread.classPK pq<[' ;i fr/orsay/lri/varna/controlers/ControleurBlinkingThread.javaPK 4F>vVFw fr/orsay/lri/varna/controlers/ControleurClicMovement$MouseStates.classPK 4F>sGG:! fr/orsay/lri/varna/controlers/ControleurClicMovement.classPK h<>~^^9i fr/orsay/lri/varna/controlers/ControleurClicMovement.javaPK 4F>ZN˰;3 fr/orsay/lri/varna/controlers/ControleurDemoTextField.classPK pq<*>>:< fr/orsay/lri/varna/controlers/ControleurDemoTextField.javaPK 4F>]xx< fr/orsay/lri/varna/controlers/ControleurGlobalRotation.classPK a*>; fr/orsay/lri/varna/controlers/ControleurGlobalRotation.javaPK 4F>4 fr/orsay/lri/varna/controlers/ControleurBorder.classPK pqF?& fr/orsay/lri/varna/controlers/ControleurJCheckBoxMenuItem.classPK pq<r>g fr/orsay/lri/varna/controlers/ControleurJCheckBoxMenuItem.javaPK 4F>K25 fr/orsay/lri/varna/controlers/ControleurMolette.classPK pq' LP< fr/orsay/lri/varna/controlers/ControleurDraggedMolette.classPK pqӍV>1 fr/orsay/lri/varna/controlers/ControleurTableAnnotations.classPK pq<= H fr/orsay/lri/varna/controlers/ControleurTableAnnotations.javaPK 4F>%b?N\ fr/orsay/lri/varna/controlers/ControleurSpaceBetweenBases.classPK pq<Ye>.a fr/orsay/lri/varna/controlers/ControleurSpaceBetweenBases.javaPK 4F>><g fr/orsay/lri/varna/controlers/ControleurVARNAPanelKeys.classPK <>!V&&; fr/orsay/lri/varna/controlers/ControleurVARNAPanelKeys.javaPK 4F> \GG?ԩ fr/orsay/lri/varna/controlers/ControleurBPHeightIncrement.classPK pq>>x fr/orsay/lri/varna/controlers/ControleurBPHeightIncrement.javaPK 4F>,L,L2 fr/orsay/lri/varna/controlers/ControleurMenu.classPK VC>VUU1 fr/orsay/lri/varna/controlers/ControleurMenu.javaPK 4F>k2.GW fr/orsay/lri/varna/controlers/ControleurInterpolator$MinimizeRMSD.classPK 4F>IRhEEB` fr/orsay/lri/varna/controlers/ControleurInterpolator$Targets.classPK 4F>XH]h fr/orsay/lri/varna/controlers/ControleurInterpolator$TargetsHolder.classPK 4F>.E"++:l fr/orsay/lri/varna/controlers/ControleurInterpolator.classPK dl=i={G{G9Ř fr/orsay/lri/varna/controlers/ControleurInterpolator.javaPK 4F>4JJD fr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor.classPK pq<ۆ+@@CC fr/orsay/lri/varna/controlers/ControleurBaseSpecialColorEditor.javaPK 4F>S} @ fr/orsay/lri/varna/controlers/ControleurSelectionHighlight.classPK pqಃ[[;)fr/orsay/lri/varna/controlers/ControleurVueAnnotation.classPK pq<:fr/orsay/lri/varna/controlers/ControleurVueAnnotation.javaPK 4F>u~2 $fr/orsay/lri/varna/controlers/ControleurZoom.classPK pqgIC&.fr/orsay/lri/varna/controlers/ControleurScriptParser$Argument.classPK 4F>vzG42fr/orsay/lri/varna/controlers/ControleurScriptParser$ArgumentType.classPK 4F>522H_8fr/orsay/lri/varna/controlers/ControleurScriptParser$ArrayArgument.classPK 4F>A25aaH>fr/orsay/lri/varna/controlers/ControleurScriptParser$ColorArgument.classPK 4F>LqqBCfr/orsay/lri/varna/controlers/ControleurScriptParser$Command.classPK 4F>csPPCHfr/orsay/lri/varna/controlers/ControleurScriptParser$Function.classPK 4F>a2nnI@Qfr/orsay/lri/varna/controlers/ControleurScriptParser$NumberArgument.classPK 4F>O]fIVfr/orsay/lri/varna/controlers/ControleurScriptParser$StringArgument.classPK 4F>+\3\3:Zfr/orsay/lri/varna/controlers/ControleurScriptParser.classPK Ch}=Zu47479>fr/orsay/lri/varna/controlers/ControleurScriptParser.javaPK 4F>pʣ7fr/orsay/lri/varna/controlers/ControleurNumPeriod.classPK pq<9u6fr/orsay/lri/varna/controlers/ControleurNumPeriod.javaPK 4F>fr/orsay/lri/varna/exceptions/PK 4F>h9fr/orsay/lri/varna/exceptions/ExceptionExportFailed.classPK mq//=fr/orsay/lri/varna/exceptions/ExceptionPermissionDenied.classPK mq<+SS<fr/orsay/lri/varna/exceptions/ExceptionPermissionDenied.javaPK 4F>N2j<1fr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm.classPK mq<;ufr/orsay/lri/varna/exceptions/ExceptionNAViewAlgorithm.javaPK 4F>B**7pfr/orsay/lri/varna/exceptions/ExceptionXmlLoading.classPK Pqᔿ?fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax.classPK mq<>fr/orsay/lri/varna/exceptions/ExceptionFileFormatOrSyntax.javaPK 4F>#":1fr/orsay/lri/varna/exceptions/ExceptionLoadingFailed.classPK mqB33: fr/orsay/lri/varna/exceptions/ExceptionXMLGeneration.classPK mq<>Sww9 fr/orsay/lri/varna/exceptions/ExceptionXMLGeneration.javaPK 4F>11::HRfr/orsay/lri/varna/exceptions/ExceptionUnmatchedClosingParentheses.classPK mq h?=Qfr/orsay/lri/varna/exceptions/ExceptionWritingForbidden.classPK mq蛪 G*$fr/orsay/lri/varna/exceptions/ExceptionModeleStyleBaseSyntaxError.classPK mqy<<=J-fr/orsay/lri/varna/exceptions/ExceptionDrawingAlgorithm.classPK mq"EBB?1fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate.classPK mq< MQ>4fr/orsay/lri/varna/exceptions/ExceptionInvalidRNATemplate.javaPK 4F>Xf;6fr/orsay/lri/varna/exceptions/ExceptionParameterError.classPK mq*cŦI`Afr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected.classPK mq<9+  HmDfr/orsay/lri/varna/exceptions/ExceptionEdgeEndpointAlreadyConnected.javaPK 4F>RkE9Ffr/orsay/lri/varna/exceptions/ExceptionJPEGEncoding.classPK mq:JJ4%Pfr/orsay/lri/varna/exceptions/MappingException.classPK mq<)qѬ3Tfr/orsay/lri/varna/exceptions/MappingException.javaPK 4F>c  ;\fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength.classPK mq<ǘ:$`fr/orsay/lri/varna/exceptions/ExceptionNonEqualLength.javaPK 4F>ffr/orsay/lri/varna/interfaces/PK 4F>=<ffr/orsay/lri/varna/interfaces/InterfaceVARNAObservable.classPK mq<~;hfr/orsay/lri/varna/interfaces/InterfaceVARNAObservable.javaPK 4F>|YY:nfr/orsay/lri/varna/interfaces/InterfaceVARNAListener.classPK TVC>G*9ofr/orsay/lri/varna/interfaces/InterfaceVARNAListener.javaPK 4F>=u-<ufr/orsay/lri/varna/interfaces/InterfaceParameterLoader.classPK mq<(*;vfr/orsay/lri/varna/interfaces/InterfaceParameterLoader.javaPK 4F>{fr/orsay/lri/varna/models/PK >o_>1&|fr/orsay/lri/varna/models/VARNAConfigLoader.classPK > 0efr/orsay/lri/varna/models/VARNAConfigLoader.javaPK 4F>wJJ*fr/orsay/lri/varna/models/FullBackup.classPK $Y=XΚ  )Nfr/orsay/lri/varna/models/FullBackup.javaPK 4F>E#4fr/orsay/lri/varna/models/VARNAEdits$AddBPEdit.classPK 4F>{ 9fr/orsay/lri/varna/models/VARNAEdits$BasesShiftEdit.classPK 4F>8gfr/orsay/lri/varna/models/VARNAEdits$HelixFlipEdit.classPK 4F>' :fr/orsay/lri/varna/models/VARNAEdits$HelixRotateEdit.classPK 4F>޵/ff5fr/orsay/lri/varna/models/VARNAEdits$RedrawEdit.classPK 4F>vn((7fr/orsay/lri/varna/models/VARNAEdits$RemoveBPEdit.classPK 4F>-}}8,fr/orsay/lri/varna/models/VARNAEdits$RotateRNAEdit.classPK 4F>") =fr/orsay/lri/varna/models/VARNAEdits$SingleBaseMoveEdit.classPK 4F>9j*-fr/orsay/lri/varna/models/VARNAEdits.classPK )~*>vb))){fr/orsay/lri/varna/models/VARNAEdits.javaPK 4F>Y4/fr/orsay/lri/varna/models/VARNAConfig$BP_STYLE.classPK 4F>;rDD+7fr/orsay/lri/varna/models/VARNAConfig.classPK .<>,00*Pfr/orsay/lri/varna/models/VARNAConfig.javaPK 4F>8 8 0lfr/orsay/lri/varna/models/CubicBezierCurve.classPK oq<7S/zfr/orsay/lri/varna/models/CubicBezierCurve.javaPK 4F>˶m(fr/orsay/lri/varna/models/BaseList.classPK nq&fr/orsay/lri/varna/models/annotations/PK 4F>!"$"$Eîfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation.classPK >'$'$DHfr/orsay/lri/varna/models/annotations/HighlightRegionAnnotation.javaPK 4F>;dxx:fr/orsay/lri/varna/models/annotations/TextAnnotation.classPK Y'>%%9fr/orsay/lri/varna/models/annotations/TextAnnotation.javaPK 4F>3q bbU=fr/orsay/lri/varna/models/annotations/ChemProbAnnotation$ChemProbAnnotationType.classPK 4F>d{B>Ffr/orsay/lri/varna/models/annotations/ChemProbAnnotation.classPK oq</ff=_fr/orsay/lri/varna/models/annotations/ChemProbAnnotation.javaPK 4F>!ufr/orsay/lri/varna/models/export/PK 4F> C8ufr/orsay/lri/varna/models/export/FillCircleCommand.classPK nq6==0fr/orsay/lri/varna/models/export/SVGExport.classPK Ģk=Fbb/{fr/orsay/lri/varna/models/export/SVGExport.javaPK 4F>ubb4*fr/orsay/lri/varna/models/export/SwingGraphics.classPK [>,ՠ3fr/orsay/lri/varna/models/export/SwingGraphics.javaPK 4F>\//<fr/orsay/lri/varna/models/export/SecStrDrawingProducer.classPK Z>H00;fr/orsay/lri/varna/models/export/SecStrDrawingProducer.javaPK 4F>$|111fr/orsay/lri/varna/models/export/ArcCommand.classPK nq< V""06fr/orsay/lri/varna/models/export/ArcCommand.javaPK 4F>“gg2N>fr/orsay/lri/varna/models/export/TextCommand.classPK nq< j1Bfr/orsay/lri/varna/models/export/TextCommand.javaPK 4F>=Gfr/orsay/lri/varna/models/export/SecStrProducerGraphics.classPK p=!_7 <@Wfr/orsay/lri/varna/models/export/SecStrProducerGraphics.javaPK 4F>Y77bfr/orsay/lri/varna/models/export/VueVARNAGraphics.classPK p=t,6efr/orsay/lri/varna/models/export/VueVARNAGraphics.javaPK 4F>|:#I#I#/.kfr/orsay/lri/varna/models/export/PSExport.classPK N=h"".Ďfr/orsay/lri/varna/models/export/PSExport.javaPK 4F>MM5fr/orsay/lri/varna/models/export/GraphicElement.classPK nq<_ hh4Cfr/orsay/lri/varna/models/export/GraphicElement.javaPK 4F>V0{{2fr/orsay/lri/varna/models/export/FontCommand.classPK nq<\y]]1Ⱥfr/orsay/lri/varna/models/export/FontCommand.javaPK 4F>[vy""3tfr/orsay/lri/varna/models/export/ColorCommand.classPK nq<ݻPg2fr/orsay/lri/varna/models/export/ColorCommand.javaPK 4F>5gr2?fr/orsay/lri/varna/models/export/LineCommand.classPK nq}8XX5fr/orsay/lri/varna/models/export/PolygonCommand.classPK nqC;49fr/orsay/lri/varna/models/export/FillPolygonCommand.classPK nq<9U08fr/orsay/lri/varna/models/export/FillPolygonCommand.javaPK 4F>sxx1fr/orsay/lri/varna/models/export/XFIGExport.classPK ̕<RH0fr/orsay/lri/varna/models/export/XFIGExport.javaPK 4F>e4fr/orsay/lri/varna/models/export/CircleCommand.classPK nq<1[773"fr/orsay/lri/varna/models/export/CircleCommand.javaPK 4F>;7(fr/orsay/lri/varna/models/export/RectangleCommand.classPK nq!}3fr/orsay/lri/varna/models/naView/PK 4F>~'w.3fr/orsay/lri/varna/models/naView/Radloop.classPK nqL+c?fr/orsay/lri/varna/models/naView/Loop.classPK nq<=2ؕ *Mfr/orsay/lri/varna/models/naView/Loop.javaPK 4F>8tD D 1Yfr/orsay/lri/varna/models/naView/Connection.classPK nq<~SA A 0#dfr/orsay/lri/varna/models/naView/Connection.javaPK 4F>',NN-nfr/orsay/lri/varna/models/naView/Region.classPK nq<]3,Ksfr/orsay/lri/varna/models/naView/Region.javaPK 4F>P?dd-yfr/orsay/lri/varna/models/naView/NAView.classPK mbl=],fr/orsay/lri/varna/models/naView/NAView.javaPK 4F>H+qfr/orsay/lri/varna/models/naView/Base.classPK nq~fr/orsay/lri/varna/models/rna/PK 4F>g Efr/orsay/lri/varna/models/rna/ModeleColorMap$NamedColorMapTypes.classPK 4F>^Srr2fr/orsay/lri/varna/models/rna/ModeleColorMap.classPK |d}=s 111fr/orsay/lri/varna/models/rna/ModeleColorMap.javaPK y>JA!A!?:fr/orsay/lri/varna/models/rna/VARNASecDraw$HelixEmbedding.classPK y>Fac c >fr/orsay/lri/varna/models/rna/VARNASecDraw$PairedPortion.classPK y>R8fr/orsay/lri/varna/models/rna/VARNASecDraw$Portion.classPK y>QP 8fr/orsay/lri/varna/models/rna/VARNASecDraw$RNATree.classPK y>OF\ \ @fr/orsay/lri/varna/models/rna/VARNASecDraw$UnpairedPortion.classPK y>}[/(/(0 fr/orsay/lri/varna/models/rna/VARNASecDraw.classPK y>A2]]/85fr/orsay/lri/varna/models/rna/VARNASecDraw.javaPK 3F>Yָ.:fr/orsay/lri/varna/models/rna/VARNAPoint.classPK nqfr/orsay/lri/varna/models/rna/VARNAPoint.javaPK c>{lT=fr/orsay/lri/varna/models/rna/RNA$DrawRNATemplateMethod.classPK c>d'fr/orsay/lri/varna/models/rna/RNA.classPK c><Ƌ&&&u*fr/orsay/lri/varna/models/rna/RNA.javaPK 4F>i 0Qfr/orsay/lri/varna/models/rna/ModeleStrand.classPK <#/[fr/orsay/lri/varna/models/rna/ModeleStrand.javaPK 4F>4949)afr/orsay/lri/varna/models/rna/Motif.classPK *= htgtg(Xfr/orsay/lri/varna/models/rna/Motif.javaPK 4F><Sfr/orsay/lri/varna/models/rna/ModeleBaseNucleotide$STATE_SPECIAL_CHARS_STATES.classPK 4F>tZtT!T!8 fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide.classPK \=,co''7,+fr/orsay/lri/varna/models/rna/ModeleBaseNucleotide.javaPK 4F>6Rfr/orsay/lri/varna/models/rna/ModeleStyleBP$Edge.classPK 4F>d_.;Yfr/orsay/lri/varna/models/rna/ModeleStyleBP$Stericity.classPK 4F> D % %1`fr/orsay/lri/varna/models/rna/ModeleStyleBP.classPK K'>*O(O(05fr/orsay/lri/varna/models/rna/ModeleStyleBP.javaPK 4F>a3Үfr/orsay/lri/varna/models/rna/ModeleStyleBase.classPK nq<enn2fr/orsay/lri/varna/models/rna/ModeleStyleBase.javaPK 4F>UR]@@+fr/orsay/lri/varna/models/rna/Mapping.classPK /kl=Α &&*fr/orsay/lri/varna/models/rna/Mapping.javaPK 3F>"  6 fr/orsay/lri/varna/models/rna/RNAMLParser$BPTemp.classPK 3F>{vrr9fr/orsay/lri/varna/models/rna/RNAMLParser$HelixTemp.classPK 3F>$!66/fr/orsay/lri/varna/models/rna/RNAMLParser.classPK ]>EpFF.Qfr/orsay/lri/varna/models/rna/RNAMLParser.javaPK 4F>V%9[fr/orsay/lri/varna/models/rna/ModeleBasesComparison.classPK Vm=j""8fr/orsay/lri/varna/models/rna/ModeleBasesComparison.javaPK 3F>d`$1fr/orsay/lri/varna/models/rna/StructureTemp.classPK v<~J0Qfr/orsay/lri/varna/models/rna/StructureTemp.javaPK 4F>mV.fr/orsay/lri/varna/models/rna/ExtendedMB.classPK Pq.fr/orsay/lri/varna/models/rna/ModeleBase.classPK l=-'fr/orsay/lri/varna/models/rna/ModeleBase.javaPK 3F>$fr/orsay/lri/varna/models/templates/PK 3F>CJfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToTree.classPK 3F>i5E%zzBtfr/orsay/lri/varna/models/templates/RNATemplate$ConvertToXml.classPK 3F>EAJN<fr/orsay/lri/varna/models/templates/RNATemplate$EdgeEndPointPosition.classPK 3F>;;^Bfr/orsay/lri/varna/models/templates/RNATemplate$In1Is.classPK 3F>[v##AGfr/orsay/lri/varna/models/templates/RNATemplate$LoadFromXml.classPK 3F>XK}3 Bkfr/orsay/lri/varna/models/templates/RNATemplate$MakeEdgeList.classPK 3F>M50 0 Avfr/orsay/lri/varna/models/templates/RNATemplate$RNAIterator.classPK 3F>D$(Ufr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement$EdgeEndPoint.classPK 3F>ÇOLLHƑfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateElement.classPK 3F>Q3Fxfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateHelix.classPK 3F>P  Qǹfr/orsay/lri/varna/models/templates/RNATemplate$RNATemplateUnpairedSequence.classPK 3F>l8]]G?fr/orsay/lri/varna/models/templates/RNATemplate$RemovePseudoKnots.classPK 3F>ojjDfr/orsay/lri/varna/models/templates/RNATemplate$VertexIterator.classPK 3F>u););5fr/orsay/lri/varna/models/templates/RNATemplate.classPK m>4I*fr/orsay/lri/varna/models/templates/RNATemplate.javaPK 3F>(q+00>I fr/orsay/lri/varna/models/templates/RNANodeValueTemplate.classPK oq<+OO= fr/orsay/lri/varna/models/templates/RNANodeValueTemplate.javaPK 3F>1NNEfr/orsay/lri/varna/models/templates/RNATemplateMappingException.classPK oq<{^D0fr/orsay/lri/varna/models/templates/RNATemplateMappingException.javaPK 3F> e<kfr/orsay/lri/varna/models/templates/RNATemplateMapping.classPK >ϩ##;F,fr/orsay/lri/varna/models/templates/RNATemplateMapping.javaPK 3F> G>fr/orsay/lri/varna/models/templates/RNANodeValue2TemplateDistance.classPK oqn55:Yfr/orsay/lri/varna/models/templates/RNATemplateAlign.classPK >fe8e89fr/orsay/lri/varna/models/templates/RNATemplateAlign.javaPK 3F>s<<Nfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException.classPK oq<@Mvfr/orsay/lri/varna/models/templates/RNATemplateDrawingAlgorithmException.javaPK 3F>7&&Lfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair.classPK Pq<.|wwKTfr/orsay/lri/varna/models/templates/RNANodeValueTemplateBrokenBasePair.javaPK 3F>(F4fr/orsay/lri/varna/models/templates/RNANodeValueTemplateBasePair.classPK PqgFfr/orsay/lri/varna/models/templates/RNANodeValueTemplateSequence.classPK Pq3R::,`fr/orsay/lri/varna/models/templates/TODO.txtPK 3F>$fr/orsay/lri/varna/models/treealign/PK 3F>: 999&fr/orsay/lri/varna/models/treealign/TreeAlignResult.classPK oq<E8fr/orsay/lri/varna/models/treealign/TreeAlignResult.javaPK 3F>O7[[Cfr/orsay/lri/varna/models/treealign/RNATree2$ConvertToMapping.classPK 3F>ZZ12 fr/orsay/lri/varna/models/treealign/RNATree2.classPK oqf߉ 5: fr/orsay/lri/varna/models/treealign/AlignedNode.classPK <е4!F fr/orsay/lri/varna/models/treealign/AlignedNode.javaPK 3F>', , 7pL fr/orsay/lri/varna/models/treealign/RNANodeValue2.classPK Ik=7 6W fr/orsay/lri/varna/models/treealign/RNANodeValue2.javaPK 3F>0vvJ1c fr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric.classPK oq< {{Ie fr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceAsymmetric.javaPK 3F>]ee@g fr/orsay/lri/varna/models/treealign/Tree$DFSPrefixIterator.classPK 3F>R" .p fr/orsay/lri/varna/models/treealign/Tree.classPK oq<`CC-} fr/orsay/lri/varna/models/treealign/Tree.javaPK 3F>6T;zz6w fr/orsay/lri/varna/models/treealign/TreeGraphviz.classPK oq< \ 5E fr/orsay/lri/varna/models/treealign/TreeGraphviz.javaPK 3F>3I3 fr/orsay/lri/varna/models/treealign/RNANodeValue2WrongTypeException.classPK oq<SHn fr/orsay/lri/varna/models/treealign/RNANodeValue2WrongTypeException.javaPK 3F>; fr/orsay/lri/varna/models/treealign/RNATree2Exception.classPK oq<){ : fr/orsay/lri/varna/models/treealign/RNATree2Exception.javaPK 3F>.Cg fr/orsay/lri/varna/models/treealign/GraphvizDrawableNodeValue.classPK oqI= fr/orsay/lri/varna/models/treealign/RNANodeValue$Origin.classPK 3F>p= 6 fr/orsay/lri/varna/models/treealign/RNANodeValue.classPK 'k=Sɮ 5 fr/orsay/lri/varna/models/treealign/RNANodeValue.javaPK 3F>@yPQQ: fr/orsay/lri/varna/models/treealign/ExampleDistance2.classPK oqL++; fr/orsay/lri/varna/models/treealign/TreeAlign$Aligner.classPK 3F>FĮU U F !fr/orsay/lri/varna/models/treealign/TreeAlign$ConvertTreeToArray.classPK 3F>%pp<!fr/orsay/lri/varna/models/treealign/TreeAlign$TreeData.classPK 3F>.GG3!fr/orsay/lri/varna/models/treealign/TreeAlign.classPK oq<΅aa2"-!fr/orsay/lri/varna/models/treealign/TreeAlign.javaPK 3F>5<Y!fr/orsay/lri/varna/models/treealign/TreeAlignException.classPK oq<\;!fr/orsay/lri/varna/models/treealign/TreeAlignException.javaPK 3F>l B!fr/orsay/lri/varna/models/treealign/RNATree$ConvertToMapping.classPK 3F>})?!fr/orsay/lri/varna/models/treealign/RNATree$ConvertToTree.classPK 3F>v1!fr/orsay/lri/varna/models/treealign/RNATree.classPK c*= OO0e!fr/orsay/lri/varna/models/treealign/RNATree.javaPK 3F>Lm44N!fr/orsay/lri/varna/models/treealign/ExampleDistance3$SequenceAlignResult.classPK 3F>k~~:!fr/orsay/lri/varna/models/treealign/ExampleDistance3.classPK =k=\KK9x!fr/orsay/lri/varna/models/treealign/ExampleDistance3.javaPK 3F>u;I!fr/orsay/lri/varna/models/treealign/TreeAlignLabelDistanceSymmetric.classPK oq!fr/orsay/lri/varna/views/PK 3F>.mL -+!fr/orsay/lri/varna/views/VueBPThickness.classPK qq<66,? "fr/orsay/lri/varna/views/VueBPThickness.javaPK 3F>o o ("fr/orsay/lri/varna/views/VueBorder.classPK qq<$l't&"fr/orsay/lri/varna/views/VueBorder.javaPK 3F>'t7 7 35"fr/orsay/lri/varna/views/VueBPHeightIncrement.classPK qq5]c c -EK"fr/orsay/lri/varna/views/VueManualInput.classPK qq ,T"fr/orsay/lri/varna/views/VueManualInput.javaPK 3F>75=_"fr/orsay/lri/varna/views/VueHighlightRegionEdit.classPK pq<)4Ew"fr/orsay/lri/varna/views/VueHighlightRegionEdit.javaPK 3F>cmzz0"fr/orsay/lri/varna/views/VueGlobalRotation.classPK a*>e /ߗ"fr/orsay/lri/varna/views/VueGlobalRotation.javaPK 3F>zƷ_ _ )ס"fr/orsay/lri/varna/views/VueStyleBP.classPK qq<?!v v (}"fr/orsay/lri/varna/views/VueStyleBP.javaPK 3F>19"fr/orsay/lri/varna/views/VueColorMapStyle$1.classPK 3F>?j1"fr/orsay/lri/varna/views/VueColorMapStyle$2.classPK 3F>0edee/"fr/orsay/lri/varna/views/VueColorMapStyle.classPK 4*=PE."fr/orsay/lri/varna/views/VueColorMapStyle.javaPK 3F>ҎbQ@>@>&"fr/orsay/lri/varna/views/VueMenu.classPK '>)]BB%-(#fr/orsay/lri/varna/views/VueMenu.javaPK 3F>~bY Y )uj#fr/orsay/lri/varna/views/PrintPanel.classPK 3F>8p$qq(v#fr/orsay/lri/varna/views/PrintTest.classPK 3F>Ti299/x#fr/orsay/lri/varna/views/PrintTestFrame$1.classPK 3F>P8__/R#fr/orsay/lri/varna/views/PrintTestFrame$2.classPK 3F>@G-#fr/orsay/lri/varna/views/PrintTestFrame.classPK qq<'#fr/orsay/lri/varna/views/PrintTest.javaPK 3F>O 'N#fr/orsay/lri/varna/views/VueBases.classPK qq<(2&5#fr/orsay/lri/varna/views/VueBases.javaPK 3F>#l#l#,#fr/orsay/lri/varna/views/VueAnnotation.classPK qqӱY Y 3$fr/orsay/lri/varna/views/VueSpaceBetweenBases.classPK qq<  2%$fr/orsay/lri/varna/views/VueSpaceBetweenBases.javaPK 3F># +30$fr/orsay/lri/varna/views/VueNumPeriod.classPK qq6K(D$fr/orsay/lri/varna/views/VueBPType.classPK qq<58 'FS$fr/orsay/lri/varna/views/VueBPType.javaPK 3F>;88&a$fr/orsay/lri/varna/views/VueJPEG.classPK qq㭫:Ls$fr/orsay/lri/varna/views/VueAboutPanel$AboutAnimator.classPK 3F>7,O{$fr/orsay/lri/varna/views/VueAboutPanel.classPK qq< Z''+'$fr/orsay/lri/varna/views/VueAboutPanel.javaPK 3F>xH H &$fr/orsay/lri/varna/views/VueZoom.classPK qq<..%#$fr/orsay/lri/varna/views/VueZoom.javaPK 3F>(4$fr/orsay/lri/varna/views/VueChemProbAnnotation.classPK qq< --3v$fr/orsay/lri/varna/views/VueChemProbAnnotation.javaPK 3F>o@v <$fr/orsay/lri/varna/views/VueBaseValues$ValueTableModel.classPK 3F>%mtt,W$fr/orsay/lri/varna/views/VueBaseValues.classPK qq<U+%fr/orsay/lri/varna/views/VueBaseValues.javaPK 3F>[wŭ'%fr/orsay/lri/varna/views/Imprimer.classPK qq?J# &!%fr/orsay/lri/varna/views/VueFont.classPK qqww0<%fr/orsay/lri/varna/views/VueBPList$Actions.classPK 3F>?9d5C%fr/orsay/lri/varna/views/VueBPList$BPTableModel.classPK 3F>i(((R%fr/orsay/lri/varna/views/VueBPList.classPK v(> y'l%fr/orsay/lri/varna/views/VueBPList.javaPK 3F>4D%fr/orsay/lri/varna/views/VueLoadColorMapValues.classPK qq%#PRR$%fr/orsay/lri/varna/views/VueUI.classPK \>i֣//#]&fr/orsay/lri/varna/views/VueUI.javaPK 3F>6  2'fr/orsay/lri/varna/views/VueListeAnnotations.classPK qq<^"E̫1w('fr/orsay/lri/varna/views/VueListeAnnotations.javaPK mq<{"EE q8'LICENSE.txtPK qq