Browse Source

CHART-16040 箱型图富文本参数面板修改

final/10.0
Qinghui.Liu 4 years ago
parent
commit
f1fe0a4da6
  1. 82
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java
  2. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

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

@ -48,6 +48,9 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
private JPanel dataNumberPane;
private JPanel dataOutlierPane;
private JPanel richTextNumberPane;
private JPanel richTextOutlierPane;
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean isDetailed) {
super(parent, showOnPane);
checkFormatVisible(isDetailed);
@ -145,6 +148,16 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
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() {
return new Component[][]{
new Component[]{getRichTextCategoryNameFormatPane(), null},
@ -229,6 +242,72 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
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() {
return getCategoryNameFormatPane().isDirty()
|| getSeriesNameFormatPane().isDirty()
@ -354,5 +433,8 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
dataNumberPane.setVisible(detailed);
dataOutlierPane.setVisible(detailed);
richTextNumberPane.setVisible(detailed);
richTextOutlierPane.setVisible(detailed);
}
}

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

@ -384,17 +384,22 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
JPanel formatContent = TableLayoutHelper.createTableLayoutPane(getRichTextComponents(), getRowSize(p), new double[]{f, p});
Component[][] components = new Component[][]{
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_Use_Format")), formatContent}
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Format")), createRichFormatPanel()}
};
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() {
UIButton contentTextArea = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Rich_Text_Edit"));

Loading…
Cancel
Save