X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureSettings.java;h=3dae4e5fca4f4409bb5c2f7053a394c19a2ba107;hb=c2214808f64b811a25cec10399dcff38db0c592c;hp=9adb254454542086b87d64d4da277e1530ab3c1b;hpb=416319530fff2c87f9bcbc0f0d568fe4b8566c70;p=jalview.git diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 9adb254..3dae4e5 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -1,19 +1,21 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.gui; @@ -105,6 +107,13 @@ public class FeatureSettings extends JPanel table.getValueAt(selectedRow, 1), fr.minmax, evt.getX(), evt.getY()); } + else if (evt.getClickCount() == 2) + { + fr.ap.alignFrame.avc.markColumnsContainingFeatures( + evt.isAltDown(), evt.isShiftDown() || evt.isMetaDown(), + evt.isMetaDown(), + (String) table.getValueAt(selectedRow, 0)); + } } }); @@ -132,7 +141,10 @@ public class FeatureSettings extends JPanel } } }); - + table.setToolTipText("" + + JvSwingUtils + .wrapTooltip("Click/drag feature types up or down to change render order.
Double click to select columns containing feature in alignment/current selection
Pressing Alt will select columns outside features rather than inside
Pressing Shift to modify current selection (rather than clear current selection)
Press CTRL or Command/Meta to toggle columns in/outside features
") + + ""); scrollPane.setViewportView(table); dassourceBrowser = new DasSourceBrowser(this); @@ -166,11 +178,15 @@ public class FeatureSettings extends JPanel frame.setContentPane(this); if (new jalview.util.Platform().isAMac()) { - Desktop.addInternalFrame(frame, MessageManager.getString("label.sequence_feature_settings"), 475, 480); + Desktop.addInternalFrame(frame, + MessageManager.getString("label.sequence_feature_settings"), + 475, 480); } else { - Desktop.addInternalFrame(frame, MessageManager.getString("label.sequence_feature_settings"), 400, 450); + Desktop.addInternalFrame(frame, + MessageManager.getString("label.sequence_feature_settings"), + 400, 450); } frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() @@ -188,8 +204,11 @@ public class FeatureSettings extends JPanel protected void popupSort(final int selectedRow, final String type, final Object typeCol, final Hashtable minmax, int x, int y) { - JPopupMenu men = new JPopupMenu(MessageManager.formatMessage("label.settings_for_param", new String[]{type})); - JMenuItem scr = new JMenuItem(MessageManager.getString("label.sort_by_score")); + JPopupMenu men = new JPopupMenu(MessageManager.formatMessage( + "label.settings_for_param", new String[] + { type })); + JMenuItem scr = new JMenuItem( + MessageManager.getString("label.sort_by_score")); men.add(scr); final FeatureSettings me = this; scr.addActionListener(new ActionListener() @@ -202,7 +221,8 @@ public class FeatureSettings extends JPanel } }); - JMenuItem dens = new JMenuItem(MessageManager.getString("label.sort_by_density")); + JMenuItem dens = new JMenuItem( + MessageManager.getString("label.sort_by_density")); dens.addActionListener(new ActionListener() { @@ -291,24 +311,28 @@ public class FeatureSettings extends JPanel }); } } - JMenuItem selCols = new JMenuItem(MessageManager.getString("label.select_columns_containing")); + JMenuItem selCols = new JMenuItem( + MessageManager.getString("label.select_columns_containing")); selCols.addActionListener(new ActionListener() { - + @Override public void actionPerformed(ActionEvent arg0) { - fr.ap.alignFrame.avc.markColumnsContainingFeatures(false, type); + fr.ap.alignFrame.avc.markColumnsContainingFeatures(false, false, + false, type); } }); - JMenuItem clearCols = new JMenuItem(MessageManager.getString("label.select_columns_not_containing")); + JMenuItem clearCols = new JMenuItem( + MessageManager.getString("label.select_columns_not_containing")); clearCols.addActionListener(new ActionListener() { - + @Override public void actionPerformed(ActionEvent arg0) { - fr.ap.alignFrame.avc.markColumnsContainingFeatures(true, type); + fr.ap.alignFrame.avc.markColumnsContainingFeatures(true, false, + false, type); } }); men.add(selCols); @@ -946,7 +970,8 @@ public class FeatureSettings extends JPanel } }); sortByScore.setFont(JvSwingUtils.getLabelFont()); - sortByScore.setText(MessageManager.getString("label.seq_sort_by_score")); + sortByScore + .setText(MessageManager.getString("label.seq_sort_by_score")); sortByScore.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -955,7 +980,8 @@ public class FeatureSettings extends JPanel } }); sortByDens.setFont(JvSwingUtils.getLabelFont()); - sortByDens.setText(MessageManager.getString("label.sequence_sort_by_density")); + sortByDens.setText(MessageManager + .getString("label.sequence_sort_by_density")); sortByDens.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -1152,13 +1178,13 @@ public class FeatureSettings extends JPanel private String[] getDisplayedFeatureGroups() { String[] gps = null; + ArrayList _gps = new ArrayList(); if (fr != null) { if (fr.featureGroups != null) { Iterator en = fr.featureGroups.keySet().iterator(); - gps = new String[fr.featureColours.size()]; int g = 0; boolean valid = false; while (en.hasNext()) @@ -1168,17 +1194,18 @@ public class FeatureSettings extends JPanel if (on != null && on.booleanValue()) { valid = true; - gps[g++] = gp; + _gps.add(gp); } } - while (g < gps.length) - { - gps[g++] = null; - } if (!valid) { return null; } + else + { + gps = new String[_gps.size()]; + _gps.toArray(gps); + } } } return gps; @@ -1333,10 +1360,15 @@ public class FeatureSettings extends JPanel public void noDasSourceActive() { complete(); - JOptionPane.showInternalConfirmDialog(Desktop.desktop, - MessageManager.getString("label.no_das_sources_selected_warn"), - MessageManager.getString("label.no_das_sources_selected_title"), JOptionPane.DEFAULT_OPTION, - JOptionPane.INFORMATION_MESSAGE); + JOptionPane + .showInternalConfirmDialog( + Desktop.desktop, + MessageManager + .getString("label.no_das_sources_selected_warn"), + MessageManager + .getString("label.no_das_sources_selected_title"), + JOptionPane.DEFAULT_OPTION, + JOptionPane.INFORMATION_MESSAGE); } // ///////////////////////////////////////////////////////////////////////