Browse Source

调整一下标题和图例的显示策略部分

master
mengao 7 years ago
parent
commit
32b5dcab69
  1. 20
      designer_chart/src/com/fr/plugin/chart/designer/style/VanChartPlotLegendPane.java
  2. 22
      designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java

20
designer_chart/src/com/fr/plugin/chart/designer/style/VanChartPlotLegendPane.java

@ -53,6 +53,7 @@ public class VanChartPlotLegendPane extends BasicPane {
protected UIButtonGroup<Integer> limitSize; protected UIButtonGroup<Integer> limitSize;
protected UISpinner maxProportion; protected UISpinner maxProportion;
private UILabel limitSizeTitle; private UILabel limitSizeTitle;
private JPanel maxProportionPane;
//高亮显示的按钮 //高亮显示的按钮
@ -228,17 +229,12 @@ public class VanChartPlotLegendPane extends BasicPane {
limitSizeTitle = new UILabel(Inter.getLocText("Plugin-ChartF_MaxProportion")); limitSizeTitle = new UILabel(Inter.getLocText("Plugin-ChartF_MaxProportion"));
double p = TableLayout.PREFERRED; JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AreaSize"),limitSize);
double f = TableLayout.FILL; maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MaxProportion"),maxProportion);
double[] columnSize = {p,f}; maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0));
double[] rowSize = {p,p,p}; JPanel panel = new JPanel(new BorderLayout());
Component[][] components = new Component[][]{ panel.add(limitSizePane, BorderLayout.NORTH);
new Component[]{null,null}, panel.add(maxProportionPane, BorderLayout.CENTER);
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AreaSize"), SwingConstants.LEFT), limitSize},
new Component[]{limitSizeTitle,maxProportion},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
limitSize.addActionListener(new ActionListener() { limitSize.addActionListener(new ActionListener() {
@Override @Override
@ -278,7 +274,7 @@ public class VanChartPlotLegendPane extends BasicPane {
//检查最大显示占比是否可用 //检查最大显示占比是否可用
private void checkMaxProPortionUse() { private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
limitSizeTitle.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
} }

22
designer_chart/src/com/fr/plugin/chart/designer/style/VanChartTitlePane.java

@ -56,7 +56,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private VanChartFloatPositionPane customFloatPositionPane; private VanChartFloatPositionPane customFloatPositionPane;
private UIButtonGroup<Integer> limitSize; private UIButtonGroup<Integer> limitSize;
private UISpinner maxProportion; private UISpinner maxProportion;
private UILabel limitSizeTitle; private JPanel maxProportionPane;
protected VanChartStylePane parent; protected VanChartStylePane parent;
@ -163,17 +163,13 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private JPanel createDisplayStrategy(){ private JPanel createDisplayStrategy(){
maxProportion = new UISpinner(0,100,1,30); maxProportion = new UISpinner(0,100,1,30);
limitSize = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_Limit"),Inter.getLocText("Plugin-ChartF_NotLimit")}); limitSize = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_Limit"),Inter.getLocText("Plugin-ChartF_NotLimit")});
limitSizeTitle = new UILabel(Inter.getLocText("Plugin-ChartF_MaxProportion"));
double p = TableLayout.PREFERRED; JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AreaSize"),limitSize);
double f = TableLayout.FILL; maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MaxProportion"),maxProportion);
double[] columnSize = {p,f}; maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0));
double[] rowSize = {p,p,p}; JPanel panel = new JPanel(new BorderLayout());
Component[][] components = new Component[][]{ panel.add(limitSizePane, BorderLayout.NORTH);
new Component[]{null,null}, panel.add(maxProportionPane, BorderLayout.CENTER);
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_AreaSize"), SwingConstants.LEFT), limitSize},
new Component[]{limitSizeTitle,maxProportion},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
limitSize.addActionListener(new ActionListener() { limitSize.addActionListener(new ActionListener() {
@Override @Override
@ -251,7 +247,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
//检查最大显示占比是否可用 //检查最大显示占比是否可用
private void checkMaxProPortionUse() { private void checkMaxProPortionUse() {
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
limitSizeTitle.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled());
} }
/** /**

Loading…
Cancel
Save