Browse Source

REPORT-3959 [9.0一轮回归]行(列)隐藏时行(列)号依然显示

master
MoMeak 7 years ago
parent
commit
3ea73837dc
  1. 8
      designer/src/com/fr/grid/GridColumnUI.java
  2. 23
      designer/src/com/fr/grid/GridRowUI.java

8
designer/src/com/fr/grid/GridColumnUI.java

@ -163,11 +163,11 @@ public class GridColumnUI extends ComponentUI {
float time = (float)resolution/ScreenResolution.getScreenResolution(); float time = (float)resolution/ScreenResolution.getScreenResolution();
double stringWidth = gridColumn.getFont().getStringBounds(columnContent, fontRenderContext).getWidth() * time; double stringWidth = gridColumn.getFont().getStringBounds(columnContent, fontRenderContext).getWidth() * time;
// if (stringWidth > tmpIncreaseWidth) { if (stringWidth > tmpIncreaseWidth) {
// paintMoreContent(i, g2d, tmpWidth1, size, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent); paintMoreContent(i, g2d, tmpWidth1, size, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent);
// } else { } else {
paintNormalContent(i, g2d, tmpWidth1, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent); paintNormalContent(i, g2d, tmpWidth1, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent);
// } }
} }

23
designer/src/com/fr/grid/GridRowUI.java

@ -159,20 +159,21 @@ public class GridRowUI extends ComponentUI {
float fmAscent = GraphHelper.getFontMetrics(gridRow.getFont()).getAscent() * time; float fmAscent = GraphHelper.getFontMetrics(gridRow.getFont()).getAscent() * time;
double stringWidth = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getWidth() * time; double stringWidth = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getWidth() * time;
double stringHeight = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getHeight() * time; double stringHeight = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getHeight() * time;
if (isSelectedBounds) { // 如果高度太小了就不画了
g2d.setColor(gridRow.getSelectedForeground()); if (stringHeight <= tmpIncreaseHeight + 2) {
} else { if (isSelectedBounds) {
// p:检查eanbled g2d.setColor(gridRow.getSelectedForeground());
if (gridRow.isEnabled()) {
g2d.setColor(gridRow.getForeground());
} else { } else {
g2d.setPaint(UIManager.getColor("controlShadow")); // p:检查eanbled
if (gridRow.isEnabled()) {
g2d.setColor(gridRow.getForeground());
} else {
g2d.setPaint(UIManager.getColor("controlShadow"));
}
} }
}
GraphHelper.drawString(g2d, paintText, (size.width - stringWidth) / 2, tmpHeight1 + (tmpIncreaseHeight - stringHeight) / 2 + GridHeader.SIZE_ADJUST / 2 + fmAscent
- 2);
GraphHelper.drawString(g2d, paintText, (size.width - stringWidth) / 2, tmpHeight1 + (tmpIncreaseHeight - stringHeight) / 2 + GridHeader.SIZE_ADJUST / 2 + fmAscent - 2);
}
} }
} }
Loading…
Cancel
Save