From 87382872c296627eefb731819261915963f67d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Tue, 3 Sep 2024 15:47:52 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-133037=20fix:=E8=87=AA=E5=8A=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=9D=A2=E6=9D=BF=E4=BF=AE=E5=A4=8D&=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controlpane/UISimpleListControlPane.java | 18 +++---------- .../chart/designer/other/AutoRefreshPane.java | 26 +++++++++++-------- .../other/AutoRefreshPaneWithoutTooltip.java | 9 +++---- .../other/VanChartInteractivePane.java | 3 ++- .../designer/mobile/ParaMobileDefinePane.java | 18 +++---------- 5 files changed, 27 insertions(+), 47 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java index 79c96067fe..c6536e138b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java @@ -2,13 +2,13 @@ package com.fr.design.gui.controlpane; import com.fine.theme.icon.LazyIcon; import com.fr.design.actions.UpdateAction; +import com.fr.design.border.FineBorderFactory; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.UIList; -import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.menu.ShortCut; @@ -22,7 +22,6 @@ import sun.swing.DefaultLookup; import javax.swing.BorderFactory; import javax.swing.DefaultListModel; -import javax.swing.JComponent; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.ListCellRenderer; @@ -33,8 +32,6 @@ import javax.swing.event.ListSelectionListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; -import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.Point; import java.awt.Toolkit; import java.awt.event.ActionEvent; @@ -89,22 +86,14 @@ public class UISimpleListControlPane extends BasicPane { toolbarDef.addShortCut(sj.getShortCut()); } toolBar = ToolBarDef.createJToolBar(); - toolBar.setUI(new UIToolBarUI(){ - @Override - public void paint(Graphics g, JComponent c) { - Graphics2D g2 = (Graphics2D) g; - g2.setColor(Color.WHITE); - g2.fillRect(0, 0, c.getWidth(), c.getHeight()); - } - }); toolbarDef.updateToolBar(toolBar); // 封装一层,加边框 JPanel toolBarPane = new JPanel(new BorderLayout()); toolBarPane.add(toolBar, BorderLayout.CENTER); - toolBarPane.setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1, UIConstants.RULER_LINE_COLOR)); + toolBarPane.setBorder(FineBorderFactory.createDefaultUnderlineBorder()); listPane.add(toolBarPane, BorderLayout.NORTH); - + contentPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); return contentPane; } @@ -420,7 +409,6 @@ public class UISimpleListControlPane extends BasicPane { private void initComponents() { label = new UILabel(); -// label.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 0)); initialLabelForeground = label.getForeground(); this.setLayout(new BorderLayout()); this.add(label, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java index 2f94ab42f7..77c7be9dd8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java @@ -18,6 +18,7 @@ import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; +import org.jetbrains.annotations.Nullable; import javax.swing.JPanel; import javax.swing.SwingUtilities; @@ -82,28 +83,22 @@ public class AutoRefreshPane extends BasicBeanPane { initTooltipSet(); - JPanel jPanel = new JPanel(new BorderLayout()); - jPanel.add(autoTooltip, BorderLayout.CENTER); - jPanel.add(tooltipSet, BorderLayout.EAST); + JPanel tipPane = getTooltipPane(); JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")), moreLabel); - Component[][] components = initComponent(jPanel); - JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + Component[][] components = initComponent(tipPane); contentPane = new JPanel(new BorderLayout()); - contentPane.add(panel1, BorderLayout.CENTER); + contentPane.add(FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}), BorderLayout.CENTER); - Component[][] AutoTooltipComponent = initAutoTooltipComponent(); - JPanel panel2 = FineLayoutBuilder.compatibleTableLayout(10, AutoTooltipComponent, new double[]{1.2, 2, 1}); - contentPane.add(panel2, BorderLayout.SOUTH); return FineLayoutBuilder.createVerticalLayout(10, moreLabelPane, contentPane); } protected Component[][] initComponent(JPanel autoTooltipPane){ - Column toolTipPane = column(10, + Column centerPane = column(10, row( cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval"))), flex(), @@ -114,11 +109,20 @@ public class AutoRefreshPane extends BasicBeanPane { ).getComponent(); return new Component[][]{ - new Component[]{null, toolTipPane} + new Component[]{null, centerPane} }; } + @Nullable + protected JPanel getTooltipPane() { + JPanel tipPane = new JPanel(new BorderLayout()); + tipPane.add(autoTooltip, BorderLayout.CENTER); + tipPane.add(tooltipSet, BorderLayout.EAST); + return tipPane; + } + + @Deprecated protected Component[][] initAutoTooltipComponent () { return new Component[][]{ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java index 21cfe6443f..845c15dbc4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPaneWithoutTooltip.java @@ -3,7 +3,7 @@ package com.fr.van.chart.designer.other; import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.vanchart.VanChart; -import java.awt.Component; +import javax.swing.JPanel; /** * Created by mengao on 2017/6/21. @@ -14,10 +14,9 @@ public class AutoRefreshPaneWithoutTooltip extends AutoRefreshPane { super(chart, isLargeModel); } - protected Component[][] initAutoTooltipComponent () { - return new Component[][]{ - new Component[]{null, null}, - }; + @Override + protected JPanel getTooltipPane() { + return null; } protected void updateAutoTooltip(RefreshMoreLabel refreshMoreLabel) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index 334104128c..c0018a5919 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -281,7 +281,8 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { //图表缩放新设计 恢复用注释。删除下面八个方法getzoomTypePane createZoomPaneContent // checkZoomEnabled getNameArray getValueArray checkZoomPane populateChartZoom updateChartZoom。 protected JPanel getZoomTypePane(UIButtonGroup zoomType) { - return TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction"), zoomType); + return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Direction")), zoomType); } protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, VanChartPlot plot) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index 1682985261..d2a9bb4f73 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -1,7 +1,7 @@ package com.fr.design.widget.ui.designer.mobile; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.properties.PropertyTab; @@ -10,8 +10,6 @@ import com.fr.design.fun.ParameterExpandablePaneUIProvider; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.MobileWidgetListPane; import com.fr.design.mainframe.WidgetPropertyPane; @@ -22,7 +20,6 @@ import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.mobile.MobileParamStyle; import com.fr.report.mobile.EmptyMobileParamStyle; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -68,25 +65,16 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { // 手机属性 private UIExpandablePane getMobilePropertyPane() { mobileParamEditor = new AccessibleMobileParamEditor(new MobileParamSettingPane()); - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p}; - double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Param_Style")), mobileParamEditor}, }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); - JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); - jPanel.add(panel); - return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile"), 280, 20, jPanel); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile"), 280, 20, panel); } // 控件顺序 private UIExpandablePane getMobileWidgetListPane() { mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); - mobileWidgetListPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 5, 0)); JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); panelWrapper.add(mobileWidgetListPane, BorderLayout.CENTER);