import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.ext.rbvi.chimera.JalviewChimeraBinding;
-import jalview.gui.ViewSelectionMenu.ViewSetProvider;
import jalview.io.AppletFormatAdapter;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
-import jalview.jbgui.GStructureViewer;
import jalview.schemes.BuriedColourScheme;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.HelixColourScheme;
import jalview.util.Platform;
import jalview.ws.dbsources.Pdb;
-import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
* @author jprocter
*
*/
-public class ChimeraViewFrame extends GStructureViewer implements Runnable,
- ViewSetProvider
+public class ChimeraViewFrame extends StructureViewerBase
{
private JalviewChimeraBinding jmb;
private boolean alignAddedStructures = false;
- AlignmentPanel ap;
-
/*
* state flag for PDB retrieval thread
*/
topView.addAlignmentPanel(ap);
// add it to the set used for colouring
topView.useAlignmentPanelForColourbyseq(ap);
- topView.buildChimeraActionMenu();
+ topView.buildActionMenu();
ap.getStructureSelectionManager()
.sequenceColoursChanged(ap);
break;
*/
public void addAlignmentPanel(AlignmentPanel nap)
{
- if (ap == null)
+ if (getAlignmentPanel() == null)
{
- ap = nap;
+ setAlignmentPanel(nap);
}
if (!_aps.contains(nap.av.getSequenceSetId()))
{
{
_alignwith.remove(nap);
_colourwith.remove(nap);
- if (ap == nap)
+ if (getAlignmentPanel() == nap)
{
- ap = null;
+ setAlignmentPanel(null);
for (AlignmentPanel aps : getAllAlignmentPanels())
{
if (aps != nap)
{
- ap = aps;
+ setAlignmentPanel(aps);
break;
}
}
} catch (Exception ex)
{
}
- if (ap != null)
+ if (getAlignmentPanel() != null)
{
- buildChimeraActionMenu();
+ buildActionMenu();
}
}
boolean enableColourBySeq)
{
useAlignmentPanelForColourbyseq(nap);
- jmb.setColourBySequence(enableColourBySeq);
+ getBinding().setColourBySequence(enableColourBySeq);
seqColour.setSelected(enableColourBySeq);
viewerColour.setSelected(!enableColourBySeq);
}
{
if (frame instanceof ChimeraViewFrame)
{
- if (((ChimeraViewFrame) frame).isLinkedWith(apanel))
+ if (((StructureViewerBase) frame).isLinkedWith(apanel))
{
result.add((ChimeraViewFrame) frame);
}
JOptionPane.YES_NO_OPTION);
jmb.closeViewer(confirm == JOptionPane.YES_OPTION);
}
- ap = null;
+ setAlignmentPanel(null);
_aps.clear();
_alignwith.clear();
_colourwith.clear();
{
if (!jmb.isLoadingFromArchive())
{
- if (_colourwith.size() == 0 && ap != null)
+ if (_colourwith.size() == 0 && getAlignmentPanel() != null)
{
// Make the currently displayed alignment panel the associated view
- _colourwith.add(ap.alignFrame.alignPanel);
+ _colourwith.add(getAlignmentPanel().alignFrame.alignPanel);
}
}
// Set the colour using the current view for the associated alignframe
}
}
- protected void buildChimeraActionMenu()
- {
- if (_alignwith == null)
- {
- _alignwith = new Vector<AlignmentPanel>();
- }
- if (_alignwith.size() == 0 && ap != null)
- {
- _alignwith.add(ap);
- }
- ;
- for (Component c : viewerActionMenu.getMenuComponents())
- {
- if (c != alignStructs)
- {
- viewerActionMenu.remove((JMenuItem) c);
- }
- }
- }
-
/*
* (non-Javadoc)
*
private void alignStructs_withAllAlignPanels()
{
- if (ap == null)
+ if (getAlignmentPanel() == null)
{
return;
}
;
if (_alignwith.size() == 0)
{
- _alignwith.add(ap);
+ _alignwith.add(getAlignmentPanel());
}
;
try
return ap;
}
}
- return ap;
+ return getAlignmentPanel();
}
@Override