|
|
|
@ -17,31 +17,26 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
|
|
|
|
|
import com.fr.design.gui.ibutton.UIToggleButton; |
|
|
|
|
import com.fr.design.gui.icombobox.LineComboBox; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
import com.fr.design.gui.style.FormatPane; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
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.ChartTextAttrPane; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; |
|
|
|
|
import com.fr.design.mainframe.chart.gui.style.ColorSelectBoxWithThemeStyle; |
|
|
|
|
import com.fr.design.mainframe.chart.mode.ChartEditContext; |
|
|
|
|
import com.fr.design.utils.gui.UIComponentUtils; |
|
|
|
|
import com.fr.design.widget.FRWidgetFactory; |
|
|
|
|
import com.fr.plugin.chart.VanChartAxisCategoryStyle; |
|
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartAxis; |
|
|
|
|
import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle; |
|
|
|
|
import com.fr.plugin.chart.base.OverlapHandleType; |
|
|
|
|
import com.fr.plugin.chart.base.VanChartConstants; |
|
|
|
|
import com.fr.plugin.chart.type.AxisTickLineType; |
|
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
import com.fr.stable.CoreConstants; |
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; |
|
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
|
import com.fr.van.chart.designer.style.axis.component.AxisLabelDisplayComboBox; |
|
|
|
|
import com.fr.van.chart.designer.style.axis.component.VanChartCategoryStylePaneWithCheckBox; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
@ -79,27 +74,17 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
protected UIButtonGroup showLabel; |
|
|
|
|
protected UIButtonGroup showLogic; |
|
|
|
|
protected ChartTextAttrPane labelTextAttrPane; |
|
|
|
|
protected UINumberDragPane labelTextRotation; |
|
|
|
|
|
|
|
|
|
private AxisLabelDisplayComboBox labelDisplayComboBox; |
|
|
|
|
|
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。下面6行删除。
|
|
|
|
|
protected UITextField labelGapValue; |
|
|
|
|
|
|
|
|
|
private UIButtonGroup<OverlapHandleType> overlapHandleTypeGroup; |
|
|
|
|
protected UIButtonGroup<Integer> labelGapStyle; |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
//protected UISpinner labelGapValue;
|
|
|
|
|
|
|
|
|
|
protected JPanel labelPanel; |
|
|
|
|
private JPanel labelStylePane; |
|
|
|
|
protected JPanel labelContentPane; |
|
|
|
|
private VanChartAxisStyleSettingPane labelPane; |
|
|
|
|
private JPanel showLogicPane; |
|
|
|
|
private JPanel labelGapPane; |
|
|
|
|
private JPanel labelGapStylePane; |
|
|
|
|
private JPanel labelGapValuePane; |
|
|
|
|
private JPanel labelDisplayPane; |
|
|
|
|
private JPanel labelStylePane; |
|
|
|
|
private JPanel categoryStylePane; |
|
|
|
|
private VanChartAxisStyleSettingPane wholeDisplayLabelPanel; |
|
|
|
|
private List<VanChartCategoryStylePaneWithCheckBox> categoryStyles = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
protected LineComboBox axisLineStyle; |
|
|
|
@ -234,17 +219,18 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
protected JPanel createLabelPane(double[] row, double[] col) { |
|
|
|
|
initLabelComponents(); |
|
|
|
|
|
|
|
|
|
labelGapPane = createLabelGapPane(row, col); |
|
|
|
|
labelPanel = createLabelDetailPanel(); |
|
|
|
|
labelPane = new VanChartAxisStyleSettingPane(showLabelDisplay(), getChartTextAttrPane()); |
|
|
|
|
wholeDisplayLabelPanel = new VanChartAxisStyleSettingPane(showLabelDisplay(), getChartTextAttrPane()); |
|
|
|
|
wholeDisplayLabelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); |
|
|
|
|
|
|
|
|
|
addComponentsListener(); |
|
|
|
|
|
|
|
|
|
JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); |
|
|
|
|
JPanel showLogicPane = createShowLogicPane(); |
|
|
|
|
JPanel labelContentPane = createLabelContentPane(); |
|
|
|
|
|
|
|
|
|
JPanel labelPane = new JPanel(new BorderLayout()); |
|
|
|
|
labelPane.add(showLabelPane, BorderLayout.NORTH); |
|
|
|
|
labelPane.add(showLogicPane, BorderLayout.CENTER); |
|
|
|
|
labelPane.add(labelContentPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane); |
|
|
|
|
} |
|
|
|
@ -253,15 +239,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); |
|
|
|
|
showLogic = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Style_Whole_Display"), Toolkit.i18nText("Fine-Design_Chart_Axis_Style_Layer_Display")}); |
|
|
|
|
initButtonGroupListener(); |
|
|
|
|
|
|
|
|
|
labelDisplayComboBox = new AxisLabelDisplayComboBox(); |
|
|
|
|
labelDisplayPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show"), labelDisplayComboBox, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); |
|
|
|
|
labelDisplayPane.setVisible(showLabelDisplay()); |
|
|
|
|
|
|
|
|
|
labelTextAttrPane = getChartTextAttrPane(); |
|
|
|
|
labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); |
|
|
|
|
labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); |
|
|
|
|
labelGapValue = new UITextField(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initButtonGroupListener() { |
|
|
|
@ -288,14 +265,18 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private JPanel createShowLogicPane() { |
|
|
|
|
private JPanel createLabelContentPane() { |
|
|
|
|
labelContentPane = new JPanel(new BorderLayout()); |
|
|
|
|
showLogicPane = new JPanel(new BorderLayout()); |
|
|
|
|
labelStylePane = new JPanel(new CardLayout()); |
|
|
|
|
labelStylePane.add(labelPanel, WHOLE_DISPLAY); |
|
|
|
|
labelStylePane.add(wholeDisplayLabelPanel, WHOLE_DISPLAY); |
|
|
|
|
labelStylePane.add(createCategoryStylePane(), LAYER_DISPLAY); |
|
|
|
|
showLogicPane.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show_Logic"), showLogic), BorderLayout.NORTH); |
|
|
|
|
showLogicPane.add(labelStylePane, BorderLayout.CENTER); |
|
|
|
|
return showLogicPane; |
|
|
|
|
showLogicPane.setVisible(false); |
|
|
|
|
labelContentPane.add(labelPane, BorderLayout.NORTH); |
|
|
|
|
labelContentPane.add(showLogicPane, BorderLayout.CENTER); |
|
|
|
|
return labelContentPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -309,37 +290,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
return categoryStylePane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createLabelGapPane(double[] row, double[] col) { |
|
|
|
|
Component[][] gapComponents = new Component[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{ |
|
|
|
|
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_TextRotation")), |
|
|
|
|
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation) |
|
|
|
|
}, |
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
JPanel gapDetailPane = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); |
|
|
|
|
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); |
|
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout()); |
|
|
|
|
panel.add(gapDetailPane, BorderLayout.CENTER); |
|
|
|
|
panel.add(labelGapValuePane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createLabelDetailPanel() { |
|
|
|
|
JPanel panel = new JPanel(new BorderLayout()); |
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); |
|
|
|
|
|
|
|
|
|
panel.add(labelDisplayPane, BorderLayout.NORTH); |
|
|
|
|
panel.add(labelTextAttrPane, BorderLayout.CENTER); |
|
|
|
|
panel.add(labelGapPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void addComponentsListener() { |
|
|
|
|
// 显示/隐藏
|
|
|
|
|
showLabel.addActionListener(new ActionListener() { |
|
|
|
@ -348,123 +298,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
checkLabelPane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 间隔/缩略/换行
|
|
|
|
|
labelDisplayComboBox.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
checkLabelGapPane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// 自动/固定
|
|
|
|
|
labelGapStyle.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
checkLabelGapValuePane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// protected JPanel createLabelPane(double[] row, double[] col){
|
|
|
|
|
// double p = TableLayout.PREFERRED;
|
|
|
|
|
// showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")});
|
|
|
|
|
// labelTextAttrPane = getChartTextAttrPane();
|
|
|
|
|
//
|
|
|
|
|
// JPanel rotationPane = createLabelRotationPane(col);
|
|
|
|
|
// JPanel overlapPane = createLabelOverlapPane();
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// Component[][] components = new Component[][]{
|
|
|
|
|
// new Component[]{labelTextAttrPane, null},
|
|
|
|
|
// new Component[]{rotationPane, null},
|
|
|
|
|
// new Component[]{overlapPane, null},
|
|
|
|
|
// };
|
|
|
|
|
//
|
|
|
|
|
// JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"),showLabel);
|
|
|
|
|
// labelPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, col);
|
|
|
|
|
// labelPanel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
|
|
|
|
|
// showLabel.addActionListener(new ActionListener() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void actionPerformed(ActionEvent e) {
|
|
|
|
|
// checkLabelPane();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// 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);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelRotationPane(double[] col) { |
|
|
|
|
labelTextRotation = new UINumberDragPane(-ROTATION_MAX, ROTATION_MAX); |
|
|
|
|
|
|
|
|
|
Component[][] gapComponents = new Component[][]{ |
|
|
|
|
new Component[]{ |
|
|
|
|
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_TextRotation")), |
|
|
|
|
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation) |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, new double[]{TableLayout.PREFERRED}, col); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createLabelOverlapPane() { |
|
|
|
|
|
|
|
|
|
labelGapStyle = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); |
|
|
|
|
labelGapStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_Interval"), labelGapStyle, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); |
|
|
|
|
|
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
//labelGapValue = new UISpinner(0, Integer.MAX_VALUE, 1, 1);
|
|
|
|
|
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(StringUtils.EMPTY, labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); |
|
|
|
|
|
|
|
|
|
JPanel panel = new JPanel(new BorderLayout(0, 0)); |
|
|
|
|
addOverlapGroupButton(panel); |
|
|
|
|
panel.add(labelGapStylePane, BorderLayout.CENTER); |
|
|
|
|
panel.add(labelGapValuePane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
labelGapStyle.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
checkLabelGapValuePane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void addOverlapGroupButton(JPanel panel) { |
|
|
|
|
overlapHandleTypeGroup = new UIButtonGroup<OverlapHandleType>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Label_OverlapAbbreviate"), Toolkit.i18nText("Fine-Design_Chart_Label_OverlapInterval")}, |
|
|
|
|
new OverlapHandleType[]{OverlapHandleType.ABBREVIATE, OverlapHandleType.INTERVAL}); |
|
|
|
|
JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Label_WhenOverlap"), overlapHandleTypeGroup, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); |
|
|
|
|
|
|
|
|
|
panel.add(north, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
overlapHandleTypeGroup.addChangeListener(new ChangeListener() { |
|
|
|
|
@Override |
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
checkLabelGapAndStylePane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected ChartTextAttrPane getChartTextAttrPane() { |
|
|
|
|
return ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() { |
|
|
|
|
protected double getEdithAreaWidth() { |
|
|
|
|
return TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; |
|
|
|
|
} |
|
|
|
|
} : new ChartTextAttrPane() { |
|
|
|
|
@Override |
|
|
|
|
protected JPanel getContentPane(JPanel buttonPane) { |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; |
|
|
|
|
double[] columnSize = {f, e}; |
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
return VanChartAxisPaneHelper.createAxisTextAttrPane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createLineStylePane(double[] row, double[] col) { |
|
|
|
@ -605,7 +442,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
protected void checkAllUse() { |
|
|
|
|
checkCardPane(); |
|
|
|
|
checkLabelPane(); |
|
|
|
|
checkLabelGapPane(); |
|
|
|
|
checkTitlePane(); |
|
|
|
|
//区域显示策略 恢复用注释。删除下面一行。
|
|
|
|
|
checkMaxProPortionUse(); |
|
|
|
@ -638,14 +474,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
protected void checkLabelPane() { |
|
|
|
|
if (showLabel != null) { |
|
|
|
|
boolean enabled = showLabel.getSelectedIndex() == 0; |
|
|
|
|
if (showLogicPane != null) { |
|
|
|
|
showLogicPane.setVisible(enabled); |
|
|
|
|
} |
|
|
|
|
if (enabled) { |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。下面1行删除。
|
|
|
|
|
checkLabelGapValuePane(); |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
//checkLabelGapAndStylePane();
|
|
|
|
|
if (labelContentPane != null) { |
|
|
|
|
labelContentPane.setVisible(enabled); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -656,39 +486,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkLabelGapAndStylePane() { |
|
|
|
|
if (overlapHandleTypeGroup != null && labelGapStylePane != null) { |
|
|
|
|
boolean visible = overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL; |
|
|
|
|
|
|
|
|
|
labelGapStylePane.setVisible(visible); |
|
|
|
|
} |
|
|
|
|
checkLabelGapValuePane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkLabelGapPane() { |
|
|
|
|
if (labelGapPane != null) { |
|
|
|
|
boolean visible = true; |
|
|
|
|
|
|
|
|
|
if (showLabelDisplay() && labelDisplayPane != null && labelDisplayComboBox != null) { |
|
|
|
|
visible = labelDisplayComboBox.getSelectedIndex() == 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
labelGapPane.setVisible(visible); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkLabelGapValuePane() { |
|
|
|
|
if (labelGapValuePane != null && labelGapStyle != null) { |
|
|
|
|
boolean visible = labelGapStyle.getSelectedIndex() == 1; |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
// if (overlapHandleTypeGroup != null) {
|
|
|
|
|
// visible = visible && overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL;
|
|
|
|
|
// }
|
|
|
|
|
labelGapValuePane.setVisible(visible); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否是指定类型 |
|
|
|
|
* |
|
|
|
@ -767,7 +564,18 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
showLabel.setSelectedIndex(axis.isShowAxisLabel() ? 0 : 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
labelPane.populateBean(getAxisLabelStyle(axis)); |
|
|
|
|
populateShowLogicPane(axis); |
|
|
|
|
switchLabelPane(axis); |
|
|
|
|
labelContentPane.validate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 切换显示是单分类样式设置面板还是多分类样式设置面板 |
|
|
|
|
*/ |
|
|
|
|
private void switchLabelPane(VanChartAxis axis) { |
|
|
|
|
labelPane.setVisible(!axis.isMultiCategory()); |
|
|
|
|
showLogicPane.setVisible(axis.isMultiCategory()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void populateShowLogicPane(VanChartAxis axis) { |
|
|
|
@ -784,29 +592,16 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
* populate整体显示那个card面板 |
|
|
|
|
*/ |
|
|
|
|
private void populateWholeDisplayPane(VanChartAxis axis) { |
|
|
|
|
TextAttr labelTextAttr = axis.getTextAttr(); |
|
|
|
|
if (labelTextAttrPane != null) { |
|
|
|
|
labelTextAttrPane.populate(labelTextAttr); |
|
|
|
|
} |
|
|
|
|
if (labelTextRotation != null) { |
|
|
|
|
labelTextRotation.populateBean((double) labelTextAttr.getRotation()); |
|
|
|
|
} |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
// if (overlapHandleTypeGroup != null) {
|
|
|
|
|
// overlapHandleTypeGroup.setSelectedItem(axis.getOverlapHandleType());
|
|
|
|
|
// }
|
|
|
|
|
if (labelDisplayComboBox != null) { |
|
|
|
|
labelDisplayComboBox.populateBean(axis.getLabelDisplay()); |
|
|
|
|
} |
|
|
|
|
if (labelGapStyle != null) { |
|
|
|
|
labelGapStyle.setSelectedIndex(axis.isAutoLabelGap() ? 0 : 1); |
|
|
|
|
} |
|
|
|
|
if (labelGapValue != null) { |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。下面1行删除。
|
|
|
|
|
labelGapValue.setText(axis.getLabelNumber().getContent()); |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
//labelGapValue.setValue(axis.getIntervalNumber());
|
|
|
|
|
} |
|
|
|
|
wholeDisplayLabelPanel.populateBean(getAxisLabelStyle(axis)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private VanChartAxisLabelStyle getAxisLabelStyle(VanChartAxis axis) { |
|
|
|
|
VanChartAxisLabelStyle style = new VanChartAxisLabelStyle(); |
|
|
|
|
style.setLabelDisplay(axis.getLabelDisplay()); |
|
|
|
|
style.setTextAttr(axis.getTextAttr()); |
|
|
|
|
style.setAutoLabelGap(axis.isAutoLabelGap()); |
|
|
|
|
style.setLabelIntervalNumber(axis.getLabelNumber()); |
|
|
|
|
return style; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -871,21 +666,21 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
private void populateCategoryStyles(VanChartAxis axis, String uuid, int index) { |
|
|
|
|
VanChartCategoryStylePaneWithCheckBox pane = new VanChartCategoryStylePaneWithCheckBox(parent, this, Toolkit.i18nText("Fine-Design_Chart_Style_Category") + (index + 1)); |
|
|
|
|
VanChartAxisCategoryStyle style = populateAxisCategoryStyles(axis, uuid, index); |
|
|
|
|
VanChartAxisLabelStyle style = populateAxisCategoryStyles(axis, uuid, index); |
|
|
|
|
pane.populate(style, uuid); |
|
|
|
|
categoryStyles.add(pane); |
|
|
|
|
categoryStylePane.add(createCateLableStylePanel(), BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private VanChartAxisCategoryStyle populateAxisCategoryStyles(VanChartAxis axis, String uuid, int index) { |
|
|
|
|
VanChartAxisCategoryStyle style; |
|
|
|
|
private VanChartAxisLabelStyle populateAxisCategoryStyles(VanChartAxis axis, String uuid, int index) { |
|
|
|
|
VanChartAxisLabelStyle style; |
|
|
|
|
if (axis.getCategoryStyle(uuid) != null) { |
|
|
|
|
style = axis.getCategoryStyle(uuid); |
|
|
|
|
} else { |
|
|
|
|
style = axis.getCategoryStyleByIndex(index); |
|
|
|
|
if (style == null) { |
|
|
|
|
style = new VanChartAxisCategoryStyle(); |
|
|
|
|
style = new VanChartAxisLabelStyle(); |
|
|
|
|
} |
|
|
|
|
axis.addCategoryStyle(uuid, style); |
|
|
|
|
} |
|
|
|
@ -1041,7 +836,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
if (showLabel != null) { |
|
|
|
|
axis.setShowAxisLabel(showLabel.getSelectedIndex() == 0); |
|
|
|
|
} |
|
|
|
|
updateShowLogicPane(axis); |
|
|
|
|
if (!axis.isMultiCategory()) { |
|
|
|
|
axis.setLabelDisplayMode(VanChartAxis.WHOLE_DISPLAY); |
|
|
|
|
updateLabelPaneStyle(axis, labelPane); |
|
|
|
|
} else { |
|
|
|
|
updateShowLogicPane(axis); |
|
|
|
|
} |
|
|
|
|
switchLabelPane(axis); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateShowLogicPane(VanChartAxis axis) { |
|
|
|
@ -1057,33 +858,15 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
* update整体显示那个card面板 |
|
|
|
|
*/ |
|
|
|
|
private void updateWholeDisplayPane(VanChartAxis axis) { |
|
|
|
|
TextAttr labelTextAttr = axis.getTextAttr(); |
|
|
|
|
if (labelTextAttrPane != null) { |
|
|
|
|
labelTextAttrPane.update(labelTextAttr); |
|
|
|
|
} |
|
|
|
|
if (labelTextRotation != null) { |
|
|
|
|
labelTextAttr.setRotation(labelTextRotation.updateBean().intValue()); |
|
|
|
|
} |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
// if (overlapHandleTypeGroup != null) {
|
|
|
|
|
// axis.setOverlapHandleType(overlapHandleTypeGroup.getSelectedItem());
|
|
|
|
|
// }
|
|
|
|
|
if (labelDisplayComboBox != null) { |
|
|
|
|
axis.setLabelDisplay(labelDisplayComboBox.updateBean()); |
|
|
|
|
} |
|
|
|
|
if (labelGapStyle != null) { |
|
|
|
|
axis.setAutoLabelGap(labelGapStyle.getSelectedIndex() == 0); |
|
|
|
|
} |
|
|
|
|
if (labelGapValue != null) { |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。下面5行删除。
|
|
|
|
|
if (axis.isAutoLabelGap()) { |
|
|
|
|
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build("1")); |
|
|
|
|
} else { |
|
|
|
|
axis.setLabelIntervalNumber(BaseFormula.createFormulaBuilder().build(labelGapValue.getText())); |
|
|
|
|
} |
|
|
|
|
//轴标签缩略间隔显示 恢复用注释。取消注释。
|
|
|
|
|
//axis.setIntervalNumber((int) labelGapValue.getValue());
|
|
|
|
|
} |
|
|
|
|
updateLabelPaneStyle(axis, wholeDisplayLabelPanel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateLabelPaneStyle(VanChartAxis axis, VanChartAxisStyleSettingPane pane) { |
|
|
|
|
VanChartAxisLabelStyle style = pane.updateBean(); |
|
|
|
|
axis.setLabelDisplay(style.getLabelDisplay()); |
|
|
|
|
axis.setTextAttr(style.getTextAttr()); |
|
|
|
|
axis.setAutoLabelGap(style.isAutoLabelGap()); |
|
|
|
|
axis.setLabelIntervalNumber(style.getLabelIntervalNumber()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -1093,8 +876,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
*/ |
|
|
|
|
private void updateLayerDisplayPane(VanChartAxis axis) { |
|
|
|
|
for (VanChartCategoryStylePaneWithCheckBox categoryStyle : categoryStyles) { |
|
|
|
|
Map<String, VanChartAxisCategoryStyle> styleMap = categoryStyle.update(); |
|
|
|
|
for (Map.Entry<String, VanChartAxisCategoryStyle> entry : styleMap.entrySet()) { |
|
|
|
|
Map<String, VanChartAxisLabelStyle> styleMap = categoryStyle.update(); |
|
|
|
|
for (Map.Entry<String, VanChartAxisLabelStyle> entry : styleMap.entrySet()) { |
|
|
|
|
axis.addCategoryStyle(entry.getKey(), entry.getValue()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|