Browse Source

REPORT-32520 修改代码规范

bugfix/10.0
Yuan.Wang 5 years ago
parent
commit
900d1f6883
  1. 13
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

13
designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

@ -67,6 +67,7 @@ public class PageSetupPane extends BasicPane {
private PagePane pagePane;
private OtherPane otherPane;
private UILabel zeroMarginWarn;
private static final String E = "E";
public PageSetupPane() {
this.initComponents();
@ -768,7 +769,7 @@ public class PageSetupPane extends BasicPane {
FontMetrics fm = g2d.getFontMetrics();
// 横向的长度
String w_str = "" + paper_width;
if (!w_str.contains("E")&&w_str.indexOf(CoreConstants.DOT) > 0) {
if (!w_str.contains(E) && w_str.indexOf(CoreConstants.DOT) > 0) {
w_str = w_str.substring(0, w_str.indexOf(CoreConstants.DOT) + 2);
}
int w_length = fm.stringWidth(w_str);
@ -776,16 +777,16 @@ public class PageSetupPane extends BasicPane {
// 纵向的长度
String h_str = "" + paper_height;
//使用科学计数法显示长度的时候,限制纵向显示长度为9位
if (h_str.contains("E")){
String str1=h_str.substring(h_str.indexOf("E"));
if (h_str.contains(E)){
String str1=h_str.substring(h_str.indexOf(E));
String str2=h_str.substring(0,9-str1.length());
h_str = str2+str1;
}else if(h_str.indexOf(".") > 0) {
h_str = h_str.substring(0, h_str.indexOf(".") + 2);
}else if(h_str.indexOf(CoreConstants.DOT) > 0) {
h_str = h_str.substring(0, h_str.indexOf(CoreConstants.DOT) + 2);
}
int h_length = fm.stringWidth(h_str);
paint_height = Math.max(paint_height, h_length + 26);
paint_height = Math.min(paint_height, 75);
paint_height = Math.min(paint_height, 74);
double startX = (pane_width - paint_width) / 2;
double startY = (pane_height - paint_height) / 2;
g2d.translate(startX, startY);

Loading…
Cancel
Save