1 package com.github.celldynamics.quimp.utils;
2
3 import javax.swing.JComponent;
4
5
6
7
8
9
10
11 public class UiTools {
12
13
14
15
16 public static final int TOOLTIPDELAY = 3000;
17
18
19
20 public static int toolTipLength = 40;
21
22
23
24
25
26
27
28 public static void setToolTip(JComponent c, String toolTip) {
29 if (toolTip != null && !toolTip.isEmpty()) {
30 c.setToolTipText(getToolTipString(toolTip));
31 }
32 }
33
34
35
36
37
38
39
40 public static String getToolTipString(String toolTip) {
41 return "<html>" + QuimpToolsCollection.stringWrap(toolTip, toolTipLength, "<br>") + "</html>";
42 }
43
44 }