diff --git a/designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java new file mode 100644 index 0000000000..31737559cb --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/StructureChartDataPane.java @@ -0,0 +1,23 @@ +package com.fr.design.chartx; + +import com.fr.design.chartx.fields.diff.StructureCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.StructureDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; +import com.fr.design.gui.frpane.AttributeChangeListener; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2019-09-02 + */ +public class StructureChartDataPane extends MultiCategoryChartDataPane { + + public StructureChartDataPane(AttributeChangeListener listener) { + super(listener); + } + + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new StructureDataSetFieldsPane(), new StructureCellDataFieldsPane()); + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java new file mode 100644 index 0000000000..87ff4d3954 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureCellDataFieldsPane.java @@ -0,0 +1,86 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.StructureColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; + +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2019-09-02 + */ +public class StructureCellDataFieldsPane extends AbstractCellDataFieldsPane { + + private TinyFormulaPane nodeName; + private TinyFormulaPane nodeId; + private TinyFormulaPane parentId; + private UITextField seriesName; + private TinyFormulaPane nodeValue; + + @Override + protected void initComponents() { + seriesName = new UITextField(); + nodeName = new TinyFormulaPane(); + nodeId = new TinyFormulaPane(); + parentId = new TinyFormulaPane(); + nodeValue = new TinyFormulaPane(); + + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Node_Name"), + "id", + Toolkit.i18nText("Fine-Design_Chart_Parent_ID"), + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Value"), + }; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[]{ + nodeName, + nodeId, + parentId, + nodeValue + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + nodeName, + nodeId, + parentId, + nodeValue, + nodeValue, + }; + } + + @Override + public void populateBean(StructureColumnFieldCollection ob) { + seriesName.setText(ob.getSeriesName()); + populateField(nodeName, ob.getNodeName()); + populateField(nodeId, ob.getNodeId()); + populateField(parentId, ob.getParentId()); + populateField(nodeValue, ob.getNodeValue()); + } + + @Override + public StructureColumnFieldCollection updateBean() { + StructureColumnFieldCollection result = new StructureColumnFieldCollection(); + result.setSeriesName(seriesName.getText()); + updateField(nodeName, result.getNodeName()); + updateField(nodeId, result.getNodeId()); + updateField(parentId, result.getParentId()); + updateField(nodeValue, result.getNodeValue()); + return result; + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java new file mode 100644 index 0000000000..049c76fd75 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/StructureDataSetFieldsPane.java @@ -0,0 +1,91 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.StructureColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; + +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2019-09-02 + */ +public class StructureDataSetFieldsPane extends AbstractDataSetFieldsPane { + + private UIComboBox nodeName; + private UIComboBox nodeId; + private UIComboBox parentId; + private UITextField seriesName; + private UIComboBox nodeValue; + private CalculateComboBox calculateCombox; + + @Override + protected void initComponents() { + nodeName = new UIComboBox(); + nodeId = new UIComboBox(); + parentId = new UIComboBox(); + seriesName = new UITextField(); + nodeValue = new UIComboBox(); + calculateCombox = new CalculateComboBox(); + + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Node_Name"), + "id", + Toolkit.i18nText("Fine-Design_Chart_Parent_ID"), + Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Value"), + Toolkit.i18nText("Fine-Design_Chart_Summary_Method") + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + return new UIComboBox[]{ + nodeName, + nodeId, + parentId, + nodeValue + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + nodeName, + nodeId, + parentId, + nodeValue, + nodeValue, + calculateCombox + }; + } + + @Override + public void populateBean(StructureColumnFieldCollection ob) { + seriesName.setText(ob.getSeriesName()); + populateField(nodeName, ob.getNodeName()); + populateField(nodeId, ob.getNodeId()); + populateField(parentId, ob.getParentId()); + populateFunctionField(nodeValue, calculateCombox, ob.getNodeValue()); + } + + @Override + public StructureColumnFieldCollection updateBean() { + StructureColumnFieldCollection result = new StructureColumnFieldCollection(); + result.setSeriesName(seriesName.getText()); + updateField(nodeName, result.getNodeName()); + updateField(nodeId, result.getNodeId()); + updateField(parentId, result.getParentId()); + updateFunctionField(nodeValue, calculateCombox, result.getNodeValue()); + return result; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java index 46af0112ce..fc90c87c36 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/WordCloudCellDataFieldsPane.java @@ -64,7 +64,7 @@ public class WordCloudCellDataFieldsPane extends AbstractCellDataFieldsPane