diff --git a/designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java b/designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java index 5c80e2b167..f9aae2cc7a 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java @@ -1,15 +1,18 @@ package com.fr.design.dialog; +import com.fine.theme.utils.FineUIScale; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.iscrollbar.UIScrollBar; import javax.swing.JPanel; import javax.swing.JScrollBar; +import javax.swing.SwingUtilities; import java.awt.AWTEvent; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; +import java.awt.Window; import java.awt.LayoutManager; import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentListener; @@ -111,6 +114,16 @@ public abstract class BasicScrollPane extends BasicBeanPane{ doLayout(); } + /** + * parent.getHeight与最外层ChartPropertyPane获取的高度一致,都是计算的面板高度而不是到设计器底部的高度 + * 这里直接获取设计器高度减去单元格元素北区估算高度,先让滚动效果显示起来 + * @return height + */ + protected int getMaxHeight(){ + Window window = SwingUtilities.getWindowAncestor(this); + return window.getHeight() - FineUIScale.scale(400); + } + protected class BarLayout implements LayoutManager { @Override @@ -135,7 +148,7 @@ public abstract class BasicScrollPane extends BasicBeanPane{ @Override public void layoutContainer(Container parent) { - if(getHeight() >= leftcontentPane.getPreferredSize().height) { + if(getMaxHeight() >= leftcontentPane.getPreferredSize().height) { scrollBar.setEnabled(false); scrollBar.setVisible(false); } else { @@ -143,7 +156,7 @@ public abstract class BasicScrollPane extends BasicBeanPane{ scrollBar.setEnabled(show); scrollBar.setVisible(show); } - maxheight = getHeight() - DET_HEIGHT; + maxheight = getMaxHeight() - DET_HEIGHT; if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { beginY = 0; } else { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java index 48ba6f2d5e..52c2a0f59e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java @@ -3,15 +3,12 @@ */ package com.fr.design.mainframe; - -import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chartx.attr.ChartProvider; -import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.chart.BaseChartPropertyPane; @@ -20,10 +17,9 @@ import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.utils.gui.GUICoreUtils; -import javax.swing.BorderFactory; import javax.swing.Icon; -import javax.swing.SwingWorker; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; public class ChartPropertyPane extends BaseChartPropertyPane { @@ -45,8 +41,6 @@ public class ChartPropertyPane extends BaseChartPropertyPane { protected void initComponent() { this.setLayout(new BorderLayout()); this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); - // 外部轮廓大小固定,适配滚动面板 - this.setPreferredSize(new Dimension(getWidth(), FineUIScale.scale(900))); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 7a8dc38e65..862bcc9e7c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -55,8 +55,8 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { private static final int COLOR_REC_WIDTH = scale(30); protected static final int TEXTFIELD_HEIGHT = scale(20); protected static final int TEXTFIELD_WIDTH = scale(130); - protected static final int UPCONTROLPANE_WIDTH = scale(230); - private static final int LAYOUR_DET = 6; + protected static final int UPCONTROLPANE_WIDTH = scale(218); + private static final int LAYOUR_DET = scale(6); public static final double VALUE = 100; @@ -611,7 +611,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { @Override public void layoutContainer(Container parent) { upControlPane.setBounds(getBoundX(), getBoundY(), UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height + MARGIN_TOP); - stagePanel.setBounds(getBoundX(), upControlPane.getPreferredSize().height + LAYOUR_DET + getBoundY(), UPCONTROLPANE_WIDTH, stagePanel.getPreferredSize().height); + stagePanel.setBounds(getBoundX(), upControlPane.getPreferredSize().height + scale(8) + getBoundY(), UPCONTROLPANE_WIDTH, stagePanel.getPreferredSize().height); colorGroup.setBounds( getColorgroupMarginLeft (), 2 * getBoundY() + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); textGroup.setBounds(colorGroup.getPreferredSize().width + getColorgroupMarginLeft (), upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET + getBoundY(), textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); } diff --git a/designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java b/designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java index c68fd09ca0..f8a4f153d4 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java @@ -4,6 +4,7 @@ import com.fine.swing.ui.layout.Layouts; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIScale; import com.fr.design.constants.LayoutConstants; +import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itextfield.UITextField; @@ -42,14 +43,17 @@ public class CustomSequencePane extends JPanel { @Override public void mouseClicked(MouseEvent e) { CustomSequenceEditPane customSequenceEditPane = new CustomSequenceEditPane(customSequence); - customSequenceEditPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + BasicDialog dialog = customSequenceEditPane.showWindowWithCustomSize(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { @Override public void doOk() { customSequence = customSequenceEditPane.updateBean(); triggerOk(CustomSequenceSortExpression.customSequenceToString(customSequence, ","), CustomSequenceSortExpression.isReferenceCustomSequence(customSequence)); } - }, new Dimension(700, 420)).setVisible(true); + }, FineUIScale.scale(new Dimension(700, 420))); + dialog.setAlwaysOnTop(true); + dialog.requestFocusInWindow(); + dialog.setVisible(true); } }; button.addMouseListener(mouseAdapter);