Browse Source

REPORT-130724 & REPORT-130807【newUI】fix:东区单元格元素滚动条问题及视觉问题修复

fbp-1.0^2
Richard.Fang 3 months ago
parent
commit
f1bb98d807
  1. 17
      designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java
  2. 10
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  3. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  4. 8
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java

17
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<T> extends BasicBeanPane<T>{
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<T> extends BasicBeanPane<T>{
@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<T> extends BasicBeanPane<T>{
scrollBar.setEnabled(show);
scrollBar.setVisible(show);
}
maxheight = getHeight() - DET_HEIGHT;
maxheight = getMaxHeight() - DET_HEIGHT;
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
beginY = 0;
} else {

10
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

6
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);
}

8
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);

Loading…
Cancel
Save