import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
-import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
-import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.gui.StructureViewer.ViewerType;
}
}
- abstract void showSelectedChains();
-
/**
* Action on selecting one of Jalview's registered colour schemes
*/
ColourSchemeI cs = ColourSchemes.getInstance()
.getColourScheme(colourSchemeName, getAlignmentPanel().av, al,
null);
- getBinding().setJalviewColourScheme(cs);
+ getBinding().colourByJalviewColourScheme(cs);
}
/**
@Override
public void actionPerformed(ActionEvent actionEvent)
{
- viewerColour_actionPerformed(actionEvent);
+ viewerColour_actionPerformed();
}
});
colourMenu.add(viewerColour);
@Override
public void actionPerformed(ActionEvent actionEvent)
{
- background_actionPerformed(actionEvent);
+ background_actionPerformed();
}
});
colourMenu.add(backGround);
@Override
public void actionPerformed(ActionEvent actionEvent)
{
- seqColour_actionPerformed(actionEvent);
+ seqColour_actionPerformed();
}
});
@Override
public void actionPerformed(ActionEvent actionEvent)
{
- chainColour_actionPerformed(actionEvent);
+ chainColour_actionPerformed();
}
});
@Override
public void actionPerformed(ActionEvent actionEvent)
{
- chargeColour_actionPerformed(actionEvent);
+ chargeColour_actionPerformed();
}
});
else
{
// update the Chimera display now.
- seqColour_actionPerformed(null);
+ seqColour_actionPerformed();
}
}
});
buildColourMenu();
}
- @Override
- public void setJalviewColourScheme(ColourSchemeI cs)
- {
- getBinding().setJalviewColourScheme(cs);
- }
-
/**
* Sends commands to the structure viewer to superimpose structures based on
* currently associated alignments. May optionally return an error message for
* the operation.
*/
@Override
- protected String alignStructs_actionPerformed(ActionEvent actionEvent)
- {
- return alignStructs_withAllAlignPanels();
- }
-
- protected String alignStructs_withAllAlignPanels()
+ protected String alignStructsWithAllAlignPanels()
{
if (getAlignmentPanel() == null)
{
String reply = null;
try
{
- AlignmentI[] als = new Alignment[_alignwith.size()];
- HiddenColumns[] alc = new HiddenColumns[_alignwith.size()];
- int[] alm = new int[_alignwith.size()];
- int a = 0;
-
- for (AlignmentViewPanel alignPanel : _alignwith)
- {
- als[a] = alignPanel.getAlignment();
- alm[a] = -1;
- alc[a++] = alignPanel.getAlignment().getHiddenColumns();
- }
- reply = getBinding().superposeStructures(als, alm, alc);
- if (reply != null)
+ reply = getBinding().superposeStructures(_alignwith);
+ if (reply != null && !reply.isEmpty())
{
String text = MessageManager
.formatMessage("error.superposition_failed", reply);
}
@Override
- public void background_actionPerformed(ActionEvent actionEvent)
+ public void background_actionPerformed()
{
Color col = JColorChooser.showDialog(this,
MessageManager.getString("label.select_background_colour"),
}
@Override
- public void viewerColour_actionPerformed(ActionEvent actionEvent)
+ public void viewerColour_actionPerformed()
{
if (viewerColour.isSelected())
{
}
@Override
- public void chainColour_actionPerformed(ActionEvent actionEvent)
+ public void chainColour_actionPerformed()
{
chainColour.setSelected(true);
getBinding().colourByChain();
}
@Override
- public void chargeColour_actionPerformed(ActionEvent actionEvent)
+ public void chargeColour_actionPerformed()
{
chargeColour.setSelected(true);
getBinding().colourByCharge();
}
@Override
- public void seqColour_actionPerformed(ActionEvent actionEvent)
+ public void seqColour_actionPerformed()
{
AAStructureBindingModel binding = getBinding();
binding.setColourBySequence(seqColour.isSelected());
}
@Override
- public void pdbFile_actionPerformed(ActionEvent actionEvent)
+ public void pdbFile_actionPerformed()
{
JalviewFileChooser chooser = new JalviewFileChooser(
Cache.getProperty("LAST_DIRECTORY"));
}
@Override
- public void viewMapping_actionPerformed(ActionEvent actionEvent)
+ public void viewMapping_actionPerformed()
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
try
if (!binding.isLoadingFromArchive())
{
- seqColour_actionPerformed(null);
+ seqColour_actionPerformed();
}
}
// default does nothing
}
+ /**
+ * Show only the selected chain(s) in the viewer
+ */
+ protected void showSelectedChains()
+ {
+ List<String> toshow = new ArrayList<>();
+ for (int i = 0; i < chainMenu.getItemCount(); i++)
+ {
+ if (chainMenu.getItem(i) instanceof JCheckBoxMenuItem)
+ {
+ JCheckBoxMenuItem item = (JCheckBoxMenuItem) chainMenu.getItem(i);
+ if (item.isSelected())
+ {
+ toshow.add(item.getText());
+ }
+ }
+ }
+ getBinding().showChains(toshow);
+ }
+
}