From 3ed9773a44ef3f976906702e42bc85e0d0db3aa6 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 26 Oct 2020 16:42:58 +0800 Subject: [PATCH 1/6] =?UTF-8?q?REPORT-41299=20=E6=96=B0=E5=BB=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4-=E8=BD=ACmeiao=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E5=A6=82=E6=9E=9C=E5=BB=BA=E7=AB=8B=E4=BA=86?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=B0=86=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=88=97=E5=90=8D=E6=97=B6=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=85=B6=E4=B8=AD=E4=B8=80=E4=B8=AA=E4=BC=9A=E9=80=A0?= =?UTF-8?q?=E6=88=90cTreeNode.getFirstChild()=E4=BA=A7=E7=94=9F=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=EF=BC=8C=E4=BB=8E=E8=80=8C=E4=B8=8D=E8=83=BD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=95=8C=E9=9D=A2=EF=BC=8C=E7=9C=8B=E8=B5=B7=E6=9D=A5?= =?UTF-8?q?=E5=B0=B1=E6=98=AF=E5=88=A0=E9=99=A4=E4=B8=8D=E6=8E=89=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=ADcTreeNode=E6=98=AF=E5=90=A6=E6=98=AF?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B9=B6=E5=A4=84?= =?UTF-8?q?=E4=BA=8E=E5=B1=95=E5=BC=80=E7=8A=B6=E6=80=81=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=98=AF=E7=9A=84=EF=BC=8C=E5=B0=86=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=BD=AE=E4=B8=BA=E4=B8=8D=E5=B1=95=E5=BC=80?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6break=E8=B7=B3=E8=BF=87=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=AD=90=E8=8A=82=E7=82=B9=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E9=81=BF=E5=85=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/TableDataTree.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java index 8f49b6e50..3feabeac1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java @@ -118,6 +118,11 @@ public class TableDataTree extends UserObjectRefreshJTree { break; } new_nodes[ci].setExpanded(cTreeNode.isExpanded()); + // REPORT-41299 如果建立的是错误的数据集(没有Child的情况)且这个错误数据集处于isExpanded状态,会在后面的if语句中调用getFirstChild()产生异常,因此这里判断一下 + if (cTreeNode.isExpanded() && cTreeNode.getChildCount() == 0) { + new_nodes[ci].setExpanded(false); + break; + } if (cTreeNode.getFirstChild() instanceof ExpandMutableTreeNode && cTreeNode.isExpanded()) { checkChildNodes(cTreeNode, new_nodes[ci]); } @@ -247,4 +252,4 @@ public class TableDataTree extends UserObjectRefreshJTree { treeModel.reload(root); } -} \ No newline at end of file +} From d56742c6dab1409854acb7e1a2052023db548a64 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 26 Oct 2020 17:18:53 +0800 Subject: [PATCH 2/6] =?UTF-8?q?CHART-15902=20=E5=88=86=E7=B1=BB=E8=BD=B4?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/axis/VanChartBaseAxisPane.java | 113 ++++++++++-------- .../component/AxisLabelDisplayComboBox.java | 48 ++++++++ 2 files changed, 112 insertions(+), 49 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/AxisLabelDisplayComboBox.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index be2c7d8a5..4590d132b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -34,6 +34,7 @@ import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.axis.component.AxisLabelDisplayComboBox; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -66,6 +67,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected ChartTextAttrPane labelTextAttrPane; protected UINumberDragPane labelTextRotation; + private AxisLabelDisplayComboBox labelDisplayComboBox; + //轴标签缩略间隔显示 恢复用注释。下面6行删除。 protected UITextField labelGapValue; @@ -75,8 +78,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { //protected UISpinner labelGapValue; protected JPanel labelPanel; + private JPanel labelGapPane; private JPanel labelGapStylePane; private JPanel labelGapValuePane; + private JPanel labelDisplayPane; protected LineComboBox axisLineStyle; protected ColorSelectBox axisLineColor; @@ -127,7 +132,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { double[] rowSize = {p, p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, column, isXAxis), null}, - new Component[]{createLabelPane(new double[]{p, p}, column), null}, + new Component[]{createLabelPane(new double[]{p, p, p}, column), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, new Component[]{createDisplayStrategy(), null}, @@ -142,7 +147,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { titleAlignPane = isXAxis ? getXAxisTitleAlignPane() : getYAxisTitleAlignPane(); titleAlignPane.setSelectedItem(Constants.CENTER); titleContent = new TinyFormulaPane(); - titleUseHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); + titleUseHtml = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Html")); UIComponentUtils.setLineWrap(titleUseHtml); titleTextAttrPane = getChartTextAttrPane(); titleTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); @@ -153,12 +158,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), titleContent}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Content")), titleContent}, new Component[]{null, titleUseHtml}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), titleAlignPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), titleAlignPane}, new Component[]{titleTextAttrPane, null}, new Component[]{ - FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")), + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_TextRotation")), UIComponentUtils.wrapWithBorderLayoutPane(titleTextRotation) }, }; @@ -199,31 +204,39 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected JPanel createLabelPane(double[] row, double[] col) { - showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")}); - labelTextAttrPane = getChartTextAttrPane(); + showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); + labelDisplayComboBox = new AxisLabelDisplayComboBox(); + labelTextAttrPane = getChartTextAttrPane(); labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); - labelGapStyle = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")}); + labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); labelGapValue = new UITextField(); Component[][] gapComponents = new Component[][]{ new Component[]{ - FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")), + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_TextRotation")), UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation) }, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle}, + new Component[]{null, null} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); - labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); - JPanel gapPanel = new JPanel(new BorderLayout()); - gapPanel.add(panel, BorderLayout.CENTER); - gapPanel.add(labelGapValuePane, BorderLayout.SOUTH); + + JPanel gapDetailPane = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); + + labelDisplayPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show"), labelDisplayComboBox); + labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + + labelGapPane = new JPanel(new BorderLayout()); + labelGapPane.add(gapDetailPane, BorderLayout.CENTER); + labelGapPane.add(labelGapValuePane, BorderLayout.SOUTH); Component[][] components = new Component[][]{ + new Component[]{labelDisplayPane, null}, new Component[]{labelTextAttrPane, null}, - new Component[]{gapPanel, null}, + new Component[]{labelGapPane, null}, }; - JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); + JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); + labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); showLabel.addActionListener(new ActionListener() { @@ -238,15 +251,17 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { checkLabelGapValuePane(); } }); - JPanel jPanel = new JPanel(new BorderLayout()); - jPanel.add(showLabelPane, BorderLayout.NORTH); - jPanel.add(labelPanel, BorderLayout.CENTER); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, jPanel); + + JPanel labelPane = new JPanel(new BorderLayout()); + labelPane.add(showLabelPane, BorderLayout.NORTH); + labelPane.add(labelPanel, BorderLayout.CENTER); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane); } // protected JPanel createLabelPane(double[] row, double[] col){ // double p = TableLayout.PREFERRED; -// showLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Show"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hidden")}); +// showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); // labelTextAttrPane = getChartTextAttrPane(); // // JPanel rotationPane = createLabelRotationPane(col); @@ -259,7 +274,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { // new Component[]{overlapPane, null}, // }; // -// JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel); +// JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel); // labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, col); // labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); // showLabel.addActionListener(new ActionListener() { @@ -279,7 +294,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { Component[][] gapComponents = new Component[][]{ new Component[]{ - FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")), + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_TextRotation")), UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation) } }; @@ -345,13 +360,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected JPanel createLineStylePane(double[] row, double[] col) { axisLineStyle = createLineComboBox(); axisLineColor = new ColorSelectBox(100); - String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}; + String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}; AxisTickLineType[] values = new AxisTickLineType[]{AxisTickLineType.TICK_LINE_OUTSIDE, AxisTickLineType.TICK_LINE_NONE}; mainTick = new UIButtonGroup(strings, values); secondTick = new UIButtonGroup(strings, values); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getLineStylePaneComponents(), row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Line_Style"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Axis_Line_Style"), panel); } protected LineComboBox createLineComboBox() { @@ -361,34 +376,34 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected Component[][] getLineStylePaneComponents() { return new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTick}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secondTick}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTick}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secondTick}, }; } protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis) { position = new UIButtonGroup(getAxisPositionNameArray(isXAxis), getAxisPositionValueArray(isXAxis)); - reversed = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); + reversed = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); Component[][] components = new Component[][]{ new Component[]{null, null}, new Component[]{ - FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Position")), + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Position")), UIComponentUtils.wrapWithBorderLayoutPane(position) }, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")), reversed}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_AxisReversed")), reversed}, }; JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel); } private String[] getAxisPositionNameArray(boolean isXAxis) { if (isXAxis) { - return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Vertical_Zero")}; + return new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Top"), Toolkit.i18nText("Fine-Design_Chart_Axis_Bottom"), Toolkit.i18nText("Fine-Design_Chart_Axis_Vertical_Zero")}; } else { - return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Left"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Right"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Vertical_Zero")}; + return new String[]{Toolkit.i18nText("Fine-Design_Chart_Layout_Left"), Toolkit.i18nText("Fine-Design_Chart_Layout_Right"), Toolkit.i18nText("Fine-Design_Chart_Axis_Vertical_Zero")}; } } @@ -403,10 +418,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected JPanel createDisplayStrategy() { //区域显示策略 恢复用注释。删除到return,即除了注释的代码都删除。 maxProportion = new UISpinner(0, 100, 1, 30); - axisLimitSize = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); + axisLimitSize = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Limit"), Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); - JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), axisLimitSize); - maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), axisLimitSize); + maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); JPanel panel = new JPanel(new BorderLayout()); panel.add(limitSizePane, BorderLayout.NORTH); @@ -419,7 +434,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } }); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel); //区域显示策略 恢复用注释。取消注释。 // limitPane = new LimitPane(); @@ -427,8 +442,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected JPanel createValueStylePane() { - valueFormatStyle = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")}); + valueFormatStyle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Common"), + Toolkit.i18nText("Fine-Design_Chart_Custom")}); valueFormat = createFormatPane(); checkFormatType(); @@ -436,8 +451,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { htmlLabelPane = new VanChartHtmlLabelPane(); centerPane = new JPanel(new CardLayout()); - centerPane.add(valueFormat, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common")); - centerPane.add(htmlLabelPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); + centerPane.add(valueFormat, Toolkit.i18nText("Fine-Design_Chart_Common")); + centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -445,7 +460,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ new Component[]{null, null}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format"), SwingConstants.LEFT), valueFormatStyle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format"), SwingConstants.LEFT), valueFormatStyle}, new Component[]{null, centerPane}, }; JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); @@ -458,7 +473,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } }); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Format"), contentPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Use_Format"), contentPane); } protected FormatPane createFormatPane() { @@ -502,9 +517,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { if (centerPane != null && valueFormatStyle != null) { CardLayout cardLayout = (CardLayout) centerPane.getLayout(); if (valueFormatStyle.getSelectedIndex() == 1) { - cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom")); + cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); } else { - cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Common")); + cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Common")); } } } @@ -568,7 +583,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { */ @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Axis"); + return Toolkit.i18nText("Fine-Design_Chart_Category_Axis"); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/AxisLabelDisplayComboBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/AxisLabelDisplayComboBox.java new file mode 100644 index 000000000..33b837eb7 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/AxisLabelDisplayComboBox.java @@ -0,0 +1,48 @@ +package com.fr.van.chart.designer.style.axis.component; + +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.type.AxisLabelDisplay; + +public class AxisLabelDisplayComboBox extends UIComboBox { + + public static final String[] DISPLAY_ITEM_GROUP = { + Toolkit.i18nText("Fine-Design_Chart_Label_OverlapInterval"), + Toolkit.i18nText("Fine-Design_Chart_Label_OverlapAbbreviate"), + Toolkit.i18nText("Fine-Design_Chart_Label_OverlapMulti_Line") + }; + + public static final AxisLabelDisplay[] DISPLAY_TYPE_GROUP = { + AxisLabelDisplay.INTERVAL, + AxisLabelDisplay.ELLIPSIS, + AxisLabelDisplay.MULTI_LINE + }; + + public AxisLabelDisplayComboBox() { + super(DISPLAY_ITEM_GROUP); + setSelectedIndex(0); + } + + public void reset() { + this.setSelectedItem(DISPLAY_ITEM_GROUP[0]); + } + + public void populateBean(AxisLabelDisplay type) { + for (int i = 0; i < DISPLAY_TYPE_GROUP.length; i++) { + if (type != null && type == DISPLAY_TYPE_GROUP[i]) { + setSelectedIndex(i); + break; + } + } + } + + public AxisLabelDisplay updateBean() { + int selectIndex = getSelectedIndex(); + + if (selectIndex >= 0 && selectIndex < DISPLAY_TYPE_GROUP.length) { + return DISPLAY_TYPE_GROUP[selectIndex]; + } + + return null; + } +} From 6a3b1c7518160a2a6f52831f4c503d34f6629bfd Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 26 Oct 2020 17:33:36 +0800 Subject: [PATCH 3/6] =?UTF-8?q?CHART-16112=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E5=99=A8browser=E5=9C=A8=E5=88=9D=E6=AC=A1?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=97=B6=E6=B8=85=E7=90=86=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/component/VanChartRichEditorPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java index 408b730b2..622d2a0ee 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java @@ -38,6 +38,7 @@ public class VanChartRichEditorPane { .prepare(new ScriptContextAdapter() { public void onScriptContextCreated(ScriptContextEvent event) { browser = event.getBrowser(); + browser.getCacheStorage().clearCache(); JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace); ns.asObject().setProperty(variable, model); From 7f72ebf63850f8ebc50098547917b6e7303dce5f Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 27 Oct 2020 09:39:02 +0800 Subject: [PATCH 4/6] =?UTF-8?q?REPORT-41855=20=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E4=BF=9D=E7=95=99=E5=B8=83=E5=B1=80=E4=B8=8B?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E4=BF=AE=E6=94=B9=E9=80=89=E4=B8=AD=E5=85=A8?= =?UTF-8?q?=E5=B1=8F=E8=AE=BE=E7=BD=AE=E6=95=88=E6=9E=9C=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E7=9A=84=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=BE=9D=E7=84=B6=E7=BD=AE=E7=81=B0=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=9C=A8=E4=B8=8D=E5=8B=BE?= =?UTF-8?q?=E9=80=89body=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7-?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E9=87=8D=E5=B8=83=E5=B1=80=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=BF=AE=E6=94=B9body=E5=86=85=E7=9A=84?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=9D=97=E7=9A=84=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E4=BC=9A=E9=80=A0=E6=88=90=E8=BF=99?= =?UTF-8?q?=E8=BE=B9=E7=9A=84npe=EF=BC=8C=E4=BD=93=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=AD=E5=B0=B1=E6=98=AF=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=8C=89=E9=92=AE=E4=B8=8D=E8=A2=AB=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0npe=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/designer/mobile/ChartEditorDefinePane.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java index 69e438401..7e3795fb5 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java @@ -228,10 +228,13 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane { mobileAttr.setAllowFullScreen(allowFullCheckBox.isSelected()); mobileAttr.setFunctionalWhenUnactivated(!functionalWhenUnactivatedCheckBox.isSelected()); } - MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); - if (style != null) { - ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); - style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); + // 在不勾选body移动端属性-手机重布局时,如果修改body内的图表块的移动端属性,会造成这边的npe,因此加个判断 + if (this.mobileCollapsedStyleEditor != null) { + MobileCollapsedStyle style = this.mobileCollapsedStyleEditor.getStyle(); + if (style != null) { + ((ChartEditor) xCreator.toData()).setMobileCollapsedStyle(style); + style.setCollapsedWork(this.mobileCollapsedStyleEditor.isSelectedCustom() && !FormDesignerUtils.isInAbsoluteLayout(xCreator)); + } } DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); // 触发设计器保存按钮亮起来 } From 01ba904a161b7395d06ebebfaa8c4a18489f3d1e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 27 Oct 2020 10:45:45 +0800 Subject: [PATCH 5/6] =?UTF-8?q?CHART-15902=20=E5=AE=8C=E5=96=84=E8=BD=B4?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/axis/VanChartBaseAxisPane.java | 49 ++++++++++++++----- .../style/axis/VanChartTimeAxisPane.java | 35 +++++++------ .../style/axis/VanChartValueAxisPane.java | 15 ++++-- .../axis/radar/VanChartRadarXAxisPane.java | 11 +++-- .../axis/radar/VanChartRadarYAxisPane.java | 26 +++++----- 5 files changed, 89 insertions(+), 47 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 4590d132b..6d241a5ad 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -121,6 +121,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { this.add(createContentPane(isXAxis), BorderLayout.CENTER); } + protected boolean showLabelDisplay() { + return true; + } + protected JPanel createContentPane(boolean isXAxis) { double p = TableLayout.PREFERRED; @@ -207,44 +211,50 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); labelDisplayComboBox = new AxisLabelDisplayComboBox(); + labelDisplayPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show"), labelDisplayComboBox); + labelDisplayPane.setVisible(showLabelDisplay()); + labelTextAttrPane = getChartTextAttrPane(); labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); labelGapValue = new UITextField(); + Component[][] gapComponents = new Component[][]{ + new Component[]{null, null}, new Component[]{ FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_TextRotation")), UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation) }, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle}, - new Component[]{null, null} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle} }; JPanel gapDetailPane = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); - - labelDisplayPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show"), labelDisplayComboBox); labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); labelGapPane = new JPanel(new BorderLayout()); labelGapPane.add(gapDetailPane, BorderLayout.CENTER); labelGapPane.add(labelGapValuePane, BorderLayout.SOUTH); - Component[][] components = new Component[][]{ - new Component[]{labelDisplayPane, null}, - new Component[]{labelTextAttrPane, null}, - new Component[]{labelGapPane, null}, - }; - JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); - labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + labelPanel = new JPanel(new BorderLayout()); labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); + labelPanel.add(labelDisplayPane, BorderLayout.NORTH); + labelPanel.add(labelTextAttrPane, BorderLayout.CENTER); + labelPanel.add(labelGapPane, BorderLayout.SOUTH); + showLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkLabelPane(); } }); + labelDisplayComboBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkLabelGapPane(); + } + }); labelGapStyle.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -495,6 +505,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected void checkAllUse() { checkCardPane(); checkLabelPane(); + checkLabelGapPane(); checkTitlePane(); //区域显示策略 恢复用注释。删除下面一行。 checkMaxProPortionUse(); @@ -554,6 +565,16 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { checkLabelGapValuePane(); } + protected void checkLabelGapPane() { + boolean visible = true; + + if (showLabelDisplay() && labelDisplayPane != null && labelDisplayComboBox != null) { + visible = labelDisplayComboBox.getSelectedIndex() == 0; + } + + labelGapPane.setVisible(visible); + } + protected void checkLabelGapValuePane() { if (labelGapValuePane != null && labelGapStyle != null) { boolean visible = labelGapStyle.getSelectedIndex() == 1; @@ -654,6 +675,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { // if (overlapHandleTypeGroup != null) { // overlapHandleTypeGroup.setSelectedItem(axis.getOverlapHandleType()); // } + if (labelDisplayComboBox != null) { + labelDisplayComboBox.populateBean(axis.getLabelDisplay()); + } if (labelGapStyle != null) { labelGapStyle.setSelectedIndex(axis.isAutoLabelGap() ? 0 : 1); } @@ -790,6 +814,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { // if (overlapHandleTypeGroup != null) { // axis.setOverlapHandleType(overlapHandleTypeGroup.getSelectedItem()); // } + if (labelDisplayComboBox != null) { + axis.setLabelDisplay(labelDisplayComboBox.updateBean()); + } if (labelGapStyle != null) { axis.setAutoLabelGap(labelGapStyle.getSelectedIndex() == 0); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java index 69a326ac4..f960b4aff 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.style.FormatPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -69,7 +70,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createTitlePane(new double[]{p, p, p, p, p,p}, column, isXAxis),null}, - new Component[]{createLabelPane(new double[]{p, p}, column),null}, + new Component[]{createLabelPane(new double[]{p, p, p}, column),null}, new Component[]{createValueDefinition(),null}, new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis),null}, @@ -80,6 +81,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } + protected boolean showLabelDisplay() { + return false; + } + @Override protected void addOverlapGroupButton(JPanel panel) { //do nothing @@ -87,7 +92,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private JPanel createValueDefinition(){ timeMinMaxValuePane = new TimeMinMaxValuePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane); } @Override @@ -127,7 +132,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { */ @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TimeAxis"); + return Toolkit.i18nText("Fine-Design_Chart_TimeAxis"); } private class TimeMinMaxValuePane extends JPanel{ @@ -174,10 +179,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { secTickPane.add(secondUnitField); secTickPane.add(secondType); - minPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Min"),minValueField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); - maxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Max"),maxValueField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); - mainPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Main_Type"),mainTickPane, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); - secPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_SecType"),secTickPane, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + minPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Data_Min"),minValueField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + maxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Data_Max"),maxValueField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + mainPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Main_Type"),mainTickPane, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + secPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_SecType"),secTickPane, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); minPane.setBorder(BorderFactory.createEmptyBorder(0,TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); maxPane.setBorder(BorderFactory.createEmptyBorder(0,TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); @@ -208,10 +213,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void initMin() { // 最小值. - minCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Min_Value")); + minCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Min_Value")); Date tmp = null; - DateEditor dateEditor = new DateEditor(tmp, true, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"), UIDatePicker.STYLE_CN_DATETIME1); - Editor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Formula")); + DateEditor dateEditor = new DateEditor(tmp, true, Toolkit.i18nText("Fine-Design_Basic_Date"), UIDatePicker.STYLE_CN_DATETIME1); + Editor formulaEditor = new FormulaEditor(Toolkit.i18nText("Fine-Design_Chart_Formula")); Editor[] editor = new Editor[]{dateEditor, formulaEditor}; minValueField = new ValueEditorPane(editor); minCheckBox.addActionListener(new ActionListener() { @@ -223,10 +228,10 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void initMax() { // 最大值 - maxCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Max_Value")); + maxCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Max_Value")); Date tmp = null; - DateEditor dateEditor = new DateEditor(tmp, true, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"), UIDatePicker.STYLE_CN_DATETIME1); - Editor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Formula")); + DateEditor dateEditor = new DateEditor(tmp, true, Toolkit.i18nText("Fine-Design_Basic_Date"), UIDatePicker.STYLE_CN_DATETIME1); + Editor formulaEditor = new FormulaEditor(Toolkit.i18nText("Fine-Design_Chart_Formula")); Editor[] editor = new Editor[]{dateEditor, formulaEditor}; maxValueField = new ValueEditorPane(editor); maxCheckBox.addActionListener(new ActionListener() { @@ -238,7 +243,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void initMain() { // 主要刻度单位 - mainTickBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Main_Type")); + mainTickBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Main_Type")); mainUnitField = new UITextField(); mainUnitField.setPreferredSize(new Dimension(20, 20)); mainType = new UIComboBox(TYPES); @@ -254,7 +259,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void initSecond() { // 次要刻度单位 - secondTickBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Second_Type")); + secondTickBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Second_Type")); secondUnitField = new UITextField(); secondUnitField.setPreferredSize(new Dimension(20, 20)); secondType = new UIComboBox(TYPES); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java index 934185b38..7633d0c1e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java @@ -5,6 +5,7 @@ import com.fr.chart.base.ChartBaseUtils; import com.fr.design.chart.ChartSwingUtils; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -50,7 +51,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, column, isXAxis), null}, - new Component[]{createLabelPane(new double[]{p, p}, column), null}, + new Component[]{createLabelPane(new double[]{p, p, p}, column), null}, new Component[]{createMinMaxValuePane(new double[]{p, p}, columnSize), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, @@ -61,6 +62,10 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } + protected boolean showLabelDisplay() { + return false; + } + @Override protected void addOverlapGroupButton(JPanel panel) { //do nothing @@ -68,12 +73,12 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { protected JPanel createMinMaxValuePane(double[] row, double[] col){ JPanel panel = createCommenValuePane(row,col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel); } protected JPanel createCommenValuePane(double[] row, double[] col){ initMinMaxValuePane(); - logBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_LogBase_Value")); + logBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_LogBase_Value")); logBaseField = new UITextField(); logBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -87,7 +92,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { // logPane.add(logBaseField); - logPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Log_Base_Value"), logBaseField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + logPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Log_Base_Value"), logBaseField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); logPane.setBorder(BorderFactory.createEmptyBorder(0, TableLayout4VanChartHelper.COMPONENT_INTERVAL, 0, 0)); @@ -125,7 +130,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { */ @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Axis"); + return Toolkit.i18nText("Fine-Design_Chart_Value_Axis"); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java index c69fc9b52..73ae49c24 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.designer.style.axis.radar; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -29,7 +30,7 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { double[] column = {f, s}; double[] rowSize = {p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createLabelPane(new double[]{p, p}, column),null}, + new Component[]{createLabelPane(new double[]{p, p, p}, column),null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize),null}, new Component[]{createValueStylePane(),null}, }; @@ -37,11 +38,15 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); } + protected boolean showLabelDisplay() { + return false; + } + protected Component[][] getLineStylePaneComponents() { return new Component[][]{ new Component[]{null,null} , - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")),axisLineStyle} , - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),axisLineColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java index d30d24573..0a3b51603 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java @@ -3,9 +3,9 @@ package com.fr.van.chart.designer.style.axis.radar; 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.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.stable.CoreConstants; @@ -41,7 +41,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { double[] column = {f, s}; double[] rowSize = {p, p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ - new Component[]{createLabelPane(new double[]{p, p}, column), null}, + new Component[]{createLabelPane(new double[]{p, p, p}, column), null}, new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize), null}, new Component[]{createValueStylePane(), null}, @@ -61,15 +61,15 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - valueStyle = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")}); + valueStyle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count"), + Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")}); JPanel commenPane = createCommenValuePane(new double[]{p, p, p}, columnSize); tableDataPane = new RadarTableDataPane(); centerPane = new JPanel(new CardLayout()); - centerPane.add(commenPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count")); - centerPane.add(tableDataPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")); + centerPane.add(commenPane, Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count")); + centerPane.add(tableDataPane, Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")); JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(valueStyle, BorderLayout.NORTH); @@ -81,16 +81,16 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { } }); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), contentPane); - contentPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,0)); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), contentPane); + contentPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); return panel; } protected Component[][] getLineStylePaneComponents() { return new Component[][]{ - new Component[]{null,null} , - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), axisLineStyle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), axisLineColor}, }; } @@ -102,9 +102,9 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { if (centerPane != null && valueStyle != null) { CardLayout cardLayout = (CardLayout) centerPane.getLayout(); if (valueStyle.getSelectedIndex() == 0) { - cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count")); + cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count")); } else { - cardLayout.show(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")); + cardLayout.show(centerPane, Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")); } } } From b916ee41820ed30266c9c4c2151bc8d00c6fa726 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 27 Oct 2020 11:04:32 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=95=B4=E7=90=86=E8=BD=B4=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E7=95=8C=E9=9D=A2create=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/axis/VanChartBaseAxisPane.java | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java index 6d241a5ad..a373dc445 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -208,6 +208,23 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } protected JPanel createLabelPane(double[] row, double[] col) { + initLabelComponents(); + + labelGapPane = createLabelGapPane(row, col); + labelPanel = createLabelDetailPanel(); + + addComponentsListener(); + + JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); + + JPanel labelPane = new JPanel(new BorderLayout()); + labelPane.add(showLabelPane, BorderLayout.NORTH); + labelPane.add(labelPanel, BorderLayout.CENTER); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane); + } + + private void initLabelComponents() { showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); labelDisplayComboBox = new AxisLabelDisplayComboBox(); @@ -218,7 +235,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); labelGapValue = new UITextField(); + } + private JPanel createLabelGapPane(double[] row, double[] col) { Component[][] gapComponents = new Component[][]{ new Component[]{null, null}, new Component[]{ @@ -231,42 +250,48 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { JPanel gapDetailPane = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); - labelGapPane = new JPanel(new BorderLayout()); - labelGapPane.add(gapDetailPane, BorderLayout.CENTER); - labelGapPane.add(labelGapValuePane, BorderLayout.SOUTH); + JPanel panel = new JPanel(new BorderLayout()); + panel.add(gapDetailPane, BorderLayout.CENTER); + panel.add(labelGapValuePane, BorderLayout.SOUTH); - JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); + return panel; + } + + private JPanel createLabelDetailPanel() { + JPanel panel = new JPanel(new BorderLayout()); + panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); - labelPanel = new JPanel(new BorderLayout()); - labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); - labelPanel.add(labelDisplayPane, BorderLayout.NORTH); - labelPanel.add(labelTextAttrPane, BorderLayout.CENTER); - labelPanel.add(labelGapPane, BorderLayout.SOUTH); + panel.add(labelDisplayPane, BorderLayout.NORTH); + panel.add(labelTextAttrPane, BorderLayout.CENTER); + panel.add(labelGapPane, BorderLayout.SOUTH); + return panel; + } + + private void addComponentsListener() { + // 显示/隐藏 showLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkLabelPane(); } }); + + // 间隔/缩略/换行 labelDisplayComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkLabelGapPane(); } }); + + // 自动/固定 labelGapStyle.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkLabelGapValuePane(); } }); - - JPanel labelPane = new JPanel(new BorderLayout()); - labelPane.add(showLabelPane, BorderLayout.NORTH); - labelPane.add(labelPanel, BorderLayout.CENTER); - - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane); } // protected JPanel createLabelPane(double[] row, double[] col){