Browse Source

标签边框增加形状

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
f3c2c203a8
  1. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java
  2. 12
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java
  3. 58
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java
  4. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

14
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java

@ -6,6 +6,7 @@ import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.LineComboBox;
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.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
@ -30,20 +31,18 @@ public class VanChartBorderPane extends BasicPane {
protected void initComponents() { protected void initComponents() {
currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
currentLineColorPane = new ColorSelectBox(100); currentLineColorPane = new ColorSelectBox(100);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e}; double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p};
Component[][] components = getUseComponent(); Component[][] components = getUseComponent();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSize(), columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
} }
protected Component[][] getUseComponent() { protected Component[][] getUseComponent() {
UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")); UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style"));
UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")); UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color"));
return new Component[][]{ return new Component[][]{
new Component[]{null,null}, new Component[]{null,null},
@ -52,6 +51,11 @@ public class VanChartBorderPane extends BasicPane {
}; };
} }
protected double[] getRowSize() {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p, p};
}
/** /**
* 标题 * 标题
* @return 标题 * @return 标题

12
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java

@ -4,10 +4,10 @@ import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.GeneralInfo; import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
@ -19,6 +19,10 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane {
private static final long serialVersionUID = -3937853702118283803L; private static final long serialVersionUID = -3937853702118283803L;
private UISpinner radius; private UISpinner radius;
public UISpinner getRadius() {
return radius;
}
@Override @Override
protected void initComponents() { protected void initComponents() {
radius = new UISpinner(0,1000,1,0); radius = new UISpinner(0,1000,1,0);
@ -31,11 +35,11 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane {
return new Component[][]{ return new Component[][]{
new Component[]{null,null}, new Component[]{null,null},
new Component[]{ new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo) UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)
}, },
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius} new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")),radius}
} ; } ;
} }

58
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java

@ -0,0 +1,58 @@
package com.fr.van.chart.designer.component.border;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.Marker;
import com.fr.chart.chartglyph.MarkerFactory;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrBorderWithShape;
import com.fr.plugin.chart.marker.type.MarkerType;
import java.awt.Component;
public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane {
private MarkerComboBox shapePane;
protected void initComponents() {
shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers());
super.initComponents();
}
protected Component[][] getUseComponent() {
return new Component[][]{
new Component[]{null, null},
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")),
UIComponentUtils.wrapWithBorderLayoutPane(shapePane)},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()}
};
}
protected double[] getRowSize() {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p, p, p};
}
public void populate(AttrBorder border) {
super.populate(border);
if (border instanceof AttrBorderWithShape) {
shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape())));
}
}
public void update(AttrBorder border) {
super.update(border);
if (border instanceof AttrBorderWithShape) {
((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType()));
}
}
}

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

@ -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;
@ -21,7 +20,7 @@ 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.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; 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;
@ -45,7 +44,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private UIToggleButton tractionLine; private UIToggleButton tractionLine;
private ColorSelectBox backgroundColor; private ColorSelectBox backgroundColor;
private VanChartBorderWithRadiusPane borderPane; private VanChartBorderWithShapePane borderPane;
private VanChartBackgroundWithOutImagePane backgroundPane; private VanChartBackgroundWithOutImagePane backgroundPane;
private JPanel tractionLinePane; private JPanel tractionLinePane;
@ -125,7 +124,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
} }
private JPanel createLabelBorderPane() { private JPanel createLabelBorderPane() {
borderPane = new VanChartBorderWithRadiusPane(); borderPane = new VanChartBorderWithShapePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
} }
@ -338,10 +337,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
backgroundColor.setSelectObject(detail.getBackgroundColor()); backgroundColor.setSelectObject(detail.getBackgroundColor());
} }
if(borderPane != null){ if(borderPane != null){
borderPane.populate(detail.getGeneralInfo()); borderPane.populate(detail.getBorder());
} }
if(backgroundPane != null){ if(backgroundPane != null){
backgroundPane.populate(detail.getGeneralInfo()); backgroundPane.populate(detail.getBackground());
} }
checkAllUse(); checkAllUse();
@ -370,10 +369,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
detail.setBackgroundColor(backgroundColor.getSelectObject()); detail.setBackgroundColor(backgroundColor.getSelectObject());
} }
if(borderPane != null){ if(borderPane != null){
borderPane.update(detail.getGeneralInfo()); borderPane.update(detail.getBorder());
} }
if(backgroundPane != null){ if(backgroundPane != null){
backgroundPane.update(detail.getGeneralInfo()); backgroundPane.update(detail.getBackground());
} }
} }

Loading…
Cancel
Save