Browse Source

Merge pull request #2488 in DESIGN/design from release/10.0 to bugfix/10.0

* commit 'b3e5bb5901bd5b125dd20cd68da5bf2abbe75c63':
  调整漏斗图系列参数
  调整漏斗图富文本参数
  CHART-15950 富文本编辑器的dialog不相应enter事件
  REPORT-38557 修复【JDK11】添加控件图标的面板里输入框显示不全
  消除魔术数
  CHART-16030 修改散点图富文本编辑器populate的内容
  CHART-16006 标签自定义JS界面修改
  CHART-16016 监控刷新自动数据点提示不支持富文本编辑器
bugfix/10.0
superman 4 years ago
parent
commit
4ab8a76a8d
  1. 5
      designer-base/src/main/java/com/fr/design/dialog/UIDialog.java
  2. 3
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  3. 27
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java
  5. 361
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java
  6. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java
  7. 31
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java
  8. 186
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  9. 8
      designer-chart/src/main/java/com/fr/van/chart/designer/component/label/GaugeLabelContentPane.java
  10. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/RefreshTooltipContentPaneWithOutSeries.java
  11. 23
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java
  12. 5
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java
  13. 8
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java
  14. 4
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java
  15. 4
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java
  16. 4
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java
  17. 10
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java
  18. 8
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java
  19. 4
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java
  20. 4
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTooltipContentPane.java
  21. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

5
designer-base/src/main/java/com/fr/design/dialog/UIDialog.java

@ -116,6 +116,11 @@ public abstract class UIDialog extends JDialog {
doCancel(); doCancel();
} }
}); });
applyEnterAction();
}
protected void applyEnterAction() {
JPanel defaultPane = (JPanel) this.getContentPane(); JPanel defaultPane = (JPanel) this.getContentPane();
InputMap inputMapAncestor = defaultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); InputMap inputMapAncestor = defaultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
ActionMap actionMap = defaultPane.getActionMap(); ActionMap actionMap = defaultPane.getActionMap();

3
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -404,7 +404,6 @@ public class CustomIconPane extends BasicPane {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, p}; double[] columnSize = {p, p};
int[][] rowCount = {{1, 1}, {1, 1}};
UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon")); UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon"));
browseButton.setPreferredSize(new Dimension(80, 25)); browseButton.setPreferredSize(new Dimension(80, 25));
browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button")); browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button"));
@ -443,7 +442,7 @@ public class CustomIconPane extends BasicPane {
imagePane.add(browseButton); imagePane.add(browseButton);
Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), nameTextField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":"), imagePane}}; Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), nameTextField}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":"), imagePane}};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1); JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }

27
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java

@ -0,0 +1,27 @@
package com.fr.van.chart.designer.component;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.Component;
public class VanChartHtmlLabelPaneWithBackGroundLabel extends VanChartHtmlLabelPane {
protected JPanel createWidthAndHeightPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH;
JPanel panel = super.createWidthAndHeightPane();
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Background")), panel},
};
return TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{d, f});
}
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java

@ -13,6 +13,6 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
} }
protected VanChartHtmlLabelPane createHtmlLabelPane() { protected VanChartHtmlLabelPane createHtmlLabelPane() {
return new VanChartHtmlLabelPane(); return new VanChartHtmlLabelPaneWithBackGroundLabel();
} }
} }

361
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPaneWithoutRichText.java

@ -1,361 +0,0 @@
package com.fr.van.chart.designer.component;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VanChartLabelContentPaneWithoutRichText extends BasicBeanPane<AttrTooltipContent> {
private UIButtonGroup<Integer> content;
private ValueFormatPaneWithCheckBox valueFormatPane;
private PercentFormatPaneWithCheckBox percentFormatPane;
private CategoryNameFormatPaneWithCheckBox categoryNameFormatPane;
private SeriesNameFormatPaneWithCheckBox seriesNameFormatPane;
//监控刷新时,自动数据点提示使用
private ChangedValueFormatPaneWithCheckBox changedValueFormatPane;
private ChangedPercentFormatPaneWithCheckBox changedPercentFormatPane;
private UIButtonGroup<Integer> styleButton;
private ChartTextAttrPane textAttrPane;
private JPanel centerPane;
private JPanel commonPanel;
private JPanel stylePanel;
private VanChartHtmlLabelPane htmlLabelPane;
private VanChartStylePane parent;
private JPanel showOnPane;
public VanChartLabelContentPaneWithoutRichText(VanChartStylePane parent, JPanel showOnPane) {
this.parent = parent;
this.showOnPane = showOnPane;
this.setLayout(new BorderLayout());
this.add(createLabelContentPane(), BorderLayout.CENTER);
}
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 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;
}
private JPanel createLabelContentPane() {
content = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Common"),
Toolkit.i18nText("Fine-Design_Chart_Custom")
});
initFormatPane(parent, showOnPane);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
commonPanel = createCommonPanel();
htmlLabelPane = createHtmlLabelPane();
htmlLabelPane.setParent(parent);
stylePanel = createTextStylePane();
centerPane = new JPanel(new CardLayout()) {
@Override
public Dimension getPreferredSize() {
if (content.getSelectedIndex() == 0) {
return commonPanel.getPreferredSize();
} else {
return new Dimension(commonPanel.getPreferredSize().width, htmlLabelPane.getPreferredSize().height);
}
}
};
centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom"));
centerPane.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common"));
double[] column = {f, e};
double[] row = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(getLabelContentTitle()), content},
new Component[]{null, centerPane},
};
initContentListener();
JPanel paramsPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column);
JPanel contentPane = new JPanel(new BorderLayout());
contentPane.add(paramsPanel, BorderLayout.CENTER);
contentPane.add(stylePanel, BorderLayout.SOUTH);
return getLabelContentPane(contentPane);
}
protected boolean hasTextStylePane() {
return true;
}
private JPanel createTextStylePane() {
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}
};
}
};
JPanel buttonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), styleButton);
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() {
if (hasTextStylePane()) {
stylePanel.setVisible(true);
textAttrPane.setVisible(styleButton.getSelectedIndex() == 1);
} else {
stylePanel.setVisible(false);
}
}
protected String getLabelContentTitle() {
return Toolkit.i18nText("Fine-Design_Report_Text");
}
protected JPanel getLabelContentPane(JPanel contentPane) {
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane);
}
protected VanChartHtmlLabelPane createHtmlLabelPane() {
return new VanChartHtmlLabelPane();
}
protected JPanel createCommonPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, p};
double[] rowSize = getRowSize(p);
return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane);
seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane);
valueFormatPane = new ValueFormatPaneWithCheckBox(parent, showOnPane);
percentFormatPane = new PercentFormatPaneWithCheckBox(parent, showOnPane);
}
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel);
}
protected double[] getRowSize(double p) {
return new double[]{p, p, p, p};
}
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{categoryNameFormatPane, null},
new Component[]{seriesNameFormatPane, null},
new Component[]{valueFormatPane, null},
new Component[]{percentFormatPane, null},
};
}
private void initContentListener() {
content.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkCardPane();
}
});
}
private void checkCardPane() {
CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (content.getSelectedIndex() == 1) {
cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Custom"));
if (isDirty()) {
setCustomFormatterText();
setDirty(false);
}
} else {
cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Common"));
}
}
protected void setCustomFormatterText() {
htmlLabelPane.setCustomFormatterText(updateBean().getFormatterTextFromCommon());
}
public boolean isDirty() {
return categoryNameFormatPane.isDirty() || seriesNameFormatPane.isDirty() || valueFormatPane.isDirty() || percentFormatPane.isDirty()
|| (changedValueFormatPane != null && changedValueFormatPane.isDirty()) || (changedValueFormatPane != null && changedPercentFormatPane.isDirty());
}
public void setDirty(boolean isDirty) {
categoryNameFormatPane.setDirty(isDirty);
seriesNameFormatPane.setDirty(isDirty);
valueFormatPane.setDirty(isDirty);
percentFormatPane.setDirty(isDirty);
if (changedValueFormatPane != null) {
changedValueFormatPane.setDirty(isDirty);
}
if (changedPercentFormatPane != null) {
changedPercentFormatPane.setDirty(isDirty);
}
}
@Override
protected String title4PopupWindow() {
return "";
}
@Override
public void populateBean(AttrTooltipContent attrTooltipContent) {
if (attrTooltipContent == null) {
return;
}
content.setSelectedIndex(attrTooltipContent.isCommon() ? 0 : 1);
populateFormatPane(attrTooltipContent);
htmlLabelPane.populate(attrTooltipContent.getHtmlLabel());
if (!attrTooltipContent.isCommon()) {
setDirty(false);
}
if (hasTextStylePane()) {
this.styleButton.setSelectedIndex(attrTooltipContent.isCustom() ? 1 : 0);
this.textAttrPane.populate(attrTooltipContent.getTextAttr());
}
checkCardPane();
checkStylePane();
}
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) {
categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat());
seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat());
valueFormatPane.populate(attrTooltipContent.getValueFormat());
percentFormatPane.populate(attrTooltipContent.getPercentFormat());
if (changedValueFormatPane != null) {
changedValueFormatPane.populate(attrTooltipContent.getChangedValueFormat());
}
if (changedPercentFormatPane != null) {
changedPercentFormatPane.populate(attrTooltipContent.getChangedPercentFormat());
}
}
public AttrTooltipContent updateBean() {
AttrTooltipContent attrTooltipContent = createAttrTooltip();
attrTooltipContent.setCommon(content.getSelectedIndex() == 0);
updateFormatPane(attrTooltipContent);
updateFormatsWithPaneWidth(attrTooltipContent);
htmlLabelPane.update(attrTooltipContent.getHtmlLabel());
if (hasTextStylePane()) {
attrTooltipContent.setCustom(styleButton.getSelectedIndex() == 1);
attrTooltipContent.setTextAttr(this.textAttrPane.update());
}
return attrTooltipContent;
}
protected AttrTooltipContent createAttrTooltip() {
return new AttrTooltipContent();
}
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) {
categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat());
seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat());
valueFormatPane.update(attrTooltipContent.getValueFormat());
percentFormatPane.update(attrTooltipContent.getPercentFormat());
if (changedValueFormatPane != null) {
changedValueFormatPane.update(attrTooltipContent.getChangedValueFormat());
}
if (changedPercentFormatPane != null) {
changedPercentFormatPane.update(attrTooltipContent.getChangedPercentFormat());
}
}
private void updateFormatsWithPaneWidth(AttrTooltipContent attrTooltipContent) {
int paneWidth = seriesNameFormatPane.getWidth();
if (paneWidth == 0) {
attrTooltipContent.getSeriesFormat().setEnable(false);
}
}
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRefreshTooltipContentPane.java

@ -22,6 +22,10 @@ public class VanChartRefreshTooltipContentPane extends VanChartTooltipContentPan
return new double[]{p,p,p,p,p,p}; return new double[]{p,p,p,p,p,p};
} }
protected boolean supportRichEditor() {
return false;
}
@Override @Override
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
super.initFormatPane(parent, showOnPane); super.initFormatPane(parent, showOnPane);

31
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java

@ -0,0 +1,31 @@
package com.fr.van.chart.designer.component;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
import java.awt.Dimension;
import java.awt.Frame;
public class VanChartRichEditorDialog extends BasicDialog {
public static final Dimension DEFAULT = new Dimension(660, 600);
public VanChartRichEditorDialog(Frame parent, BasicPane pane) {
super(parent, pane);
this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor"));
this.setBasicDialogSize(DEFAULT);
GUICoreUtils.centerWindow(this);
this.setResizable(false);
}
protected void applyEnterAction() {
}
public void checkValid() {
}
}

186
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -51,6 +51,15 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private static final long serialVersionUID = 8825929000117843641L; private static final long serialVersionUID = 8825929000117843641L;
// 字符样式button
private static final int TEXT_ATTR_AUTO_INDEX = 0;
private static final int TEXT_ATTR_CUSTOM_INDEX = 1;
// 标签内容button
private static final int COMMON_INDEX = 0;
private static final int RICH_EDITOR_INDEX = 1;
private static final int CUSTOM_INDEX_WITH_RICH_EDITOR = 2;
private static final int CUSTOM_INDEX_WITHOUT_RICH_EDITOR = 1;
private UIButtonGroup<Integer> content; private UIButtonGroup<Integer> content;
private CategoryNameFormatPaneWithCheckBox categoryNameFormatPane; private CategoryNameFormatPaneWithCheckBox categoryNameFormatPane;
@ -222,11 +231,19 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
private void initCenterPane() { private void initCenterPane() {
if (supportRichEditor()) {
initCenterPaneWithRichEditor();
} else {
initCenterPaneWithoutRichEditor();
}
}
private void initCenterPaneWithRichEditor() {
centerPanel = new JPanel(new CardLayout()) { centerPanel = new JPanel(new CardLayout()) {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
if (content.getSelectedIndex() == 0) { if (content.getSelectedIndex() == COMMON_INDEX) {
return commonPanel.getPreferredSize(); return commonPanel.getPreferredSize();
} else if (content.getSelectedIndex() == 1) { } else if (content.getSelectedIndex() == RICH_EDITOR_INDEX) {
return editorPanel.getPreferredSize(); return editorPanel.getPreferredSize();
} else { } else {
return htmlPanel.getPreferredSize(); return htmlPanel.getPreferredSize();
@ -239,6 +256,21 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
centerPanel.add(htmlPanel, Toolkit.i18nText("Fine-Design_Chart_Custom")); centerPanel.add(htmlPanel, Toolkit.i18nText("Fine-Design_Chart_Custom"));
} }
private void initCenterPaneWithoutRichEditor() {
centerPanel = new JPanel(new CardLayout()) {
public Dimension getPreferredSize() {
if (content.getSelectedIndex() == COMMON_INDEX) {
return commonPanel.getPreferredSize();
} else {
return htmlPanel.getPreferredSize();
}
}
};
centerPanel.add(commonPanel, Toolkit.i18nText("Fine-Design_Chart_Common"));
centerPanel.add(htmlPanel, Toolkit.i18nText("Fine-Design_Chart_Custom"));
}
protected String getLabelContentTitle() { protected String getLabelContentTitle() {
return Toolkit.i18nText("Fine-Design_Report_Text"); return Toolkit.i18nText("Fine-Design_Report_Text");
} }
@ -247,6 +279,14 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane); return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), contentPane);
} }
protected boolean supportRichEditor() {
return true;
}
protected boolean hasTextStylePane() {
return true;
}
private JPanel createButtonPane() { private JPanel createButtonPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
@ -254,11 +294,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
double[] column = {f, p}; double[] column = {f, p};
double[] row = {p, p}; double[] row = {p, p};
content = new UIButtonGroup<>(new String[]{ if (supportRichEditor()) {
Toolkit.i18nText("Fine-Design_Chart_Common"), content = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Rich_Text"), Toolkit.i18nText("Fine-Design_Chart_Common"),
Toolkit.i18nText("Fine-Design_Chart_Custom") Toolkit.i18nText("Fine-Design_Chart_Rich_Text"),
}); Toolkit.i18nText("Fine-Design_Chart_Custom")
});
} else {
content = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Common"),
Toolkit.i18nText("Fine-Design_Chart_Custom")
});
}
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
@ -319,7 +366,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
private void checkStylePane() { private void checkStylePane() {
textAttrPane.setVisible(styleButton.getSelectedIndex() == 1); if (hasTextStylePane()) {
stylePanel.setVisible(true);
textAttrPane.setVisible(styleButton.getSelectedIndex() == TEXT_ATTR_CUSTOM_INDEX);
} else {
stylePanel.setVisible(false);
}
} }
private JPanel createRichEditorPanel() { private JPanel createRichEditorPanel() {
@ -355,7 +407,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void fireRichEditor() { private void fireRichEditor() {
final ModernUIPane<VanChartRichEditorPane.RichEditorModel> pane = VanChartRichEditorPane.createRichEditorPane(richText); final ModernUIPane<VanChartRichEditorPane.RichEditorModel> pane = VanChartRichEditorPane.createRichEditorPane(richText);
BasicDialog dialog = pane.showWindow(new JFrame()); BasicDialog dialog = new VanChartRichEditorDialog(new JFrame(), pane);
pane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); pane.populate(VanChartRichEditorPane.getRichEditorModel(richText));
@ -455,20 +507,46 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void checkCardPane() { private void checkCardPane() {
if (supportRichEditor()) {
checkCardPaneWithRichEditor();
} else {
checkCardPaneWithoutRichEditor();
}
}
private void checkCardPaneWithRichEditor() {
CardLayout cardLayout = (CardLayout) centerPanel.getLayout(); CardLayout cardLayout = (CardLayout) centerPanel.getLayout();
if (content.getSelectedIndex() == 2) {
if (content.getSelectedIndex() == CUSTOM_INDEX_WITH_RICH_EDITOR) {
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Custom")); cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Custom"));
if(isDirty()){ checkCustomPane();
setCustomFormatterText(); } else if (content.getSelectedIndex() == RICH_EDITOR_INDEX) {
setDirty(false);
}
} else if (content.getSelectedIndex() == 1) {
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Rich_Text")); cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Rich_Text"));
} else { } else {
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Common")); cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Common"));
} }
stylePanel.setVisible(content.getSelectedIndex() != 1); stylePanel.setVisible(hasTextStylePane() && content.getSelectedIndex() != RICH_EDITOR_INDEX);
}
private void checkCardPaneWithoutRichEditor() {
CardLayout cardLayout = (CardLayout) centerPanel.getLayout();
if (content.getSelectedIndex() == CUSTOM_INDEX_WITHOUT_RICH_EDITOR) {
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Custom"));
checkCustomPane();
} else {
cardLayout.show(centerPanel, Toolkit.i18nText("Fine-Design_Chart_Common"));
}
stylePanel.setVisible(hasTextStylePane());
}
private void checkCustomPane() {
if (isDirty()) {
setCustomFormatterText();
setDirty(false);
}
} }
protected void setCustomFormatterText() { protected void setCustomFormatterText() {
@ -511,25 +589,20 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
return; return;
} }
if (attrTooltipContent.isCommon()) { populateTypeButton(attrTooltipContent);
content.setSelectedIndex(0); populateFormatPane(attrTooltipContent);
} else if (attrTooltipContent.isRichText()) { if (supportRichEditor()) {
content.setSelectedIndex(1); populateRichEditor(attrTooltipContent);
} else {
content.setSelectedIndex(2);
} }
if (hasTextStylePane()) {
if (attrTooltipContent.isCustom()) { if (attrTooltipContent.isCustom()) {
styleButton.setSelectedIndex(1); styleButton.setSelectedIndex(TEXT_ATTR_CUSTOM_INDEX);
} else { } else {
styleButton.setSelectedIndex(0); styleButton.setSelectedIndex(TEXT_ATTR_AUTO_INDEX);
}
this.textAttrPane.populate(attrTooltipContent.getTextAttr());
} }
this.textAttrPane.populate(attrTooltipContent.getTextAttr());
populateFormatPane(attrTooltipContent);
populateRichEditor(attrTooltipContent);
htmlLabelPane.populate(attrTooltipContent.getHtmlLabel()); htmlLabelPane.populate(attrTooltipContent.getHtmlLabel());
if(!attrTooltipContent.isCommon()){ if(!attrTooltipContent.isCommon()){
setDirty(false); setDirty(false);
@ -539,6 +612,26 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
checkStylePane(); checkStylePane();
} }
private void populateTypeButton(AttrTooltipContent attrTooltipContent) {
if (supportRichEditor()) {
if (attrTooltipContent.isCommon()) {
content.setSelectedIndex(COMMON_INDEX);
} else if (attrTooltipContent.isRichText()) {
content.setSelectedIndex(RICH_EDITOR_INDEX);
} else {
content.setSelectedIndex(CUSTOM_INDEX_WITH_RICH_EDITOR);
}
return;
}
if (attrTooltipContent.isCommon()) {
content.setSelectedIndex(COMMON_INDEX);
} else {
content.setSelectedIndex(CUSTOM_INDEX_WITHOUT_RICH_EDITOR);
}
}
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { protected void populateFormatPane(AttrTooltipContent attrTooltipContent) {
VanChartFormatPaneWithCheckBox[] formatPaneGroup = new VanChartFormatPaneWithCheckBox[]{ VanChartFormatPaneWithCheckBox[] formatPaneGroup = new VanChartFormatPaneWithCheckBox[]{
categoryNameFormatPane, categoryNameFormatPane,
@ -615,14 +708,17 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
public AttrTooltipContent updateBean() { public AttrTooltipContent updateBean() {
AttrTooltipContent attrTooltipContent = createAttrTooltip(); AttrTooltipContent attrTooltipContent = createAttrTooltip();
attrTooltipContent.setCommon(content.getSelectedIndex() == 0); updateLabelType(attrTooltipContent);
attrTooltipContent.setRichText(content.getSelectedIndex() == 1);
attrTooltipContent.setCustom(styleButton.getSelectedIndex() == 1);
attrTooltipContent.setTextAttr(this.textAttrPane.update());
updateFormatPane(attrTooltipContent); updateFormatPane(attrTooltipContent);
updateRichEditor(attrTooltipContent); if (supportRichEditor()) {
updateTooltipRichText(attrTooltipContent); updateRichEditor(attrTooltipContent);
updateTooltipRichText(attrTooltipContent);
}
if (hasTextStylePane()) {
attrTooltipContent.setCustom(styleButton.getSelectedIndex() == TEXT_ATTR_CUSTOM_INDEX);
attrTooltipContent.setTextAttr(this.textAttrPane.update());
}
updateFormatsWithPaneWidth(attrTooltipContent); updateFormatsWithPaneWidth(attrTooltipContent);
htmlLabelPane.update(attrTooltipContent.getHtmlLabel()); htmlLabelPane.update(attrTooltipContent.getHtmlLabel());
@ -630,6 +726,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
return attrTooltipContent; return attrTooltipContent;
} }
private void updateLabelType(AttrTooltipContent attrTooltipContent) {
if (supportRichEditor()) {
attrTooltipContent.setCommon(content.getSelectedIndex() == COMMON_INDEX);
attrTooltipContent.setRichText(content.getSelectedIndex() == RICH_EDITOR_INDEX);
return;
}
attrTooltipContent.setCommon(content.getSelectedIndex() == COMMON_INDEX);
attrTooltipContent.setRichText(false);
}
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {
return new AttrTooltipContent(); return new AttrTooltipContent();
} }

8
designer-chart/src/main/java/com/fr/van/chart/designer/component/label/GaugeLabelContentPane.java

@ -2,7 +2,7 @@ package com.fr.van.chart.designer.component.label;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.component.VanChartLabelContentPaneWithoutRichText; import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -10,7 +10,7 @@ import javax.swing.JPanel;
/** /**
* Created by mengao on 2017/8/13. * Created by mengao on 2017/8/13.
*/ */
public class GaugeLabelContentPane extends VanChartLabelContentPaneWithoutRichText { public class GaugeLabelContentPane extends VanChartTooltipContentPane {
public GaugeLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { public GaugeLabelContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(parent, showOnPane); super(parent, showOnPane);
@ -24,6 +24,10 @@ public class GaugeLabelContentPane extends VanChartLabelContentPaneWithoutRichTe
return contentPane; return contentPane;
} }
protected boolean supportRichEditor() {
return false;
}
protected boolean hasTextStylePane() { protected boolean hasTextStylePane() {
return false; return false;
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/RefreshTooltipContentPaneWithOutSeries.java

@ -17,6 +17,10 @@ public class RefreshTooltipContentPaneWithOutSeries extends TooltipContentPaneWi
super(null, showOnPane); super(null, showOnPane);
} }
protected boolean supportRichEditor() {
return false;
}
@Override @Override
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
super.initFormatPane(parent, showOnPane); super.initFormatPane(parent, showOnPane);

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

@ -1,15 +1,17 @@
package com.fr.van.chart.funnel.designer.style; package com.fr.van.chart.funnel.designer.style;
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.AttrTooltipNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat;
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.CategoryNameFormatPaneWithoutCheckBox;
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.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.ValueFormatPaneWithoutCheckBox;
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.JPanel; import javax.swing.JPanel;
@ -59,10 +61,29 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane {
setRichTextPercentFormatPane(new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane)); setRichTextPercentFormatPane(new FunnelPercentFormatPaneWithoutCheckBox(parent, showOnPane));
} }
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{
getRichTextSeriesNameFormatPane(),
getRichTextValueFormatPane(),
getRichTextPercentFormatPane()
};
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
attrTooltipContent.getRichTextSeriesFormat(),
attrTooltipContent.getRichTextValueFormat(),
attrTooltipContent.getRichTextPercentFormat()
};
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
}
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.getCategoryFormat().setEnable(false); attrTooltipContent.getCategoryFormat().setEnable(false);
attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat()); attrTooltipContent.setSeriesFormat(new AttrTooltipNameFormat());
attrTooltipContent.setRichTextSeriesFormat(new AttrTooltipNameFormat());
return attrTooltipContent; return attrTooltipContent;
} }

5
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelRefreshTooltipContentPane.java

@ -16,6 +16,11 @@ public class VanChartFunnelRefreshTooltipContentPane extends VanChartFunnelToolt
public VanChartFunnelRefreshTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { public VanChartFunnelRefreshTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(null, showOnPane); super(null, showOnPane);
} }
protected boolean supportRichEditor() {
return false;
}
@Override @Override
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
super.initFormatPane(parent, showOnPane); super.initFormatPane(parent, showOnPane);

8
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java

@ -3,7 +3,7 @@ package com.fr.van.chart.gantt.designer.style.label;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent;
import com.fr.van.chart.designer.component.VanChartLabelContentPaneWithoutRichText; import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
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.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
@ -16,7 +16,7 @@ import java.awt.Component;
/** /**
* Created by hufan on 2017/1/13. * Created by hufan on 2017/1/13.
*/ */
public class VanChartGanttLabelContentPane extends VanChartLabelContentPaneWithoutRichText { public class VanChartGanttLabelContentPane extends VanChartTooltipContentPane {
private VanChartFormatPaneWithCheckBox processesFormatPane; private VanChartFormatPaneWithCheckBox processesFormatPane;
private VanChartDateFormatPaneWithCheckBox startTimeFormatPane; private VanChartDateFormatPaneWithCheckBox startTimeFormatPane;
@ -57,6 +57,10 @@ public class VanChartGanttLabelContentPane extends VanChartLabelContentPaneWitho
}; };
} }
protected boolean supportRichEditor() {
return false;
}
protected Component[][] getPaneComponents() { protected Component[][] getPaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{processesFormatPane, null}, new Component[]{processesFormatPane, null},

4
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapRefreshTooltipContentPane.java

@ -23,6 +23,10 @@ public class VanChartMapRefreshTooltipContentPane extends VanChartMapTooltipCont
return new double[]{p,p,p,p,p,p}; return new double[]{p,p,p,p,p,p};
} }
protected boolean supportRichEditor() {
return false;
}
@Override @Override
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
super.initFormatPane(parent, showOnPane); super.initFormatPane(parent, showOnPane);

4
designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMutiPieRefreshTooltipContentPane.java

@ -19,6 +19,10 @@ public class VanChartMutiPieRefreshTooltipContentPane extends VanChartMultiPieTo
super(null, showOnPane); super(null, showOnPane);
} }
protected boolean supportRichEditor() {
return false;
}
@Override @Override
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
super.initFormatPane(parent, showOnPane); super.initFormatPane(parent, showOnPane);

4
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterRefreshTooltipContentPane.java

@ -41,6 +41,10 @@ public class VanChartScatterRefreshTooltipContentPane extends VanChartScatterToo
setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane); setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane);
} }
protected boolean supportRichEditor() {
return false;
}
protected double[] getRowSize(double p) { protected double[] getRowSize(double p) {
return new double[]{p, p, p, p, p, p}; return new double[]{p, p, p, p, p, p};
} }

10
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.scatter; package com.fr.van.chart.scatter;
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.scatter.attr.ScatterAttrTooltipContent; import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltipContent;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
@ -107,21 +108,24 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa
} }
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) { protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
super.populateRichEditor(attrTooltipContent);
if (attrTooltipContent instanceof ScatterAttrTooltipContent) { if (attrTooltipContent instanceof ScatterAttrTooltipContent) {
ScatterAttrTooltipContent scatterAttrTooltipContent = (ScatterAttrTooltipContent) attrTooltipContent; ScatterAttrTooltipContent scatterAttrTooltipContent = (ScatterAttrTooltipContent) attrTooltipContent;
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{
richTextXFormatPane, richTextYFormatPane, richTextSizeFormatPane getRichTextSeriesNameFormatPane(),
richTextXFormatPane,
richTextYFormatPane,
richTextSizeFormatPane
}; };
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
scatterAttrTooltipContent.getRichTextSeriesFormat(),
scatterAttrTooltipContent.getRichTextXFormat(), scatterAttrTooltipContent.getRichTextXFormat(),
scatterAttrTooltipContent.getRichTextYFormat(), scatterAttrTooltipContent.getRichTextYFormat(),
scatterAttrTooltipContent.getRichTextSizeFormat() scatterAttrTooltipContent.getRichTextSizeFormat()
}; };
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup); populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr()); populateRichText(attrTooltipContent.getRichTextAttr());
} }

8
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java

@ -4,7 +4,7 @@ package com.fr.van.chart.structure.desinger.style;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat; import com.fr.plugin.chart.multilayer.style.AttrTooltipMultiLevelNameFormat;
import com.fr.van.chart.designer.component.VanChartLabelContentPaneWithoutRichText; 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.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
@ -17,7 +17,7 @@ import java.awt.Component;
/** /**
* Created by shine on 2017/2/15. * Created by shine on 2017/2/15.
*/ */
public class VanChartStructureLabelContentPane extends VanChartLabelContentPaneWithoutRichText { public class VanChartStructureLabelContentPane extends VanChartTooltipContentPane {
public VanChartStructureLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { public VanChartStructureLabelContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(parent, showOnPane); super(parent, showOnPane);
} }
@ -54,6 +54,10 @@ public class VanChartStructureLabelContentPane extends VanChartLabelContentPaneW
setPercentFormatPane(percentFormatPane); setPercentFormatPane(percentFormatPane);
} }
protected boolean supportRichEditor() {
return false;
}
@Override @Override
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); AttrTooltipContent attrTooltipContent = new AttrTooltipContent();

4
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureRefreshTooltipContentPane.java

@ -38,6 +38,10 @@ public class VanChartStructureRefreshTooltipContentPane extends VanChartStructur
setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane); setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane);
} }
protected boolean supportRichEditor() {
return false;
}
protected double[] getRowSize(double p) { protected double[] getRowSize(double p) {
return new double[]{p, p, p, p, p}; return new double[]{p, p, p, p, p};
} }

4
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudRefreshTooltipContentPane.java

@ -51,6 +51,10 @@ public class VanChartWordCloudRefreshTooltipContentPane extends VanChartWordClou
setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane); setRichTextChangedPercentFormatPane(richTextChangedPercentFormatPane);
} }
protected boolean supportRichEditor() {
return false;
}
protected double[] getRowSize(double p) { protected double[] getRowSize(double p) {
return new double[]{p, p, p, p, p, p}; return new double[]{p, p, p, p, p, p};
} }

4
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -128,8 +128,8 @@
} }
str += " " + key + "=\"" + value + "\""; str += " " + key + "=\"" + value + "\"";
if (key === "alt" && dataIdMap[value]) { if (key === "alt" && dataIdMap[value.trim()]) {
str += " " + "data-id" + "=\"" + dataIdMap[value] + "\""; str += " " + "data-id" + "=\"" + dataIdMap[value.trim()] + "\"";
} }
}); });

Loading…
Cancel
Save