Browse Source

Pull request #14607: REPORT-130759 - 单元格元素-标题-布局-自定义悬浮位置显示不全

Merge in DESIGN/design from ~RENEKTON/design:newui to newui

* commit 'bceaac2fc72f964f398932532d2e88ee6559ffb1':
  边框问题
  气泡弹窗
newui
Renekton-张世豪 4 months ago
parent
commit
9a738450cc
  1. 39
      designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java
  2. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  3. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

39
designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java

@ -1,5 +1,7 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.SystemInfo;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.utils.AWTUtilities; import com.fr.design.utils.AWTUtilities;
@ -9,15 +11,22 @@ import com.fr.stable.Constants;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.BasicStroke;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point; import java.awt.Point;
import java.awt.Polygon; import java.awt.Polygon;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Shape; import java.awt.Shape;
import java.awt.Stroke;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.Window; import java.awt.Window;
import java.awt.event.AWTEventListener; import java.awt.event.AWTEventListener;
@ -319,7 +328,7 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
final JPanel contentPane = (JPanel) this.getContentPane(); final JPanel contentPane = (JPanel) this.getContentPane();
this.setLayout(null); this.setLayout(null);
contentPane.add(UIBubbleFloatPane.this); contentPane.add(UIBubbleFloatPane.this);
contentPane.setBorder(null); setContentBorder(contentPane);
} }
/** /**
@ -328,5 +337,33 @@ public abstract class UIBubbleFloatPane<T> extends BasicBeanPane<T> {
public void checkValid() throws Exception { public void checkValid() throws Exception {
} }
private void setContentBorder(JPanel contentPane) {
if (SystemInfo.isWindows) {
contentPane.setBorder(new Border() {
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Graphics2D g2d = (Graphics2D) g;
Stroke oldStroke = g2d.getStroke();
g2d.setStroke(new BasicStroke(2, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
g2d.setColor(FineUIUtils.getUIColor("Label.borderColor", "Label.borderColor"));
g2d.drawPolygon((Polygon) getShape4Board());
g2d.setStroke(oldStroke);
}
@Override
public Insets getBorderInsets(Component c) {
return null;
}
@Override
public boolean isBorderOpaque() {
return false;
}
});
} else {
contentPane.setBorder(null);
}
}
} }
} }

9
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -45,6 +45,7 @@ import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
/** /**
* 属性表, 图表样式-图例 界面. * 属性表, 图表样式-图例 界面.
@ -52,9 +53,9 @@ import static com.fine.swing.ui.layout.Layouts.row;
public class VanChartPlotLegendPane extends BasicPane { public class VanChartPlotLegendPane extends BasicPane {
private static final long serialVersionUID = 1614283200308877353L; private static final long serialVersionUID = 1614283200308877353L;
private static final int WIDTH = FineUIScale.scale(165); private static final int WIDTH = scale(165);
private static final int HEIGHT = FineUIScale.scale(100); private static final int HEIGHT = scale(100);
private static final int GAP = 20; private static final int GAP = scale(20);
private Plot plot; private Plot plot;
@ -161,7 +162,7 @@ public class VanChartPlotLegendPane extends BasicPane {
backgroundPane = creatBackgroundPane(); backgroundPane = creatBackgroundPane();
fixedCheckPane = createFixedCheckPane(); fixedCheckPane = createFixedCheckPane();
JPanel panel = new JPanel(); JPanel panel = new JPanel();
panel.setLayout(new BorderLayout(0, FineUIScale.scale(10))); panel.setLayout(new BorderLayout(0, scale(10)));
panel.add(createDisplayStrategy(), BorderLayout.CENTER); panel.add(createDisplayStrategy(), BorderLayout.CENTER);
panel.add(fixedCheckPane, BorderLayout.SOUTH); panel.add(fixedCheckPane, BorderLayout.SOUTH);

7
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -47,14 +47,15 @@ import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIScale.scale;
// 属性表-样式 标题界面 // 属性表-样式 标题界面
public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> { public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private static final long serialVersionUID = -2438898431228882682L; private static final long serialVersionUID = -2438898431228882682L;
private static final int WIDTH = FineUIScale.scale(165); private static final int WIDTH = scale(165);
private static final int HEIGHT = FineUIScale.scale(100); private static final int HEIGHT = scale(100);
private static final int GAP = FineUIScale.scale(20); private static final int GAP = scale(20);
private UICheckBox isTitleVisible; private UICheckBox isTitleVisible;
private JPanel titlePane; private JPanel titlePane;

Loading…
Cancel
Save