private Component createValueLabel(DetailsDecoration property, int maxLength) { String value = property.getFormatedValue(); boolean abbreviate = (value.length() > maxLength); String abbreviatedValue; if (value.matches("[0-9\\.]+e-?[0-9]+")) { value = "<html><body>" + value.replaceAll("e(-?[0-9]+)", "·10<sup>$1</sup>") + "</body></html>"; } if (abbreviate) { abbreviatedValue = StringUtils.abbreviate(value, maxLength); } else { abbreviatedValue = value; } WebLabel label; if (StringUtils.isEmpty(property.getValueLink())) { label = new WebLabel(abbreviatedValue); } else { DetailsWebLinkLabel webLabel = new DetailsWebLinkLabel(abbreviatedValue); webLabel.setLink(property.getValueLink(), false); label = webLabel; } SwingUtils.changeFontSize(label, -1); if (abbreviate) { TooltipManager.setTooltip(label, value, TooltipWay.down, 0); } label.setCursor(new Cursor(Cursor.HAND_CURSOR)); label.addMouseListener(new PropertyMouseListener(property)); if (property.isSelected()) { SwingUtils.setBoldFont(label); } if (property.getBgColor() != null) { WebPanel colorBox = new WebPanel(); colorBox.setPreferredSize(new Dimension(15, 15)); colorBox.setBackground(property.getBgColor()); return new GroupPanel(4, colorBox, label); } label.setForeground(property.isVisible() ? Color.BLACK : Color.lightGray); return label; }