Browse Source

REPORT-55748 【组件背景分离】组件复用-组件悬浮状态没有显示蓝色边框

final/10.0
hades 3 years ago
parent
commit
e421a9dfe5
  1. 10
      designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java

10
designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java

@ -2,12 +2,13 @@ package com.fr.design.mainframe;
import com.fr.base.GraphHelper;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants;
import com.fr.general.IOUtils;
import com.fr.stable.Constants;
import java.awt.BasicStroke;
import java.awt.Stroke;
import javax.swing.JComponent;
import java.awt.AlphaComposite;
import java.awt.Color;
@ -32,6 +33,8 @@ public class CoverPane extends JComponent {
protected static final int BORDER_WIDTH = 2;
public static final int EDIT_BTN_W = 75;
public static final int EDIT_BTN_H = 20;
private static final int BORDER_GAP = 2;
private static final BasicStroke BORDER_STROKE = new BasicStroke(2f);
public static void paintEditButton(Graphics g, Component component) {
int x = 0;
@ -82,6 +85,11 @@ public class CoverPane extends JComponent {
g2d.setColor(XCreatorConstants.COVER_COLOR);
g2d.fillRect(0, 0, component.getWidth(), component.getHeight());
g2d.setComposite(oldComposite);
g2d.setColor(XCreatorConstants.FORM_BORDER_COLOR);
Stroke oldStroke = g2d.getStroke();
g2d.setStroke(BORDER_STROKE);
g2d.drawRect(BORDER_GAP, BORDER_GAP, component.getWidth() - BORDER_GAP * 2, component.getHeight() - BORDER_GAP * 2);
g2d.setStroke(oldStroke);
}
public CoverPane() {

Loading…
Cancel
Save