Browse Source

Pull request #2506: CHART-15942 & CHART-15944 & CHART-16058 & CHART-16038 & CHART-15999 & CHART-15946 & CHART-16036 & CHART-16031 & CHART-15990 & CHART-15965 & CHART-16009 标签形状选择后三种时,圆角灰化、标签边框线形选择为无时,其余面板隐藏

Merge in DESIGN/design from ~QINGHUI.LIU/design:release/10.0 to release/10.0

* commit 'ebfdb749b33ba8c57676d3a2862b0f040406b825':
  删除多余的赋值
  CHART-16009 标签纵向时无边框
  CHART-15965 无边框设置界面时,border宽度设置为0
  CHART-15990 富文本自动自定义切换时不改变content
  CHART-16031 完善仪表盘富文本参数
  CHART-16036 完善多层饼图富文本参数
  CHART-15946 标签边框颜色支持自动
  CHART-15999 完善地图富文本参数解析
  CHART-16038 完善框架图提示的富文本参数
  CHART-16058 完善漏斗图提示的富文本参数
  CHART-15944 标签形状选择后三种时,圆角灰化
  CHART-15942 标签边框线形选择为无时,其余面板隐藏
feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
02d76c6b14
  1. 198
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java
  2. 22
      designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java
  3. 29
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  4. 21
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java
  5. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java
  6. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java
  7. 2
      designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java
  8. 1
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java
  9. 1
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java
  10. 22
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java
  11. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

198
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java

@ -1,58 +1,210 @@
package com.fr.van.chart.designer.component.border;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.Marker;
import com.fr.chart.chartglyph.MarkerFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrBorderWithShape;
import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane {
public class VanChartBorderWithShapePane extends BasicPane {
private static final int RECTANGULAR_INDEX = 0;
private static final int DIALOG_INDEX = 1;
private MarkerComboBox shapePane;
private static final int AUTO_COLOR = 0;
private static final int CUSTOM_COLOR = 1;
protected void initComponents() {
shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers());
super.initComponents();
private LineComboBox lineTypeBox;
private UIButtonGroup<Integer> lineColorButton;
private ColorSelectBox lineColorBox;
private MarkerComboBox borderShape;
private UISpinner borderRadius;
private JPanel detailPane;
private JPanel colorBoxPane;
public VanChartBorderWithShapePane() {
initComponents();
createBorderPane();
}
private void initComponents() {
lineTypeBox = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
lineColorButton = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Automatic"),
Toolkit.i18nText("Fine-Design_Chart_Custom")
});
lineColorBox = new ColorSelectBox(100);
borderShape = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers());
borderRadius = new UISpinner(0, 1000, 1, 0);
}
private void createBorderPane() {
this.setLayout(new BorderLayout());
detailPane = createDetailPane();
this.add(createLineTypePane(), BorderLayout.CENTER);
this.add(detailPane, BorderLayout.SOUTH);
initLineTypeListener();
initLineColorListener();
initShapeListener();
}
private void initLineTypeListener() {
lineTypeBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkDetailPane();
}
});
}
private void checkDetailPane() {
detailPane.setVisible(lineTypeBox.getSelectedLineStyle() != Constants.LINE_NONE);
}
protected Component[][] getUseComponent() {
return new Component[][]{
private void initLineColorListener() {
lineColorButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkColorPane();
}
});
}
private void checkColorPane() {
colorBoxPane.setVisible(lineColorButton.getSelectedIndex() == CUSTOM_COLOR);
}
private void initShapeListener() {
borderShape.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkRadiusPane();
}
});
}
private void checkRadiusPane() {
borderRadius.setEnabled(borderShape.getSelectedIndex() == RECTANGULAR_INDEX || borderShape.getSelectedIndex() == DIALOG_INDEX);
}
private JPanel createLineTypePane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane},
UIComponentUtils.wrapWithBorderLayoutPane(lineTypeBox)}};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
}
private JPanel createDetailPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")),
UIComponentUtils.wrapWithBorderLayoutPane(shapePane)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()}
UIComponentUtils.wrapWithBorderLayoutPane(borderShape)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), borderRadius}
};
JPanel center = createLineColorPane();
JPanel south = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout());
panel.add(center, BorderLayout.CENTER);
panel.add(south, BorderLayout.SOUTH);
return panel;
}
protected double[] getRowSize() {
private JPanel createLineColorPane() {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p, p, p};
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] center = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), lineColorButton}
};
Component[][] south = new Component[][]{
new Component[]{null, null},
new Component[]{null, lineColorBox}
};
colorBoxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(south, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout());
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(center, rowSize, columnSize), BorderLayout.CENTER);
panel.add(colorBoxPane, BorderLayout.SOUTH);
return panel;
}
public void populate(AttrBorder border) {
super.populate(border);
protected String title4PopupWindow() {
return null;
}
if (border instanceof AttrBorderWithShape) {
shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape())));
public void populate(AttrBorderWithShape border) {
if (border == null) {
return;
}
}
public void update(AttrBorder border) {
super.update(border);
lineTypeBox.setSelectedLineStyle(border.getBorderStyle());
lineColorButton.setSelectedIndex(border.isAutoColor() ? AUTO_COLOR : CUSTOM_COLOR);
lineColorBox.setSelectObject(border.getBorderColor());
borderShape.setSelectedMarker((Marker.createMarker(border.getShape())));
borderRadius.setValue(border.getRoundRadius());
if (border instanceof AttrBorderWithShape) {
((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType()));
checkDetailPane();
checkColorPane();
checkRadiusPane();
}
public void update(AttrBorderWithShape border) {
if (border == null) {
return;
}
border.setBorderStyle(lineTypeBox.getSelectedLineStyle());
border.setAutoColor(lineColorButton.getSelectedIndex() == AUTO_COLOR);
border.setBorderColor(lineColorBox.getSelectObject());
border.setShape(MarkerType.parse(borderShape.getSelectedMarkder().getMarkerType()));
border.setRoundRadius((int) borderRadius.getValue());
}
}

22
designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java

@ -1,6 +1,10 @@
package com.fr.van.chart.designer.component.tooltip;
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.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -36,4 +40,22 @@ public class TooltipContentPaneWithOutSeries extends VanChartTooltipContentPane
new Component[]{getRichTextPercentFormatPane(), null}
};
}
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{
getRichTextCategoryNameFormatPane(),
getRichTextValueFormatPane(),
getRichTextPercentFormatPane()
};
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
attrTooltipContent.getRichTextCategoryFormat(),
attrTooltipContent.getRichTextValueFormat(),
attrTooltipContent.getRichTextPercentFormat()
};
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
}
}

29
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -36,6 +36,8 @@ import java.awt.Component;
public class VanChartPlotLabelDetailPane extends BasicPane {
private static final long serialVersionUID = -22438250307946275L;
private static final int HORIZONTAL_INDEX = 0;
private BasicBeanPane<AttrTooltipContent> dataLabelContentPane;
private UIButtonGroup<Integer> position;
@ -51,6 +53,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private JPanel positionPane;
private Integer[] oldPositionValues;
private JPanel borderPaneWithTitle;
private JPanel backgroundPaneWithTitle;
private VanChartStylePane parent;
private Plot plot;
@ -125,8 +130,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private JPanel createLabelBorderPane() {
borderPane = new VanChartBorderWithShapePane();
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
return borderPaneWithTitle;
}
private JPanel createLabelBackgroundPane() {
@ -142,7 +148,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
};
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane);
backgroundPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane);
return backgroundPaneWithTitle;
}
protected double[] getLabelStyleRowSize(double p) {
@ -227,6 +235,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"),
});
orientation.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
checkOrientation();
}
});
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation);
}
@ -309,6 +323,16 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
tractionLine.setSelected(position.getSelectedItem() == Constants.OUTSIDE);
checkPositionEnabled();
}
private void checkOrientation() {
if (orientation != null && borderPaneWithTitle != null && backgroundPaneWithTitle != null) {
boolean horizontal = orientation.getSelectedIndex() == HORIZONTAL_INDEX;
borderPaneWithTitle.setVisible(horizontal);
backgroundPaneWithTitle.setVisible(horizontal);
}
}
private void checkPositionEnabled() {
tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE);
}
@ -344,6 +368,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
checkAllUse();
checkOrientation();
}

21
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelTooltipContentPane.java

@ -1,6 +1,8 @@
package com.fr.van.chart.funnel.designer.style;
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.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
@ -9,6 +11,7 @@ import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckB
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.ValueFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -58,6 +61,24 @@ public class VanChartFunnelTooltipContentPane extends VanChartTooltipContentPane
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() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.getCategoryFormat().setEnable(false);

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

@ -45,6 +45,8 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipAreaNameFormat());
content.setValueFormat(new AttrTooltipMapValueFormat());
content.setRichTextCategoryFormat(new AttrTooltipAreaNameFormat());
content.setRichTextValueFormat(new AttrTooltipMapValueFormat());
return content;
}
}

2
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/tooltip/VanChartMapTooltipContentPane.java

@ -45,6 +45,8 @@ public class VanChartMapTooltipContentPane extends VanChartTooltipContentPane {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipAreaNameFormat());
content.setValueFormat(new AttrTooltipMapValueFormat());
content.setRichTextCategoryFormat(new AttrTooltipAreaNameFormat());
content.setRichTextValueFormat(new AttrTooltipMapValueFormat());
return content;
}
}

2
designer-chart/src/main/java/com/fr/van/chart/map/line/VanChartLineMapTooltipContentPane.java

@ -43,6 +43,8 @@ public class VanChartLineMapTooltipContentPane extends VanChartTooltipContentPan
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipStartAndEndNameFormat());
content.setValueFormat(new AttrTooltipValueFormat());
content.setRichTextCategoryFormat(new AttrTooltipStartAndEndNameFormat());
content.setRichTextValueFormat(new AttrTooltipValueFormat());
return content;
}

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

@ -38,6 +38,7 @@ public class VanChartMultiPieLabelContentPane extends VanChartLabelContentPane {
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
content.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return content;
}
}

1
designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieTooltipContentPane.java

@ -39,6 +39,7 @@ public class VanChartMultiPieTooltipContentPane extends VanChartTooltipContentPa
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent content = new AttrTooltipContent();
content.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
content.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return content;
}

22
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureTooltipContentPane.java

@ -3,6 +3,8 @@ package com.fr.van.chart.structure.desinger.style;
import com.fr.design.i18n.Toolkit;
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.multilayer.style.AttrTooltipMultiLevelNameFormat;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
@ -13,6 +15,7 @@ import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckB
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.ValueFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithoutCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
@ -87,10 +90,29 @@ public class VanChartStructureTooltipContentPane extends VanChartTooltipContentP
setRichTextPercentFormatPane(richTextPercentFormatPane);
}
protected void populateRichEditor(AttrTooltipContent attrTooltipContent) {
VanChartFormatPaneWithoutCheckBox[] formatPaneGroup = new VanChartFormatPaneWithoutCheckBox[]{
getRichTextCategoryNameFormatPane(),
getRichTextSeriesNameFormatPane(),
getRichTextValueFormatPane()
};
AttrTooltipFormat[] formatGroup = new AttrTooltipFormat[]{
attrTooltipContent.getRichTextCategoryFormat(),
attrTooltipContent.getRichTextSeriesFormat(),
attrTooltipContent.getRichTextValueFormat()
};
setRichTextAttr(new AttrTooltipRichText());
populateRichTextFormat(formatPaneGroup, formatGroup);
populateRichText(attrTooltipContent.getRichTextAttr());
}
@Override
protected AttrTooltipContent createAttrTooltip() {
AttrTooltipContent attrTooltipContent = new AttrTooltipContent();
attrTooltipContent.setCategoryFormat(new AttrTooltipMultiLevelNameFormat());
attrTooltipContent.setRichTextCategoryFormat(new AttrTooltipMultiLevelNameFormat());
return attrTooltipContent;
}
}

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

@ -232,7 +232,7 @@
content = this.editor.getValue(BI.NicEditor.FormatType.ESCAPE),
origin = content;
if (isAuto) {
content = this._switchToAutoStyle();
// content = this._switchToAutoStyle();
this.setFocus();
} else if (editorService.isRichTextEqual(content, this.options.placeholder)) {
content = "";

Loading…
Cancel
Save