package jalview.jbgui;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+import jalview.api.SplitContainerI;
import jalview.bin.Cache;
import jalview.gui.JvSwingUtils;
import jalview.gui.Preferences;
protected JMenuItem showTranslation = new JMenuItem();
- protected JMenu cdna = new JMenu();
-
protected JMenuItem extractScores = new JMenuItem();
protected JMenuItem expandAlignment = new JMenuItem();
GridLayout gridLayout1 = new GridLayout();
- JMenu jMenu3 = new JMenu();
+ JMenu showMenu = new JMenu();
JMenuItem showAllSeqs = new JMenuItem();
protected JMenuItem hideAllAlAnnotations = new JMenuItem();
+ protected JCheckBoxMenuItem showComplementMenuItem = new JCheckBoxMenuItem();
+
protected JCheckBoxMenuItem sortAnnBySequence = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem sortAnnByLabel = new JCheckBoxMenuItem();
JMenuItem textColour = new JMenuItem();
- JMenu formatMenu = new JMenu();
+ protected JMenu formatMenu = new JMenu();
JMenu selectMenu = new JMenu();
private Map<KeyStroke, JMenuItem> accelerators = new HashMap<KeyStroke, JMenuItem>();
+ private SplitContainerI splitFrame;
+
public GAlignFrame()
{
try
// colours.add(covariationColour);
colours.add(tcoffeeColour);
colours.add(RNAInteractionColour);
- setColourSelected(jalview.bin.Cache
- .getDefault("DEFAULT_COLOUR", "None"));
-
+ setColourSelected(jalview.bin.Cache.getDefault(
+ Preferences.DEFAULT_COLOUR, "None"));
}
public void setColourSelected(String defaultColour)
}
});
- /*
- * cDNA menu options
- */
- cdna.setText(MessageManager.getString("label.cdna"));
- // link to available cDNA
- JMenuItem linkCdna = new JMenuItem(
- MessageManager.getString("label.link_cdna"));
- linkCdna.setToolTipText(JvSwingUtils.wrapTooltip(true,
- MessageManager.getString("label.link_cdna_tip")));
- linkCdna.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- linkCdna_actionPerformed();
- }
- });
- cdna.add(linkCdna);
- // align linked cDNA
- JMenuItem alignCdna = new JMenuItem(
- MessageManager.getString("label.align_cdna"));
- alignCdna.setToolTipText(JvSwingUtils.wrapTooltip(true,
- MessageManager.getString("label.align_cdna_tip")));
- alignCdna.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- alignCdna_actionPerformed();
- }
- });
- cdna.add(alignCdna);
-
- // view alignment as cDNA (when known)
- JMenuItem viewAsCdna = new JMenuItem(
- MessageManager.getString("label.view_as_cdna"));
- viewAsCdna.setToolTipText(JvSwingUtils.wrapTooltip(true,
- MessageManager.getString("label.view_as_cdna_tip")));
- viewAsCdna.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- viewAsCdna_actionPerformed();
- }
- });
- cdna.add(viewAsCdna);
-
extractScores.setText(MessageManager.getString("label.extract_scores")
+ "...");
extractScores.addActionListener(new ActionListener()
}
});
statusPanel.setLayout(gridLayout1);
- jMenu3.setText(MessageManager.getString("action.show"));
+ showMenu.setText(MessageManager.getString("action.show"));
showAllSeqs.setText(MessageManager.getString("label.all_sequences"));
showAllSeqs.setToolTipText(MessageManager
.getString("label.toggle_sequence_visibility"));
};
addMenuActionAndAccelerator(keyStroke, invertColSel, al);
+ showComplementMenuItem.setVisible(false);
+ showComplementMenuItem.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showComplement_actionPerformed(showComplementMenuItem.getState());
+ }
+ });
+
tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()
{
@Override
viewMenu.add(expandViews);
viewMenu.add(gatherViews);
viewMenu.addSeparator();
- viewMenu.add(jMenu3);
+ viewMenu.add(showMenu);
viewMenu.add(hideMenu);
+ viewMenu.add(showComplementMenuItem);
viewMenu.addSeparator();
viewMenu.add(followHighlightMenuItem);
annotationsMenu.add(annotationPanelMenuItem);
calculateMenu.add(PCAMenuItem);
calculateMenu.addSeparator();
calculateMenu.add(showTranslation);
- calculateMenu.add(cdna);
calculateMenu.add(showProducts);
calculateMenu.add(autoCalculate);
calculateMenu.add(sortByTree);
this.getContentPane().add(statusPanel, java.awt.BorderLayout.SOUTH);
statusPanel.add(statusBar, null);
this.getContentPane().add(tabbedPane, java.awt.BorderLayout.CENTER);
- jMenu3.add(showAllColumns);
- jMenu3.add(showAllSeqs);
- jMenu3.add(showAllhidden);
+ showMenu.add(showAllColumns);
+ showMenu.add(showAllSeqs);
+ showMenu.add(showAllhidden);
hideMenu.add(hideSelColumns);
hideMenu.add(hideSelSequences);
hideMenu.add(hideAllSelection);
menuItem.addActionListener(actionListener);
}
- protected void viewAsCdna_actionPerformed()
- {
- }
-
- protected void alignCdna_actionPerformed()
- {
- }
-
- protected void linkCdna_actionPerformed()
- {
- }
-
/**
* Action on clicking sort annotations by type.
*
{
return this.accelerators;
}
+
+ /**
+ * Returns the selected index of the tabbed pane, or -1 if none selected
+ * (including the case where the tabbed pane has not been made visible).
+ *
+ * @return
+ */
+ public int getTabIndex()
+ {
+ return tabbedPane.getSelectedIndex();
+ }
+
+ public JPanel getStatusPanel()
+ {
+ return statusPanel;
+ }
+
+ /**
+ * Sets a reference to the containing split frame. Also makes the 'toggle
+ * split view' menu item visible and checked.
+ *
+ * @param sf
+ */
+ public void setSplitFrame(SplitContainerI sf)
+ {
+ this.splitFrame = sf;
+ if (sf != null)
+ {
+ this.showComplementMenuItem.setVisible(true);
+ this.showComplementMenuItem.setState(true);
+ }
+ }
+
+ public SplitContainerI getSplitViewContainer()
+ {
+ return this.splitFrame;
+ }
+
+ protected void showComplement_actionPerformed(boolean state)
+ {
+ }
}