From 279c9f40bd3c2956ca6aa2540a63a1ef6e52974d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 20 Aug 2020 10:35:25 +0800 Subject: [PATCH 1/6] =?UTF-8?q?CHART-15216=20release=E2=86=92final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartLineMapTooltipConditionPane.java | 4 +-- ...VanChartLineMapPlotTooltipNoCheckPane.java | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java index 408480a791..d3ed1ab7a5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLineMapTooltipConditionPane.java @@ -4,7 +4,7 @@ package com.fr.van.chart.designer.other.condition.item; import com.fr.chart.chartattr.Plot; import com.fr.design.condition.ConditionAttributesPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import com.fr.van.chart.map.line.VanChartLineMapPlotTooltipPane; +import com.fr.van.chart.map.line.VanChartLineMapPlotTooltipNoCheckPane; /** * Created by hufan on 2016/12/23. @@ -16,6 +16,6 @@ public class VanChartLineMapTooltipConditionPane extends VanChartTooltipConditio } protected VanChartPlotTooltipPane createTooltipContentsPane() { - return new VanChartLineMapPlotTooltipPane(getPlot(), null); + return new VanChartLineMapPlotTooltipNoCheckPane(getPlot(), null); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java new file mode 100644 index 0000000000..49afb79ebc --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapPlotTooltipNoCheckPane.java @@ -0,0 +1,36 @@ +package com.fr.van.chart.map.line; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import java.awt.BorderLayout; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-08-20 + */ +public class VanChartLineMapPlotTooltipNoCheckPane extends VanChartLineMapPlotTooltipPane { + + public VanChartLineMapPlotTooltipNoCheckPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void addComponents(Plot plot) { + isTooltipShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Tooltip")); + tooltipPane = createTooltipPane(plot); + + this.setLayout(new BorderLayout()); + this.add(tooltipPane, BorderLayout.CENTER); + } + + @Override + public void populate(AttrTooltip attr) { + super.populate(attr); + isTooltipShow.setSelected(true); + tooltipPane.setEnabled(isTooltipShow.isSelected()); + } +} \ No newline at end of file From ea06a7b22458583df9cf14eecf94fe49812390c2 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 20 Aug 2020 12:25:29 +0800 Subject: [PATCH 2/6] =?UTF-8?q?REPORT-37821=20=20frm=E7=BB=9D=E5=AF=B9?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E6=A1=86=E9=80=89=E5=A4=9A=E4=B8=AA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/EditingMouseListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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 3754e5109e..2fa3dea643 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 @@ -195,6 +195,7 @@ public class EditingMouseListener extends MouseInputAdapter { */ 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()); + MouseEvent clickEvent = 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); @@ -219,14 +220,21 @@ public class EditingMouseListener extends MouseInputAdapter { lastPressEvent = null; lastXCreator = null; e.translatePoint(oldX - e.getX(), oldY - e.getY()); - if (pressX != oldX || pressY != oldY) { + if (isAutoFire(transEvent, clickEvent)) { // click只有在mouseReleased和mousePressed前后x/y坐标相等时才会被触发在mouseReleased之后 // 但是当使用者来回点击切换时 存在mouseReleased和mousePressed前后x/y坐标不相等的情况 即鼠标按下去的位置和鼠标释放的位置不相等 存在偏移 // 当这种偏移很小时 看起来就好像是点击了 实际上是手抖了或者鼠标轻微滑动了 所以这里对这种情况要有容错处理 - mouseClicked(transEvent); + mouseClicked(clickEvent); } } + private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent ) { + offsetEventPoint(transEvent); + XCreator xCreator = designer.getComponentAt(transEvent); + return (pressX != clickEvent.getX() || pressY != clickEvent.getY()) + && xCreator != null && xCreator.acceptType(XCardSwitchButton.class); + } + private void mouseDraggingRelease(MouseEvent e) { // 当前鼠标所在的组件 XCreator hoveredComponent = designer.getComponentAt(e.getX(), e.getY()); From 3ed643669b8d926ffcdf70e2b655ae3978977548 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 19 Aug 2020 14:56:42 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractCustomFieldComboBoxPane.java | 121 +++++++++--------- .../SeriesValueFieldComboBoxPane.java | 12 +- .../design/chartx/data/DataLayoutHelper.java | 69 ++++++++++ .../data/map/AbstractAreaLngLatPane.java | 15 +-- .../chartx/data/map/MapChartDataPane.java | 8 +- .../fields/AbstractCellDataFieldsPane.java | 15 +-- .../fields/AbstractDataSetFieldsPane.java | 15 +-- .../fields/diff/MapDataSetFieldsPane.java | 7 +- .../fr/design/chartx/single/CellDataPane.java | 2 + .../fr/design/chartx/single/DataSetPane.java | 30 ++--- .../design/chartx/single/SingleDataPane.java | 22 +--- .../ExtendedCustomFieldComboBoxPane.java | 12 +- 12 files changed, 176 insertions(+), 152 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java index e93900ea6f..e4e27b7f49 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java @@ -1,19 +1,18 @@ package com.fr.design.chartx.component; import com.fr.data.util.function.AbstractDataFunction; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.chartx.component.correlation.AbstractCorrelationPane; import com.fr.design.chartx.component.correlation.CalculateComboBoxEditorComponent; import com.fr.design.chartx.component.correlation.FieldEditorComponentWrapper; import com.fr.design.chartx.component.correlation.UIComboBoxEditorComponent; import com.fr.design.chartx.component.correlation.UITextFieldEditorComponent; -import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.chartx.data.DataLayoutHelper; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import com.fr.extended.chart.UIComboBoxWithNone; @@ -22,19 +21,25 @@ import com.fr.stable.StringUtils; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.util.ArrayList; -import java.util.List; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; /** * Created by shine on 2018/9/12. * 系列名使用字段名or字段值的抽象的pane 支持多种属性结构的存取 */ -public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane { +public abstract class AbstractCustomFieldComboBoxPane extends BasicBeanPane { + + private UIButtonGroup nameOrValue; + private JPanel cardPane; + private CardLayout cardLayout; private AbstractUseFieldValuePane useFieldValuePane; @@ -42,73 +47,43 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< private List fieldList = new ArrayList(); - @Override - protected void initLayout() { - this.setLayout(new BorderLayout(0, 6)); - JPanel northPane = new JPanel(new BorderLayout()); - northPane.add(jcb, BorderLayout.CENTER); - UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); - label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, 20)); - northPane.add(label, BorderLayout.WEST); - this.add(northPane, BorderLayout.NORTH); - this.add(cardPane, BorderLayout.CENTER); - } + public AbstractCustomFieldComboBoxPane() { - @Override - protected List> initPaneList() { useFieldValuePane = createUseFieldValuePane(); customFieldNamePane = createCustomFieldNamePane(); - List> list = new ArrayList>(); - list.add(useFieldValuePane); - list.add(paneWrapper()); - return list; - } - private FurtherBasicBeanPane paneWrapper() { - FurtherBasicBeanPane pane = new FurtherBasicBeanPane() { + nameOrValue = new UIButtonGroup( + new String[]{useFieldValuePane.title4PopupWindow(), customFieldNamePane.title4PopupWindow()}, + new Boolean[]{false, true}); + nameOrValue.setSelectedItem(false); + nameOrValue.addChangeListener(new ChangeListener() { @Override - public String title4PopupWindow() { - return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + public void stateChanged(ChangeEvent e) { + checkCardPane(); } + }); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"), nameOrValue); - @Override - public boolean accept(Object ob) { - return false; - } - - @Override - public void reset() { - } + cardLayout = new CardLayout(); + cardPane = new JPanel(cardLayout); + cardPane.add(useFieldValuePane, useFieldValuePane.title4PopupWindow()); + cardPane.add(customFieldNamePane, customFieldNamePane.title4PopupWindow()); - @Override - public void populateBean(Object ob) { - } - - @Override - public Object updateBean() { - return null; - } - }; - pane.setLayout(new BorderLayout(0, 6)); - pane.add(customFieldNamePane, BorderLayout.CENTER); - return pane; + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); + this.add(cardPane, BorderLayout.CENTER); } protected abstract AbstractUseFieldValuePane createUseFieldValuePane(); protected abstract AbstractCustomFieldNamePane createCustomFieldNamePane(); - @Override - protected String title4PopupWindow() { - return StringUtils.EMPTY; - } - protected boolean valueComboBoxHasNone() { return false; } public void checkBoxUse(boolean hasUse) { - jcb.setEnabled(hasUse); + nameOrValue.setEnabled(hasUse); useFieldValuePane.checkBoxUse(hasUse); } @@ -122,6 +97,19 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< fieldList = columnNameList; } + private void checkCardPane() { + cardLayout.show(cardPane, nameOrValue.getSelectedItem() ? customFieldNamePane.title4PopupWindow() : useFieldValuePane.title4PopupWindow()); + } + + protected void populateNameOrValue(boolean b) { + nameOrValue.setSelectedItem(b); + checkCardPane(); + } + + protected boolean updateNameOrValue() { + return nameOrValue.getSelectedItem(); + } + protected void populateCustomFieldNamePane(T t) { customFieldNamePane.populateBean(t); } @@ -138,6 +126,16 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< useFieldValuePane.updateBean(t); } + @Override + public T updateBean() { + return null; + } + + @Override + protected String title4PopupWindow() { + return null; + } + protected abstract class AbstractUseFieldValuePane extends FurtherBasicBeanPane { private UIComboBox series; private UIComboBox value; @@ -169,11 +167,7 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"), SwingConstants.LEFT), function}, }; - double p = TableLayout.PREFERRED; - double[] columnSize = {78, 122}; - double[] rowSize = {p, p, p}; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel panel = DataLayoutHelper.createDataLayoutPane(components); this.setLayout(new BorderLayout(0, 6)); this.add(panel, BorderLayout.CENTER); @@ -258,5 +252,10 @@ public abstract class AbstractCustomFieldComboBoxPane extends UIComboBoxPane< protected Object[] createLine() { return new String[]{StringUtils.EMPTY, StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Chart_Use_None")}; } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + } } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java index 4372cf0db1..e38b3965d4 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/SeriesValueFieldComboBoxPane.java @@ -27,23 +27,21 @@ public class SeriesValueFieldComboBoxPane extends AbstractCustomFieldComboBoxPan @Override public void populateBean(SeriesValueCorrelationDefinition ob) { + populateNameOrValue(ob.isCustomFieldValue()); if (ob.isCustomFieldValue()) { populateCustomFieldNamePane(ob); - jcb.setSelectedIndex(1); } else { populateUseFieldValuePane(ob); - jcb.setSelectedIndex(0); } } @Override public void updateBean(SeriesValueCorrelationDefinition ob) { - if (jcb.getSelectedIndex() == 0) { - ob.setCustomFieldValue(false); - updateUseFieldValuePane(ob); - } else { - ob.setCustomFieldValue(true); + ob.setCustomFieldValue(updateNameOrValue()); + if (ob.isCustomFieldValue()) { updateCustomFieldNamePane(ob); + } else { + updateUseFieldValuePane(ob); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java b/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java new file mode 100644 index 0000000000..98ae28085c --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/DataLayoutHelper.java @@ -0,0 +1,69 @@ +package com.fr.design.chartx.data; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.Component; +import java.util.Arrays; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2020/7/22 + */ +public class DataLayoutHelper { + + public static int WIDTH = 150; + public static int LABEL_HEIGHT = 20; + public static int LABEL_WIDTH = 65; + + public static int LEFT_GAP = 15; + public static int RIGHT_GAP = 10; + + public static void setWIDTH(int WIDTH) { + DataLayoutHelper.WIDTH = WIDTH; + } + + public static void setLabelHeight(int labelHeight) { + LABEL_HEIGHT = labelHeight; + } + + public static void setLabelWidth(int labelWidth) { + LABEL_WIDTH = labelWidth; + } + + public static void setLeftGap(int leftGap) { + LEFT_GAP = leftGap; + } + + public static void setRightGap(int rightGap) { + RIGHT_GAP = rightGap; + } + + public static JPanel createDataLayoutPane(Component[][] components) { + int len = components.length; + double p = TableLayout.PREFERRED; + double[] columnSize = {DataLayoutHelper.LABEL_WIDTH, DataLayoutHelper.WIDTH}; + double[] rowSize = new double[len]; + Arrays.fill(rowSize, p); + + return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + } + + public static JPanel createDataLayoutPane(String label, Component component) { + Component[][] components = new Component[][]{ + new Component[]{new UILabel(label, SwingConstants.LEFT), component} + }; + + return createDataLayoutPane(components); + } + + public static void addNormalBorder(JComponent component) { + component.setBorder(BorderFactory.createEmptyBorder(0, DataLayoutHelper.LEFT_GAP, 0, DataLayoutHelper.RIGHT_GAP)); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java index 09393918a5..53c1cde759 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java @@ -1,18 +1,15 @@ package com.fr.design.chartx.data.map; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.util.Arrays; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -67,8 +64,10 @@ public abstract class AbstractAreaLngLatPane extends JPanel { locationType.setSelectedIndex(0); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("FR-Plugin_Design_Geographic_Location"), locationType); + this.setLayout(new BorderLayout(0, 6)); - this.add(locationType, BorderLayout.NORTH); + this.add(northPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } @@ -103,12 +102,8 @@ public abstract class AbstractAreaLngLatPane extends JPanel { for (int i = 0; i < len; i++) { components[i] = new Component[]{new UILabel(labels[i], SwingConstants.LEFT), fieldComponents[i]}; } - double p = TableLayout.PREFERRED; - double[] columnSize = {ChartDataPane.LABEL_WIDTH, 122}; - double[] rowSize = new double[len]; - Arrays.fill(rowSize, p); - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 6); + return DataLayoutHelper.createDataLayoutPane(components); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java index fd4790d57d..c6686dece9 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java @@ -10,7 +10,6 @@ import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane; import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane; import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; @@ -33,11 +32,8 @@ public class MapChartDataPane extends AbstractChartDataPane { this.setLayout(new BorderLayout()); this.add(cellDataFieldsPane, BorderLayout.CENTER); + DataLayoutHelper.addNormalBorder(this); } @Override diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java index cfb9a2c18a..3df0d3d6d5 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/DataSetPane.java @@ -3,25 +3,20 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.DataSetDefinition; import com.fr.data.impl.NameTableData; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; -import com.fr.design.utils.gui.UIComponentUtils; -import java.util.List; +import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Dimension; +import java.util.List; /** * Created by shine on 2019/5/21. */ public class DataSetPane extends FurtherBasicBeanPane { - private static final int TABLE_DATA_LABEL_LINE_WRAP_WIDTH = 65; - private static final int TABLE_DATA_PANE_WIDTH = 246; private DatabaseTableDataPane tableDataPane; @@ -32,24 +27,27 @@ public class DataSetPane extends FurtherBasicBeanPane { } private void initComps(AbstractDataSetFieldsPane dataSetFieldsPane) { - UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data")); - UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH); - UIComponentUtils.setPreferedWidth(label, ChartDataPane.LABEL_WIDTH); - - tableDataPane = new DatabaseTableDataPane(label) { + tableDataPane = new DatabaseTableDataPane(null) { @Override protected void userEvent() { refreshBoxListAndTableName(); checkBoxUse(); } + + @Override + protected void setBorder() { + } + }; - tableDataPane.setPreferredSize(new Dimension(TABLE_DATA_PANE_WIDTH, tableDataPane.getPreferredSize().height)); + this.dataSetFieldsPane = dataSetFieldsPane; - this.setLayout(new BorderLayout()); - this.add(tableDataPane, BorderLayout.NORTH); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Table_Data"), tableDataPane); + this.setLayout(new BorderLayout(0, 6)); + this.add(northPane, BorderLayout.NORTH); this.add(dataSetFieldsPane, BorderLayout.CENTER); + DataLayoutHelper.addNormalBorder(this); checkBoxUse(); } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java index dc4dfc65ad..06ed06649b 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/single/SingleDataPane.java @@ -3,28 +3,22 @@ package com.fr.design.chartx.single; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.data.DataLayoutHelper; import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; -import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.frpane.UIComboBoxPane; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.utils.gui.UIComponentUtils; -import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; -import java.awt.BorderLayout; /** * Created by shine on 2019/5/21. */ public class SingleDataPane extends BasicBeanPane { - private static final int TABLE_DATA_LABEL_LINE_WIDTH = 81; - private UIComboBoxPane comboBoxPane; private DataSetPane dataSetPane; @@ -50,18 +44,12 @@ public class SingleDataPane extends BasicBeanPane { } protected void initLayout() { - this.setLayout(new BorderLayout(LayoutConstants.HGAP_LARGE, 6)); - JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE, 0)); + this.setLayout(new BorderLayout(0, 6)); + JPanel northPane = DataLayoutHelper.createDataLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Data_Source"), jcb); + DataLayoutHelper.addNormalBorder(northPane); - UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Data_Source")); - UIComponentUtils.setPreferedWidth(label, TABLE_DATA_LABEL_LINE_WIDTH); - northPane.add(label,BorderLayout.WEST); - northPane.add(jcb, BorderLayout.CENTER); - - northPane.setBorder(BorderFactory.createEmptyBorder(5,24,0,15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); - } @Override diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java index 108d4b605e..119d73bda6 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java @@ -27,21 +27,19 @@ public class ExtendedCustomFieldComboBoxPane extends AbstractCustomFieldComboBox public void populateBean(AbstractDataConfig ob) { if (ob.isCustomName()) { populateCustomFieldNamePane(ob); - jcb.setSelectedIndex(1); } else { populateUseFieldValuePane(ob); - jcb.setSelectedIndex(0); } + populateNameOrValue(ob.isCustomName()); } @Override public void updateBean(AbstractDataConfig ob) { - if (jcb.getSelectedIndex() == 0) { - ob.setCustomName(false); - updateUseFieldValuePane(ob); - } else { - ob.setCustomName(true); + ob.setCustomName(updateNameOrValue()); + if (ob.isCustomName()) { updateCustomFieldNamePane(ob); + } else { + updateUseFieldValuePane(ob); } } From 0d341449424ff6017835950b9849761353e830d1 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 19 Aug 2020 15:01:17 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chartx/data/map/MapChartDataPane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java index c6686dece9..148bcd7ca2 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java @@ -10,6 +10,7 @@ import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane; import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane; import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; @@ -32,7 +33,11 @@ public class MapChartDataPane extends AbstractChartDataPane Date: Wed, 19 Aug 2020 17:48:12 +0800 Subject: [PATCH 5/6] =?UTF-8?q?CHART-15175=20=E8=B0=83=E6=95=B4=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=95=B0=E6=8D=AE=E7=9A=84=E6=95=B0=E6=8D=AE=E7=82=B9?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java | 4 ---- .../com/fr/van/chart/box/VanChartBoxTooltipContentPane.java | 6 +++++- .../java/com/fr/van/chart/box/VanChartBoxTooltipPane.java | 6 ------ .../chart/box/data/report/BoxPlotReportDataContentPane.java | 2 +- .../chart/box/data/table/BoxPlotTableDataContentPane.java | 2 +- 5 files changed, 7 insertions(+), 13 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 a68eb55964..f1cae6e3bf 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 @@ -25,8 +25,4 @@ 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 8831b50491..b2271cc337 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 @@ -178,7 +178,7 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { } protected AttrTooltipContent createAttrTooltip() { - return new AttrBoxTooltipContent(); + return new AttrBoxTooltipContent(detailed); } protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { @@ -195,6 +195,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { q1.populate(boxTooltipContent.getQ1()); min.populate(boxTooltipContent.getMin()); outlier.populate(boxTooltipContent.getOutlier()); + + checkFormatVisible(boxTooltipContent.isDetailed()); } } @@ -212,6 +214,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { q1.update(boxTooltipContent.getQ1()); min.update(boxTooltipContent.getMin()); outlier.update(boxTooltipContent.getOutlier()); + + boxTooltipContent.setDetailed(this.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 955f974534..ad5840267a 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 @@ -4,7 +4,6 @@ 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; @@ -25,11 +24,6 @@ public class VanChartBoxTooltipPane extends VanChartTooltipPane { 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/box/data/report/BoxPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java index f6d6090356..037c0aa70b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/report/BoxPlotReportDataContentPane.java @@ -101,7 +101,7 @@ public class BoxPlotReportDataContentPane extends AbstractReportDataContentPane boolean isDetailed = dataType.getSelectedIndex() == 0; report.setDetailed(isDetailed); - ((VanChartBoxPlot) initplot).setDetailed(isDetailed); + ((VanChartBoxPlot) initplot).updateDetailedAttr(isDetailed); } if (detailedDataSeriesPane != null) { detailedDataSeriesPane.updateBean(collection); diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java index 92b554d0d2..4fa2296aa0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java @@ -154,7 +154,7 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { boolean isDetailed = dataType.getSelectedIndex() == 0; table.setDetailed(isDetailed); - ((VanChartBoxPlot) initplot).setDetailed(isDetailed); + ((VanChartBoxPlot) initplot).updateDetailedAttr(isDetailed); } if (seriesTypeComboxPane != null) { seriesTypeComboxPane.updateBean(collection); From b42d4cc480c431184c0746bdf69bded08f911300 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 19 Aug 2020 18:20:06 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=B0=83=E6=95=B4check=E7=9A=84=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/box/VanChartBoxTooltipContentPane.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 b2271cc337..77b16b4993 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 @@ -32,7 +32,7 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { super(parent, showOnPane); - this.detailed = isDetailed; + checkFormatVisible(isDetailed); } protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { @@ -83,8 +83,6 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { commonPanel.add(createDataNumberPane(), BorderLayout.CENTER); commonPanel.add(createDataDetailPane(), BorderLayout.SOUTH); - checkFormatVisible(detailed); - return commonPanel; }