Browse Source
* commit '0dce6dd580fdc3deca9328f8290fc1f9663f8fac': update 代码质量 代码质量 update CHART-4027 系列+值 自定义相关celldata design CHART-4027 系列+值 自定义相关 designresearch/10.0
zheng
6 years ago
18 changed files with 709 additions and 313 deletions
@ -0,0 +1,56 @@
|
||||
package com.fr.design.chartx.component; |
||||
|
||||
import com.fr.chartx.data.field.ColumnField; |
||||
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition; |
||||
import com.fr.chartx.data.field.SeriesValueField; |
||||
import com.fr.design.chartx.component.correlation.AbstractCorrelationPane; |
||||
import com.fr.design.chartx.component.correlation.FieldEditorComponentWrapper; |
||||
import com.fr.design.chartx.component.correlation.TinyFormulaPaneEditorComponent; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.general.GeneralUtils; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/4. |
||||
*/ |
||||
public class CellDataSeriesValueCorrelationPane extends AbstractCorrelationPane<SeriesValueCorrelationDefinition> { |
||||
|
||||
@Override |
||||
protected FieldEditorComponentWrapper[] createFieldEditorComponentWrappers() { |
||||
return new FieldEditorComponentWrapper[]{ |
||||
new TinyFormulaPaneEditorComponent(Toolkit.i18nText("Fine-Design_Chart_Series_Name")), |
||||
new TinyFormulaPaneEditorComponent(Toolkit.i18nText("Fine-Design_Chart_Series_Value")) |
||||
}; |
||||
} |
||||
|
||||
@Override |
||||
protected List<Object[]> covertTBeanToTableModelList(SeriesValueCorrelationDefinition seriesValueCorrelationDefinition) { |
||||
List<Object[]> result = new ArrayList<Object[]>(); |
||||
|
||||
List<SeriesValueField> seriesValueFieldList = seriesValueCorrelationDefinition.getSeriesValueFieldList(); |
||||
for (SeriesValueField seriesValueField : seriesValueFieldList) { |
||||
Object[] array = new Object[]{seriesValueField.getSeries().getFieldName(), seriesValueField.getValue().getFieldName()}; |
||||
result.add(array); |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
protected void setTableModelListToTBean(List<Object[]> tableValues, SeriesValueCorrelationDefinition seriesValueCorrelationDefinition) { |
||||
List<SeriesValueField> seriesValueFieldList = new ArrayList<SeriesValueField>(); |
||||
|
||||
for (Object[] oneLine : tableValues) { |
||||
SeriesValueField seriesValueField = new SeriesValueField(); |
||||
ColumnField series = new ColumnField(GeneralUtils.objectToString(oneLine[0])); |
||||
ColumnField value = new ColumnField(GeneralUtils.objectToString(oneLine[1])); |
||||
seriesValueField.setSeries(series); |
||||
seriesValueField.setValue(value); |
||||
seriesValueFieldList.add(seriesValueField); |
||||
} |
||||
|
||||
seriesValueCorrelationDefinition.setSeriesValueFieldList(seriesValueFieldList); |
||||
} |
||||
} |
@ -1,58 +0,0 @@
|
||||
package com.fr.design.chartx.component; |
||||
|
||||
import com.fr.chartx.data.field.CustomFieldValueColumnFields; |
||||
|
||||
/** |
||||
* Created by shine on 2019/5/17. |
||||
*/ |
||||
public class CustomFieldComboBoxPane extends AbstractCustomFieldComboBoxPane<CustomFieldValueColumnFields> { |
||||
|
||||
@Override |
||||
protected AbstractUseFieldValuePane createUseFieldValuePane() { |
||||
return new UseFieldValuePane(); |
||||
} |
||||
|
||||
@Override |
||||
protected AbstractCustomFieldNamePane createCustomFieldNamePane() { |
||||
return new CustomFieldNamePane(); |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(CustomFieldValueColumnFields ob) { |
||||
if (ob.isCustomFieldValue()) { |
||||
populateCustomFieldNamePane(ob); |
||||
jcb.setSelectedIndex(1); |
||||
} else { |
||||
populateUseFieldValuePane(ob); |
||||
jcb.setSelectedIndex(0); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(CustomFieldValueColumnFields ob) { |
||||
if (jcb.getSelectedIndex() == 0) { |
||||
ob.setCustomFieldValue(false); |
||||
updateUseFieldValuePane(ob); |
||||
} else { |
||||
ob.setCustomFieldValue(true); |
||||
updateCustomFieldNamePane(ob); |
||||
} |
||||
} |
||||
|
||||
private class UseFieldValuePane extends AbstractUseFieldValuePane<CustomFieldValueColumnFields> { |
||||
|
||||
@Override |
||||
public void populateBean(CustomFieldValueColumnFields ob) { |
||||
|
||||
} |
||||
} |
||||
|
||||
private class CustomFieldNamePane extends AbstractCustomFieldNamePane<CustomFieldValueColumnFields> { |
||||
|
||||
@Override |
||||
public void populateBean(CustomFieldValueColumnFields ob) { |
||||
|
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,107 @@
|
||||
package com.fr.design.chartx.component; |
||||
|
||||
import com.fr.chartx.data.field.ColumnField; |
||||
import com.fr.chartx.data.field.SeriesValueCorrelationDefinition; |
||||
import com.fr.chartx.data.field.SeriesValueField; |
||||
import com.fr.data.util.function.AbstractDataFunction; |
||||
import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; |
||||
import com.fr.general.GeneralUtils; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by shine on 2019/5/17. |
||||
*/ |
||||
public class SeriesValueFieldComboBoxPane extends AbstractCustomFieldComboBoxPane<SeriesValueCorrelationDefinition> { |
||||
|
||||
@Override |
||||
protected AbstractUseFieldValuePane createUseFieldValuePane() { |
||||
return new UseFieldValuePane(); |
||||
} |
||||
|
||||
@Override |
||||
protected AbstractCustomFieldNamePane createCustomFieldNamePane() { |
||||
return new CustomFieldNamePane(); |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(SeriesValueCorrelationDefinition ob) { |
||||
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); |
||||
updateCustomFieldNamePane(ob); |
||||
} |
||||
} |
||||
|
||||
private class UseFieldValuePane extends AbstractUseFieldValuePane { |
||||
|
||||
@Override |
||||
public void populateBean(SeriesValueCorrelationDefinition ob) { |
||||
List<SeriesValueField> list = ob.getSeriesValueFieldList(); |
||||
if (list != null && list.size() > 0) { |
||||
populateSeries(list.get(0).getSeries().getFieldName()); |
||||
populateValue(list.get(0).getValue().getFieldName()); |
||||
populateFunction((AbstractDataFunction) list.get(0).getValue().getDataFunction()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(SeriesValueCorrelationDefinition ob) { |
||||
List<SeriesValueField> list = new ArrayList<SeriesValueField>(); |
||||
SeriesValueField seriesValueField = new SeriesValueField(); |
||||
ColumnField series = new ColumnField(updateSeries()); |
||||
ColumnField value = new ColumnField(updateValue()); |
||||
value.setDataFunction(updateFunction()); |
||||
seriesValueField.setValue(value); |
||||
seriesValueField.setSeries(series); |
||||
list.add(seriesValueField); |
||||
ob.setSeriesValueFieldList(list); |
||||
} |
||||
} |
||||
|
||||
private class CustomFieldNamePane extends AbstractCustomFieldNamePane { |
||||
@Override |
||||
protected List<Object[]> covertTBeanToTableModelList(SeriesValueCorrelationDefinition seriesValueCorrelationDefinition) { |
||||
List<Object[]> list = new ArrayList<Object[]>(); |
||||
for (SeriesValueField seriesValueField : seriesValueCorrelationDefinition.getSeriesValueFieldList()) { |
||||
Object[] array = new Object[]{ |
||||
seriesValueField.getSeries().getFieldName(), |
||||
seriesValueField.getValue().getFieldName(), |
||||
DataPaneHelper.getFunctionString(seriesValueField.getValue().getDataFunction()) |
||||
}; |
||||
list.add(array); |
||||
} |
||||
return list; |
||||
} |
||||
|
||||
@Override |
||||
protected void setTableModelListToTBean(List<Object[]> tableValues, SeriesValueCorrelationDefinition seriesValueCorrelationDefinition) { |
||||
List<SeriesValueField> seriesValueFields = new ArrayList<SeriesValueField>(); |
||||
for (Object[] line : tableValues) { |
||||
ColumnField series = new ColumnField(GeneralUtils.objectToString(line[0])); |
||||
ColumnField value = new ColumnField(GeneralUtils.objectToString(line[1])); |
||||
value.setDataFunction(DataPaneHelper.getFunctionByName(GeneralUtils.objectToString(line[2]))); |
||||
SeriesValueField seriesValueField = new SeriesValueField(); |
||||
seriesValueField.setValue(value); |
||||
seriesValueField.setSeries(series); |
||||
seriesValueFields.add(seriesValueField); |
||||
} |
||||
seriesValueCorrelationDefinition.setSeriesValueFieldList(seriesValueFields); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,130 @@
|
||||
package com.fr.design.chartx.component.correlation; |
||||
|
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.gui.frpane.UICorrelationPane; |
||||
import com.fr.design.gui.itable.UITable; |
||||
import com.fr.design.gui.itable.UITableEditor; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.JTable; |
||||
import javax.swing.event.ChangeEvent; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Component; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/4. |
||||
* 自定义editorComponent + 支持多种数据格式 |
||||
*/ |
||||
public abstract class AbstractCorrelationPane<T> extends BasicBeanPane<T> { |
||||
private FieldEditorComponentWrapper[] editorComponents; |
||||
|
||||
private UICorrelationPane correlationPane; |
||||
|
||||
public AbstractCorrelationPane() { |
||||
|
||||
this.editorComponents = createFieldEditorComponentWrappers(); |
||||
|
||||
String[] headers = new String[editorComponents.length]; |
||||
|
||||
for (int i = 0, len = editorComponents.length; i < len; i++) { |
||||
headers[i] = editorComponents[i].headerName(); |
||||
} |
||||
|
||||
initComps(headers); |
||||
} |
||||
|
||||
protected abstract FieldEditorComponentWrapper[] createFieldEditorComponentWrappers(); |
||||
|
||||
@Override |
||||
public void populateBean(T ob) { |
||||
correlationPane.populateBean(covertTBeanToTableModelList(ob)); |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(T ob) { |
||||
setTableModelListToTBean(correlationPane.updateBean(), ob); |
||||
} |
||||
|
||||
@Override |
||||
public T updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
protected abstract List<Object[]> covertTBeanToTableModelList(T t); |
||||
|
||||
protected abstract void setTableModelListToTBean(List<Object[]> tableValues, T t); |
||||
|
||||
private void initComps(String[] headers) { |
||||
correlationPane = new UICorrelationPane(headers) { |
||||
public UITableEditor createUITableEditor() { |
||||
return new Editor(); |
||||
} |
||||
|
||||
protected UITable initUITable() { |
||||
return new UITable(columnCount) { |
||||
|
||||
public UITableEditor createTableEditor() { |
||||
return createUITableEditor(); |
||||
} |
||||
|
||||
public void tableCellEditingStopped(ChangeEvent e) { |
||||
stopPaneEditing(e); |
||||
} |
||||
}; |
||||
} |
||||
|
||||
protected ActionListener getAddButtonListener() { |
||||
return new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
tablePane.addLine(createLine()); |
||||
fireTargetChanged(); |
||||
} |
||||
}; |
||||
} |
||||
}; |
||||
|
||||
this.setLayout(new BorderLayout()); |
||||
this.add(correlationPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
protected Object[] createLine() { |
||||
return new Object[this.editorComponents.length]; |
||||
} |
||||
|
||||
|
||||
private class Editor extends UITableEditor { |
||||
|
||||
private Component currentComponent; |
||||
private FieldEditorComponentWrapper currentEditorWrapper; |
||||
|
||||
public Object getCellEditorValue() { |
||||
return currentEditorWrapper.getValue(currentComponent); |
||||
} |
||||
|
||||
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { |
||||
if (column == table.getModel().getColumnCount()) { |
||||
return null; |
||||
} |
||||
|
||||
correlationPane.stopCellEditing(); |
||||
|
||||
currentEditorWrapper = AbstractCorrelationPane.this.editorComponents[column]; |
||||
|
||||
currentComponent = currentEditorWrapper.getTableCellEditorComponent(correlationPane, table, isSelected, row, column); |
||||
currentEditorWrapper.setValue(currentComponent, value); |
||||
|
||||
return currentComponent; |
||||
} |
||||
|
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,19 @@
|
||||
package com.fr.design.chartx.component.correlation; |
||||
|
||||
import java.awt.Component; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/10. |
||||
*/ |
||||
public abstract class AbstractEditorComponent<T extends Component> implements FieldEditorComponentWrapper<T> { |
||||
private String header; |
||||
|
||||
public AbstractEditorComponent(String header) { |
||||
this.header = header; |
||||
} |
||||
|
||||
@Override |
||||
public String headerName() { |
||||
return this.header; |
||||
} |
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.fr.design.chartx.component.correlation; |
||||
|
||||
import com.fr.design.gui.frpane.UICorrelationPane; |
||||
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; |
||||
|
||||
import javax.swing.JTable; |
||||
import java.awt.event.ItemEvent; |
||||
import java.awt.event.ItemListener; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/10. |
||||
*/ |
||||
public class CalculateComboBoxEditorComponent extends AbstractEditorComponent<CalculateComboBox> { |
||||
|
||||
public CalculateComboBoxEditorComponent(String header) { |
||||
super(header); |
||||
} |
||||
|
||||
@Override |
||||
public CalculateComboBox getTableCellEditorComponent(final UICorrelationPane parent, JTable table, boolean isSelected, int row, int column) { |
||||
|
||||
CalculateComboBox calculateComboBox = new CalculateComboBox(); |
||||
|
||||
calculateComboBox.addItemListener(new ItemListener() { |
||||
public void itemStateChanged(ItemEvent e) { |
||||
parent.stopCellEditing(); |
||||
parent.fireTargetChanged(); |
||||
} |
||||
}); |
||||
return calculateComboBox; |
||||
} |
||||
|
||||
@Override |
||||
public Object getValue(CalculateComboBox calculateComboBox) { |
||||
return calculateComboBox.getSelectedItem(); |
||||
} |
||||
|
||||
@Override |
||||
public void setValue(CalculateComboBox calculateComboBox, Object o) { |
||||
|
||||
if (o != null) { |
||||
calculateComboBox.setSelectedItem(o); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.chartx.component.correlation; |
||||
|
||||
import com.fr.design.gui.frpane.UICorrelationPane; |
||||
|
||||
import javax.swing.JTable; |
||||
import java.awt.Component; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/4. |
||||
*/ |
||||
public interface FieldEditorComponentWrapper<T extends Component> { |
||||
|
||||
String headerName(); |
||||
|
||||
T getTableCellEditorComponent(UICorrelationPane parent, JTable table, boolean isSelected, final int row, int column); |
||||
|
||||
Object getValue(T t); |
||||
|
||||
void setValue(T t, Object o); |
||||
} |
@ -0,0 +1,56 @@
|
||||
package com.fr.design.chartx.component.correlation; |
||||
|
||||
import com.fr.base.BaseFormula; |
||||
import com.fr.base.Utils; |
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.event.UIObserverListener; |
||||
import com.fr.design.formula.TinyFormulaPane; |
||||
import com.fr.design.gui.frpane.UICorrelationPane; |
||||
|
||||
import javax.swing.JTable; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/4. |
||||
*/ |
||||
public class TinyFormulaPaneEditorComponent extends AbstractEditorComponent<TinyFormulaPane> { |
||||
|
||||
public TinyFormulaPaneEditorComponent(String header) { |
||||
super(header); |
||||
} |
||||
|
||||
@Override |
||||
public TinyFormulaPane getTableCellEditorComponent(final UICorrelationPane parent, JTable table, boolean isSelected, final int row, int column) { |
||||
TinyFormulaPane editorComponent = new TinyFormulaPane() { |
||||
@Override |
||||
public void okEvent() { |
||||
parent.stopCellEditing(); |
||||
parent.fireTargetChanged(); |
||||
} |
||||
|
||||
@Override |
||||
protected void populateTextField(BaseFormula fm) { |
||||
formulaTextField.setText(fm.getContent()); |
||||
} |
||||
}; |
||||
editorComponent.setBackground(UIConstants.FLESH_BLUE); |
||||
|
||||
editorComponent.getUITextField().registerChangeListener(new UIObserverListener() { |
||||
@Override |
||||
public void doChange() { |
||||
parent.fireTargetChanged(); |
||||
} |
||||
}); |
||||
|
||||
return editorComponent; |
||||
} |
||||
|
||||
@Override |
||||
public Object getValue(TinyFormulaPane formulaPane) { |
||||
return formulaPane.getUITextField().getText(); |
||||
} |
||||
|
||||
@Override |
||||
public void setValue(TinyFormulaPane formulaPane, Object o) { |
||||
formulaPane.getUITextField().setText(Utils.objectToString(o)); |
||||
} |
||||
} |
@ -0,0 +1,55 @@
|
||||
package com.fr.design.chartx.component.correlation; |
||||
|
||||
import com.fr.design.gui.frpane.UICorrelationPane; |
||||
import com.fr.design.gui.icombobox.UIComboBox; |
||||
import com.fr.design.gui.itable.UITable; |
||||
|
||||
import javax.swing.JTable; |
||||
import java.awt.event.ItemEvent; |
||||
import java.awt.event.ItemListener; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/10. |
||||
*/ |
||||
public class UIComboBoxEditorComponent extends AbstractEditorComponent<UIComboBox> { |
||||
|
||||
public UIComboBoxEditorComponent(String header) { |
||||
super(header); |
||||
} |
||||
|
||||
protected List<String> items() { |
||||
return new ArrayList<String>(); |
||||
} |
||||
|
||||
@Override |
||||
public UIComboBox getTableCellEditorComponent(final UICorrelationPane parent, JTable table, boolean isSelected, final int row, int column) { |
||||
UIComboBox uiComboBox = new UIComboBox(items().toArray()); |
||||
|
||||
uiComboBox.addItemListener(new ItemListener() { |
||||
public void itemStateChanged(ItemEvent e) { |
||||
parent.stopCellEditing(); |
||||
parent.fireTargetChanged(); |
||||
UITable table = parent.getTable(); |
||||
Object object = table.getValueAt(row, 0); |
||||
if (object != null) { |
||||
table.setValueAt(object, row, 1); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
return uiComboBox; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public Object getValue(UIComboBox uiComboBox) { |
||||
return uiComboBox.getSelectedItem(); |
||||
} |
||||
|
||||
@Override |
||||
public void setValue(UIComboBox uiComboBox, Object o) { |
||||
uiComboBox.getModel().setSelectedItem(o); |
||||
} |
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.fr.design.chartx.component.correlation; |
||||
|
||||
import com.fr.design.event.UIObserverListener; |
||||
import com.fr.design.gui.frpane.UICorrelationPane; |
||||
import com.fr.design.gui.itextfield.UITextField; |
||||
import com.fr.general.GeneralUtils; |
||||
|
||||
import javax.swing.JTable; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/10. |
||||
*/ |
||||
public class UITextFieldEditorComponent extends AbstractEditorComponent<UITextField> { |
||||
public UITextFieldEditorComponent(String header) { |
||||
super(header); |
||||
} |
||||
|
||||
@Override |
||||
public UITextField getTableCellEditorComponent(final UICorrelationPane parent, JTable table, boolean isSelected, int row, int column) { |
||||
UITextField uiTextField = new UITextField(); |
||||
|
||||
uiTextField.registerChangeListener(new UIObserverListener() { |
||||
@Override |
||||
public void doChange() { |
||||
parent.fireTargetChanged(); |
||||
} |
||||
}); |
||||
|
||||
return uiTextField; |
||||
} |
||||
|
||||
@Override |
||||
public Object getValue(UITextField uiTextField) { |
||||
return uiTextField.getText(); |
||||
} |
||||
|
||||
@Override |
||||
public void setValue(UITextField uiTextField, Object o) { |
||||
uiTextField.setText(GeneralUtils.objectToString(o)); |
||||
} |
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.fr.design.chartx.fields.diff; |
||||
|
||||
import com.fr.chartx.data.field.diff.AbstractColumnFieldCollectionWithSeriesValue; |
||||
import com.fr.design.chartx.component.CellDataSeriesValueCorrelationPane; |
||||
import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.BorderLayout; |
||||
|
||||
/** |
||||
* Created by shine on 2019/6/4. |
||||
*/ |
||||
public abstract class AbstractCellDataFieldsWithSeriesValuePane<T extends AbstractColumnFieldCollectionWithSeriesValue> |
||||
extends AbstractCellDataFieldsPane<T> { |
||||
|
||||
private CellDataSeriesValueCorrelationPane seriesValueFieldsPane; |
||||
|
||||
@Override |
||||
protected JPanel createCenterPane() { |
||||
JPanel normalCenter = super.createCenterPane(); |
||||
seriesValueFieldsPane = new CellDataSeriesValueCorrelationPane(); |
||||
|
||||
if (normalCenter != null) { |
||||
JPanel panel = new JPanel(new BorderLayout()); |
||||
panel.add(normalCenter, BorderLayout.CENTER); |
||||
panel.add(seriesValueFieldsPane, BorderLayout.SOUTH); |
||||
return panel; |
||||
} else { |
||||
return seriesValueFieldsPane; |
||||
} |
||||
} |
||||
|
||||
protected void populateSeriesValuePane(AbstractColumnFieldCollectionWithSeriesValue fieldCollectionWithSeriesValue) { |
||||
seriesValueFieldsPane.populateBean(fieldCollectionWithSeriesValue.getSeriesValueCorrelationDefinition()); |
||||
} |
||||
|
||||
protected void updateSeriesValuePane(AbstractColumnFieldCollectionWithSeriesValue fieldCollectionWithSeriesValue) { |
||||
seriesValueFieldsPane.updateBean(fieldCollectionWithSeriesValue.getSeriesValueCorrelationDefinition()); |
||||
} |
||||
|
||||
} |
@ -1,60 +0,0 @@
|
||||
package com.fr.design.chartx.fields.diff; |
||||
|
||||
import com.fr.chartx.data.field.diff.AbstractColumnFieldCollectionWithCustomField; |
||||
import com.fr.design.chartx.component.CustomFieldComboBoxPane; |
||||
import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.BorderLayout; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by shine on 2019/5/16. |
||||
* 带有 自定义系列名(fr表现为 系列名使用字段名) 的字段集合 的一个pane |
||||
*/ |
||||
public abstract class AbstractDataSetFieldsWithCustomFieldPane<T extends AbstractColumnFieldCollectionWithCustomField> |
||||
extends AbstractDataSetFieldsPane<T> { |
||||
|
||||
private CustomFieldComboBoxPane customFieldComboBoxPane; |
||||
|
||||
@Override |
||||
protected JPanel createCenterPane() { |
||||
JPanel normalCenter = super.createCenterPane(); |
||||
customFieldComboBoxPane = new CustomFieldComboBoxPane(); |
||||
|
||||
if (normalCenter != null) { |
||||
JPanel panel = new JPanel(new BorderLayout()); |
||||
panel.add(normalCenter, BorderLayout.CENTER); |
||||
panel.add(customFieldComboBoxPane, BorderLayout.SOUTH); |
||||
return panel; |
||||
} else { |
||||
return customFieldComboBoxPane; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void checkBoxUse(boolean hasUse) { |
||||
super.checkBoxUse(hasUse); |
||||
customFieldComboBoxPane.checkBoxUse(hasUse); |
||||
} |
||||
|
||||
@Override |
||||
public void clearAllBoxList() { |
||||
super.clearAllBoxList(); |
||||
customFieldComboBoxPane.clearAllBoxList(); |
||||
} |
||||
|
||||
@Override |
||||
public void refreshBoxListWithSelectTableData(List columnNameList) { |
||||
super.refreshBoxListWithSelectTableData(columnNameList); |
||||
customFieldComboBoxPane.refreshBoxListWithSelectTableData(columnNameList); |
||||
} |
||||
|
||||
protected void populateCustomPane(AbstractColumnFieldCollectionWithCustomField t) { |
||||
customFieldComboBoxPane.populateBean(t.getCustomFieldValueColumnFields()); |
||||
} |
||||
|
||||
protected void updateCustomPane(AbstractColumnFieldCollectionWithCustomField t) { |
||||
customFieldComboBoxPane.updateBean(t.getCustomFieldValueColumnFields()); |
||||
} |
||||
} |
@ -0,0 +1,60 @@
|
||||
package com.fr.design.chartx.fields.diff; |
||||
|
||||
import com.fr.chartx.data.field.diff.AbstractColumnFieldCollectionWithSeriesValue; |
||||
import com.fr.design.chartx.component.SeriesValueFieldComboBoxPane; |
||||
import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.BorderLayout; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by shine on 2019/5/16. |
||||
* 带有 自定义系列名(fr表现为 系列名使用字段名) 的字段集合 的一个pane |
||||
*/ |
||||
public abstract class AbstractDataSetFieldsWithSeriesValuePane<T extends AbstractColumnFieldCollectionWithSeriesValue> |
||||
extends AbstractDataSetFieldsPane<T> { |
||||
|
||||
private SeriesValueFieldComboBoxPane seriesValueFieldComboBoxPane; |
||||
|
||||
@Override |
||||
protected JPanel createCenterPane() { |
||||
JPanel normalCenter = super.createCenterPane(); |
||||
seriesValueFieldComboBoxPane = new SeriesValueFieldComboBoxPane(); |
||||
|
||||
if (normalCenter != null) { |
||||
JPanel panel = new JPanel(new BorderLayout()); |
||||
panel.add(normalCenter, BorderLayout.CENTER); |
||||
panel.add(seriesValueFieldComboBoxPane, BorderLayout.SOUTH); |
||||
return panel; |
||||
} else { |
||||
return seriesValueFieldComboBoxPane; |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void checkBoxUse(boolean hasUse) { |
||||
super.checkBoxUse(hasUse); |
||||
seriesValueFieldComboBoxPane.checkBoxUse(hasUse); |
||||
} |
||||
|
||||
@Override |
||||
public void clearAllBoxList() { |
||||
super.clearAllBoxList(); |
||||
seriesValueFieldComboBoxPane.clearAllBoxList(); |
||||
} |
||||
|
||||
@Override |
||||
public void refreshBoxListWithSelectTableData(List columnNameList) { |
||||
super.refreshBoxListWithSelectTableData(columnNameList); |
||||
seriesValueFieldComboBoxPane.refreshBoxListWithSelectTableData(columnNameList); |
||||
} |
||||
|
||||
protected void populateSeriesValuePane(AbstractColumnFieldCollectionWithSeriesValue fieldCollectionWithSeriesValue) { |
||||
seriesValueFieldComboBoxPane.populateBean(fieldCollectionWithSeriesValue.getSeriesValueCorrelationDefinition()); |
||||
} |
||||
|
||||
protected void updateSeriesValuePane(AbstractColumnFieldCollectionWithSeriesValue fieldCollectionWithSeriesValue) { |
||||
seriesValueFieldComboBoxPane.updateBean(fieldCollectionWithSeriesValue.getSeriesValueCorrelationDefinition()); |
||||
} |
||||
} |
Loading…
Reference in new issue