diff --git a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java index 0c3a067a95..80efde739e 100644 --- a/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java @@ -562,7 +562,7 @@ public class FRGUIPaneFactory { double n = (double)(width + WIDTH_OFFSET_N ) / (double)WIDTH_PARA_F; double i = Math.abs(((double) ((int) m + (int) (m + 1)) / WIDTHABS_PARA_F) - m); double j = Math.abs(((double) ((int) n + (int) (n + 1)) / WIDTHABS_PARA_F) - n); - double x = i > j ? i : j; + double x = Math.max(i,j); if (AssistUtils.equals(x, i)) { w = (int) (Math.round(m) * WIDTH_PARA_INT - WIDTH_OFFSET_M); } else if (AssistUtils.equals(x, j)) { diff --git a/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java b/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java index 1be77c8492..d394f43ee7 100644 --- a/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java +++ b/designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java @@ -372,7 +372,8 @@ public class TableLayoutHelper { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; JPanel jp1 = TableLayoutHelper.createTableLayoutPane(createTestComponents("jp1"), TableLayoutHelper.FILL_NONE); - JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp2"), TableLayoutHelper.FILL_LASTCOL_AND_ROW, (double)2 * TEN, (double)2 * TEN); + JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp2"), + TableLayoutHelper.FILL_LASTCOL_AND_ROW, (double)2 * TEN, (double)2 * TEN); JPanel jp3 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp3"), new double[]{f, p, f, p}, new double[]{f, f}, 4, 4); JPanel jp4 = TableLayoutHelper.createGapTableLayoutPane(createTestComponents("jp4"), diff --git a/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java index 9ff8fd28cc..5396e88e63 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/CustomChartDataPane.java @@ -3,6 +3,8 @@ package com.fr.design.chartx; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.CustomChartDataDefinition; +import com.fr.design.chartx.fields.diff.FunnelCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.FunnelDataSetFieldsPane; import com.fr.design.chartx.fields.diff.GaugeCellDataFieldsPane; import com.fr.design.chartx.fields.diff.GaugeDataSetFieldsPane; import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane; @@ -41,6 +43,9 @@ import java.util.Map; */ public class CustomChartDataPane extends ChartDataPane { + private static final int HGAP = 0; + private static final int VGAP = 6; + public CustomChartDataPane(AttributeChangeListener listener) { super(listener); } @@ -92,10 +97,18 @@ public class CustomChartDataPane extends ChartDataPane { case SCATTER: case BUBBLE: return new SingleDataPane(new ScatterDataSetFieldsPane(), new ScatterCellDataFieldsPane()); + case PIE: + case SAME_PIE: + case DIFFERENT_PIE: + case POINTER_180: + case POINTER_360: + return new SingleDataPane(new FunnelDataSetFieldsPane(), new FunnelCellDataFieldsPane()); default: - return StringUtils.equals(CustomStyle.CUSTOM.toString(), plot.getCustomType()) ? - new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()) : - new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); + if (StringUtils.equals(CustomStyle.CUSTOM.toString(), plot.getCustomType())){ + return new SingleDataPane(new SingleCategoryDataSetFieldsPane(), new SingleCategoryCellDataFieldsPane()); + } else { + return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); + } } } @@ -147,7 +160,7 @@ public class CustomChartDataPane extends ChartDataPane { JPanel tabPanel = new JPanel(new BorderLayout()); tabPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, getBackground())); tabPanel.add(tabPane, BorderLayout.CENTER); - this.setLayout(new BorderLayout(0, 6)); + this.setLayout(new BorderLayout(HGAP, VGAP)); this.add(tabPanel, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java index 6474cad0b6..f82e4b253c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPane.java @@ -10,13 +10,13 @@ import com.fr.general.IOUtils; import javax.swing.BoxLayout; import javax.swing.JComponent; import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; /** @@ -168,4 +168,8 @@ public abstract class AbstractMultiComponentPane extends J updateField(comboBox, temp); } } + + public void checkEnable(boolean hasUse){ + addButton.setEnabled(hasUse); + } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java index 5f0e6500b0..f784c4a861 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/AbstractMultiComponentPaneWithUISpinner.java @@ -11,10 +11,10 @@ import com.fr.stable.AssistUtils; import javax.swing.JComponent; import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; import java.util.ArrayList; import java.util.List; +import java.awt.BorderLayout; +import java.awt.Component; /** * Created by shine on 2019/6/18. @@ -148,4 +148,8 @@ public abstract class AbstractMultiComponentPaneWithUISpinner { private List currentBoxItems = new ArrayList(); + public void setCurrentBoxItems(List currentBoxItems) { this.currentBoxItems = currentBoxItems; } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractCellDataFieldsPane.java index b302ec8632..6d1cf932ad 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractCellDataFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractCellDataFieldsPane.java @@ -47,7 +47,7 @@ public abstract class AbstractCellDataFieldsPane { @@ -54,7 +55,7 @@ public class FunnelCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesVa ColumnFieldCollectionWithSeriesValue fieldCollection = new ColumnFieldCollectionWithSeriesValue(); updateSeriesValuePane(fieldCollection); SeriesValueCorrelationDefinition seriesValueCorrelationDefinition = fieldCollection.getSeriesValueCorrelationDefinition(); - filterPane.updateBean(seriesValueCorrelationDefinition.getFilterProperties()); + seriesValueCorrelationDefinition.setFilterProperties(filterPane.updateBean()); return fieldCollection; } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java index aa1c9fe28a..ee15e39450 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/FunnelDataSetFieldsPane.java @@ -14,6 +14,7 @@ import java.awt.BorderLayout; /** * Created by Wim on 2019/10/23. + * 饼图、多指针仪表盘 在组合图中 没有分类配置项, 也用这个。 */ public class FunnelDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeCellDataFieldsPane.java index 5df78ff2ba..f93cf0effa 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeCellDataFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/GaugeCellDataFieldsPane.java @@ -34,7 +34,7 @@ public class GaugeCellDataFieldsPane extends AbstractCellDataFieldsPane { this.setLayout(new BorderLayout()); this.add(tableDataPane, BorderLayout.NORTH); this.add(dataSetFieldsPane, BorderLayout.CENTER); + 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 a4e6949983..dc4dfc65ad 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 @@ -7,23 +7,24 @@ 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.mainframe.chart.gui.ChartDataPane; -import com.fr.design.utils.gui.GUICoreUtils; +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.awt.Component; -import java.awt.Dimension; 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; @@ -51,11 +52,13 @@ 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)); + + 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); - UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source")); - label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); - northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); - northPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 8)); + + northPane.setBorder(BorderFactory.createEmptyBorder(5,24,0,15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); @@ -70,7 +73,6 @@ public class SingleDataPane extends BasicBeanPane { this.setLayout(new BorderLayout()); this.add(comboBoxPane, BorderLayout.CENTER); - } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index 01610a2457..92df8bc6b2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -160,7 +160,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { initPositionListener(); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel); } private JPanel createTitleStylePane(){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 0949dbf6eb..8b309840e7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -118,7 +118,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { new Component[]{createLabelPane(new double[]{p, p}, column), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, - new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null}, + new Component[]{createDisplayStrategy(), null}, new Component[]{createValueStylePane(), null}, }; @@ -326,7 +326,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } } - protected JPanel createDisplayStrategy(double[] row, double[] col){ + protected JPanel createDisplayStrategy(){ limitPane = new LimitPane(); return limitPane; } @@ -385,7 +385,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected void checkAllUse() { checkCardPane(); checkLabelPane(); - limitPane.checkMaxProPortionUse(); + if (limitPane != null){ + limitPane.checkMaxProPortionUse(); + } } protected void checkCardPane() { 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 74dbf7221b..2d408c9050 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 @@ -73,7 +73,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { new Component[]{createValueDefinition(),null}, new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis),null}, - new Component[]{createDisplayStrategy(new double[]{p, p,p}, columnSize),null}, + new Component[]{createDisplayStrategy(),null}, new Component[]{createValueStylePane(),null}, }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java index 3b271f2b3a..2b90633e67 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java @@ -54,7 +54,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { new Component[]{createMinMaxValuePane(new double[]{p, p}, columnSize), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, - new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null}, + new Component[]{createDisplayStrategy(), null}, new Component[]{createValueStylePane(), null}, };