|
|
@ -1,120 +1,403 @@ |
|
|
|
package com.fr.van.chart.designer.component; |
|
|
|
package com.fr.van.chart.designer.component; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
|
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
|
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
|
|
|
|
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.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
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.ChangedPercentFormatPaneWithCheckBox; |
|
|
|
import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; |
|
|
|
|
|
|
|
import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; |
|
|
|
import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; |
|
|
|
import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; |
|
|
|
|
|
|
|
import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; |
|
|
|
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.format.VanChartFormatPaneWithCheckBox; |
|
|
|
|
|
|
|
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox; |
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JComponent; |
|
|
|
|
|
|
|
import javax.swing.JFrame; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.CardLayout; |
|
|
|
import java.awt.CardLayout; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 内容界面 。数据点提示 |
|
|
|
* 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent> { |
|
|
|
public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent> { |
|
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 8825929000117843641L; |
|
|
|
private static final long serialVersionUID = 8825929000117843641L; |
|
|
|
|
|
|
|
|
|
|
|
protected UIButtonGroup<Integer> content; |
|
|
|
private UIButtonGroup<Integer> content; |
|
|
|
protected ValueFormatPaneWithCheckBox valueFormatPane; |
|
|
|
|
|
|
|
protected PercentFormatPaneWithCheckBox percentFormatPane; |
|
|
|
private CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; |
|
|
|
protected CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; |
|
|
|
private SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; |
|
|
|
protected SeriesNameFormatPaneWithCheckBox seriesNameFormatPane; |
|
|
|
private ValueFormatPaneWithCheckBox valueFormatPane; |
|
|
|
|
|
|
|
private PercentFormatPaneWithCheckBox percentFormatPane; |
|
|
|
|
|
|
|
|
|
|
|
//监控刷新时,自动数据点提示使用
|
|
|
|
//监控刷新时,自动数据点提示使用
|
|
|
|
protected ChangedValueFormatPaneWithCheckBox changedValueFormatPane; |
|
|
|
private ChangedValueFormatPaneWithCheckBox changedValueFormatPane; |
|
|
|
protected ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; |
|
|
|
private ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane; |
|
|
|
|
|
|
|
|
|
|
|
private JPanel centerPane; |
|
|
|
private CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane; |
|
|
|
|
|
|
|
private SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane; |
|
|
|
|
|
|
|
private ValueFormatPaneWithoutCheckBox richTextValueFormatPane; |
|
|
|
|
|
|
|
private PercentFormatPaneWithoutCheckBox richTextPercentFormatPane; |
|
|
|
|
|
|
|
private ChangedValueFormatPaneWithoutCheckBox richTextChangedValueFormatPane; |
|
|
|
|
|
|
|
private ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel centerPanel; |
|
|
|
private JPanel commonPanel; |
|
|
|
private JPanel commonPanel; |
|
|
|
|
|
|
|
private JPanel editorPanel; |
|
|
|
|
|
|
|
private JPanel htmlPanel; |
|
|
|
|
|
|
|
private JPanel stylePanel; |
|
|
|
|
|
|
|
private UIButtonGroup<Integer> styleButton; |
|
|
|
|
|
|
|
private ChartTextAttrPane textAttrPane; |
|
|
|
private VanChartHtmlLabelPane htmlLabelPane; |
|
|
|
private VanChartHtmlLabelPane htmlLabelPane; |
|
|
|
|
|
|
|
|
|
|
|
private VanChartStylePane parent; |
|
|
|
private VanChartStylePane parent; |
|
|
|
private JPanel showOnPane; |
|
|
|
private JPanel showOnPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private AttrTooltipRichText richText; |
|
|
|
|
|
|
|
|
|
|
|
public VanChartTooltipContentPane(VanChartStylePane parent, JPanel showOnPane){ |
|
|
|
public VanChartTooltipContentPane(VanChartStylePane parent, JPanel showOnPane){ |
|
|
|
this.parent = parent; |
|
|
|
this.parent = parent; |
|
|
|
this.showOnPane = showOnPane; |
|
|
|
this.showOnPane = showOnPane; |
|
|
|
|
|
|
|
this.richText = new AttrTooltipRichText(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initFormatPane(parent, showOnPane); |
|
|
|
|
|
|
|
initRichTextFormatPane(parent, showOnPane); |
|
|
|
|
|
|
|
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.add(createLabelContentPane(),BorderLayout.CENTER); |
|
|
|
this.add(createLabelContentPane(),BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CategoryNameFormatPaneWithCheckBox getCategoryNameFormatPane() { |
|
|
|
|
|
|
|
return categoryNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setCategoryNameFormatPane(CategoryNameFormatPaneWithCheckBox categoryNameFormatPane) { |
|
|
|
|
|
|
|
this.categoryNameFormatPane = categoryNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public SeriesNameFormatPaneWithCheckBox getSeriesNameFormatPane() { |
|
|
|
|
|
|
|
return seriesNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setSeriesNameFormatPane(SeriesNameFormatPaneWithCheckBox seriesNameFormatPane) { |
|
|
|
|
|
|
|
this.seriesNameFormatPane = seriesNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ValueFormatPaneWithCheckBox getValueFormatPane() { |
|
|
|
|
|
|
|
return valueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setValueFormatPane(ValueFormatPaneWithCheckBox valueFormatPane) { |
|
|
|
|
|
|
|
this.valueFormatPane = valueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PercentFormatPaneWithCheckBox getPercentFormatPane() { |
|
|
|
|
|
|
|
return percentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setPercentFormatPane(PercentFormatPaneWithCheckBox percentFormatPane) { |
|
|
|
|
|
|
|
this.percentFormatPane = percentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChangedValueFormatPaneWithCheckBox getChangedValueFormatPane() { |
|
|
|
|
|
|
|
return changedValueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setChangedValueFormatPane(ChangedValueFormatPaneWithCheckBox changedValueFormatPane) { |
|
|
|
|
|
|
|
this.changedValueFormatPane = changedValueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChangedPercentFormatPaneWithCheckBox getChangedPercentFormatPane() { |
|
|
|
|
|
|
|
return changedPercentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setChangedPercentFormatPane(ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane) { |
|
|
|
|
|
|
|
this.changedPercentFormatPane = changedPercentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CategoryNameFormatPaneWithoutCheckBox getRichTextCategoryNameFormatPane() { |
|
|
|
|
|
|
|
return richTextCategoryNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRichTextCategoryNameFormatPane(CategoryNameFormatPaneWithoutCheckBox richTextCategoryNameFormatPane) { |
|
|
|
|
|
|
|
this.richTextCategoryNameFormatPane = richTextCategoryNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public SeriesNameFormatPaneWithoutCheckBox getRichTextSeriesNameFormatPane() { |
|
|
|
|
|
|
|
return richTextSeriesNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRichTextSeriesNameFormatPane(SeriesNameFormatPaneWithoutCheckBox richTextSeriesNameFormatPane) { |
|
|
|
|
|
|
|
this.richTextSeriesNameFormatPane = richTextSeriesNameFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ValueFormatPaneWithoutCheckBox getRichTextValueFormatPane() { |
|
|
|
|
|
|
|
return richTextValueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRichTextValueFormatPane(ValueFormatPaneWithoutCheckBox richTextValueFormatPane) { |
|
|
|
|
|
|
|
this.richTextValueFormatPane = richTextValueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PercentFormatPaneWithoutCheckBox getRichTextPercentFormatPane() { |
|
|
|
|
|
|
|
return richTextPercentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRichTextPercentFormatPane(PercentFormatPaneWithoutCheckBox richTextPercentFormatPane) { |
|
|
|
|
|
|
|
this.richTextPercentFormatPane = richTextPercentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChangedValueFormatPaneWithoutCheckBox getRichTextChangedValueFormatPane() { |
|
|
|
|
|
|
|
return richTextChangedValueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRichTextChangedValueFormatPane(ChangedValueFormatPaneWithoutCheckBox richTextChangedValueFormatPane) { |
|
|
|
|
|
|
|
this.richTextChangedValueFormatPane = richTextChangedValueFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChangedPercentFormatPaneWithoutCheckBox getRichTextChangedPercentFormatPane() { |
|
|
|
|
|
|
|
return richTextChangedPercentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setRichTextChangedPercentFormatPane(ChangedPercentFormatPaneWithoutCheckBox richTextChangedPercentFormatPane) { |
|
|
|
|
|
|
|
this.richTextChangedPercentFormatPane = richTextChangedPercentFormatPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AttrTooltipRichText getRichTextAttr() { |
|
|
|
|
|
|
|
return richText; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelContentPane() { |
|
|
|
private JPanel createLabelContentPane() { |
|
|
|
content = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"), |
|
|
|
initDetailPane(); |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); |
|
|
|
initCenterPane(); |
|
|
|
|
|
|
|
|
|
|
|
initFormatPane(parent, showOnPane); |
|
|
|
JPanel content = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
content.add(createButtonPane(), BorderLayout.NORTH); |
|
|
|
double f = TableLayout.FILL; |
|
|
|
content.add(centerPanel, BorderLayout.CENTER); |
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
content.add(stylePanel, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
|
|
commonPanel = createCommonPanel(); |
|
|
|
initContentListener(); |
|
|
|
htmlLabelPane = createHtmlLabelPane(); |
|
|
|
|
|
|
|
htmlLabelPane.setParent(parent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
centerPane = new JPanel(new CardLayout()){ |
|
|
|
return getLabelContentPane(content); |
|
|
|
@Override |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initDetailPane() { |
|
|
|
|
|
|
|
commonPanel = createCommonFormatPanel(); |
|
|
|
|
|
|
|
editorPanel = createRichEditorPanel(); |
|
|
|
|
|
|
|
htmlPanel = createHtmlPane(); |
|
|
|
|
|
|
|
stylePanel = createCommonStylePane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initCenterPane() { |
|
|
|
|
|
|
|
centerPanel = new JPanel(new CardLayout()) { |
|
|
|
public Dimension getPreferredSize() { |
|
|
|
public Dimension getPreferredSize() { |
|
|
|
if (content.getSelectedIndex() == 0) { |
|
|
|
if (content.getSelectedIndex() == 0) { |
|
|
|
return commonPanel.getPreferredSize(); |
|
|
|
return commonPanel.getPreferredSize(); |
|
|
|
|
|
|
|
} else if (content.getSelectedIndex() == 1) { |
|
|
|
|
|
|
|
return editorPanel.getPreferredSize(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return new Dimension(commonPanel.getPreferredSize().width,htmlLabelPane.getPreferredSize().height); |
|
|
|
return htmlPanel.getPreferredSize(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
centerPane.add(htmlLabelPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); |
|
|
|
|
|
|
|
centerPane.add(commonPanel,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] column = {f, e}; |
|
|
|
centerPanel.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common")); |
|
|
|
double[] row = {p,p,p}; |
|
|
|
centerPanel.add(editorPanel, Toolkit.i18nText("Fine-Design_Chart_Rich_Text")); |
|
|
|
|
|
|
|
centerPanel.add(htmlPanel, Toolkit.i18nText("Fine-Design_Chart_Custom")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected String getLabelContentTitle() { |
|
|
|
|
|
|
|
return Toolkit.i18nText("Fine-Design_Report_Text"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLabelContentPane(JPanel contentPane) { |
|
|
|
|
|
|
|
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createButtonPane() { |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] column = {f, p}; |
|
|
|
|
|
|
|
double[] row = {p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
content = new UIButtonGroup<>(new String[]{ |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Common"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Rich_Text"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Custom") |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{null, null}, |
|
|
|
new Component[]{new UILabel(getLabelContentTitle()),content}, |
|
|
|
new Component[]{content, null} |
|
|
|
new Component[]{null,centerPane}, |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
initContentListener(); |
|
|
|
|
|
|
|
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); |
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); |
|
|
|
return getLabelContentPane(contentPane); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected String getLabelContentTitle () { |
|
|
|
protected JPanel createCommonFormatPanel() { |
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel formatContent = TableLayoutHelper.createTableLayoutPane(getPaneComponents(), getRowSize(p), new double[]{f, p}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(getLabelContentTitle()), formatContent} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{f, e}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLabelContentPane(JPanel contentPane) { |
|
|
|
private JPanel createCommonStylePane() { |
|
|
|
return createTableLayoutPaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane); |
|
|
|
styleButton = new UIButtonGroup<>(new String[]{ |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Automatic"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Custom") |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textAttrPane = new ChartTextAttrPane() { |
|
|
|
|
|
|
|
protected Component[][] getComponents(JPanel buttonPane) { |
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{null, getFontNameComboBox()}, |
|
|
|
|
|
|
|
new Component[]{null, buttonPane} |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
protected VanChartHtmlLabelPane createHtmlLabelPane() { |
|
|
|
JPanel buttonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), styleButton); |
|
|
|
return new VanChartHtmlLabelPaneWithOutWidthAndHeight(); |
|
|
|
|
|
|
|
|
|
|
|
JPanel stylePanel = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
stylePanel.add(buttonPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
stylePanel.add(textAttrPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initStyleButtonListener(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return stylePanel; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initStyleButtonListener() { |
|
|
|
|
|
|
|
styleButton.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
checkStylePane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkStylePane() { |
|
|
|
|
|
|
|
textAttrPane.setVisible(styleButton.getSelectedIndex() == 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createCommonPanel() { |
|
|
|
private JPanel createRichEditorPanel() { |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel formatContent = TableLayoutHelper.createTableLayoutPane(getRichTextComponents(), getRowSize(p), new double[]{f, p}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Content_Style")), createRichEditorButton()}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Format")), formatContent} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JComponent createRichEditorButton() { |
|
|
|
|
|
|
|
UIButton contentTextArea = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Rich_Text_Edit")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentTextArea.addMouseListener(new MouseAdapter() { |
|
|
|
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
|
|
|
fireRichEditor(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return contentTextArea; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void fireRichEditor() { |
|
|
|
|
|
|
|
final ModernUIPane<VanChartRichEditorPane.RichEditorModel> pane = VanChartRichEditorPane.createRichEditorPane(richText); |
|
|
|
|
|
|
|
BasicDialog dialog = pane.showWindow(new JFrame()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog.addDialogActionListener(new DialogActionAdapter() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void doOk() { |
|
|
|
|
|
|
|
VanChartRichEditorPane.RichEditorModel model = pane.update(); |
|
|
|
|
|
|
|
|
|
|
|
double[] columnSize = {f, p}; |
|
|
|
String content = model.getContent(); |
|
|
|
double[] rowSize = getRowSize(p); |
|
|
|
updateLocalRichText(content, model.isAuto()); |
|
|
|
|
|
|
|
|
|
|
|
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); |
|
|
|
SwingUtilities.getWindowAncestor(pane).setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void doCancel() { |
|
|
|
|
|
|
|
SwingUtilities.getWindowAncestor(pane).setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog.setVisible(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (parent != null) { |
|
|
|
|
|
|
|
parent.attributeChanged(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createHtmlPane() { |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double[] column = {f, p}; |
|
|
|
|
|
|
|
double[] row = {p, p}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
htmlLabelPane = createHtmlLabelPane(); |
|
|
|
|
|
|
|
htmlLabelPane.setParent(parent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] htmlComponents = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{htmlLabelPane, null} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(htmlComponents, row, column); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected VanChartHtmlLabelPane createHtmlLabelPane() { |
|
|
|
|
|
|
|
return new VanChartHtmlLabelPaneWithOutWidthAndHeight(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { |
|
|
|
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { |
|
|
@ -124,6 +407,13 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); |
|
|
|
percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initRichTextFormatPane(VanChartStylePane parent, JPanel showOnPane) { |
|
|
|
|
|
|
|
richTextCategoryNameFormatPane = new CategoryNameFormatPaneWithoutCheckBox(parent, showOnPane); |
|
|
|
|
|
|
|
richTextSeriesNameFormatPane = new SeriesNameFormatPaneWithoutCheckBox(parent, showOnPane); |
|
|
|
|
|
|
|
richTextValueFormatPane = new ValueFormatPaneWithoutCheckBox(parent, showOnPane); |
|
|
|
|
|
|
|
richTextPercentFormatPane = new PercentFormatPaneWithoutCheckBox(parent, showOnPane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { |
|
|
|
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); |
|
|
|
} |
|
|
|
} |
|
|
@ -141,6 +431,15 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getRichTextComponents() { |
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{richTextCategoryNameFormatPane, null}, |
|
|
|
|
|
|
|
new Component[]{richTextSeriesNameFormatPane, null}, |
|
|
|
|
|
|
|
new Component[]{richTextValueFormatPane, null}, |
|
|
|
|
|
|
|
new Component[]{richTextPercentFormatPane, null}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initContentListener() { |
|
|
|
private void initContentListener() { |
|
|
|
content.addActionListener(new ActionListener() { |
|
|
|
content.addActionListener(new ActionListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -152,16 +451,20 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void checkCardPane() { |
|
|
|
private void checkCardPane() { |
|
|
|
CardLayout cardLayout = (CardLayout) centerPane.getLayout(); |
|
|
|
CardLayout cardLayout = (CardLayout) centerPanel.getLayout(); |
|
|
|
if (content.getSelectedIndex() == 1) { |
|
|
|
if (content.getSelectedIndex() == 2) { |
|
|
|
cardLayout.show(centerPane,com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); |
|
|
|
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Custom")); |
|
|
|
if(isDirty()){ |
|
|
|
if(isDirty()){ |
|
|
|
setCustomFormatterText(); |
|
|
|
setCustomFormatterText(); |
|
|
|
setDirty(false); |
|
|
|
setDirty(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (content.getSelectedIndex() == 1) { |
|
|
|
|
|
|
|
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Rich_Text")); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common")); |
|
|
|
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Common")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stylePanel.setVisible(content.getSelectedIndex() != 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void setCustomFormatterText() { |
|
|
|
protected void setCustomFormatterText() { |
|
|
@ -169,8 +472,13 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isDirty() { |
|
|
|
public boolean isDirty() { |
|
|
|
return categoryNameFormatPane.isDirty() || seriesNameFormatPane.isDirty() || valueFormatPane.isDirty() || percentFormatPane.isDirty() |
|
|
|
|
|
|
|
|| (changedValueFormatPane != null && changedValueFormatPane.isDirty()) || (changedValueFormatPane != null && changedPercentFormatPane.isDirty()); |
|
|
|
return categoryNameFormatPane.isDirty() |
|
|
|
|
|
|
|
|| seriesNameFormatPane.isDirty() |
|
|
|
|
|
|
|
|| valueFormatPane.isDirty() |
|
|
|
|
|
|
|
|| percentFormatPane.isDirty() |
|
|
|
|
|
|
|
|| (changedValueFormatPane != null && changedValueFormatPane.isDirty()) |
|
|
|
|
|
|
|
|| (changedValueFormatPane != null && changedPercentFormatPane.isDirty()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setDirty(boolean isDirty) { |
|
|
|
public void setDirty(boolean isDirty) { |
|
|
@ -199,28 +507,103 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
content.setSelectedIndex(attrTooltipContent.isCommon() ? 0 : 1); |
|
|
|
if (attrTooltipContent.isCommon()) { |
|
|
|
|
|
|
|
content.setSelectedIndex(0); |
|
|
|
|
|
|
|
} else if (attrTooltipContent.isRichText()) { |
|
|
|
|
|
|
|
content.setSelectedIndex(1); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
content.setSelectedIndex(2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attrTooltipContent.isCustom()) { |
|
|
|
|
|
|
|
styleButton.setSelectedIndex(1); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
styleButton.setSelectedIndex(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.textAttrPane.populate(attrTooltipContent.getTextAttr()); |
|
|
|
|
|
|
|
|
|
|
|
populateFormatPane(attrTooltipContent); |
|
|
|
populateFormatPane(attrTooltipContent); |
|
|
|
|
|
|
|
populateRichEditor(attrTooltipContent); |
|
|
|
|
|
|
|
|
|
|
|
htmlLabelPane.populate(attrTooltipContent.getHtmlLabel()); |
|
|
|
htmlLabelPane.populate(attrTooltipContent.getHtmlLabel()); |
|
|
|
if(!attrTooltipContent.isCommon()){ |
|
|
|
if(!attrTooltipContent.isCommon()){ |
|
|
|
setDirty(false); |
|
|
|
setDirty(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
checkCardPane(); |
|
|
|
checkCardPane(); |
|
|
|
|
|
|
|
checkStylePane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
|
|
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
|
|
categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat()); |
|
|
|
VanChartFormatPaneWithCheckBox[] formatPaneGroup = new VanChartFormatPaneWithCheckBox[]{ |
|
|
|
seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat()); |
|
|
|
categoryNameFormatPane, |
|
|
|
valueFormatPane.populate(attrTooltipContent.getValueFormat()); |
|
|
|
seriesNameFormatPane, |
|
|
|
percentFormatPane.populate(attrTooltipContent.getPercentFormat()); |
|
|
|
valueFormatPane, |
|
|
|
|
|
|
|
percentFormatPane, |
|
|
|
|
|
|
|
changedValueFormatPane, |
|
|
|
|
|
|
|
changedPercentFormatPane |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (changedValueFormatPane != null) { |
|
|
|
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ |
|
|
|
changedValueFormatPane.populate(attrTooltipContent.getChangedValueFormat()); |
|
|
|
attrTooltipContent.getCategoryFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getSeriesFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getValueFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getPercentFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getChangedValueFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getChangedPercentFormat() |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0, len = formatPaneGroup.length; i < len; i++) { |
|
|
|
|
|
|
|
VanChartFormatPaneWithCheckBox formatPane = formatPaneGroup[i]; |
|
|
|
|
|
|
|
AttrTooltipFormat format = formatGroup[i]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (formatPane != null && format != null) { |
|
|
|
|
|
|
|
formatPane.populate(format); |
|
|
|
} |
|
|
|
} |
|
|
|
if (changedPercentFormatPane != null) { |
|
|
|
} |
|
|
|
changedPercentFormatPane.populate(attrTooltipContent.getChangedPercentFormat()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { |
|
|
|
|
|
|
|
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ |
|
|
|
|
|
|
|
richTextCategoryNameFormatPane, |
|
|
|
|
|
|
|
richTextSeriesNameFormatPane, |
|
|
|
|
|
|
|
richTextValueFormatPane, |
|
|
|
|
|
|
|
richTextPercentFormatPane, |
|
|
|
|
|
|
|
richTextChangedValueFormatPane, |
|
|
|
|
|
|
|
richTextChangedPercentFormatPane |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ |
|
|
|
|
|
|
|
attrTooltipContent.getRichTextCategoryFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getRichTextSeriesFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getRichTextValueFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getRichTextPercentFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getRichTextChangedValueFormat(), |
|
|
|
|
|
|
|
attrTooltipContent.getRichTextChangedPercentFormat() |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
populateRichTextFormat(formatPaneGroup, formatGroup); |
|
|
|
|
|
|
|
populateRichText(attrTooltipContent.getRichTextAttr()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void populateRichTextFormat(VanChartFormatPaneWithCheckBox[] formatPaneGroup, AttrTooltipFormat[] formatGroup) { |
|
|
|
|
|
|
|
for (int i = 0, len = formatPaneGroup.length; i < len; i++) { |
|
|
|
|
|
|
|
VanChartFormatPaneWithCheckBox formatPane = formatPaneGroup[i]; |
|
|
|
|
|
|
|
AttrTooltipFormat format = formatGroup[i]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (formatPane != null && format != null) { |
|
|
|
|
|
|
|
formatPane.populate(format); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 填充面板时,更新富文本编辑器参数
|
|
|
|
|
|
|
|
formatPane.updateFormatParams(richText.getParams(), format.getJs()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void populateRichText(AttrTooltipRichText tooltipRichText) { |
|
|
|
|
|
|
|
if (tooltipRichText != null) { |
|
|
|
|
|
|
|
updateLocalRichText(tooltipRichText.getContent(), tooltipRichText.isAuto()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -228,9 +611,13 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
AttrTooltipContent attrTooltipContent = createAttrTooltip(); |
|
|
|
AttrTooltipContent attrTooltipContent = createAttrTooltip(); |
|
|
|
|
|
|
|
|
|
|
|
attrTooltipContent.setCommon(content.getSelectedIndex() == 0); |
|
|
|
attrTooltipContent.setCommon(content.getSelectedIndex() == 0); |
|
|
|
|
|
|
|
attrTooltipContent.setRichText(content.getSelectedIndex() == 1); |
|
|
|
|
|
|
|
attrTooltipContent.setCustom(styleButton.getSelectedIndex() == 1); |
|
|
|
|
|
|
|
attrTooltipContent.setTextAttr(this.textAttrPane.update()); |
|
|
|
|
|
|
|
|
|
|
|
updateFormatPane(attrTooltipContent); |
|
|
|
updateFormatPane(attrTooltipContent); |
|
|
|
|
|
|
|
updateRichEditor(attrTooltipContent); |
|
|
|
|
|
|
|
updateTooltipRichText(attrTooltipContent); |
|
|
|
updateFormatsWithPaneWidth(attrTooltipContent); |
|
|
|
updateFormatsWithPaneWidth(attrTooltipContent); |
|
|
|
|
|
|
|
|
|
|
|
htmlLabelPane.update(attrTooltipContent.getHtmlLabel()); |
|
|
|
htmlLabelPane.update(attrTooltipContent.getHtmlLabel()); |
|
|
@ -243,11 +630,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
|
|
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { |
|
|
|
|
|
|
|
if (categoryNameFormatPane != null) { |
|
|
|
categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat()); |
|
|
|
categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (seriesNameFormatPane != null) { |
|
|
|
seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat()); |
|
|
|
seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (valueFormatPane != null) { |
|
|
|
valueFormatPane.update(attrTooltipContent.getValueFormat()); |
|
|
|
valueFormatPane.update(attrTooltipContent.getValueFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (percentFormatPane != null) { |
|
|
|
percentFormatPane.update(attrTooltipContent.getPercentFormat()); |
|
|
|
percentFormatPane.update(attrTooltipContent.getPercentFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
if (changedValueFormatPane != null) { |
|
|
|
if (changedValueFormatPane != null) { |
|
|
|
changedValueFormatPane.update(attrTooltipContent.getChangedValueFormat()); |
|
|
|
changedValueFormatPane.update(attrTooltipContent.getChangedValueFormat()); |
|
|
|
} |
|
|
|
} |
|
|
@ -256,6 +650,40 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void updateRichEditor(AttrTooltipContent attrTooltipContent) { |
|
|
|
|
|
|
|
if (richTextCategoryNameFormatPane != null) { |
|
|
|
|
|
|
|
richTextCategoryNameFormatPane.update(attrTooltipContent.getRichTextCategoryFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (richTextSeriesNameFormatPane != null) { |
|
|
|
|
|
|
|
richTextSeriesNameFormatPane.update(attrTooltipContent.getRichTextSeriesFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (richTextValueFormatPane != null) { |
|
|
|
|
|
|
|
richTextValueFormatPane.update(attrTooltipContent.getRichTextValueFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (richTextPercentFormatPane != null) { |
|
|
|
|
|
|
|
richTextPercentFormatPane.update(attrTooltipContent.getRichTextPercentFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (richTextChangedValueFormatPane != null) { |
|
|
|
|
|
|
|
richTextChangedValueFormatPane.update(attrTooltipContent.getRichTextChangedValueFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (richTextChangedPercentFormatPane != null) { |
|
|
|
|
|
|
|
richTextChangedPercentFormatPane.update(attrTooltipContent.getRichTextChangedPercentFormat()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateLocalRichText(String content, boolean isAuto) { |
|
|
|
|
|
|
|
richText.setContent(content); |
|
|
|
|
|
|
|
richText.setAuto(isAuto); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updateTooltipRichText(AttrTooltipContent attrTooltipContent) { |
|
|
|
|
|
|
|
if (attrTooltipContent != null) { |
|
|
|
|
|
|
|
AttrTooltipRichText tooltipRichText = attrTooltipContent.getRichTextAttr(); |
|
|
|
|
|
|
|
tooltipRichText.setContent(richText.getContent()); |
|
|
|
|
|
|
|
tooltipRichText.setAuto(richText.isAuto()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* CHART-1295 |
|
|
|
* CHART-1295 |
|
|
|
* 通过格式的面板宽度来判断在自定义js代码中是否显示this.seriesName字符串。 |
|
|
|
* 通过格式的面板宽度来判断在自定义js代码中是否显示this.seriesName字符串。 |
|
|
|