Skip to content

Commit 8975a82

Browse files
committed
JToolTip fixed; now heavyweight
1 parent cf340a4 commit 8975a82

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed
128 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/javax/swing/ToolTipManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener
100100
private KeyListener accessibilityKeyListener = null;
101101

102102
// PENDING(ges)
103-
protected boolean lightWeightPopupEnabled = true;
103+
protected boolean lightWeightPopupEnabled = false; // BH 2018 true;
104104
protected boolean heavyWeightPopupEnabled = false;
105105

106106
ToolTipManager() {
@@ -311,7 +311,7 @@ else if (location.y - sBounds.y + size.height > sBounds.height) {
311311

312312
PopupFactory popupFactory = PopupFactory.getSharedInstance();
313313

314-
if (lightWeightPopupEnabled) {
314+
if (false && lightWeightPopupEnabled) { // BH 2018
315315
int y = getPopupFitHeight(popupRect, insideComponent);
316316
int x = getPopupFitWidth(popupRect,insideComponent);
317317
if (x>0 || y>0) {
@@ -321,7 +321,7 @@ else if (location.y - sBounds.y + size.height > sBounds.height) {
321321
}
322322
}
323323
else {
324-
popupFactory.setPopupType(PopupFactory.MEDIUM_WEIGHT_POPUP);
324+
popupFactory.setPopupType(PopupFactory.HEAVY_WEIGHT_POPUP);//PopupFactory.MEDIUM_WEIGHT_POPUP);
325325
}
326326
tipWindow = popupFactory.getPopup(insideComponent, tip,
327327
location.x,

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,9 @@ protected void setIconAndText(String prop, ImageIcon icon, int gap,
783783
text = PT.rep(text.substring(6, text.length() - 7), "</br>", "");
784784
text = PT.rep(text, "</html>", "");
785785
text = PT.rep(text, "href=", "target=_blank href=");
786-
System.out.println(text);
786+
text = PT.rep(text, "href=", "target=_blank href=");
787+
// Jalview hack
788+
text = PT.rep(text, "width: 350; text-align: justify; word-wrap: break-word;", "width: 350px; word-wrap: break-word;");
787789
}
788790
}
789791
DOMNode obj = null;

0 commit comments

Comments
 (0)