|
|
@ -7,12 +7,11 @@ import com.fr.design.dialog.BasicPane; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
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.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
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.gui.style.ChartTextAttrPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; |
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
import com.fr.design.style.color.ColorSelectBox; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot; |
|
|
|
import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot; |
|
|
|
import com.fr.plugin.chart.base.AttrLabelDetail; |
|
|
|
import com.fr.plugin.chart.base.AttrLabelDetail; |
|
|
@ -20,6 +19,8 @@ import com.fr.plugin.chart.base.AttrTooltipContent; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.van.chart.designer.PlotFactory; |
|
|
|
import com.fr.van.chart.designer.PlotFactory; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
|
|
|
|
|
|
|
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; |
|
|
|
|
|
|
|
import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; |
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
import com.fr.van.chart.designer.style.VanChartStylePane; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
@ -28,9 +29,6 @@ import javax.swing.event.ChangeEvent; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Dimension; |
|
|
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by Mitisky on 15/12/7. |
|
|
|
* Created by Mitisky on 15/12/7. |
|
|
@ -42,9 +40,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
private UIButtonGroup<Integer> position; |
|
|
|
private UIButtonGroup<Integer> position; |
|
|
|
private UIButtonGroup<Boolean> autoAdjust; |
|
|
|
private UIButtonGroup<Boolean> autoAdjust; |
|
|
|
|
|
|
|
private UIButtonGroup<Integer> orientation; |
|
|
|
private UIToggleButton tractionLine; |
|
|
|
private UIToggleButton tractionLine; |
|
|
|
|
|
|
|
|
|
|
|
private ColorSelectBox backgroundColor; |
|
|
|
private ColorSelectBox backgroundColor; |
|
|
|
|
|
|
|
private VanChartBorderWithShapePane borderPane; |
|
|
|
|
|
|
|
private VanChartBackgroundWithOutImagePane backgroundPane; |
|
|
|
|
|
|
|
|
|
|
|
private JPanel tractionLinePane; |
|
|
|
private JPanel tractionLinePane; |
|
|
|
private JPanel positionPane; |
|
|
|
private JPanel positionPane; |
|
|
@ -100,15 +101,48 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { |
|
|
|
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { |
|
|
|
if(hasLabelPosition(plot)){ |
|
|
|
if(hasLabelPosition(plot)){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 仅饼图、柱形图、条形图、折线图、面积图含有边框和背景
|
|
|
|
|
|
|
|
if (hasBorderAndBackground(plot)) { |
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{dataLabelContentPane,null}, |
|
|
|
|
|
|
|
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, |
|
|
|
|
|
|
|
new Component[]{createLabelBorderPane(), null}, |
|
|
|
|
|
|
|
new Component[]{createLabelBackgroundPane(), null} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{dataLabelContentPane,null}, |
|
|
|
new Component[]{dataLabelContentPane,null}, |
|
|
|
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} |
|
|
|
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
return new Component[][]{ |
|
|
|
new Component[]{dataLabelContentPane,null} |
|
|
|
new Component[]{dataLabelContentPane,null} |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelBorderPane() { |
|
|
|
|
|
|
|
borderPane = new VanChartBorderWithShapePane(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelBackgroundPane() { |
|
|
|
|
|
|
|
backgroundPane = new VanChartBackgroundWithOutImagePane(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected Component[][] getPaneComponents() { |
|
|
|
|
|
|
|
return new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, |
|
|
|
|
|
|
|
new Component[]{null, centerPane}, |
|
|
|
|
|
|
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected double[] getLabelStyleRowSize(double p) { |
|
|
|
protected double[] getLabelStyleRowSize(double p) { |
|
|
@ -123,6 +157,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
return plot instanceof VanChartLabelPositionPlot; |
|
|
|
return plot instanceof VanChartLabelPositionPlot; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean hasBorderAndBackground(Plot plot) { |
|
|
|
|
|
|
|
return PlotFactory.hasBorderAndBackgroundPlotLabel(plot); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { |
|
|
|
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); |
|
|
|
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); |
|
|
|
} |
|
|
|
} |
|
|
@ -157,8 +195,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
positionPane = new JPanel(); |
|
|
|
positionPane = new JPanel(); |
|
|
|
checkPositionPane(title); |
|
|
|
checkPositionPane(title); |
|
|
|
panel.add(positionPane, BorderLayout.CENTER); |
|
|
|
panel.add(positionPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasLabelOrientationPane()) { |
|
|
|
|
|
|
|
panel.add(createLabelOrientationPane(), BorderLayout.CENTER); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (plot.isSupportLeadLine()) { |
|
|
|
if (plot.isSupportLeadLine()) { |
|
|
|
tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); |
|
|
|
tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); |
|
|
@ -168,7 +209,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { |
|
|
|
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { |
|
|
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); |
|
|
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); |
|
|
|
} |
|
|
|
} |
|
|
|
return panel; |
|
|
|
|
|
|
|
|
|
|
|
return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout")); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLabelLayoutPane(JPanel panel, String title) { |
|
|
|
|
|
|
|
return createTableLayoutPaneWithTitle(title, panel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected boolean hasLabelOrientationPane() { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel createLabelOrientationPane() { |
|
|
|
|
|
|
|
orientation = new UIButtonGroup<>(new String[]{ |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void checkPositionPane(String title) { |
|
|
|
protected void checkPositionPane(String title) { |
|
|
@ -205,13 +264,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ |
|
|
|
protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ |
|
|
|
JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); |
|
|
|
return TableLayoutHelper.createTableLayoutPane(comps, row, col); |
|
|
|
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initPositionListener() { |
|
|
|
protected void initPositionListener() { |
|
|
|
position.addChangeListener(new ChangeListener() { |
|
|
|
position.addChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -267,16 +323,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
if(position != null){ |
|
|
|
if(position != null){ |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
position.setSelectedItem(detail.getPosition()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(orientation != null){ |
|
|
|
|
|
|
|
orientation.setSelectedIndex(detail.isHorizontal() ? 0 : 1); |
|
|
|
|
|
|
|
} |
|
|
|
if(tractionLine != null){ |
|
|
|
if(tractionLine != null){ |
|
|
|
tractionLine.setSelected(detail.isShowGuidLine()); |
|
|
|
tractionLine.setSelected(detail.isShowGuidLine()); |
|
|
|
} |
|
|
|
} |
|
|
|
if(autoAdjust != null){ |
|
|
|
if(autoAdjust != null){ |
|
|
|
autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1); |
|
|
|
autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(backgroundColor != null){ |
|
|
|
if(backgroundColor != null){ |
|
|
|
backgroundColor.setSelectObject(detail.getBackgroundColor()); |
|
|
|
backgroundColor.setSelectObject(detail.getBackgroundColor()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(borderPane != null){ |
|
|
|
|
|
|
|
borderPane.populate(detail.getBorder()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(backgroundPane != null){ |
|
|
|
|
|
|
|
backgroundPane.populate(detail.getBackground()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
checkAllUse(); |
|
|
|
checkAllUse(); |
|
|
|
} |
|
|
|
} |
|
|
@ -294,12 +359,21 @@ public class VanChartPlotLabelDetailPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); |
|
|
|
detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(orientation != null){ |
|
|
|
|
|
|
|
detail.setHorizontal(orientation.getSelectedIndex() == 0); |
|
|
|
|
|
|
|
} |
|
|
|
if(tractionLine != null){ |
|
|
|
if(tractionLine != null){ |
|
|
|
detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); |
|
|
|
detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); |
|
|
|
} |
|
|
|
} |
|
|
|
if(backgroundColor != null){ |
|
|
|
if(backgroundColor != null){ |
|
|
|
detail.setBackgroundColor(backgroundColor.getSelectObject()); |
|
|
|
detail.setBackgroundColor(backgroundColor.getSelectObject()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(borderPane != null){ |
|
|
|
|
|
|
|
borderPane.update(detail.getBorder()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(backgroundPane != null){ |
|
|
|
|
|
|
|
backgroundPane.update(detail.getBackground()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|