label.graduated_color_for_params = Graduated Feature Colour for {0}
label.select_backgroud_colour = Select Background Colour
label.invalid_font = Invalid Font
-label.separate_multiple_accession_ids = Enter one or more accession IDs
+label.separate_multiple_accession_ids = Enter one or more PDB accession IDs separated by a semi-colon ";"
label.separate_multiple_query_values = Enter one or more {0}s separated by a semi-colon ";"
label.search_all = Enter one or more search values separated by a semi-colon ";" (Note: This Searches the entire PDB database)
label.replace_commas_semicolons = Replace commas with semi-colons
*/
package jalview.gui;
+import jalview.util.MessageManager;
+
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.Rectangle;
import java.awt.event.ActionListener;
+import java.util.Objects;
import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JScrollBar;
import javax.swing.SwingConstants;
-import jalview.util.MessageManager;
-
/**
* useful functions for building Swing GUIs
*
*/
public static String wrapTooltip(boolean enclose, String ttext)
{
+ Objects.requireNonNull(ttext, "Tootip text to format must not be null!");
ttext = ttext.trim();
boolean maxLenghtExceeded = false;
}
else
{
- return (enclose ? "<html><table width=350 border=0><tr><td align=justify>"
- : "")
- + ttext + ((enclose ? "</td></tr></table></html>" : ""));
+ return enclose ? "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
+ + ttext + "</p></html>"
+ : ttext;
}
}
JPanel laypanel = new JPanel(new GridLayout(1, 2));
JPanel labPanel = new JPanel(new BorderLayout());
JPanel valPanel = new JPanel();
- // laypanel.setSize(panel.getPreferredSize());
- // laypanel.setLayout(null);
labPanel.setBounds(new Rectangle(7, 7, 158, 23));
valPanel.setBounds(new Rectangle(172, 7, 270, 23));
- // labPanel.setLayout(new GridLayout(1,1));
- // valPanel.setLayout(new GridLayout(1,1));
labPanel.add(label, BorderLayout.WEST);
valPanel.add(valBox);
laypanel.add(labPanel);
} catch (Exception e)
{
// System.out.println(">>>>>>>>>>>>>>>" + e.getMessage());
- // JOptionPane.showMessageDialog(this, e.getMessage(),
- // "PDB Web-service Error", JOptionPane.ERROR_MESSAGE);
e.printStackTrace();
errorWarning.append(e.getMessage());
checkForErrors();
protected JTextField txt_search = new JTextField(20);
- protected JTable tbl_summary = new JTable();
+ protected JTable tbl_summary = new JTable()
+ {
+ public String getToolTipText(MouseEvent evt)
+ {
+ String toolTipText = null;
+ java.awt.Point pnt = evt.getPoint();
+ int rowIndex = rowAtPoint(pnt);
+ int colIndex = columnAtPoint(pnt);
+
+ try
+ {
+ toolTipText = getValueAt(rowIndex, colIndex).toString();
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ toolTipText = (toolTipText == null ? null : JvSwingUtils.wrapTooltip(
+ true, toolTipText));
+ return toolTipText;
+ }
+ };
protected StringBuilder errorWarning = new StringBuilder();
lbl_warning.setFont(new java.awt.Font("Verdana", 0, 12));
tbl_summary.setAutoCreateRowSorter(true);
+ tbl_summary.getTableHeader().setReorderingAllowed(false);
tbl_summary.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
import jalview.datamodel.SequenceI;
import jalview.gui.AlignmentPanel;
import jalview.gui.Desktop;
+import jalview.gui.JvSwingUtils;
import jalview.jbgui.PDBDocFieldPreferences.PreferenceSource;
import jalview.util.MessageManager;
import jalview.ws.dbsources.PDBRestClient;
protected static final String VIEWS_LOCAL_PDB = "VIEWS_LOCAL_PDB";
- protected JTable tbl_summary = new JTable();
+ protected JTable tbl_summary = new JTable()
+ {
+ public String getToolTipText(MouseEvent evt)
+ {
+ String toolTipText = null;
+ java.awt.Point pnt = evt.getPoint();
+ int rowIndex = rowAtPoint(pnt);
+ int colIndex = columnAtPoint(pnt);
+
+ try
+ {
+ toolTipText = getValueAt(rowIndex, colIndex).toString();
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ toolTipText = (toolTipText == null ? null : JvSwingUtils.wrapTooltip(
+ true, toolTipText));
+ return toolTipText;
+ }
+ };
protected JScrollPane scrl_foundStructures = new JScrollPane(
tbl_summary);