Browse Source

CHART-14346 && CHART-14180 悬浮图表配置组合图不能选择单元格数据源 && 轴标题隐藏优化

feature/big-screen
白岳 4 years ago
parent
commit
f026765d25
  1. 1
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java
  2. 12
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java
  3. 42
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

1
designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomDataPane.java

@ -27,6 +27,7 @@ public class VanChartCustomDataPane extends ChartDataPane {
}
contentsTabPane = new VanChartCustomPlotDataContentsTabPane((VanChartCustomPlot)chart.getPlot(), VanChartCustomDataPane.this, listener);
contentsTabPane.setSupportCellData(isSupportCellData());
content.add(contentsTabPane, BorderLayout.CENTER);
return content;

12
designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java

@ -22,10 +22,21 @@ import java.util.Map;
* Created by Fangjie on 2016/4/29.
*/
public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTabPane<VanChartCustomPlot, ChartCollection> {
private boolean supportCellData = true;
public VanChartCustomPlotDataContentsTabPane(VanChartCustomPlot plot, VanChartCustomDataPane parent, AttributeChangeListener listener) {
super(plot, parent, listener);
}
public boolean isSupportCellData() {
return supportCellData;
}
public void setSupportCellData(boolean supportCellData) {
this.supportCellData = supportCellData;
}
@Override
protected void initTabTitle() {
@ -60,6 +71,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
for (int i = 0; i < customPlotList.size(); i++){
//根据不同的plot创建不同的数据配置界面
ChartDataPane contentPane = new VanChartDataPane(listener);
contentPane.setSupportCellData(supportCellData);
paneList.add(contentPane);
}

42
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -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
*/

Loading…
Cancel
Save