|
|
@ -8,11 +8,11 @@ import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
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.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.mainframe.chart.PaneTitleConstants; |
|
|
|
import com.fr.design.mainframe.chart.PaneTitleConstants; |
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.design.utils.gui.UIComponentUtils; |
|
|
|
import com.fr.design.utils.gui.UIComponentUtils; |
|
|
|
import com.fr.plugin.chart.attr.VanChartLegend; |
|
|
|
import com.fr.plugin.chart.attr.VanChartLegend; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.Constants; |
|
|
@ -20,8 +20,8 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
import com.fr.van.chart.designer.component.VanChartFloatPositionPane; |
|
|
|
import com.fr.van.chart.designer.component.VanChartFloatPositionPane; |
|
|
|
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; |
|
|
|
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; |
|
|
|
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; |
|
|
|
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; |
|
|
|
import com.fr.van.chart.designer.style.component.LimitPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.Icon; |
|
|
|
import javax.swing.Icon; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
@ -55,7 +55,13 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
protected UIToggleButton customFloatPositionButton; |
|
|
|
protected UIToggleButton customFloatPositionButton; |
|
|
|
protected VanChartFloatPositionPane customFloatPositionPane; |
|
|
|
protected VanChartFloatPositionPane customFloatPositionPane; |
|
|
|
|
|
|
|
|
|
|
|
private LimitPane limitPane; |
|
|
|
//区域显示策略 恢复用注释。下面4行删除。
|
|
|
|
|
|
|
|
protected UIButtonGroup<Integer> limitSize; |
|
|
|
|
|
|
|
protected UISpinner maxProportion; |
|
|
|
|
|
|
|
private UILabel limitSizeTitle; |
|
|
|
|
|
|
|
private JPanel maxProportionPane; |
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。取消注释。
|
|
|
|
|
|
|
|
//private LimitPane limitPane;
|
|
|
|
|
|
|
|
|
|
|
|
//高亮显示的按钮
|
|
|
|
//高亮显示的按钮
|
|
|
|
protected UIButtonGroup<Boolean> highlightButton; |
|
|
|
protected UIButtonGroup<Boolean> highlightButton; |
|
|
@ -228,8 +234,31 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createDisplayStrategy(){ |
|
|
|
protected JPanel createDisplayStrategy(){ |
|
|
|
limitPane = new LimitPane(false); |
|
|
|
//区域显示策略 恢复用注释。开始删除。
|
|
|
|
return limitPane; |
|
|
|
maxProportion = new UISpinner(0, 100, 1, 30); |
|
|
|
|
|
|
|
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")}); |
|
|
|
|
|
|
|
limitSizeTitle = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize); |
|
|
|
|
|
|
|
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); |
|
|
|
|
|
|
|
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); |
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
panel.add(limitSizePane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
panel.add(maxProportionPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
limitSize.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
checkMaxProPortionUse(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return panel; |
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。结束删除。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。取消注释。
|
|
|
|
|
|
|
|
// limitPane = new LimitPane(false);
|
|
|
|
|
|
|
|
// return limitPane;
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createHighlightPane(){ |
|
|
|
private JPanel createHighlightPane(){ |
|
|
@ -255,8 +284,19 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
//检查显示策略界面是否可用
|
|
|
|
//检查显示策略界面是否可用
|
|
|
|
protected void checkDisplayStrategyUse() { |
|
|
|
protected void checkDisplayStrategyUse() { |
|
|
|
GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected()); |
|
|
|
//区域显示策略 恢复用注释。下面2行删除。
|
|
|
|
limitPane.checkMaxProPortionUse(); |
|
|
|
limitSize.setEnabled(!customFloatPositionButton.isSelected()); |
|
|
|
|
|
|
|
checkMaxProPortionUse(); |
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。取消注释。
|
|
|
|
|
|
|
|
// GUICoreUtils.setEnabled(limitPane, !customFloatPositionButton.isSelected());
|
|
|
|
|
|
|
|
// limitPane.checkMaxProPortionUse();
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。删除下面方法。
|
|
|
|
|
|
|
|
//检查最大显示占比是否可用
|
|
|
|
|
|
|
|
private void checkMaxProPortionUse() { |
|
|
|
|
|
|
|
maxProportion.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); |
|
|
|
|
|
|
|
maxProportionPane.setVisible(limitSize.getSelectedIndex() == 0 && limitSize.isEnabled()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void checkBoxUse() { |
|
|
|
protected void checkBoxUse() { |
|
|
@ -287,7 +327,11 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
legend.setPosition(-1); |
|
|
|
legend.setPosition(-1); |
|
|
|
} |
|
|
|
} |
|
|
|
legend.setFloating(customFloatPositionButton.isSelected()); |
|
|
|
legend.setFloating(customFloatPositionButton.isSelected()); |
|
|
|
legend.setLimitAttribute(limitPane.updateBean()); |
|
|
|
//区域显示策略 恢复用注释。下面2行删除。
|
|
|
|
|
|
|
|
legend.setLimitSize(limitSize.getSelectedIndex() == 0); |
|
|
|
|
|
|
|
legend.setMaxHeight(maxProportion.getValue()); |
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。取消注释。
|
|
|
|
|
|
|
|
//legend.setLimitAttribute(limitPane.updateBean());
|
|
|
|
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); |
|
|
|
legend.setFloatPercentX(customFloatPositionPane.getFloatPosition_x()); |
|
|
|
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); |
|
|
|
legend.setFloatPercentY(customFloatPositionPane.getFloatPosition_y()); |
|
|
|
if(highlightButton != null && highlightButton.getSelectedItem() != null){ |
|
|
|
if(highlightButton != null && highlightButton.getSelectedItem() != null){ |
|
|
@ -307,7 +351,11 @@ public class VanChartPlotLegendPane extends BasicPane { |
|
|
|
customFloatPositionButton.setSelected(legend.isFloating()); |
|
|
|
customFloatPositionButton.setSelected(legend.isFloating()); |
|
|
|
customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX()); |
|
|
|
customFloatPositionPane.setFloatPosition_x(legend.getFloatPercentX()); |
|
|
|
customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); |
|
|
|
customFloatPositionPane.setFloatPosition_y(legend.getFloatPercentY()); |
|
|
|
limitPane.populateBean(legend.getLimitAttribute()); |
|
|
|
//区域显示策略 恢复用注释。下面2行删除。
|
|
|
|
|
|
|
|
limitSize.setSelectedIndex(legend.isLimitSize() ? 0 : 1); |
|
|
|
|
|
|
|
maxProportion.setValue(legend.getMaxHeight()); |
|
|
|
|
|
|
|
//区域显示策略 恢复用注释。取消注释。
|
|
|
|
|
|
|
|
//limitPane.populateBean(legend.getLimitAttribute());
|
|
|
|
if(highlightButton != null){ |
|
|
|
if(highlightButton != null){ |
|
|
|
highlightButton.setSelectedItem(legend.isHighlight()); |
|
|
|
highlightButton.setSelectedItem(legend.isHighlight()); |
|
|
|
} |
|
|
|
} |
|
|
|