diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 8a157f0843..0d78f84ffc 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -81,7 +81,7 @@ public class MinMaxValuePane extends JPanel { }; } - private void checkBoxUse() { + protected void checkBoxUse() { minValueField.setEnabled(minCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected()); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java index 0003c09be5..3eff5f6974 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java @@ -97,17 +97,21 @@ public class ChartFillStylePane extends BasicBeanPane{ customPane.setPreferredSize(new Dimension(200, 130)); colorGradient.setPreferredSize(new Dimension(120, 30)); + + this.setLayout(new BorderLayout()); + this.add(getContentPane(),BorderLayout.CENTER); + } + + protected JPanel getContentPane () { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { f }; double[] rowSize = { p, p}; - Component[][] components = new Component[][]{ - new Component[]{styleSelectBox}, - new Component[]{customPane} - } ; - JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize); - this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); + Component[][] components = new Component[][]{ + new Component[]{styleSelectBox}, + new Component[]{customPane} + } ; + return TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize); } @Override diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java index 951d57f822..9d3f9756e3 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java @@ -1,24 +1,18 @@ package com.fr.design.mainframe.chart.gui.style; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Component; -import java.awt.FlowLayout; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.util.List; - -import javax.swing.JPanel; -import javax.swing.border.Border; - import com.fr.chart.chartattr.Plot; -import com.fr.design.constants.UIConstants; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ibutton.UIHeadGroup; +import javax.swing.*; +import javax.swing.border.Border; +import java.awt.*; +import java.util.List; + public abstract class ThirdTabPane extends BasicBeanPane{ private static final long serialVersionUID = 2298609199400393886L; @@ -114,8 +108,8 @@ public abstract class ThirdTabPane extends BasicBeanPane{ protected static class NamePane { private String name; - private AbstractChartTabPane pane; - public NamePane(String name, AbstractChartTabPane pane) { + private BasicScrollPane pane; + public NamePane(String name, BasicScrollPane pane) { this.name = name; this.pane = pane; } @@ -125,10 +119,10 @@ public abstract class ThirdTabPane extends BasicBeanPane{ public void setName(String name) { this.name = name; } - public AbstractChartTabPane getPane() { + public BasicScrollPane getPane() { return pane; } - public void setPane(AbstractChartTabPane pane) { + public void setPane(BasicScrollPane pane) { this.pane = pane; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java index 2f82714bf2..66b0c41f3c 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java @@ -26,62 +26,67 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane{ public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot) { this(parent, plot, false); } - - public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot, boolean custom) { + + public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot, boolean custom) { this.plot = plot; - this.parentPane = parent; - fillStylePane = getFillStylePane(); + this.parentPane = parent; + fillStylePane = getFillStylePane(); + + this.setLayout(new BorderLayout()); + this.add(getContentPane(custom), BorderLayout.CENTER); + } - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = { f }; - double[] rowSize = { p,p,p}; + protected JPanel getContentPane(boolean custom) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {f}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[3][1]; - if(custom) { - if(!(plot instanceof Bar2DPlot)) { - components[0] = new Component[]{getContentInPlotType()}; - components[1] = new Component[]{new JSeparator()}; - } + JPanel panel; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + if (custom) { + if (!(plot instanceof Bar2DPlot)) { + components[0] = new Component[]{getContentInPlotType()}; + components[1] = new Component[]{new JSeparator()}; + } - JScrollPane scrollPane = new JScrollPane(); - scrollPane.setViewportView(panel); - scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - this.setLayout(new BorderLayout()); - this.add(scrollPane, BorderLayout.CENTER); + JScrollPane scrollPane = new JScrollPane(); + scrollPane.setViewportView(panel); + scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } else { - if(fillStylePane != null) { - components[0] = new Component[]{fillStylePane}; - components[1] = new Component[]{new JSeparator()}; - } - - JPanel contentPane = getContentInPlotType(); - if(contentPane != null) { - components[2] = new Component[]{contentPane}; - } - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); - this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); + if (fillStylePane != null) { + components[0] = new Component[]{fillStylePane}; + components[1] = new Component[]{new JSeparator()}; + } + + JPanel contentPane = getContentInPlotType(); + if (contentPane != null) { + components[2] = new Component[]{contentPane}; + } + + panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } - } - - /** + panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15)); + return panel; + + } + + /** * 在每个不同类型Plot, 得到不同类型的属性. 比如: 柱形的风格, 折线的线型曲线. */ protected abstract JPanel getContentInPlotType(); - + /** * 返回 填充界面. */ protected ChartFillStylePane getFillStylePane() { return new ChartFillStylePane(); } - + /** * 界面标题. */ @@ -95,8 +100,8 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane{ public Plot updateBean() { return null; } - - + + /** * 更新Plot的属性到系列界面 */ diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java index 7cb9beb02c..c9f54fc339 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java @@ -3,9 +3,9 @@ package com.fr.design.mainframe.chart.gui.style.series; import com.fr.chart.chartattr.Chart; import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import javax.swing.*; import java.awt.*; @@ -15,7 +15,7 @@ import java.awt.*; * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-1-5 上午10:31:50 */ -public class ChartSeriesPane extends BasicScrollPane{ +public class ChartSeriesPane extends AbstractVanChartScrollPane { protected AbstractPlotSeriesPane seriesStyleContentPane; protected Chart chart; 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/designer/PlotFactory.java b/designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java index 3e6aff6c21..b5a3828e06 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/PlotFactory.java @@ -15,7 +15,11 @@ import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.plugin.chart.designer.component.VanChartLabelContentPane; import com.fr.plugin.chart.designer.component.VanChartRefreshTooltipContentPane; import com.fr.plugin.chart.designer.component.VanChartTooltipContentPane; -import com.fr.plugin.chart.designer.style.*; +import com.fr.plugin.chart.designer.style.HeatMapRangeLegendPane; +import com.fr.plugin.chart.designer.style.VanChartPlotLegendPane; +import com.fr.plugin.chart.designer.style.VanChartRangeLegendPane; +import com.fr.plugin.chart.designer.style.VanChartStylePane; +import com.fr.plugin.chart.designer.style.VanLegendPaneWidthOutHighlight; import com.fr.plugin.chart.designer.style.label.VanChartGaugePlotLabelPane; import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane; import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane; @@ -322,7 +326,12 @@ public class PlotFactory { public static FormatPane createAutoFormatPane(){ FormatPane formatPane = new FormatPane(){ - + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { + return new Component[][]{ + new Component[]{typePane,null}, + new Component[]{centerPane, null}, + }; + } protected UIComboBoxRenderer createComBoxRender(){ return new UIComboBoxRenderer() { @Override 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..e8c85515c5 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 @@ -2,10 +2,11 @@ package com.fr.plugin.chart.designer.component; import com.fr.chart.base.ChartConstants; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; 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.*; @@ -15,19 +16,19 @@ import java.awt.*; */ //系列-风格 public class VanChartBeautyPane extends BasicBeanPane { - private UIComboBox styleBox; + private UIButtonGroup styleBox; public VanChartBeautyPane() { - styleBox = new UIComboBox(getNameArray()); + styleBox = new UIButtonGroup(getNameArray()); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = { f }; - double[] rowSize = { p}; + double[] columnSize = {p, f}; + double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{styleBox}, + new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Style")), 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,11 +295,18 @@ 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(){ - return new FormatPane(); + return new FormatPane(){ + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { + return new Component[][]{ + new Component[]{typePane,null}, + new Component[]{centerPane, null}, + }; + } + }; } protected void checkFormatType() { @@ -311,17 +333,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 +342,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } } - private void checkLabelGapValuePane() { + protected void checkLabelGapValuePane() { if(labelGapValue != null && labelGapStyle != null){ labelGapValue.setEnabled(labelGapStyle.getSelectedIndex() == 1); } @@ -337,8 +350,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 +466,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } } if(reversed != null){ - reversed.setSelected(axis.hasAxisReversed()); + reversed.setSelectedIndex(axis.hasAxisReversed() == true ? 0 : 1); } } @@ -574,7 +587,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..d1da53d682 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 @@ -18,12 +18,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.*; @@ -38,6 +38,10 @@ import java.util.regex.Pattern; * 时间坐标轴 */ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { + private JPanel minPane; + private JPanel maxPane; + private JPanel mainPane; + private JPanel secPane; private static final long serialVersionUID = 1371126030195384450L; private static final String[] TYPES = new String[]{ @@ -57,19 +61,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 +75,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,44 +142,60 @@ 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}; + 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); + minPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Min"),minValueField); + maxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Max"),maxValueField); + mainPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MainType"),mainTickPane); + secPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_SecType"),secTickPane); + + minPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + maxPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + mainPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + secPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + + JPanel minPaneWithCheckBox = new JPanel(new BorderLayout()); + JPanel maxPaneWithCheckBox = new JPanel(new BorderLayout()); + JPanel mainPaneWithCheckBox = new JPanel(new BorderLayout()); + JPanel secPaneWithCheckBox = new JPanel(new BorderLayout()); + + minPaneWithCheckBox.add(minCheckBox, BorderLayout.NORTH); + minPaneWithCheckBox.add(minPane, BorderLayout.CENTER); + maxPaneWithCheckBox.add(maxCheckBox, BorderLayout.NORTH); + maxPaneWithCheckBox.add(maxPane, BorderLayout.CENTER); + mainPaneWithCheckBox.add(mainTickBox, BorderLayout.NORTH); + mainPaneWithCheckBox.add(mainPane, BorderLayout.CENTER); + secPaneWithCheckBox.add(secondTickBox, BorderLayout.NORTH); + secPaneWithCheckBox.add(secPane, BorderLayout.CENTER); Component[][] components = { - {maxMinPane, null}, - {mainTickPane, null}, - {secTickPane, null}, + {minPaneWithCheckBox}, + {maxPaneWithCheckBox}, + {mainPaneWithCheckBox}, + {secPaneWithCheckBox}, }; - 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")); Editor[] editor = new Editor[]{dateEditor, formulaEditor}; minValueField = new ValueEditorPane(editor); - minValueField.setEnabled(false); minCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { checkBoxUse(); @@ -192,13 +205,12 @@ 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")); Editor[] editor = new Editor[]{dateEditor, formulaEditor}; maxValueField = new ValueEditorPane(editor); - maxValueField.setEnabled(false); maxCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { checkBoxUse(); @@ -208,12 +220,10 @@ 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); mainType = new UIComboBox(TYPES); - mainType.setEnabled(false); mainTickBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -226,12 +236,10 @@ 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); secondType = new UIComboBox(TYPES); - secondType.setEnabled(false); secondTickBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -244,22 +252,11 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private void checkBoxUse() { - minValueField.setEnabled(minCheckBox.isSelected()); - maxValueField.setEnabled(maxCheckBox.isSelected()); - if(minValueField.getCurrentEditor() instanceof FormulaEditor){ - FormulaEditor tmpEditor = (FormulaEditor)minValueField.getCurrentEditor(); - tmpEditor.enableEditor(minCheckBox.isSelected()); - } - - if(maxValueField.getCurrentEditor() instanceof FormulaEditor){ - FormulaEditor tmpEditor = (FormulaEditor)maxValueField.getCurrentEditor(); - tmpEditor.enableEditor(maxCheckBox.isSelected()); - } - mainType.setEnabled(mainTickBox.isSelected()); - mainUnitField.setEnabled(mainTickBox.isSelected()); - secondType.setEnabled(secondTickBox.isSelected()); - secondUnitField.setEnabled(secondTickBox.isSelected()); + minPane.setVisible(minCheckBox.isSelected()); + maxPane.setVisible(maxCheckBox.isSelected()); + mainPane.setVisible(mainTickBox.isSelected()); + secPane.setVisible(secondTickBox.isSelected()); } public void update(VanChartTimeAxis timeAxis){ 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..ed9f11c529 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 @@ -27,6 +27,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { protected VanChartMinMaxValuePane minMaxValuePane; private UICheckBox logBox; private UITextField logBaseField; + private JPanel logPane; public VanChartValueAxisPane(){ this(false); @@ -43,20 +44,13 @@ 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[]{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[]{createValueStylePane(),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[]{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}, + new Component[]{createDisplayStrategy(new double[]{p, p, p}, columnSize), null}, + new Component[]{createValueStylePane(), null}, }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -64,12 +58,12 @@ 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(); - logBox = new UICheckBox(Inter.getLocText("Plugin-ChartF_LogBaseValue") + " "); + logBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Plugin-ChartF_LogBaseValue"})); logBaseField = new UITextField(); logBaseField.setPreferredSize(new Dimension(55, 20)); logBox.addActionListener(new ActionListener() { @@ -77,16 +71,26 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { logBaseField.setEnabled(logBox.isSelected()); } }); + ChartSwingUtils.addListener(logBox, logBaseField); // JPanel logPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); // logPane.add(logBox); // logPane.add(logBaseField); + + logPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_LogBaseValue"), logBaseField); + + logPane.setBorder(BorderFactory.createEmptyBorder(0, 25, 0, 15)); + + JPanel logPaneWithCheckBox = new JPanel(new BorderLayout()); + + logPaneWithCheckBox.add(logBox, BorderLayout.NORTH); + logPaneWithCheckBox.add(logPane, BorderLayout.CENTER); + Component[][] components = new Component[][]{ new Component[]{minMaxValuePane, null}, - new Component[]{logBox}, - new Component[]{logBaseField}, - } ; + new Component[]{logPaneWithCheckBox, null}, + }; logBox.addActionListener(new ActionListener() { @Override @@ -103,7 +107,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { } private void checkBox() { - logBaseField.setEnabled(logBox.isSelected()); + logPane.setVisible(logBox.isSelected()); } /** diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutSecTick.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutSecTick.java index 8b511b1ec7..91623964b9 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutSecTick.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutSecTick.java @@ -1,5 +1,6 @@ package com.fr.plugin.chart.designer.style.axis.component; +import javax.swing.*; import java.awt.*; /** @@ -9,14 +10,15 @@ public class MinMaxValuePaneWithOutSecTick extends VanChartMinMaxValuePane { private static final long serialVersionUID = -887359523503645758L; - protected Component[][] getPanelComponents() { - return new Component[][]{ - new Component[]{minCheckBox}, - new Component[]{minValueField}, - new Component[]{maxCheckBox}, - new Component[]{maxValueField}, - new Component[]{isCustomMainUnitBox}, - new Component[]{mainUnitField}, + protected double[] getRowSize(double p) { + return new double[]{p, p, p}; + } + + protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) { + return new Component[][] { + {minPaneWithCheckBox}, + {maxPaneWithCheckBox}, + {mainPaneWithCheckBox}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutTick.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutTick.java index 6a620dfc7b..43eedd3ebe 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutTick.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/MinMaxValuePaneWithOutTick.java @@ -3,6 +3,7 @@ package com.fr.plugin.chart.designer.style.axis.component; import com.fr.base.Formula; import com.fr.plugin.chart.range.MinAndMaxValue; +import javax.swing.*; import java.awt.*; /** @@ -11,13 +12,14 @@ import java.awt.*; public class MinMaxValuePaneWithOutTick extends VanChartMinMaxValuePane { private static final long serialVersionUID = -957414093602086034L; - @Override - protected Component[][] getPanelComponents() { - return new Component[][]{ - new Component[]{minCheckBox}, - new Component[]{minValueField}, - new Component[]{maxCheckBox}, - new Component[]{maxValueField}, + protected double[] getRowSize(double p) { + return new double[]{p, p}; + } + + protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) { + return new Component[][] { + {minPaneWithCheckBox}, + {maxPaneWithCheckBox}, }; } @@ -39,9 +41,4 @@ public class MinMaxValuePaneWithOutTick extends VanChartMinMaxValuePane { minAndMaxValue.setCustomMax(maxCheckBox.isSelected()); } - private void checkBoxUse() { - minValueField.setEnabled(minCheckBox.isSelected()); - maxValueField.setEnabled(maxCheckBox.isSelected()); - } - } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/VanChartMinMaxValuePane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/VanChartMinMaxValuePane.java index 99df1062c8..212692a8a3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/VanChartMinMaxValuePane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/component/VanChartMinMaxValuePane.java @@ -2,9 +2,10 @@ package com.fr.plugin.chart.designer.style.axis.component; import com.fr.design.chart.ChartSwingUtils; import com.fr.design.chart.axis.MinMaxValuePane; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.itextfield.UITextField; +import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -14,31 +15,90 @@ import java.awt.event.ActionListener; */ public class VanChartMinMaxValuePane extends MinMaxValuePane { + private JPanel minPane; + private JPanel maxPane; + private JPanel mainPane; + private JPanel secPane; + @Override protected double[] getRowSize(double p) { - return new double[]{p, p, p, p, p, p, p, p}; + return new double[]{p, p, p, p}; } @Override protected void addComponentListener(Component[][] components) { - for (int i = 0; i < components.length; i += 2) { - addListener((UICheckBox) components[i][0]); - ChartSwingUtils.addListener((UICheckBox) components[i][0], (UITextField) components[i + 1][0]); - } + + ChartSwingUtils.addListener(minCheckBox, minValueField); + ChartSwingUtils.addListener(maxCheckBox, maxValueField); + ChartSwingUtils.addListener(isCustomMainUnitBox, mainUnitField); + ChartSwingUtils.addListener(isCustomSecUnitBox, secUnitField); + minCheckBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkBoxUse(); + } + }); + maxCheckBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkBoxUse(); + } + }); + isCustomMainUnitBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkBoxUse(); + } + }); + isCustomSecUnitBox.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkBoxUse(); + } + }); } @Override protected Component[][] getPanelComponents() { - return new Component[][]{ - new Component[]{minCheckBox}, - new Component[]{minValueField}, - new Component[]{maxCheckBox}, - new Component[]{maxValueField}, - new Component[]{isCustomMainUnitBox}, - new Component[]{mainUnitField}, - new Component[]{isCustomSecUnitBox}, - new Component[]{secUnitField}, + + minPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Min"),minValueField); + maxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Chart-Data_Max"),maxValueField); + mainPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MainType"),mainUnitField); + secPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_SecType"),secUnitField); + + minPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + maxPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + mainPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + secPane.setBorder(BorderFactory.createEmptyBorder(0,25,0,15)); + + JPanel minPaneWithCheckBox = new JPanel(new BorderLayout()); + JPanel maxPaneWithCheckBox = new JPanel(new BorderLayout()); + JPanel mainPaneWithCheckBox = new JPanel(new BorderLayout()); + JPanel secPaneWithCheckBox = new JPanel(new BorderLayout()); + + minPaneWithCheckBox.add(minCheckBox, BorderLayout.NORTH); + minPaneWithCheckBox.add(minPane, BorderLayout.CENTER); + maxPaneWithCheckBox.add(maxCheckBox, BorderLayout.NORTH); + maxPaneWithCheckBox.add(maxPane, BorderLayout.CENTER); + mainPaneWithCheckBox.add(isCustomMainUnitBox, BorderLayout.NORTH); + mainPaneWithCheckBox.add(mainPane, BorderLayout.CENTER); + secPaneWithCheckBox.add(isCustomSecUnitBox, BorderLayout.NORTH); + secPaneWithCheckBox.add(secPane, BorderLayout.CENTER); + + return getShowComponents(minPaneWithCheckBox, maxPaneWithCheckBox, mainPaneWithCheckBox, secPaneWithCheckBox); + } + + protected Component[][] getShowComponents(JPanel minPaneWithCheckBox, JPanel maxPaneWithCheckBox, JPanel mainPaneWithCheckBox, JPanel secPaneWithCheckBox) { + return new Component[][] { + {minPaneWithCheckBox}, + {maxPaneWithCheckBox}, + {mainPaneWithCheckBox}, + {secPaneWithCheckBox}, }; } + protected void checkBoxUse() { + minPane.setVisible(minCheckBox.isSelected()); + maxPane.setVisible(maxCheckBox.isSelected()); + + mainPane.setVisible(isCustomMainUnitBox.isSelected()); + secPane.setVisible(isCustomSecUnitBox.isSelected()); + } + } \ No newline at end of file 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..89d79bcce0 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}, }; @@ -36,6 +33,7 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { 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}, }; 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..789c34ee5c 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}, }; @@ -61,7 +57,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { centerPane.add(commenPane, Inter.getLocText("Plugin-ChartF_UnifiedComputing")); centerPane.add(tableDataPane, Inter.getLocText("Plugin-ChartF_RespectivelySpecified")); - JPanel contentPane = new JPanel(new BorderLayout(0, 4)); + JPanel contentPane = new JPanel(new BorderLayout()); contentPane.add(valueStyle, BorderLayout.NORTH); contentPane.add(centerPane, BorderLayout.CENTER); valueStyle.addActionListener(new ActionListener() { @@ -71,11 +67,14 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { } }); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), contentPane); + JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_ValueDefinition"), contentPane); + contentPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + return 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}, }; 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..f776a22407 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 @@ -6,7 +6,9 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; 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.AbstractVanChartScrollPane; +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; @@ -15,7 +17,7 @@ import javax.swing.*; import java.awt.*; //图表区|绘图区 边框和背景 -public class VanChartAreaBackgroundPane extends AbstractChartTabPane { +public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane { private static final long serialVersionUID = 104381641640066015L; protected VanChartBorderWithRadiusPane chartBorderPane; @@ -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..f2ca9ce33b 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()); @@ -71,12 +69,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane{ horizontalGridLine = new ColorSelectBox(100); verticalGridLine = new ColorSelectBox(100); Component[][] components = getGridLinePaneComponents(); - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + 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 370e162c08..3412fe0854 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 @@ -11,6 +11,8 @@ import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane; import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; @@ -40,6 +42,7 @@ import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import java.awt.*; /** * 图表样式-系列抽象界面 @@ -75,13 +78,38 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP super(parent, plot); } + protected JPanel getContentPane(boolean custom) { + return getContentInPlotType(); + } + @Override /** * 返回 填充界面. */ protected ChartFillStylePane getFillStylePane() { //如果是自定義組合圖,則不創建填充界面 - return parentPane instanceof VanChartCustomStylePane ? null : new ChartFillStylePane(); + return parentPane instanceof VanChartCustomStylePane ? null : new ChartFillStylePane(){ + protected JPanel getContentPane () { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p, p}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("ColorMatch")),styleSelectBox}, + new Component[]{null,customPane}, + + }; + return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + + } + @Override + public Dimension getPreferredSize() { + if(styleSelectBox.getSelectedIndex() != styleSelectBox.getItemCount() - 1) { + return new Dimension(styleSelectBox.getPreferredSize().width, 30); + } + return super.getPreferredSize(); + } + }; } //风格 @@ -98,13 +126,13 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //趋势线 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() { @@ -114,19 +142,20 @@ 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); + } //半径界面 @@ -196,7 +225,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() { @@ -217,7 +246,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..0184f1fe82 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); @@ -38,12 +38,15 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p,p,p,p,p,p}; + double[] rowSize = {p,p,p,p,p}; + JPanel panel = new JPanel(new BorderLayout()); + panel.add(getFillStylePane(), BorderLayout.NORTH); + panel.add(createStylePane(), BorderLayout.CENTER); + JPanel ColorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Color"), panel); + panel.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); Component[][] components = new Component[][]{ - new Component[]{createStylePane()}, - new Component[]{stylePane == null ? null : new JSeparator()}, + new Component[]{ColorPane}, new Component[]{createSeriesStylePane(rowSize, new double[]{p,f})}, - new Component[]{new JSeparator()}, new Component[]{createBorderPane()}, }; @@ -55,19 +58,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 +98,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 +119,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