Browse Source

REPORT-40495 设计面板-多sheet-windows下韩文名称的sheet不被选中时不显示名称

【问题原因】之前用的Graphics2D的drawString方法,无法画出韩文的sheetName,debug发现走到里面,fontInfo中的font=null,而GraphHelper的drawString方法,这个方法debug走到里面发现font一直是正常的,并且两个方法里面的Graphics2D也都是SunGraphics2D,就很奇怪,没搞懂为啥
【改动思路】将调用Graphics2D的drawString方法替换为调用GraphHelper的drawString方法
feature/big-screen
Yvan 4 years ago
parent
commit
a1b92c6eb8
  1. 19
      designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java

19
designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java

@ -134,7 +134,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
* 编辑的对象实例 * 编辑的对象实例
*/ */
private ReportComponentComposite reportComposite; private ReportComponentComposite reportComposite;
private int selectedIndex = -1; private int selectedIndex = -1;
private JPanel buttonPane; private JPanel buttonPane;
@ -332,7 +332,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
leftButton.setEnabled(buttonEnabled); leftButton.setEnabled(buttonEnabled);
rightButton.setEnabled(buttonEnabled); rightButton.setEnabled(buttonEnabled);
} }
/** /**
* 抽出来方便OEM * 抽出来方便OEM
* @return * @return
@ -417,10 +417,10 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
// 画两个添加sheet图标 // 画两个添加sheet图标
iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + GRAP; iconLocation = isOvertakeWidth ? (int) (maxWidth) : addIconlocation + GRAP;
paintAddButton(g2d); paintAddButton(g2d);
} }
protected void paintAddButton(Graphics2D g2d){ protected void paintAddButton(Graphics2D g2d){
getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3); getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3);
ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3); ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3);
@ -496,7 +496,8 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
sheetIcon.paintIcon(this, g2d, (int) textX + charWidth, 2); sheetIcon.paintIcon(this, g2d, (int) textX + charWidth, 2);
g2d.setPaint(getForeground()); g2d.setPaint(getForeground());
g2d.drawString(sheetName, (int) textX + charWidth + 14, textAscent); // REPORT-40495 之前的g2d.drawString()无法画出韩文sheetName,修改成GraphHelper的drawString
GraphHelper.drawString(g2d, sheetName, (int) textX + charWidth + 14, textAscent);
} }
/** /**
@ -626,7 +627,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
processRightMouseButton(evtX, evtY); processRightMouseButton(evtX, evtY);
} }
} }
private void processRightMouseButton(int evtX, int evtY){ private void processRightMouseButton(int evtX, int evtY){
MenuDef def = new MenuDef(); MenuDef def = new MenuDef();
addInsertGridShortCut(def); addInsertGridShortCut(def);
@ -636,14 +637,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
def.updateMenu(); def.updateMenu();
GUICoreUtils.showPopupMenu(tabPop, this, evtX - 1, evtY - 1); GUICoreUtils.showPopupMenu(tabPop, this, evtX - 1, evtY - 1);
} }
private void processLeftMouseButton(int evtX){ private void processLeftMouseButton(int evtX){
if (evtX > iconLocation && evtX < iconLocation + GRID_TOSHEET_RIGHT) { if (evtX > iconLocation && evtX < iconLocation + GRID_TOSHEET_RIGHT) {
firstInsertActionPerformed(); firstInsertActionPerformed();
} else if (evtX > iconLocation + POLY_TOSHEET_LEFT && evtX < iconLocation + POLY_TOSHEET_RIGHT) { } else if (evtX > iconLocation + POLY_TOSHEET_LEFT && evtX < iconLocation + POLY_TOSHEET_RIGHT) {
new PolyReportInsertAction().actionPerformed(null); new PolyReportInsertAction().actionPerformed(null);
} }
} }
protected void addInsertGridShortCut(MenuDef def){ protected void addInsertGridShortCut(MenuDef def){
@ -847,7 +848,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
} }
protected class GridReportInsertAction extends SheetInsertAction { protected class GridReportInsertAction extends SheetInsertAction {
@Override @Override
protected TemplateReport newTemplateReport() { protected TemplateReport newTemplateReport() {
return new WorkSheet(); return new WorkSheet();

Loading…
Cancel
Save