|
|
|
@ -54,11 +54,13 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = -5717246802333308973L; |
|
|
|
|
private static final double ROTATION_MAX = 90.0; |
|
|
|
|
protected UIButtonGroup showTitle; |
|
|
|
|
protected TinyFormulaPane titleContent; |
|
|
|
|
protected UIButtonGroup<Integer> titleAlignPane; |
|
|
|
|
protected UIToggleButton titleUseHtml; |
|
|
|
|
protected ChartTextAttrPane titleTextAttrPane; |
|
|
|
|
protected UINumberDragPane titleTextRotation; |
|
|
|
|
protected JPanel titlePane; |
|
|
|
|
|
|
|
|
|
protected UIButtonGroup showLabel; |
|
|
|
|
protected ChartTextAttrPane labelTextAttrPane; |
|
|
|
@ -108,6 +110,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
public void setParentPane(VanChartStylePane parent) { |
|
|
|
|
htmlLabelPane.setParent(parent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void reLayoutPane(boolean isXAxis) { |
|
|
|
|
this.removeAll(); |
|
|
|
|
this.add(createContentPane(isXAxis), BorderLayout.CENTER); |
|
|
|
@ -135,6 +138,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected JPanel createTitlePane(double[] row, double[] col, boolean isXAxis) { |
|
|
|
|
showTitle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); |
|
|
|
|
titleAlignPane = isXAxis ? getXAxisTitleAlignPane() : getYAxisTitleAlignPane(); |
|
|
|
|
titleAlignPane.setSelectedItem(Constants.CENTER); |
|
|
|
|
titleContent = new TinyFormulaPane(); |
|
|
|
@ -158,9 +162,21 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
UIComponentUtils.wrapWithBorderLayoutPane(titleTextRotation) |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
titlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); |
|
|
|
|
|
|
|
|
|
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); |
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, panel); |
|
|
|
|
JPanel showTitlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Title"), showTitle); |
|
|
|
|
showTitle.addActionListener(new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
checkTitlePane(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
JPanel jPanel = new JPanel(new BorderLayout()); |
|
|
|
|
jPanel.add(showTitlePane, BorderLayout.NORTH); |
|
|
|
|
jPanel.add(titlePane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private UIButtonGroup<Integer> getXAxisTitleAlignPane() { |
|
|
|
@ -171,6 +187,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
return new UIButtonGroup<Integer>(alignmentIconArray, alignment); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private UIButtonGroup<Integer> getYAxisTitleAlignPane() { |
|
|
|
|
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"), |
|
|
|
@ -462,6 +479,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
protected void checkAllUse() { |
|
|
|
|
checkCardPane(); |
|
|
|
|
checkLabelPane(); |
|
|
|
|
checkTitlePane(); |
|
|
|
|
//区域显示策略 恢复用注释。删除下面一行。
|
|
|
|
|
checkMaxProPortionUse(); |
|
|
|
|
|
|
|
|
@ -505,6 +523,15 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void checkTitlePane() { |
|
|
|
|
if (showTitle != null) { |
|
|
|
|
boolean enabled = showTitle.getSelectedIndex() == 0; |
|
|
|
|
if (titlePane != null) { |
|
|
|
|
titlePane.setVisible(enabled); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void checkLabelGapAndStylePane() { |
|
|
|
|
if (overlapHandleTypeGroup != null && labelGapStylePane != null) { |
|
|
|
|
boolean visible = overlapHandleTypeGroup.getSelectedItem() == OverlapHandleType.INTERVAL; |
|
|
|
@ -528,6 +555,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否是指定类型 |
|
|
|
|
* |
|
|
|
|
* @param ob 对象 |
|
|
|
|
* @return 是否是指定类型 |
|
|
|
|
*/ |
|
|
|
@ -537,6 +565,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* title应该是一个属性,不只是对话框的标题时用到,与其他组件结合时,也会用得到 |
|
|
|
|
* |
|
|
|
|
* @return 绥化狂标题 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
@ -550,6 +579,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
public void reset() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void populateBean(VanChartAxis axis) { |
|
|
|
|
populateTitle(axis); |
|
|
|
@ -569,6 +599,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
//标题
|
|
|
|
|
private void populateTitle(VanChartAxis axis) { |
|
|
|
|
if (showTitle != null) { |
|
|
|
|
showTitle.setSelectedIndex(axis.isShowAxisTitle() ? 0 : 1); |
|
|
|
|
} |
|
|
|
|
Title axisTitle = axis.getTitle(); |
|
|
|
|
if (axisTitle != null) { |
|
|
|
|
if (axisTitle.getTextObject() instanceof BaseFormula && titleContent != null) { |
|
|
|
@ -690,8 +723,12 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
updateFormat(axis); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//标题
|
|
|
|
|
private void updateTitle(VanChartAxis axis) { |
|
|
|
|
if (showTitle != null) { |
|
|
|
|
axis.setShowAxisTitle(showTitle.getSelectedIndex() == 0); |
|
|
|
|
} |
|
|
|
|
Title axisTitle = axis.getTitle(); |
|
|
|
|
if (axisTitle == null) { |
|
|
|
|
axisTitle = new Title(); |
|
|
|
@ -810,6 +847,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* X坐标轴不同类型切换,new一个新的 |
|
|
|
|
* |
|
|
|
|
* @param axisName 坐标轴名称 |
|
|
|
|
* @return 新的axis |
|
|
|
|
*/ |
|
|
|
|