|
|
|
@ -16,7 +16,11 @@ import com.fr.general.ComparatorUtils;
|
|
|
|
|
import com.fr.plugin.chart.base.AttrTooltipContent; |
|
|
|
|
import com.fr.plugin.chart.base.AttrTooltipRichText; |
|
|
|
|
import com.fr.plugin.chart.base.TableFieldCollection; |
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; |
|
|
|
|
import com.fr.plugin.chart.base.format.AttrTooltipFormat; |
|
|
|
|
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.stable.StringUtils; |
|
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; |
|
|
|
@ -50,7 +54,9 @@ import java.awt.event.ActionEvent;
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 |
|
|
|
@ -436,15 +442,14 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void fireRichEditor() { |
|
|
|
|
|
|
|
|
|
AttrTooltipRichText richText = this.richTextTooltipContent.getRichTextAttr(); |
|
|
|
|
|
|
|
|
|
ModernUIPane<VanChartRichEditorModel> richEditorPane = VanChartRichEditorPane.createRichEditorPane(richText); |
|
|
|
|
VanChartRichTextPane richTextPane = new VanChartRichTextPane(getTableFieldNames(), richEditorPane); |
|
|
|
|
VanChartRichTextPane richTextPane = this.createRichTextPane(getTableFieldNames(), richEditorPane); |
|
|
|
|
|
|
|
|
|
BasicDialog richTextDialog = new VanChartRichTextDialog(DesignerContext.getDesignerFrame(), richTextPane); |
|
|
|
|
|
|
|
|
|
// 更新字段格式和汇总方式
|
|
|
|
|
richTextPane.populateBean(this.richTextTooltipContent); |
|
|
|
|
// 更新富文本编辑器内容
|
|
|
|
|
richEditorPane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); |
|
|
|
|
|
|
|
|
|
richTextDialog.addDialogActionListener(new DialogActionAdapter() { |
|
|
|
@ -486,6 +491,42 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
|
|
|
|
|
return parent.getDataModelColumnNames(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected VanChartRichTextPane createRichTextPane(List<String> tableFieldNames, ModernUIPane<VanChartRichEditorModel> richEditorPane) { |
|
|
|
|
return new VanChartRichTextPane(tableFieldNames, richEditorPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void refreshRichTextFormat(AttrTooltipRichText richText) { |
|
|
|
|
String[] fieldNames = new String[]{ |
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Series_Name"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Use_Value"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Use_Percent") |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
AttrTooltipFormat[] fieldFormats = new AttrTooltipFormat[]{ |
|
|
|
|
new AttrTooltipCategoryFormat(), |
|
|
|
|
new AttrTooltipSeriesFormat(), |
|
|
|
|
new AttrTooltipValueFormat(), |
|
|
|
|
new AttrTooltipPercentFormat() |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Map<String, String> params = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
for (int i = 0, len = fieldNames.length; i < len; i++) { |
|
|
|
|
params.put(fieldNames[i], fieldFormats[i].getJs()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<String> tableFieldNames = this.getTableFieldNames(); |
|
|
|
|
|
|
|
|
|
if (tableFieldNames != null) { |
|
|
|
|
for (String fieldName : tableFieldNames) { |
|
|
|
|
params.put(fieldName, fieldName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
richText.setParams(params); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createHtmlPane() { |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
@ -734,11 +775,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
|
|
|
|
|
attrTooltipContent.getRichTextChangedPercentFormat() |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 传递富文本格式
|
|
|
|
|
updateTooltipFormat(richTextTooltipContent, attrTooltipContent); |
|
|
|
|
// 更新富文本可用参数
|
|
|
|
|
populateRichTextFormat(formatPaneGroup, formatGroup); |
|
|
|
|
// 更新富文本初始参数
|
|
|
|
|
// populateRichTextFormat(richTextTooltipContent.getRichTextAttr());
|
|
|
|
|
refreshRichTextFormat(richTextTooltipContent.getRichTextAttr()); |
|
|
|
|
|
|
|
|
|
populateRichText(attrTooltipContent.getRichTextAttr()); |
|
|
|
|
|
|
|
|
|
checkRichEditorState(attrTooltipContent); |
|
|
|
|