protected void outputText_actionPerformed(ActionEvent e)
{
- CutAndPasteTransfer cap = new CutAndPasteTransfer(false);
- JInternalFrame frame = new JInternalFrame();
- cap.formatForOutput();
- frame.setContentPane(cap);
- Desktop.addInternalFrame(frame, "Alignment output - "+e.getActionCommand(), 600, 500);
+ CutAndPasteTransfer cap = new CutAndPasteTransfer();
+ Desktop.addInternalFrame(cap, "Alignment output - "+e.getActionCommand(), 600, 500);
cap.setText( FormatAdapter.formatSequences(e.getActionCommand(), viewport.getAlignment().getSequences()));
}
protected void htmlMenuItem_actionPerformed(ActionEvent e)
{
- HTMLOutput htmlOutput = new HTMLOutput(viewport);
- htmlOutput = null;
+ new HTMLOutput(viewport);
}
protected void createPNG_actionPerformed(ActionEvent e)
protected void delete_actionPerformed(ActionEvent e)
{
boolean seqsdeleted=false;
- addHistoryItem(new HistoryItem("Delete Sequences", viewport.alignment, HistoryItem.HIDE));
if (viewport.getSelectionGroup() == null)
return;
+ addHistoryItem(new HistoryItem("Delete Sequences", viewport.alignment, HistoryItem.HIDE));
+
SequenceGroup sg = viewport.getSelectionGroup();
for (int i=0;i < sg.sequences.size(); i++)
{
public void clustalColour_actionPerformed(ActionEvent e)
{
- abovePIDThreshold.setSelected(false);
changeColour(new ClustalxColourScheme(viewport.alignment.getSequences(), viewport.alignment.getWidth()));
}
ccs.setConsensus( viewport.vconsensus );
viewport.setGlobalColourScheme(ccs);
- SliderPanel.setConservationSlider(alignPanel, ccs, "Background");
+ ccs.inc = SliderPanel.setConservationSlider(alignPanel, ccs, "Background");
}
else
{
SequenceGroup sg = (SequenceGroup)groups.elementAt(i);
- if (cs instanceof ClustalxColourScheme)
- {
+ if(cs==null)
+ sg.cs = null;
+ else if (cs instanceof ClustalxColourScheme)
sg.cs = new ClustalxColourScheme(sg.sequences, sg.getWidth());
- }
- else if(cs!=null)
- {
+ else if (cs instanceof UserColourScheme)
+ sg.cs = new UserColourScheme( ((UserColourScheme)cs).getColours());
+ else
try{
sg.cs = (ColourSchemeI) cs.getClass().newInstance();
- }catch(Exception ex){ex.printStackTrace();}
- }
+ }catch(Exception ex){}
if(viewport.getAbovePIDThreshold())
{
public void userDefinedColour_actionPerformed(ActionEvent e)
{
- UserDefinedColours chooser = new UserDefinedColours( alignPanel, null);
+ new UserDefinedColours( alignPanel, null);
}
public void PIDColour_actionPerformed(ActionEvent e)
public void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
{
- RedundancyPanel sp = new RedundancyPanel(alignPanel);
+ RedundancyPanel sp = new RedundancyPanel(alignPanel,this);
JInternalFrame frame = new JInternalFrame();
frame.setContentPane(sp);
Desktop.addInternalFrame(frame, "Redundancy threshold selection", 400, 100, false);
public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
{
- if(viewport.getSelectionGroup().getSize()<2)
+ if((viewport.getSelectionGroup()==null) ||
+ viewport.getSelectionGroup().getSize()<2)
JOptionPane.showInternalMessageDialog(this, "You must select at least 2 sequences.", "Invalid Selection", JOptionPane.WARNING_MESSAGE);
else
{
protected void avTreeBlosumMenuItem_actionPerformed(ActionEvent e)
{
- NewTreePanel("AV", "BL", "Average distance tree using BLOSUM62PID");
+ NewTreePanel("AV", "BL", "Average distance tree using BLOSUM62");
}
void NewTreePanel(String type, String pwType, String title)
if(!viewport.alignment.isAligned())
{
JOptionPane.showMessageDialog(Desktop.desktop, "The sequences must be aligned before creating a tree.\n"
- +"Try using the Pad function in the edit menu.",
+ +"Try using the Pad function in the edit menu,\n"
+ +"or one of the multiple sequence alignment web services.",
"Sequences not aligned", JOptionPane.WARNING_MESSAGE);
return;
}
if (seq!=null) {
JPredClient ct = new JPredClient(title, seq);
} else {
- System.out.print("JALVIEW ERROR! - Unexpected JPred selection state!\n");
+ System.err.print("JALVIEW ERROR! - Unexpected JPred selection state!\n");
}
}
protected void msaAlignMenuItem_actionPerformed(ActionEvent e)