// private static final String DEFAULT_STRUCTURE2 =
// "((((..(((....)))..))))";
- private VARNAPanel _vp;
+ public VARNAPanel vp;
private JPanel _tools = new JPanel();
private JPanel _input = new JPanel();
initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1);
}
+ public AppVarnaBinding(String seq){
+ super("VARNA in Jalview");
+ initVarna(seq,this.DEFAULT_STRUCTURE1);
+ }
+
private void initVarna(String seq, String str){
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);
+ 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());
}
RNA _RNA1 = new RNA("User defined 1");
try {
- _vp = new VARNAPanel("0",".");
+ vp = new VARNAPanel("0",".");
_RNA1.setRNA(seq, str);
- _RNA1.drawRNARadiate(_vp.getConfig());
+ _RNA1.drawRNARadiate(vp.getConfig());
} catch (ExceptionNonEqualLength e) {
- _vp.errorDialog(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(),_RNA1,generateDefaultName(),true);
+ vp.setPreferredSize(new Dimension(400, 400));
+ _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
setBackground(_backgroundColor);
- _vp.setBackground(_backgroundColor);
+ vp.setBackground(_backgroundColor);
getContentPane().setLayout(new BorderLayout());
- getContentPane().add(_vp, BorderLayout.CENTER);
+ getContentPane().add(vp, BorderLayout.CENTER);
setVisible(true);
- _vp.addVARNAListener(this);
+ vp.addVARNAListener(this);
}
private void RNAPanelDemoInit()
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);
+ 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());
}
RNA _RNA1 = new RNA("User defined 1");
RNA _RNA2 = new RNA("User defined 2");
try {
- _vp = new VARNAPanel("0",".");
+ vp = new VARNAPanel("0",".");
_RNA1.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE1);
- _RNA1.drawRNARadiate(_vp.getConfig());
+ _RNA1.drawRNARadiate(vp.getConfig());
_RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
- _RNA2.drawRNARadiate(_vp.getConfig());
+ _RNA2.drawRNARadiate(vp.getConfig());
} catch (ExceptionNonEqualLength e) {
- _vp.errorDialog(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);
+ 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);
+ vp.setBackground(_backgroundColor);
Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
try {
RNA nRNA = new RNA(generateDefaultName());
nRNA.setRNA(_seq.getText(), _str.getText());
- nRNA.drawRNARadiate(_vp.getConfig());
+ nRNA.drawRNARadiate(vp.getConfig());
_rnaList.add(new VARNAConfig(),nRNA,true);
} catch (ExceptionUnmatchedClosingParentheses e1) {
- JOptionPane.showMessageDialog(_vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
} catch (ExceptionFileFormatOrSyntax e1) {
- JOptionPane.showMessageDialog(_vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
+ JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
}
}
});
});
_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);
+ _rnaList.add((VARNAConfig)vp.getConfig().clone(),vp.getRNA().clone(),vp.getRNA().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new Date()),true);
}});
JPanel ops = new JPanel();
goPanel.add(_createButton, BorderLayout.CENTER);
- JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,_vp);
+ 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);
+ DropTarget dt = new DropTarget(vp, this);
- _vp.addVARNAListener(this);
+ vp.addVARNAListener(this);
}
public static String generateDefaultName()
}
public void init() {
- _vp.setBackground(_backgroundColor);
+ vp.setBackground(_backgroundColor);
_error = true;
}
}
public VARNAPanel get_varnaPanel() {
- return _vp;
+ return vp;
}
public void set_varnaPanel(VARNAPanel surface) {
- _vp = surface;
+ vp = surface;
}
} catch (ExceptionUnmatchedClosingParentheses e1) {
} catch (ExceptionFileFormatOrSyntax e1) {
}
- _vp.showRNA(r);
- _vp.repaint();
+ vp.showRNA(r);
+ vp.repaint();
}
else
{