Browse Source

适配框架图

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
43642548e6
  1. 61
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRichTextFieldListPane.java
  2. 63
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java

61
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRichTextFieldListPane.java

@ -0,0 +1,61 @@
package com.fr.van.chart.structure.desinger.style;
import com.fr.design.i18n.Toolkit;
import com.fr.design.ui.ModernUIPane;
import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat;
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat;
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 VanChartStructureRichTextFieldListPane extends VanChartFieldListPane {
public VanChartStructureRichTextFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane<VanChartRichEditorModel> richEditorPane) {
super(fieldAttrPane, richEditorPane);
}
protected void initDefaultFieldButton() {
VanChartFieldListener fieldListener = getFieldListener();
VanChartFieldButton categoryNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Node_Name"),
new AttrTooltipMultiLevelNameFormat(), false, fieldListener);
VanChartFieldButton seriesNameButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"),
new AttrTooltipSeriesFormat(), 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_Use_Percent"),
new AttrTooltipPercentFormat(), false, fieldListener);
setCategoryNameButton(categoryNameButton);
setSeriesNameButton(seriesNameButton);
setValueButton(valueButton);
setPercentButton(percentButton);
}
protected void addDefaultFieldButton(JPanel fieldPane) {
fieldPane.add(getCategoryNameButton());
fieldPane.add(getSeriesNameButton());
fieldPane.add(getValueButton());
}
protected List<VanChartFieldButton> getDefaultFieldButtonList() {
List<VanChartFieldButton> fieldButtonList = new ArrayList<>();
fieldButtonList.add(getCategoryNameButton());
fieldButtonList.add(getSeriesNameButton());
fieldButtonList.add(getValueButton());
return fieldButtonList;
}
}

63
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java

@ -2,20 +2,21 @@ package com.fr.van.chart.structure.desinger.style;
import com.fr.design.i18n.Toolkit; 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.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat;
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.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.PercentFormatPaneWithoutCheckBox;
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;
@ -70,44 +71,34 @@ public class VanChartStructureTooltipContentPane extends VanChartTooltipContentP
setPercentFormatPane(percentFormatPane); setPercentFormatPane(percentFormatPane);
} }
protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { protected VanChartRichTextPane createRichTextPane(ModernUIPane<VanChartRichEditorModel> richEditorPane) {
CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane) {
protected String getCheckBoxText() { return new VanChartRichTextPane(richEditorPane) {
return Toolkit.i18nText("Fine-Design_Chart_Node_Name");
protected VanChartFieldListPane createFieldListPane(VanChartFieldAttrPane fieldAttrPane, ModernUIPane<VanChartRichEditorModel> richEditor) {
return new VanChartStructureRichTextFieldListPane(fieldAttrPane, richEditor);
} }
};
SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane) { protected AttrTooltipContent getInitialTooltipContent() {
protected String getCheckBoxText() { return createAttrTooltip();
return Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name");
} }
}; };
ValueFormatPaneWithoutCheckBox richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane);
PercentFormatPaneWithoutCheckBox richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane);
setRichTextCategoryNameFormatPane(richTextCategoryNameFormatPane);
setRichTextSeriesNameFormatPane(richTextSeriesNameFormatPane);
setRichTextValueFormatPane(richTextValueFormatPane);
setRichTextPercentFormatPane(richTextPercentFormatPane);
} }
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { protected String[] getRichTextFieldNames() {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ return new String[]{
getRichTextCategoryNameFormatPane(), Toolkit.i18nText("Fine-Design_Chart_Node_Name"),
getRichTextSeriesNameFormatPane(), Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name"),
getRichTextValueFormatPane() Toolkit.i18nText("Fine-Design_Chart_Use_Value")
}; };
}
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ protected AttrTooltipFormat[] getRichTextFieldFormats() {
attrTooltipContent.getRichTextCategoryFormat(), return new AttrTooltipFormat[]{
attrTooltipContent.getRichTextSeriesFormat(), new AttrTooltipMultiLevelNameFormat(),
attrTooltipContent.getRichTextValueFormat() new AttrTooltipSeriesFormat(),
new AttrTooltipValueFormat()
}; };
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
checkRichEditorState(attrTooltipContent);
} }
@Override @Override

Loading…
Cancel
Save