Maksim
5 years ago
214 changed files with 3520 additions and 3534 deletions
@ -0,0 +1,23 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.common.annotations.Open; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@Open |
||||
public interface MultiStyleUIConfigProvider extends Mutable { |
||||
String XML_TAG = "MultiStyleUIConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 获取配置项list |
||||
* |
||||
* @return 配置项list |
||||
*/ |
||||
List<StyleUIConfigProvider> getConfigList(); |
||||
} |
@ -0,0 +1,40 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.file.FILEChooserPane; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import javax.swing.Icon; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-10-11 |
||||
*/ |
||||
public interface ReportSupportedFileUIProvider extends Mutable { |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
String XML_TAG = "ReportSupportedFileUIProvider"; |
||||
|
||||
/** |
||||
* 向文件选择器中添加指定文件类型过滤器 |
||||
* @param fileChooser 文件选择器 |
||||
* @param suffix 文件后缀 |
||||
*/ |
||||
void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); |
||||
|
||||
|
||||
/** |
||||
* 获取文件关联的icon |
||||
* @param path 文件路径 |
||||
* @param isShowLock 是否显示被锁住 |
||||
* @return 对应的图标 |
||||
*/ |
||||
Icon getFileIcon(String path,boolean isShowLock); |
||||
|
||||
/** |
||||
* 保存为新类型文件 |
||||
* @param targetPath 目标路径 |
||||
* @param jTemplate 模板对象 |
||||
*/ |
||||
boolean saveToNewFile(String targetPath, JTemplate jTemplate); |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.common.annotations.Open; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@Open |
||||
public interface StyleUIConfigProvider extends Mutable { |
||||
String XML_TAG = "CustomStyleUIConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* @return 配置名 |
||||
*/ |
||||
String configName(); |
||||
|
||||
/** |
||||
* @param changeListener 需要添加的listener |
||||
* @return 对应的component |
||||
*/ |
||||
JComponent uiComponent(ChangeListener changeListener); |
||||
|
||||
/** |
||||
* @return 更新后的样式 |
||||
*/ |
||||
Style updateConfig(); |
||||
|
||||
/** |
||||
* @param style 待渲染的样式 |
||||
*/ |
||||
void populateConfig(Style style); |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.StyleUIConfigProvider; |
||||
import com.fr.design.fun.MultiStyleUIConfigProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@API(level = MultiStyleUIConfigProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractMultiStyleUIConfigProvider extends AbstractProvider implements MultiStyleUIConfigProvider { |
||||
@Override |
||||
public List<StyleUIConfigProvider> getConfigList() { |
||||
return new ArrayList<StyleUIConfigProvider>(); |
||||
} |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,40 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.ReportSupportedFileUIProvider; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.file.FILEChooserPane; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import javax.swing.Icon; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-10-14 |
||||
*/ |
||||
@API(level = ReportSupportedFileUIProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractReportSupportedFileUIProvider extends AbstractProvider implements ReportSupportedFileUIProvider { |
||||
@Override |
||||
public void addChooseFileFilter(FILEChooserPane fileChooser, String suffix) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public Icon getFileIcon(String path, boolean isShowLock) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public boolean saveToNewFile(String targetPath, JTemplate jTemplate) { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
} |
@ -0,0 +1,41 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.design.fun.StyleUIConfigProvider; |
||||
import com.fr.stable.StringUtils; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-11 |
||||
*/ |
||||
@API(level = StyleUIConfigProvider.CURRENT_LEVEL) |
||||
public class AbstractStyleUIConfigProvider extends AbstractProvider implements StyleUIConfigProvider { |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String configName() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public JComponent uiComponent(ChangeListener changeListener) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public Style updateConfig() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void populateConfig(Style style) { |
||||
|
||||
} |
||||
} |
@ -1,51 +1,63 @@
|
||||
package com.fr.design.gui.itree.filetree; |
||||
|
||||
import com.fr.base.extension.FileExtension; |
||||
import com.fr.base.io.BaseBook; |
||||
import com.fr.design.ExtraDesignClassManager; |
||||
import com.fr.design.mainframe.AbstractAppProvider; |
||||
import com.fr.design.mainframe.App; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.file.FILE; |
||||
import com.fr.report.ExtraReportClassManager; |
||||
import com.fr.report.fun.ReportSupportedFileProvider; |
||||
import com.fr.report.fun.impl.AbstractReportSupportedFileProvider; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
import org.easymock.EasyMock; |
||||
import org.junit.Assert; |
||||
import org.junit.Test; |
||||
|
||||
import org.junit.runner.RunWith; |
||||
import org.powermock.api.easymock.PowerMock; |
||||
import org.powermock.core.classloader.annotations.PrepareForTest; |
||||
import org.powermock.modules.junit4.PowerMockRunner; |
||||
import java.util.HashSet; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* Created by alex sung on 2019/7/25. |
||||
*/ |
||||
@RunWith(PowerMockRunner.class) |
||||
@PrepareForTest(ExtraReportClassManager.class) |
||||
public class FileNodeConstantsTest { |
||||
@Test |
||||
public void supportFileTypesTest(){ |
||||
ExtraDesignClassManager extra = EasyMock.mock(ExtraDesignClassManager.class); |
||||
Set<Mutable> apps = new HashSet<Mutable>(){{add(new MockCptxApp());}}; |
||||
EasyMock.expect(extra.getArray(App.MARK_STRING)).andReturn(apps).anyTimes(); |
||||
EasyMock.replay(extra); |
||||
public void supportFileTypesTest() { |
||||
ExtraReportClassManager extra = mockExtraReportClassManager(); |
||||
Assert.assertEquals(1, extra.getArray(ReportSupportedFileProvider.XML_TAG).size()); |
||||
ReportSupportedFileProvider option = (ReportSupportedFileProvider) extra.getArray(ReportSupportedFileProvider.XML_TAG).iterator().next(); |
||||
Assert.assertEquals(FileExtension.CPTX, option.getFileExtensions()[0]); |
||||
} |
||||
|
||||
Assert.assertEquals(1, extra.getArray(App.MARK_STRING).size()); |
||||
App app = (App) extra.getArray(App.MARK_STRING).iterator().next(); |
||||
Assert.assertEquals("cptx", app.defaultExtensions()[0]); |
||||
@Test |
||||
public void testSupportFileTypesOrder() { |
||||
ExtraReportClassManager extra = mockExtraReportClassManager(); |
||||
PowerMock.mockStatic(ExtraReportClassManager.class); |
||||
EasyMock.expect(ExtraReportClassManager.getInstance()).andReturn(extra).once(); |
||||
PowerMock.replayAll(); |
||||
String[] fileTypes = FileNodeConstants.getSupportFileTypes(); |
||||
Assert.assertEquals("cptx", fileTypes[0]); |
||||
Assert.assertEquals("cpt", fileTypes[1]); |
||||
} |
||||
|
||||
private class MockCptxApp extends AbstractAppProvider{ |
||||
@Override |
||||
public String[] defaultExtensions() { |
||||
return new String[] {FileExtension.CPTX.getExtension()}; |
||||
} |
||||
private ExtraReportClassManager mockExtraReportClassManager() { |
||||
ExtraReportClassManager extra = EasyMock.mock(ExtraReportClassManager.class); |
||||
Set<Mutable> options = new HashSet<Mutable>() {{ |
||||
add(new MockNewTemplateFileOption()); |
||||
}}; |
||||
EasyMock.expect(extra.getArray(ReportSupportedFileProvider.XML_TAG)).andReturn(options).anyTimes(); |
||||
EasyMock.replay(extra); |
||||
return extra; |
||||
} |
||||
|
||||
@Override |
||||
public JTemplate openTemplate(FILE tplFile) { |
||||
return null; |
||||
} |
||||
private class MockNewTemplateFileOption extends AbstractReportSupportedFileProvider { |
||||
|
||||
@Override |
||||
public BaseBook asIOFile(FILE tplFile) { |
||||
return null; |
||||
public FileExtension[] getFileExtensions() { |
||||
return new FileExtension[]{FileExtension.CPTX |
||||
}; |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,39 @@
|
||||
package com.fr.file; |
||||
|
||||
import com.fr.base.extension.FileExtension; |
||||
import com.fr.file.filter.ChooseFileFilter; |
||||
import com.fr.invoke.Reflect; |
||||
import com.fr.stable.StringUtils; |
||||
import org.junit.Assert; |
||||
import org.junit.Test; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-10-15 |
||||
*/ |
||||
|
||||
public class FILEChooserPaneTest { |
||||
@Test |
||||
public void testAddChooseFileFilter() { |
||||
FILEChooserPane chooserPane = Reflect.on(FILEChooserPane.class).field("INSTANCE").get(); |
||||
Reflect.on(chooserPane).set("suffix", ".cpt"); |
||||
String result1 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", null).get(); |
||||
Assert.assertEquals("WorkBook1.cpt", result1); |
||||
|
||||
ChooseFileFilter chooseFileFilter1 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); |
||||
String result2 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter1).get(); |
||||
Assert.assertEquals("WorkBook1.cpt", result2); |
||||
|
||||
ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); |
||||
String result3 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter2).get(); |
||||
Assert.assertEquals("WorkBook1.cptx", result3); |
||||
|
||||
ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); |
||||
String result4 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter3).get(); |
||||
Assert.assertEquals("WorkBook1.cpt", result4); |
||||
|
||||
ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); |
||||
String result5 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter5).get(); |
||||
Assert.assertEquals("WorkBook1.cptx", result5); |
||||
} |
||||
|
||||
} |
@ -1,52 +0,0 @@
|
||||
package com.fr.design.chartx; |
||||
|
||||
import com.fr.chartx.data.GanttChartDataDefinition; |
||||
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane; |
||||
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane; |
||||
import com.fr.design.chartx.single.SingleDataPane; |
||||
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||
import com.fr.van.chart.map.designer.VanChartGroupPane; |
||||
|
||||
import javax.swing.JPanel; |
||||
|
||||
/** |
||||
* Created by shine on 2019/5/22. |
||||
*/ |
||||
public class GanttChartDataPane extends AbstractChartDataPane<GanttChartDataDefinition> { |
||||
|
||||
private AbstractVanSingleDataPane dataPane; |
||||
private AbstractVanSingleDataPane linkPane; |
||||
|
||||
@Override |
||||
protected JPanel createContentPane() { |
||||
dataPane = new AbstractVanSingleDataPane(listener) { |
||||
@Override |
||||
protected SingleDataPane createSingleDataPane() { |
||||
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); |
||||
} |
||||
}; |
||||
linkPane = new AbstractVanSingleDataPane(listener) { |
||||
@Override |
||||
protected SingleDataPane createSingleDataPane() { |
||||
return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); |
||||
} |
||||
}; |
||||
return new VanChartGroupPane(new String[]{"data", "link"}, new JPanel[]{dataPane, linkPane}) { |
||||
}; |
||||
} |
||||
|
||||
public GanttChartDataPane(AttributeChangeListener listener) { |
||||
super(listener); |
||||
} |
||||
|
||||
@Override |
||||
public void populate(GanttChartDataDefinition ganttChartDataDefinition) { |
||||
dataPane.populate(ganttChartDataDefinition.getDataDefinition()); |
||||
linkPane.populate(ganttChartDataDefinition.getLinkDefinition()); |
||||
} |
||||
|
||||
@Override |
||||
public GanttChartDataDefinition update() { |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,66 @@
|
||||
package com.fr.design.chartx.component; |
||||
|
||||
import com.fr.base.Utils; |
||||
import com.fr.chartx.data.field.ColumnField; |
||||
import com.fr.chartx.data.field.diff.BubbleColumnField; |
||||
import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection; |
||||
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 java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by Wim on 2019/11/04. |
||||
*/ |
||||
public class CellDataSeriesXYValueCorrelationPane extends AbstractCorrelationPane<BubbleColumnFieldCollection> { |
||||
|
||||
@Override |
||||
protected FieldEditorComponentWrapper[] createFieldEditorComponentWrappers() { |
||||
return new FieldEditorComponentWrapper[]{ |
||||
new TinyFormulaPaneEditorComponent(Toolkit.i18nText("Fine-Design_Chart_Series_Name")), |
||||
new TinyFormulaPaneEditorComponent(Toolkit.i18nText("Fine-Design_Chart_X_Axis")), |
||||
new TinyFormulaPaneEditorComponent(Toolkit.i18nText("Fine-Design_Chart_Y_Axis")), |
||||
new TinyFormulaPaneEditorComponent(Toolkit.i18nText("Fine-Design_Chart_Series_Value")) |
||||
}; |
||||
} |
||||
|
||||
@Override |
||||
protected List<Object[]> covertTBeanToTableModelList(BubbleColumnFieldCollection bubbleColumnFieldCollection) { |
||||
List<Object[]> result = new ArrayList<>(); |
||||
|
||||
List<BubbleColumnField> bubbleColumnFieldList = bubbleColumnFieldCollection.getList(); |
||||
for (BubbleColumnField field : bubbleColumnFieldList) { |
||||
Object[] array = new Object[]{ |
||||
field.getSeriesName().getFieldName(), |
||||
field.getXField().getFieldName(), |
||||
field.getYField().getFieldName(), |
||||
field.getSizeField().getFieldName() |
||||
}; |
||||
result.add(array); |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
protected void setTableModelListToTBean(List<Object[]> tableValues, BubbleColumnFieldCollection bubbleColumnFieldCollection) { |
||||
List<BubbleColumnField> bubbleColumnFieldList = new ArrayList<>(); |
||||
for (Object[] oneLine : tableValues) { |
||||
BubbleColumnField bubbleColumnField = new BubbleColumnField(); |
||||
ColumnField series = new ColumnField(Utils.objectToString(oneLine[0])); |
||||
ColumnField xField = new ColumnField(Utils.objectToString(oneLine[1])); |
||||
ColumnField yField = new ColumnField(Utils.objectToString(oneLine[2])); |
||||
ColumnField value = new ColumnField(Utils.objectToString(oneLine[3])); |
||||
bubbleColumnField.setSeriesName(series); |
||||
bubbleColumnField.setXField(xField); |
||||
bubbleColumnField.setYField(yField); |
||||
bubbleColumnField.setSizeField(value); |
||||
bubbleColumnFieldList.add(bubbleColumnField); |
||||
} |
||||
|
||||
bubbleColumnFieldCollection.setList(bubbleColumnFieldList); |
||||
} |
||||
} |
@ -0,0 +1,76 @@
|
||||
package com.fr.design.chartx.data.drillMap; |
||||
|
||||
import com.fr.chartx.data.DrillMapChartDataDefinition; |
||||
import com.fr.design.chartx.AbstractChartDataPane; |
||||
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; |
||||
import com.fr.van.chart.map.designer.VanChartGroupPane; |
||||
|
||||
import javax.swing.JPanel; |
||||
|
||||
/** |
||||
* @author shine |
||||
* @version 10.0 |
||||
* Created by shine on 2019/11/13 |
||||
*/ |
||||
public class DrillMapChartDataPane extends AbstractChartDataPane<DrillMapChartDataDefinition> { |
||||
private DrillMapLayerPane layerPane; |
||||
private DrillMapDataPane dataPane; |
||||
|
||||
public DrillMapChartDataPane(AttributeChangeListener listener) { |
||||
super(listener); |
||||
} |
||||
|
||||
private VanChartDrillMapPlot getDrillMapPlot() { |
||||
if (getVanChart() != null) { |
||||
return getVanChart().getPlot(); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
protected JPanel createContentPane() { |
||||
VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); |
||||
if (drillMapPlot == null) { |
||||
return new JPanel(); |
||||
} |
||||
|
||||
layerPane = new DrillMapLayerPane(drillMapPlot); |
||||
dataPane = new DrillMapDataPane(drillMapPlot); |
||||
return new VanChartGroupPane(new String[]{Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level"), Toolkit.i18nText("Fine-Design_Chart_Use_Data")}, |
||||
new JPanel[]{layerPane, dataPane}) { |
||||
@Override |
||||
protected void tabChanged(int index) { |
||||
if (index == 0) { |
||||
return; |
||||
} |
||||
dataPane.fireMapTypeChanged(); |
||||
} |
||||
}; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected void populate(DrillMapChartDataDefinition drillMapChartDataDefinition) { |
||||
if (drillMapChartDataDefinition == null) { |
||||
return; |
||||
} |
||||
VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); |
||||
|
||||
layerPane.populateBean(drillMapPlot); |
||||
dataPane.populateBean(drillMapChartDataDefinition); |
||||
} |
||||
|
||||
@Override |
||||
protected DrillMapChartDataDefinition update() { |
||||
VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); |
||||
|
||||
layerPane.updateBean(drillMapPlot); |
||||
|
||||
DrillMapChartDataDefinition definition = new DrillMapChartDataDefinition(); |
||||
dataPane.updateBean(definition); |
||||
|
||||
return definition; |
||||
} |
||||
} |
@ -0,0 +1,120 @@
|
||||
package com.fr.design.chartx.data.drillMap; |
||||
|
||||
import com.fr.chartx.data.DrillMapChartDataDefinition; |
||||
import com.fr.design.beans.BasicBeanPane; |
||||
import com.fr.design.beans.FurtherBasicBeanPane; |
||||
import com.fr.design.chartx.fields.diff.AreaMapCellDataFieldsPane; |
||||
import com.fr.design.chartx.fields.diff.AreaMapDataSetFieldsPane; |
||||
import com.fr.design.chartx.single.SingleDataPane; |
||||
import com.fr.design.gui.frpane.UIComboBoxPane; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; |
||||
|
||||
import java.awt.BorderLayout; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by Mitisky on 16/6/20. |
||||
* 钻取地图数据配置界面中 和钻取层级平级的数据界面 |
||||
*/ |
||||
public class DrillMapDataPane extends BasicBeanPane<DrillMapChartDataDefinition> { |
||||
private UIComboBoxPane<DrillMapChartDataDefinition> dataDefinitionType;//数据定义方式:底层数据汇总/各层级分别指定
|
||||
|
||||
private SingleDataPane bottomDataPane;//底层数据汇总方式定义钻取地图数据
|
||||
|
||||
private EachLayerDataDefinitionPane eachLayerDataDefinitionPane;//各层级分别指定
|
||||
|
||||
public DrillMapDataPane(VanChartDrillMapPlot drillMapPlot) { |
||||
bottomDataPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); |
||||
eachLayerDataDefinitionPane = new EachLayerDataDefinitionPane(drillMapPlot); |
||||
|
||||
dataDefinitionType = new UIComboBoxPane<DrillMapChartDataDefinition>() { |
||||
@Override |
||||
protected List<FurtherBasicBeanPane<? extends DrillMapChartDataDefinition>> initPaneList() { |
||||
|
||||
List<FurtherBasicBeanPane<? extends DrillMapChartDataDefinition>> paneList = new ArrayList<FurtherBasicBeanPane<? extends DrillMapChartDataDefinition>>(); |
||||
paneList.add(new BottomLayerDataDefinitionPane()); |
||||
paneList.add(eachLayerDataDefinitionPane); |
||||
return paneList; |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
this.setLayout(new BorderLayout()); |
||||
this.add(dataDefinitionType, BorderLayout.CENTER); |
||||
} |
||||
|
||||
public void fireMapTypeChanged() { |
||||
eachLayerDataDefinitionPane.fireMapTypeChanged(); |
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(DrillMapChartDataDefinition ob) { |
||||
|
||||
dataDefinitionType.setSelectedIndex(ob.isFromBottomData() ? 0 : 1); |
||||
|
||||
bottomDataPane.populateBean(ob.getBottomDataDefinition()); |
||||
eachLayerDataDefinitionPane.populateBean(ob); |
||||
} |
||||
|
||||
/** |
||||
* Update. |
||||
*/ |
||||
@Override |
||||
public DrillMapChartDataDefinition updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void updateBean(DrillMapChartDataDefinition drillMapDefinition) { |
||||
if (dataDefinitionType.getSelectedIndex() == 0) { |
||||
drillMapDefinition.setFromBottomData(true); |
||||
drillMapDefinition.setBottomDataDefinition(bottomDataPane.updateBean()); |
||||
} else { |
||||
drillMapDefinition.setFromBottomData(false); |
||||
eachLayerDataDefinitionPane.updateBean(drillMapDefinition); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return Toolkit.i18nText("Fine-Design_Chart_Use_Data"); |
||||
} |
||||
|
||||
private class BottomLayerDataDefinitionPane extends FurtherBasicBeanPane<DrillMapChartDataDefinition> { |
||||
|
||||
private BottomLayerDataDefinitionPane() { |
||||
this.setLayout(new BorderLayout()); |
||||
this.add(bottomDataPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
@Override |
||||
public boolean accept(Object ob) { |
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public void reset() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void populateBean(DrillMapChartDataDefinition ob) { |
||||
} |
||||
|
||||
@Override |
||||
public DrillMapChartDataDefinition updateBean() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public String title4PopupWindow() { |
||||
return Toolkit.i18nText("Fine-Design_Chart_Bottom_Data_Sum"); |
||||
} |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue