Browse Source

Pull request #3280: CHART-17805 饼图标签面板美化

Merge in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '5ac5cfbba9dab5932733999aa2722cbe09018aee':
  CHART-17805 饼图面板美化
feature/big-screen
Bjorn 4 years ago
parent
commit
5350d2bb35
  1. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java
  2. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

21
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java

@ -13,6 +13,7 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.pie.style.VanChartPieValueLabelContentPane; import com.fr.van.chart.pie.style.VanChartPieValueLabelContentPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
/** /**
@ -34,6 +35,14 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane
return panel; return panel;
} }
protected JPanel createBorderAndBackgroundPane() {
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 10));
jPanel.add(createLabelBorderPane(), BorderLayout.NORTH);
jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER);
return jPanel;
}
protected JPanel createLabelBorderPane() { protected JPanel createLabelBorderPane() {
VanChartBorderWithShapePane borderPane = new VanChartBorderWithShapePane() { VanChartBorderWithShapePane borderPane = new VanChartBorderWithShapePane() {
@Override @Override
@ -58,6 +67,18 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane
protected JPanel createLabelBackgroundPane() { protected JPanel createLabelBackgroundPane() {
VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() { VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() {
@Override
protected JPanel initContentPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize);
}
@Override
protected Component[][] getPaneComponents() { protected Component[][] getPaneComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_Background")), typeComboBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Utils_Background")), typeComboBox},

6
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -23,6 +23,7 @@ import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutI
import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; 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.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -242,6 +243,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
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"));
tractionLinePane = TableLayout4VanChartHelper.createGapTableLayoutPane("", tractionLine); tractionLinePane = TableLayout4VanChartHelper.createGapTableLayoutPane("", tractionLine);
tractionLinePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
panel.add(tractionLinePane, BorderLayout.SOUTH); panel.add(tractionLinePane, BorderLayout.SOUTH);
initPositionListener(); initPositionListener();
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) {
@ -350,7 +352,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
} }
private void checkPosition() { private void checkPosition() {
tractionLine.setSelected(position.getSelectedItem() == Constants.OUTSIDE); tractionLine.setSelected(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE);
checkPositionEnabled(); checkPositionEnabled();
} }
@ -364,7 +366,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
} }
private void checkPositionEnabled() { private void checkPositionEnabled() {
tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE); tractionLinePane.setVisible(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE);
} }
protected void checkPane() { protected void checkPane() {

Loading…
Cancel
Save