After Width: | Height: | Size: 4.6 KiB |
@ -1,37 +0,0 @@ |
|||||||
package com.fr.design.mainframe.alphafine.preview; |
|
||||||
|
|
||||||
|
|
||||||
import com.fr.design.gui.ilable.UILabel; |
|
||||||
import com.fr.design.mainframe.alphafine.AlphaFineConstants; |
|
||||||
import com.fr.general.IOUtils; |
|
||||||
import com.fr.general.Inter; |
|
||||||
|
|
||||||
import javax.swing.*; |
|
||||||
import java.awt.*; |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* Created by XiaXiang on 2017/5/5. |
|
||||||
*/ |
|
||||||
public class ActionPreviewPane extends JPanel { |
|
||||||
private static final Font NAME = new Font("Song_TypeFace", 0, 14); |
|
||||||
|
|
||||||
public ActionPreviewPane() { |
|
||||||
setLayout(new BorderLayout()); |
|
||||||
setBackground(null); |
|
||||||
setBorder(BorderFactory.createEmptyBorder(135, 0, 0, 0)); |
|
||||||
UILabel image = new UILabel(); |
|
||||||
image.setPreferredSize(new Dimension(150, 111)); |
|
||||||
image.setHorizontalAlignment(SwingConstants.CENTER); |
|
||||||
image.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
||||||
image.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/noresult.png")); |
|
||||||
UILabel description = new UILabel(Inter.getLocText("FR-Designer_NoResult")); |
|
||||||
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); |
|
||||||
description.setFont(NAME); |
|
||||||
description.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); |
|
||||||
description.setHorizontalAlignment(SwingConstants.CENTER); |
|
||||||
this.add(image, BorderLayout.CENTER); |
|
||||||
this.add(description, BorderLayout.SOUTH); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,31 @@ |
|||||||
|
package com.fr.design.mainframe.alphafine.preview; |
||||||
|
|
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.mainframe.alphafine.AlphaFineConstants; |
||||||
|
import com.fr.general.FRFont; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by XiaXiang on 2017/8/14. |
||||||
|
*/ |
||||||
|
public class NoResultPane extends JPanel { |
||||||
|
public NoResultPane(String title, Icon icon) { |
||||||
|
setLayout(new BorderLayout()); |
||||||
|
setBackground(Color.white); |
||||||
|
setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); |
||||||
|
UILabel image = new UILabel(); |
||||||
|
image.setPreferredSize(new Dimension(150, 111)); |
||||||
|
image.setHorizontalAlignment(SwingConstants.CENTER); |
||||||
|
image.setIcon(icon); |
||||||
|
image.setBorder(BorderFactory.createEmptyBorder(100,0,0,0)); |
||||||
|
UILabel description = new UILabel(title); |
||||||
|
description.setForeground(AlphaFineConstants.MEDIUM_GRAY); |
||||||
|
description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14)); |
||||||
|
description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0)); |
||||||
|
description.setHorizontalAlignment(SwingConstants.CENTER); |
||||||
|
add(image, BorderLayout.CENTER); |
||||||
|
add(description, BorderLayout.SOUTH); |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 374 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 306 B |
After Width: | Height: | Size: 344 B |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 982 B |
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 750 B |
After Width: | Height: | Size: 447 B |
After Width: | Height: | Size: 344 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 372 B |
After Width: | Height: | Size: 723 B |
After Width: | Height: | Size: 429 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 269 B |
After Width: | Height: | Size: 654 B |
After Width: | Height: | Size: 423 B |
After Width: | Height: | Size: 503 B |
After Width: | Height: | Size: 306 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 559 B |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 423 B |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 1002 B |
After Width: | Height: | Size: 329 B |
After Width: | Height: | Size: 269 B |
@ -1 +1,92 @@ |
|||||||
package com.fr.design.module;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 7.0.3
* Date: 13-7-8
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
}
protected void registerFloatEditor() {
ActionFactory.registerChartCollection(ChartCollection.class);
}
/**
* 返回设计器能打开的模板类型的一个数组列表
*
* @return 可以打开的模板类型的数组
*/
public App<?>[] apps4TemplateOpener() {
return new App[0];
}
protected WidgetOption[] options4Show() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if (ArrayUtils.isEmpty(rowChart)) {
continue;
}
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
public String getInterNationalName() {
return Inter.getLocText("FR-Chart-Design_ChartModule");
}
} |
package com.fr.design.module; |
||||||
|
|
||||||
|
import com.fr.chart.base.ChartInternationalNameContentBean; |
||||||
|
import com.fr.chart.chartattr.Chart; |
||||||
|
import com.fr.chart.chartattr.ChartCollection; |
||||||
|
import com.fr.chart.charttypes.ChartTypeManager; |
||||||
|
import com.fr.design.ChartTypeInterfaceManager; |
||||||
|
import com.fr.design.actions.core.ActionFactory; |
||||||
|
import com.fr.design.chart.ChartDialog; |
||||||
|
import com.fr.design.chart.gui.ChartComponent; |
||||||
|
import com.fr.design.chart.gui.ChartWidgetOption; |
||||||
|
import com.fr.design.gui.core.WidgetOption; |
||||||
|
import com.fr.design.mainframe.App; |
||||||
|
import com.fr.design.mainframe.ChartPropertyPane; |
||||||
|
import com.fr.form.ui.ChartEditor; |
||||||
|
import com.fr.general.IOUtils; |
||||||
|
import com.fr.general.Inter; |
||||||
|
import com.fr.plugin.chart.map.server.ChartMapEditorAction; |
||||||
|
import com.fr.stable.ArrayUtils; |
||||||
|
import com.fr.stable.bridge.StableFactory; |
||||||
|
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by IntelliJ IDEA. |
||||||
|
* Author : Richer |
||||||
|
* Version: 7.0.3 |
||||||
|
* Date: 13-7-8 |
||||||
|
* Time: 上午9:13 |
||||||
|
*/ |
||||||
|
public class ChartDesignerModule extends DesignModule { |
||||||
|
public void start() { |
||||||
|
super.start(); |
||||||
|
dealBeforeRegister(); |
||||||
|
register(); |
||||||
|
registerFloatEditor(); |
||||||
|
} |
||||||
|
|
||||||
|
protected void dealBeforeRegister(){ |
||||||
|
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); |
||||||
|
StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); |
||||||
|
} |
||||||
|
|
||||||
|
private void register(){ |
||||||
|
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); |
||||||
|
|
||||||
|
DesignModuleFactory.registerChartEditorClass(ChartEditor.class); |
||||||
|
DesignModuleFactory.registerChartComponentClass(ChartComponent.class); |
||||||
|
|
||||||
|
DesignModuleFactory.registerChartDialogClass(ChartDialog.class); |
||||||
|
|
||||||
|
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); |
||||||
|
|
||||||
|
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); |
||||||
|
ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction()); |
||||||
|
} |
||||||
|
|
||||||
|
protected void registerFloatEditor() { |
||||||
|
ActionFactory.registerChartCollection(ChartCollection.class); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回设计器能打开的模板类型的一个数组列表 |
||||||
|
* |
||||||
|
* @return 可以打开的模板类型的数组 |
||||||
|
*/ |
||||||
|
public App<?>[] apps4TemplateOpener() { |
||||||
|
return new App[0]; |
||||||
|
} |
||||||
|
protected WidgetOption[] options4Show() { |
||||||
|
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); |
||||||
|
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; |
||||||
|
for (int i = 0; i < typeName.length; i++) { |
||||||
|
String plotID = typeName[i].getPlotID(); |
||||||
|
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); |
||||||
|
if (ArrayUtils.isEmpty(rowChart)) { |
||||||
|
continue; |
||||||
|
} |
||||||
|
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); |
||||||
|
Icon icon = IOUtils.readIcon(iconPath); |
||||||
|
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); |
||||||
|
} |
||||||
|
return child; |
||||||
|
} |
||||||
|
|
||||||
|
public String getInterNationalName() { |
||||||
|
return Inter.getLocText("FR-Chart-Design_ChartModule"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
@ -0,0 +1,40 @@ |
|||||||
|
package com.fr.plugin.chart.area; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.condition.ConditionAttributesPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
||||||
|
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
||||||
|
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 15/11/18. |
||||||
|
*/ |
||||||
|
public class AreaIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { |
||||||
|
@Override |
||||||
|
public String getIconPath() { |
||||||
|
return "com/fr/design/images/form/toolbar/area.png"; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractChartTypePane getPlotTypePane() { |
||||||
|
return new VanChartAreaPlotPane(); |
||||||
|
} |
||||||
|
|
||||||
|
public ConditionAttributesPane getPlotConditionPane(Plot plot){ |
||||||
|
return new VanChartAreaConditionPane(plot); |
||||||
|
} |
||||||
|
|
||||||
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ |
||||||
|
return new VanChartAreaSeriesPane(parent, plot); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* plot面板的标题 |
||||||
|
* 插件兼容 |
||||||
|
*/ |
||||||
|
public String getPlotTypeTitle4PopupWindow(){ |
||||||
|
return VanChartAreaPlotPane.TITLE; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,96 @@ |
|||||||
|
package com.fr.plugin.chart.area; |
||||||
|
|
||||||
|
import com.fr.chart.base.AttrBackground; |
||||||
|
import com.fr.chart.base.ChartConstants; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; |
||||||
|
import com.fr.plugin.chart.attr.EffectHelper; |
||||||
|
import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground; |
||||||
|
import com.fr.plugin.chart.base.AttrDataSheet; |
||||||
|
import com.fr.plugin.chart.base.AttrEffect; |
||||||
|
import com.fr.plugin.chart.base.AttrLabel; |
||||||
|
import com.fr.plugin.chart.base.AttrTooltip; |
||||||
|
import com.fr.plugin.chart.base.VanChartAttrLine; |
||||||
|
import com.fr.plugin.chart.base.VanChartAttrMarker; |
||||||
|
import com.fr.plugin.chart.base.VanChartAttrTrendLine; |
||||||
|
import com.fr.plugin.chart.designer.PlotFactory; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartAreaFillColorConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartDataSheetContentPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartLineTypeConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartMarkerConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartTrendLineConditionPane; |
||||||
|
import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint; |
||||||
|
import com.fr.plugin.chart.scatter.large.VanChartLargeModelMarkerConditionPane; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 15/11/18. |
||||||
|
*/ |
||||||
|
public class VanChartAreaConditionPane extends DataSeriesConditionPane { |
||||||
|
private static final long serialVersionUID = -7180705321732069806L; |
||||||
|
|
||||||
|
public VanChartAreaConditionPane(Plot plot) { |
||||||
|
super(plot); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initComponents() { |
||||||
|
super.initComponents(); |
||||||
|
//添加全部条件属性后被遮挡
|
||||||
|
liteConditionPane.setPreferredSize(new Dimension(300, 400)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void addBasicAction() { |
||||||
|
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); |
||||||
|
classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this)); |
||||||
|
classPaneMap.put(AttrAreaSeriesFillColorBackground.class, new VanChartAreaFillColorConditionPane(this, plot)); |
||||||
|
classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPane(this)); |
||||||
|
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); |
||||||
|
//是否使用数据表
|
||||||
|
if (plot.getDataSheet().isVisible()) { |
||||||
|
classPaneMap.put(AttrDataSheet.class, new VanChartDataSheetContentPane(this, plot)); |
||||||
|
} |
||||||
|
if(PlotFactory.largeDataModel(plot)){ |
||||||
|
classPaneMap.put(VanChartAttrMarker.class, new VanChartLargeModelMarkerConditionPane(this)); |
||||||
|
} else { |
||||||
|
classPaneMap.put(VanChartAttrMarker.class, new VanChartMarkerConditionPane(this)); |
||||||
|
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getAreaPlotDefaultEffect())); |
||||||
|
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected void addStyleAction() { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected ChartConditionPane createListConditionPane() { |
||||||
|
return new ChartConditionPane(){ |
||||||
|
@Override |
||||||
|
public String[] columns2Populate() { |
||||||
|
return new String[]{ |
||||||
|
ChartConstants.CATEGORY_INDEX, |
||||||
|
ChartConstants.CATEGORY_NAME, |
||||||
|
ChartConstants.SERIES_INDEX, |
||||||
|
ChartConstants.SERIES_NAME, |
||||||
|
ChartConstants.VALUE, |
||||||
|
VanChartMultiCategoryDataPoint.CATEGORY_ARRAY, |
||||||
|
}; |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回图表class对象 |
||||||
|
* @return class对象 |
||||||
|
*/ |
||||||
|
public Class<? extends Plot> class4Correspond() { |
||||||
|
return VanChartAreaPlot.class; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,95 @@ |
|||||||
|
package com.fr.plugin.chart.area; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Chart; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; |
||||||
|
import com.fr.general.FRLogger; |
||||||
|
import com.fr.general.Inter; |
||||||
|
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 15/11/18. |
||||||
|
*/ |
||||||
|
public class VanChartAreaPlotPane extends AbstractVanChartTypePane { |
||||||
|
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewArea"); |
||||||
|
private static final long serialVersionUID = -8161581682558781651L; |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String[] getTypeIconPath() { |
||||||
|
|
||||||
|
return new String[]{"/com/fr/plugin/chart/area/images/area.png", |
||||||
|
"/com/fr/plugin/chart/area/images/stack.png", |
||||||
|
"/com/fr/plugin/chart/area/images/percentStack.png", |
||||||
|
"/com/fr/plugin/chart/area/images/custom.png", |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String[] getTypeTipName() { |
||||||
|
String area = Inter.getLocText("FR-Chart-Type_Area"); |
||||||
|
String stack = Inter.getLocText("FR-Chart-Type_Stacked"); |
||||||
|
String percent = Inter.getLocText("FR-Chart-Use_Percent"); |
||||||
|
return new String[]{ |
||||||
|
area, |
||||||
|
stack + area, |
||||||
|
percent + stack + area, |
||||||
|
Inter.getLocText("FR-Chart-Mode_Custom") |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回界面标题 |
||||||
|
* @return 界面标题 |
||||||
|
*/ |
||||||
|
public String title4PopupWindow() { |
||||||
|
return Inter.getLocText("Plugin-ChartF_NewArea"); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新界面内容 |
||||||
|
*/ |
||||||
|
public void populateBean(Chart chart) { |
||||||
|
for(ChartImagePane imagePane : typeDemo) { |
||||||
|
imagePane.isPressing = false; |
||||||
|
} |
||||||
|
Plot plot = chart.getPlot(); |
||||||
|
if(plot instanceof VanChartAreaPlot) { |
||||||
|
lastTypeIndex = ((VanChartAreaPlot) plot).getVanChartPlotType().ordinal(); |
||||||
|
typeDemo.get(lastTypeIndex).isPressing = true; |
||||||
|
} |
||||||
|
checkDemosBackground(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 获取各图表类型界面ID, 本质是plotID |
||||||
|
* |
||||||
|
* @return 图表类型界面ID |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
protected String getPlotTypeID() { |
||||||
|
return VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID; |
||||||
|
} |
||||||
|
|
||||||
|
protected Plot getSelectedClonedPlot(){ |
||||||
|
VanChartAreaPlot newPlot = null; |
||||||
|
Chart[] areaChart = AreaIndependentVanChart.AreaVanChartTypes; |
||||||
|
for(int i = 0, len = areaChart.length; i < len; i++){ |
||||||
|
if(typeDemo.get(i).isPressing){ |
||||||
|
newPlot = (VanChartAreaPlot)areaChart[i].getPlot(); |
||||||
|
} |
||||||
|
} |
||||||
|
Plot cloned = null; |
||||||
|
try { |
||||||
|
cloned = (Plot)newPlot.clone(); |
||||||
|
} catch (CloneNotSupportedException e) { |
||||||
|
FRLogger.getLogger().error("Error In AreaChart"); |
||||||
|
} |
||||||
|
return cloned; |
||||||
|
} |
||||||
|
|
||||||
|
public Chart getDefaultChart() { |
||||||
|
return AreaIndependentVanChart.AreaVanChartTypes[0]; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
package com.fr.plugin.chart.area; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
||||||
|
import com.fr.plugin.chart.column.VanChartCustomStackAndAxisConditionPane; |
||||||
|
import com.fr.plugin.chart.line.VanChartLineSeriesPane; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
public class VanChartAreaSeriesPane extends VanChartLineSeriesPane{ |
||||||
|
|
||||||
|
private static final long serialVersionUID = 5497989595104913025L; |
||||||
|
|
||||||
|
public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot){ |
||||||
|
super(parent, plot); |
||||||
|
} |
||||||
|
|
||||||
|
protected JPanel getContentInPlotType(){ |
||||||
|
|
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double[] row = {p,p,p,p,p,p,p,p,p,p,p,p}; |
||||||
|
double[] col = {f}; |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{createStylePane()}, |
||||||
|
new Component[]{stylePane == null ? null : new JSeparator()}, |
||||||
|
new Component[]{createLineTypePane()}, |
||||||
|
new Component[]{new JSeparator()}, |
||||||
|
new Component[]{createMarkerPane()}, |
||||||
|
new Component[]{new JSeparator()}, |
||||||
|
new Component[]{createAreaFillColorPane()}, |
||||||
|
new Component[]{new JSeparator()}, |
||||||
|
new Component[]{createStackedAndAxisPane()}, |
||||||
|
new Component[]{createLargeDataModelPane()}, |
||||||
|
new Component[]{new JSeparator()}, |
||||||
|
new Component[]{createTrendLinePane()}, |
||||||
|
}; |
||||||
|
|
||||||
|
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); |
||||||
|
return contentPane; |
||||||
|
} |
||||||
|
|
||||||
|
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() { |
||||||
|
return VanChartCustomStackAndAxisConditionPane.class; |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 728 B |
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,56 @@ |
|||||||
|
package com.fr.plugin.chart.bar; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.condition.ConditionAttributesPane; |
||||||
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||||
|
import com.fr.design.mainframe.chart.AbstractChartAttrPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
||||||
|
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
||||||
|
import com.fr.plugin.chart.column.VanChartColumnConditionPane; |
||||||
|
import com.fr.plugin.chart.column.VanChartColumnSeriesPane; |
||||||
|
import com.fr.plugin.chart.designer.other.VanChartOtherPane; |
||||||
|
import com.fr.plugin.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 15/10/20. |
||||||
|
*/ |
||||||
|
public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { |
||||||
|
@Override |
||||||
|
public String getIconPath() { |
||||||
|
return "com/fr/design/images/form/toolbar/bar.png"; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractChartTypePane getPlotTypePane() { |
||||||
|
return new VanChartBarPlotPane(); |
||||||
|
} |
||||||
|
|
||||||
|
public ConditionAttributesPane getPlotConditionPane(Plot plot){ |
||||||
|
return new VanChartColumnConditionPane(plot); |
||||||
|
} |
||||||
|
|
||||||
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ |
||||||
|
return new VanChartColumnSeriesPane(parent, plot); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 图表的属性界面数组 |
||||||
|
* @return 属性界面 |
||||||
|
*/ |
||||||
|
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ |
||||||
|
VanChartStylePane stylePane = new VanChartBarStylePane(listener); |
||||||
|
VanChartOtherPane otherPane = new VanChartOtherPane(); |
||||||
|
return new AbstractChartAttrPane[]{stylePane, otherPane}; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* plot面板的标题 |
||||||
|
* 插件兼容 |
||||||
|
*/ |
||||||
|
public String getPlotTypeTitle4PopupWindow(){ |
||||||
|
return VanChartBarPlotPane.TITLE; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,96 @@ |
|||||||
|
package com.fr.plugin.chart.bar; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Chart; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; |
||||||
|
import com.fr.general.FRLogger; |
||||||
|
import com.fr.general.Inter; |
||||||
|
import com.fr.plugin.chart.column.VanChartColumnPlot; |
||||||
|
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 15/10/20. |
||||||
|
*/ |
||||||
|
public class VanChartBarPlotPane extends AbstractVanChartTypePane { |
||||||
|
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBar"); |
||||||
|
|
||||||
|
private static final long serialVersionUID = 2879689884048643002L; |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String[] getTypeIconPath() { |
||||||
|
return new String[]{"/com/fr/plugin/chart/bar/images/bar.png", |
||||||
|
"/com/fr/plugin/chart/bar/images/stack.png", |
||||||
|
"/com/fr/plugin/chart/bar/images/percentstack.png", |
||||||
|
"/com/fr/plugin/chart/bar/images/custom.png", |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String[] getTypeTipName() { |
||||||
|
String bar = Inter.getLocText("FR-Chart-Type_Bar"); |
||||||
|
String stack = Inter.getLocText("FR-Chart-Type_Stacked"); |
||||||
|
String percent = Inter.getLocText("FR-Chart-Use_Percent"); |
||||||
|
return new String[]{ |
||||||
|
bar, |
||||||
|
stack + bar, |
||||||
|
percent + stack + bar, |
||||||
|
Inter.getLocText("FR-Chart-Mode_Custom") |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回界面标题 |
||||||
|
* @return 界面标题 |
||||||
|
*/ |
||||||
|
public String title4PopupWindow() { |
||||||
|
return Inter.getLocText("Plugin-ChartF_NewBar"); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新界面内容 |
||||||
|
*/ |
||||||
|
public void populateBean(Chart chart) { |
||||||
|
for(ChartImagePane imagePane : typeDemo) { |
||||||
|
imagePane.isPressing = false; |
||||||
|
} |
||||||
|
Plot plot = chart.getPlot(); |
||||||
|
if(plot instanceof VanChartColumnPlot) { |
||||||
|
lastTypeIndex = ((VanChartColumnPlot)plot).getVanChartPlotType().ordinal(); |
||||||
|
typeDemo.get(lastTypeIndex).isPressing = true; |
||||||
|
} |
||||||
|
checkDemosBackground(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取各图表类型界面ID, 本质是plotID |
||||||
|
* |
||||||
|
* @return 图表类型界面ID |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
protected String getPlotTypeID() { |
||||||
|
return VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID; |
||||||
|
} |
||||||
|
|
||||||
|
protected Plot getSelectedClonedPlot(){ |
||||||
|
VanChartColumnPlot newPlot = null; |
||||||
|
Chart[] barChart = BarIndependentVanChart.BarVanChartTypes; |
||||||
|
for(int i = 0, len = barChart.length; i < len; i++){ |
||||||
|
if(typeDemo.get(i).isPressing){ |
||||||
|
newPlot = (VanChartColumnPlot)barChart[i].getPlot(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Plot cloned = null; |
||||||
|
try { |
||||||
|
cloned = (Plot)newPlot.clone(); |
||||||
|
} catch (CloneNotSupportedException e) { |
||||||
|
FRLogger.getLogger().error("Error In ColumnChart"); |
||||||
|
} |
||||||
|
return cloned; |
||||||
|
} |
||||||
|
|
||||||
|
public Chart getDefaultChart() { |
||||||
|
return BarIndependentVanChart.BarVanChartTypes[0]; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
package com.fr.plugin.chart.bar; |
||||||
|
|
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||||
|
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; |
||||||
|
import com.fr.plugin.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.plugin.chart.designer.style.axis.bar.VanChartBarAxisPane; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 16/6/8. |
||||||
|
*/ |
||||||
|
public class VanChartBarStylePane extends VanChartStylePane { |
||||||
|
public VanChartBarStylePane(AttributeChangeListener listener) { |
||||||
|
super(listener); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void createVanChartAxisPane(List<BasicPane> paneList, VanChartAxisPlot plot) { |
||||||
|
paneList.add(new VanChartBarAxisPane(plot, VanChartBarStylePane.this)); |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 290 B |
After Width: | Height: | Size: 261 B |
After Width: | Height: | Size: 247 B |
After Width: | Height: | Size: 256 B |
@ -0,0 +1,85 @@ |
|||||||
|
package com.fr.plugin.chart.bubble; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Chart; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.condition.ConditionAttributesPane; |
||||||
|
import com.fr.design.gui.frpane.AttributeChangeListener; |
||||||
|
import com.fr.design.mainframe.chart.AbstractChartAttrPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.ChartDataPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
||||||
|
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContentPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; |
||||||
|
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
||||||
|
import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane; |
||||||
|
import com.fr.plugin.chart.designer.other.VanChartOtherPane; |
||||||
|
import com.fr.plugin.chart.designer.style.VanChartStylePane; |
||||||
|
import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 16/3/31. |
||||||
|
*/ |
||||||
|
public class BubbleIndependentVanChartInterface extends AbstractIndependentVanChartUI { |
||||||
|
/** |
||||||
|
* 图表的类型定义界面类型,就是属性表的第一个界面 |
||||||
|
* |
||||||
|
* @return 图表的类型定义界面类型 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public AbstractChartTypePane getPlotTypePane() { |
||||||
|
return new VanChartBubblePlotPane(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 图标路径 |
||||||
|
* |
||||||
|
* @return 图标路径 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public String getIconPath() { |
||||||
|
return "com/fr/design/images/form/toolbar/bubble.png"; |
||||||
|
} |
||||||
|
@Override |
||||||
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){ |
||||||
|
return new VanChartBubbleSeriesPane(parent, plot); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ |
||||||
|
if(((VanChartBubblePlot) plot).isForceBubble()){ |
||||||
|
return super.getTableDataSourcePane(plot, parent); |
||||||
|
} |
||||||
|
return new VanChartBubblePlotTableDataContentPane(parent); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ |
||||||
|
if(((VanChartBubblePlot) plot).isForceBubble()){ |
||||||
|
return super.getReportDataSourcePane(plot, parent); |
||||||
|
} |
||||||
|
return new BubblePlotReportDataContentPane(parent); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 图表的属性界面数组 |
||||||
|
* @return 属性界面 |
||||||
|
*/ |
||||||
|
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){ |
||||||
|
VanChartStylePane stylePane = new VanChartBubbleStylePane(listener); |
||||||
|
VanChartOtherPane otherPane = new VanChartOtherPane(){ |
||||||
|
protected BasicBeanPane<Chart> createInteractivePane() { |
||||||
|
return new VanChartBubbleInteractivePane(); |
||||||
|
} |
||||||
|
}; |
||||||
|
return new AbstractChartAttrPane[]{stylePane, otherPane}; |
||||||
|
} |
||||||
|
|
||||||
|
public ConditionAttributesPane getPlotConditionPane(Plot plot){ |
||||||
|
return new VanChartBubbleConditionPane(plot); |
||||||
|
} |
||||||
|
|
||||||
|
public String getPlotTypeTitle4PopupWindow(){ |
||||||
|
return VanChartBubblePlotPane.TITLE; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,94 @@ |
|||||||
|
package com.fr.plugin.chart.bubble; |
||||||
|
|
||||||
|
import com.fr.chart.base.AttrAlpha; |
||||||
|
import com.fr.chart.base.AttrBackground; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; |
||||||
|
import com.fr.plugin.chart.attr.EffectHelper; |
||||||
|
import com.fr.plugin.chart.base.AttrEffect; |
||||||
|
import com.fr.plugin.chart.base.AttrLabel; |
||||||
|
import com.fr.plugin.chart.base.AttrTooltip; |
||||||
|
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble; |
||||||
|
import com.fr.plugin.chart.designer.PlotFactory; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartBubbleSetConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; |
||||||
|
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane; |
||||||
|
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; |
||||||
|
import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip; |
||||||
|
import com.fr.plugin.chart.scatter.component.label.VanChartScatterLabelConditionPane; |
||||||
|
import com.fr.plugin.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 16/3/31. |
||||||
|
*/ |
||||||
|
public class VanChartBubbleConditionPane extends DataSeriesConditionPane { |
||||||
|
private static final long serialVersionUID = -7180705321732069806L; |
||||||
|
|
||||||
|
public VanChartBubbleConditionPane(Plot plot) { |
||||||
|
super(plot); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initComponents() { |
||||||
|
super.initComponents(); |
||||||
|
//添加全部条件属性后被遮挡
|
||||||
|
liteConditionPane.setPreferredSize(new Dimension(300, 400)); |
||||||
|
} |
||||||
|
|
||||||
|
private boolean forceBubble() { |
||||||
|
return plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected ChartConditionPane createListConditionPane() { |
||||||
|
return forceBubble() ? new ChartConditionPane() : new VanChartBubbleConditionSelectionPane(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void addBasicAction() { |
||||||
|
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); |
||||||
|
classPaneMap.put(VanChartAttrBubble.class, new VanChartBubbleSetConditionPane(this)); |
||||||
|
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); |
||||||
|
|
||||||
|
if(forceBubble()){ |
||||||
|
addForceAction(); |
||||||
|
} else if(PlotFactory.largeDataModel(plot)){ |
||||||
|
addLargeAction(); |
||||||
|
} else { |
||||||
|
addNormalAction(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private void addNormalAction() { |
||||||
|
classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot)); |
||||||
|
classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot)); |
||||||
|
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect())); |
||||||
|
} |
||||||
|
|
||||||
|
private void addForceAction() { |
||||||
|
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); |
||||||
|
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); |
||||||
|
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect())); |
||||||
|
} |
||||||
|
|
||||||
|
private void addLargeAction() { |
||||||
|
classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
protected void addStyleAction() { |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回图表class对象 |
||||||
|
* @return class对象 |
||||||
|
*/ |
||||||
|
public Class<? extends Plot> class4Correspond() { |
||||||
|
return VanChartBubblePlot.class; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.fr.plugin.chart.bubble; |
||||||
|
|
||||||
|
import com.fr.chart.base.ChartConstants; |
||||||
|
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; |
||||||
|
import com.fr.plugin.chart.scatter.VanChartScatterDataPoint; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 16/3/31. |
||||||
|
*/ |
||||||
|
public class VanChartBubbleConditionSelectionPane extends ChartConditionPane { |
||||||
|
|
||||||
|
|
||||||
|
public String[] columns2Populate() { |
||||||
|
return new String[]{ |
||||||
|
ChartConstants.SERIES_INDEX, |
||||||
|
ChartConstants.SERIES_NAME, |
||||||
|
VanChartScatterDataPoint.X, |
||||||
|
VanChartScatterDataPoint.Y, |
||||||
|
ChartConstants.VALUE |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
package com.fr.plugin.chart.bubble; |
||||||
|
|
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.general.Inter; |
||||||
|
import com.fr.plugin.chart.base.VanChartConstants; |
||||||
|
import com.fr.plugin.chart.designer.other.VanChartInteractivePaneWithOutSort; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 16/3/31. |
||||||
|
*/ |
||||||
|
public class VanChartBubbleInteractivePane extends VanChartInteractivePaneWithOutSort { |
||||||
|
protected String[] getNameArray() { |
||||||
|
Plot plot = chart.getPlot(); |
||||||
|
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) { |
||||||
|
return new String[]{Inter.getLocText("Plugin-ChartF_XYAxis"), Inter.getLocText("Chart-Use_None")}; |
||||||
|
} |
||||||
|
return super.getNameArray(); |
||||||
|
} |
||||||
|
|
||||||
|
protected String[] getValueArray() { |
||||||
|
Plot plot = chart.getPlot(); |
||||||
|
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) { |
||||||
|
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE}; |
||||||
|
} |
||||||
|
return super.getValueArray(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,171 @@ |
|||||||
|
package com.fr.plugin.chart.bubble; |
||||||
|
|
||||||
|
import com.fr.chart.base.AttrAlpha; |
||||||
|
import com.fr.chart.base.DataSeriesCondition; |
||||||
|
import com.fr.chart.chartattr.Chart; |
||||||
|
import com.fr.chart.chartattr.Plot; |
||||||
|
import com.fr.chart.chartglyph.ConditionAttr; |
||||||
|
import com.fr.chart.chartglyph.ConditionCollection; |
||||||
|
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; |
||||||
|
import com.fr.general.FRLogger; |
||||||
|
import com.fr.general.Inter; |
||||||
|
import com.fr.plugin.chart.base.VanChartTools; |
||||||
|
import com.fr.plugin.chart.base.VanChartZoom; |
||||||
|
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane; |
||||||
|
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; |
||||||
|
import com.fr.plugin.chart.vanchart.VanChart; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by Mitisky on 16/3/31. |
||||||
|
*/ |
||||||
|
public class VanChartBubblePlotPane extends AbstractVanChartTypePane { |
||||||
|
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBubble");; |
||||||
|
|
||||||
|
private static final long serialVersionUID = -3481633368542654247L; |
||||||
|
|
||||||
|
private static final float FORCE_ALPHA = 1.0f; |
||||||
|
|
||||||
|
private static final float ALPHA = 0.7f; |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String[] getTypeIconPath() { |
||||||
|
return new String[]{"/com/fr/plugin/chart/bubble/images/bubble.png", |
||||||
|
"/com/fr/plugin/chart/bubble/images/force.png" |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected String[] getTypeTipName() { |
||||||
|
return new String[]{ |
||||||
|
Inter.getLocText("FR-Chart-Chart_BubbleChart"), |
||||||
|
Inter.getLocText("Plugin-ChartF_NewForceBubble") |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回界面标题 |
||||||
|
* @return 界面标题 |
||||||
|
*/ |
||||||
|
public String title4PopupWindow() { |
||||||
|
return Inter.getLocText("Plugin-ChartF_NewBubble"); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新界面内容 |
||||||
|
*/ |
||||||
|
public void populateBean(Chart chart) { |
||||||
|
for(ChartImagePane imagePane : typeDemo) { |
||||||
|
imagePane.isPressing = false; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
Plot plot = chart.getPlot(); |
||||||
|
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot)plot).isForceBubble()){ |
||||||
|
lastTypeIndex = BubblePlotType.FORCE.ordinal(); |
||||||
|
} else { |
||||||
|
lastTypeIndex = BubblePlotType.NORMAL.ordinal(); |
||||||
|
} |
||||||
|
|
||||||
|
typeDemo.get(lastTypeIndex).isPressing = true; |
||||||
|
|
||||||
|
checkDemosBackground(); |
||||||
|
} |
||||||
|
|
||||||
|
private void removeDefaultAttr(ConditionAttr conditionAttr, Class <? extends DataSeriesCondition> targetClass) { |
||||||
|
DataSeriesCondition attr = conditionAttr.getExisted(targetClass); |
||||||
|
if (attr != null){ |
||||||
|
conditionAttr.remove(targetClass); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 获取各图表类型界面ID, 本质是plotID |
||||||
|
* |
||||||
|
* @return 图表类型界面ID |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
protected String getPlotTypeID() { |
||||||
|
return VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID; |
||||||
|
} |
||||||
|
|
||||||
|
protected Plot getSelectedClonedPlot(){ |
||||||
|
VanChartBubblePlot newPlot = null; |
||||||
|
Chart[] bubbleChart = BubbleIndependentVanChart.BubbleVanChartTypes; |
||||||
|
for(int i = 0, len = bubbleChart.length; i < len; i++){ |
||||||
|
if(typeDemo.get(i).isPressing){ |
||||||
|
newPlot = (VanChartBubblePlot)bubbleChart[i].getPlot(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
Plot cloned = null; |
||||||
|
try { |
||||||
|
cloned = (Plot)newPlot.clone(); |
||||||
|
} catch (CloneNotSupportedException e) { |
||||||
|
FRLogger.getLogger().error("Error In BubbleChart"); |
||||||
|
} |
||||||
|
return cloned; |
||||||
|
} |
||||||
|
|
||||||
|
public Chart getDefaultChart() { |
||||||
|
return BubbleIndependentVanChart.BubbleVanChartTypes[0]; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
/** |
||||||
|
* 力學氣泡圖切換到其他氣泡圖時,刪除條件屬性 |
||||||
|
* 并且将bubbleAttr属性重置 |
||||||
|
*/ |
||||||
|
protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ |
||||||
|
cloneOldDefaultAttrConditionCollection(oldPlot, newPlot); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ |
||||||
|
if (oldPlot.getConditionCollection() != null) { |
||||||
|
ConditionCollection newCondition = new ConditionCollection(); |
||||||
|
newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone()); |
||||||
|
newPlot.setConditionCollection(newCondition); |
||||||
|
|
||||||
|
ConditionAttr attrList = newCondition.getDefaultAttr(); |
||||||
|
|
||||||
|
//根据气泡图类型,重设透明度属性
|
||||||
|
removeDefaultAttr(attrList, AttrAlpha.class); |
||||||
|
|
||||||
|
//删除标签属性(防止切换到大数据气泡图标签属性会拷贝过去)
|
||||||
|
removeDefaultAttr(attrList, ScatterAttrLabel.class); |
||||||
|
|
||||||
|
AttrAlpha attrAlpha = new AttrAlpha(); |
||||||
|
attrAlpha.setAlpha(((VanChartBubblePlot)newPlot).isForceBubble() ? FORCE_ALPHA : ALPHA); |
||||||
|
|
||||||
|
attrList.addDataSeriesCondition(attrAlpha); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException { |
||||||
|
if(oldPlot instanceof VanChartBubblePlot && newPlot instanceof VanChartBubblePlot){ |
||||||
|
if(((VanChartBubblePlot) oldPlot).isForceBubble() == ((VanChartBubblePlot) newPlot).isForceBubble()){ |
||||||
|
super.cloneHotHyperLink(oldPlot, newPlot); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
protected VanChartTools createVanChartTools() { |
||||||
|
VanChartTools tools = new VanChartTools(); |
||||||
|
tools.setSort(false); |
||||||
|
return tools; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 气泡图相同图表类型之间切换的时候,chart的部分属性也需要重置 |
||||||
|
* @param chart |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
protected void resetChartAttr4SamePlot(Chart chart){ |
||||||
|
VanChartZoom vanChartZoom = new VanChartZoom(); |
||||||
|
((VanChart)chart).setVanChartZoom(vanChartZoom); |
||||||
|
//重置监控刷新选项
|
||||||
|
resetRefreshMoreLabelAttr((VanChart)chart); |
||||||
|
} |
||||||
|
} |