Browse Source

Merge remote-tracking branch 'origin/fbp/release' into fbp/release

# Conflicts:
#	designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java
#	designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java
fbp/merge
Destiny.Lin 3 months ago
parent
commit
b899c9c15b
  1. 5
      designer-base/src/main/java/com/fine/theme/light/ui/FineSliderUI.java
  2. 30
      designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java
  3. 2
      designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java
  4. 11
      designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DCTableDataJSBridge.java
  5. 16
      designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java
  6. 19
      designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java
  7. 2
      designer-base/src/main/java/com/fr/design/layout/TableLayoutHelper.java
  8. 19
      designer-base/src/main/java/com/fr/design/style/AlphaPane.java
  9. 19
      designer-base/src/main/java/com/fr/design/web/CustomIconPane.java
  10. 5
      designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java
  11. 3
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  12. 2
      designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java
  13. 29
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  14. 106
      designer-chart/src/main/java/com/fr/design/chart/axis/ChartAlertValuePane.java
  15. 23
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapDataPane.java
  16. 47
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapReportDataContentPane.java
  17. 79
      designer-chart/src/main/java/com/fr/design/chart/report/GisMapTableDataContentPane.java
  18. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  19. 110
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartAxisLabelPane.java
  20. 34
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartAxisTitlePane.java
  21. 32
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDataPointLabel4GisPane.java
  22. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java
  23. 11
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartAxisPane.java
  24. 32
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java
  25. 27
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/legend/ChartLegendPane.java
  26. 44
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/title/ChartTitlePane.java
  27. 16
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java
  28. 3
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java

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); defaultLabelHeight = FineUIUtils.getAndScaleInt("Slider.labelHeight", DEFAULT_LABEL_HEIGHT);
} }
@Override
protected Color getTrackColor() {
return trackColor;
}
@Override @Override
protected void calculateLabelRect() { protected void calculateLabelRect() {

30
designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java

@ -1,12 +1,22 @@
package com.fine.theme.utils; package com.fine.theme.utils;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.core.FormatField;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.Color;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.flex;
@ -62,4 +72,24 @@ public class FineComponentsFactory {
flex(), cell(confirmButton), cell(cancelButton)).getComponent(); flex(), cell(confirmButton), cell(cancelButton)).getComponent();
} }
/**
* 创建示例文本圆角边框&浅灰背景
*
* @return 示例文本Label
*/
public static UILabel createSampleLabel() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption");
Border interBorder = new UIRoundedBorder(labelColor, 0, 4);
Border border = BorderFactory.createTitledBorder(interBorder, Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"),
TitledBorder.ABOVE_TOP, 0, null, labelColor);
UILabel sampleLabel = new UILabel(FormatField.getInstance().getFormatValue());
sampleLabel.setHorizontalAlignment(UILabel.CENTER);
sampleLabel.setBorder(BorderFactory.createCompoundBorder(border, new ScaledEmptyBorder(2, 0, 8, 0)));
FineUIStyle.setStyle(sampleLabel, FineUIStyle.LABEL_TIP);
return sampleLabel;
}
} }

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.fine.swing.ui.layout.Spacer;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; 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.log.FineLoggerFactory;
import com.fr.stable.collections.combination.Pair; import com.fr.stable.collections.combination.Pair;

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

16
designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java

@ -1,9 +1,9 @@
package com.fr.design.gui.style; package com.fr.design.gui.style;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat; import com.fr.base.CoreDecimalFormat;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
@ -12,8 +12,6 @@ import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.icombobox.TextFontComboBox; import com.fr.design.gui.icombobox.TextFontComboBox;
@ -28,13 +26,10 @@ import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.math.RoundingMode; import java.math.RoundingMode;
import javax.swing.BorderFactory;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.text.Format; import java.text.Format;
@ -161,14 +156,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
} }
private void initSampleLabel() { private void initSampleLabel() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption"); sampleLabel = FineComponentsFactory.createSampleLabel();
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);
String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample");
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, labelColor);
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue());
sampleLabel.setHorizontalAlignment(UILabel.CENTER);
sampleLabel.setBorder(border);
FineUIStyle.setStyle(sampleLabel, FineUIStyle.LABEL_TIP);
} }

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

@ -1,15 +1,13 @@
package com.fr.design.gui.style; package com.fr.design.gui.style;
import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat; import com.fr.base.CoreDecimalFormat;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.data.core.FormatField.FormatContents; import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -22,17 +20,11 @@ import com.fr.design.i18n.Toolkit;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.math.RoundingMode; import java.math.RoundingMode;
@ -112,14 +104,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
} }
private void initPreviewLabel4GeneralFormat() { private void initPreviewLabel4GeneralFormat() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption"); previewLabel = FineComponentsFactory.createSampleLabel();
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 0, 4);
String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample");
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.ABOVE_TOP, 0, null, labelColor);
previewLabel = new UILabel(FormatField.getInstance().getFormatValue());
previewLabel.setHorizontalAlignment(UILabel.CENTER);
previewLabel.setBorder(border);
FineUIStyle.setStyle(previewLabel, FineUIStyle.LABEL_TIP);
} }
protected void initLayout() { protected void initLayout() {

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); JPanel secondMenu = createTableLayoutPane(components, rowSize, columnSize);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] column = {LayoutConstants.CHART_ATTR_TOMARGIN, f}; double[] column = {LayoutConstants.HORIZONTAL_GAP, f};
double[] row = {p, p}; double[] row = {p, p};
StringBuilder resultText = new StringBuilder(); StringBuilder resultText = new StringBuilder();
for (String text : title) { for (String text : title) {

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

@ -1,9 +1,7 @@
package com.fr.design.style; package com.fr.design.style;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.JFormattedTextField; import javax.swing.JFormattedTextField;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSlider; import javax.swing.JSlider;
@ -14,6 +12,7 @@ import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.islider.UISlider; import com.fr.design.gui.islider.UISlider;
@ -46,17 +45,10 @@ public class AlphaPane extends JPanel {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// 透明选项 // 透明选项
JPanel alphaPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); alphaSlider = new UISlider(UISlider.HORIZONTAL, 0, ALPHA_FLOAT, START_VALUE);
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));
valueSpinner = new UIBasicSpinner(new SpinnerListModel(values)); 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); JFormattedTextField field = GUICoreUtils.getSpinnerTextField(valueSpinner);
field.setText(checkFormat(START_VALUE)); field.setText(checkFormat(START_VALUE));
@ -65,9 +57,8 @@ public class AlphaPane extends JPanel {
field.setHorizontalAlignment(UITextField.LEFT); field.setHorizontalAlignment(UITextField.LEFT);
field.getDocument().addDocumentListener(textListener); field.getDocument().addDocumentListener(textListener);
} }
valueSpinner.setPreferredSize(new Dimension(60, 18));
alphaSlider.addChangeListener(changeListener); alphaSlider.addChangeListener(changeListener);
this.add(alphaPane, BorderLayout.CENTER);
} }
DocumentListener textListener = new DocumentListener() { 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.Icon;
import com.fr.base.IconManager; import com.fr.base.IconManager;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
@ -419,7 +420,7 @@ public class CustomIconPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UIButton browseButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Icon_SelectIcon")); 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")); 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)); nameTextField.setPreferredSize(FineUIScale.createScaleDimension(172, 24));
browseButton.addActionListener(e -> onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this))); browseButton.addActionListener(e -> onBrowseButtonClicked(SwingUtilities.getWindowAncestor(EditIconDialog.this)));
@ -446,16 +447,14 @@ public class CustomIconPane extends BasicPane {
showImageLabel = new UILabel(); showImageLabel = new UILabel();
showImageLabel.setPreferredSize(FineUIScale.createScaleDimension(50, 50)); showImageLabel.setPreferredSize(FineUIScale.createScaleDimension(50, 50));
JPanel centerPane = column(10, JPanel centerPane = column(LayoutConstants.VERTICAL_GAP,
row( row(40,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(1.2), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")),
cell(nameTextField).weight(3) cell(nameTextField)
), ),
row( row(40,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")).weight(1.2), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon") + ":")),
row( row(cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)).weight(1)
cell(showImageLabel), column(fix(13), cell(browseButton), fix(13)).weight(1)
).weight(3)
) )
).getComponent(); ).getComponent();
this.add(centerPane, BorderLayout.WEST); 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.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.frpane.FontSizeComboPane; 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.frpane.UIPercentDragPane;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
@ -67,7 +68,7 @@ public class WidgetStyleEditPane<T extends TemplateTheme> extends BasicBeanPane<
* 控件背景和透明度配置面板 * 控件背景和透明度配置面板
*/ */
protected NewColorSelectBox widgetBgColorSelectBox; 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 = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR); colorSelectBox.setSelectObject(WidgetThemeDisplayConstants.DEFAULT_THEME_COLOR);
widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); widgetBgColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);
widgetBgAlphaDragPane = new UIPercentDragPane(); widgetBgAlphaDragPane = new UINumberDragPaneWithPercent(0, 100, 1);
initLineBox(); initLineBox();
borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1); borderRadiusSpinner = new UISpinner(0, Integer.MAX_VALUE, 1);
iconColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true); iconColorSelectBox = new NewColorSelectBox(WidgetThemeDisplayConstants.THEME_WIDGET_COMPONENT_WIDTH, true);

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

@ -147,6 +147,7 @@ tooltip.normal=#3F506A
tooltip.disabled=#A3ADBD tooltip.disabled=#A3ADBD
hover.deep=#e2fbe6 hover.deep=#e2fbe6
fill.deep=#F6F9FE fill.deep=#F6F9FE
track.normal=#DADEE7
#---- Button ---- #---- Button ----
@ -731,7 +732,7 @@ Slider.trackWidth = 2
Slider.thumbSize = 12,12 Slider.thumbSize = 12,12
Slider.focusWidth=0 Slider.focusWidth=0
Slider.trackValueColor=$brand.normal Slider.trackValueColor=$brand.normal
Slider.trackColor=$border.divider Slider.trackColor=$track.normal
Slider.thumbColor=$fill.normal Slider.thumbColor=$fill.normal
Slider.thumbBorderColor=$border.divider Slider.thumbBorderColor=$border.divider
Slider.tickColor = @disabledForeground Slider.tickColor = @disabledForeground

2
designer-chart/src/main/java/com/fr/design/chart/ChartIcon.java

@ -24,7 +24,7 @@ import java.awt.Graphics2D;
* 图表的缩略图Icon, 在选择图表类型界面 用到. * 图表的缩略图Icon, 在选择图表类型界面 用到.
*/ */
public class ChartIcon implements Icon, XMLable { public class ChartIcon implements Icon, XMLable {
private static final int WIDTH = FineUIScale.scale(215); private static final int WIDTH = FineUIScale.scale(210);
private static final int HEIGHT = FineUIScale.scale(100); private static final int HEIGHT = FineUIScale.scale(100);

29
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -7,6 +7,7 @@ import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
@ -24,7 +25,6 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van; import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JLayer; import javax.swing.JLayer;
@ -74,6 +74,7 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
JLayer<UIScrollPane> typeScrollPane = FineUIUtils.createCollapsibleScrollBarLayer(mainTypeList); JLayer<UIScrollPane> typeScrollPane = FineUIUtils.createCollapsibleScrollBarLayer(mainTypeList);
iconViewList = new JList(); iconViewList = new JList();
iconViewList.setBorder(null);
iconListModel = new DefaultListModel(); iconListModel = new DefaultListModel();
iconViewList.setModel(iconListModel); iconViewList.setModel(iconListModel);
@ -104,20 +105,20 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
ChartIcon chartIcon = (ChartIcon) value; ChartIcon chartIcon = (ChartIcon) value;
UILabel centerImg = new UILabel(chartIcon); UILabel centerImg = new UILabel(chartIcon);
UILabel text = new UILabel(getChartName(chartIcon), SwingConstants.CENTER); UILabel text = new UILabel(getChartName(chartIcon), SwingConstants.CENTER);
Color borderColor = isSelected ? FineUIUtils.getUIColor("defaultHighlightBorderColor", "Component.focusedBorderColor") :
Column component = column( FineUIUtils.getUIColor("defaultBorderColor", "Component.borderColor");
fix(5), Color fillColor = FlatUIUtils.getUIColor("fill.normal", Color.WHITE);
cell(centerImg), cell(text),
fix(5)
).getComponent();
Color borderColor = isSelected ? FineUIUtils.getUIColor("defaultHighlightBorderColor", "Component.focusedBorderColor")
: FineUIUtils.getUIColor("defaultBorderColor", "Component.borderColor");
UIRoundedBorder roundedBorder = new UIRoundedBorder(borderColor, 1, 5); UIRoundedBorder roundedBorder = new UIRoundedBorder(borderColor, 1, 5);
component.setBorder(BorderFactory.createCompoundBorder( Column component = column(
new ScaledEmptyBorder(0, 10, 10, 0), roundedBorder)); fix(5), cell(centerImg), cell(text), fix(5)
component.setBackground(Color.WHITE); ).with(it -> {
return component; it.setOpaque(true);
it.setBorder(roundedBorder);
it.setBackground(fillColor);
}).getComponent();
JPanel pane = FineLayoutBuilder.asBorderLayoutWrapped(component);
pane.setBorder(new ScaledEmptyBorder(0, 10, 10, 0));
return pane;
} }
return this; return this;
} }

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

@ -1,5 +1,6 @@
package com.fr.design.chart.axis; package com.fr.design.chart.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.chartattr.ChartAlertValue; 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.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; 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.AlphaPane;
import com.fr.design.style.FRFontPane; import com.fr.design.style.FRFontPane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import javax.swing.*; import javax.swing.ButtonGroup;
import java.awt.*; 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.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; 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 * @author kunsnat E-mail:kunsnat@gmail.com
@ -56,29 +63,13 @@ public class ChartAlertValuePane extends BasicBeanPane<ChartAlertValue> {
public ChartAlertValuePane() { public ChartAlertValuePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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 = new UITextField();
textField.setColumns(4);
valuePane.add(textField);
textField.addMouseListener(new MouseAdapter() { textField.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
showFormulaPane(); showFormulaPane();
} }
}); });
textField.addKeyListener(new KeyAdapter() { textField.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
e.consume(); 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); 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); colorBox = new ColorSelectBox(80);
lineColorPane.add(colorBox);
alphaPane = new AlphaPane(); 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 = new UIComboBox();
fontNameBox.setPreferredSize(new Dimension(80,20));
fontNameBox.addItem("SimSun"); // TODO 这边字体中没有在列表内 fontNameBox.addItem("SimSun"); // TODO 这边字体中没有在列表内
String[] names = DesignUtils.getAvailableFontFamilyNames4Report(); String[] names = DesignUtils.getAvailableFontFamilyNames4Report();
@ -121,25 +107,31 @@ public class ChartAlertValuePane extends BasicBeanPane<ChartAlertValue> {
} }
fontSizeBox = new UIComboBox(); fontSizeBox = new UIComboBox();
fontSizeBox.setPreferredSize(new Dimension(80,20));
Integer[] sizes = FRFontPane.Font_Sizes; Integer[] sizes = FRFontPane.Font_Sizes;
for(int i = 0; i < sizes.length; i++) { for(int i = 0; i < sizes.length; i++) {
fontSizeBox.addItem(sizes[i]); fontSizeBox.addItem(sizes[i]);
} }
leftButton = new UIRadioButton(getLeftName());
double t = TableLayout.FILL; rightButton = new UIRadioButton(getRightName());
double[] rowSize = {t, t, t, t, t}; Component[][] components = {
double[] columnSize = {0.1, 0.2, 0.5, 0.2}; {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content") ), contentField = new UITextField()},
Component[][] components= { {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font")), fontNameBox},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content") + ":"), contentField = new UITextField(3)}, {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_Report_Font") + ":"), fontNameBox}, {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Font_Size") + ":"), fontSizeBox}, FineLayoutBuilder.createHorizontalLayout(10, leftButton, rightButton)},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout") + ": "), leftButton = new UIRadioButton(getLeftName())},
{null, null, rightButton = new UIRadioButton(getRightName())},
}; };
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(); ButtonGroup bg = new ButtonGroup();
bg.add(leftButton); 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; 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.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; 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.GisMapTableDefinition;
import com.fr.chart.chartdata.TopDefinition; import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.DataContentsPane; import com.fr.design.mainframe.chart.gui.data.DataContentsPane;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -102,17 +103,13 @@ public class GisMapDataPane extends DataContentsPane{
contentPane.add(dataFromPane = new UIComboBoxPane<Chart>() { contentPane.add(dataFromPane = new UIComboBoxPane<Chart>() {
protected void initLayout() { 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[][]{ 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(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
@ -134,7 +131,7 @@ public class GisMapDataPane extends DataContentsPane{
} }
}, BorderLayout.CENTER); }, BorderLayout.CENTER);
dataFromPane.setBorder(BorderFactory.createEmptyBorder(10 ,0, 0, 0)); dataFromPane.setBorder(new ScaledEmptyBorder(10 ,0, 0, 0));
return contentPane; 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; package com.fr.design.chart.report;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.chartdata.BaseSeriesDefinition; import com.fr.chart.chartdata.BaseSeriesDefinition;
import com.fr.chart.chartdata.GisMapReportDefinition; import com.fr.chart.chartdata.GisMapReportDefinition;
import com.fr.chart.chartdata.SeriesDefinition; import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; 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.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor; import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.FocusAdapter; import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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地图单元格数据源设置界面 * 属性表gis地图单元格数据源设置界面
* *
@ -55,37 +56,25 @@ public class GisMapReportDataContentPane extends FurtherBasicBeanPane<GisMapRepo
} }
private void initCom() { 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")}); 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")}); 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(); addressPane = new DefaultTinyFormulaPane();
addressNamePane = new DefaultTinyFormulaPane(); addressNamePane = new DefaultTinyFormulaPane();
double p = TableLayout.PREFERRED; orderPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
double f = TableLayout.FILL; new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng_Order")), lnglatOrder);
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.setVisible(false); orderPane.setVisible(false);
lnglatOrder.setSelectedIndex(0); lnglatOrder.setSelectedIndex(0);
addressType.setSelectedIndex(0); addressType.setSelectedIndex(0);
Component[][] components = new Component[][]{ JPanel northPane = column(10,
new Component[]{addressType, addressPane}, row(10,
new Component[]{orderPane, null}, cell(addressType).weight(1), cell(addressPane).weight(1)
new Component[]{new UILabel(" " +com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address_Name")+":", SwingConstants.RIGHT), addressNamePane}, ),
}; cell(orderPane),
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); 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); this.add(northPane, BorderLayout.NORTH);

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

@ -1,10 +1,10 @@
package com.fr.design.chart.report; package com.fr.design.chart.report;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartdata.GisMapTableDefinition; import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.chartdata.SeriesDefinition; import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.constants.LayoutConstants;
import com.fr.data.impl.NameTableData; import com.fr.data.impl.NameTableData;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.FurtherBasicBeanPane; 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.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor; import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; 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.ChangeEvent;
import javax.swing.event.ChangeListener; 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.FocusAdapter;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -34,6 +37,10 @@ import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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地图数据集数据源定义面板 * 属性表gis地图数据集数据源定义面板
* @author eason * @author eason
@ -54,26 +61,20 @@ public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTable
private JPanel orderPane; private JPanel orderPane;
public GisMapTableDataContentPane() { public GisMapTableDataContentPane() {
this.setLayout(new BorderLayout()); this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Dataset"), SwingConstants.LEFT);
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new FlowLayout(FlowLayout.LEFT)); fromTableData = new DatabaseTableDataPane(label) {
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Dataset") + ":", SwingConstants.LEFT);
northPane.add(fromTableData = new DatabaseTableDataPane(label) {
@Override @Override
protected void userEvent() { protected void userEvent() {
refresh2ComboBox(); refresh2ComboBox();
} }
}); };
fromTableData.setPreferredSize(new Dimension(218, 20)); JPanel northPane = FineLayoutBuilder.asBorderLayoutWrapped(fromTableData);
northPane.add(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")}); 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")}); 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")});
addressType.addChangeListener(new ChangeListener() { addressType.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -82,22 +83,8 @@ public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTable
}); });
addressBox = new UIComboBox(); addressBox = new UIComboBox();
addressNameBox = new UIComboBox(); addressNameBox = new UIComboBox();
double p = TableLayout.PREFERRED; orderPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
double f = TableLayout.FILL; new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_LatLng_Order")), lnglatOrder);
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.setVisible(false); orderPane.setVisible(false);
lnglatOrder.setSelectedIndex(0); lnglatOrder.setSelectedIndex(0);
addressType.setSelectedIndex(0); addressType.setSelectedIndex(0);
@ -105,17 +92,19 @@ public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTable
addressNameBox.removeAllItems(); addressNameBox.removeAllItems();
addressNameBox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")); addressNameBox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
Component[][] components = new Component[][]{ JPanel centerPane = column(10,
new Component[]{addressType, addressBox}, row(10,
new Component[]{orderPane,null}, cell(addressType).weight(1), cell(addressBox).weight(0.5)
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address_Name") + ":", SwingConstants.RIGHT), addressNameBox}, ),
}; cell(orderPane),
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Address_Name"))).weight(1.2),
JPanel pane = new JPanel(); cell(addressNameBox).weight(3)
)
).getComponent();
JPanel pane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(0, 10));
this.add(pane, BorderLayout.CENTER); this.add(pane, BorderLayout.CENTER);
pane.setLayout(new BorderLayout());
pane.add(centerPane, BorderLayout.NORTH); 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")}; 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; package com.fr.design.mainframe.chart.gui.other;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.CoreDecimalFormat; import com.fr.base.CoreDecimalFormat;
import com.fr.base.Style; import com.fr.base.Style;
@ -407,11 +408,11 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isAutoRefresh, null}, 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")), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")),
autoRefreshTime, autoRefreshTime,
new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds")) 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}, 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); 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; 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.BaseFormula;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.ChartBaseUtils; import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Axis;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; 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.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.NumberDragBar; 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.ChangeEvent;
import javax.swing.event.ChangeListener; 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.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -155,33 +159,26 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
} }
private JPanel getWrapShowWayPane() { 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[][]{ 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},
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose},
new Component[]{null, orientationSpinner, orientationBar, null}, new Component[]{null, createorientionRow()},
new Component[]{null, textAttrPane, null, null}, new Component[]{textAttrPane, null, null},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3});
} }
private JPanel getIntervalShowWayPane() { private Row createorientionRow() {
return FineLayoutBuilder.createHorizontalLayout(10, new double[]{1, 1.5}, orientationSpinner, orientationBar);
double p = TableLayout.PREFERRED; }
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
private JPanel getIntervalShowWayPane() {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{getCombox()}, new Component[]{getCombox()},
new Component[]{getTowChoose()}, new Component[]{getTowChoose()},
new Component[]{getOther()} new Component[]{getOther()}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
} }
private JPanel getTowChoose() { private JPanel getTowChoose() {
@ -192,46 +189,30 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
custom.setSelected(false); custom.setSelected(false);
customLabelSamleTime.setVisible(true); customLabelSamleTime.setVisible(true);
customLabelSamleTime.setEnabled(false); 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[][]{ JPanel customPane = FineLayoutBuilder.createHorizontalLayout(10, custom, customLabelSamleTime);
new Component[]{custom, customLabelSamleTime, null},
}, new double[]{p}, new double[]{p, p, f});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, auto,}, new Component[]{auto,},
new Component[]{null, customPane} new Component[]{customPane}
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1});
} }
private JPanel getCombox() { 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[][]{ 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() { 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[][]{ 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[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose},
new Component[]{null, orientationSpinner, orientationBar, null}, new Component[]{null, createorientionRow()},
new Component[]{null, textAttrPane, null, null}, new Component[]{textAttrPane, null, null},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
private void checkShowWay() { private void checkShowWay() {
@ -246,18 +227,13 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
} else { } else {
labelPane = getWrapShowWayPane(); labelPane = getWrapShowWayPane();
} }
double p = TableLayout.PREFERRED; labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
double f = TableLayout.FILL; showWayPane = FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane);
double[] row = {p, p};
double[] col = {f};
showWayPane = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow}, new Component[]{labelPane}}, row, col);
this.add(showWayPane, BorderLayout.CENTER); this.add(showWayPane, BorderLayout.CENTER);
this.validate(); this.validate();
} }
private void checkOrientationField() { private void checkOrientationField() {
if (labelOrientationChoose.getSelectedIndex() != 2) { if (labelOrientationChoose.getSelectedIndex() != 2) {
orientationBar.setVisible(false); orientationBar.setVisible(false);
@ -283,23 +259,17 @@ public class ChartAxisLabelPane extends BasicPane implements UIObserver{
customLabelSamleTime.registerChangeListener(this.observerListener); customLabelSamleTime.registerChangeListener(this.observerListener);
orientationSpinner.registerChangeListener(this.observerListener); orientationSpinner.registerChangeListener(this.observerListener);
labelOrientationChoose.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[][]{ Component[][] components = new Component[][]{
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelSampleChoose, customLabelSamleTime}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")),
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose, null}, FineLayoutBuilder.createHorizontalLayout(10,labelSampleChoose, customLabelSamleTime)},
new Component[]{null,orientationSpinner, orientationBar, null}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation")), labelOrientationChoose},
new Component[]{null,textAttrPane, null, null}, new Component[]{null, createorientionRow()},
new Component[]{textAttrPane, null},
}; };
labelPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); labelPane = FineLayoutBuilder.commonLeftRightLayout(components);
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
double[] row = {p,p}; return FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane);
double[] col = {f};
return TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow}, new Component[]{labelPane}}, row, col);
} }
private void checkCustomSampleField() { 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; 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.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Title; import com.fr.chart.chartattr.Title;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; 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.general.FRFont;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
@ -46,24 +44,17 @@ public class ChartAxisTitlePane extends BasicPane{
axisTitleContentPane = new DefaultTinyFormulaPane(); axisTitleContentPane = new DefaultTinyFormulaPane();
axisTitleAttrPane = new ChartTextAttrPane(); axisTitleAttrPane = new ChartTextAttrPane();
axisTitleAttrPane.populate(FRFont.getInstance("Microsoft YaHei", Font.PLAIN, 9)); axisTitleAttrPane.populate(FRFont.getInstance("Microsoft YaHei", Font.PLAIN, 9));
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), titleAlignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup();
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.setSelectedItem(Constants.CENTER); 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[][]{ Component[][] components = new Component[][]{
new Component[]{null,axisTitleContentPane}, new Component[]{axisTitleContentPane},
new Component[]{null,axisTitleAttrPane}, new Component[]{axisTitleAttrPane},
new Component[]{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alignment_Style"))}, new Component[]{FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new Component[]{null,titleAlignmentPane,}, 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() { isAxisTitleVisable.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { 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()); this.setLayout(new BorderLayout());
JPanel panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{ JPanel panel = FineLayoutBuilder.createVerticalLayout(10, isAxisTitleVisable, titlePane);
new Component[]{isAxisTitleVisable}, new Component[]{titlePane}}, row, col);
this.add(panel, BorderLayout.CENTER); 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; 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.base.Utils;
import com.fr.chart.base.AttrContents; import com.fr.chart.base.AttrContents;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel; 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.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -49,31 +50,18 @@ public class ChartDataPointLabel4GisPane extends ChartDatapointLabelPane{
initFormatListener(); 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[][]{ Component[][] components = new Component[][]{
new Component[]{isAddress, null}, new Component[]{isAddress, null},
new Component[]{isAddressName, null}, new Component[]{isAddressName, null},
new Component[]{isAddressTittle, null}, new Component[]{isAddressTittle, null},
new Component[]{isDatapointValue, valueFormatButton}, 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} new Component[]{textFontPane, null}
}; };
labelPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); labelPane = FineLayoutBuilder.commonLeftRightLayout(components);
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
double[] row = {p,p}; JPanel panel = FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane);
double[] col = {LayoutConstants.CHART_ATTR_TOMARGIN, f};
JPanel panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow,null},new Component[]{null, labelPane}}, row, col);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER) ; 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; 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.CoreDecimalFormat;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Style; import com.fr.base.Style;
@ -180,11 +182,8 @@ public class ChartDatapointLabelPane extends BasicPane{
components[6] = new Component[]{textFontPane,null}; components[6] = new Component[]{textFontPane,null};
labelPane = TableLayoutHelper.createTableLayoutPane(components,rowSize2,columnSize); labelPane = TableLayoutHelper.createTableLayoutPane(components,rowSize2,columnSize);
} }
labelPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
double[] row = {p,p}; panel = FineLayoutBuilder.createVerticalLayout(10, isLabelShow, labelPane );
double[] col = {LayoutConstants.CHART_ATTR_TOMARGIN, f};
panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLabelShow,null},new Component[]{null, labelPane}}, row, col);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER) ; 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.AxisStyleObject;
import com.fr.design.chart.axis.ChartStyleAxisPane; import com.fr.design.chart.axis.ChartStyleAxisPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; 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.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ThirdTabPane; 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.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import java.awt.BorderLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -28,6 +30,15 @@ public class ChartAxisPane extends ThirdTabPane<Chart> implements AutoSelectedPa
super(plot, parent); 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 @Override
protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) { protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) {
List<NamePane> paneList = new ArrayList<NamePane>(); List<NamePane> paneList = new ArrayList<NamePane>();

32
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; package com.fr.design.mainframe.chart.gui.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.AxisUnitType; 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.chart.chartattr.Plot;
import com.fr.design.chart.ChartSwingUtils; import com.fr.design.chart.ChartSwingUtils;
import com.fr.design.chart.axis.MinMaxValuePane; 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.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.FormatPane; import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartAxisLabelPane; import com.fr.design.mainframe.chart.gui.style.ChartAxisLabelPane;
@ -34,7 +33,6 @@ import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -153,15 +151,11 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
//构造数据定义界面 //构造数据定义界面
private JPanel createDataDefinePane(){ 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[][]{ Component[][] component = new Component[][]{
new Component[]{null,initMinMaxValue(),null}, new Component[]{initMinMaxValue(),null},
new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, new Component[]{addLogarithmicPane2ValuePane(), addLogText()},
}; };
return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(10, component, new double[]{1, 1});
} }
// 返回最大最小值界面. 雷达轴 有切换按钮. // 返回最大最小值界面. 雷达轴 有切换按钮.
@ -175,15 +169,13 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
// 返回对数相关界面. 百分比 没有此界面. // 返回对数相关界面. 百分比 没有此界面.
protected JPanel addLogarithmicPane2ValuePane() { protected JPanel addLogarithmicPane2ValuePane() {
JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); logBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Logarithmic"));
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")));
logBaseField = new UITextField(4); logBaseField = new UITextField(4);
logBaseField.setText("10"); 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() { logBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkLogUse(); checkLogUse();
} }
@ -195,13 +187,7 @@ public class ChartValuePane extends ChartAxisUsePane<Axis>{
} }
private JPanel addLogText() { private JPanel addLogText() {
JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); return FineLayoutBuilder.createHorizontalLayout(10, logBaseField);
if(logBaseField != null) {
labelLogPane.add(logBaseField);
}
return labelLogPane;
} }
protected JPanel getAxisTitlePane(){ 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; 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.base.BaseUtils;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Legend; import com.fr.chart.chartattr.Legend;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.BoldFontTextLabel; 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.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartBackgroundNoImagePane; 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.ChartBorderPane;
@ -18,8 +17,11 @@ import com.fr.design.dialog.BasicScrollPane;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.Icon;
import java.awt.*; 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.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -70,24 +72,17 @@ public class ChartLegendPane extends BasicScrollPane<Chart>{
location.setAllToolTips(textArray); location.setAllToolTips(textArray);
backgroundPane = new ChartBackgroundNoImagePane(); 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[][]{ Component[][] components = new Component[][]{
new Component[]{null,textAttrPane}, new Component[]{textAttrPane},
new Component[]{new JSeparator(),null}, new Component[]{new JSeparator(),null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),location} , new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),location} ,
new Component[]{new JSeparator(),null}, new Component[]{new JSeparator(),null},
new Component[]{borderPane,null}, new Component[]{borderPane,null},
new Component[]{backgroundPane,null} new Component[]{backgroundPane,null}
}; };
legendPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); legendPane = FineLayoutBuilder.commonLeftRightLayout(components);
double[] col = {f}; legendPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
double[] row = {p, p}; JPanel panel = FineLayoutBuilder.createVerticalLayout(10, isLegendVisible, legendPane);
JPanel panel = TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{isLegendVisible},new Component[]{legendPane},},row,col);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
isLegendVisible.addActionListener(new ActionListener() { 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; 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.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Title; import com.fr.chart.chartattr.Title;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.BoldFontTextLabel; 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.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartBackgroundNoImagePane; 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.ChartBorderPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.stable.Constants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import java.awt.BorderLayout; 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")); isTitleVisable = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Title_Visible"));
titlePane = createTitlePane(); titlePane = createTitlePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isTitleVisable}, new Component[]{isTitleVisable},
new Component[]{titlePane} new Component[]{titlePane}
} ; } ;
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1});
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
@ -83,10 +76,6 @@ public class ChartTitlePane extends BasicScrollPane<Chart> {
backgroundPane = new ChartBackgroundNoImagePane(); backgroundPane = new ChartBackgroundNoImagePane();
chartDefaultAttrPane = createDefaultAttrPane(); 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[][]{ Component[][] components = new Component[][]{
new Component[]{chartDefaultAttrPane,null}, new Component[]{chartDefaultAttrPane,null},
new Component[]{new JSeparator(),null}, new Component[]{new JSeparator(),null},
@ -94,29 +83,22 @@ public class ChartTitlePane extends BasicScrollPane<Chart> {
new Component[]{backgroundPane,null} new Component[]{backgroundPane,null}
} ; } ;
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 0});
} }
private JPanel createDefaultAttrPane(){ private JPanel createDefaultAttrPane(){
titleContent = new DefaultTinyFormulaPane(); titleContent = new DefaultTinyFormulaPane();
textAttrPane = new ChartTextAttrPane(); textAttrPane = new ChartTextAttrPane();
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), alignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup();
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};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null,titleContent,null}, new Component[]{titleContent,null},
new Component[]{null,textAttrPane,null}, new Component[]{textAttrPane,null},
new Component[]{null,new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alignment_Style") + ":"),alignmentPane} , new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alignment_Style")), alignmentPane} ,
} ; } ;
JPanel attrPane = FineLayoutBuilder.commonLeftRightLayout(components);
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); attrPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
return attrPane;
} }
// 检查标题界面是否可用. // 检查标题界面是否可用.

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

@ -2,6 +2,7 @@ package com.fanruan.boot.env;
import com.fanruan.boot.FSProperties; import com.fanruan.boot.FSProperties;
import com.fanruan.boot.KVProperties; import com.fanruan.boot.KVProperties;
import com.fanruan.boot.LoggerProperties;
import com.fanruan.boot.SchedulerCoreComponent; import com.fanruan.boot.SchedulerCoreComponent;
import com.fanruan.carina.Carina; import com.fanruan.carina.Carina;
import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.FineComponent;
@ -10,6 +11,7 @@ import com.fanruan.carina.annotions.Start;
import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Stop;
import com.fanruan.carina.annotions.Supplemental; import com.fanruan.carina.annotions.Supplemental;
import com.fanruan.config.ConfigProviderFactory; import com.fanruan.config.ConfigProviderFactory;
import com.fanruan.config.LocalConfigSource;
import com.fanruan.config.realm.ConfigRealm; import com.fanruan.config.realm.ConfigRealm;
import com.fanruan.dao.context.DBContextProvider; import com.fanruan.dao.context.DBContextProvider;
import com.fanruan.dao.context.DBContextStarter; import com.fanruan.dao.context.DBContextStarter;
@ -25,6 +27,7 @@ import com.fanruan.kv.factory.KVStoreFactory;
import com.fanruan.kv.manager.CarinaKVManager; import com.fanruan.kv.manager.CarinaKVManager;
import com.fanruan.kv.store.KVStore; import com.fanruan.kv.store.KVStore;
import com.fanruan.kv.store.KVStoreHolder; import com.fanruan.kv.store.KVStoreHolder;
import com.fanruan.repository.LocalConfigSourceShell;
import com.fanruan.workplace.http.RepositoryManager; import com.fanruan.workplace.http.RepositoryManager;
import com.fr.cbb.dialect.security.InsecurityElementFactory; import com.fr.cbb.dialect.security.InsecurityElementFactory;
import com.fr.cluster.ClusterBridge; import com.fr.cluster.ClusterBridge;
@ -63,12 +66,12 @@ import com.fr.intelli.record.Focus;
import com.fr.intelli.record.FocusInterceptor; import com.fr.intelli.record.FocusInterceptor;
import com.fr.intelli.record.PerformancePoint; import com.fr.intelli.record.PerformancePoint;
import com.fr.intelli.record.PerformancePointInterceptor; import com.fr.intelli.record.PerformancePointInterceptor;
import com.fr.invoke.Reflect;
import com.fr.io.base.ResourcePaths; import com.fr.io.base.ResourcePaths;
import com.fr.io.repository.ResourceRepository; import com.fr.io.repository.ResourceRepository;
import com.fr.io.repository.ResourceRepositoryWrapper; import com.fr.io.repository.ResourceRepositoryWrapper;
import com.fr.io.utils.ResourceIOUtils; import com.fr.io.utils.ResourceIOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.record.analyzer.AnalyzerConfiguration; import com.fr.record.analyzer.AnalyzerConfiguration;
import com.fr.record.analyzer.AnalyzerMutableGroup; import com.fr.record.analyzer.AnalyzerMutableGroup;
import com.fr.record.analyzer.DBMetrics; import com.fr.record.analyzer.DBMetrics;
@ -80,7 +83,6 @@ import com.fr.security.encryption.SystemEncryptionManager;
import com.fr.security.encryption.core.EncryptionScaffold; import com.fr.security.encryption.core.EncryptionScaffold;
import com.fr.security.encryption.provider.SecuritySeedProvider; import com.fr.security.encryption.provider.SecuritySeedProvider;
import com.fr.security.encryption.storage.keys.LoadSeedSecurityKey; import com.fr.security.encryption.storage.keys.LoadSeedSecurityKey;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.db.DBContext; import com.fr.stable.db.DBContext;
import com.fr.stable.db.properties.FineMicroServicesDBProperties; import com.fr.stable.db.properties.FineMicroServicesDBProperties;
@ -88,6 +90,7 @@ import com.fr.stable.db.session.DBSession;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.tenant.context.TenantContext; import com.fr.tenant.context.TenantContext;
import com.fr.tenant.context.provider.CurrentTenantKey; import com.fr.tenant.context.provider.CurrentTenantKey;
import com.fr.third.apache.logging.log4j.Level;
import com.fr.third.apache.logging.log4j.core.config.Configurator; import com.fr.third.apache.logging.log4j.core.config.Configurator;
import com.fr.third.net.bytebuddy.implementation.MethodDelegation; import com.fr.third.net.bytebuddy.implementation.MethodDelegation;
import com.fr.third.net.bytebuddy.matcher.ElementMatchers; import com.fr.third.net.bytebuddy.matcher.ElementMatchers;
@ -100,8 +103,6 @@ import com.fr.transaction.HibernateTransactor;
import com.fr.transaction.RemoteTransactor; import com.fr.transaction.RemoteTransactor;
import com.fr.transaction.TransactorFactory; import com.fr.transaction.TransactorFactory;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fanruan.config.LocalConfigSource;
import com.fanruan.repository.LocalConfigSourceShell;
import java.net.URI; import java.net.URI;
import java.sql.Connection; import java.sql.Connection;
@ -245,9 +246,14 @@ public class DesignEnvComponent {
*/ */
private void startLogger() { private void startLogger() {
// 获取本地的日志级别配置 // 获取本地的日志级别配置
Log4jConfigFactory.getInstance().setRootLevel(Log4jConfig.getInstance().getRootLevel()); Level localLogPreferLevel = Log4jConfig.getInstance().getRootLevel();
// 刷新到本地配置
Log4jConfigFactory.getInstance().setRootLevel(localLogPreferLevel);
URI uri = Log4jUtils.buildUserConfigURI(StringUtils.EMPTY); URI uri = Log4jUtils.buildUserConfigURI(StringUtils.EMPTY);
FRLogger.getLogger().config(uri); FRLogger.getLogger().config(uri);
// 刷新到carina的配置,防止 portal service 启动的时候覆盖了
// 配置对象都是默认都文件读取的,设计器本地启动的阶段反射修改一下
Reflect.on(Carina.properties(LoggerProperties.class)).set("level", localLogPreferLevel.name());
// 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下 // 日志配置更新的监听在FRLogger里面,fbp去掉了但是设计器本地还是需要这个监听的,初始化的时候监听一下
listenConfig(); listenConfig();
} }

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

@ -1,6 +1,5 @@
package com.fr.design.mainframe.cell.settingpane.desensitization.model; package com.fr.design.mainframe.cell.settingpane.desensitization.model;
import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
@ -26,7 +25,7 @@ public class UpdateDataWorker extends SwingWorker<Map<String, Object>, Void> {
protected Map<String, Object> doInBackground() { protected Map<String, Object> doInBackground() {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
Map<String, String> allRoles = RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization(); Map<String, String> allRoles = RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization();
Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> allRules = DesensitizationRuleManager.getInstance().getAllRules(); Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> allRules = RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap();
result.put(ROLE_KEY, allRoles); result.put(ROLE_KEY, allRoles);
result.put(RULE_KEY, allRules); result.put(RULE_KEY, allRules);

Loading…
Cancel
Save