|
|
|
@ -2,6 +2,7 @@ package com.fr.van.chart.designer.component;
|
|
|
|
|
|
|
|
|
|
import com.fr.design.ui.ModernUIPane; |
|
|
|
|
import com.fr.plugin.chart.base.AttrTooltipRichText; |
|
|
|
|
import com.fr.plugin.chart.type.TextAlign; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.teamdev.jxbrowser.chromium.Browser; |
|
|
|
|
import com.teamdev.jxbrowser.chromium.JSValue; |
|
|
|
@ -71,12 +72,18 @@ public class VanChartRichEditorPane {
|
|
|
|
|
|
|
|
|
|
String content = richText.getContent(); |
|
|
|
|
String initParams = StringUtils.EMPTY; |
|
|
|
|
String align = StringUtils.EMPTY; |
|
|
|
|
|
|
|
|
|
if (content.contains("data-id") && !content.contains("class")) { |
|
|
|
|
initParams = richText.getInitParamsContent(); |
|
|
|
|
|
|
|
|
|
String left = TextAlign.LEFT.getAlign(); |
|
|
|
|
String center = TextAlign.CENTER.getAlign(); |
|
|
|
|
|
|
|
|
|
align = content.contains(left) ? left : center; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams); |
|
|
|
|
return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static class RichEditorModel { |
|
|
|
@ -84,12 +91,14 @@ public class VanChartRichEditorPane {
|
|
|
|
|
private boolean auto; |
|
|
|
|
private String params; |
|
|
|
|
private String initParams; |
|
|
|
|
private String align; |
|
|
|
|
|
|
|
|
|
public RichEditorModel(String content, boolean auto, String params, String initParams) { |
|
|
|
|
public RichEditorModel(String content, boolean auto, String params, String initParams, String align) { |
|
|
|
|
this.content = content; |
|
|
|
|
this.auto = auto; |
|
|
|
|
this.params = params; |
|
|
|
|
this.initParams = initParams; |
|
|
|
|
this.align = align; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getContent() { |
|
|
|
@ -123,5 +132,13 @@ public class VanChartRichEditorPane {
|
|
|
|
|
public void setInitParams(String initParams) { |
|
|
|
|
this.initParams = initParams; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getAlign() { |
|
|
|
|
return align; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setAlign(String align) { |
|
|
|
|
this.align = align; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|