import jalview.analysis.AlignmentAnnotationUtils;
import jalview.analysis.AlignmentUtils;
import jalview.analysis.Conservation;
+import jalview.bin.JalviewLite;
import jalview.commands.ChangeCaseCommand;
import jalview.commands.EditCommand;
import jalview.commands.EditCommand.Action;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.io.AppletFormatAdapter;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormatI;
+import jalview.io.FileFormats;
import jalview.io.SequenceAnnotationReport;
import jalview.schemes.Blosum62ColourScheme;
import jalview.schemes.BuriedColourScheme;
e.printStackTrace();
}
- for (int i = 0; i < jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS.length; i++)
+ for (String ff : FileFormats.getInstance().getWritableFormats(true))
{
- MenuItem item = new MenuItem(
- jalview.io.AppletFormatAdapter.WRITEABLE_FORMATS[i]);
+ MenuItem item = new MenuItem(ff);
item.addActionListener(this);
outputmenu.add(item);
{
menu1.setLabel(MessageManager.getString("action.edit_group"));
groupMenu.remove(createGroupMenuItem);
+ if (sg.cs != null)
+ {
+ abovePIDColour.setState(sg.cs.getThreshold() > 0);
+ conservationMenuItem.setState(sg.cs.conservationApplied());
+ }
}
-
}
else
{
@Override
public void itemStateChanged(ItemEvent evt)
{
- if (evt.getSource() == abovePIDColour)
+ Object source = evt.getSource();
+ if (source == abovePIDColour)
{
abovePIDColour_itemStateChanged();
}
- else if (evt.getSource() == showColourText)
+ else if (source == conservationMenuItem)
+ {
+ conservationMenuItem_itemStateChanged();
+ }
+ else if (source == showColourText)
{
showColourText_itemStateChanged();
}
- else if (evt.getSource() == showText)
+ else if (source == showText)
{
showText_itemStateChanged();
}
- else if (evt.getSource() == showBoxes)
+ else if (source == showBoxes)
{
showBoxes_itemStateChanged();
}
- else if (evt.getSource() == displayNonconserved)
+ else if (source == displayNonconserved)
{
this.showNonconserved_itemStateChanged();
}
{
noColourmenuItem_actionPerformed();
}
- else if (source == conservationMenuItem)
- {
- conservationMenuItem_itemStateChanged();
- }
else if (source == unGroupMenuItem)
{
unGroupMenuItem_actionPerformed();
Frame frame = new Frame();
frame.add(cap);
- jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage(
+ JalviewLite.addFrame(frame, MessageManager.formatMessage(
"label.selection_output_command",
new Object[] { e.getActionCommand() }), 600, 500);
// JBPNote: getSelectionAsNewSequence behaviour has changed - this method
// now returns a full copy of sequence data
// TODO consider using getSequenceSelection instead here
- cap.setText(new jalview.io.AppletFormatAdapter().formatSequences(
- e.getActionCommand(), ap.av.getShowJVSuffix(), ap, true));
+ FileFormatI fileFormat = FileFormats.getInstance().forName(
+ e.getActionCommand());
+ cap.setText(new AppletFormatAdapter().formatSequences(fileFormat,
+ ap.av.getShowJVSuffix(), ap, true));
}
CutAndPasteTransfer cap = new CutAndPasteTransfer(false, ap.alignFrame);
- StringBuffer contents = new StringBuffer();
+ StringBuilder contents = new StringBuilder(128);
for (SequenceI seq : sequences)
{
contents.append(MessageManager.formatMessage(
seq,
true,
true,
- false,
(ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr
.getMinMax() : null);
contents.append("</p>");
void addPDB()
{
- if (seq.getAllPDBEntries() != null)
+ Vector<PDBEntry> pdbs = seq.getAllPDBEntries();
+ if (pdbs != null&& !pdbs.isEmpty())
{
- PDBEntry entry = seq.getAllPDBEntries().firstElement();
+ PDBEntry entry = pdbs.firstElement();
if (ap.av.applet.jmolAvailable)
{
new jalview.appletgui.AppletJmol(entry, new SequenceI[] { seq },
- null, ap, AppletFormatAdapter.URL);
+ null, ap, DataSourceType.URL);
}
else
{
new MCview.AppletPDBViewer(entry, new SequenceI[] { seq }, null,
- ap, AppletFormatAdapter.URL);
+ ap, DataSourceType.URL);
}
}