Browse Source

REPORT-35692 国际化-页面设置-单位改为INCH,显示不全

feature/big-screen
Henry.Wang 4 years ago
parent
commit
39fd9ae7e7
  1. 9
      designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java

9
designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java

@ -52,9 +52,9 @@ public class UnitFieldPane extends JPanel {
this.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM")); this.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM"));
} }
//ajust the heigt of unitLabel. //自适应label宽度
Dimension unitDimension = new Dimension(this.getPreferredSize().width, int width = this.getFontMetrics(this.getFont()).stringWidth(this.getText());
preferredHeight); Dimension unitDimension = new Dimension(width, preferredHeight);
this.setMinimumSize(unitDimension); this.setMinimumSize(unitDimension);
this.setMinimumSize(unitDimension); this.setMinimumSize(unitDimension);
this.setSize(unitDimension); this.setSize(unitDimension);
@ -62,7 +62,8 @@ public class UnitFieldPane extends JPanel {
} }
} }
public UnitFieldPane(int unitType) { public
UnitFieldPane(int unitType) {
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
this.unitType = unitType; this.unitType = unitType;

Loading…
Cancel
Save