Browse Source

Pull request #11785: REPORT-92304 & REPORT-92440 & REPORT-92439 修复svg图标替换bug

Merge in DESIGN/design from ~OBO/design:release/11.0 to release/11.0

* commit '94f9aadec21e8b3b0b84666ff2743608ac8173b2':
  REPORT-92440 mac-数据源带叹号的宽度不正常
  REPORT-92440 mac-数据源带叹号的宽度不正常
  REPORT-92440 mac-数据源带叹号的宽度不正常
  REPORT-92439 mac下-展开收起图标的问题
  REPORT-92439 mac下-展开收起图标的问题
  REPORT-92440 mac-数据源带叹号的宽度不正常
  REPORT-92440 mac-数据源带叹号的宽度不正常
  REPORT-92439 mac下-展开收起图标的问题
  REPORT-92440 增加了SvgPaintWorker的execute方法的注释
  REPORT-92430 设计器-图标-mac下文件图标都丢失了,windows下正常
  REPORT-92439 mac下-展开收起图标的问题
  REPORT-92440 mac-数据源带叹号的宽度不正常
  REPORT-92439 优化了计算svg位置x,y的写法
  REPORT-92439 mac下-展开收起图标的问题
  REPORT-92440 mac-数据源带叹号的宽度不正常
  REPORT-92304 设计器-图标-三角形需要更新
release/11.0
Obo-王学仁 2 years ago committed by Harrison-刘珂
parent
commit
71784a64da
  1. 12
      designer-base/src/main/java/com/fr/base/svg/SVGIcon.java
  2. 7
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  3. 30
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  4. 27
      designer-base/src/main/java/com/fr/design/icon/WarningIcon.java
  5. 6
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  6. 16
      designer-base/src/main/java/com/fr/design/utils/SvgDraw.java
  7. 73
      designer-base/src/main/java/com/fr/design/utils/SvgDrawUtils.java
  8. 28
      designer-base/src/main/java/com/fr/design/utils/SvgPaintUtils.java
  9. 4
      designer-base/src/main/resources/com/fr/design/images/lookandfeel/TreeLeafIcon.svg
  10. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/left_normal.svg
  11. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/left_pressed.svg
  12. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/right_normal.svg
  13. 2
      designer-base/src/main/resources/com/fr/design/standard/drag/right_pressed.svg
  14. 2
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_hover.svg
  15. 2
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_normal.svg
  16. 2
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_hover.svg
  17. 2
      designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_normal.svg
  18. 6
      designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollButton.java
  19. 11
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java
  20. 9
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java

12
designer-base/src/main/java/com/fr/base/svg/SVGIcon.java

@ -1,9 +1,12 @@
package com.fr.base.svg; package com.fr.base.svg;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.*; import javax.swing.Icon;
import java.awt.*; import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -34,10 +37,7 @@ public class SVGIcon implements Icon {
public void paintIcon(Component c, Graphics g, int x, int y) { public void paintIcon(Component c, Graphics g, int x, int y) {
if (HI_DPI_SURPORT) { if (HI_DPI_SURPORT) {
Graphics2D graphics = (Graphics2D) g.create(x, y, image.getWidth(null), image.getHeight(null)); Graphics2D graphics = (Graphics2D) g.create(x, y, image.getWidth(null), image.getHeight(null));
float scale = SYSTEM_SCALE; SvgDrawUtils.doDrawSVG(graphics, () -> SvgDrawUtils.drawImage(graphics, image, 0, 0, null));
graphics.scale(1 / scale, 1 / scale);
graphics.drawImage(image, 0, 0, null);
graphics.scale(1.0D, 1.0D);
graphics.dispose(); graphics.dispose();
} else { } else {
g.drawImage(image, x, y, null); g.drawImage(image, x, y, null);

7
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -5,7 +5,7 @@ import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgDrawUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -18,7 +18,6 @@ import java.awt.Container;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.LayoutManager; import java.awt.LayoutManager;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -338,9 +337,7 @@ public class UIEastResizableContainer extends JPanel {
button = UIConstants.DRAG_RIGHT_PRESS; button = UIConstants.DRAG_RIGHT_PRESS;
} }
} }
SvgPaintUtils.beforePaint((Graphics2D) g); SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, 10, 7, null));
g.drawImage(button, 18, 7, this);
SvgPaintUtils.afterPaint((Graphics2D) g);
} }
} }
} }

30
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -3,12 +3,22 @@ package com.fr.design.gui.icontainer;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgDrawUtils;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.JComponent;
import java.awt.*; import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.LayoutManager;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener; import java.awt.event.MouseMotionListener;
@ -411,11 +421,9 @@ public class UIResizableContainer extends JPanel {
Image upButton = (upModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_UP_NORMAL : UIConstants.DRAG_UP_PRESS); Image upButton = (upModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_UP_NORMAL : UIConstants.DRAG_UP_PRESS);
Image downButton = (downModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_DOWN_NORMAL : UIConstants.DRAG_DOWN_PRESS); Image downButton = (downModel == UIConstants.MODEL_NORMAL ? UIConstants.DRAG_DOWN_NORMAL : UIConstants.DRAG_DOWN_PRESS);
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, getWidth(), getHeight(), null); g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, getWidth(), getHeight(), null);
SvgPaintUtils.beforePaint((Graphics2D) g); SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, null));
g.drawImage(UIConstants.DRAG_LINE, (getWidth() - toolPaneHeight) / 2, 3, null); SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, upButton, ARROW_MARGIN, 0, null));
g.drawImage(upButton, ARROW_MARGIN, 1, null); SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, downButton, (getWidth() - toolPaneHeight - ARROW_MARGIN), 0, null));
g.drawImage(downButton, getWidth() - toolPaneHeight - ARROW_MARGIN, 1, null);
SvgPaintUtils.afterPaint((Graphics2D) g);
} }
} }
@ -512,7 +520,7 @@ public class UIResizableContainer extends JPanel {
button = UIConstants.DRAG_LEFT_PRESS; button = UIConstants.DRAG_LEFT_PRESS;
} }
} }
g.drawImage(button, -1, ARROW_MARGIN_VERTICAL, this); SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, -6, ARROW_MARGIN_VERTICAL, VerticalToolPane.this));
} else { } else {
g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, toolPaneHeight, getHeight(), null); g.drawImage(UIConstants.DRAG_BAR_LIGHT, 0, 0, toolPaneHeight, getHeight(), null);
if (containerWidth == toolPaneHeight) { if (containerWidth == toolPaneHeight) {
@ -528,7 +536,7 @@ public class UIResizableContainer extends JPanel {
button = UIConstants.DRAG_RIGHT_PRESS; button = UIConstants.DRAG_RIGHT_PRESS;
} }
} }
g.drawImage(button, 2, ARROW_MARGIN_VERTICAL, this); SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, 10, ARROW_MARGIN_VERTICAL, VerticalToolPane.this));
} }
if (isLeftRightDragEnabled) { if (isLeftRightDragEnabled) {
g.drawImage(UIConstants.DRAG_DOT_VERTICAL, 2, getHeight() / 2, 5, toolPaneHeight, null); g.drawImage(UIConstants.DRAG_DOT_VERTICAL, 2, getHeight() / 2, 5, toolPaneHeight, null);

27
designer-base/src/main/java/com/fr/design/icon/WarningIcon.java

@ -1,12 +1,17 @@
package com.fr.design.icon; package com.fr.design.icon;
import com.fr.base.svg.SVGLoader; import com.fr.base.svg.SVGLoader;
import com.fr.design.utils.SvgPaintUtils; import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.utils.SvgDrawUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import javax.swing.GrayFilter; import javax.swing.GrayFilter;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import java.awt.*; import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.image.ImageObserver; import java.awt.image.ImageObserver;
/** /**
@ -20,7 +25,8 @@ public class WarningIcon extends ImageIcon {
}; };
protected final static MediaTracker TRACKER = new MediaTracker(COMPONENT); protected final static MediaTracker TRACKER = new MediaTracker(COMPONENT);
private final static Image WARNING_IMAGE = SVGLoader.load("/com/fr/design/standard/warning.svg"); private final static Image WARNING_IMAGE = SVGLoader.load("/com/fr/design/standard/warning.svg");
private static final boolean HI_DPI_SUPPORT = SystemScaleUtils.isJreHiDPIEnabled();
public static final float SYSTEM_SCALE = SystemScaleUtils.sysScale();
private Image mainImage = null; private Image mainImage = null;
private ImageObserver imageObserver; private ImageObserver imageObserver;
private int width = -1; private int width = -1;
@ -36,14 +42,15 @@ public class WarningIcon extends ImageIcon {
@Override @Override
public synchronized void paintIcon(Component c, Graphics g, int x, int y) { public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
SvgPaintUtils.beforePaint((Graphics2D) g); //裁剪绘制svg的位置,以免影响到图标右侧的文字
Graphics2D graphics = (Graphics2D) g.create(x, y, WARNING_IMAGE.getWidth(null), WARNING_IMAGE.getHeight(null));
if (mainImage != null) { if (mainImage != null) {
g.drawImage(mainImage, x, y, c); SvgDrawUtils.doDrawSVG(graphics, () -> SvgDrawUtils.drawImage(graphics, mainImage, x, y, null));
} }
if (WARNING_IMAGE != null) { if (WARNING_IMAGE != null) {
g.drawImage(WARNING_IMAGE, x, y, c); SvgDrawUtils.doDrawSVG(graphics, () -> SvgDrawUtils.drawImage(graphics, WARNING_IMAGE, x, y, null));
} }
SvgPaintUtils.afterPaint((Graphics2D) g); graphics.dispose();
} }
/** /**
@ -91,7 +98,8 @@ public class WarningIcon extends ImageIcon {
* @return the width in pixels of this icon * @return the width in pixels of this icon
*/ */
public int getIconWidth() { public int getIconWidth() {
return width; //如果环境支持高清化,drawImage可能会缩放绘制的图像比例,需要保证svg正常显示的同时调整绘制范围
return HI_DPI_SUPPORT ? (int) (width / SYSTEM_SCALE) : width;
} }
/** /**
@ -100,7 +108,8 @@ public class WarningIcon extends ImageIcon {
* @return the height in pixels of this icon * @return the height in pixels of this icon
*/ */
public int getIconHeight() { public int getIconHeight() {
return height; //如果环境支持高清化,drawImage可能会缩放绘制的图像比例,需要保证svg正常显示的同时调整绘制范围
return HI_DPI_SUPPORT ? (int) (height / SYSTEM_SCALE) : height;
} }
{ {

6
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -19,7 +19,7 @@ import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatFactory; import com.fr.design.notification.SnapChatFactory;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgDrawUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -1314,9 +1314,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
} else { } else {
button = UIConstants.POP_BUTTON_UP; button = UIConstants.POP_BUTTON_UP;
} }
SvgPaintUtils.beforePaint((Graphics2D) g); SvgDrawUtils.doDrawSVG(g, () -> SvgDrawUtils.drawImage(g, button, (ARROW_RANGE_START + 8), 4, null));
g.drawImage(button, ARROW_RANGE_START + 8, 4, null);
SvgPaintUtils.afterPaint((Graphics2D) g);
} }
} }

16
designer-base/src/main/java/com/fr/design/utils/SvgDraw.java

@ -0,0 +1,16 @@
package com.fr.design.utils;
/**
* 绘制SVG图标的函数式接口
*
* @author obo
* @since 11.0
* Created on 2023/3/24
*/
public interface SvgDraw<T> {
/**
* 绘制svg图标的具体逻辑,方法体
* */
void drawSVG();
}

73
designer-base/src/main/java/com/fr/design/utils/SvgDrawUtils.java

@ -0,0 +1,73 @@
package com.fr.design.utils;
import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import org.jetbrains.annotations.NotNull;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.ImageObserver;
/**
* 用于绘制svg图片缩放(高分屏下)
*
* @author hades
* @since 11.0
* Created on 2022/5/6
*/
public class SvgDrawUtils {
private static final boolean HI_DPI_ENABLED = SystemScaleUtils.isJreHiDPIEnabled();
/**
* 绘制svg前若环境支持高清化则对缩放比例进行适配
* */
public static void beforeDraw(Graphics2D g2) {
if (HI_DPI_ENABLED) {
g2.scale(1 / SVGLoader.SYSTEM_SCALE, 1 / SVGLoader.SYSTEM_SCALE);
}
}
/**
* 绘制svg后还原缩放矩阵
* */
public static void afterDraw(Graphics2D g2) {
if (HI_DPI_ENABLED) {
g2.scale(SVGLoader.SYSTEM_SCALE, SVGLoader.SYSTEM_SCALE);
}
}
/**
* 计算高缩放下绘制svg图标时新的的位置x,y
* @param position 旧坐标的值
* @return 新的position值
* */
public static int calculatePosition(int position) {
return HI_DPI_ENABLED ? (int) (position * SVGLoader.SYSTEM_SCALE) : position;
}
/**
* 绘制svg图像的完整逻辑
* @param graphics 绘图
* @param svgDraw 具体绘制逻辑
* */
public static void doDrawSVG(@NotNull Graphics graphics, @NotNull final SvgDraw<Graphics> svgDraw) {
SvgDrawUtils.beforeDraw((Graphics2D) graphics);
svgDraw.drawSVG();
SvgDrawUtils.afterDraw((Graphics2D) graphics);
}
/**
* 绘制前对坐标x和y进行处理
* @param graphics 绘图
* @param image svg的Image对象
* @param x x坐标
* @param y y坐标
* @param imageObserver 图像观察器
* */
public static void drawImage(Graphics graphics, Image image, int x, int y, ImageObserver imageObserver) {
//如果环境支持高清化,在调整缩放比例时绘制svg会影响到位置的变化,若图标无确定裁剪位置,则需要进行调整
graphics.drawImage(image, SvgDrawUtils.calculatePosition(x), SvgDrawUtils.calculatePosition(y), imageObserver);
}
}

28
designer-base/src/main/java/com/fr/design/utils/SvgPaintUtils.java

@ -1,28 +0,0 @@
package com.fr.design.utils;
import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import java.awt.Graphics2D;
/**
* 用于绘制svg图片缩放(高分屏下)
*
* @author hades
* @version 11.0
* Created by hades on 2022/5/6
*/
public class SvgPaintUtils {
public static void beforePaint(Graphics2D g2) {
if (SystemScaleUtils.isJreHiDPIEnabled()) {
g2.scale(1 / SVGLoader.SYSTEM_SCALE, 1 / SVGLoader.SYSTEM_SCALE);
}
}
public static void afterPaint(Graphics2D g2) {
if (SystemScaleUtils.isJreHiDPIEnabled()) {
g2.scale(SVGLoader.SYSTEM_SCALE, SVGLoader.SYSTEM_SCALE);
}
}
}

4
designer-base/src/main/resources/com/fr/design/images/lookandfeel/TreeLeafIcon.svg

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 15V1H10L14 5.001V15H2ZM9 2H3V14H13V6.0002H10H9V5.0002V2ZM10 2.41412V5.0002H12.5853L10 2.41412Z" fill="#333334"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 3H4V13H6H8H12V7H8V3Z" fill="#FEF6DE"/>
</svg>

After

Width:  |  Height:  |  Size: 366 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/left_normal.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M10 4.48284C10 4.30466 9.78457 4.21543 9.65858 4.34142L6 8L9.65858 11.6586C9.78457 11.7846 10 11.6953 10 11.5172V4.48284Z" fill="#333334"/> <path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M10 4.48284C10 4.30466 9.78457 4.21543 9.65858 4.34142L6 8L9.65858 11.6586C9.78457 11.7846 10 11.6953 10 11.5172V4.48284Z" fill="#333334"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/left_pressed.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 4.48284C10 4.30466 9.78457 4.21543 9.65858 4.34142L6 8L9.65858 11.6586C9.78457 11.7846 10 11.6953 10 11.5172V4.48284Z" fill="#333334"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M10 4.48284C10 4.30466 9.78457 4.21543 9.65858 4.34142L6 8L9.65858 11.6586C9.78457 11.7846 10 11.6953 10 11.5172V4.48284Z" fill="#333334"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 295 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/right_normal.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M6 4.48284C6 4.30466 6.21543 4.21543 6.34142 4.34142L10 8L6.34142 11.6586C6.21543 11.7846 6 11.6953 6 11.5172V4.48284Z" fill="#333334"/> <path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M6 4.48284C6 4.30466 6.21543 4.21543 6.34142 4.34142L10 8L6.34142 11.6586C6.21543 11.7846 6 11.6953 6 11.5172V4.48284Z" fill="#333334"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

2
designer-base/src/main/resources/com/fr/design/standard/drag/right_pressed.svg

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 4.48284C6 4.30466 6.21543 4.21543 6.34142 4.34142L10 8L6.34142 11.6586C6.21543 11.7846 6 11.6953 6 11.5172V4.48284Z" fill="#333334"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M6 4.48284C6 4.30466 6.21543 4.21543 6.34142 4.34142L10 8L6.34142 11.6586C6.21543 11.7846 6 11.6953 6 11.5172V4.48284Z" fill="#333334"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

2
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_hover.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 2C7.69534 2 7.78457 2.21543 7.65858 2.34142L4 6L0.341421 2.34142C0.215428 2.21543 0.304662 2 0.482843 2L7.51716 2Z" fill="#62646E"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 2C7.69534 2 7.78457 2.21543 7.65858 2.34142L4 6L0.341421 2.34142C0.215428 2.21543 0.304662 2 0.482843 2L7.51716 2Z" fill="#62646E"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 295 B

2
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/down_normal.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 2C7.69534 2 7.78457 2.21543 7.65858 2.34142L4 6L0.341421 2.34142C0.215428 2.21543 0.304662 2 0.482843 2L7.51716 2Z" fill="#AEAEAE"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 2C7.69534 2 7.78457 2.21543 7.65858 2.34142L4 6L0.341421 2.34142C0.215428 2.21543 0.304662 2 0.482843 2L7.51716 2Z" fill="#AEAEAE"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 295 B

2
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_hover.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 6C7.69534 6 7.78457 5.78457 7.65858 5.65858L4 2L0.341421 5.65858C0.215428 5.78457 0.304662 6 0.482843 6L7.51716 6Z" fill="#62646E"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 6C7.69534 6 7.78457 5.78457 7.65858 5.65858L4 2L0.341421 5.65858C0.215428 5.78457 0.304662 6 0.482843 6L7.51716 6Z" fill="#62646E"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 295 B

2
designer-base/src/main/resources/com/fr/design/standard/triangle.arrow/up_normal.svg

@ -1,3 +1,3 @@
<svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="10" height="10" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 6C7.69534 6 7.78457 5.78457 7.65858 5.65858L4 2L0.341421 5.65858C0.215428 5.78457 0.304662 6 0.482843 6L7.51716 6Z" fill="#AEAEAE"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.51716 6C7.69534 6 7.78457 5.78457 7.65858 5.65858L4 2L0.341421 5.65858C0.215428 5.78457 0.304662 6 0.482843 6L7.51716 6Z" fill="#AEAEAE"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 295 B

6
designer-realize/src/main/java/com/fr/design/cell/bar/DynamicScrollButton.java

@ -1,7 +1,7 @@
package com.fr.design.cell.bar; package com.fr.design.cell.bar;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgDrawUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -69,7 +69,7 @@ public class DynamicScrollButton extends BasicArrowButton {
private void paintArrow(Graphics g, Dimension size) { private void paintArrow(Graphics g, Dimension size) {
SvgPaintUtils.beforePaint((Graphics2D) g); SvgDrawUtils.beforeDraw((Graphics2D) g);
switch (direction) { switch (direction) {
case SwingConstants.NORTH: case SwingConstants.NORTH:
g.drawImage(UIConstants.ARROW_NORTH, 0, 0, this); g.drawImage(UIConstants.ARROW_NORTH, 0, 0, this);
@ -84,7 +84,7 @@ public class DynamicScrollButton extends BasicArrowButton {
g.drawImage(UIConstants.ARROW_WEST, 0, 0, this); g.drawImage(UIConstants.ARROW_WEST, 0, 0, this);
break; break;
} }
SvgPaintUtils.afterPaint((Graphics2D) g); SvgDrawUtils.afterDraw((Graphics2D) g);
} }

11
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/ProductNewsImagePanel.java

@ -2,19 +2,18 @@ package com.fr.design.mainframe.alphafine.component;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.svg.SVGLoader; import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.model.ProductNews; import com.fr.design.mainframe.alphafine.model.ProductNews;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgDrawUtils;
import javax.swing.JPanel;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.RenderingHints; import java.awt.RenderingHints;
import java.util.Set; import java.util.Set;
import javax.swing.JPanel;
/** /**
* @author hades * @author hades
@ -58,9 +57,9 @@ public class ProductNewsImagePanel extends JPanel {
} }
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet(); Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
if (!readSet.contains(productNews.getId())) { if (!readSet.contains(productNews.getId())) {
SvgPaintUtils.beforePaint(g2); SvgDrawUtils.beforeDraw(g2);
g2.drawImage(NEW_TIP_IMAGE, 0, 0, this); g2.drawImage(NEW_TIP_IMAGE, 0, 0, this);
SvgPaintUtils.afterPaint(g2); SvgDrawUtils.afterDraw(g2);
} }
g2.setColor(BACKGROUND_COLOR); g2.setColor(BACKGROUND_COLOR);

9
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java

@ -4,13 +4,14 @@ import com.fr.base.svg.SVGLoader;
import com.fr.base.svg.SystemScaleUtils; import com.fr.base.svg.SystemScaleUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.alphafine.AlphaFineUtil; import com.fr.design.mainframe.alphafine.AlphaFineUtil;
import com.fr.design.utils.SvgPaintUtils; import com.fr.design.utils.SvgDrawUtils;
import javax.swing.JPanel;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import javax.swing.JPanel;
/** /**
* @author hades * @author hades
@ -33,7 +34,7 @@ public class QuestionPane extends JPanel {
protected void paintComponent(Graphics g) { protected void paintComponent(Graphics g) {
super.paintComponent(g); super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g; Graphics2D g2 = (Graphics2D) g;
SvgPaintUtils.beforePaint(g2); SvgDrawUtils.beforeDraw(g2);
// 宽高保持 // 宽高保持
int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth(); int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth();
int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight(); int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight();
@ -47,7 +48,7 @@ public class QuestionPane extends JPanel {
int imageWidth = QUESTION_IMAGE.getWidth(this); int imageWidth = QUESTION_IMAGE.getWidth(this);
int imageHeight = QUESTION_IMAGE.getHeight(this); int imageHeight = QUESTION_IMAGE.getHeight(this);
g2.drawImage(QUESTION_IMAGE, (width - imageWidth) / 2 - 2, (height - imageHeight) / 2 - 2,this); g2.drawImage(QUESTION_IMAGE, (width - imageWidth) / 2 - 2, (height - imageHeight) / 2 - 2,this);
SvgPaintUtils.afterPaint(g2); SvgDrawUtils.afterDraw(g2);
} }

Loading…
Cancel
Save