2 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.
3 Copyright (C) 2008 Kevin Darty, Alain Denise and Yann Ponty.
4 electronic mail : Yann.Ponty@lri.fr
5 paper mail : LRI, bat 490 Université Paris-Sud 91405 Orsay Cedex France
7 This file is part of VARNA version 3.1.
8 VARNA version 3.1 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along with VARNA version 3.1.
16 If not, see http://www.gnu.org/licenses.
18 package fr.orsay.lri.varna.views;
20 import java.awt.FlowLayout;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
24 import javax.swing.JComboBox;
25 import javax.swing.JLabel;
26 import javax.swing.JPanel;
28 import fr.orsay.lri.varna.VARNAPanel;
29 import fr.orsay.lri.varna.models.rna.ModeleBP;
32 public class VueBPType implements ActionListener {
34 private VARNAPanel _vp;
36 private JComboBox _edge5;
37 private JComboBox _edge3;
38 private JComboBox _stericity;
41 public VueBPType(VARNAPanel vp, ModeleBP msbp) {
45 ModeleBP.Edge[] edges = ModeleBP.Edge.values();
46 ModeleBP.Edge bck = msbp.getEdgePartner5();
47 _edge5 = new JComboBox(edges);
48 for (int i = 0; i < edges.length; i++) {
50 _edge5.setSelectedIndex(i);
53 bck = msbp.getEdgePartner3();
54 _edge3 = new JComboBox(edges);
55 for (int i = 0; i < edges.length; i++) {
57 _edge3.setSelectedIndex(i);
60 ModeleBP.Stericity[] sters = ModeleBP.Stericity.values();
61 ModeleBP.Stericity bcks = msbp.getStericity();
62 _stericity = new JComboBox(sters);
63 for (int i = 0; i < sters.length; i++) {
65 _stericity.setSelectedIndex(i);
68 _edge5.addActionListener(this);
69 _edge3.addActionListener(this);
70 _stericity.addActionListener(this);
73 panel.setLayout(new FlowLayout(FlowLayout.LEFT));
75 JLabel label5 = new JLabel("5' edge: ");
76 JLabel label3 = new JLabel("3' edge: ");
77 JLabel labelS = new JLabel("Stericity: ");
84 panel.add(_stericity);
87 public JPanel getPanel() {
91 public ModeleBP.Edge getEdge5() {
92 return (ModeleBP.Edge) _edge5.getSelectedItem();
95 public ModeleBP.Edge getEdge3() {
96 return (ModeleBP.Edge) _edge3.getSelectedItem();
99 public ModeleBP.Stericity getStericity() {
100 return (ModeleBP.Stericity) _stericity.getSelectedItem();
103 public VARNAPanel get_vp() {
107 public void actionPerformed(ActionEvent e) {
108 _msbp.setEdge5(getEdge5());
109 _msbp.setEdge3(getEdge3());
110 _msbp.setStericity(getStericity());