action.show_hidden_markers = Show Hidden Markers
action.find = Find
action.undefine_groups = Undefine Groups
-action.create_groups = Create Groups
action.make_groups_selection = Make Groups For Selection
action.copy = Copy
action.cut = Cut
action.show_hidden_markers = Mostrar marcadores ocultos
action.find = Buscar
action.undefine_groups = Grupos sin definir
-action.create_groups = Crear grupos
action.make_groups_selection = Hacer grupos para seleccionar
action.copy = Copiar
action.cut = Cortar
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
+import java.awt.MenuShortcut;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
{
delete_actionPerformed();
}
+ else if (source == createGroup)
+ {
+ createGroup_actionPerformed();
+ }
+ else if (source == unGroup)
+ {
+ unGroup_actionPerformed();
+ }
else if (source == grpsFromSelection)
{
makeGrpsFromSelection_actionPerformed();
.getString("action.make_groups_selection"));
grpsFromSelection.addActionListener(this);
createGroup.setLabel(MessageManager.getString("action.create_group"));
+ createGroup.addActionListener(this);
unGroup.setLabel(MessageManager.getString("action.remove_group"));
+ unGroup.addActionListener(this);
+
annotationColumnSelection.setLabel(MessageManager
.getString("action.select_by_annotation"));
annotationColumnSelection.addActionListener(this);
ColourMenuHelper.setColourSelected(colourMenu, schemeName);
}
+
+ /**
+ * Disable inapplicable items in the Select menu when it is clicked
+ */
+ @Override
+ protected void configureSelectMenu()
+ {
+ createGroup.setEnabled(false);
+ unGroup.setEnabled(false);
+ SequenceGroup sg = viewport.getSelectionGroup();
+ if (sg != null)
+ {
+ List<SequenceGroup> groups = viewport.getAlignment().getGroups();
+ createGroup.setEnabled(groups == null || !groups.contains(sg));
+ unGroup.setEnabled(groups != null && groups.contains(sg));
+ }
+ }
}
class PrintThread extends Thread
private SplitContainerI splitFrame;
+ protected JMenuItem createGroup;
+
+ protected JMenuItem unGroup;
+
public GAlignFrame()
{
try
}
});
- JMenuItem createGroup = new JMenuItem(
- MessageManager.getString("action.create_groups"));
+ createGroup = new JMenuItem(
+ MessageManager.getString("action.create_group"));
keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false);
al = new ActionListener()
};
addMenuActionAndAccelerator(keyStroke, createGroup, al);
- JMenuItem unGroup = new JMenuItem(
+ unGroup = new JMenuItem(
MessageManager.getString("action.remove_group"));
keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask()
formatMenu.setText(MessageManager.getString("action.format"));
JMenu selectMenu = new JMenu(MessageManager.getString("action.select"));
+ selectMenu.addMenuListener(new MenuListener()
+ {
+ @Override
+ public void menuSelected(MenuEvent e)
+ {
+ configureSelectMenu();
+ }
+
+ @Override
+ public void menuDeselected(MenuEvent e)
+ {
+ }
+
+ @Override
+ public void menuCanceled(MenuEvent e)
+ {
+ }
+ });
idRightAlign.setText(MessageManager
.getString("label.right_align_sequence_id"));
idRightAlign.addActionListener(new ActionListener()
// selectMenu.add(listenToViewSelections);
}
+ protected void configureSelectMenu()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
/**
* Constructs the entries on the Colour menu (but does not add them to the
* menu).