diff --git a/designer_base/src/com/fr/design/gui/style/FormatPane.java b/designer_base/src/com/fr/design/gui/style/FormatPane.java index 4c4d86424f..7785c0e336 100644 --- a/designer_base/src/com/fr/design/gui/style/FormatPane.java +++ b/designer_base/src/com/fr/design/gui/style/FormatPane.java @@ -104,18 +104,21 @@ public class FormatPane extends AbstractBasicStylePane { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - Component[][] components = new Component[][]{ + double[] rowSize = {p, p, p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 3}, {1, 1}}; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(getComponent(fontPane, centerPane, frFontPane), rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); + this.add(panel, BorderLayout.CENTER); + } + + protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, FRFontPane frFontPane) { + return new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Inter.getLocText("FR-Base_Format") + " ", SwingConstants.LEFT), typeComboBox}, new Component[]{null, centerPane}, new Component[]{fontPane, frFontPane}, new Component[]{null, null} }; - double[] rowSize = {p, p, p, p, p}; - double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 3}, {1, 1}}; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); - this.add(panel, BorderLayout.CENTER); } protected UIComboBoxRenderer createComBoxRender() { @@ -375,6 +378,10 @@ public class FormatPane extends AbstractBasicStylePane { }; typeComboBox.setRenderer(render); typeComboBox.addItemListener(itemListener); + setTypeComboBoxPane(typeComboBox); + } + + protected void setTypeComboBoxPane (UIComboBox typeComboBox) { this.add(typeComboBox, BorderLayout.NORTH); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTooltipContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTooltipContentPane.java index d36cc405d0..bebe2af7c6 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartTooltipContentPane.java @@ -2,12 +2,18 @@ package com.fr.plugin.chart.designer.component; import com.fr.design.beans.BasicBeanPane; 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.base.AttrTooltipContent; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; -import com.fr.plugin.chart.designer.component.format.*; +import com.fr.plugin.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.plugin.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; +import com.fr.plugin.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; +import com.fr.plugin.chart.designer.component.format.PercentFormatPaneWithCheckBox; +import com.fr.plugin.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.plugin.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.plugin.chart.designer.style.VanChartStylePane; import javax.swing.*; @@ -75,12 +81,23 @@ public class VanChartTooltipContentPane extends BasicBeanPane limitSize; protected UISpinner maxProportion; private UILabel limitSizeTitle; + private JPanel maxProportionPane; //高亮显示的按钮 @@ -228,17 +229,12 @@ public class VanChartPlotLegendPane extends BasicPane { limitSizeTitle = new UILabel(Inter.getLocText("Plugin-ChartF_MaxProportion")); - 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_AreaSize"), SwingConstants.LEFT), limitSize}, - new Component[]{limitSizeTitle,maxProportion}, - - }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AreaSize"),limitSize); + 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); limitSize.addActionListener(new ActionListener() { @Override @@ -278,7 +274,7 @@ public class VanChartPlotLegendPane extends BasicPane { //检查最大显示占比是否可用 private void checkMaxProPortionUse() { maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); - limitSizeTitle.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java index 299beeee82..f8947ad879 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java @@ -56,7 +56,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { private VanChartFloatPositionPane customFloatPositionPane; private UIButtonGroup limitSize; private UISpinner maxProportion; - private UILabel limitSizeTitle; + private JPanel maxProportionPane; protected VanChartStylePane parent; @@ -163,17 +163,13 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { private JPanel createDisplayStrategy(){ maxProportion = new UISpinner(0,100,1,30); limitSize = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Limit"),Inter.getLocText("Plugin-ChartF_NotLimit")}); - limitSizeTitle = new UILabel(Inter.getLocText("Plugin-ChartF_MaxProportion")); - 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_AreaSize"), SwingConstants.LEFT), limitSize}, - new Component[]{limitSizeTitle,maxProportion}, - }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + + JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AreaSize"),limitSize); + 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); limitSize.addActionListener(new ActionListener() { @Override @@ -251,7 +247,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { //检查最大显示占比是否可用 private void checkMaxProPortionUse() { maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); - limitSizeTitle.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); + maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); } /** diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/datasheet/VanChartDataSheetPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/datasheet/VanChartDataSheetPane.java index 4dbf26fe02..94ee1871c4 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/datasheet/VanChartDataSheetPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/datasheet/VanChartDataSheetPane.java @@ -5,9 +5,7 @@ import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.DataSheet; import com.fr.design.constants.LayoutConstants; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.style.FormatPane; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -17,10 +15,13 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.Inter; import com.fr.plugin.chart.VanChartAttrHelper; -import com.fr.plugin.chart.type.AxisType; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.base.VanChartConstants; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.border.VanChartBorderPane; +import com.fr.plugin.chart.designer.component.format.VanChartFormatPane; +import com.fr.plugin.chart.type.AxisType; import javax.swing.*; import java.awt.*; @@ -30,7 +31,7 @@ import java.awt.event.ActionListener; /** * 样式-数据表 */ -public class VanChartDataSheetPane extends BasicScrollPane { +public class VanChartDataSheetPane extends AbstractVanChartScrollPane { private static final long serialVersionUID = 5547658195141361981L; private UICheckBox isShowDataSheet; @@ -73,7 +74,6 @@ public class VanChartDataSheetPane extends BasicScrollPane { Component[][] components = new Component[][]{ new Component[]{isShowDataSheet}, - new Component[]{new JSeparator()}, new Component[]{dataSheetPane} }; return components; @@ -85,23 +85,18 @@ public class VanChartDataSheetPane extends BasicScrollPane { private JPanel createDataSheetPane(){ textAttrPane = new ChartTextAttrPane(); - formatPane = new FormatPane(); + formatPane = new VanChartFormatPane(); formatPane.setForDataSheet(); borderPane = new VanChartBorderPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, f}; - double[] rowSize = {p,p,p,p,p,p,p,p}; + double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Style")),null}, - new Component[]{null,textAttrPane}, - new Component[]{new JSeparator(),null}, - new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_DataType")),null}, - new Component[]{null,formatPane}, - new Component[]{new JSeparator(),null}, - new Component[]{borderPane,null}, - new Component[]{new JSeparator(),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Base_Format"),formatPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"),textAttrPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),borderPane),null}, }; return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index 844afc8f38..ee586c91f0 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -5,8 +5,8 @@ import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.label.LabelContentPaneWithCate; import com.fr.plugin.chart.designer.component.label.LabelContentPaneWithPercent; import com.fr.plugin.chart.designer.style.VanChartStylePane; -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.*; @@ -14,7 +14,7 @@ import java.awt.*; /** * 仪表盘的分类(多指针时)或者百分比标签 */ -public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartPlotLabelDetailPane { +public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabelDetailPane { private static final long serialVersionUID = 5176535960949074945L; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeLabelDetailPane.java new file mode 100644 index 0000000000..c83ad98e5a --- /dev/null +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -0,0 +1,40 @@ +package com.fr.plugin.chart.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; +import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import com.fr.plugin.chart.designer.style.VanChartStylePane; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by mengao on 2017/8/13. + */ +public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartGaugeLabelDetailPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { + style = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Automatic"), + Inter.getLocText("Plugin-ChartF_Custom")}); + textFontPane = new ChartTextAttrPane(); + + initStyleListener(); + + return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot),row,col); + } + + protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ + return TableLayoutHelper.createTableLayoutPane(comps,row,col); + } + + protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { + return TableLayout4VanChartHelper.createGapTableLayoutPane(title, panel); + } +} diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugePlotLabelPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugePlotLabelPane.java index d60ddac36c..7ac18e56bc 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugePlotLabelPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugePlotLabelPane.java @@ -5,8 +5,8 @@ import com.fr.general.Inter; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.style.VanChartStylePane; -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.*; @@ -40,10 +40,9 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { cateTitle = Inter.getLocText("Plugin-ChartF_PercentLabel"); break; } - JPanel cateOrPercentPane = TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(cateTitle, labelDetailPane); - JPanel valuePane = TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(valueTitle, gaugeValueLabelPane); + JPanel cateOrPercentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(cateTitle, labelDetailPane); + JPanel valuePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(valueTitle, gaugeValueLabelPane); labelPane.add(cateOrPercentPane, BorderLayout.NORTH); - labelPane.add(new JSeparator(), BorderLayout.CENTER); labelPane.add(valuePane, BorderLayout.SOUTH); } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index 31a363071c..2dcb96dab2 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -5,8 +5,8 @@ import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.plugin.chart.designer.component.label.LabelContentPaneWithCateValue; import com.fr.plugin.chart.designer.component.label.LabelContentPaneWithOutCate; import com.fr.plugin.chart.designer.style.VanChartStylePane; -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.*; @@ -14,7 +14,7 @@ import java.awt.*; /** * 仪表盘的值标签 */ -public class VanChartGaugeValueLabelDetailPane extends VanChartPlotLabelDetailPane { +public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailPane { private static final long serialVersionUID = 2601073419430634281L; private GaugeStyle gaugeStyle; @@ -59,9 +59,7 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartPlotLabelDetailPa private Component[][] getLabelPaneComponentsWithBackground(Plot plot, double p, double[] columnSize) { return new Component[][]{ new Component[]{dataLabelContentPane,null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLabelStylePane(new double[]{p,p}, columnSize, plot),null}, - new Component[]{new JSeparator(),null}, + new Component[]{createLabelStylePane(new double[]{p,p,p}, columnSize, plot),null}, new Component[]{createBackgroundColorPane(),null}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartLabelPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartLabelPane.java index a1b016b960..aaeeadd920 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartLabelPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartLabelPane.java @@ -4,17 +4,17 @@ import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.dialog.BasicScrollPane; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.designer.style.VanChartStylePane; import javax.swing.*; import java.awt.*; -public class VanChartLabelPane extends BasicScrollPane { +public class VanChartLabelPane extends AbstractVanChartScrollPane { private VanChartPlotLabelPane labelPane; private Chart chart; protected VanChartStylePane parent; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java index a8c981ddef..41b0f5a76c 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -5,6 +5,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; @@ -34,7 +35,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected BasicBeanPane dataLabelContentPane; protected UIButtonGroup position; - protected UIToggleButton autoAdjust; + protected UIButtonGroup autoAdjust; protected UIToggleButton tractionLine; protected UIButtonGroup style; @@ -71,16 +72,13 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(hasLabelPosition(plot)){ return new Component[][]{ new Component[]{dataLabelContentPane,null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLabelPositionPane(new double[]{p,p}, columnSize, plot),null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLabelStylePane(new double[]{p,p}, columnSize, plot),null}, + new Component[]{createLabelPositionPane(new double[]{p,p,p}, columnSize, plot),null}, + new Component[]{createLabelStylePane(new double[]{p,p,p}, columnSize, plot),null}, }; } else { return new Component[][]{ new Component[]{dataLabelContentPane,null}, - new Component[]{new JSeparator(),null}, - new Component[]{createLabelStylePane(new double[]{p,p}, columnSize, plot),null}, + new Component[]{createLabelStylePane(new double[]{p,p,p}, columnSize, plot),null}, }; } } @@ -93,8 +91,8 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return plot instanceof VanChartLabelPositionPlot; } - protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(title, component); + protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); } protected JPanel createLabelPositionPane(double[] row, double[] col, Plot plot) { @@ -110,33 +108,33 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } position = new UIButtonGroup(names, values); - autoAdjust = new UIToggleButton(Inter.getLocText("Plugin-ChartF_Auto_Adjust")); + autoAdjust = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_On"), Inter.getLocText("Plugin-ChartF_Off")}, new Boolean[]{true, false}); + + + Component[][] comps = new Component[3][2]; + + comps[0] = new Component[]{null,null}; + comps[1] = new Component[]{new UILabel(Inter.getLocText("Chart-Layout_Position"), SwingConstants.LEFT), position}; - Component[] comps; if(plot.isSupportLeadLine()){ tractionLine = new UIToggleButton(Inter.getLocText("ChartF-Show_GuidLine")); - comps = new Component[]{position, tractionLine}; + comps[2] = new Component[]{null,tractionLine}; initPositionListener(); } else if(PlotFactory.plotAutoAdjustLabelPosition(plot)){ - comps = new Component[]{position, autoAdjust}; - } else { - comps = new Component[]{position}; - } - - int len = comps.length; - Component[][] components = new Component[len][2]; - - for(int i = 0; i < len; i++){ - components[i] = new Component[]{comps[i], null}; + comps[2]= new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Auto_Adjust"), SwingConstants.LEFT),autoAdjust}; } - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components,row,col); - return createTableLayoutPaneWithTitle(Inter.getLocText("Chart-Layout_Position"), panel); + return getLabelPositionPane(comps,row,col); } return new JPanel(); } + protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ + JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); + return createTableLayoutPaneWithTitle(Inter.getLocText("FR-Chart_Layout"), panel); + } + + protected void initPositionListener() { position.addChangeListener(new ChangeListener() { @Override @@ -149,7 +147,15 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected JPanel createLabelStylePane(double[] row, double[] col, Plot plot) { style = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Automatic"), Inter.getLocText("Plugin-ChartF_Custom")}); - textFontPane = new ChartTextAttrPane(); + textFontPane = new ChartTextAttrPane(){ + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{null, fontNameComboBox}, + new Component[]{null, buttonPane} + }; + } + }; initStyleListener(); @@ -158,13 +164,15 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } protected Component[][] getLabelStyleComponents(Plot plot) { + UILabel text = new UILabel(Inter.getLocText("Plugin-Chart_Character"), SwingConstants.LEFT); return new Component[][]{ - new Component[]{style,null}, + new Component[]{null,null}, + new Component[]{text,style}, new Component[]{textFontPane,null}, }; } - private void initStyleListener() { + protected void initStyleListener() { style.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -191,7 +199,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private void checkStyleUse() { - textFontPane.setEnabled(style.getSelectedIndex() == 1); + textFontPane.setVisible(style.getSelectedIndex() == 1); } private void checkPosition() { @@ -211,7 +219,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { tractionLine.setSelected(detail.isShowGuidLine()); } if(autoAdjust != null){ - autoAdjust.setSelected(detail.isAutoAdjust()); + autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1); } style.setSelectedIndex(detail.isCustom() ? 1 : 0); textFontPane.populate(detail.getTextAttr()); @@ -234,7 +242,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { position.setSelectedItem(detail.getPosition()); } - detail.setAutoAdjust(autoAdjust != null && autoAdjust.isSelected()); + detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); if(tractionLine != null){ detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelPane.java index a1959f0e5d..d7ff66fb09 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/label/VanChartPlotLabelPane.java @@ -6,7 +6,6 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; -import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.designer.PlotFactory; @@ -46,10 +45,9 @@ public class VanChartPlotLabelPane extends BasicPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p,p}; + double[] rowSize = {p,p}; Component[][] components = new Component[][]{ new Component[]{isLabelShow}, - new Component[]{new JSeparator()}, new Component[]{labelPane} }; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java index ed9418f940..17ad7b534f 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotRefreshTooltipPane.java @@ -57,13 +57,10 @@ public class VanChartPlotRefreshTooltipPane extends VanChartPlotTooltipNoCheckPa protected Component[][] createComponents(Plot plot) { Component[][] components = new Component[][]{ new Component[]{refreshTooltipContentPane,null}, - new Component[]{new JSeparator(),null}, new Component[]{initDurationPane(),null}, - new Component[]{new JSeparator(),null}, new Component[]{createLabelStylePane(),null}, - new Component[]{new JSeparator(),null}, - new Component[]{borderPane,null}, - new Component[]{backgroundPane,null} + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),borderPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), backgroundPane),null}, }; return components; diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotTooltipPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotTooltipPane.java index 55f98e686c..b57b8340c8 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotTooltipPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartPlotTooltipPane.java @@ -3,8 +3,8 @@ package com.fr.plugin.chart.designer.style.tooltip; import com.fr.chart.chartattr.Plot; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; @@ -36,7 +36,7 @@ public class VanChartPlotTooltipPane extends BasicPane { protected VanChartBackgroundWithOutImagePane backgroundPane; - protected UIToggleButton showAllSeries; + protected UICheckBox showAllSeries; protected UIButtonGroup followMouse; protected VanChartStylePane parent; @@ -55,10 +55,9 @@ public class VanChartPlotTooltipPane extends BasicPane { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p,p}; + double[] rowSize = {p,p}; Component[][] components = new Component[][]{ new Component[]{isTooltipShow}, - new Component[]{new JSeparator()}, new Component[]{tooltipPane} }; @@ -92,11 +91,9 @@ public class VanChartPlotTooltipPane extends BasicPane { protected Component[][] createComponents(Plot plot) { Component[][] components = new Component[][]{ new Component[]{tooltipContentPane,null}, - new Component[]{new JSeparator(),null}, new Component[]{createLabelStylePane(),null}, - new Component[]{new JSeparator(),null}, - new Component[]{borderPane,null}, - new Component[]{backgroundPane,null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Border"),borderPane),null}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_Background"), backgroundPane),null}, new Component[]{createDisplayStrategy(plot),null}, }; return components; @@ -109,21 +106,30 @@ public class VanChartPlotTooltipPane extends BasicPane { protected JPanel createLabelStylePane() { style = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Automatic"),Inter.getLocText("Plugin-ChartF_Custom")}); - textFontPane = new ChartTextAttrPane(); - + textFontPane = new ChartTextAttrPane() { + protected Component[][] getComponents(JPanel buttonPane) { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{null, fontNameComboBox}, + new Component[]{null, buttonPane} + }; + } + }; + UILabel text = new UILabel(Inter.getLocText("Plugin-Chart_Character"), SwingConstants.LEFT); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f}; - double[] rowSize = {p,p}; + double[] rowSize = {p, p, p}; Component[][] components = new Component[][]{ - new Component[]{style,null}, - new Component[]{textFontPane,null}, + new Component[]{null, null}, + new Component[]{text, style}, + new Component[]{null, textFontPane}, }; initStyleListener(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); } @@ -137,15 +143,22 @@ public class VanChartPlotTooltipPane extends BasicPane { } protected JPanel createDisplayStrategy(Plot plot) { - showAllSeries = new UIToggleButton(getShowAllSeriesLabelText()); + showAllSeries = new UICheckBox(getShowAllSeriesLabelText()); followMouse = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_FollowMouse"), Inter.getLocText("Plugin-ChartF_NotFollowMouse")}); - JPanel panel = new JPanel(new BorderLayout(0,4)); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = { p,f }; + double[] rowSize = { p,p,p}; + Component[][] components = new Component[3][2]; + components[0] = new Component[]{null,null}; + components[1] = new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Prompt_Box")),followMouse}; + if(plot.isSupportTooltipSeriesType() && hasTooltipSeriesType()){ - panel.add(showAllSeries, BorderLayout.NORTH); + components[2] = new Component[]{showAllSeries,null}; } - panel.add(followMouse,BorderLayout.SOUTH); - return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_DisplayStrategy"), panel); } protected String getShowAllSeriesLabelText() { diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartTooltipPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartTooltipPane.java index 5d0cd3b77c..f332efbb47 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartTooltipPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/tooltip/VanChartTooltipPane.java @@ -4,17 +4,17 @@ import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; -import com.fr.design.dialog.BasicScrollPane; import com.fr.general.Inter; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.plugin.chart.designer.AbstractVanChartScrollPane; import com.fr.plugin.chart.designer.PlotFactory; import com.fr.plugin.chart.designer.style.VanChartStylePane; import javax.swing.*; import java.awt.*; -public class VanChartTooltipPane extends BasicScrollPane { +public class VanChartTooltipPane extends AbstractVanChartScrollPane { private static final long serialVersionUID = -2974722365840564105L; private VanChartPlotTooltipPane tooltipPane; private Chart chart; @@ -70,7 +70,7 @@ public class VanChartTooltipPane extends BasicScrollPane { } @Override - protected String title4PopupWindow() { + public String title4PopupWindow() { return Inter.getLocText("Plugin-Chart_Tooltip"); }