Browse Source

REPORT-99485 修复windows下绘制文字锯齿严重的问题

newui
jinsihou 12 months ago
parent
commit
213c9ed700
  1. 7
      designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java
  2. 23
      designer-realize/src/main/java/com/fr/grid/GridColumnUI.java
  3. 25
      designer-realize/src/main/java/com/fr/grid/GridRowUI.java

7
designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java

@ -2,10 +2,9 @@ package com.fr.design.foldablepane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.GraphHelper;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JPanel;
@ -13,7 +12,6 @@ import javax.swing.UIManager;
import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
@ -84,7 +82,8 @@ public class HeaderPane extends JPanel {
int descent = metrics.getDescent();
double titleY = (double) (getHeight() - (ascent + descent)) / 2 + ascent;
GraphHelper.drawString(g2d, this.title, triangleDown.getIconWidth() + FineUIScale.scale(UIManager.getInt("ExpandablePane.HeaderPane.hGap")), titleY);
FlatUIUtils.setRenderingHints(g2d);
g2d.drawString(this.title, triangleDown.getIconWidth() + FineUIScale.scale(UIManager.getInt("ExpandablePane.HeaderPane.hGap")), (int) titleY);
g2d.dispose();
}

23
designer-realize/src/main/java/com/fr/grid/GridColumnUI.java

@ -1,14 +1,6 @@
package com.fr.grid;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics;
import java.awt.geom.Rectangle2D;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.vcs.DesignerMode;
@ -22,6 +14,18 @@ import com.fr.privilege.finegrain.ColumnRowPrivilegeControl;
import com.fr.report.ReportHelper;
import com.fr.report.elementcase.ElementCase;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics;
import java.awt.geom.Rectangle2D;
/**
* @editor zhou
* @since 2012-3-22下午5:51:10
@ -77,6 +81,7 @@ public class GridColumnUI extends ComponentUI {
// draw left border line.
g2d.setPaint(gridColumn.getSeparatorLineColor());
GraphHelper.drawLine(g2d, 0, 0, 0, size.getHeight());
FlatUIUtils.setRenderingHints(g2d);
drawColumn(horizontalBeginValue, horizontalEndValue, columnWidthList, reportPane, g2d, gridColumn, size);
}

25
designer-realize/src/main/java/com/fr/grid/GridRowUI.java

@ -1,26 +1,30 @@
package com.fr.grid;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.geom.Rectangle2D;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.stable.AssistUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.vcs.DesignerMode;
import com.fr.cache.list.IntList;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.ColumnRowPrivilegeControl;
import com.fr.report.ReportHelper;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.AssistUtils;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.font.FontRenderContext;
import java.awt.geom.Rectangle2D;
/**
* @editor zhou
@ -77,6 +81,7 @@ public class GridRowUI extends ComponentUI {
// draw top border line.
g2d.setPaint(gridRow.getSeparatorLineColor());
GraphHelper.drawLine(g2d, 0, 0, size.getWidth(), 0);
FlatUIUtils.setRenderingHints(g2d);
// draw row
drawRow(verticalBeginValue, verticalEndValue, rowHeightList, resolution, gridRow, g2d);
}

Loading…
Cancel
Save