From: gmungoc Date: Mon, 17 Nov 2014 16:28:32 +0000 (+0000) Subject: JAL-1581 Tooltip slimmed down, Help button added on panel with link to X-Git-Tag: Release_2_8_2b1^2~28 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=30b6afb62b0741f2ac9224a50929d2dd9ece1754;p=jalview.git JAL-1581 Tooltip slimmed down, Help button added on panel with link to relevant Help page. --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index c3ef580..952f902 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -344,7 +344,7 @@ label.dont_ask_me_again = Don't ask me again label.select_eps_character_rendering_style = Select EPS character rendering style label.invert_selection = Invert Selection label.optimise_order = Optimise Order -label.seq_sort_by_score = Seq sort by Score +label.seq_sort_by_score = Sequence sort by Score label.load_colours = Load Colours label.save_colours = Save Colours label.fetch_das_features = Fetch DAS Features @@ -778,7 +778,9 @@ label.services_at = Services at {0} label.rest_client_submit = {0} using {1} label.fetch_retrieve_from =Retrieve from {0} label.fetch_retrieve_from_all_sources = Retrieve from all {0} sources in {1}
First is :{2} -label.feature_settings_click_drag = 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
+#label.feature_settings_click_drag = 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
+label.feature_settings_click_drag = Drag up or down to change render order.
Double click to select columns containing feature. +label.transparency_tip = Adjust transparency to 'see through' feature colours. label.opt_and_params_further_details = see further details by right-clicking label.opt_and_params_show_brief_desc_image_link = Click to show brief description
Right click for further information. label.opt_and_params_show_brief_desc = Click to show brief description
diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index a1663d9..dc403d0 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -748,7 +748,7 @@ label.services_at = Servicios en {0} label.rest_client_submit = {0} utilizando {1} label.fetch_retrieve_from =Recuperar de {0} label.fetch_retrieve_from_all_sources = Recuperar de todas las fuentes {0} en {1}
La primera es :{2} -label.feature_settings_click_drag = Haga clic o arrastre los tipos de las características hacia arriba o hacia abajo para cambiar el orden de visualización.
Haga doble clic para seleccionar las columnas que contienen las características del alineamiento/selección actual.
Presionando Alt seleccionará las columnas exteriores a las características en lugar de las interiores
Presione Shift para modificar la selección actual (en lugar de borrarla)
Presione CTRL o Command/Meta para cambiar las columans externas o internas a las características
+label.feature_settings_click_drag = Haga clic o arrastre los tipos de las características hacia arriba o hacia abajo para cambiar el orden de visualización.
Haga doble clic para seleccionar las columnas que contienen las características del alineamiento/selección actual.
label.opt_and_params_further_details = ver los detalles adicionales haciendo clic en el botón derecho label.opt_and_params_show_brief_desc_image_link = Haga clic para ver una descripción breve
Haga clic en el botón derecho para obtener información adicional. label.opt_and_params_show_brief_desc = Haga clic para ver una descripción breve
diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 693e6fe..2210148 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -27,6 +27,7 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import jalview.gui.Help.HelpId; import jalview.io.JalviewFileChooser; import jalview.schemes.AnnotationColourGradient; import jalview.schemes.GraduatedColor; @@ -61,6 +62,7 @@ import java.util.Iterator; import java.util.List; import java.util.Vector; +import javax.help.HelpSetException; import javax.swing.AbstractCellEditor; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -132,7 +134,19 @@ public class FeatureSettings extends JPanel ex.printStackTrace(); } - table = new JTable(); + table = new JTable() { + @Override + public String getToolTipText(MouseEvent e) { + if (table.columnAtPoint(e.getPoint()) == 0) { + /* + * Tooltip for feature name only + */ + return JvSwingUtils.wrapTooltip(true, + MessageManager.getString("label.feature_settings_click_drag")); + } + return null; + } + }; table.getTableHeader().setFont(new Font("Verdana", Font.PLAIN, 12)); table.setFont(new Font("Verdana", Font.PLAIN, 12)); table.setDefaultRenderer(Color.class, new ColorRenderer()); @@ -201,8 +215,8 @@ public class FeatureSettings extends JPanel } } }); - table.setToolTipText(JvSwingUtils - .wrapTooltip(true, MessageManager.getString("label.feature_settings_click_drag"))); +// table.setToolTipText(JvSwingUtils.wrapTooltip(true, +// MessageManager.getString("label.feature_settings_click_drag"))); scrollPane.setViewportView(table); dassourceBrowser = new DasSourceBrowser(this); @@ -572,7 +586,9 @@ public class FeatureSettings extends JPanel || ((Boolean) fr.featureGroups.get(group)).booleanValue()) { if (group != null) + { checkGroupState(group); + } type = tmpfeatures[index].getType(); if (!visibleChecks.contains(type)) { @@ -610,7 +626,9 @@ public class FeatureSettings extends JPanel if (fr.renderOrder != null) { if (!handlingUpdate) + { fr.findAllFeatures(groupChanged != null); // prod to update + } // colourschemes. but don't // affect display // First add the checks in the previous render order, @@ -691,12 +709,18 @@ public class FeatureSettings extends JPanel { order[i] = fr.getOrder(data[i][0].toString()); if (order[i] < 0) + { order[i] = fr.setOrder(data[i][0].toString(), i / order.length); + } if (i > 1) + { sort = sort || order[i - 1] > order[i]; + } } if (sort) + { jalview.util.QuickSort.sort(order, data); + } } void load() @@ -887,7 +911,9 @@ public class FeatureSettings extends JPanel public void orderByAvWidth() { if (table == null || table.getModel() == null) + { return; + } Object[][] data = ((FeatureTableModel) table.getModel()).getData(); float[] width = new float[data.length]; float[] awidth; @@ -909,7 +935,9 @@ public class FeatureSettings extends JPanel width[i] = 0; } if (max < width[i]) + { max = width[i]; + } } boolean sort = false; for (int i = 0; i < width.length; i++) @@ -929,11 +957,15 @@ public class FeatureSettings extends JPanel fr.setOrder(data[i][0].toString(), width[i]); // store for later } if (i > 0) + { sort = sort || width[i - 1] > width[i]; + } } if (sort) + { jalview.util.QuickSort.sort(width, data); // update global priority order + } updateFeatureRenderer(data, false); table.repaint(); @@ -1001,7 +1033,9 @@ public class FeatureSettings extends JPanel JButton sortByDens = new JButton(); - JPanel transbuttons = new JPanel(new GridLayout(4, 1)); + JButton help = new JButton(); + + JPanel transbuttons = new JPanel(new GridLayout(5, 1)); private void jbInit() throws Exception { @@ -1047,6 +1081,21 @@ public class FeatureSettings extends JPanel sortByDens(null); } }); + help.setFont(JvSwingUtils.getLabelFont()); + help.setText(MessageManager.getString("action.help")); + help.addActionListener(new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + try + { + Help.showHelpWindow(HelpId.SequenceFeatureSettings); + } catch (HelpSetException e1) + { + e1.printStackTrace(); + } + } + }); cancel.setFont(JvSwingUtils.getLabelFont()); cancel.setText(MessageManager.getString("action.cancel")); cancel.addActionListener(new ActionListener() @@ -1094,6 +1143,8 @@ public class FeatureSettings extends JPanel }); transparency.setMaximum(70); + transparency.setToolTipText(MessageManager + .getString("label.transparency_tip")); fetchDAS.setText(MessageManager.getString("label.fetch_das_features")); fetchDAS.addActionListener(new ActionListener() { @@ -1129,6 +1180,9 @@ public class FeatureSettings extends JPanel transbuttons.add(invert); transbuttons.add(sortByScore); transbuttons.add(sortByDens); + transbuttons.add(help); + JPanel sliderPanel = new JPanel(); + sliderPanel.add(transparency); transPanel.add(transparency); transPanel.add(transbuttons); buttonPanel.add(ok); diff --git a/src/jalview/gui/Help.java b/src/jalview/gui/Help.java index dac17c0..ae3f457 100644 --- a/src/jalview/gui/Help.java +++ b/src/jalview/gui/Help.java @@ -2,6 +2,7 @@ package jalview.gui; import java.net.URL; +import javax.help.BadIDException; import javax.help.HelpBroker; import javax.help.HelpSet; import javax.help.HelpSetException; @@ -14,6 +15,23 @@ import javax.help.HelpSetException; */ public class Help { + public enum HelpId + { + Home("home"), SequenceFeatureSettings("seqfeatures.settings"); + + private String id; + + private HelpId(String loc) + { + this.id = loc; + } + + @Override + public String toString() + { + return this.id; + } + } private static final long HALF_A_MO = 500; // half a second @@ -33,10 +51,11 @@ public class Help * * This is a workaround for issue JAL-914 - both Desktop and AlignFrame * responding to F1 key, resulting in duplicate help windows opened. + * @param id TODO * * @throws HelpSetException */ - public static void showHelpWindow() throws HelpSetException + public static void showHelpWindow(HelpId id) throws HelpSetException { long timeNow = System.currentTimeMillis(); @@ -48,8 +67,21 @@ public class Help HelpSet hs = new HelpSet(cl, url); HelpBroker hb = hs.createHelpBroker(); - hb.setCurrentID("home"); + try + { + hb.setCurrentID(id.toString()); + } catch (BadIDException bad) + { + System.out.println("Bad help link: " + id.toString() + + ": must match a target in help.jhm"); + throw bad; + } hb.setDisplayed(true); } } + + public static void showHelpWindow() throws HelpSetException + { + showHelpWindow(HelpId.Home); + } }