Browse Source

Pull request #14935: 无jira任务, fbp/release 合 fbp/feature

Merge in DESIGN/design from fbp/release to fbp/feature

* commit '74cc3d4196eafedff14e21b2d48d0fd9e66fa2fe':
  REPORT-136120 fix: 本地设计器启动日志级别需要全部配置保持一致
  REPORT-135874 fix: 修复无法获取远程环境脱敏规则的问题
  修改拖拽条颜色
  REPORT-135657 提供前端获取当前所有数据集的方式
  去除html标签
  REPORT-135879 【fr-fbp回归】次管保存数据中心模板,报错没权限
  无JIRA任务 改了前端bug,更新一波js
  REPORT-135680 fix:fbp回归问题修复
  无JIRA任务 改了前端bug,更新一波js
  REPORT-136114 fix:老图表部分面板翻新
  REPORT-132266 fix: 下拉多选框数据 Windows 出现数据错乱
  REPORT-132266 fix: 下拉多选框数据 Windows 出现数据错乱
fbp/feature
superman 2 months ago committed by zhouping-周平
parent
commit
25cc88d069
  1. 37
      designer-base/src/main/java/com/fine/theme/light/ui/FineComboCheckBoxUI.java
  2. 5
      designer-base/src/main/java/com/fine/theme/light/ui/FineSliderUI.java
  3. 2
      designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java
  4. 2
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  5. 17
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java
  6. 11
      designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataJSBridge.java
  7. 11
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java
  8. 135
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java
  9. 2
      designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java
  10. 18
      designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java
  11. 19
      designer-base/src/main/java/com/fr/design/style/AlphaPane.java
  12. 19
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  13. 5
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java
  14. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties
  15. 21
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  16. 119
      designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js
  17. 46
      designer-base/src/test/java/com/fr/design/gui/storybook/components/ComboCheckBoxStoryBoard.java
  18. 106
      designer-chart/src/main/java/com/fr/design/chart/axis/ChartAlertValuePane.java
  19. 23
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapDataPane.java
  20. 47
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapReportDataContentPane.java
  21. 75
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapTableDataContentPane.java
  22. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  23. 110
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartAxisLabelPane.java
  24. 34
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartAxisTitlePane.java
  25. 32
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDataPointLabel4GisPane.java
  26. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java
  27. 11
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartAxisPane.java
  28. 30
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java
  29. 27
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/legend/ChartLegendPane.java
  30. 44
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/title/ChartTitlePane.java
  31. 12
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java
  32. 7
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java
  33. 8
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java

37
designer-base/src/main/java/com/fine/theme/light/ui/FineComboCheckBoxUI.java

@ -0,0 +1,37 @@
package com.fine.theme.light.ui;
import com.formdev.flatlaf.ui.FlatComboBoxUI;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
/**
* {@link com.fr.design.gui.icombocheckbox.UIComboCheckBox} UI 样式
*
* @author lemon
* @since 12.0
* Created on 2024/09/27
*/
public class FineComboCheckBoxUI extends FlatComboBoxUI {
public FineComboCheckBoxUI() {
super();
}
/**
* 创建UI
*/
public static ComponentUI createUI(JComponent c) {
return new FineComboCheckBoxUI();
}
@Override
public void installUI(JComponent c) {
super.installUI(c);
c.setBackground(UIManager.getColor("ComboCheckBox.background"));
c.setBorder(UIManager.getBorder("ComboCheckBox.border"));
}
}

5
designer-base/src/main/java/com/fine/theme/light/ui/FineSliderUI.java

@ -50,6 +50,11 @@ public class FineSliderUI extends FlatSliderUI {
defaultLabelHeight = FineUIUtils.getAndScaleInt("Slider.labelHeight", DEFAULT_LABEL_HEIGHT);
}
@Override
protected Color getTrackColor() {
return trackColor;
}
@Override
protected void calculateLabelRect() {

2
designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java

@ -6,6 +6,8 @@ import com.fine.swing.ui.layout.Row;
import com.fine.swing.ui.layout.Spacer;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.collections.combination.Pair;

2
designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java

@ -41,6 +41,7 @@ public interface FineUIStyle {
String POPUP_MENU_TOOL_BAR = "popupMenuToolBar";
String POPUP_MENU_DROPDOWN = "dropdownPopupMenu";
String TRANSPARENT_TEXT_FIELD = "transparentTextField";
String OFFET_LEFT_TEXT_FIELD = "offsetLeftText";
String TRANSPARENT_BACKGROUND = "transparentBackground";
String PURE_LIST = "pureList";
String NO_BORDER_LIST = "noBorderList";
@ -51,6 +52,7 @@ public interface FineUIStyle {
String DEFAULT_TABLE = "defaultTable";
String WHITE_BUTTON = "whiteButton";
String ORIGINAL_BUTTON = "originalButton";
String PLAIN_ARROW_BUTTON = "plainArrowButton";
String GRAY_BUTTON = "grayButton";
String DETAIL_LABEL = "detailLabel";
String WIDGET_EVENT_LABEL = "widgetEventLabel";

17
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java

@ -1,7 +1,6 @@
package com.fr.design.data.datapane.preview.desensitization.view.setting;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.data.desensitize.base.DesensitizationTableData;
@ -14,7 +13,6 @@ import com.fr.design.data.datapane.preview.desensitization.view.rule.Desensitiza
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.ComboCheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombocheckbox.UIComboCheckBox;
import com.fr.design.gui.ilable.UILabel;
@ -39,7 +37,6 @@ import javax.swing.UIManager;
import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -57,6 +54,8 @@ import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/**
* 处理TableDataDesensitizationTablePane中TableEditPane的Model
*
@ -367,12 +366,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
}
});
setBoxStyle();
}
private void setBoxStyle() {
this.rolesCheckBox.setBorder(new FineRoundBorder());
FineUIStyle.setStyle(this.rolesCheckBox.getEditor(), FineUIStyle.TRANSPARENT_TEXT_FIELD);
}
@Override
@ -433,7 +426,9 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(getLabel(), BorderLayout.EAST);
JPanel pane = getClickPane();
pane.setOpaque(false);
this.add(pane, BorderLayout.CENTER);
}
@Override
@ -457,7 +452,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
// 规则状态
this.ruleStatusLabel = new UILabel();
this.ruleStatusLabel.setOpaque(true);
FineUIStyle.setStyle(ruleStatusLabel, FineUIStyle.LABEL_WARNING_TIP);
setStyle(ruleStatusLabel, FineUIStyle.LABEL_WARNING_TIP);
}
/**

11
designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataJSBridge.java

@ -6,6 +6,7 @@ import com.fr.datacenters.tabledata.bean.DCTableDataBean;
import com.fr.datacenters.tabledata.filter.DCFilter;
import com.fr.datacenters.tabledata.parameter.DCParameter;
import com.fr.design.bridge.exec.JSBridge;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.design.formula.FormulaFactory;
@ -135,6 +136,16 @@ public class DCTableDataJSBridge {
}).setVisible(true);
}
/**
* 当前所有数据集名称
*/
@JSBridge
public void getDatasetNames(final JsFunction callback) {
JxUIPane.DEFAULT_EXECUTOR.submit(() ->
callback.invoke(window, EmbedJson.encode(
DesignTableDataManager.getAllDSNames(DesignTableDataManager.getEditingTableDataSource()))));
}
/**
* 解析公式参数
*/

11
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java

@ -31,6 +31,10 @@ import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
public class UICheckListPopup extends UIPopupMenu {
private List<ActionListener> listeners = new ArrayList<ActionListener>();
private List<JCheckBox> checkBoxList = new ArrayList<JCheckBox>();
@ -120,15 +124,12 @@ public class UICheckListPopup extends UIPopupMenu {
}
private void addOneCheckValue(Object checkValue) {
JPanel checkPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
checkPane.setPreferredSize(FineUIScale.scale(new Dimension(144, CHECKBOX_HEIGHT)));
JPanel checkPane = new JPanel(new BorderLayout());
final JCheckBox temp = createCheckbox();
final UILabel label = new UILabel(checkValue.toString());
label.setBackground(Color.WHITE);
label.setPreferredSize(FineUIScale.scale(new Dimension(100, 20)));
checkPane.setBackground(Color.WHITE);
checkPane.add(temp);
checkPane.add(label);
checkPane.add(row(fix(4), cell(temp), cell(label)).getComponent());
if (labelNeedToolTips) {
// 设置每项Label的tooltips为其省略前的内容
label.setToolTipText(checkValue.toString());

135
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java

@ -2,19 +2,20 @@ package com.fr.design.gui.icombocheckbox;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.HoverAware;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils;
import javax.swing.Icon;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
@ -36,6 +37,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.fine.theme.utils.FineUIStyle.OFFET_LEFT_TEXT_FIELD;
import static com.fine.theme.utils.FineUIStyle.PLAIN_ARROW_BUTTON;
import static com.fine.theme.utils.FineUIStyle.TRANSPARENT_TEXT_FIELD;
import static com.fine.theme.utils.FineUIStyle.setStyle;
/**
* 设计器下拉复选框组件
* 支持全选半选
@ -43,10 +49,10 @@ import java.util.Map;
* 可以省略显示
*
* @author
* @since
* Created on
* @since Created on
*/
public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNameObserver, HoverAware {
public class UIComboCheckBox extends JComboBox implements UIObserver, GlobalNameObserver, HoverAware {
private static final String UI_CLASS_ID = "ComboCheckBoxUI";
//下拉框的值
private Object[] values;
//已经选中的值
@ -55,8 +61,8 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private List<ActionListener> listeners = new ArrayList<ActionListener>();
private UICheckListPopup popup;
private UITextField editor;
private final JPanel clickPane = new JPanel(new BorderLayout());
private UIButton arrowButton;
private UILabel label;
//选中的值之间显示的分隔符
private String valueSperator;
private static final String DEFAULT_VALUE_SPERATOR = ",";
@ -71,6 +77,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private String placeHolder = StringUtils.EMPTY;
private boolean rollOver;
private boolean popupVisible = false;
public UIComboCheckBox(Object[] value) {
this(value, DEFAULT_VALUE_SPERATOR, true);
@ -123,19 +130,22 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
}
private void initComponent() {
this.popup = new UICheckListPopup(values, supportSelectAll);
this.popup = new UICheckListPopup(values, supportSelectAll) {
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
size.width = UIComboCheckBox.this.getWidth();
return size;
}
};
this.popup.setBorder(new FineRoundBorder());
this.popup.addActionListener(new PopupAction());
this.editor = createEditor();
this.arrowButton = createArrowButton();
this.label = new UILabel(getIcon());
label.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
initClickPane();
setLayoutAndAddComponents();
setText();
addPopupListener(this);
setBackground(Color.WHITE);
setOpaque(true);
}
/**
@ -152,8 +162,8 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
return popup;
}
public UITextField getEditor() {
return editor;
public JPanel getClickPane() {
return clickPane;
}
public String getPlaceHolder() {
@ -164,31 +174,37 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
this.placeHolder = placeHolder;
}
public UIButton getArrowButton() {
return arrowButton;
}
private void initClickPane() {
editor = new TextField();
editor.setEditable(false);
setStyle(editor, OFFET_LEFT_TEXT_FIELD);
public UILabel getLabel() {
return label;
}
arrowButton = new UIButton(getIcon());
setStyle(arrowButton, PLAIN_ARROW_BUTTON);
private UIButton createArrowButton() {
final UIButton arrowBtn = new UIButton();
arrowBtn.setNormalPainted(false);
arrowBtn.setPreferredSize(FineUIScale.scale(new Dimension(20, 5)));
arrowBtn.setIcon(getIcon());
arrowBtn.setExtraPainted(false);
addPopupListener(arrowBtn);
clickPane.add(editor, BorderLayout.CENTER);
clickPane.add(arrowButton, BorderLayout.EAST);
return arrowBtn;
addPopupListener(editor);
addPopupListener(arrowButton);
addHoverStatusListener(editor);
addHoverStatusListener(arrowButton);
}
private UITextField createEditor() {
UITextField editor = new TextField();
editor.setEditable(false);
addPopupListener(editor);
protected void addHoverStatusListener(JComponent component) {
component.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
rollOver = true;
repaint();
}
return editor;
@Override
public void mouseExited(MouseEvent e) {
rollOver = popup.isVisible();
repaint();
}
});
}
/**
@ -202,18 +218,6 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
public void mouseClicked(MouseEvent e) {
togglePopup();
}
@Override
public void mouseEntered(MouseEvent e) {
rollOver = true;
repaint();
}
@Override
public void mouseExited(MouseEvent e) {
rollOver = false;
repaint();
}
});
}
@ -240,7 +244,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
@Override
public boolean isHovered() {
return rollOver || this.popup.isShowing();
return rollOver;
}
private class PopupAction implements ActionListener {
@ -258,10 +262,32 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private void togglePopup() {
if (this.arrowButton.isEnabled()) {
popup.setBorder(new FineRoundBorder());
popup.setPreferredSize(new Dimension(getWidth(), this.popup.getPreferredSize().height));
popup.show(this, 0, getHeight());
if (popupVisible) {
hidePopup();
} else {
showPopup();
}
}
}
/**
* 展示 popup
*/
public void showPopup() {
this.popup.show(this, 0, getHeight());
arrowButton.setIcon(new LazyIcon("up_arrow"));
arrowButton.repaint();
popupVisible = true;
}
/**
* 隐藏 popup
*/
public void hidePopup() {
popup.setVisible(false);
arrowButton.setIcon(new LazyIcon("down_arrow"));
arrowButton.repaint();
popupVisible = false;
}
/**
@ -301,6 +327,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
/**
* 为为添加placeholder
*
* @param editor
*/
protected void setEditorPlaceHolder(UITextField editor) {
@ -335,7 +362,7 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
for (int i = 1; i <= chars.length; i++) {
//如果原文本+省略号长度超过文本框
if (fontMetrics.charsWidth(chars, 0, i) + omitLength > textEditor.getPreferredSize().getWidth()) {
if (fontMetrics.charsWidth(chars, 0, i) + omitLength > textEditor.getWidth()) {
//从第i-1的位置截断再拼上省略号
omitText = text.substring(0, i - 2) + OMIT_TEXT;
break;
@ -466,8 +493,14 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
}
}
@Override
public String getUIClassID() {
return UI_CLASS_ID;
}
/**
* 简单的测试demo
*
* @param args
*/
public static void main(String args[]) {

2
designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java

@ -370,7 +370,7 @@ public class TableLayoutHelper {
JPanel secondMenu = createTableLayoutPane(components, rowSize, columnSize);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] column = {LayoutConstants.CHART_ATTR_TOMARGIN, f};
double[] column = {LayoutConstants.HORIZONTAL_GAP, f};
double[] row = {p, p};
StringBuilder resultText = new StringBuilder();
for (String text : title) {

18
designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java

@ -1,29 +1,23 @@
package com.fr.design.mainframe.authority;
import com.fanruan.config.impl.data.ConnectionConfigProviderFactory;
import com.fanruan.config.impl.data.TableDataConfigProviderFactory;
import com.fr.base.CloneCollector;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.log.FineLoggerFactory;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.authority.user.UserAuthority;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static javax.swing.JOptionPane.WARNING_MESSAGE;
@ -31,6 +25,7 @@ public class JTemplateAuthorityChecker {
JTemplate<?, ?> jTemplate;
Set<String> authConnectionNames;
Set<String> authDatasetNames;
Set<String> templateDatasetNames;
Map<String, ElementAuthorityChecker> checkerMap = new HashMap<>();
Set<String> authFailConnectionNames = new HashSet<>();
Set<String> authFailDatasetNames = new HashSet<>();
@ -45,7 +40,12 @@ public class JTemplateAuthorityChecker {
}
private void initAuthNames() {
// 无需获取所有数据集和数据连接了,当前只能获取自己有权限的
// 无需获取所有服务器数据集和数据连接了,因为当前只能获取自己有权限的,只要拿一下模板数据集就行
templateDatasetNames = new HashSet<>();
Iterator<String> tableDataNameIterator = jTemplate.getTarget().getTableDataNameIterator();
while (tableDataNameIterator.hasNext()) {
templateDatasetNames.add(tableDataNameIterator.next());
}
Map<String, Set<String>> authNamesMap = RemoteAuthorityRepository.getInstance().getAuthServerDataSetAndConnectionNames(WorkContext.getCurrent().getConnection().getUserName());
if (authNamesMap != null) {
//有权限的数据连接名称
@ -87,6 +87,8 @@ public class JTemplateAuthorityChecker {
}
}
}
// 排除模板数据集的部分
authFailDatasetNames.removeAll(templateDatasetNames);
FineLoggerFactory.getLogger().info("JTemplateAuthorityChecker check time consume:" + (System.currentTimeMillis() - s));
return authFailConnectionNames.size() == 0 && authFailDatasetNames.size() == 0;
}

19
designer-base/src/main/java/com/fr/design/style/AlphaPane.java

@ -1,9 +1,7 @@
package com.fr.design.style;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.JFormattedTextField;
import javax.swing.JPanel;
import javax.swing.JSlider;
@ -14,6 +12,7 @@ import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Utils;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.islider.UISlider;
@ -46,17 +45,10 @@ public class AlphaPane extends JPanel {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
// 透明选项
JPanel alphaPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
alphaPane.setBorder(BorderFactory.createEmptyBorder());
this.add(alphaPane, BorderLayout.CENTER);
alphaPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha") + ":"));
alphaPane.add(alphaSlider = new UISlider(UISlider.HORIZONTAL, 0, ALPHA_FLOAT, START_VALUE));
alphaSlider.setPreferredSize(new Dimension(80, 20));
alphaSlider = new UISlider(UISlider.HORIZONTAL, 0, ALPHA_FLOAT, START_VALUE);
valueSpinner = new UIBasicSpinner(new SpinnerListModel(values));
alphaPane.add(valueSpinner);
JPanel alphaPane = FineLayoutBuilder.createHorizontalLayout(10, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")),
alphaSlider, valueSpinner);
JFormattedTextField field = GUICoreUtils.getSpinnerTextField(valueSpinner);
field.setText(checkFormat(START_VALUE));
@ -65,9 +57,8 @@ public class AlphaPane extends JPanel {
field.setHorizontalAlignment(UITextField.LEFT);
field.getDocument().addDocumentListener(textListener);
}
valueSpinner.setPreferredSize(new Dimension(60, 18));
alphaSlider.addChangeListener(changeListener);
this.add(alphaPane, BorderLayout.CENTER);
}
DocumentListener textListener = new DocumentListener() {

19
designer-base/src/main/java/com/fr/design/web/CustomIconPane.java

@ -6,6 +6,7 @@ import com.fr.base.GraphHelper;
import com.fr.base.Icon;
import com.fr.base.IconManager;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
@ -419,7 +420,7 @@ public class CustomIconPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon"));
browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button"));
nameTextField = new UITextField(20);
nameTextField = new UITextField();
nameTextField.setPreferredSize(FineUIScale.createScaleDimension(172, 24));
browseButton.addActionListener(e -> onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this)));
@ -446,16 +447,14 @@ public class CustomIconPane extends BasicPane {
showImageLabel = new UILabel();
showImageLabel.setPreferredSize(FineUIScale.createScaleDimension(50, 50));
JPanel centerPane = column(10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(1.2),
cell(nameTextField).weight(3)
JPanel centerPane = column(LayoutConstants.VERTICAL_GAP,
row(40,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")),
cell(nameTextField)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")).weight(1.2),
row(
cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)
).weight(3)
row(40,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")),
row(cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)).weight(1)
)
).getComponent();
this.add(centerPane, BorderLayout.WEST);

5
designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java

@ -5,6 +5,7 @@ import com.fr.base.theme.TemplateTheme;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.frpane.FontSizeComboPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.frpane.UIPercentDragPane;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
@ -67,7 +68,7 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
* 控件背景和透明度配置面板
*/
protected NewColorSelectBox widgetBgColorSelectBox;
protected UIPercentDragPane widgetBgAlphaDragPane;
protected UINumberDragPaneWithPercent widgetBgAlphaDragPane;
/**
* 图标颜色
*/
@ -130,7 +131,7 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
colorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR);
widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
widgetBgAlphaDragPane = new UIPercentDragPane();
widgetBgAlphaDragPane = new UINumberDragPaneWithPercent(0, 100, 1);
initLineBox();
borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1);
iconColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);

1
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties

@ -5,6 +5,7 @@ CheckBoxUI=com.fine.theme.light.ui.FineCheckBoxUI
CheckBoxMenuItemUI=com.formdev.flatlaf.ui.FlatCheckBoxMenuItemUI
ColorChooserUI=com.formdev.flatlaf.ui.FlatColorChooserUI
ComboBoxUI=com.fine.theme.light.ui.FineComboBoxUI
ComboCheckBoxUI=com.fine.theme.light.ui.FineComboCheckBoxUI
DesktopIconUI=com.formdev.flatlaf.ui.FlatDesktopIconUI
DesktopPaneUI=com.formdev.flatlaf.ui.FlatDesktopPaneUI
CalendarPaneUI=com.fine.theme.light.ui.FineCalendarPaneUI

21
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -147,6 +147,7 @@ tooltip.normal=#3F506A
tooltip.disabled=#A3ADBD
hover.deep=#e2fbe6
fill.deep=#F6F9FE
track.normal=#DADEE7
#---- Button ----
@ -324,6 +325,10 @@ ComboBox.comboHeight = 24
ComboBox.selectBox.button.height = 22
ComboBox.renderInset = 0,6,0,6
#---- ComboCheckBox ----
ComboCheckBox.background = $fill.normal
ComboCheckBox.border = com.fine.theme.light.ui.FineRoundBorder
#---- Component ----
Component.focusWidth = 0
@ -727,7 +732,7 @@ Slider.trackWidth = 2
Slider.thumbSize = 12,12
Slider.focusWidth=0
Slider.trackValueColor=$brand.normal
Slider.trackColor=$border.divider
Slider.trackColor=$track.normal
Slider.thumbColor=$fill.normal
Slider.thumbBorderColor=$border.divider
Slider.tickColor = @disabledForeground
@ -1276,6 +1281,15 @@ chart.selectedBorderColor = #2576EF
borderWidth : 0; \
disabledBackground : fade($Button.background,0%);
[style]Button.plainArrowButton=\
background : fade($Button.background,0%); \
margin: 4,4,4,4; \
borderWidth : 0; \
disabledBackground : fade($Button.background,0%); \
hoverBackground : null; \
selectedBackground : null; \
pressedBackground : null
[style]CombinationButton.primary = \
background : @BrandColor; \
arc : 3
@ -1328,6 +1342,11 @@ chart.selectedBorderColor = #2576EF
[style]TextField.transparentTextField=\
background: fade(@background, 0%); \
border: null;
[style]TextField.offsetLeftText=\
background: fade(@background, 0%); \
border: 0,6,0,0;
[style]PopupMenu.dropdownPopupMenu=\
background: fade(@background, 0%); \
borderInsets: 0,0,0,0;

119
designer-base/src/main/resources/com/fr/design/data/tabledata/datacenter/web/data-choose.main.js

File diff suppressed because one or more lines are too long

46
designer-base/src/test/java/com/fr/design/gui/storybook/components/ComboCheckBoxStoryBoard.java

@ -0,0 +1,46 @@
package com.fr.design.gui.storybook.components;
import com.fr.design.gui.icombocheckbox.UIComboCheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.storybook.StoryBoard;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.ArrayUtils;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
public class ComboCheckBoxStoryBoard extends StoryBoard {
public ComboCheckBoxStoryBoard() {
super("下拉多选框");
add(
cell(new UILabel("普通状态")).with(this::h3),
cell(getComboCheckBox(ArrayUtils.toArray("测试1", "测试2", "测试3", "测试4"))),
cell(new UILabel("长文字状态")).with(this::h3),
cell(getComboCheckBox(ArrayUtils.toArray("测试长文字1测试长文字1测试长文字1测试长文字1测试长文字1测试长文字1测试长文字1",
"测试长文字2测试长文字2测试长文字2测试长文字2测试长文字2测试长文字2测试长文字2",
"测试长文字3测试长文字3测试长文字3测试长文字3测试长文字3测试长文字3测试长文字3",
"测试长文字4测试长文字4测试长文字4测试长文字4测试长文字4测试长文字4测试长文字4"))),
flex()
);
}
private UIComboCheckBox getComboCheckBox(Object[] array) {
return new UIComboCheckBox(array, true) {
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pane = getClickPane();
pane.setOpaque(false);
this.add(pane, BorderLayout.CENTER);
}
};
}
}

106
designer-chart/src/main/java/com/fr/design/chart/axis/ChartAlertValuePane.java

@ -1,5 +1,6 @@
package com.fr.design.chart.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.chartattr.ChartAlertValue;
@ -13,25 +14,31 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.AlphaPane;
import com.fr.design.style.FRFontPane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import javax.swing.*;
import java.awt.*;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Font;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* 图表 坐标轴 警戒线值 编辑界面. (默认 位置居左居右)
* @author kunsnat E-mail:kunsnat@gmail.com
@ -56,29 +63,13 @@ public class ChartAlertValuePane extends BasicBeanPane<ChartAlertValue> {
public ChartAlertValuePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(pane, BorderLayout.CENTER);
JPanel alertLinePane =FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
pane.add(alertLinePane);
alertLinePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Line_Setting")));
JPanel valuePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
alertLinePane.add(valuePane);
valuePane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Value") + ":"));
// 警戒线
textField = new UITextField();
textField.setColumns(4);
valuePane.add(textField);
textField.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
showFormulaPane();
}
});
textField.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
e.consume();
@ -86,33 +77,28 @@ public class ChartAlertValuePane extends BasicBeanPane<ChartAlertValue> {
}
});
JPanel lineStylePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
alertLinePane.add(lineStylePane);
lineStylePane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style") + ":"));
lineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
lineStylePane.add(lineCombo);
JPanel lineColorPane =FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
alertLinePane.add(lineColorPane);
lineColorPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Line_Color") + ":"));
colorBox = new ColorSelectBox(80);
lineColorPane.add(colorBox);
alphaPane = new AlphaPane();
alertLinePane.add(alphaPane);
JPanel tipPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
pane.add(tipPane);
tipPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Tip") + ":", null));
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
tipPane.add(centerPane);
JPanel alertLinePane = column(10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Value"))).weight(1),
cell(textField).weight(4)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style"))).weight(1),
cell(lineCombo).weight(4)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Line_Color"))).weight(1),
cell(colorBox).weight(4)
),
cell(alphaPane)
).getComponent();
// 提示文字
fontNameBox = new UIComboBox();
fontNameBox.setPreferredSize(new Dimension(80,20));
fontNameBox.addItem("SimSun"); // TODO 这边字体中没有在列表内
String[] names = DesignUtils.getAvailableFontFamilyNames4Report();
@ -121,25 +107,31 @@ public class ChartAlertValuePane extends BasicBeanPane<ChartAlertValue> {
}
fontSizeBox = new UIComboBox();
fontSizeBox.setPreferredSize(new Dimension(80,20));
Integer[] sizes = FRFontPane.Font_Sizes;
for(int i = 0; i < sizes.length; i++) {
fontSizeBox.addItem(sizes[i]);
}
double t = TableLayout.FILL;
double[] rowSize = {t, t, t, t, t};
double[] columnSize = {0.1, 0.2, 0.5, 0.2};
Component[][] components= {
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content") + ":"), contentField = new UITextField(3)},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font") + ":"), fontNameBox},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Size") + ":"), fontSizeBox},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout") + ": "), leftButton = new UIRadioButton(getLeftName())},
{null, null, rightButton = new UIRadioButton(getRightName())},
leftButton = new UIRadioButton(getLeftName());
rightButton = new UIRadioButton(getRightName());
Component[][] components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content") ), contentField = new UITextField()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font")), fontNameBox},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Size") ), fontSizeBox},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),
FineLayoutBuilder.createHorizontalLayout(10, leftButton, rightButton)},
};
JPanel tablePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
centerPane.add(tablePane);
JPanel tipPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 4});
JPanel pane = column(10,
cell(wrapComponentWithTitle(alertLinePane,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Line_Setting")
)),
cell(wrapComponentWithTitle(tipPane,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Tip")))
).getComponent();
this.add(pane, BorderLayout.CENTER);
ButtonGroup bg = new ButtonGroup();
bg.add(leftButton);

23
designer-chart/src/main/java/com/fr/design/chart/report/GisMapDataPane.java

@ -1,5 +1,7 @@
package com.fr.design.chart.report;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
@ -7,18 +9,17 @@ import com.fr.chart.chartdata.GisMapReportDefinition;
import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.gui.data.DataContentsPane;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
@ -102,17 +103,13 @@ public class GisMapDataPane extends DataContentsPane{
contentPane.add(dataFromPane = new UIComboBoxPane<Chart>() {
protected void initLayout() {
this.setLayout(new BorderLayout(LayoutConstants.HGAP_LARGE,6));
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { p,f };
double[] rowSize = { p};
Component[][] components = new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source") + ":"), jcb},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source")), jcb},
} ;
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0);
JPanel northPane = FineLayoutBuilder.commonLeftRightLayout(components);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
@ -134,7 +131,7 @@ public class GisMapDataPane extends DataContentsPane{
}
}, BorderLayout.CENTER);
dataFromPane.setBorder(BorderFactory.createEmptyBorder(10 ,0, 0, 0));
dataFromPane.setBorder(new ScaledEmptyBorder(10 ,0, 0, 0));
return contentPane;
}

47
designer-chart/src/main/java/com/fr/design/chart/report/GisMapReportDataContentPane.java

@ -1,12 +1,12 @@
package com.fr.design.chart.report;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.chartdata.BaseSeriesDefinition;
import com.fr.chart.chartdata.GisMapReportDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -17,25 +17,26 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 属性表gis地图单元格数据源设置界面
*
@ -55,37 +56,25 @@ public class GisMapReportDataContentPane extends FurtherBasicBeanPane<GisMapRepo
}
private void initCom() {
this.setLayout(new BorderLayout(0, 0));
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
addressType = new UIButtonGroup<String>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng")});
lnglatOrder = new UIButtonGroup<String>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude_First"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude_First")});
addressPane = new DefaultTinyFormulaPane();
addressNamePane = new DefaultTinyFormulaPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p};
orderPane = new JPanel(new BorderLayout(LayoutConstants.VGAP_MEDIUM, 0)) {
@Override
public Dimension getPreferredSize() {
if (this.isVisible()) {
return super.getPreferredSize();
} else {
return new Dimension(0, 0);
}
}
};
orderPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng_Order")), BorderLayout.WEST);
orderPane.add(lnglatOrder, BorderLayout.CENTER);
orderPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng_Order")), lnglatOrder);
orderPane.setVisible(false);
lnglatOrder.setSelectedIndex(0);
addressType.setSelectedIndex(0);
Component[][] components = new Component[][]{
new Component[]{addressType, addressPane},
new Component[]{orderPane, null},
new Component[]{new UILabel(" " +com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address_Name")+":", SwingConstants.RIGHT), addressNamePane},
};
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel northPane = column(10,
row(10,
cell(addressType).weight(1), cell(addressPane).weight(1)
),
cell(orderPane),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address_Name"))).weight(1.2), cell(addressNamePane).weight(3)
)
).getComponent();
this.add(northPane, BorderLayout.NORTH);

75
designer-chart/src/main/java/com/fr/design/chart/report/GisMapTableDataContentPane.java

@ -1,10 +1,10 @@
package com.fr.design.chart.report;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Utils;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.constants.LayoutConstants;
import com.fr.data.impl.NameTableData;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.FurtherBasicBeanPane;
@ -16,17 +16,20 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
@ -34,6 +37,10 @@ import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 属性表gis地图数据集数据源定义面板
* @author eason
@ -54,23 +61,17 @@ public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTable
private JPanel orderPane;
public GisMapTableDataContentPane() {
this.setLayout(new BorderLayout());
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new FlowLayout(FlowLayout.LEFT));
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Dataset"), SwingConstants.LEFT);
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Dataset") + ":", SwingConstants.LEFT);
northPane.add(fromTableData = new DatabaseTableDataPane(label) {
fromTableData = new DatabaseTableDataPane(label) {
@Override
protected void userEvent() {
refresh2ComboBox();
}
});
fromTableData.setPreferredSize(new Dimension(218, 20));
northPane.add(fromTableData);
};
JPanel northPane = FineLayoutBuilder.asBorderLayoutWrapped(fromTableData);
this.add(northPane, BorderLayout.NORTH);
addressType = new UIButtonGroup<String>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_GIS_Address"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng")});
lnglatOrder = new UIButtonGroup<String>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude_First"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude_First")});
@ -82,22 +83,8 @@ public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTable
});
addressBox = new UIComboBox();
addressNameBox = new UIComboBox();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p};
orderPane = new JPanel(new BorderLayout(LayoutConstants.VGAP_MEDIUM,0)){
@Override
public Dimension getPreferredSize() {
if(this.isVisible()){
return super.getPreferredSize();
}else{
return new Dimension(0,0);
}
}
};
orderPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng_Order")), BorderLayout.WEST);
orderPane.add(lnglatOrder, BorderLayout.CENTER);
orderPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng_Order")), lnglatOrder);
orderPane.setVisible(false);
lnglatOrder.setSelectedIndex(0);
addressType.setSelectedIndex(0);
@ -105,17 +92,19 @@ public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTable
addressNameBox.removeAllItems();
addressNameBox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
Component[][] components = new Component[][]{
new Component[]{addressType, addressBox},
new Component[]{orderPane,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address_Name") + ":", SwingConstants.RIGHT), addressNameBox},
};
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel pane = new JPanel();
JPanel centerPane = column(10,
row(10,
cell(addressType).weight(1), cell(addressBox).weight(0.5)
),
cell(orderPane),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address_Name"))).weight(1.2),
cell(addressNameBox).weight(3)
)
).getComponent();
JPanel pane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
this.add(pane, BorderLayout.CENTER);
pane.setLayout(new BorderLayout());
pane.add(centerPane, BorderLayout.NORTH);
String[] titles = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Title"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Region_Value")};

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.other;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.base.CoreDecimalFormat;
import com.fr.base.Style;
@ -407,11 +408,11 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
Component[][] components = new Component[][]{
new Component[]{isAutoRefresh, null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new Component[]{FineLayoutBuilder.createHorizontalLayout(10,
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")),
autoRefreshTime,
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds"))
}, 1)},
)},
new Component[]{new UILabel("<html><font size='2' face='Microsoft Yahei' color='red'>" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Support_Img_And_Cell") + "</font></html>"), null},
};
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Fine-Design_Chart_Data_Check"}, components, rowSize, columnSize);

110
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartAxisLabelPane.java

@ -1,12 +1,14 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.base.TextAttr;
import com.fr.chart.chartattr.Axis;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -16,14 +18,16 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.NumberDragBar;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import javax.swing.*;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@ -155,33 +159,26 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
}
private JPanel getWrapShowWayPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f};
double[] rowSize = {p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay, null},
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null},
new Component[]{null, orientationSpinner, orientationBar, null},
new Component[]{null, textAttrPane, null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose},
new Component[]{null, createorientionRow()},
new Component[]{textAttrPane, null, null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3});
}
private JPanel getIntervalShowWayPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
private Row createorientionRow() {
return FineLayoutBuilder.createHorizontalLayout(10, new double[]{1, 1.5}, orientationSpinner, orientationBar);
}
private JPanel getIntervalShowWayPane() {
Component[][] components = new Component[][]{
new Component[]{getCombox()},
new Component[]{getTowChoose()},
new Component[]{getOther()}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
private JPanel getTowChoose() {
@ -192,46 +189,30 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
custom.setSelected(false);
customLabelSamleTime.setVisible(true);
customLabelSamleTime.setEnabled(false);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, f};
double[] rowSize = {p, p};
JPanel customPane = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{custom, customLabelSamleTime, null},
}, new double[]{p}, new double[]{p, p, f});
JPanel customPane = FineLayoutBuilder.createHorizontalLayout(10, custom, customLabelSamleTime);
Component[][] components = new Component[][]{
new Component[]{null, auto,},
new Component[]{null, customPane}
new Component[]{auto,},
new Component[]{customPane}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
}
private JPanel getCombox() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay, null}
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), showWay}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.commonLeftRightLayout(components);
}
private JPanel getOther() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null},
new Component[]{null, orientationSpinner, orientationBar, null},
new Component[]{null, textAttrPane, null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose},
new Component[]{null, createorientionRow()},
new Component[]{textAttrPane, null, null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private void checkShowWay() {
@ -246,18 +227,13 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
} else {
labelPane = getWrapShowWayPane();
}
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p};
double[] col = {f};
showWayPane = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow}, new Component[]{labelPane}}, row, col);
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
showWayPane = FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane);
this.add(showWayPane, BorderLayout.CENTER);
this.validate();
}
private void checkOrientationField() {
if (labelOrientationChoose.getSelectedIndex() != 2) {
orientationBar.setVisible(false);
@ -283,23 +259,17 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
customLabelSamleTime.registerChangeListener(this.observerListener);
orientationSpinner.registerChangeListener(this.observerListener);
labelOrientationChoose.registerChangeListener(this.observerListener);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, p, f};
double[] rowSize = {p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelSampleChoose, customLabelSamleTime},
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null},
new Component[]{null,orientationSpinner, orientationBar, null},
new Component[]{null,textAttrPane, null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")),
FineLayoutBuilder.createHorizontalLayout(10,labelSampleChoose, customLabelSamleTime)},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose},
new Component[]{null, createorientionRow()},
new Component[]{textAttrPane, null},
};
labelPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
double[] row = {p,p};
double[] col = {f};
return TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow}, new Component[]{labelPane}}, row, col);
labelPane = FineLayoutBuilder.commonLeftRightLayout(components);
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
return FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane);
}
private void checkCustomSampleField() {

34
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartAxisTitlePane.java

@ -1,25 +1,23 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Title;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.FRFont;
import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import javax.swing.Icon;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -46,24 +44,17 @@ public class ChartAxisTitlePane extends BasicPane{
axisTitleContentPane = new DefaultTinyFormulaPane();
axisTitleAttrPane = new ChartTextAttrPane();
axisTitleAttrPane.populate(FRFont.getInstance("Microsoft YaHei", Font.PLAIN, 9));
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
Integer[] alignment = new Integer[] { Constants.LEFT, Constants.CENTER, Constants.RIGHT };
titleAlignmentPane = new UIButtonGroup<Integer>(alignmentIconArray, alignment);
titleAlignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup();
titleAlignmentPane.setSelectedItem(Constants.CENTER);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN, f };
double[] rowSize = { p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{null,axisTitleContentPane},
new Component[]{null,axisTitleAttrPane},
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alignment_Style"))},
new Component[]{null,titleAlignmentPane,},
new Component[]{axisTitleContentPane},
new Component[]{axisTitleAttrPane},
new Component[]{FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alignment_Style")), titleAlignmentPane)},
};
titlePane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
titlePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
titlePane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
isAxisTitleVisable.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -71,11 +62,8 @@ public class ChartAxisTitlePane extends BasicPane{
}
});
double[] row = {p,p};
double[] col = {f};
this.setLayout(new BorderLayout());
JPanel panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isAxisTitleVisable}, new Component[]{titlePane}}, row, col);
JPanel panel = FineLayoutBuilder.createVerticalLayout(10, isAxisTitleVisable, titlePane);
this.add(panel, BorderLayout.CENTER);
}

32
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDataPointLabel4GisPane.java

@ -1,23 +1,24 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Utils;
import com.fr.chart.base.AttrContents;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.FRFont;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -49,31 +50,18 @@ public class ChartDataPointLabel4GisPane extends ChartDatapointLabelPane{
initFormatListener();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { p, f };
double[] rowSize = { p,p,p,p,p,p};
JPanel delimiterPane = new JPanel(new BorderLayout(LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM));
delimiterPane.add(new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Delimiter_Symbol")), BorderLayout.WEST);
delimiterPane.add(divideComoBox, BorderLayout.CENTER);
Component[][] components = new Component[][]{
new Component[]{isAddress, null},
new Component[]{isAddressName, null},
new Component[]{isAddressTittle, null},
new Component[]{isDatapointValue, valueFormatButton},
new Component[]{delimiterPane, null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Delimiter_Symbol")), divideComoBox},
new Component[]{textFontPane, null}
};
labelPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
double[] row = {p,p};
double[] col = {LayoutConstants.CHART_ATTR_TOMARGIN, f};
JPanel panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow,null},new Component[]{null, labelPane}}, row, col);
labelPane = FineLayoutBuilder.commonLeftRightLayout(components);
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
JPanel panel = FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER) ;

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.CoreDecimalFormat;
import com.fr.base.FRContext;
import com.fr.base.Style;
@ -180,11 +182,8 @@ public class ChartDatapointLabelPane extends BasicPane{
components[6] = new Component[]{textFontPane,null};
labelPane = TableLayoutHelper.createTableLayoutPane(components,rowSize2,columnSize);
}
double[] row = {p,p};
double[] col = {LayoutConstants.CHART_ATTR_TOMARGIN, f};
panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow,null},new Component[]{null, labelPane}}, row, col);
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
panel = FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane );
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER) ;

11
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartAxisPane.java

@ -6,6 +6,7 @@ import com.fr.design.chart.ChartPlotFactory;
import com.fr.design.chart.axis.AxisStyleObject;
import com.fr.design.chart.axis.ChartStyleAxisPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ThirdTabPane;
@ -13,6 +14,7 @@ import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.List;
@ -28,6 +30,15 @@ public class ChartAxisPane extends ThirdTabPane<Chart> implements AutoSelectedPa
super(plot, parent);
}
@Override
protected void initLayout() {
this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
if (!paneList.isEmpty()) {
this.add(tabPane, BorderLayout.NORTH);
}
this.add(centerPane, BorderLayout.CENTER);
}
@Override
protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) {
List<NamePane> paneList = new ArrayList<NamePane>();

30
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula;
import com.fr.base.Utils;
import com.fr.chart.base.AxisUnitType;
@ -10,13 +11,11 @@ import com.fr.chart.chartattr.NumberAxis;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.ChartSwingUtils;
import com.fr.design.chart.axis.MinMaxValuePane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartAxisLabelPane;
@ -34,7 +33,6 @@ import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -153,15 +151,11 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
//构造数据定义界面
private JPanel createDataDefinePane(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f};
double[] rowSize = { p, p};
Component[][] component = new Component[][]{
new Component[]{null,initMinMaxValue(),null},
new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()},
new Component[]{initMinMaxValue(),null},
new Component[]{addLogarithmicPane2ValuePane(), addLogText()},
};
return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, component, new double[]{1, 1});
}
// 返回最大最小值界面. 雷达轴 有切换按钮.
@ -175,13 +169,11 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
// 返回对数相关界面. 百分比 没有此界面.
protected JPanel addLogarithmicPane2ValuePane() {
JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
labelLogPane.add(logBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Logarithmic")+":"));
labelLogPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Log_Base")));
logBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Logarithmic"));
logBaseField = new UITextField(4);
logBaseField.setText("10");
logBaseField.setPreferredSize(new Dimension(55, 20));
JPanel labelLogPane = FineLayoutBuilder.createHorizontalLayout(10, logBox,
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Log_Base")));
logBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -195,13 +187,7 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
}
private JPanel addLogText() {
JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
if(logBaseField != null) {
labelLogPane.add(logBaseField);
}
return labelLogPane;
return FineLayoutBuilder.createHorizontalLayout(10, logBaseField);
}
protected JPanel getAxisTitlePane(){

27
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/legend/ChartLegendPane.java

@ -1,15 +1,14 @@
package com.fr.design.mainframe.chart.gui.style.legend;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Legend;
import com.fr.chart.chartattr.Plot;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartBackgroundNoImagePane;
import com.fr.design.mainframe.chart.gui.style.ChartBorderPane;
@ -18,8 +17,11 @@ import com.fr.design.dialog.BasicScrollPane;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -70,24 +72,17 @@ public class ChartLegendPane extends BasicScrollPane<Chart>{
location.setAllToolTips(textArray);
backgroundPane = new ChartBackgroundNoImagePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN, f };
double[] rowSize = { p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{null,textAttrPane},
new Component[]{textAttrPane},
new Component[]{new JSeparator(),null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),location} ,
new Component[]{new JSeparator(),null},
new Component[]{borderPane,null},
new Component[]{backgroundPane,null}
};
legendPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
double[] col = {f};
double[] row = {p, p};
JPanel panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLegendVisible},new Component[]{legendPane},},row,col);
legendPane = FineLayoutBuilder.commonLeftRightLayout(components);
legendPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
JPanel panel = FineLayoutBuilder.createVerticalLayout(10, isLegendVisible, legendPane);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
isLegendVisible.addActionListener(new ActionListener() {

44
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/title/ChartTitlePane.java

@ -1,30 +1,27 @@
package com.fr.design.mainframe.chart.gui.style.title;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.chart.base.TextAttr;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Title;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartBackgroundNoImagePane;
import com.fr.design.mainframe.chart.gui.style.ChartBorderPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
@ -57,16 +54,12 @@ public class ChartTitlePane extends BasicScrollPane<Chart> {
isTitleVisable = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Title_Visible"));
titlePane = createTitlePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{isTitleVisable},
new Component[]{titlePane}
} ;
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1});
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
@ -83,10 +76,6 @@ public class ChartTitlePane extends BasicScrollPane<Chart> {
backgroundPane = new ChartBackgroundNoImagePane();
chartDefaultAttrPane = createDefaultAttrPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{chartDefaultAttrPane,null},
new Component[]{new JSeparator(),null},
@ -94,29 +83,22 @@ public class ChartTitlePane extends BasicScrollPane<Chart> {
new Component[]{backgroundPane,null}
} ;
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 0});
}
private JPanel createDefaultAttrPane(){
titleContent = new DefaultTinyFormulaPane();
textAttrPane = new ChartTextAttrPane();
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
alignmentPane = new UIButtonGroup<Integer>(alignmentIconArray, alignment);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {LayoutConstants.CHART_ATTR_TOMARGIN, p, f};
double[] rowSize = {p, p,p};
alignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup();
Component[][] components = new Component[][]{
new Component[]{null,titleContent,null},
new Component[]{null,textAttrPane,null},
new Component[]{null,new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alignment_Style") + ":"),alignmentPane} ,
new Component[]{titleContent,null},
new Component[]{textAttrPane,null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alignment_Style")), alignmentPane} ,
} ;
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
JPanel attrPane = FineLayoutBuilder.commonLeftRightLayout(components);
attrPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
return attrPane;
}
// 检查标题界面是否可用.

12
designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java vendored

@ -11,6 +11,7 @@ import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.annotions.Stop;
import com.fanruan.carina.annotions.Supplemental;
import com.fanruan.config.ConfigProviderFactory;
import com.fanruan.config.LocalConfigSource;
import com.fanruan.config.realm.ConfigRealm;
import com.fanruan.dao.context.DBContextProvider;
import com.fanruan.dao.context.DBContextStarter;
@ -64,12 +65,12 @@ import com.fr.intelli.record.Focus;
import com.fr.intelli.record.FocusInterceptor;
import com.fr.intelli.record.PerformancePoint;
import com.fr.intelli.record.PerformancePointInterceptor;
import com.fr.invoke.Reflect;
import com.fr.io.base.ResourcePaths;
import com.fr.io.repository.ResourceRepository;
import com.fr.io.repository.ResourceRepositoryWrapper;
import com.fr.io.utils.ResourceIOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.record.analyzer.AnalyzerConfiguration;
import com.fr.record.analyzer.AnalyzerMutableGroup;
import com.fr.record.analyzer.DBMetrics;
@ -81,7 +82,6 @@ import com.fr.security.encryption.SystemEncryptionManager;
import com.fr.security.encryption.core.EncryptionScaffold;
import com.fr.security.encryption.provider.SecuritySeedProvider;
import com.fr.security.encryption.storage.keys.LoadSeedSecurityKey;
import com.fr.stable.StringUtils;
import com.fr.stable.db.DBContext;
import com.fr.stable.db.properties.FineMicroServicesDBProperties;
@ -102,7 +102,6 @@ import com.fr.transaction.HibernateTransactor;
import com.fr.transaction.RemoteTransactor;
import com.fr.transaction.TransactorFactory;
import com.fr.workspace.WorkContext;
import com.fanruan.config.LocalConfigSource;
import com.fr.workspace.server.repository.config.LocalConfigSourceShell;
import java.net.URI;
@ -247,9 +246,14 @@ public class DesignEnvComponent {
*/
private void startLogger() {
// 获取本地的日志级别配置
Log4jConfigFactory.getInstance().setRootLevel(Log4jConfig.getInstance().getRootLevel());
Level localLogPreferLevel = Log4jConfig.getInstance().getRootLevel();
// 刷新到本地配置
Log4jConfigFactory.getInstance().setRootLevel(localLogPreferLevel);
URI uri = Log4jUtils.buildUserConfigURI(StringUtils.EMPTY);
FRLogger.getLogger().config(uri);
// 刷新到carina的配置,防止 portal service 启动的时候覆盖了
// 配置对象都是默认都文件读取的,设计器本地启动的阶段反射修改一下
Reflect.on(Carina.properties(LoggerProperties.class)).set("level", localLogPreferLevel.name());
// 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下
listenConfig();
}

7
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java

@ -292,12 +292,7 @@ public class DesensitizationCellPane extends BasicBeanPane {
protected void setLayoutAndAddComponents() {
// 使用BorderLayout,否则默认使用的FlowLayout会让整个下拉选框使用最小Size,然后TableCell这边会出现空白
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UITextField editor = getEditor();
UIButton arrowButton = getArrowButton();
setStyle(editor, TRANSPARENT_TEXT_FIELD);
setStyle(arrowButton, PLAIN_BUTTON);
this.add(editor, BorderLayout.CENTER);
this.add(arrowButton, BorderLayout.EAST);
this.add(getClickPane(), BorderLayout.CENTER);
}
@Override

8
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java

@ -1,10 +1,8 @@
package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.fr.base.operator.org.OrganizationOperator;
import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import javax.swing.SwingWorker;
import java.util.HashMap;
@ -26,8 +24,8 @@ public class UpdateDataWorker extends SwingWorker<Map<String, Object>, Void> {
@Override
protected Map<String, Object> doInBackground() {
Map<String, Object> result = new HashMap<>();
Map<String, String> allRoles = WorkContext.getCurrent().get(OrganizationOperator.class).getAllRoles4Desensitization();
Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> allRules = DesensitizationRuleManager.getInstance().getAllRules();
Map<String, String> allRoles = RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization();
Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> allRules = RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap();
result.put(ROLE_KEY, allRoles);
result.put(RULE_KEY, allRules);

Loading…
Cancel
Save