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