From c00b7db525fa89929de4307d0014338d515e898f Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 14 Aug 2020 11:19:50 +0800 Subject: [PATCH 01/13] =?UTF-8?q?CHART-15054=20=E8=B0=83=E6=95=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9D=A2=E6=9D=BF=E6=A0=87=E7=AD=BE=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/SeriesNameUseFieldValuePane.java | 18 +++++++++++------- .../report/BoxPlotReportDataContentPane.java | 2 +- .../BoxPlotTableResultDataSeriesPane.java | 2 +- ...oxPlotTableSeriesNameUseFieldValuePane.java | 7 +++++++ .../data/table/UIComboBoxWithEditLabel.java | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index 8511430b34..889e6f5302 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -99,13 +99,13 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane Date: Fri, 14 Aug 2020 11:27:05 +0800 Subject: [PATCH 02/13] =?UTF-8?q?CHART-15096=20=E6=9D=A1=E4=BB=B6=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=95=B0=E6=8D=AE=E8=A1=A8=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasheet/VanchartDataSheetNoCheckPane.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java index e5471e59f4..a9e915ff52 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java @@ -1,10 +1,12 @@ package com.fr.van.chart.designer.style.datasheet; import com.fr.chart.chartglyph.DataSheet; +import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.plugin.chart.base.AttrDataSheet; import javax.swing.JPanel; import java.awt.Component; +import java.awt.Container; /** * Created by mengao on 2017/5/24. @@ -19,6 +21,18 @@ public class VanchartDataSheetNoCheckPane extends VanChartDataSheetPane { return components; } + protected void layoutContentPane() { + leftcontentPane = createContentPane(); + this.add(leftcontentPane); + } + + protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) { + int width = parent.getWidth(); + int height = parent.getHeight(); + scrollBar.setBounds(0, 0, 0, 0); + leftcontentPane.setBounds(0, 0, width, height); + } + public void populate(AttrDataSheet attrDataSheet) { populate(attrDataSheet.getDataSheet()); } From c87e9f6e70b080efbc679d5d16d74277d0ad2737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 14 Aug 2020 11:28:40 +0800 Subject: [PATCH 03/13] =?UTF-8?q?CHART-15096=20=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/datasheet/VanchartDataSheetNoCheckPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java index a9e915ff52..cc47a3fc1e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanchartDataSheetNoCheckPane.java @@ -21,11 +21,13 @@ public class VanchartDataSheetNoCheckPane extends VanChartDataSheetPane { return components; } + @Override protected void layoutContentPane() { leftcontentPane = createContentPane(); this.add(leftcontentPane); } + @Override protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) { int width = parent.getWidth(); int height = parent.getHeight(); From f565b41d0bbf12bae3f8bf4758f08e98c9a788bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 14 Aug 2020 13:54:00 +0800 Subject: [PATCH 04/13] =?UTF-8?q?CHART-14800=20=E5=9B=BE=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=8A=A0=E8=BD=BD=E6=85=A2=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=BA=86=E6=9C=8D=E5=8A=A1=E8=8F=9C=E5=8D=95=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E7=82=B9=E5=87=BB=E7=BC=BA=E5=B0=91=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/chart/ChartDesignerActivator.java | 7 ----- .../main/java/com/fr/start/MainDesigner.java | 26 +++++++------------ 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java index 098b965d06..0cd81f783e 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java @@ -6,9 +6,7 @@ import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.ChartPropertyPane; -import com.fr.design.module.ChartEmptyDataStyleAction; import com.fr.design.module.ChartHyperlinkGroup; -import com.fr.design.module.ChartPreStyleAction; import com.fr.design.module.DesignModuleFactory; import com.fr.form.ui.ChartEditor; import com.fr.locale.InterMutableKey; @@ -20,7 +18,6 @@ import com.fr.plugin.chart.vanchart.export.ImagePainter; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.DownloadOnlineSourcesHelper; -import com.fr.van.chart.map.server.ChartMapEditorAction; /** * Created by juhaoyu on 2018/6/27. @@ -43,10 +40,6 @@ public class ChartDesignerActivator extends Activator implements Prepare { DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); - ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); - ActionFactory.registerChartEmptyDataStyleAction(new ChartEmptyDataStyleAction()); - ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); - ActionFactory.registerChartCollection(ChartCollection.class); DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 0020514f2d..ff3aadd36b 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -3,7 +3,6 @@ package com.fr.start; import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.newReport.NewPolyReportAction; import com.fr.design.actions.file.newReport.NewWorkBookAction; @@ -34,6 +33,8 @@ import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ShortCut; +import com.fr.design.module.ChartEmptyDataStyleAction; +import com.fr.design.module.ChartPreStyleAction; import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; @@ -54,23 +55,24 @@ import com.fr.stable.xml.XMLTools; import com.fr.start.module.StartupArgs; import com.fr.start.server.ServerTray; import com.fr.third.org.apache.commons.lang3.time.StopWatch; +import com.fr.van.chart.map.server.ChartMapEditorAction; import com.fr.workspace.WorkContext; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.border.MatteBorder; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Insets; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.io.File; import java.util.ArrayList; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class MainDesigner extends BaseDesigner { @@ -160,15 +162,7 @@ public class MainDesigner extends BaseDesigner { if (WorkContext.getCurrent().isRoot()) { menuDef.addShortCut(new ServerConfigManagerAction(), new StyleListAction(), new WidgetManagerAction()); - if (ActionFactory.getChartPreStyleAction() != null) { - menuDef.addShortCut(ActionFactory.getChartPreStyleAction()); - } - if (ActionFactory.getChartEmptyDataStyleAction() != null) { - menuDef.addShortCut(ActionFactory.getChartEmptyDataStyleAction()); - } - if (ActionFactory.getChartMapEditorAction() != null) { - menuDef.addShortCut(ActionFactory.getChartMapEditorAction()); - } + menuDef.addShortCut(new ChartPreStyleAction(), new ChartEmptyDataStyleAction(),new ChartMapEditorAction()); } insertMenu(menuDef, MenuHandler.SERVER); From 7150ffee7a5ee992ee1b095e16fabafb7ca6be4f Mon Sep 17 00:00:00 2001 From: Harrison Date: Fri, 14 Aug 2020 16:23:31 +0800 Subject: [PATCH 05/13] =?UTF-8?q?REPORT-37487=20&&=20REPORT-37484=201?= =?UTF-8?q?=E3=80=81=E5=9B=9E=E5=A4=8D=20result=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=20$$$=20=E3=80=82=202=E3=80=81=E5=92=8C=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=B2=9F=E9=80=9A=EF=BC=8C=E5=B0=86=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=88=86=E5=88=AB=E9=BB=98=E8=AE=A4=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=20=3D=20=E5=92=8C=E4=B8=8D=E5=B1=95=E7=A4=BA=20=3D=20?= =?UTF-8?q?3=E3=80=81=E6=81=A2=E5=A4=8D=E6=95=B0=E6=8D=AE=E7=9A=84?= =?UTF-8?q?=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/formula/FormulaTextField.java | 33 +++++++++++++++++-- .../fr/design/formula/SortFormulaPane.java | 2 +- .../design/formula/FormulaTextFieldTest.java | 28 ++++++++++++++++ .../design/dscolumn/DSColumnAdvancedPane.java | 11 +++---- .../cellquick/CellDSColumnEditor.java | 8 ++--- 5 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java index 146085e3da..6294a7a3bd 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java @@ -16,7 +16,9 @@ import javax.swing.text.Document; **/ public class FormulaTextField extends DictionaryTextField { - private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build("="); + private static final String EMPTY_STRING = "="; + + private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build(EMPTY_STRING); public FormulaTextField() { } @@ -43,7 +45,15 @@ public class FormulaTextField extends DictionaryTextField { if (this.value == null) { this.value = createDefault(); } - return this.value; + //保持联动 + linkValueByText(); + return value; + } + + private void linkValueByText() { + + String content = getText(); + this.value.setContent(content); } /** @@ -58,7 +68,24 @@ public class FormulaTextField extends DictionaryTextField { if (this.value == null) { this.value = createDefault(); } - setText(this.value.getPureContent()); + } + + /** + * 是需要设置不带 = 号,还是带 = 号。 + * + * @param value 值 + * @param isPure 带不带 = 号, 是 = 不带, 否 = 带。 + */ + public void setValueAndText(BaseFormula value, boolean isPure) { + + setValue(value); + String content = null; + if (isPure) { + content = this.value.getPureContent(); + } else { + content = this.value.getContent(); + } + setText(content); } private BaseFormula createDefault() { diff --git a/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java index 4d598a7e25..7b6e536fc2 100644 --- a/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/SortFormulaPane.java @@ -64,7 +64,7 @@ public abstract class SortFormulaPane extends JPanel { public void doOk() { BaseFormula fm = formulaPane.update(); if (fm != null) { - sortFormulaTextField.setValue(fm); + sortFormulaTextField.setValueAndText(fm, true); } } }).setVisible(true); diff --git a/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java b/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java new file mode 100644 index 0000000000..8c58f6023d --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/formula/FormulaTextFieldTest.java @@ -0,0 +1,28 @@ +package com.fr.design.formula; + +import com.fr.base.BaseFormula; +import org.junit.Assert; +import org.junit.Test; + +import static org.junit.Assert.*; + +public class FormulaTextFieldTest { + + @Test + public void testSet() { + + FormulaTextField field = new FormulaTextField(); + BaseFormula aaaa = BaseFormula.createFormulaBuilder().build("aaaa"); + field.setValueAndText(aaaa, true); + + Assert.assertEquals("aaaa", field.getText()); + + field.setValueAndText(aaaa, false); + Assert.assertEquals("=aaaa", field.getText()); + + field.setText("bbbb"); + BaseFormula formula = field.getValue(); + Assert.assertEquals("bbbb", formula.getPureContent()); + } + +} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 07eefdd2bd..58636917cd 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -257,7 +257,7 @@ public class DSColumnAdvancedPane extends BasicPane { this.sortOrderComboBox.setSortOrder(new SortOrder(sort)); BaseFormula sortFormulaObject = dSColumn.getSortFormulaObject(); - sortFormulaTextField.setValue(sortFormulaObject); + sortFormulaTextField.setValueAndText(sortFormulaObject, true); } public void update(CellElement cellElement) { @@ -421,7 +421,7 @@ public class DSColumnAdvancedPane extends BasicPane { this.add(bottomLabel); formulaTextField = new FormulaTextField(24); this.add(formulaTextField); - formulaTextField.setValue(defaultFormula); + formulaTextField.setValueAndText(defaultFormula, true); UIButton bottomFrmulaButton = new UIButton("..."); this.add(bottomFrmulaButton); @@ -444,8 +444,7 @@ public class DSColumnAdvancedPane extends BasicPane { public void populateFormula(BaseFormula baseFormula) { - this.formulaTextField.setValue(baseFormula); - this.formulaTextField.setText(baseFormula.getPureContent()); + this.formulaTextField.setValueAndText(baseFormula, true); } public BaseFormula getFormula() { @@ -481,9 +480,9 @@ public class DSColumnAdvancedPane extends BasicPane { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { - formulaTextField.setValue(defaultFormula); + formulaTextField.setValueAndText(defaultFormula, true); } else { - formulaTextField.setValue(valueFormula); + formulaTextField.setValueAndText(valueFormula, true); } } }).setVisible(true); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 983fbb9da7..d9b8f1e7a0 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -1070,7 +1070,7 @@ public class CellDSColumnEditor extends CellQuickEditor { this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); formulaTextField = new FormulaTextField(); - formulaTextField.setValue(defaultFormula); + formulaTextField.setValueAndText(defaultFormula, false); JPanel textFieldPane = new JPanel(new BorderLayout()); textFieldPane.add(formulaTextField, BorderLayout.CENTER); @@ -1101,7 +1101,7 @@ public class CellDSColumnEditor extends CellQuickEditor { public void populateFormula(BaseFormula baseFormula) { - this.formulaTextField.setValue(baseFormula); + this.formulaTextField.setValueAndText(baseFormula, false); } public BaseFormula getFormula() { @@ -1145,9 +1145,9 @@ public class CellDSColumnEditor extends CellQuickEditor { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { - formulaTextField.setValue(defaultFormula); + formulaTextField.setValueAndText(defaultFormula, false); } else { - formulaTextField.setValue(valueFormula); + formulaTextField.setValueAndText(valueFormula, false); } } }).setVisible(true); From 7cc9abc8586ea9cd6226447572aec980d0b3c2aa Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 14 Aug 2020 16:30:13 +0800 Subject: [PATCH 06/13] =?UTF-8?q?REPORT-37460=20&&=20REPORT-37526=20?= =?UTF-8?q?=E3=80=90frm=E8=AE=BE=E8=AE=A1=E7=95=8C=E9=9D=A2=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=BC=A9=E6=94=BE=E3=80=91=E6=A8=A1=E6=9D=BF=E6=94=BE?= =?UTF-8?q?=E5=A4=A7=E5=90=8E=EF=BC=8C=E7=82=B9=E5=87=BB=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E7=BC=96=E8=BE=91=EF=BC=8C=E5=8F=8C=E5=87=BB=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E7=94=9F=E6=95=88=EF=BC=8C=E7=BC=A9=E5=B0=8F=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF100%=EF=BC=8C=E5=8D=95=E5=87=BB=E5=B0=B1=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/EditingMouseListener.java | 16 ++++++++-------- .../java/com/fr/design/mainframe/FormArea.java | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 0f3af7537a..3ef72242a7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -327,8 +327,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.getCursor().getType() == Cursor.HAND_CURSOR) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } // component.getParent() 是报表块所在的XWTitleLayout - int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); + int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -342,8 +342,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (component.getCoverPane() != null) { if (component.getCoverPane().getComponentCount() > 1) { JComponent button1 = (JComponent) component.getCoverPane().getComponent(1); - int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); - int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); + int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); + int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + button1.getWidth()) { if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + button1.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -358,8 +358,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (StringUtils.isEmpty(component.toData().getDescription())) { return; } - int minX1 = getParentPositionX(component, component.getX()) + component.getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW - designer.getArea().getHorizontalValue(); - int minY1 = getParentPositionY(component, component.getY()) - designer.getArea().getVerticalValue(); + int minX1 = getParentPositionX(component, component.getX()) + component.getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW - designer.getHorizontalScaleValue(); + int minY1 = getParentPositionY(component, component.getY()) - designer.getVerticalScaleValue(); if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) { if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -426,8 +426,8 @@ public class EditingMouseListener extends MouseInputAdapter { if (designer.getCursor().getType() == Cursor.HAND_CURSOR) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } - int minX = button.getX() + getParentPositionX(component, 0) - designer.getArea().getHorizontalValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getArea().getVerticalValue(); + int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); + int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue(); if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 967cabd06f..f127f8ea0d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -773,7 +773,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { heightPane.setValue(height); reCalculateHeight((int) height); } - if (designer.getRootComponent().acceptType(XWFitLayout.class) && AssistUtils.equals(slide, DEFAULT_SLIDER) ) { + if (designer.getRootComponent().acceptType(XWFitLayout.class) && AssistUtils.equals(screenValue, DEFAULT_SLIDER) ) { XWFitLayout layout = (XWFitLayout) designer.getRootComponent(); // 撤销时先refreshRoot了,此处去掉内边距再增加间隔 layout.moveContainerMargin(); From 3fb194e0e2e6fa763dcc028e81fd4ee0848b07fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 14 Aug 2020 18:07:42 +0800 Subject: [PATCH 07/13] =?UTF-8?q?CHART-15112=20=E6=97=B6=E9=97=B4=E8=BD=B4?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E7=8E=AF=E5=A2=83=E5=B0=91=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/designer/style/axis/VanChartTimeAxisPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java index b57f0fc2f3..212e8b1fa0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java @@ -162,8 +162,8 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { JPanel mainTickPane = new JPanel(); mainTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); - mainUnitField.setPreferredSize(new Dimension(100,20)); - secondUnitField.setPreferredSize(new Dimension(100,20)); + mainUnitField.setPreferredSize(new Dimension(80,20)); + secondUnitField.setPreferredSize(new Dimension(80,20)); mainTickPane.add(mainUnitField); mainTickPane.add(mainType); From 672ef252d42449af04baba48a81393f4410505fa Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 14 Aug 2020 19:47:00 +0800 Subject: [PATCH 08/13] =?UTF-8?q?REPORT-37289=20=E3=80=9010.0.9=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91frm=E6=A8=A1=E6=9D=BFtab=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=86=85=E8=BF=9B=E8=A1=8C=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E6=9D=A5=E5=9B=9E=E7=82=B9=E5=87=BB=E5=88=87=E6=8D=A2?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E7=8E=B0=E4=BC=9A=E5=81=B6=E7=84=B6=E7=9A=84?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=A4=B1=E6=95=88=E6=88=96=E5=8D=A1=E9=A1=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/EditingMouseListener.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 3ef72242a7..d8234c2b1d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -79,6 +79,9 @@ public class EditingMouseListener extends MouseInputAdapter { //备份开始拖动的位置和大小 private Rectangle dragBackupBounds; + private int pressX; + private int pressY; + /** * 获取最小移动距离 * @@ -141,6 +144,8 @@ public class EditingMouseListener extends MouseInputAdapter { public void mousePressed(MouseEvent e) { int oldX = e.getX(); int oldY = e.getY(); + pressX = oldX; + pressY = oldY; offsetEventPoint(e); if (!stopEditing()) { return; @@ -189,6 +194,7 @@ public class EditingMouseListener extends MouseInputAdapter { * @param e 鼠标事件 */ public void mouseReleased(MouseEvent e) { + MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); int oldX = e.getX(); int oldY = e.getY(); offsetEventPoint(e); @@ -213,6 +219,12 @@ public class EditingMouseListener extends MouseInputAdapter { lastPressEvent = null; lastXCreator = null; e.translatePoint(oldX - e.getX(), oldY - e.getY()); + if (pressX != oldX || pressY != oldY) { + // click只有在mouseReleased和mousePressed前后x/y坐标相等时才会被触发在mouseReleased之后 + // 但是当使用者来回点击切换时 存在mouseReleased和mousePressed前后x/y坐标不相等的情况 即鼠标按下去的位置和鼠标释放的位置不相等 存在偏移 + // 当这种偏移很小时 看起来就好像是点击了 实际上是手抖了或者鼠标轻微滑动了 所以这里对这种情况要有容错处理 + mouseClicked(transEvent); + } } private void mouseDraggingRelease(MouseEvent e) { From 42ec0d8bba5241c5cd06cccdf994c43f3c5be20c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 16 Aug 2020 12:14:37 +0800 Subject: [PATCH 09/13] =?UTF-8?q?CHART-15056=20=E4=BD=BF=E7=94=A8LinkedHas?= =?UTF-8?q?hMap=E4=BF=9D=E8=AF=81=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/condition/ConditionAttributesPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 781c57b052..6ca4ed6808 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -15,8 +15,9 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JScrollPane; import java.awt.Dimension; -import java.util.HashMap; import java.util.Iterator; +import java.util.Map; +import java.util.LinkedHashMap; @Open public abstract class ConditionAttributesPane extends BasicBeanPane { @@ -27,7 +28,7 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { protected LiteConditionPane liteConditionPane; - protected java.util.Map classPaneMap = new HashMap(); + protected Map classPaneMap = new LinkedHashMap<>(); //可用的Actions. protected java.util.List useAbleActionList = new java.util.ArrayList(); @@ -70,7 +71,7 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); propertyChangePane.add(selectedItemScrollPane); } - + public void updateBean(T ob) { updateMenuDef(); } From d23640845ad96181e781ca69fd4af053369c9f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 17 Aug 2020 08:59:02 +0800 Subject: [PATCH 10/13] =?UTF-8?q?CHART-15112=20=E5=88=BB=E5=BA=A6=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/designer/style/axis/VanChartTimeAxisPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java index 212e8b1fa0..69a326ac44 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java @@ -162,8 +162,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { JPanel mainTickPane = new JPanel(); mainTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); - mainUnitField.setPreferredSize(new Dimension(80,20)); - secondUnitField.setPreferredSize(new Dimension(80,20)); + + int width = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH - (int) Math.ceil(mainType.getPreferredSize().getWidth()); + mainUnitField.setPreferredSize(new Dimension(width,20)); + secondUnitField.setPreferredSize(new Dimension(width,20)); mainTickPane.add(mainUnitField); mainTickPane.add(mainType); From 71078002fe599dbe0aa27437af47d90683b4dd64 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 17 Aug 2020 09:13:36 +0800 Subject: [PATCH 11/13] =?UTF-8?q?REPORT-37289=20=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=8Bnpe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/parameter/ParameterPropertyPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java index e3d5f46e4e..ddab3a305e 100644 --- a/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java @@ -1,5 +1,6 @@ package com.fr.design.parameter; +import com.fr.base.Parameter; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XWParameterLayout; @@ -124,7 +125,8 @@ public class ParameterPropertyPane extends JPanel{ hideInJForm = jt instanceof JForm && !(creator instanceof XWParameterLayout || creator.getParent() instanceof XWParameterLayout); } catch (NullPointerException ex) { - hideInJForm = toolbarPane.updateBean().length <= 0; + Parameter[] parameters = toolbarPane.updateBean(); + hideInJForm = parameters == null || parameters.length <= 0; } if (isVisible && toolbarPane.hasSelectedLabelItem() && !hideInJForm) { addParaPane.setVisible(true); From 185f936457130e5e66ef29cf4271713597a5e7ab Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 17 Aug 2020 11:23:50 +0800 Subject: [PATCH 12/13] =?UTF-8?q?CHART-14983=20=E6=A0=B9=E6=8D=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E8=B0=83=E6=95=B4=E7=AE=B1=E5=9E=8B?= =?UTF-8?q?=E5=9B=BE=E6=95=B0=E6=8D=AE=E7=82=B9=E6=8F=90=E7=A4=BA=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/box/VanChartBoxPlotTooltipPane.java | 8 +- .../box/VanChartBoxTooltipContentPane.java | 89 +++++++++++++++++-- .../van/chart/box/VanChartBoxTooltipPane.java | 18 ++++ .../component/VanChartTooltipContentPane.java | 16 +++- .../style/tooltip/VanChartTooltipPane.java | 12 ++- 5 files changed, 129 insertions(+), 14 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java index 4ad21d0d86..a68eb55964 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.box; import com.fr.chart.chartattr.Plot; import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.plugin.chart.box.attr.AttrBoxTooltip; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; @@ -13,7 +14,8 @@ public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane { } protected void initTooltipContentPane(Plot plot) { - tooltipContentPane = new VanChartBoxTooltipContentPane(parent, VanChartBoxPlotTooltipPane.this); + boolean isDetailed = ((VanChartBoxPlot) plot).isDetailed(); + tooltipContentPane = new VanChartBoxTooltipContentPane(parent, VanChartBoxPlotTooltipPane.this, isDetailed); } protected AttrTooltip getAttrTooltip() { @@ -23,4 +25,8 @@ public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane { protected boolean hasTooltipSeriesType() { return false; } + + public void checkContentVisible(boolean isDetailed) { + ((VanChartBoxTooltipContentPane) tooltipContentPane).checkFormatVisible(isDetailed); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 2b449785ef..8831b50491 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -1,6 +1,8 @@ package com.fr.van.chart.box; import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; @@ -10,10 +12,13 @@ import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.awt.Component; public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { + private boolean detailed; + private VanChartFormatPaneWithCheckBox number; private VanChartFormatPaneWithCheckBox max; private VanChartFormatPaneWithCheckBox q3; @@ -22,8 +27,12 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { private VanChartFormatPaneWithCheckBox min; private VanChartFormatPaneWithCheckBox outlier; - public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { + private JPanel dataNumberPane; + private JPanel dataOutlierPane; + + public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { super(parent, showOnPane); + this.detailed = isDetailed; } protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { @@ -67,22 +76,81 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { }; } + protected JPanel createCommonPanel() { + JPanel commonPanel = new JPanel(new BorderLayout()); + + commonPanel.add(createCateAndSeriesPane(), BorderLayout.NORTH); + commonPanel.add(createDataNumberPane(), BorderLayout.CENTER); + commonPanel.add(createDataDetailPane(), BorderLayout.SOUTH); + + checkFormatVisible(detailed); + + return commonPanel; + } + protected double[] getRowSize(double p) { - return new double[]{p, p, p, p, p, p, p, p, p}; + return new double[]{p, p, p, p, p, p, p, p, p, p, p, p}; } - protected Component[][] getPaneComponents() { - return new Component[][]{ + private JPanel createCateAndSeriesPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + + double[] columnSize = {f, p}; + double[] rowSize = {p, p}; + + Component[][] cateAndSeries = new Component[][]{ new Component[]{categoryNameFormatPane, null}, - new Component[]{seriesNameFormatPane, null}, + new Component[]{seriesNameFormatPane, null} + }; + + return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize); + } + + private JPanel createDataNumberPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + + double[] columnSize = {f, p}; + double[] rowSize = {p, p}; + + Component[][] dataNumber = new Component[][]{ + new Component[]{null, null}, new Component[]{number, null}, + }; + + dataNumberPane = TableLayoutHelper.createTableLayoutPane(dataNumber, rowSize, columnSize); + + return dataNumberPane; + } + + private JPanel createDataDetailPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {f, p}; + + JPanel detailPane = new JPanel(new BorderLayout()); + + Component[][] dataDetail = new Component[][]{ + new Component[]{null, null}, new Component[]{max, null}, new Component[]{q3, null}, new Component[]{median, null}, new Component[]{q1, null}, - new Component[]{min, null}, - new Component[]{outlier, null} + new Component[]{min, null} }; + + Component[][] dataOutlier = new Component[][]{ + new Component[]{null, null}, + new Component[]{outlier, null}, + }; + + dataOutlierPane = TableLayoutHelper.createTableLayoutPane(dataOutlier, new double[]{p, p}, columnSize); + + detailPane.add(TableLayoutHelper.createTableLayoutPane(dataDetail, new double[]{p, p, p, p, p, p}, columnSize), BorderLayout.NORTH); + detailPane.add(dataOutlierPane, BorderLayout.CENTER); + + return detailPane; } public boolean isDirty() { @@ -146,4 +214,11 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { outlier.update(boxTooltipContent.getOutlier()); } } + + public void checkFormatVisible(boolean detailed) { + this.detailed = detailed; + + dataNumberPane.setVisible(detailed); + dataOutlierPane.setVisible(detailed); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java index 5d485c31d2..955f974534 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java @@ -1,6 +1,10 @@ package com.fr.van.chart.box; +import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; import com.fr.van.chart.designer.style.tooltip.VanChartTooltipPane; @@ -14,4 +18,18 @@ public class VanChartBoxTooltipPane extends VanChartTooltipPane { protected VanChartPlotTooltipPane getTooltipPane(Plot plot) { return new VanChartBoxPlotTooltipPane(plot, parent); } + + public void populateTooltipPane(Plot plot) { + DataSeriesCondition attr = ((VanChartPlot) plot).getAttrTooltipFromConditionCollection(); + VanChartPlotTooltipPane tooltipPane = getPlotTooltipPane(); + + if (tooltipPane instanceof VanChartBoxPlotTooltipPane) { + tooltipPane.populate((AttrTooltip) attr); + + VanChartBoxPlotTooltipPane boxPlotTooltipPane = (VanChartBoxPlotTooltipPane) tooltipPane; + VanChartBoxPlot boxPlot = (VanChartBoxPlot) plot; + + boxPlotTooltipPane.checkContentVisible(boxPlot.isDetailed()); + } + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index af03afbe91..5920dd969f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -42,6 +42,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane { this.parent = parent; } + public VanChartPlotTooltipPane getPlotTooltipPane() { + return tooltipPane; + } + @Override protected JPanel createContentPane() { JPanel contentPane = new JPanel(new BorderLayout()); @@ -48,7 +53,10 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane { parent.initAllListeners(); } - Plot plot = this.chart.getPlot(); + populateTooltipPane(this.chart.getPlot()); + } + + public void populateTooltipPane(Plot plot) { DataSeriesCondition attr = ((VanChartPlot)plot).getAttrTooltipFromConditionCollection(); if(tooltipPane != null) { tooltipPane.populate((AttrTooltip)attr); @@ -74,7 +82,7 @@ public class VanChartTooltipPane extends AbstractVanChartScrollPane { @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Tooltip"); + return Toolkit.i18nText("Fine-Design_Chart_Tooltip"); } protected VanChartPlotTooltipPane getTooltipPane(Plot plot) { From 3b5adce5d32ba28f537e2a2259011f40d70075ea Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 17 Aug 2020 14:21:23 +0800 Subject: [PATCH 13/13] =?UTF-8?q?REPORT-37487=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=97=E5=8F=B3=E4=BE=A7=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E9=97=AE=E9=A2=98=20=E5=8F=B3=E4=BE=A7=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=EF=BC=8C=E6=98=BE=E7=A4=BA=E5=80=BC=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=87=8D=E7=BD=AE=E4=B8=BA=20=3D$$$=20?= =?UTF-8?q?=E5=8F=8C=E5=87=BB=E6=95=B0=E6=8D=AE=E6=BA=90=E9=AB=98=E7=BA=A7?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E4=B8=8D=E4=BC=9A=E9=87=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/formula/FormulaTextField.java | 11 +++++----- .../design/dscolumn/DSColumnAdvancedPane.java | 6 ++++-- .../cellquick/CellDSColumnEditor.java | 20 ++++++++++--------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java index 6294a7a3bd..36cabec6bb 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaTextField.java @@ -18,8 +18,6 @@ public class FormulaTextField extends DictionaryTextField { private static final String EMPTY_STRING = "="; - private static final BaseFormula EMPTY_FORMULA = BaseFormula.createFormulaBuilder().build(EMPTY_STRING); - public FormulaTextField() { } @@ -64,10 +62,10 @@ public class FormulaTextField extends DictionaryTextField { @Override public void setValue(BaseFormula value) { - this.value = value; - if (this.value == null) { - this.value = createDefault(); + if (value == null) { + value = createDefault(); } + this.value = value; } /** @@ -94,7 +92,8 @@ public class FormulaTextField extends DictionaryTextField { if (StringUtils.isNotEmpty(text)) { return BaseFormula.createFormulaBuilder().build(text); } else { - return EMPTY_FORMULA; + //防止默认值被修改, 每一次创建都是不一样的。 + return BaseFormula.createFormulaBuilder().build(EMPTY_STRING); } } } diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java index 58636917cd..b1273ce58d 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java @@ -410,10 +410,10 @@ public class DSColumnAdvancedPane extends BasicPane { private static class JFormulaField extends JPanel { private CellElement cellElement; private FormulaTextField formulaTextField; - private BaseFormula defaultFormula; + private String defaultValue; public JFormulaField(String defaultValue) { - this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + this.defaultValue = defaultValue; this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); UILabel bottomLabel = new UILabel("="); @@ -421,6 +421,7 @@ public class DSColumnAdvancedPane extends BasicPane { this.add(bottomLabel); formulaTextField = new FormulaTextField(24); this.add(formulaTextField); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); formulaTextField.setValueAndText(defaultFormula, true); UIButton bottomFrmulaButton = new UIButton("..."); @@ -480,6 +481,7 @@ public class DSColumnAdvancedPane extends BasicPane { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); formulaTextField.setValueAndText(defaultFormula, true); } else { formulaTextField.setValueAndText(valueFormula, true); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index d9b8f1e7a0..248a274f57 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -646,7 +646,6 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class ResultSetSortConfigPane extends JPanel { private static final String DEFAULT_VALUE = "="; - private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(); private JPanel contentPane; private UIButtonGroup sortTypePane; private JFormulaField formulaField; @@ -723,7 +722,8 @@ public class CellDSColumnEditor extends CellQuickEditor { } BaseFormula baseFormula = dSColumn.getSortFormulaObject(); if (baseFormula == null) { - this.formulaField.populateFormula(DEFAULT_FORMULA); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(); + this.formulaField.populateFormula(defaultFormula); } else { this.formulaField.populateFormula(baseFormula); } @@ -1064,11 +1064,12 @@ public class CellDSColumnEditor extends CellQuickEditor { public class JFormulaField extends JPanel { private CellElement cellElement; private FormulaTextField formulaTextField; - private BaseFormula defaultFormula; + private String defaultValue; public JFormulaField(String defaultValue) { - - this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); + + this.defaultValue = defaultValue; + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); formulaTextField = new FormulaTextField(); formulaTextField.setValueAndText(defaultFormula, false); @@ -1145,6 +1146,7 @@ public class CellDSColumnEditor extends CellQuickEditor { public void doOk() { BaseFormula valueFormula = formulaPane.update(); if (valueFormula.getContent().length() <= 1) { + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); formulaTextField.setValueAndText(defaultFormula, false); } else { formulaTextField.setValueAndText(valueFormula, false); @@ -1164,8 +1166,7 @@ public class CellDSColumnEditor extends CellQuickEditor { */ public class CustomValuePane extends JPanel { private static final String DEFAULT_VALUE = "=$$$"; - private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); - + private JFormulaField formulaField; public CustomValuePane() { @@ -1188,7 +1189,8 @@ public class CellDSColumnEditor extends CellQuickEditor { if (valueFormula != null) { formulaField.populateFormula(valueFormula); } else { - formulaField.populateFormula(DEFAULT_FORMULA); + BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); + formulaField.populateFormula(defaultFormula); } formulaField.populateElement(cellElement); @@ -1201,7 +1203,7 @@ public class CellDSColumnEditor extends CellQuickEditor { Object value = cellElement.getValue(); if (value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) (cellElement.getValue()); - dSColumn.setResultObject(this.formulaField.getFormula()); + dSColumn.setResultObject(StringUtils.isEmpty(this.formulaField.getFormulaText()) ? null : this.formulaField.getFormula()); } } }