Browse Source

REPORT-9377

master
Mata.Li 6 years ago
parent
commit
ed8f2798c4
  1. 42
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

42
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -26,6 +26,7 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.net.URI;
import java.text.MessageFormat;
import java.util.Locale;
public class AboutPane extends JPanel {
@ -34,6 +35,7 @@ public class AboutPane extends JPanel {
private static final String COPYRIGHT_LABEL = "\u00A9 ";
private static final String BUILD_PREFIX = " ";
private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("company_telephone");
private static final String PRESIDENT_PHONE = CloudCenter.getInstance().acquireUrlByKind("president_phone");
public AboutPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -79,6 +81,9 @@ public class AboutPane extends JPanel {
contentPane.add(urlActionPane);
contentPane.add(emailPane);
contentPane.add(getRemarkPane());
if (shouldShowThanks()) {
addThankPane(contentPane);
}
@ -111,6 +116,43 @@ public class AboutPane extends JPanel {
return true;
}
private JPanel getRemarkPane(){
String remark = Inter.getLocText("Fine-Designer_About_Remark_Info",PRESIDENT_PHONE);
UILabel label = new UILabel();
label.setSize(new Dimension(580,30));
//用THML标签进行拼接,以实现自动换行
StringBuilder builder = new StringBuilder("<html>");
char[] chars = remark.toCharArray();
//获取字体计算大小
FontMetrics fontMetrics = label.getFontMetrics(label.getFont());
int start = 0;
int len = 0;
while (start + len < remark.length()) {
while (true) {
len++;
if (start + len > remark.length())
break;
if (fontMetrics.charsWidth(chars, start, len)
> label.getWidth()) {
break;
}
}
builder.append(chars, start, len-1).append("<br/>");
start = start + len - 1;
len = 0;
}
//拼接剩余部分
builder.append(chars, start, remark.length()-start);
builder.append("</html>");
JPanel jPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
label.setText(builder.toString());
jPanel.add(label);
return jPanel;
}
//添加鸣谢面板
private void addThankPane(JPanel contentPane) {
BBSGuestPaneProvider pane = StableFactory.getMarkedInstanceObjectFromClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPaneProvider.class);

Loading…
Cancel
Save