From 425efd12c79b7247bbe003faaf441a19f158b74a Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Mon, 14 Aug 2017 16:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9D=90=E6=A0=87=E8=BD=B4=E7=B3=BB=E5=88=97?= =?UTF-8?q?=E7=AD=89=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/NormalChartDataPane.java | 4 +- .../gui/style/series/UIColorPickerPane.java | 40 +++---- .../column/VanChartColumnSeriesPane.java | 4 +- .../designer/AbstractVanChartAttrPane.java | 10 ++ .../designer/AbstractVanChartTabPane.java | 8 ++ .../component/VanChartBeautyPane.java | 4 +- .../background/VanChartGradientPane.java | 3 +- ...nChartAxisScrollPaneWithOutTypeSelect.java | 4 +- .../VanChartAxisScrollPaneWithTypeSelect.java | 9 +- .../style/axis/VanChartBaseAxisPane.java | 112 +++++++++--------- .../style/axis/VanChartTimeAxisPane.java | 50 ++++---- .../style/axis/VanChartValueAxisPane.java | 19 +-- .../gauge/VanChartGaugeDetailAxisPane.java | 24 ++-- .../axis/radar/VanChartRadarXAxisPane.java | 3 - .../axis/radar/VanChartRadarYAxisPane.java | 6 +- .../VanChartAreaBackgroundPane.java | 10 +- .../background/VanChartAxisAreaPane.java | 18 +-- .../VanChartAbstractPlotSeriesPane.java | 35 ++++-- .../chart/gauge/VanChartGaugeSeriesPane.java | 10 +- .../chart/pie/RadiusCardLayoutPane.java | 7 +- .../chart/pie/VanChartPieSeriesPane.java | 22 ++-- 21 files changed, 205 insertions(+), 197 deletions(-) create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartAttrPane.java create mode 100644 designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartTabPane.java diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index 6a33c6df96..6d32e5353a 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -4,6 +4,7 @@ import com.fr.chart.chartattr.ChartCollection; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicScrollPane; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ilable.UILabel; @@ -80,7 +81,8 @@ public class NormalChartDataPane extends DataContentsPane { }; contentPane.add(dataPane, BorderLayout.CENTER); dataPane.setBorder(BorderFactory.createEmptyBorder(10 ,0, 0, 0)); - return contentPane; + UIExpandablePane advanceExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 20, contentPane); + return advanceExpandablePane; } @Override diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index a24b818346..37c2f26b51 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -1,27 +1,11 @@ package com.fr.design.mainframe.chart.gui.style.series; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.LayoutManager; -import java.awt.Point; -import java.awt.event.*; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; - import com.fr.base.Formula; import com.fr.chart.base.AreaColor; import com.fr.chart.base.ChartBaseUtils; import com.fr.chart.chartglyph.MapHotAreaColor; import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.frpane.UINumberDragPane; @@ -31,12 +15,20 @@ import com.fr.design.gui.ipoppane.PopupHider; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.dialog.BasicPane; -import com.fr.general.Inter; -import com.fr.stable.StringUtils; import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.Inter; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; public class UIColorPickerPane extends BasicPane implements UIObserver { private static final int MARGIN_TOP = 10; @@ -105,11 +97,10 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; Component[][] components = createComponents(); - upControlPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + upControlPane = TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize); this.textFieldList = this.getTextFieldList(); this.textGroup = new TextFieldGroupPane(); @@ -122,6 +113,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { refreshGroupPane(colors, getValueArray(number)); } + protected double[] getRowSIze () { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p}; + } + protected UIButtonGroup getDesignTypeButtonGroup(){ return designTypeButtonGroup; } diff --git a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java index cb418b1635..75b8b7bba5 100644 --- a/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java @@ -50,9 +50,7 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane { double[] rowSize = {p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createStylePane()}, - new Component[]{stylePane == null ? null : new JSeparator()}, new Component[]{createSeriesStylePane(new double[]{p,p}, new double[]{p,f})}, - new Component[]{new JSeparator()}, new Component[]{createBorderPane()}, new Component[]{createStackedAndAxisPane()}, new Component[]{createTrendLinePane()}, @@ -113,7 +111,7 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane { checkImagePane(); } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), borderPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), borderPane); } private void checkAll() { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartAttrPane.java b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartAttrPane.java new file mode 100644 index 0000000000..61cd9c1dd7 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartAttrPane.java @@ -0,0 +1,10 @@ +package com.fr.plugin.chart.designer; + +import com.fr.design.mainframe.chart.AbstractChartAttrPane; + +/** + * Created by mengao on 2017/8/11. + */ +public abstract class AbstractVanChartAttrPane extends AbstractChartAttrPane { + +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartTabPane.java b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartTabPane.java new file mode 100644 index 0000000000..5953a74f46 --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/AbstractVanChartTabPane.java @@ -0,0 +1,8 @@ +package com.fr.plugin.chart.designer; + +/** + * Created by mengao on 2017/8/13. + */ +public abstract class AbstractVanChartTabPane extends AbstractVanChartScrollPane { + public abstract String title4PopupWindow(); +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java index c4f58b2f39..acc98ff805 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartBeautyPane.java @@ -4,8 +4,8 @@ import com.fr.chart.base.ChartConstants; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import javax.swing.*; import java.awt.*; @@ -27,7 +27,7 @@ public class VanChartBeautyPane extends BasicBeanPane { Component[][] components = new Component[][]{ new Component[]{styleBox}, } ; - JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Plugin-Chart_Style"}, components, rowSize, columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java index b4adb66065..e3052d8910 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartGradientPane.java @@ -44,8 +44,7 @@ public class VanChartGradientPane extends GradientBackgroundQuickPane { Component[][] components = new Component[][]{ new Component[]{gradientBar, null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Gradient_Direction") + ":")}, - new Component[]{directionPane} + new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Gradient_Direction")),directionPane}, }; JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithOutTypeSelect.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithOutTypeSelect.java index b0b1e5bce1..e5f8938afb 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithOutTypeSelect.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithOutTypeSelect.java @@ -1,8 +1,8 @@ package com.fr.plugin.chart.designer.style.axis; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import com.fr.plugin.chart.designer.style.VanChartStylePane; import javax.swing.*; @@ -10,7 +10,7 @@ import javax.swing.*; /** * 无类型选择。y轴数值轴。 */ -public class VanChartAxisScrollPaneWithOutTypeSelect extends BasicScrollPane implements VanChartXYAxisPaneInterface{ +public class VanChartAxisScrollPaneWithOutTypeSelect extends AbstractVanChartScrollPane implements VanChartXYAxisPaneInterface{ private static final long serialVersionUID = 7700110757493668325L; protected VanChartBaseAxisPane axisPane; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java index 1ad748aa1a..fcde1ac9db 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java @@ -2,17 +2,17 @@ package com.fr.plugin.chart.designer.style.axis; import com.fr.chart.chartattr.Axis; import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; -import com.fr.plugin.chart.type.AxisType; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.style.VanChartStylePane; +import com.fr.plugin.chart.type.AxisType; import javax.swing.*; import java.awt.*; @@ -22,7 +22,7 @@ import java.util.List; /** * 带有坐标轴类型选择控件。可选类型:分类、时间、数值 */ -public class VanChartAxisScrollPaneWithTypeSelect extends BasicScrollPane implements VanChartXYAxisPaneInterface{ +public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScrollPane implements VanChartXYAxisPaneInterface{ private static final long serialVersionUID = -8462279689749700666L; private UIComboBoxPane axisTypePane; private VanChartTimeAxisPane timeAxisPane; @@ -56,7 +56,8 @@ public class VanChartAxisScrollPaneWithTypeSelect extends BasicScrollPane { protected UINumberDragPane labelTextRotation; protected UIButtonGroup labelGapStyle; protected UITextField labelGapValue; + protected JPanel labelPanel; + protected LineComboBox axisLineStyle; protected ColorSelectBox axisLineColor; @@ -61,10 +63,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected UIButtonGroup secondTick; protected UIButtonGroup position; - protected UIToggleButton reversed; + protected UIButtonGroup reversed; protected UIButtonGroup axisLimitSize; protected UISpinner maxProportion; + protected JPanel maxProportionPane; protected UIButtonGroup valueFormatStyle; protected FormatPane valueFormat; @@ -93,20 +96,14 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; + double[] rowSize = {p, p, p, p, p, p, p,p}; Component[][] components = new Component[][]{ - new Component[]{new JSeparator(),null}, - new Component[]{createTitlePane(new double[]{p, p, p, p, p}, columnSize, isXAxis),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLineStylePane(new double[]{p, p,p,p}, columnSize),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createDisplayStrategy(new double[]{p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createValueStylePane(),null}, + new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, columnSize, isXAxis), null}, + new Component[]{createLabelPane(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}, + new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null}, + new Component[]{createValueStylePane(), null}, }; return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); @@ -125,15 +122,16 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { titleTextRotation.populateBean(-ROTATION_MAX); } Component[][] components = new Component[][]{ - new Component[]{titleContent,null}, - new Component[]{titleAlignPane,null}, - new Component[]{titleUseHtml,null}, + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Content")),titleContent}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Position")),titleAlignPane}, + new Component[]{null,titleUseHtml}, new Component[]{titleTextAttrPane,null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_TextRotation")),titleTextRotation}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, panel); } private UIButtonGroup getXAxisTitleAlignPane(){ @@ -168,11 +166,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { JPanel gapPanel = TableLayoutHelper.createTableLayoutPane(gapComponents, row, col); Component[][] components = new Component[][]{ - new Component[]{showLabel,null}, new Component[]{labelTextAttrPane, null}, new Component[]{gapPanel,null}, }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); + + JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AxisLabel"),showLabel); + labelPanel = TableLayoutHelper.createTableLayoutPane(components, row, col); + labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); showLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -185,7 +185,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { checkLabelGapValuePane(); } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); + 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); } protected JPanel createLineStylePane(double[] row, double[] col){ @@ -197,11 +200,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { secondTick = new UIButtonGroup(strings, values); JPanel panel = TableLayoutHelper.createTableLayoutPane(getLineStylePaneComponents(), row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_AxisLineStyle"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AxisLineStyle"), panel); } protected Component[][] getLineStylePaneComponents() { return new Component[][]{ + new Component[]{null,null} , new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_type")),axisLineStyle} , new Component[]{new UILabel(Inter.getLocText("FR-Chart-Color_Color")),axisLineColor}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MainGraduationLine")),mainTick}, @@ -211,14 +215,15 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis){ position = new UIButtonGroup(getAxisPositionNameArray(isXAxis), getAxisPositionValueArray(isXAxis)); - reversed = new UIToggleButton(Inter.getLocText("Plugin-ChartF_OpenAxisReversed")); + reversed = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false}); Component[][] components = new Component[][]{ - new Component[]{position, null}, - new Component[]{reversed,null}, + new Component[]{null, null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AxisLabel_Position")),position}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_AxisReversed")),reversed}, } ; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Layout_Position"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Layout_Position"), panel); } private String[] getAxisPositionNameArray(boolean isXAxis){ @@ -240,11 +245,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected JPanel createDisplayStrategy(double[] row, double[] col){ maxProportion = new UISpinner(0,100,1,30); axisLimitSize = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_LimitAreaSize"),Inter.getLocText("Plugin-ChartF_NotLimitAreaSize")}); - Component[][] components = new Component[][]{ - new Component[]{axisLimitSize,null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AxisProportion")+":"),maxProportion}, - }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,row,col); + + JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AreaSize"),axisLimitSize); + maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MaxProportion"),maxProportion); + maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + JPanel panel = new JPanel(new BorderLayout()); + panel.add(limitSizePane, BorderLayout.NORTH); + panel.add(maxProportionPane, BorderLayout.CENTER); axisLimitSize.addActionListener(new ActionListener() { @Override @@ -253,7 +260,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); } protected JPanel createValueStylePane(){ @@ -269,9 +276,17 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { centerPane.add(valueFormat,Inter.getLocText("Plugin-ChartF_Common")); centerPane.add(htmlLabelPane, Inter.getLocText("Plugin-ChartF_Custom")); - JPanel contentPane = new JPanel(new BorderLayout(0, 4)); - contentPane.add(valueFormatStyle, BorderLayout.NORTH); - contentPane.add(centerPane, BorderLayout.CENTER); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p,f}; + double[] rowSize = {p,p,p}; + Component[][] components = new Component[][]{ + new Component[]{null,null}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AxisLabel_Format"), SwingConstants.LEFT), valueFormatStyle}, + new Component[]{null, centerPane}, + }; + JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + valueFormatStyle.addActionListener(new ActionListener() { @Override @@ -280,7 +295,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Use_Format"), contentPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Use_Format"), contentPane); } protected FormatPane createFormatPane(){ @@ -311,17 +326,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { protected void checkLabelPane() { if(showLabel != null){ boolean enabled = showLabel.getSelectedIndex() == 0; - if(labelTextAttrPane != null){ - labelTextAttrPane.setEnabled(enabled); - } - if(labelTextRotation != null){ - labelTextRotation.setEnabled(enabled); - } - if(labelGapValue != null){ - labelGapValue.setEnabled(enabled); - } - if(labelGapStyle != null){ - labelGapStyle.setEnabled(enabled); + if(labelPanel != null){ + labelPanel.setVisible(enabled); } if(enabled){ checkLabelGapValuePane(); @@ -329,7 +335,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } } - private void checkLabelGapValuePane() { + protected void checkLabelGapValuePane() { if(labelGapValue != null && labelGapStyle != null){ labelGapValue.setEnabled(labelGapStyle.getSelectedIndex() == 1); } @@ -337,8 +343,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { //检查最大显示占比是否可用 private void checkMaxProPortionUse() { - if(maxProportion != null && axisLimitSize != null){ - maxProportion.setEnabled(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled()); + if(maxProportionPane != null && axisLimitSize != null){ + maxProportionPane.setVisible(axisLimitSize.getSelectedIndex() == 0 && axisLimitSize.isEnabled()); } } @@ -453,7 +459,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } } if(reversed != null){ - reversed.setSelected(axis.hasAxisReversed()); + reversed.setSelectedIndex(axis.hasAxisReversed() == true ? 0 : 1); } } @@ -574,7 +580,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axis.setPosition(position.getSelectedItem()); } if(reversed != null){ - axis.setAxisReversed(reversed.isSelected()); + axis.setAxisReversed(reversed.getSelectedItem()); } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java index b6580df8a9..54bbc98436 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartTimeAxisPane.java @@ -10,6 +10,7 @@ import com.fr.design.editor.editor.FormulaEditor; import com.fr.design.gui.date.UIDatePicker; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.style.FormatPane; import com.fr.design.layout.FRGUIPaneFactory; @@ -18,12 +19,12 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.general.DateUtils; import com.fr.general.FRLogger; import com.fr.general.Inter; -import com.fr.plugin.chart.type.TimeType; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartTimeAxis; import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import com.fr.plugin.chart.type.TimeType; import com.fr.stable.StringUtils; import javax.swing.*; @@ -57,19 +58,12 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { double[] columnSize = {p, f}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{new JSeparator(),null}, - new Component[]{createTitlePane(new double[]{p, p, p, p, p}, columnSize, isXAxis),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createTitlePane(new double[]{p, p, p, p, p,p}, columnSize, isXAxis),null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, new Component[]{createValueDefinition(),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLineStylePane(new double[]{p, p,p,p}, columnSize),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null}, new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createDisplayStrategy(new double[]{p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createDisplayStrategy(new double[]{p, p,p}, columnSize),null}, new Component[]{createValueStylePane(),null}, }; @@ -78,7 +72,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private JPanel createValueDefinition(){ timeMinMaxValuePane = new TimeMinMaxValuePane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), timeMinMaxValuePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), timeMinMaxValuePane); } @Override @@ -145,38 +139,36 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] rowSize = {p, p, p}; - double[] columnSize = {p, f}; - Component[][] maxMin = { - {minCheckBox, minValueField}, - {maxCheckBox, maxValueField}, - }; - JPanel maxMinPane = TableLayoutHelper.createTableLayoutPane(maxMin, rowSize, columnSize); + double[] rowSize = {p, p, p, p, p, p, p, p}; + double[] columnSize = {f, p, p}; JPanel mainTickPane = new JPanel(); mainTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); - mainTickPane.add(mainTickBox); mainTickPane.add(mainUnitField); mainTickPane.add(mainType); JPanel secTickPane = new JPanel(); secTickPane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); - secTickPane.add(secondTickBox); secTickPane.add(secondUnitField); secTickPane.add(secondType); Component[][] components = { - {maxMinPane, null}, - {mainTickPane, null}, - {secTickPane, null}, + {minCheckBox, null, null}, + {null, new UILabel(Inter.getLocText("FR-Chart-Data_Min")), minValueField}, + {maxCheckBox, null, null}, + {null, new UILabel(Inter.getLocText("FR-Chart-Data_Max")), maxValueField}, + {mainTickBox, null, null}, + {null, new UILabel(Inter.getLocText("Plugin-ChartF_MainType")), mainTickPane}, + {secondTickBox, null, null}, + {null, new UILabel(Inter.getLocText("Plugin-ChartF_SecType")), secTickPane}, }; - this.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize)); + this.add(TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize)); } private void initMin() { // 最小值. - minCheckBox = new UICheckBox(Inter.getLocText("FR-Chart-Data_Min")); + minCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Min_Value"})); Date tmp = null; DateEditor dateEditor = new DateEditor(tmp, true, Inter.getLocText("FR-Designer_Date"), UIDatePicker.STYLE_CN_DATETIME1); Editor formulaEditor = new FormulaEditor(Inter.getLocText("Plugin-ChartF_Formula")); @@ -192,7 +184,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void initMax() { // 最大值 - maxCheckBox = new UICheckBox(Inter.getLocText("FR-Chart-Data_Max")); + maxCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Max_Value"})); Date tmp = null; DateEditor dateEditor = new DateEditor(tmp, true, Inter.getLocText("FR-Designer_Date"), UIDatePicker.STYLE_CN_DATETIME1); Editor formulaEditor = new FormulaEditor(Inter.getLocText("Plugin-ChartF_Formula")); @@ -208,7 +200,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void initMain() { // 主要刻度单位 - mainTickBox = new UICheckBox(Inter.getLocText("Plugin-ChartF_MainType")); + mainTickBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Plugin-ChartF_MainType"})); mainUnitField = new UITextField(); mainUnitField.setPreferredSize(new Dimension(20, 20)); mainUnitField.setEditable(false); @@ -226,7 +218,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void initSecond() { // 次要刻度单位 - secondTickBox = new UICheckBox(Inter.getLocText("Plugin-ChartF_SecType")); + secondTickBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Plugin-ChartF_SecType"})); secondUnitField = new UITextField(); secondUnitField.setPreferredSize(new Dimension(20, 20)); secondUnitField.setEditable(false); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java index 98c2843b83..8ab45491a5 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartValueAxisPane.java @@ -43,19 +43,12 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { double[] columnSize = {p, f}; double[] rowSize = {p,p,p,p,p,p,p,p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{new JSeparator(),null}, - new Component[]{createTitlePane(new double[]{p, p, p, p,p}, columnSize, isXAxis),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createTitlePane(new double[]{p, p, p, p,p,p}, columnSize, isXAxis),null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLineStylePane(new double[]{p, p,p,p}, columnSize),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createAxisPositionPane(new double[]{p, p}, columnSize, isXAxis),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createDisplayStrategy(new double[]{p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createMinMaxValuePane(new double[]{p, p, 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}, + new Component[]{createDisplayStrategy(new double[]{p, p,p}, columnSize),null}, new Component[]{createValueStylePane(),null}, }; @@ -64,7 +57,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { protected JPanel createMinMaxValuePane(double[] row, double[] col){ JPanel panel = createCommenValuePane(row,col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), panel); } protected JPanel createCommenValuePane(double[] row, double[] col){ initMinMaxValuePane(); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index 45d1418902..7df8f9bfbf 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java @@ -15,8 +15,8 @@ import com.fr.plugin.chart.designer.style.VanChartStylePane; import com.fr.plugin.chart.designer.style.axis.VanChartValueAxisPane; import com.fr.plugin.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick; import com.fr.plugin.chart.designer.style.axis.component.VanChartMinMaxValuePane; -import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.gauge.VanChartGaugePlot; +import com.fr.plugin.chart.type.GaugeStyle; import javax.swing.*; import java.awt.*; @@ -54,11 +54,8 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{ case THERMOMETER: return new Component[][]{ new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, - new Component[]{new JSeparator(), null}, new Component[]{createValueDefinition(), null}, - new Component[]{new JSeparator(), null}, new Component[]{createTickColorPane(new double[]{p, p, p}, new double[]{p, f}), null}, - new Component[]{new JSeparator(), null}, new Component[]{createValueStylePane()}, }; case RING: @@ -72,9 +69,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{ default: return new Component[][]{ new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, - new Component[]{new JSeparator(), null}, new Component[]{createValueDefinition(), null}, - new Component[]{new JSeparator(), null}, new Component[]{createValueStylePane()}, }; } @@ -83,16 +78,21 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{ protected JPanel createLabelPane(double[] row, double[] col){ showLabel = new UIButtonGroup(new String[]{Inter.getLocText("Chart-Use_Show"), Inter.getLocText("Plugin-ChartF_Hidden")}); labelTextAttrPane = new ChartTextAttrPane(); + labelPanel = new JPanel(new BorderLayout()); + labelPanel.add(labelTextAttrPane); + labelPanel.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); JPanel panel = new JPanel(new BorderLayout(0, 6)); - panel.add(showLabel, BorderLayout.NORTH); - panel.add(labelTextAttrPane, BorderLayout.CENTER); + panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AxisLabel"), showLabel), BorderLayout.NORTH); + panel.add(labelPanel, BorderLayout.CENTER); showLabel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { checkLabelPane(); } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); + JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); + panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + return jPanel; } private JPanel createValueDefinition(){ @@ -107,7 +107,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{ minMaxValuePane = new VanChartMinMaxValuePane(); break; } - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), minMaxValuePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), minMaxValuePane); } private JPanel createTickColorPane(double[] row, double[] col){ @@ -118,7 +118,9 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane{ new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_SecondGraduationLine")), secTickColor}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_TickColor"), panel); + JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_TickColor"), panel); + panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + return jPanel; } private boolean isMulti(GaugeStyle style){ diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java index c4e2ab0cb4..0019652da9 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java @@ -23,11 +23,8 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { double[] columnSize = {p, f}; double[] rowSize = {p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{new JSeparator(),null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize),null}, - new Component[]{new JSeparator(),null}, new Component[]{createValueStylePane(),null}, }; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java index ec18dbaf7d..71685c9251 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java @@ -33,13 +33,9 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { double[] columnSize = {p, f}; double[] rowSize = {p, p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ - new Component[]{new JSeparator(), null}, new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, - new Component[]{new JSeparator(), null}, new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize), null}, - new Component[]{new JSeparator(), null}, new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize), null}, - new Component[]{new JSeparator(), null}, new Component[]{createValueStylePane(), null}, }; @@ -71,7 +67,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), contentPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), contentPane); } protected Component[][] getLineStylePaneComponents() { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaBackgroundPane.java index 489af7ae67..70eb9bd8f1 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaBackgroundPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAreaBackgroundPane.java @@ -7,6 +7,8 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; +import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.background.VanChartBackgroundPane; import com.fr.plugin.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.plugin.chart.designer.style.background.radar.VanChartRadarAxisAreaPane; @@ -45,8 +47,8 @@ public class VanChartAreaBackgroundPane extends AbstractChartTabPane { double[] columnSize = { f }; double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ - new Component[]{chartBorderPane}, - new Component[]{chartBackgroundPane} + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),chartBorderPane)}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), chartBackgroundPane)}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); contentPane.add(panel, BorderLayout.CENTER); @@ -88,8 +90,8 @@ public class VanChartAreaBackgroundPane extends AbstractChartTabPane { protected Component[][] initComponents() { return new Component[][]{ - new Component[]{chartBorderPane}, - new Component[]{chartBackgroundPane}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),chartBorderPane)}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), chartBackgroundPane)}, new Component[]{chartAxisAreaPane} }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java index 07157cc679..48bf12ce81 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java @@ -15,8 +15,8 @@ import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.attr.DefaultAxisHelper; import com.fr.plugin.chart.attr.axis.VanChartAlertValue; import com.fr.plugin.chart.attr.axis.VanChartAxis; -import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.base.VanChartCustomIntervalBackground; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator; @@ -53,14 +53,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { f }; - double[] rowSize = {p,p,p,p,p}; + double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createGridLinePane(new double[]{p,p}, new double[]{p,f})}, - new Component[]{new JSeparator()}, + new Component[]{createGridLinePane(new double[]{p,p,p}, new double[]{p,f})}, new Component[]{createAlertLinePane()}, - new Component[]{new JSeparator()}, - new Component[]{createIntervalPane(new double[]{p,p,p}, new double[]{p,f})}, + new Component[]{createIntervalPane(new double[]{p,p,p,p}, new double[]{p,f})}, }; JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); @@ -72,11 +70,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ verticalGridLine = new ColorSelectBox(100); Component[][] components = getGridLinePaneComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); } protected Component[][] getGridLinePaneComponents() { return new Component[][]{ + new Component[]{null,null}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine}, }; @@ -84,7 +83,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ protected JPanel createAlertLinePane(){ alertLine = new UICorrelationComboBoxPane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine); } protected JPanel createIntervalPane(double[] row, double[] col){ @@ -108,11 +107,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH); intervalPane.add(centerPane, BorderLayout.CENTER); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane); } protected Component[][] getIntervalPaneComponents() { return new Component[][]{ + new Component[]{null,null}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground}, }; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index 04cda0cbc0..cab4b96baf 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -19,12 +19,21 @@ import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.radius.VanChartRadiusPlot; -import com.fr.plugin.chart.base.*; +import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground; +import com.fr.plugin.chart.base.AttrEffect; +import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.AttrLineEffect; +import com.fr.plugin.chart.base.VanChartAttrLine; +import com.fr.plugin.chart.base.VanChartAttrMarker; +import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.plugin.chart.custom.style.VanChartCustomStylePane; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.*; +import com.fr.plugin.chart.designer.component.VanChartAreaSeriesFillColorPane; +import com.fr.plugin.chart.designer.component.VanChartBeautyPane; +import com.fr.plugin.chart.designer.component.VanChartLineTypePane; +import com.fr.plugin.chart.designer.component.VanChartMarkerPane; +import com.fr.plugin.chart.designer.component.VanChartTrendLinePane; import com.fr.plugin.chart.designer.component.border.VanChartBorderPane; -import com.fr.plugin.chart.base.AttrLineEffect; import com.fr.plugin.chart.pie.RadiusCardLayoutPane; import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; @@ -76,26 +85,26 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } //风格 - protected VanChartBeautyPane createStylePane() { + protected JPanel createStylePane() { //如果是自定義組合圖,則不創建填充界面 if (parentPane instanceof VanChartCustomStylePane){ stylePane = null; }else { stylePane = new VanChartBeautyPane(); } - return stylePane; + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"), stylePane); } //趋势线 protected JPanel createTrendLinePane() { trendLinePane = new VanChartTrendLinePane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Trend_Line"), trendLinePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Trend_Line"), trendLinePane); } //线 protected JPanel createLineTypePane() { lineTypePane = getLineTypePane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Line"), lineTypePane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Line"), lineTypePane); } protected VanChartLineTypePane getLineTypePane() { @@ -105,19 +114,19 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //标记点类型 protected JPanel createMarkerPane() { markerPane = new VanChartMarkerPane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Marker"), markerPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Marker"), markerPane); } //填充颜色 protected JPanel createAreaFillColorPane() { areaSeriesFillColorPane = new VanChartAreaSeriesFillColorPane(); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_FillColor"), areaSeriesFillColorPane); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_FillColor"), areaSeriesFillColorPane); } //边框(默认没有圆角) - protected VanChartBorderPane createBorderPane() { + protected JPanel createBorderPane() { borderPane = createDiffBorderPane(); - return borderPane; + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"), borderPane); } //半径界面 @@ -187,7 +196,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } protected JPanel createLargeDataModelPane(UIButtonGroup modelGroup) { - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Large_Model"), modelGroup); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Large_Model"), modelGroup); } protected UIButtonGroup createLargeDataModelGroup() { @@ -208,7 +217,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //不透明度 protected JPanel createAlphaPane() { transparent = new UINumberDragPane(0, 100); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Alpha"), transparent); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Alpha"), transparent); } //堆积和坐标轴设置(自定义柱形图等用到) diff --git a/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java index 09112c332d..d754cfd972 100644 --- a/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java @@ -12,9 +12,9 @@ import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; -import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import com.fr.plugin.chart.pie.RadiusCardLayoutPane; @@ -57,9 +57,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { double[] rowSize = {p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createGaugeLayoutPane()}, - new Component[]{new JSeparator()}, new Component[]{createGaugeStylePane(rowSize, new double[]{p,f})}, - new Component[]{new JSeparator()}, new Component[]{createGaugeBandsPane()} }; @@ -74,7 +72,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { changeLabelPosition(); } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Chart_Layout"), gaugeLayout); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart_Layout"), gaugeLayout); } private void changeLabelPosition() { @@ -106,7 +104,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if(rotate != null){ panel.add(rotate, BorderLayout.NORTH); } - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); } private Component[][] getDiffComponentsWithGaugeStyle() { @@ -183,7 +181,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private JPanel createGaugeBandsPane() { colorPickerPane = new ColorPickerPaneWithFormula("meterString"); - return TableLayout4VanChartHelper.createTitlePane(Inter.getLocText("Plugin-ChartF_Range"), colorPickerPane, 16); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Range"), colorPickerPane); } diff --git a/designer_chart/src/com/fr/plugin/chart/pie/RadiusCardLayoutPane.java b/designer_chart/src/com/fr/plugin/chart/pie/RadiusCardLayoutPane.java index dc36cdd860..53d33788b4 100644 --- a/designer_chart/src/com/fr/plugin/chart/pie/RadiusCardLayoutPane.java +++ b/designer_chart/src/com/fr/plugin/chart/pie/RadiusCardLayoutPane.java @@ -3,15 +3,14 @@ package com.fr.plugin.chart.pie; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; -import com.fr.plugin.chart.type.RadiusType; -import com.fr.plugin.chart.base.VanChartRadius; import com.fr.plugin.chart.attr.radius.VanChartRadiusPlot; +import com.fr.plugin.chart.base.VanChartRadius; import com.fr.plugin.chart.layout.VanChartCardLayoutPane; +import com.fr.plugin.chart.type.RadiusType; import javax.swing.*; import java.awt.*; @@ -71,7 +70,7 @@ public class RadiusCardLayoutPane extends BasicBeanPane { double[] columnSize = {p, f}; double[] rowSize = {p,p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")),radiusType}, + new Component[]{radiusType,null}, new Component[]{cardPane, null}, }; diff --git a/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java index a45caa7983..5050fefe24 100644 --- a/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/pie/VanChartPieSeriesPane.java @@ -2,7 +2,7 @@ package com.fr.plugin.chart.pie; import com.fr.chart.chartattr.Plot; -import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.TableLayout; @@ -28,7 +28,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { protected UISpinner startAngle; protected UISpinner endAngle; protected UISpinner innerRadius; - private UIToggleButton supportRotation; + private UIButtonGroup supportRotation; public VanChartPieSeriesPane(ChartStylePane parent, Plot plot) { super(parent, plot); @@ -41,9 +41,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { double[] rowSize = {p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ new Component[]{createStylePane()}, - new Component[]{stylePane == null ? null : new JSeparator()}, new Component[]{createSeriesStylePane(rowSize, new double[]{p,f})}, - new Component[]{new JSeparator()}, new Component[]{createBorderPane()}, }; @@ -55,19 +53,21 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { startAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); endAngle = new UISpinner(MIN_ANGLE, MAX_ANGLE, 1, 0); innerRadius = new UISpinner(0, 100, 1, 0); - supportRotation = new UIToggleButton(Inter.getLocText("Plugin-ChartF_Rotation")); + supportRotation = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false}); + Component[][] components = new Component[][]{ + new Component[]{null,null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_StartAngle")),startAngle}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_EndAngle")),endAngle}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_InnerRadius")),innerRadius}, - new Component[]{createRadiusPane(), null}, - new Component[]{supportRotation,null} + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Radius_Set")), createRadiusPane()}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Rotation")),supportRotation} }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); } //半径界面 @@ -93,7 +93,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { startAngle.setValue(piePlot4VanChart.getStartAngle()); endAngle.setValue(piePlot4VanChart.getEndAngle()); innerRadius.setValue(piePlot4VanChart.getInnerRadiusPercent()); - supportRotation.setSelected(piePlot4VanChart.isSupportRotation()); + supportRotation.setSelectedIndex(piePlot4VanChart.isSupportRotation() == true ?0:1); } } @@ -114,7 +114,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { piePlot4VanChart.setStartAngle(startAngle.getValue()); piePlot4VanChart.setEndAngle(endAngle.getValue()); piePlot4VanChart.setInnerRadiusPercent(innerRadius.getValue()); - piePlot4VanChart.setSupportRotation(supportRotation.isSelected()); + piePlot4VanChart.setSupportRotation(supportRotation.getSelectedItem()); } } } \ No newline at end of file