Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~plough/10-design into release/10.0

master
plough 6 years ago
parent
commit
dde63114e8
  1. 43
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

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

@ -33,7 +33,8 @@ public class AboutPane extends JPanel {
private static final int DEFAULT_GAP = 12; private static final int DEFAULT_GAP = 12;
private static final String COPYRIGHT_LABEL = "\u00A9 "; private static final String COPYRIGHT_LABEL = "\u00A9 ";
private static final String BUILD_PREFIX = " "; private static final String BUILD_PREFIX = " ";
private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("company_telephone"); private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("help.compNo");
private static final String PRESIDENT_PHONE = CloudCenter.getInstance().acquireUrlByKind("help.PNo");
public AboutPane() { public AboutPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -79,6 +80,9 @@ public class AboutPane extends JPanel {
contentPane.add(urlActionPane); contentPane.add(urlActionPane);
contentPane.add(emailPane); contentPane.add(emailPane);
contentPane.add(getRemarkPane());
if (shouldShowThanks()) { if (shouldShowThanks()) {
addThankPane(contentPane); addThankPane(contentPane);
} }
@ -111,6 +115,43 @@ public class AboutPane extends JPanel {
return true; 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) { private void addThankPane(JPanel contentPane) {
BBSGuestPaneProvider pane = StableFactory.getMarkedInstanceObjectFromClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPaneProvider.class); BBSGuestPaneProvider pane = StableFactory.getMarkedInstanceObjectFromClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPaneProvider.class);

Loading…
Cancel
Save