From 0f4cae075fc9ee2387b748b385386e32958873da Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 13 Oct 2020 09:53:14 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-40853=20=E6=8F=90=E4=BA=A4=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E7=BB=84=E5=A4=9A=E6=AC=A1=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB=20&&=20REPORT-40843=20=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C=E7=82=B9=E5=87=BB=E5=88=B0?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F-=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C?= =?UTF-8?q?=E6=9C=80=E5=B0=8F=E5=8C=96=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E6=89=93=E5=BC=80=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=B4=A9?= =?UTF-8?q?=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/gradient/GradientBackgroundPane.java | 3 ++- .../design/style/background/gradient/GradientBar.java | 10 +++++++++- .../com/fr/design/write/submit/DBManipulationPane.java | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java index 59aed2a6f..1cbf543a4 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java @@ -26,6 +26,7 @@ import java.awt.event.ActionListener; */ public class GradientBackgroundPane extends BackgroundDetailPane { private static final long serialVersionUID = -6854603990673031897L; + public static final int DEFAULT_GRADIENT_WIDTH = 254; private UIRadioButton left2right, top2bottom; private GradientBar gradientBar; @@ -41,7 +42,7 @@ public class GradientBackgroundPane extends BackgroundDetailPane { // neil:增加渐变色拖动条 JPanel gradientPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel blankJp = new JPanel(); - gradientBar = new GradientBar(4, 254); + gradientBar = new GradientBar(4, DEFAULT_GRADIENT_WIDTH); blankJp.add(gradientBar); UILabel jl = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient")); jl.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index 46d1b9165..b088864c0 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -192,7 +192,15 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab } float[] dist = new float[list.size()]; for (int i = 0; i < list.size(); i++) { - dist[i] = (float) ((list.get(i).getX() - 4) / (max - 4)); + double value = list.get(i).getX() - 4; + double defaultMax = max - 4; + if (Double.compare(value, defaultMax) > 0) { + // 设置了预定义的渐变色 渐变色起始位置比较大 然后由预定义样式切换到自定义样式 做下等比例转换 + dist[i] = (float) (value / (GradientBackgroundPane.DEFAULT_GRADIENT_WIDTH - 4)); + list.get(i).setX(max * dist[i]); + } else { + dist[i] = (float) (value / defaultMax); + } } LinearGradientPaint paint = new LinearGradientPaint(start, end, dist, c); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 590f9d112..ccf01dd5e 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -53,6 +53,7 @@ import javax.swing.BorderFactory; import javax.swing.DefaultCellEditor; import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; +import javax.swing.JFrame; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -867,13 +868,14 @@ public class DBManipulationPane extends BasicBeanPane { textLabel = new UILabel(); textLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { + vPaneDLG.setAlwaysOnTop(true); vPaneDLG.setVisible(true); } }); vPane = new ValuePane(types); - vPaneDLG = vPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + vPaneDLG = vPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { public void doOk() { fireEditingStopped(); // Make the renderer // reappear.