Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/final/10.0)

* commit '0129658830b5f7f23f5c442458833a6a405b2d25':
  REPORT-41414 && REPORT-41495 【问题原因】REPORT-41414中之前改动没有考虑到菜单栏-模板-模板数据集界面中也会包括MaxMemRowCountPanel,然而模板数据集界面中给MaxMemRowCountPanel的空间比较小,会造成MaxMemRowCountPanel显示异常;REPORT-41495产生原因是Windows下的JDK11绘制时会有缩放效果,这里是字被放大了一点,把后面的框挤下去了,而之前回归改动只修改了"文件重命名"的情况,没有考虑"文件夹重命名" 【改动思路】REPORT-41414 在DBTableDataPane中把中间一部分的宽度缩短一点,相当于拉长了右侧的MaxMemRowCountPanel;REPORT-41495中将文本框缩小一点
  CHART-16040 箱型图富文本编辑器参数修改
  增加空判断
  CHART-16224 增加富文本条件属性界面事件
  CHART-16040 箱型图富文本参数面板修改
  CHART-15957 & CHART-15957 调整富文本打开时的鼠标位置和字符样式
  CHART-15955 & CHART-16115 调整富文本界面宽高
  删除多余的语句
  CHART-16226 富文本提示默认居左
  CHART-16148 解决组合图中标签颜色颜色触发更新导致的属性储存错误
  CHART-16154 & CHART-16194 删除搜索框、切换自动时,不修改对齐方式
  REPORT-41414 数据集-繁体设计器,共享数据集缓存到磁盘记录数输入框消失 【问题原因】之前的一个改动将MaxMexRowCountPanel中的UISpinner给拉长得过多,超过了设定的最大宽度,因此输入框没能显示 【改动思路】调整拉长幅度,另外根据国际化特点调整了最大宽度
final/10.0
Yyming 4 years ago
parent
commit
7a53ae4de6
  1. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  4. 135
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java
  5. 30
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java
  6. 8
      designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java
  7. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java
  8. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java
  9. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java
  10. 25
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  11. 3
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java
  12. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java
  13. 3
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java
  14. 3
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java
  15. 14
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html
  16. 3
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  17. 19
      designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js

3
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -185,7 +185,8 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> {
box.setMinimumSize(new Dimension(300, 400)); box.setMinimumSize(new Dimension(300, 400));
// 防止数据连接名过长时影响 split pane 分割效果 // 防止数据连接名过长时影响 split pane 分割效果
connectionTableProcedurePane.setMinimumSize(new Dimension(250, 400)); // 本界面中给MaxMemRowCountPanel留的空间太小,造成MaxMemRowCountPanel显示异常,这边减小一点最小宽度,拉长MaxMemRowCountPanel
connectionTableProcedurePane.setMinimumSize(new Dimension(230, 400));
connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400)); connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400));
// 使用SplitPane // 使用SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane);

4
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java

@ -21,7 +21,7 @@ public class MaxMemRowCountPanel extends UIToolbar {
private static final int MAX_IN_MEMORY = 1; private static final int MAX_IN_MEMORY = 1;
private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"), private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") }; com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") };
private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 250; private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 280;
private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4; private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4;
private static int getMaxComBoBoxWidth() { private static int getMaxComBoBoxWidth() {
int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]); int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]);
@ -73,7 +73,7 @@ public class MaxMemRowCountPanel extends UIToolbar {
switchCache = new UIComboBox(CACHE_LIST); switchCache = new UIComboBox(CACHE_LIST);
switchCache.addActionListener(switchStateL); switchCache.addActionListener(switchStateL);
numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); numberSpinner = new UISpinner(0, Integer.MAX_VALUE, 1);
numberSpinner.setNumberFieldColumns(4); numberSpinner.setNumberFieldColumns(3);
} }
private void showAllPanel() { private void showAllPanel() {

2
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -578,7 +578,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
} }
}); });
nameField.selectAll(); nameField.selectAll();
nameField.setPreferredSize(new Dimension(180, 20)); nameField.setPreferredSize(new Dimension(170, 20));
JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5));
topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15)); topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15));

135
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java

@ -7,6 +7,13 @@ import com.fr.design.layout.TableLayoutHelper;
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.AttrTooltipRichText;
import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat;
import com.fr.plugin.chart.base.format.AttrTooltipDataMaxFormat;
import com.fr.plugin.chart.base.format.AttrTooltipDataMedianFormat;
import com.fr.plugin.chart.base.format.AttrTooltipDataMinFormat;
import com.fr.plugin.chart.base.format.AttrTooltipDataNumberFormat;
import com.fr.plugin.chart.base.format.AttrTooltipDataOutlierFormat;
import com.fr.plugin.chart.base.format.AttrTooltipDataQ1Format;
import com.fr.plugin.chart.base.format.AttrTooltipDataQ3Format;
import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat;
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat; import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent;
@ -48,6 +55,9 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
private JPanel dataNumberPane; private JPanel dataNumberPane;
private JPanel dataOutlierPane; private JPanel dataOutlierPane;
private JPanel richTextNumberPane;
private JPanel richTextOutlierPane;
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) { public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) {
super(parent, showOnPane); super(parent, showOnPane);
checkFormatVisible(isDetailed); checkFormatVisible(isDetailed);
@ -145,6 +155,16 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
return commonPanel; return commonPanel;
} }
protected JPanel createRichFormatPanel() {
JPanel richFormatPanel = new JPanel(new BorderLayout());
richFormatPanel.add(createRichTextCateAndSeriesPane(), BorderLayout.NORTH);
richFormatPanel.add(createRichTextDataNumberPane(), BorderLayout.CENTER);
richFormatPanel.add(createRichTextDataDetailPane(), BorderLayout.SOUTH);
return richFormatPanel;
}
protected Component[][] getRichTextComponents() { protected Component[][] getRichTextComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{getRichTextCategoryNameFormatPane(), null}, new Component[]{getRichTextCategoryNameFormatPane(), null},
@ -229,6 +249,72 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
return detailPane; return detailPane;
} }
private JPanel createRichTextCateAndSeriesPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
Component[][] cateAndSeries = new Component[][]{
new Component[]{null, null},
new Component[]{null, getRichTextCategoryNameFormatPane()},
new Component[]{null, getRichTextSeriesNameFormatPane()}
};
return TableLayoutHelper.createTableLayoutPane(cateAndSeries, rowSize, columnSize);
}
private JPanel createRichTextDataNumberPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] dataNumber = new Component[][]{
new Component[]{null, null},
new Component[]{null, richTextNumber},
};
richTextNumberPane = TableLayoutHelper.createTableLayoutPane(dataNumber, rowSize, columnSize);
return richTextNumberPane;
}
private JPanel createRichTextDataDetailPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
JPanel detailPane = new JPanel(new BorderLayout());
Component[][] richTextDetail = new Component[][]{
new Component[]{null, null},
new Component[]{null, richTextMax},
new Component[]{new UILabel(getLabelContentTitle()), richTextQ3},
new Component[]{null, richTextMedian},
new Component[]{null, richTextQ1},
new Component[]{null, richTextMin}
};
Component[][] dataOutlier = new Component[][]{
new Component[]{null, null},
new Component[]{null, richTextOutlier},
};
richTextOutlierPane = TableLayoutHelper.createTableLayoutPane(dataOutlier, new double[]{p, p}, columnSize);
detailPane.add(TableLayoutHelper.createTableLayoutPane(richTextDetail, new double[]{p, p, p, p, p, p}, columnSize), BorderLayout.NORTH);
detailPane.add(richTextOutlierPane, BorderLayout.CENTER);
return detailPane;
}
public boolean isDirty() { public boolean isDirty() {
return getCategoryNameFormatPane().isDirty() return getCategoryNameFormatPane().isDirty()
|| getSeriesNameFormatPane().isDirty() || getSeriesNameFormatPane().isDirty()
@ -291,26 +377,48 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
if (attrTooltipContent instanceof AttrBoxTooltipContent) { if (attrTooltipContent instanceof AttrBoxTooltipContent) {
AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent;
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{ VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = getFormatPaneGroup();
AttrTooltipFormat[] formatGroup = getFormatGroup(boxTooltipContent);
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
checkRichEditorState(attrTooltipContent);
}
}
private VanChartFormatPaneWithoutCheckBox[] getFormatPaneGroup() {
if (detailed) {
return new VanChartFormatPaneWithoutCheckBox[]{
richTextNumber, richTextMax, richTextQ3, richTextMedian, richTextNumber, richTextMax, richTextQ3, richTextMedian,
richTextQ1, richTextMin, richTextOutlier richTextQ1, richTextMin, richTextOutlier
}; };
}
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{ return new VanChartFormatPaneWithoutCheckBox[]{
boxTooltipContent.getRichTextNumber(), richTextMax, richTextQ3, richTextMedian, richTextQ1, richTextMin
boxTooltipContent.getRichTextMax(),
boxTooltipContent.getRichTextQ3(),
boxTooltipContent.getRichTextMedian(),
boxTooltipContent.getRichTextQ1(),
boxTooltipContent.getRichTextMin(),
boxTooltipContent.getRichTextOutlier()
}; };
}
populateRichTextFormat(formatPaneGroup, formatGroup); private AttrTooltipFormat[] getFormatGroup(AttrBoxTooltipContent boxTooltipContent) {
populateRichText(attrTooltipContent.getRichTextAttr()); AttrTooltipDataNumberFormat richTextNumber = boxTooltipContent.getRichTextNumber();
AttrTooltipDataMaxFormat richTextMaxFormat = boxTooltipContent.getRichTextMax();
AttrTooltipDataQ3Format richTextQ3Format = boxTooltipContent.getRichTextQ3();
AttrTooltipDataMedianFormat richTextMedianFormat = boxTooltipContent.getRichTextMedian();
AttrTooltipDataQ1Format richTextQ1Format = boxTooltipContent.getRichTextQ1();
AttrTooltipDataMinFormat richTextMinFormat = boxTooltipContent.getRichTextMin();
AttrTooltipDataOutlierFormat richTextOutlierFormat = boxTooltipContent.getRichTextOutlier();
checkRichEditorState(attrTooltipContent); if (detailed) {
return new AttrTooltipFormat[]{
richTextNumber, richTextMaxFormat, richTextQ3Format, richTextMedianFormat,
richTextQ1Format, richTextMinFormat, richTextOutlierFormat
};
} }
return new AttrTooltipFormat[]{
richTextMaxFormat, richTextQ3Format, richTextMedianFormat, richTextQ1Format, richTextMinFormat
};
} }
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { protected void updateFormatPane(AttrTooltipContent attrTooltipContent) {
@ -354,5 +462,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
dataNumberPane.setVisible(detailed); dataNumberPane.setVisible(detailed);
dataOutlierPane.setVisible(detailed); dataOutlierPane.setVisible(detailed);
richTextNumberPane.setVisible(detailed);
richTextOutlierPane.setVisible(detailed);
} }
} }

30
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java

@ -5,6 +5,8 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.van.chart.designer.component.VanChartLabelContentPane;
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 com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane;
@ -14,6 +16,34 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa
super(plot, parent); super(plot, parent);
} }
protected void initToolTipContentPane(Plot plot) {
VanChartLabelContentPane dataLabelContentPane = new VanChartLabelContentPane(getParentPane(), VanChartColumnPlotLabelDetailPane.this) {
protected void checkCardPane() {
super.checkCardPane();
checkOrientationPane();
}
};
setDataLabelContentPane(dataLabelContentPane);
}
private void checkOrientationPane() {
VanChartLabelContentPane dataLabelContentPane = (VanChartLabelContentPane) getDataLabelContentPane();
UIButtonGroup<Integer> content = dataLabelContentPane.getContent();
UIButtonGroup<Integer> orientation = getOrientation();
if (content == null || orientation == null) {
return;
}
if (content.getSelectedIndex() == VanChartTooltipContentPane.RICH_EDITOR_INDEX) {
orientation.setSelectedIndex(HORIZONTAL_INDEX);
orientation.setEnabled(false);
} else {
orientation.setEnabled(true);
}
}
protected boolean hasLabelOrientationPane() { protected boolean hasLabelOrientationPane() {
return !((VanChartColumnPlot) this.getPlot()).isBar(); return !((VanChartColumnPlot) this.getPlot()).isBar();
} }

8
designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java

@ -83,14 +83,14 @@ public class VanChartCustomPlotLabelTabPane extends VanChartCustomPlotTabPane<Va
List<VanChartPlot> customPlotList = plot.getCustomPlotList(); List<VanChartPlot> customPlotList = plot.getCustomPlotList();
for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) { for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) {
ConditionAttr attrList = customPlotList.get(i).getConditionCollection().getDefaultAttr(); ConditionAttr attrList = customPlotList.get(i).getConditionCollection().getDefaultAttr();
DataSeriesCondition attr = customPlotList.get(i).getAttrLabelFromConditionCollection();
if (attr != null) {
attrList.remove(attr);
}
VanChartPlotLabelPane labelPane = (VanChartPlotLabelPane) paneList.get(i); VanChartPlotLabelPane labelPane = (VanChartPlotLabelPane) paneList.get(i);
AttrLabel attrLabel = labelPane.update(); AttrLabel attrLabel = labelPane.update();
DataSeriesCondition attr = customPlotList.get(i).getAttrLabelFromConditionCollection();
if (attr != null) {
attrList.remove(attr);
}
if (attrLabel != null) { if (attrLabel != null) {
attrList.addDataSeriesCondition(attrLabel); attrList.addDataSeriesCondition(attrLabel);
} }

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

@ -1,5 +1,7 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -15,4 +17,8 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane {
protected VanChartHtmlLabelPane createHtmlLabelPane() { protected VanChartHtmlLabelPane createHtmlLabelPane() {
return new VanChartHtmlLabelPaneWithBackGroundLabel(); return new VanChartHtmlLabelPaneWithBackGroundLabel();
} }
protected AttrTooltipContent createAttrTooltip() {
return new AttrTooltipContent(TextAlign.CENTER);
}
} }

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

@ -10,7 +10,7 @@ import java.awt.Frame;
public class VanChartRichEditorDialog extends BasicDialog { public class VanChartRichEditorDialog extends BasicDialog {
public static final Dimension DEFAULT = new Dimension(660, 600); public static final Dimension DEFAULT = new Dimension(960, 600);
public VanChartRichEditorDialog(Frame parent, BasicPane pane) { public VanChartRichEditorDialog(Frame parent, BasicPane pane) {
super(parent, pane); super(parent, pane);

21
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java

@ -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;
}
} }
} }

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

@ -57,10 +57,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private static final int TEXT_ATTR_AUTO_INDEX = 0; private static final int TEXT_ATTR_AUTO_INDEX = 0;
private static final int TEXT_ATTR_CUSTOM_INDEX = 1; private static final int TEXT_ATTR_CUSTOM_INDEX = 1;
// 标签内容button // 标签内容button
private static final int COMMON_INDEX = 0; public static final int COMMON_INDEX = 0;
private static final int RICH_EDITOR_INDEX = 1; public static final int RICH_EDITOR_INDEX = 1;
private static final int CUSTOM_INDEX_WITH_RICH_EDITOR = 2; public static final int CUSTOM_INDEX_WITH_RICH_EDITOR = 2;
private static final int CUSTOM_INDEX_WITHOUT_RICH_EDITOR = 1; public static final int CUSTOM_INDEX_WITHOUT_RICH_EDITOR = 1;
private UIButtonGroup<Integer> content; private UIButtonGroup<Integer> content;
@ -202,6 +202,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
this.richTextChangedPercentFormatPane = richTextChangedPercentFormatPane; this.richTextChangedPercentFormatPane = richTextChangedPercentFormatPane;
} }
public UIButtonGroup<Integer> getContent() {
return content;
}
public AttrTooltipRichText getRichTextAttr() { public AttrTooltipRichText getRichTextAttr() {
return richText; return richText;
} }
@ -384,17 +388,22 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
double[] columnSize = {f, e}; double[] columnSize = {f, e};
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
JPanel formatContent = TableLayoutHelper.createTableLayoutPane(getRichTextComponents(), getRowSize(p), new double[]{f, p});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, 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_Content_Style")), createRichEditorButton()},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Format")), formatContent} new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Format")), createRichFormatPanel()}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
protected JPanel createRichFormatPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
return TableLayoutHelper.createTableLayoutPane(getRichTextComponents(), getRowSize(p), new double[]{f, p});
}
private JComponent createRichEditorButton() { private JComponent createRichEditorButton() {
UIButton contentTextArea = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Rich_Text_Edit")); UIButton contentTextArea = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Rich_Text_Edit"));
@ -508,7 +517,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
private void checkCardPane() { protected void checkCardPane() {
if (supportRichEditor()) { if (supportRichEditor()) {
checkCardPaneWithRichEditor(); checkCardPaneWithRichEditor();
} else { } else {

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

@ -4,6 +4,7 @@ import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.AttrTooltipRichText; 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.base.format.AttrTooltipNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipNameFormat;
import com.fr.plugin.chart.type.TextAlign;
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;
@ -82,7 +83,7 @@ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane {
} }
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); AttrTooltipContent attrTooltipContent = new AttrTooltipContent(TextAlign.CENTER);
attrTooltipContent.getCategoryFormat().setEnable(false); attrTooltipContent.getCategoryFormat().setEnable(false);
attrTooltipContent.getRichTextCategoryFormat().setEnable(false); attrTooltipContent.getRichTextCategoryFormat().setEnable(false);

3
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java

@ -3,6 +3,7 @@ package com.fr.van.chart.map.designer.style.label;
import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat; import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat;
import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat; import com.fr.plugin.chart.base.format.AttrTooltipMapValueFormat;
import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.VanChartLabelContentPane;
import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithoutCheckBox;
@ -42,7 +43,7 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane {
@Override @Override
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent content = new AttrTooltipContent(); AttrTooltipContent content = new AttrTooltipContent(TextAlign.CENTER);
content.setCategoryFormat(new AttrTooltipAreaNameFormat()); content.setCategoryFormat(new AttrTooltipAreaNameFormat());
content.setValueFormat(new AttrTooltipMapValueFormat()); content.setValueFormat(new AttrTooltipMapValueFormat());
content.setRichTextCategoryFormat(new AttrTooltipAreaNameFormat()); content.setRichTextCategoryFormat(new AttrTooltipAreaNameFormat());

3
designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.multilayer.style;
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.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.VanChartLabelContentPane;
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.PercentFormatPaneWithoutCheckBox;
@ -36,7 +37,7 @@ public class VanChartMultiPieLabelContentPane extends VanChartLabelContentPane {
} }
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent content = new AttrTooltipContent(); AttrTooltipContent content = new AttrTooltipContent(TextAlign.CENTER);
content.setCategoryFormat(new AttrTooltipMultiLevelNameFormat()); content.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
content.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat()); content.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return content; return content;

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

@ -4,6 +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.plugin.chart.type.TextAlign;
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.PercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
@ -60,7 +61,7 @@ public class VanChartStructureLabelContentPane extends VanChartLabelContentPane
@Override @Override
protected AttrTooltipContent createAttrTooltip() { protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent(); AttrTooltipContent attrTooltipContent = new AttrTooltipContent(TextAlign.CENTER);
attrTooltipContent.setCategoryFormat(new AttrTooltipMultiLevelNameFormat()); attrTooltipContent.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return attrTooltipContent; return attrTooltipContent;
} }

14
designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

@ -41,6 +41,7 @@
var isAuto = Pool.data.isAuto(); var isAuto = Pool.data.isAuto();
var params = Pool.data.getParams(); var params = Pool.data.getParams();
var initParams = Pool.data.getInitParams(); var initParams = Pool.data.getInitParams();
var align = Pool.data.getAlign();
var getDimensionIds = function (params) { var getDimensionIds = function (params) {
var result = []; var result = [];
@ -58,7 +59,7 @@
return result; return result;
} }
var getInitContent = function (params, initParams) { var getInitContent = function (params, initParams, align) {
var editorService = BI.Services.getService("bi.service.design.chart.common.editor"); var editorService = BI.Services.getService("bi.service.design.chart.common.editor");
var paramGroup = params.split("-"); var paramGroup = params.split("-");
@ -68,7 +69,7 @@
var [key, value] = paramGroup[i].split(":"); var [key, value] = paramGroup[i].split(":");
if (initParams.indexOf(value) > -1) { if (initParams.indexOf(value) > -1) {
content += '<p style="text-align: center;">' + editorService.getEditorParamImage(key) + '<br></p>'; content += '<p style="text-align:' + align + ';">' + editorService.getEditorParamImage(key) + '<br></p>';
} }
} }
@ -78,7 +79,7 @@
var dimensionIds = getDimensionIds(params); var dimensionIds = getDimensionIds(params);
if (initParams) { if (initParams) {
content = getInitContent(params, initParams); content = getInitContent(params, initParams, align);
} }
var rich_editor = BI.createWidget({ var rich_editor = BI.createWidget({
@ -118,16 +119,21 @@
var isAuto = Pool.data.isAuto(); var isAuto = Pool.data.isAuto();
var params = Pool.data.getParams(); var params = Pool.data.getParams();
var initParams = Pool.data.getInitParams(); var initParams = Pool.data.getInitParams();
var align = Pool.data.getAlign();
if (initParams) { if (initParams) {
content = getInitContent(params, initParams); content = getInitContent(params, initParams, align);
} }
rich_editor.editor.bindToolbar(rich_editor.bar);
rich_editor.setValue({ rich_editor.setValue({
content: content, content: content,
isAuto: isAuto, isAuto: isAuto,
dimensionIds: getDimensionIds(params) dimensionIds: getDimensionIds(params)
}); });
rich_editor.setFocus();
} }
Pool.update = function () { Pool.update = function () {

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

@ -27,7 +27,6 @@
this.editor = BI.createWidget({ this.editor = BI.createWidget({
type: "bi.nic_editor", type: "bi.nic_editor",
$value: "chart-common-editor", $value: "chart-common-editor",
height: 365,
cls: "editor bi-border bi-focus-shadow " + (o.textAlign === "center" ? "editor-center-text" : ""), cls: "editor bi-border bi-focus-shadow " + (o.textAlign === "center" ? "editor-center-text" : ""),
listeners: [{ listeners: [{
eventName: BI.NicEditor.EVENT_FOCUS, eventName: BI.NicEditor.EVENT_FOCUS,
@ -194,7 +193,7 @@
content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE), content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE),
isEqualToPlaceholder = editorService.isRichTextEqual(content, this.options.placeholder); isEqualToPlaceholder = editorService.isRichTextEqual(content, this.options.placeholder);
var HTML_ONLY_STYLE_TAG = "<font[\\s\\S]*?>|</font>|<span[\\s\\S]*?>|</span>|<b\\s+(.*?)>|<b>|</b>|<u[\\s\\S]*?>|</u>|<i\\s+(.*?)>|<i>|</i>|<strong[\\s\\S]*?>|</strong>|<em[\\s\\S]*?>|</em>|<div[\\s\\S]style(.*?)>|</div>|<p[\\s\\S]style(.*?)>|<p.[\\s\\S]*align(.*?)>|</p>"; var HTML_ONLY_STYLE_TAG = "<font[\\s\\S]*?>|</font>|<span[\\s\\S]*?>|</span>|<b\\s+(.*?)>|<b>|</b>|<u[\\s\\S]*?>|</u>|<i\\s+(.*?)>|<i>|</i>|<strong[\\s\\S]*?>|</strong>|<em[\\s\\S]*?>|</em>|<div[\\s\\S]style(.*?)>|</div>";
if (!isEqualToPlaceholder) { if (!isEqualToPlaceholder) {
content = content.replaceAll(HTML_ONLY_STYLE_TAG, ""); content = content.replaceAll(HTML_ONLY_STYLE_TAG, "");

19
designer-chart/src/main/resources/com/fr/design/editor/script/insertcombo/combo.insert_param.js

@ -30,6 +30,7 @@
items: this.model.items, items: this.model.items,
chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE, chooseType: BI.ButtonGroup.CHOOSE_TYPE_SINGLE,
behaviors: {}, behaviors: {},
width: 200,
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
@ -45,27 +46,15 @@
var searchPopup = { var searchPopup = {
type: "bi.vertical", type: "bi.vertical",
cls: "bi-border", cls: "bi-border",
hgap: 15, tgap: 10,
tgap: 5,
bgap: 10, bgap: 10,
items: [{ items: [this.adapter]
type: "bi.searcher",
adapter: this.adapter,
width: 210,
height: 24,
listeners: [{
eventName: BI.Searcher.EVENT_CHANGE,
action: function () {
self.store.changeParam(this.getValue()[0]);
}
}]
}, this.adapter]
}; };
return { return {
type: "bi.combo", type: "bi.combo",
direction: "bottom,left", direction: "bottom,left",
isNeedAdjustWidth: false, isNeedAdjustWidth: true,
el: { el: {
type: "bi.vertical_adapt", type: "bi.vertical_adapt",
items: [{ items: [{

Loading…
Cancel
Save