Browse Source

适配漏斗图

feature/big-screen
Qinghui.Liu 3 years ago
parent
commit
db2aa5788e
  1. 55
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java
  2. 62
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRichTextFieldListPane.java
  3. 55
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java

55
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java

@ -1,18 +1,21 @@
package com.fr.van.chart.funnel.designer.style; package com.fr.van.chart.funnel.designer.style;
import com.fr.design.i18n.Toolkit;
import com.fr.design.ui.ModernUIPane;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat;
import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.plugin.chart.type.TextAlign; import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.VanChartLabelContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.richText.VanChartFieldListPane;
import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel;
import com.fr.van.chart.designer.component.richText.VanChartRichTextPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -54,32 +57,34 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane {
setPercentFormatPane(new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane)); setPercentFormatPane(new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane));
} }
@Override protected VanChartRichTextPane createRichTextPane(ModernUIPane<VanChartRichEditorModel> richEditorPane) {
protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) {
setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); return new VanChartRichTextPane(richEditorPane) {
setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane));
setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane<VanChartRichEditorModel> richEditor) {
setRichTextPercentFormatPane(new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane)); return new VanChartFunnelRichTextFieldListPane(fieldAttrPane, richEditor);
} }
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { protected AttrTooltipContent getInitialTooltipContent() {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ return createAttrTooltip();
getRichTextSeriesNameFormatPane(), }
getRichTextValueFormatPane(),
getRichTextPercentFormatPane()
}; };
}
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ protected String[] getRichTextFieldNames() {
attrTooltipContent.getRichTextSeriesFormat(), return new String[]{
attrTooltipContent.getRichTextValueFormat(), Toolkit.i18nText("Fine-Design_Chart_Series_Name"),
attrTooltipContent.getRichTextPercentFormat() Toolkit.i18nText("Fine-Design_Chart_Use_Value"),
Toolkit.i18nText("Fine-Design_Chart_Value_Conversion")
}; };
}
setRichTextAttr(new AttrTooltipRichText()); protected AttrTooltipFormat[] getRichTextFieldFormats() {
populateRichTextFormat(formatPaneGroup, formatGroup); return new AttrTooltipFormat[]{
populateRichText(attrTooltipContent.getRichTextAttr()); new AttrTooltipNameFormat(),
new AttrTooltipValueFormat(),
checkRichEditorState(attrTooltipContent); new AttrTooltipPercentFormat()
};
} }
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {

62
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRichTextFieldListPane.java

@ -0,0 +1,62 @@
package com.fr.van.chart.funnel.designer.style;
import com.fr.design.i18n.Toolkit;
import com.fr.design.ui.ModernUIPane;
import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat;
import com.fr.plugin.chart.base.format.AttrTooltipNameFormat;
import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane;
import com.fr.van.chart.designer.component.richText.VanChartFieldButton;
import com.fr.van.chart.designer.component.richText.VanChartFieldListPane;
import com.fr.van.chart.designer.component.richText.VanChartFieldListener;
import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
public class VanChartFunnelRichTextFieldListPane extends VanChartFieldListPane {
public VanChartFunnelRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane<VanChartRichEditorModel> richEditorPane) {
super(fieldAttrPane, richEditorPane);
}
protected void initDefaultFieldButton() {
VanChartFieldListener fieldListener = getFieldListener();
VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"),
new AttrTooltipCategoryFormat(), false, fieldListener);
VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Series_Name"),
new AttrTooltipNameFormat(), false, fieldListener);
VanChartFieldButton valueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Use_Value"),
new AttrTooltipValueFormat(), false, fieldListener);
VanChartFieldButton percentButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Value_Conversion"),
new AttrTooltipPercentFormat(), false, fieldListener);
setCategoryNameButton(categoryNameButton);
setSeriesNameButton(seriesNameButton);
setValueButton(valueButton);
setPercentButton(percentButton);
}
protected void addDefaultFieldButton(JPanel fieldPane) {
fieldPane.add(getSeriesNameButton());
fieldPane.add(getValueButton());
fieldPane.add(getPercentButton());
}
protected List<VanChartFieldButton> getDefaultFieldButtonList() {
List<VanChartFieldButton> fieldButtonList = new ArrayList<>();
fieldButtonList.add(getSeriesNameButton());
fieldButtonList.add(getValueButton());
fieldButtonList.add(getPercentButton());
return fieldButtonList;
}
}

55
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java

@ -1,17 +1,20 @@
package com.fr.van.chart.funnel.designer.style; package com.fr.van.chart.funnel.designer.style;
import com.fr.design.i18n.Toolkit;
import com.fr.design.ui.ModernUIPane;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.plugin.chart.base.format.AttrTooltipNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat;
import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.richText.VanChartFieldListPane;
import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel;
import com.fr.van.chart.designer.component.richText.VanChartRichTextPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -53,32 +56,34 @@ public class VanChartFunnelTooltipContentPane extends VanChartTooltipContentPane
setPercentFormatPane(new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane)); setPercentFormatPane(new FunnelPercentFormatPaneWithCheckBox(parent, showOnPane));
} }
@Override protected VanChartRichTextPane createRichTextPane(ModernUIPane<VanChartRichEditorModel> richEditorPane) {
protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) {
setRichTextCategoryNameFormatPane(new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane)); return new VanChartRichTextPane(richEditorPane) {
setRichTextSeriesNameFormatPane(new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane));
setRichTextValueFormatPane(new ValueFormatPaneWithoutCheckBox(parent, showOnPane)); protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane<VanChartRichEditorModel> richEditor) {
setRichTextPercentFormatPane(new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane)); return new VanChartFunnelRichTextFieldListPane(fieldAttrPane, richEditor);
} }
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { protected AttrTooltipContent getInitialTooltipContent() {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ return createAttrTooltip();
getRichTextSeriesNameFormatPane(), }
getRichTextValueFormatPane(),
getRichTextPercentFormatPane()
}; };
}
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ protected String[] getRichTextFieldNames() {
attrTooltipContent.getRichTextSeriesFormat(), return new String[]{
attrTooltipContent.getRichTextValueFormat(), Toolkit.i18nText("Fine-Design_Chart_Series_Name"),
attrTooltipContent.getRichTextPercentFormat() Toolkit.i18nText("Fine-Design_Chart_Use_Value"),
Toolkit.i18nText("Fine-Design_Chart_Value_Conversion")
}; };
}
setRichTextAttr(new AttrTooltipRichText()); protected AttrTooltipFormat[] getRichTextFieldFormats() {
populateRichTextFormat(formatPaneGroup, formatGroup); return new AttrTooltipFormat[]{
populateRichText(attrTooltipContent.getRichTextAttr()); new AttrTooltipNameFormat(),
new AttrTooltipValueFormat(),
checkRichEditorState(attrTooltipContent); new AttrTooltipPercentFormat()
};
} }
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {

Loading…
Cancel
Save