Browse Source
* commit '3e96c3fd9384646ba15c2c9d0922c1c2f8efffab': 删除多余的赋值 CHART-16009 标签纵向时无边框 CHART-15965 无边框设置界面时,border宽度设置为0 CHART-15990 富文本自动自定义切换时不改变content CHART-16031 完善仪表盘富文本参数 CHART-16036 完善多层饼图富文本参数 CHART-15946 标签边框颜色支持自动 CHART-15999 完善地图富文本参数解析 CHART-16038 完善框架图提示的富文本参数 CHART-16058 完善漏斗图提示的富文本参数 CHART-15944 标签形状选择后三种时,圆角灰化 CHART-15942 标签边框线形选择为无时,其余面板隐藏 REPORT-40216 修改 REPORT-40216 用双击选中的下标 REPORT-40216 数据集-数据库数据集-复制数据集并修改名称后,单元格中的原数据集会被自动修改research/11.0
superman
4 years ago
16 changed files with 334 additions and 50 deletions
@ -0,0 +1,24 @@ |
|||||||
|
package com.fr.design.data.datapane; |
||||||
|
|
||||||
|
import org.junit.Test; |
||||||
|
|
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
import static org.junit.Assert.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Yyming |
||||||
|
* @version 10.0 |
||||||
|
* Created by Yyming on 2020/9/29 |
||||||
|
*/ |
||||||
|
public class TableDataPaneListPaneTest { |
||||||
|
|
||||||
|
@Test |
||||||
|
public void rename() { |
||||||
|
TableDataPaneListPane listPane = new TableDataPaneListPane(); |
||||||
|
listPane.rename("111", "222"); |
||||||
|
listPane.rename("222", "333"); |
||||||
|
Map<String, String> dsNameChangedMap = listPane.getDsNameChangedMap(); |
||||||
|
assertEquals(1, dsNameChangedMap.size()); |
||||||
|
} |
||||||
|
} |
@ -1,58 +1,210 @@ |
|||||||
package com.fr.van.chart.designer.component.border; |
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.Marker; |
||||||
import com.fr.chart.chartglyph.MarkerFactory; |
import com.fr.chart.chartglyph.MarkerFactory; |
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
||||||
|
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.gui.ispinner.UISpinner; |
||||||
import com.fr.design.gui.xcombox.MarkerComboBox; |
import com.fr.design.gui.xcombox.MarkerComboBox; |
||||||
import com.fr.design.i18n.Toolkit; |
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.utils.gui.UIComponentUtils; |
import com.fr.design.utils.gui.UIComponentUtils; |
||||||
import com.fr.design.widget.FRWidgetFactory; |
import com.fr.design.widget.FRWidgetFactory; |
||||||
import com.fr.plugin.chart.base.AttrBorderWithShape; |
import com.fr.plugin.chart.base.AttrBorderWithShape; |
||||||
import com.fr.plugin.chart.marker.type.MarkerType; |
import com.fr.plugin.chart.marker.type.MarkerType; |
||||||
|
import com.fr.stable.Constants; |
||||||
|
import com.fr.stable.CoreConstants; |
||||||
|
import com.fr.van.chart.designer.TableLayout4VanChartHelper; |
||||||
|
|
||||||
|
import javax.swing.JPanel; |
||||||
|
import java.awt.BorderLayout; |
||||||
import java.awt.Component; |
import java.awt.Component; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.awt.event.ActionListener; |
||||||
|
|
||||||
public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane { |
public class VanChartBorderWithShapePane extends BasicPane { |
||||||
|
private static final int RECTANGULAR_INDEX = 0; |
||||||
|
private static final int DIALOG_INDEX = 1; |
||||||
|
|
||||||
private MarkerComboBox shapePane; |
private static final int AUTO_COLOR = 0; |
||||||
|
private static final int CUSTOM_COLOR = 1; |
||||||
|
|
||||||
protected void initComponents() { |
private LineComboBox lineTypeBox; |
||||||
shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); |
private UIButtonGroup<Integer> lineColorButton; |
||||||
super.initComponents(); |
private ColorSelectBox lineColorBox; |
||||||
|
private MarkerComboBox borderShape; |
||||||
|
private UISpinner borderRadius; |
||||||
|
|
||||||
|
private JPanel detailPane; |
||||||
|
private JPanel colorBoxPane; |
||||||
|
|
||||||
|
public VanChartBorderWithShapePane() { |
||||||
|
initComponents(); |
||||||
|
createBorderPane(); |
||||||
|
} |
||||||
|
|
||||||
|
private void initComponents() { |
||||||
|
lineTypeBox = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); |
||||||
|
lineColorButton = new UIButtonGroup<>(new String[]{ |
||||||
|
Toolkit.i18nText("Fine-Design_Chart_Automatic"), |
||||||
|
Toolkit.i18nText("Fine-Design_Chart_Custom") |
||||||
|
}); |
||||||
|
lineColorBox = new ColorSelectBox(100); |
||||||
|
borderShape = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); |
||||||
|
borderRadius = new UISpinner(0, 1000, 1, 0); |
||||||
|
} |
||||||
|
|
||||||
|
private void createBorderPane() { |
||||||
|
this.setLayout(new BorderLayout()); |
||||||
|
|
||||||
|
detailPane = createDetailPane(); |
||||||
|
|
||||||
|
this.add(createLineTypePane(), BorderLayout.CENTER); |
||||||
|
this.add(detailPane, BorderLayout.SOUTH); |
||||||
|
|
||||||
|
initLineTypeListener(); |
||||||
|
initLineColorListener(); |
||||||
|
initShapeListener(); |
||||||
|
} |
||||||
|
|
||||||
|
private void initLineTypeListener() { |
||||||
|
lineTypeBox.addActionListener(new ActionListener() { |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
checkDetailPane(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkDetailPane() { |
||||||
|
detailPane.setVisible(lineTypeBox.getSelectedLineStyle() != Constants.LINE_NONE); |
||||||
} |
} |
||||||
|
|
||||||
protected Component[][] getUseComponent() { |
private void initLineColorListener() { |
||||||
return new Component[][]{ |
lineColorButton.addActionListener(new ActionListener() { |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
checkColorPane(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkColorPane() { |
||||||
|
colorBoxPane.setVisible(lineColorButton.getSelectedIndex() == CUSTOM_COLOR); |
||||||
|
} |
||||||
|
|
||||||
|
private void initShapeListener() { |
||||||
|
borderShape.addActionListener(new ActionListener() { |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
checkRadiusPane(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
private void checkRadiusPane() { |
||||||
|
borderRadius.setEnabled(borderShape.getSelectedIndex() == RECTANGULAR_INDEX || borderShape.getSelectedIndex() == DIALOG_INDEX); |
||||||
|
} |
||||||
|
|
||||||
|
private JPanel createLineTypePane() { |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
||||||
|
|
||||||
|
double[] columnSize = {f, e}; |
||||||
|
double[] rowSize = {p, p}; |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
new Component[]{null, null}, |
new Component[]{null, null}, |
||||||
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), |
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), |
||||||
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)}, |
UIComponentUtils.wrapWithBorderLayoutPane(lineTypeBox)}}; |
||||||
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane}, |
|
||||||
|
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
||||||
|
} |
||||||
|
|
||||||
|
private JPanel createDetailPane() { |
||||||
|
double p = TableLayout.PREFERRED; |
||||||
|
double f = TableLayout.FILL; |
||||||
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
||||||
|
|
||||||
|
double[] columnSize = {f, e}; |
||||||
|
double[] rowSize = {p, p, p}; |
||||||
|
|
||||||
|
Component[][] components = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), |
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), |
||||||
UIComponentUtils.wrapWithBorderLayoutPane(shapePane)}, |
UIComponentUtils.wrapWithBorderLayoutPane(borderShape)}, |
||||||
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()} |
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), borderRadius} |
||||||
}; |
}; |
||||||
|
|
||||||
|
JPanel center = createLineColorPane(); |
||||||
|
JPanel south = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); |
||||||
|
|
||||||
|
JPanel panel = new JPanel(new BorderLayout()); |
||||||
|
|
||||||
|
panel.add(center, BorderLayout.CENTER); |
||||||
|
panel.add(south, BorderLayout.SOUTH); |
||||||
|
|
||||||
|
return panel; |
||||||
} |
} |
||||||
|
|
||||||
protected double[] getRowSize() { |
private JPanel createLineColorPane() { |
||||||
double p = TableLayout.PREFERRED; |
double p = TableLayout.PREFERRED; |
||||||
return new double[]{p, p, p, p, p}; |
double f = TableLayout.FILL; |
||||||
|
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; |
||||||
|
|
||||||
|
double[] columnSize = {f, e}; |
||||||
|
double[] rowSize = {p, p}; |
||||||
|
|
||||||
|
Component[][] center = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), lineColorButton} |
||||||
|
}; |
||||||
|
|
||||||
|
Component[][] south = new Component[][]{ |
||||||
|
new Component[]{null, null}, |
||||||
|
new Component[]{null, lineColorBox} |
||||||
|
}; |
||||||
|
|
||||||
|
colorBoxPane = TableLayout4VanChartHelper.createGapTableLayoutPane(south, rowSize, columnSize); |
||||||
|
|
||||||
|
JPanel panel = new JPanel(new BorderLayout()); |
||||||
|
|
||||||
|
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(center, rowSize, columnSize), BorderLayout.CENTER); |
||||||
|
panel.add(colorBoxPane, BorderLayout.SOUTH); |
||||||
|
|
||||||
|
return panel; |
||||||
} |
} |
||||||
|
|
||||||
public void populate(AttrBorder border) { |
protected String title4PopupWindow() { |
||||||
super.populate(border); |
return null; |
||||||
|
} |
||||||
|
|
||||||
if (border instanceof AttrBorderWithShape) { |
public void populate(AttrBorderWithShape border) { |
||||||
shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape()))); |
if (border == null) { |
||||||
|
return; |
||||||
} |
} |
||||||
} |
|
||||||
|
|
||||||
public void update(AttrBorder border) { |
lineTypeBox.setSelectedLineStyle(border.getBorderStyle()); |
||||||
super.update(border); |
lineColorButton.setSelectedIndex(border.isAutoColor() ? AUTO_COLOR : CUSTOM_COLOR); |
||||||
|
lineColorBox.setSelectObject(border.getBorderColor()); |
||||||
|
borderShape.setSelectedMarker((Marker.createMarker(border.getShape()))); |
||||||
|
borderRadius.setValue(border.getRoundRadius()); |
||||||
|
|
||||||
if (border instanceof AttrBorderWithShape) { |
checkDetailPane(); |
||||||
((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType())); |
checkColorPane(); |
||||||
|
checkRadiusPane(); |
||||||
|
} |
||||||
|
|
||||||
|
public void update(AttrBorderWithShape border) { |
||||||
|
if (border == null) { |
||||||
|
return; |
||||||
} |
} |
||||||
|
|
||||||
|
border.setBorderStyle(lineTypeBox.getSelectedLineStyle()); |
||||||
|
border.setAutoColor(lineColorButton.getSelectedIndex() == AUTO_COLOR); |
||||||
|
border.setBorderColor(lineColorBox.getSelectObject()); |
||||||
|
border.setShape(MarkerType.parse(borderShape.getSelectedMarkder().getMarkerType())); |
||||||
|
border.setRoundRadius((int) borderRadius.getValue()); |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue