Browse Source

REPORT-111995 东区主要面板布局翻新

newui
Levy.Xie-解安森 1 year ago
parent
commit
5f2d8b7139
  1. 21
      designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java
  2. 10
      designer-base/src/main/java/com/fr/design/constants/LayoutConstants.java
  3. 45
      designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java
  4. 2
      designer-base/src/main/java/com/fr/design/dialog/MultiTabPane.java
  5. 47
      designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java
  6. 2
      designer-base/src/main/java/com/fr/design/editor/editor/ColumnIndexEditor.java
  7. 8
      designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java
  8. 7
      designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java
  9. 22
      designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java
  10. 2
      designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java
  11. 72
      designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java
  12. 13
      designer-base/src/main/java/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java
  13. 4
      designer-base/src/main/java/com/fr/design/gui/frpane/UIComboBoxPane.java
  14. 50
      designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java
  15. 7
      designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBox.java
  16. 17
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  17. 6
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java
  18. 14
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java
  19. 231
      designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java
  20. 24
      designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java
  21. 98
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  22. 213
      designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java
  23. 37
      designer-base/src/main/java/com/fr/design/gui/style/TextFontTippedPane.java
  24. 136
      designer-base/src/main/java/com/fr/design/gui/style/TextFormatPane.java
  25. 16
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  26. 31
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java
  27. 54
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java
  28. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java
  29. 45
      designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java
  30. 28
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  31. 6
      designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java
  32. 47
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  33. 5
      designer-base/src/main/resources/com/fine/theme/icon/cellelement.svg
  34. 5
      designer-base/src/main/resources/com/fine/theme/icon/cellelement_disable.svg
  35. 10
      designer-base/src/main/resources/com/fine/theme/icon/close/close.svg
  36. 10
      designer-base/src/main/resources/com/fine/theme/icon/close/close_disable.svg
  37. 11
      designer-base/src/main/resources/com/fine/theme/icon/close/close_round.svg
  38. 11
      designer-base/src/main/resources/com/fine/theme/icon/close/close_round_disable.svg
  39. 4
      designer-base/src/main/resources/com/fine/theme/icon/font/add_parenthesis.svg
  40. 4
      designer-base/src/main/resources/com/fine/theme/icon/font/add_parenthesis_disable.svg
  41. 11
      designer-base/src/main/resources/com/fine/theme/icon/font/remove_parenthesis.svg
  42. 11
      designer-base/src/main/resources/com/fine/theme/icon/font/remove_parenthesis_disable.svg
  43. 17
      designer-base/src/main/resources/com/fine/theme/icon/font/shadow.svg
  44. 17
      designer-base/src/main/resources/com/fine/theme/icon/font/shadow_disable.svg
  45. 3
      designer-base/src/main/resources/com/fine/theme/icon/font/strike.svg
  46. 3
      designer-base/src/main/resources/com/fine/theme/icon/font/strike_disable.svg
  47. 3
      designer-base/src/main/resources/com/fine/theme/icon/font/sub.svg
  48. 3
      designer-base/src/main/resources/com/fine/theme/icon/font/sub_disable.svg
  49. 3
      designer-base/src/main/resources/com/fine/theme/icon/font/super.svg
  50. 3
      designer-base/src/main/resources/com/fine/theme/icon/font/super_disable.svg
  51. 4
      designer-base/src/main/resources/com/fine/theme/icon/select.svg
  52. 4
      designer-base/src/main/resources/com/fine/theme/icon/select_disable.svg
  53. 6
      designer-base/src/main/resources/com/fine/theme/icon/sort/fill/nosort.svg
  54. 8
      designer-base/src/main/resources/com/fine/theme/icon/sort/fill/sort_asc.svg
  55. 8
      designer-base/src/main/resources/com/fine/theme/icon/sort/fill/sort_desc.svg
  56. 6
      designer-base/src/main/resources/com/fine/theme/icon/sort/nosort.svg
  57. 6
      designer-base/src/main/resources/com/fine/theme/icon/sort/nosort_disable.svg
  58. 8
      designer-base/src/main/resources/com/fine/theme/icon/sort/sort_asc.svg
  59. 8
      designer-base/src/main/resources/com/fine/theme/icon/sort/sort_asc_disable.svg
  60. 0
      designer-base/src/main/resources/com/fine/theme/icon/sort/sort_desc.svg
  61. 0
      designer-base/src/main/resources/com/fine/theme/icon/sort/sort_desc_disable.svg
  62. 9
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  63. 76
      designer-realize/src/main/java/com/fr/design/expand/ExpandFatherPane.java
  64. 28
      designer-realize/src/main/java/com/fr/design/mainframe/AbstractAttrPane.java
  65. 39
      designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java
  66. 78
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java
  67. 554
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  68. 43
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java
  69. 115
      designer-realize/src/main/java/com/fr/design/present/BarCodePane.java
  70. 80
      designer-realize/src/main/java/com/fr/design/present/CurrencyLinePane.java
  71. 6
      designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortItemPane.java
  72. 8
      designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortItemPane.java
  73. 29
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortGroupPane.java
  74. 99
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortItemPane.java
  75. 42
      designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java
  76. 41
      designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java
  77. 28
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java
  78. 14
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceSortExpressionPane.java
  79. 12
      designer-realize/src/main/java/com/fr/design/sort/expressionpane/FormulaSortExpressionPane.java
  80. 196
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java
  81. 37
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderSettingPane.java
  82. 47
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java
  83. 28
      designer-realize/src/main/java/com/fr/design/sort/header/SortHeaderPane.java
  84. 73
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java
  85. 42
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  86. 39
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java
  87. 4
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java

21
designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java

@ -37,6 +37,7 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("down_arrow", "com/fine/theme/icon/down_arrow.svg", true),
new SvgIconSource("down_arrow_12", "com/fine/theme/icon/down_arrow.svg", true, 12),
new SvgIconSource("up_arrow_12", "com/fine/theme/icon/up_arrow.svg", true, 12),
new SvgIconSource("select", "com/fine/theme/icon/select.svg", true),
// 数据集相关Icon
new SvgIconSource("database", "com/fine/theme/icon/dataset/database.svg", true),
@ -144,7 +145,6 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("tool_copy", "com/fine/theme/icon/toolbar/copy.svg", true),
new SvgIconSource("move_down", "com/fine/theme/icon/toolbar/move_down.svg", true),
new SvgIconSource("move_up", "com/fine/theme/icon/toolbar/move_up.svg", true),
new SvgIconSource("sort_asc", "com/fine/theme/icon/toolbar/sort_asc.svg", true),
new SvgIconSource("tool_edit", "com/fine/theme/icon/toolbar/edit.svg", true),
new SvgIconSource("tool_edit_white", "com/fine/theme/icon/toolbar/edit_white.svg", true),
@ -159,6 +159,8 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("notification", "com/fine/theme/icon/notification/notification.svg"),
new SvgIconSource("notification_dot", "com/fine/theme/icon/notification/notification_dot.svg"),
//东区面板
new SvgIconSource("cellelement_small", "com/fine/theme/icon/cellelement.svg"),
// 三角
new SvgIconSource("triangle_down", "com/fine/theme/icon/triangle/triangle_down.svg"),
@ -172,6 +174,23 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("zoomIn", "com/fine/theme/icon/zoom/zoomIn.svg", true),
new SvgIconSource("zoomOut", "com/fine/theme/icon/zoom/zoomOut.svg", true),
//排序
new SvgIconSource("sort_asc", "com/fine/theme/icon/sort/sort_asc.svg", true),
new SvgIconSource("sort_desc", "com/fine/theme/icon/sort/sort_desc.svg", true),
new SvgIconSource("nosort", "com/fine/theme/icon/sort/nosort.svg", true),
// 关闭
new SvgIconSource("close", "com/fine/theme/icon/close/close.svg", true),
new SvgIconSource("close_round", "com/fine/theme/icon/close/close_round.svg", true),
// 文字样式
new SvgIconSource("add_parenthesis", "com/fine/theme/icon/font/add_parenthesis.svg", true),
new SvgIconSource("remove_parenthesis", "com/fine/theme/icon/font/remove_parenthesis.svg", true),
new SvgIconSource("shadow", "com/fine/theme/icon/font/shadow.svg", true),
new SvgIconSource("strike", "com/fine/theme/icon/font/strike.svg", true),
new SvgIconSource("sub", "com/fine/theme/icon/font/sub.svg", true),
new SvgIconSource("super", "com/fine/theme/icon/font/super.svg", true),
new SvgIconSource("dot", "com/fine/theme/icon/dot.svg", true),
new SvgIconSource("expand_popup", "com/fine/theme/icon/popup/expand_popup.svg"),
new SvgIconSource("collapse_popup", "com/fine/theme/icon/popup/collapse_popup.svg")

10
designer-base/src/main/java/com/fr/design/constants/LayoutConstants.java

@ -42,4 +42,14 @@ public class LayoutConstants {
* 图表属性表中二级菜单距离右边框的距离
*/
public static final int CHART_ATTR_TOMARGIN = 46;
/**
* 主题化布局水平间隙
*/
public static final int HORIZONTAL_GAP = 10;
/**
* 主题化布局垂直间隙
*/
public static final int VERTICAL_GAP = 10;
}

45
designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java

@ -1,23 +1,22 @@
package com.fr.design.data.datapane;
import com.fine.swing.ui.layout.Layouts;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import javax.swing.*;
import java.awt.*;
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.row;
public class VerticalChoosePane extends ChoosePane implements DesignerBean {
private static final int RIGHTBORDER = 5;
private static final int MAX_WIDTH = 60;
public VerticalChoosePane(Previewable previewable) {
@ -31,35 +30,23 @@ public class VerticalChoosePane extends ChoosePane implements DesignerBean {
@Override
protected void initComponentsLayout(PreviewLabel previewLabel, int labelSize) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
JPanel rs = new JPanel(new BorderLayout(0, 0));
rs.add(tableNameComboBox, BorderLayout.CENTER);
rs.add(GUICoreUtils.createFlowPane(new Component[]{new RefreshLabel(this), previewLabel}, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST);
rs.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -RIGHTBORDER));
UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEFT);
UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEFT);
UILabel l3 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), MAX_WIDTH, UILabel.LEFT);
if (labelSize > 0) {
Dimension pSize = new Dimension(labelSize, 20);
l1.setPreferredSize(pSize);
l2.setPreferredSize(pSize);
l3.setPreferredSize(pSize);
}
Component[][] components = new Component[][]{
new Component[]{l1, dsNameComboBox},
new Component[]{l2, schemaBox},
new Component[]{l3, UIComponentUtils.wrapWithBorderLayoutPane(rs)}
};
JPanel content = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_LARGE);
this.setLayout(new BorderLayout());
this.add(content, BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
row(cell(l1).weight(1), cell(dsNameComboBox).weight(2)),
row(cell(l2).weight(1), cell(schemaBox).weight(2)),
row(
cell(l3).weight(1),
cell(tableNameComboBox).weight(1.2),
flex(0.1),
cell(new RefreshLabel(this)).weight(0.3),
flex(0.1),
cell(previewLabel).weight(0.3))
).getComponent(), BorderLayout.CENTER);
}

2
designer-base/src/main/java/com/fr/design/dialog/MultiTabPane.java

@ -81,7 +81,7 @@ public abstract class MultiTabPane<T> extends FurtherBasicBeanPane<T>{
}
protected void initLayout() {
this.setLayout(new BorderLayout(0, 4));
this.setLayout(new BorderLayout());
this.add(tabPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}

47
designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java

@ -1,7 +1,9 @@
package com.fr.design.editor;
import com.fine.swing.ui.layout.Layouts;
import com.fr.base.BaseFormula;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.editor.editor.ColumnIndexEditor;
@ -25,12 +27,12 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* Created by MoMeak on 2017/7/26.
*/
@ -45,7 +47,6 @@ public class DoubleDeckValueEditorPane extends BasicPane implements UIObserver,
private UIButton arrowButton;
private JPopupMenu menu;
private JPanel centerPane;
private CardLayout cardLayout;
private Object value;
private UIButtonGroup upButton;
private GlobalNameListener globalNameListener = null;
@ -76,42 +77,38 @@ public class DoubleDeckValueEditorPane extends BasicPane implements UIObserver,
private void initComponents(final Editor[] cards, String popupName, String textEditorValue, int centerPaneWidth) {
this.setLayout(new BorderLayout(0, 4));
this.setLayout(new BorderLayout());
this.cards = cards;
final String[] nameArray = new String[cards.length];
for (int i = 0; i < cards.length; i++) {
nameArray[i] = cards[i].getName();
}
upButton = new UIButtonGroup(nameArray);
upButton = new UIButtonGroup<>(nameArray);
upButton.setAllToolTips(nameArray);
this.add(upButton, BorderLayout.NORTH);
centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
setCurrentEditor(0);
centerPane.setPreferredSize(new Dimension(centerPaneWidth, centerPane.getPreferredSize().height));
menu = createPopMenu();
upButton.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (globalNameListener != null) {
globalNameListener.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_CellWrite_InsertRow_Policy"));
}
Object oldValue = currentEditor.getValue();
setCurrentEditor(upButton.getSelectedIndex());
currentEditor.selected();
value = currentEditor.getValue();
if (uiObserverListener != null) {
uiObserverListener.doChange();
}
DoubleDeckValueEditorPane.this.firePropertyChange("value", oldValue, value);
upButton.addChangeListener(e -> {
if (globalNameListener != null) {
globalNameListener.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_CellWrite_InsertRow_Policy"));
}
Object oldValue = currentEditor.getValue();
setCurrentEditor(upButton.getSelectedIndex());
currentEditor.selected();
value = currentEditor.getValue();
if (uiObserverListener != null) {
uiObserverListener.doChange();
}
DoubleDeckValueEditorPane.this.firePropertyChange("value", oldValue, value);
});
this.add(centerPane, BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(upButton),
cell(centerPane)
).getComponent(), BorderLayout.CENTER);
}

2
designer-base/src/main/java/com/fr/design/editor/editor/ColumnIndexEditor.java

@ -41,8 +41,6 @@ public class ColumnIndexEditor extends Editor<Object> {
}
this.add(valueColumnIndexComboBox, BorderLayout.CENTER);
this.setName(name);
valueColumnIndexComboBox.setBorder(null);
}
@Override

8
designer-base/src/main/java/com/fr/design/foldablepane/HeaderPane.java

@ -2,7 +2,7 @@ package com.fr.design.foldablepane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.GraphHelper;
import javax.swing.BorderFactory;
@ -92,13 +92,9 @@ public class HeaderPane extends JPanel {
this.isShow = true;
triangleDown = new LazyIcon("triangle_down");
triangleRight = new LazyIcon("triangle_right");
int width = FineUIUtils.getAndScaleInt("HeaderPane.width", defaultWidth);
int height = FineUIUtils.getAndScaleInt("HeaderPane.height", defaultHeight);
this.setPreferredSize(new Dimension(width, height));
Insets insets = FineUIUtils.getAndScaleUIInsets("ExpandablePane.HeaderPane.borderInsets", defaultInsets);
this.setForeground(UIManager.getColor("ExpandablePane.HeaderPane.foreground"));
this.setFont(getFont().deriveFont(Font.BOLD));
this.setBorder(BorderFactory.createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
this.setBorder(new ScaledEmptyBorder(17, 0, 17, 0));
}
public HeaderPane(Color bgColor, String title, int headHeight) {

7
designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java

@ -1,10 +1,7 @@
package com.fr.design.foldablepane;
import com.fine.theme.utils.FineUIScale;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.MouseAdapter;
@ -16,7 +13,6 @@ import java.awt.event.MouseEvent;
*/
public class UIExpandablePane extends JPanel {
private static final int LEFT_BORDER = 5;
private static final long serialVersionUID = 1L;
private HeaderPane headerPanel;
private JPanel contentPanel;
@ -47,7 +43,7 @@ public class UIExpandablePane extends JPanel {
}
private void initComponents() {
this.setLayout(new BorderLayout(0, FineUIScale.scale(UIManager.getInt("ExpandablePane.vGap"))));
this.setLayout(new BorderLayout());
headerPanel = new HeaderPane(color, title, headHeight);
headerPanel.addMouseListener(new PanelAction());
@ -58,7 +54,6 @@ public class UIExpandablePane extends JPanel {
}
protected void setcontentPanelontentPanelBorder (){
contentPanel.setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, 0));
}

22
designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java

@ -1,21 +1,19 @@
package com.fr.design.formula;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.DesignerContext;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -40,9 +38,8 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
formulaTextField.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand"));
// 添加一公式编辑器按钮
formulaTextFieldButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png"));
formulaTextFieldButton = new UIButton(new LazyIcon("formula"));
formulaTextFieldButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "...");
formulaTextFieldButton.setPreferredSize(new Dimension(24, 20));
formulaTextFieldButton.setOpaque(false);
formulaTextFieldButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
formulaTextFieldButton.addActionListener(new ActionListener() {
@ -73,12 +70,10 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
}
protected void initLayout() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
JPanel pane = new JPanel(new BorderLayout(0,0));
JPanel pane1 = new JPanel(new BorderLayout(0,0));
JPanel pane = new JPanel(new BorderLayout());
JPanel pane1 = new JPanel(new BorderLayout());
pane1.add(formulaTextField, BorderLayout.NORTH);
pane1.setBorder(BorderFactory.createEmptyBorder(0,0,0,5));
pane1.setBorder(new ScaledEmptyBorder(0,0,0,5));
pane.add(pane1,BorderLayout.CENTER);
pane.add(formulaTextFieldButton,BorderLayout.EAST);
@ -112,11 +107,6 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present");
}
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 20);
}
@Override
public void registerChangeListener(UIObserverListener listener) {
if(formulaTextField != null) {

2
designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java

@ -162,7 +162,7 @@ public abstract class AbstractShortCutFactory {
SortItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort"));
this.setMnemonic('S');
this.setSmallIcon(new LazyIcon("sort_asc"));
this.setSmallIcon(new LazyIcon("sort_desc"));
}
@Override

72
designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java

@ -0,0 +1,72 @@
package com.fr.design.gui.core;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
/**
* 简单的响应式面板容器提供切换布局的功能
*
* @author Levy.Xie
* @since 11.0
* Created on 2023/12/25
*/
public class ReactiveCardPane extends JPanel {
String selectKey;
Map<String, Supplier<Component>> cardFactory = new HashMap<>();
/**
* 创建响应式面板容器
*
* @return 面板
*/
public static ReactiveCardPane create() {
ReactiveCardPane container = new ReactiveCardPane();
container.setLayout(new BorderLayout());
return container;
}
/**
* 添加创建布局卡片的supplier
* <p>由于swing的布局生成机制单一组件不能在不同布局中出现因此无法存储构建好的布局可以存储工厂方法使用时调用</p>
*
* @param key supplier标识
* @param supplier 工厂方法
* @return this
*/
public ReactiveCardPane addSupplier(String key, Supplier<Component> supplier) {
cardFactory.put(key, supplier);
return this;
}
/**
* 选择布局
*
* @param key supplier标识
* @return this
*/
public ReactiveCardPane select(String key) {
this.selectKey = key;
return this;
}
/**
* 渲染卡片
*
* @throws IllegalArgumentException 非法key值
*/
public void populate() throws IllegalArgumentException {
if (selectKey == null || !cardFactory.containsKey(selectKey)) {
throw new IllegalArgumentException("container select key is illegal!");
}
removeAll();
add(cardFactory.get(selectKey).get(), BorderLayout.CENTER);
revalidate();
repaint();
}
}

13
designer-base/src/main/java/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java

@ -1,5 +1,7 @@
package com.fr.design.gui.frpane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
@ -17,7 +19,6 @@ import java.awt.*;
* 用于属性表中的面板主要是为了给包含于这个面板内部的众多UI控件加监听事件在UI控件改变的时候通知模板做相应的变化
*/
public abstract class AbstractAttrNoScrollPane extends BasicPane {
private static final int DEFAULT_HEIGHT = 250;
private static boolean hasChangeListener;
protected JPanel leftContentPane;
@ -59,7 +60,7 @@ public abstract class AbstractAttrNoScrollPane extends BasicPane {
protected void initContentPane() {
leftContentPane = createContentPane();
if (leftContentPane != null) {
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, original));
leftContentPane.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0));
this.add(leftContentPane, BorderLayout.CENTER);
}
}
@ -125,14 +126,6 @@ public abstract class AbstractAttrNoScrollPane extends BasicPane {
return hasChangeListener;
}
/**
* 返回预定义的大小.
*/
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, DEFAULT_HEIGHT);
}
/**
* 返回绑定的属性事件.
* @param listener 增加监听

4
designer-base/src/main/java/com/fr/design/gui/frpane/UIComboBoxPane.java

@ -1,7 +1,9 @@
package com.fr.design.gui.frpane;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icombobox.UIComboBox;
import javax.swing.*;
@ -92,7 +94,7 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
* august 如果需要的布局有变化覆盖之
*/
protected void initLayout() {
this.setLayout(new BorderLayout(0, 6));
this.setLayout(new BorderLayout(0, FineUIScale.scale(LayoutConstants.VERTICAL_GAP)));
JPanel northPane = new JPanel(new BorderLayout());
northPane.add(jcb, BorderLayout.CENTER);
this.add(northPane, BorderLayout.NORTH);

50
designer-base/src/main/java/com/fr/design/gui/frpane/UINumberDragPane.java

@ -1,23 +1,26 @@
package com.fr.design.gui.frpane;
import com.fine.swing.ui.layout.Layouts;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.islider.UISlider;
import com.fr.design.gui.ispinner.UISpinner;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNameObserver {
private static final long serialVersionUID = -8681716725163358249L;
private UISlider dragBar;
private UISpinner spinner;
private boolean isEditing = false;
private String numberDargPaneName = "";
private String numberDragPaneName = "";
private GlobalNameListener globalNameListener = null;
/**
@ -38,31 +41,26 @@ public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNam
dragBar.setMajorTickSpacing((int) maxValue);
spinner = createUISpinner(minValue, maxValue, dierta);
spinner.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"));
this.setLayout(new BorderLayout(4, 0));
this.add(spinner, BorderLayout.EAST);
this.add(dragBar, BorderLayout.CENTER);
dragBar.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(numberDargPaneName);
}
spinner.setValue(dragBar.getValue());
if (isEditing) {
userEvent(updateBean());
}
this.setLayout(new BorderLayout());
this.add(Layouts.row(
cell(dragBar).weight(0.7), flex(0.1), cell(spinner).weight(0.7)
).getComponent());
dragBar.addChangeListener(e -> {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(numberDragPaneName);
}
spinner.setValue(dragBar.getValue());
if (isEditing) {
userEvent(updateBean());
}
});
spinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(numberDargPaneName);
}
dragBar.setValue((int) spinner.getValue());
if (isEditing) {
userEvent(updateBean());
}
spinner.addChangeListener(e -> {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(numberDragPaneName);
}
dragBar.setValue((int) spinner.getValue());
if (isEditing) {
userEvent(updateBean());
}
});
}
@ -93,7 +91,7 @@ public class UINumberDragPane extends BasicBeanPane<Double> implements GlobalNam
* @param name
*/
public void setGlobalName(String name) {
numberDargPaneName = name;
numberDragPaneName = name;
}
@Override

7
designer-base/src/main/java/com/fr/design/gui/icombobox/ExtendedComboBox.java

@ -47,13 +47,6 @@ public class ExtendedComboBox extends UIComboBox {
setUI(new ExtendedComboBoxUI());
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = VALUE120;
return dim;
}
static class ExtendedComboBoxUI extends FineComboBoxUI {
public static ComponentUI createUI(JComponent c) {
return new ExtendedComboBoxUI();

17
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -2,6 +2,7 @@ package com.fr.design.gui.icontainer;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
@ -33,13 +34,13 @@ import java.awt.event.MouseMotionListener;
public class UIEastResizableContainer extends JPanel {
private static final long serialVersionUID = 1854340560790476907L;
public static final int MAX_CONTAINER_WIDTH = 340;
public static final int MIN_CONTAINER_WIDTH = 286;
public static final int MAX_CONTAINER_WIDTH = FineUIScale.scale(340);
public static final int MIN_CONTAINER_WIDTH = FineUIScale.scale(286);
private int containerWidth = 240;
private int preferredWidth = 240;
private int topToolPaneHeight = 40;
private int leftPaneWidth = 42;
private int containerWidth = FineUIScale.scale(240);
private int preferredWidth = FineUIScale.scale(240);
private int topToolPaneHeight = FineUIScale.scale(40);
private int leftPaneWidth = FineUIScale.scale(42);
private JComponent leftPane;
private JComponent rightPane;
@ -47,8 +48,8 @@ public class UIEastResizableContainer extends JPanel {
private TopToolPane topToolPane;
private static final int ARROW_MARGIN = 15;
private static final int ARROW_RANGE = 35;
private static final int ARROW_MARGIN = FineUIScale.scale(15);
private static final int ARROW_RANGE = FineUIScale.scale(35);
public UIEastResizableContainer() {

6
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java

@ -1,7 +1,6 @@
package com.fr.design.gui.itableeditorpane;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -51,10 +50,9 @@ public class UITableEditorPane<T> extends BasicPane {
UILabel l = new UILabel(leftLabelName);
editTable = tableModel.createTable();
// editTable.getTableHeader().setBackground(UIConstants.DEFAULT_BG_RULER);
UIScrollPane scrollPane = new UIScrollPane(editTable);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC));
scrollPane.setBorder(new FineRoundBorder());
pane.add(scrollPane, BorderLayout.CENTER);
initbuttonPane(action);
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();

14
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java

@ -1,6 +1,6 @@
package com.fr.design.gui.itableeditorpane;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.log.FineLoggerFactory;
@ -198,7 +198,7 @@ public abstract class UITableModelAdapter<T> extends AbstractTableModel implemen
protected abstract class AddTableRowAction extends UITableEditAction {
public AddTableRowAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
this.setSmallIcon(new LazyIcon("add"));
}
@Override
@ -215,7 +215,7 @@ public abstract class UITableModelAdapter<T> extends AbstractTableModel implemen
public EditAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/edit.png"));
this.setSmallIcon(new LazyIcon("edit"));
}
@Override
@ -239,13 +239,13 @@ public abstract class UITableModelAdapter<T> extends AbstractTableModel implemen
public DeleteAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Delete"));
this.setDeleteTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?");
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
this.setSmallIcon(new LazyIcon("remove"));
}
public DeleteAction(Component component){
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Delete"));
this.setDeleteTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?");
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
this.setSmallIcon(new LazyIcon("remove"));
this.component = component;
}
@ -309,7 +309,7 @@ public abstract class UITableModelAdapter<T> extends AbstractTableModel implemen
protected class MoveUpAction extends UITableEditAction {
public MoveUpAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png"));
this.setSmallIcon(new LazyIcon("move_up"));
}
@Override
@ -333,7 +333,7 @@ public abstract class UITableModelAdapter<T> extends AbstractTableModel implemen
public MoveDownAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png"));
this.setSmallIcon(new LazyIcon("move_down"));
}
@Override

231
designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java

@ -4,6 +4,8 @@ package com.fr.design.gui.style;
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.design.ExtraDesignClassManager;
@ -12,15 +14,13 @@ import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.IndentationUnitProcessor;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.event.EventDispatcher;
import com.fr.general.ComparatorUtils;
@ -39,35 +39,28 @@ import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Arrays;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.fix;
/**
* Pane to edit cell alignment.
*/
public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final int ANGEL = 90;
private static final int GAP = 23;
private static final int VERGAP = 3;
private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20);
private static final String[] TEXT = {Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Wrap_Text"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Single_Line"),
Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Single_Line(Adjust_Font)"), Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Multi_Line(Adjust_Font)")};
private static final String[] LAYOUT = {Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Default"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Titled"),
Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Extend"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Adjust")};
private JPanel hPaneContainer;
private JPanel vPaneContainer;
private JPanel rotationBarCC;
private JPanel basicPane;
private JPanel seniorPane;
private ReactiveCardPane rotationBarPane;
private UIComboBox textComboBox;
private UIComboBox textRotationComboBox;
@ -95,8 +88,9 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
protected void initComponents() {
textComboBox = new UIComboBox(TEXT);
imageLayoutComboBox = new UIComboBox(LAYOUT);
initTextRotationCombox();
initTextRotationComboBox();
// todo: 换新图标及反白问题
Icon[][] hAlignmentIconArray = {{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png")},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png")},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png")},
@ -106,9 +100,6 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
hAlignmentPane = new UIButtonGroup<>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Left"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Center"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Right"),
Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Distributed"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_DEFAULT")});
hPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
vPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
Icon[][] vAlignmentIconArray = {{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal_white.png")},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal_white.png")},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal_white.png")}};
@ -146,8 +137,6 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
}
private void initOtherComponent() {
hPaneContainer.add(hAlignmentPane);
vPaneContainer.add(vAlignmentPane);
rotationPane = new UINumberDragPane(-ANGEL, ANGEL);
leftIndentSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
@ -157,24 +146,11 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
spaceAfterSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
lineSpaceSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
rotationBarCC = new JPanel(new CardLayout());
rotationBarCC.add(rotationPane, "show");
rotationBarCC.add(new JPanel(), "hide");
this.setLayout(new BorderLayout());
this.add(createPane(), BorderLayout.CENTER);
textRotationComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
CardLayout cc = (CardLayout) rotationBarCC.getLayout();
cc.show(rotationBarCC, textRotationComboBox.getSelectedIndex() == 0 ? "show" : "hide");
}
});
}
private void initTextRotationCombox() {
private void initTextRotationComboBox() {
ArrayList<String> selectOption = new ArrayList<>();
selectOption.add(Toolkit.i18nText("Fine-Design_Basic_Custom_Angle"));
VerticalTextProcessor processor = ExtraClassManager.getInstance().getSingle(VerticalTextProcessor.XML_TAG, DefaultVerticalTextProcessor.class);
@ -198,101 +174,118 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
}
private JPanel createPane() {
JPanel jp1 = new JPanel(new BorderLayout());
basicPane = new JPanel();
seniorPane = new JPanel();
basicPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), 290, 24, basicPane());
seniorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Basic_Advanced"), 290, 24, seniorPane());
jp1.add(basicPane, BorderLayout.NORTH);
jp1.add(seniorPane, BorderLayout.CENTER);
return jp1;
JPanel basicPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), 290, 24, basicPane());
JPanel seniorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Basic_Advanced"), 290, 24, seniorPane());
return Layouts.column(
cell(basicPane),
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))),
cell(seniorPane)
).getComponent();
}
private JPanel basicPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel horizontalLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Pane_Horizontal") + " ", SwingConstants.LEFT);
UILabel verticalLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Pane_Vertical") + " ", SwingConstants.LEFT);
UIComponentUtils.setLineWrap(horizontalLabel);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{horizontalLabel, hPaneContainer},
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Pane_Vertical") + " ", SwingConstants.RIGHT), vPaneContainer},
new Component[]{null, null}
};
double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
UIComponentUtils.setLineWrap(verticalLabel);
return Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(horizontalLabel).weight(1.2),
cell(hAlignmentPane).weight(3)),
row(
cell(verticalLabel).weight(1.2),
cell(vAlignmentPane).weight(1.8),
flex(1.2))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0))).getComponent();
}
private JPanel seniorPane() {
JPanel senPane = new JPanel(new BorderLayout());
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel((Toolkit.i18nText("Fine-Design_Basic_Image_Layout")) + " ", SwingConstants.LEFT), imageLayoutComboBox},
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Text_Style") + " ", SwingConstants.LEFT), textComboBox},
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation") + " ", SwingConstants.LEFT), textRotationComboBox},
new Component[]{null, rotationBarCC},
new Component[]{null, null},
};
double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel tempPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
senPane.add(tempPane, BorderLayout.NORTH);
senPane.add(seniorDownPane(), BorderLayout.CENTER);
return senPane;
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(seniorUpPane()),
cell(seniorMiddlePane()),
cell(seniorDownPane())
).getComponent();
}
private JPanel seniorDownPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
leftIndentSpinner.setPreferredSize(SPINNER_DIMENSION);
rightIndentSpinner.setPreferredSize(SPINNER_DIMENSION);
spaceBeforeSpinner.setPreferredSize(SPINNER_DIMENSION);
spaceAfterSpinner.setPreferredSize(SPINNER_DIMENSION);
lineSpaceSpinner.setPreferredSize(SPINNER_DIMENSION);
JPanel indentationPane = new JPanel(new BorderLayout());
indentationPane.add(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Indentation")), SwingConstants.LEFT));
indentationPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, GAP));
JPanel partSpacingPane = new JPanel(new BorderLayout());
partSpacingPane.add(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Part_Spacing")), SwingConstants.LEFT));
partSpacingPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, GAP));
JPanel spacingPane = new JPanel(new BorderLayout());
spacingPane.add(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Line_Spacing")), SwingConstants.LEFT));
spacingPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, GAP));
Component[][] components = new Component[][]{
new Component[]{null, null, null},
new Component[]{indentationPane, creatSpinnerPane(leftIndentSpinner), creatSpinnerPane(rightIndentSpinner)},
new Component[]{null, new UILabel((Toolkit.i18nText("Fine-Design_Report_Left")), SwingConstants.CENTER), new UILabel((Toolkit.i18nText("Fine-Design_Basic_Right")), SwingConstants.CENTER)},
new Component[]{null, null, null},
new Component[]{null, null, null},
new Component[]{partSpacingPane, creatSpinnerPane(spaceBeforeSpinner), creatSpinnerPane(spaceAfterSpinner)},
new Component[]{null, new UILabel((Toolkit.i18nText("Fine-Design_Basic_Front")), SwingConstants.CENTER), new UILabel((Toolkit.i18nText("Fine-Design_Basic_Behind")), SwingConstants.CENTER)},
new Component[]{null, null, null},
new Component[]{null, null, null},
new Component[]{spacingPane, creatSpinnerPane(lineSpaceSpinner), null},
};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, VERGAP);
private JPanel seniorUpPane() {
return Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Image_Layout")), SwingConstants.LEFT)).weight(1.2),
cell(imageLayoutComboBox).weight(3.0)
),
row(
cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Text_Style")), SwingConstants.LEFT)).weight(1.2),
cell(textComboBox).weight(3.0)
)
).getComponent();
}
private JPanel creatSpinnerPane(Component comp) {
JPanel jp = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
jp.add(comp);
return jp;
private JPanel seniorMiddlePane() {
rotationBarPane = ReactiveCardPane.create()
.addSupplier("hide", () -> Layouts.row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)).weight(1.2),
cell(textRotationComboBox).weight(3)
).getComponent())
.addSupplier("show", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)).weight(1.2),
cell(textRotationComboBox).weight(3)
),
row(
flex(1.2),
cell(rotationPane).weight(3)
)
).getComponent());
rotationBarPane.select("show").populate();
textRotationComboBox.addItemListener(e -> {
String key = (textRotationComboBox.getSelectedIndex() == 0) ? "show" : "hide";
rotationBarPane.select(key).populate();
});
return rotationBarPane;
}
private JPanel seniorDownPane() {
UILabel indentationLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Indentation")), SwingConstants.LEFT);
UILabel partSpacingLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Style_Part_Spacing")), SwingConstants.LEFT);
UILabel spacingLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Line_Spacing")), SwingConstants.LEFT);
return Layouts.column(
row(
cell(indentationLabel).weight(1.2),
cell(leftIndentSpinner).weight(1.4),
flex(0.2),
cell(rightIndentSpinner).weight(1.4)
),
fix(2),
row(
flex(1.2),
cell(new UILabel((Toolkit.i18nText("Fine-Design_Report_Left")), SwingConstants.CENTER)).weight(1.4),
flex(0.2),
cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Right")), SwingConstants.CENTER)).weight(1.4)
),
fix(10),
row(
cell(partSpacingLabel).weight(1.2),
cell(spaceBeforeSpinner).weight(1.4),
flex(0.2),
cell(spaceAfterSpinner).weight(1.4)
),
fix(2),
row(
flex(1.2),
cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Front")), SwingConstants.CENTER)).weight(1.4),
flex(0.2),
cell(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Behind")), SwingConstants.CENTER)).weight(1.4)
),
fix(10),
row(
cell(spacingLabel).weight(1.2),
cell(lineSpaceSpinner).weight(1.4),
flex(1.6)
)
).getComponent();
}
/**

24
designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java

@ -1,13 +1,11 @@
package com.fr.design.gui.style;
import com.fine.swing.ui.layout.Layouts;
import com.fr.base.Style;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.fun.BackgroundQuickUIProvider;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.*;
import com.fr.general.Background;
@ -21,6 +19,8 @@ import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* @author zhou
* @since 2012-5-28下午6:22:09
@ -45,7 +45,7 @@ public class BackgroundPane extends AbstractBasicStylePane {
}
protected void initComponents() {
this.setLayout(new BorderLayout(0, 6));
this.setLayout(new BorderLayout());
typeComboBox = new UIComboBox();
final CardLayout cardlayout = new CardLayout();
@ -75,19 +75,9 @@ public class BackgroundPane extends AbstractBasicStylePane {
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{null},
new Component[]{typeComboBox},
new Component[]{centerPane}
};
double[] rowSize = {p, p, p};
double[] columnSize = {f};
int[][] rowCount = {{1},{1},{1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
this.add(panel, BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(typeComboBox), cell(centerPane)
).getComponent(),BorderLayout.CENTER);
}
protected BackgroundQuickPane[] supportKindsOfBackgroundUI() {

98
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -4,6 +4,8 @@ package com.fr.design.gui.style;
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.CellBorderStyle;
import com.fr.base.Style;
import com.fr.design.constants.LayoutConstants;
@ -13,8 +15,6 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
@ -22,29 +22,33 @@ import com.fr.general.IOUtils;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
/**
* @author zhou
* @since 2012-5-28下午6:22:04
*/
public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final String[] BORDERARRAY = {"currentLineCombo", "currentLineColorPane", "outerToggleButton", "topToggleButton",
private static final String[] BORDER_ARRAY = {"currentLineCombo", "currentLineColorPane", "outerToggleButton", "topToggleButton",
"leftToggleButton", "bottomToggleButton", "rightToggleButton", "innerToggleButton", "horizontalToggleButton", "verticalToggleButton"};
private static final Set<String> BORDER_SET = new HashSet<>(Arrays.asList(BORDERARRAY));
private static final Set<String> BORDER_SET = new HashSet<>(Arrays.asList(BORDER_ARRAY));
private UIToggleButton topToggleButton;
private UIToggleButton horizontalToggleButton;
@ -67,7 +71,22 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
protected void initComponents() {
initButtonsWithIcon();
this.setLayout(new BorderLayout(0, 0));
JPanel borderPane = initBorderPane();
JPanel backgroundPane = initBackgroundPane();
this.setLayout(new BorderLayout());
this.add(Layouts.column(
cell(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border"), 280, 24, borderPane)),
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))),
cell(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), 280, 24, backgroundPane))
).getComponent());
initAllNames();
outerToggleButton.addChangeListener(outerToggleButtonChangeListener);
innerToggleButton.addChangeListener(innerToggleButtonChangeListener);
}
private JPanel initBorderPane() {
JPanel externalPane = new JPanel(new GridLayout(0, 4));
externalPane.add(topToggleButton);
externalPane.add(leftToggleButton);
@ -76,40 +95,42 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
JPanel insidePane = new JPanel(new GridLayout(0, 2));
insidePane.add(horizontalToggleButton);
insidePane.add(verticalToggleButton);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style") + " ", SwingConstants.LEFT), currentLineCombo},
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color") + " ", SwingConstants.LEFT), currentLineColorPane},
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border") + " ", SwingConstants.LEFT), outerToggleButton = new UIToggleButton(new Icon[]{IOUtils.readIcon("com/fr/design/images/m_format/out.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/out_white.png")}, false)},
new Component[]{null, externalPane},
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_In_Border") + " ", SwingConstants.LEFT), innerToggleButton = new UIToggleButton(new Icon[]{IOUtils.readIcon("com/fr/design/images/m_format/in.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/in_white.png")}, false)},
new Component[]{null, insidePane},
new Component[]{null, null}
};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
JPanel borderPanel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border"), 280, 24, panel);
this.add(borderPanel, BorderLayout.NORTH);
return Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style"), SwingConstants.LEFT)).weight(1.2),
cell(currentLineCombo).weight(3)),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"), SwingConstants.LEFT)).weight(1.2),
cell(currentLineColorPane).weight(3)),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Out_Border"), SwingConstants.LEFT)).weight(1.2),
cell(outerToggleButton = new UIToggleButton(new Icon[]{IOUtils.readIcon("com/fr/design/images/m_format/out.png"),
IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/out_white.png")}, false)).weight(3)),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_In_Border"), SwingConstants.LEFT)).weight(1.2),
cell(externalPane).weight(3)),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_In_Border"), SwingConstants.LEFT)).weight(1.2),
cell(innerToggleButton = new UIToggleButton(new Icon[]{IOUtils.readIcon("com/fr/design/images/m_format/in.png"),
IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/in_white.png")}, false)).weight(3)),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_In_Border"), SwingConstants.LEFT)).weight(1.2),
cell(insidePane).weight(3))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0))).getComponent();
}
private JPanel initBackgroundPane() {
UILabel backgroundFillLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Background_Fill"));
backgroundFillLabel.setPreferredSize(new Dimension(60, 20));
backgroundPane = new BackgroundPane();
JPanel backgroundContainPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{backgroundFillLabel, backgroundPane}},
TableLayoutHelper.FILL_LASTCOLUMN, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM);
JPanel backgroundPanel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), 280, 24, backgroundContainPane);
this.add(backgroundPanel, BorderLayout.CENTER);
initAllNames();
outerToggleButton.addChangeListener(outerToggleButtonChangeListener);
innerToggleButton.addChangeListener(innerToggleButtonChangeListener);
return Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(backgroundFillLabel).with(it -> {
it.setBorder(new ScaledEmptyBorder(LayoutConstants.VGAP_MEDIUM, 0, 0, 0));
it.setVerticalAlignment(SwingConstants.TOP);
}).weight(1.2),
cell(backgroundPane).weight(3)
)
).getComponent();
}
ChangeListener outerToggleButtonChangeListener = new ChangeListener() {
@ -133,6 +154,7 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
};
private void initButtonsWithIcon() {
// todo: 暂缺视觉反白图标
topToggleButton = new UIToggleButton(new Icon[]{IOUtils.readIcon("/com/fr/base/images/dialog/border/top.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/top_white.png")}, false);
leftToggleButton = new UIToggleButton(new Icon[]{IOUtils.readIcon("/com/fr/base/images/dialog/border/left.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/left_white.png")}, false);
bottomToggleButton = new UIToggleButton(new Icon[]{IOUtils.readIcon("/com/fr/base/images/dialog/border/bottom.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bottom_white.png")}, false);

213
designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java

@ -4,7 +4,8 @@ package com.fr.design.gui.style;
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
import com.fr.base.BaseUtils;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.FRContext;
import com.fr.base.Style;
import com.fr.base.Utils;
@ -12,12 +13,11 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
@ -26,24 +26,19 @@ import com.fr.general.FRFont;
import com.fr.stable.Constants;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.RenderingHints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;
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.row;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* Pane to edit Font.
*/
@ -54,12 +49,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
36, 38, 40, 48, 64, 72, 128
};
private static final int MAX_FONT_SIZE = 100;
private static final Dimension BUTTON_SIZE = new Dimension(20, 18);
private static final Dimension UNDER_LINE_SIZE = new Dimension(87, 20);
private static final Dimension HIDE_SIZE = new Dimension(0, 0);
private final String[] fontSizeStyles = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FR_Font_Plain"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FR_Font_Bold"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FR_Font_Italic"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FR_Font_Bolditalic")};
private JPanel buttonPane;
private JPanel isSuperOrSubPane;
private UIComboBox fontNameComboBox;
private UIComboBox fontSizeStyleComboBox;
protected UIComboBox fontSizeComboBox;
@ -76,19 +66,14 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
private UIToggleButton isShadowCheckBox;
private UIToggleButton superPane;
private UIToggleButton subPane;
private JPanel linePane;
private int italic_bold;
/**
* LeftPane和RightPane之间的间隙也是fontSizeStyleComboBox与fontSizeComboBox之间的间隙之前的默认值为VGAP_LARGE
*/
private int hGapBetweenLeftPaneAndRightPane = LayoutConstants.VGAP_LARGE;
private ReactiveCardPane styleContainer;
public FRFontPane() {
this.initComponents();
}
@Deprecated
public FRFontPane(int hGapBetweenLeftPaneAndRightPane) {
this.hGapBetweenLeftPaneAndRightPane = hGapBetweenLeftPaneAndRightPane;
this.initComponents();
}
@ -123,17 +108,12 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
this.colorSelectPane.setColor(frFont.getForeground());
this.colorSelectPane.repaint();
// update frFont.
CardLayout cly = (CardLayout) linePane.getLayout();
int line = frFont.getUnderline();
if (line == Constants.LINE_NONE) {
underline.setSelected(false);
cly.show(linePane, "none");
linePane.setPreferredSize(HIDE_SIZE);
styleContainer.removeAll();
} else {
underline.setSelected(true);
cly.show(linePane, "combobox");
linePane.setPreferredSize(UNDER_LINE_SIZE);
this.underlineCombo.setSelectedLineStyle(line);
}
// effects
@ -149,6 +129,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
this.superPane.setSelected(false);
this.subPane.setSelected(false);
}
styleContainer.select(underline.isSelected() ? "showLine" : "hideLine").populate();
}
/**
@ -231,7 +212,6 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
@Override
public Style update(Style style) {
// TODO Auto-generated method stub
FRFont frFont = style.getFRFont();
frFont = this.update(frFont);
return style.deriveFRFont(frFont);
@ -248,44 +228,54 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
protected void initComponents() {
fontSizeStyleComboBox = new UIComboBox(fontSizeStyles);
fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
fontNameComboBox.setPreferredSize(new Dimension(144, 20));
fontSizeComboBox = new UIComboBox(getFontSizes());
fontSizeComboBox.setEditable(true);
this.underlineCombo = new LineComboBox(UIConstants.BORDER_LINE_STYLE_ARRAY);
underlineCombo = new LineComboBox(UIConstants.BORDER_LINE_STYLE_ARRAY);
colorSelectPane = new UIColorButton();
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"));
bold.setPreferredSize(BUTTON_SIZE);
italic.setPreferredSize(BUTTON_SIZE);
underline.setPreferredSize(BUTTON_SIZE);
isStrikethroughCheckBox = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/strikethrough.png"));
isStrikethroughCheckBox.setPreferredSize(BUTTON_SIZE);
isShadowCheckBox = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/shadow.png"));
isShadowCheckBox.setPreferredSize(BUTTON_SIZE);
superPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sup.png"));
superPane.setPreferredSize(BUTTON_SIZE);
subPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sub.png"));
subPane.setPreferredSize(BUTTON_SIZE);
Component[] SuperOrSubComponents = new Component[]{
superPane, subPane
};
isSuperOrSubPane = new JPanel(new BorderLayout());
isSuperOrSubPane.add(GUICoreUtils.createFlowPane(SuperOrSubComponents, FlowLayout.LEFT, LayoutConstants.HGAP_SMALL));
Component[] components_font = new Component[]{
colorSelectPane, underline, isStrikethroughCheckBox, isShadowCheckBox
};
buttonPane = new JPanel(new BorderLayout());
buttonPane.add(GUICoreUtils.createFlowPane(components_font, FlowLayout.LEFT, LayoutConstants.HGAP_SMALL));
linePane = new JPanel(new CardLayout());
bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(new LazyIcon("italic"));
underline = new UIToggleButton(new LazyIcon("underline"));
isStrikethroughCheckBox = new UIToggleButton(new LazyIcon("strike"));
isShadowCheckBox = new UIToggleButton(new LazyIcon("shadow"));
superPane = new UIToggleButton(new LazyIcon("super"));
subPane = new UIToggleButton(new LazyIcon("sub"));
styleContainer = ReactiveCardPane.create()
.addSupplier("showLine", this::createContentWithLine)
.addSupplier("hideLine", this:: createContentNoLine);
initAllNames();
setToolTips();
initListeners();
styleContainer.select("hideLine").populate();
this.setLayout(new BorderLayout());
this.add(createPane(), BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(fontNameComboBox),
row(5,
cell(fontSizeStyleComboBox).weight(1),
cell(fontSizeComboBox).weight(1)),
cell(styleContainer)
).getComponent(), BorderLayout.CENTER);
DefaultValues defaultValues = FRContext.getDefaultValues();
populateBean(defaultValues.getFRFont());
}
private Component createContentNoLine() {
return createFontButtonRow().getComponent();
}
private Component createContentWithLine() {
return column(LayoutConstants.VERTICAL_GAP,
createFontButtonRow(),
cell(underlineCombo)
).getComponent();
}
private Cell<?> createFontButtonRow() {
return row(3, cell(colorSelectPane), cell(underline), cell(isStrikethroughCheckBox), cell(isShadowCheckBox),
cell(superPane), cell(subPane));
}
private void initAllNames() {
fontSizeStyleComboBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FR_Font_Style"));
fontNameComboBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name"));
@ -312,63 +302,13 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
subPane.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FR_Font_Subscript"));
}
private JPanel createLinePane() {
linePane.add(new JPanel(), "none");
JPanel gap = new JPanel(new GridLayout(0, 1));
gap.add(underlineCombo);
linePane.add(gap, "combobox");
private void initListeners() {
underline.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
CardLayout cly = (CardLayout) linePane.getLayout();
cly.show(linePane, underline.isSelected() ? "combobox" : "none");
if(underline.isSelected()){
linePane.setPreferredSize(UNDER_LINE_SIZE);
}else{
linePane.setPreferredSize(HIDE_SIZE);
}
styleContainer.select(underline.isSelected() ? "showLine" : "hideLine").populate();
}
});
return linePane;
}
private JPanel createLeftPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p};
double[] rowSize = {p, p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{fontSizeStyleComboBox},
new Component[]{buttonPane},
new Component[]{createLinePane()}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
protected JPanel createRightPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{fontSizeComboBox},
new Component[]{isSuperOrSubPane}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM);
}
private JPanel createPane() {
JPanel createPane = new JPanel(new BorderLayout());
createPane.add(fontNameComboBox, BorderLayout.NORTH);
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, hGapBetweenLeftPaneAndRightPane, LayoutConstants.VGAP_LARGE);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
createPane.add(jPanel, BorderLayout.CENTER);
return createPane;
}
/**
@ -388,53 +328,4 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse
public void setGlobalName(String name) {
}
private class TwoButtonPane extends JPanel {
public UIToggleButton leftButton;
public UIToggleButton rightButton;
public TwoButtonPane(UIToggleButton leftButton, UIToggleButton rightButton) {
this.leftButton = leftButton;
this.rightButton = rightButton;
this.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 0));
this.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
initButton(leftButton);
initButton(rightButton);
initListener();
}
private void initListener() {
leftButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
rightButton.setSelected(false);
}
});
rightButton.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
leftButton.setSelected(false);
}
});
}
private void initButton(UIToggleButton button) {
button.setRoundBorder(false);
button.setBorderPainted(false);
this.add(button);
}
protected void paintBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(UIConstants.LINE_COLOR);
int buttonX = getComponent(0).getX();
int buttonY = getComponent(0).getY();
int height = getComponent(0).getHeight();
int width = getComponent(0).getWidth();
g.drawLine(buttonX + width, 0, buttonX + width, height);
width += getComponent(1).getWidth();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.drawRoundRect(buttonX - 1, buttonY - 1, width + 2, getHeight() - 1, UIConstants.ARC, UIConstants.ARC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
}
}
}

37
designer-base/src/main/java/com/fr/design/gui/style/TextFontTippedPane.java

@ -1,21 +1,21 @@
package com.fr.design.gui.style;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Style;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.theme.edit.ui.LabelUtils;
import javax.swing.BorderFactory;
import javax.swing.SwingConstants;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
@ -33,7 +33,7 @@ public class TextFontTippedPane extends AbstractBasicStylePane {
private void initializePane(boolean showFormatTip) {
setLayout(new BorderLayout());
setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0));
fontPane = new FRFontPane();
this.add(createLabeledPane(Toolkit.i18nText("Fine-Design_Form_FR_Font"), fontPane), BorderLayout.NORTH);
@ -45,24 +45,21 @@ public class TextFontTippedPane extends AbstractBasicStylePane {
}
private JPanel createLabeledPane(String text, JPanel panel) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = { p };
double[] columnSize = {p, f};
UILabel uiLabel = new UILabel(text);
JPanel uiLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
uiLabelPane.add(uiLabel, BorderLayout.NORTH);
return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[] { uiLabelPane, panel },
}, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
return Layouts.row(
cell(uiLabel).with(it -> {
it.setVerticalAlignment(SwingConstants.TOP);
it.setBorder(new ScaledEmptyBorder(5, 0, 0, 0));
}).weight(1),
cell(panel).weight(3)
).getComponent();
}
private JPanel createFormatTipPane() {
JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane();
container.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
JTextArea formatMigratedTip = LabelUtils.createAutoWrapLabel(Toolkit.i18nText("Fine-Design_Report_Format_Style_Migrated_Tip"), new Color(153, 153, 153));
container.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0));
JTextArea formatMigratedTip = LabelUtils.createAutoWrapLabel(Toolkit.i18nText("Fine-Design_Report_Format_Style_Migrated_Tip"),
FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption"));
container.add(formatMigratedTip, BorderLayout.NORTH);
return container;

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

@ -1,5 +1,9 @@
package com.fr.design.gui.style;
import com.fine.swing.ui.layout.Column;
import com.fine.swing.ui.layout.Layouts;
import com.fine.swing.ui.layout.Row;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat;
import com.fr.base.GraphHelper;
import com.fr.base.Style;
@ -7,10 +11,12 @@ import com.fr.base.TextFormat;
import com.fr.data.core.FormatField;
import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.TextFontComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
@ -21,17 +27,14 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.event.ItemEvent;
@ -40,6 +43,10 @@ import java.math.RoundingMode;
import java.text.Format;
import java.text.SimpleDateFormat;
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.row;
/**
* @author Starryi
* @version 1.0
@ -72,6 +79,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
private boolean isRightFormat;
private boolean isDate = false;
private GlobalNameListener globalNameListener = null;
protected ReactiveCardPane cardPane;
public TextFormatPane() {
@ -81,10 +89,6 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
initPreviewLabel4GeneralFormat();
initLayout();
setTextFieldVisible(false);
setRoundingBoxVisible(false);
setPreviewLabelVisible(false);
}
private void initFormatTypesComboBox() {
@ -103,21 +107,15 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
private void initRoundingCheckBox4PercentFormat() {
roundingBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Base_Option_Half_Up"));
roundingBox.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
roundingBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
}
});
roundingBox.setGlobalName("roundingBox");
}
private void initPreviewLabel4GeneralFormat() {
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption");
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.LEFT, 0, null, UIConstants.LINE_COLOR);
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.ABOVE_TOP, 0, null, labelColor);
previewLabel = new UILabel(FormatField.getInstance().getFormatValue()) {
@Override
public void paint(Graphics g) {
super.paint(g);
@ -125,7 +123,7 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
Color original = g.getColor();
g.setColor(getBackground());
g.fillRect(LABEL_X, LABEL_Y, width - LABEL_DELTA_WIDTH, LABEL_HEIGHT);
g.setColor(UIConstants.LINE_COLOR);
g.setColor(labelColor);
FontMetrics cellFM = g.getFontMetrics();
int textWidth = cellFM.stringWidth(getText());
GraphHelper.drawString(g, getText(), (width - textWidth) / 2F, 26);
@ -137,43 +135,42 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
}
protected void initLayout() {
JPanel labeledFormatTypeComboBoxPane = new JPanel(new BorderLayout(20, 0));
labeledFormatTypeComboBoxPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format")), BorderLayout.WEST);
labeledFormatTypeComboBoxPane.add(typeComboBox, BorderLayout.CENTER);
JPanel labeledRoundingCheckboxPane = new JPanel(new BorderLayout(0, 0));
labeledRoundingCheckboxPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Option")), BorderLayout.WEST);
labeledRoundingCheckboxPane.add(roundingBox, BorderLayout.CENTER);
addComponents(4, new JComponent[] { labeledFormatTypeComboBoxPane, textField, labeledRoundingCheckboxPane, previewLabel});
}
protected void setTextFieldVisible(boolean visible) {
textField.setVisible(visible);
}
protected void setRoundingBoxVisible(boolean visible) {
roundingBox.getParent().setVisible(visible);
}
protected void setPreviewLabelVisible(boolean visible) {
previewLabel.setVisible(visible);
}
protected void addComponents(int gap, JComponent[] components) {
JPanel container = this;
container.setLayout(new BorderLayout(0, gap));
for (JComponent component: components) {
if (component != null) {
container.add(component, BorderLayout.NORTH);
JPanel nextContainer = new JPanel(new BorderLayout(0, gap));
container.add(nextContainer, BorderLayout.CENTER);
container = nextContainer;
}
}
if (container.getComponentCount() == 0) {
container.getParent().remove(container);
}
this.setLayout(new BorderLayout());
cardPane = ReactiveCardPane.create()
.addSupplier("normal", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
createTypeRow()
).getComponent())
.addSupplier("preview", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
createTypeRow(),
createPreviewRow()
).getComponent())
.addSupplier("previewAndCheck", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
createTypeRow(),
createPreviewRow(),
createRoundBoxRow()
).getComponent());
cardPane.select("normal").populate();
this.add(cardPane);
}
private Cell<Row> createTypeRow() {
return row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format"))).weight(1.2),
cell(typeComboBox).weight(3)
);
}
private Cell<Row> createRoundBoxRow() {
return row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Option"))).weight(1.2),
cell(roundingBox).with(it -> it.setBorder(null)).weight(3)
);
}
private Cell<Row> createPreviewRow() {
return row(
cell(previewLabel).weight(1)
);
}
protected UIComboBoxRenderer createComBoxRender() {
@ -189,18 +186,6 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
};
}
@Override
/**
* 得到合适的大小
*/
public Dimension getPreferredSize() {
if (this.typeComboBox.getSelectedIndex() == FormatContents.NULL) {
return typeComboBox.getPreferredSize();
}
return super.getPreferredSize();
}
/**
* 弹出框标题
*
@ -329,6 +314,11 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
return contents == FormatContents.TEXT || contents == FormatContents.NULL;
}
private boolean isRoundFormat() {
int contents = getFormatContents();
return contents == FormatContents.PERCENT || contents == FormatContents.THOUSANDTHS;
}
/**
* Radio selection listener.
*/
@ -338,16 +328,16 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
int contents = getFormatContents();
Column contentContainer;
if (!isTextOrNull()) {
textField.removeAllItems();
String[] items = FormatField.getInstance().getFormatArray(contents, false);
textField.setItemArray(items);
textField.setSelectedIndex(0);
cardPane.select(isRoundFormat() ? "previewAndCheck" : "preview").populate();
} else {
cardPane.select("normal").populate();
}
setTextFieldVisible(!isTextOrNull());
setPreviewLabelVisible(!isTextOrNull());
setRoundingBoxVisible(getFormatContents() == FormatContents.PERCENT || getFormatContents() == FormatContents.THOUSANDTHS);
}
}
@ -363,17 +353,11 @@ public class TextFormatPane extends AbstractBasicStylePane implements GlobalName
};
@Override
/**
* populate
*/
public void populateBean(Style style) {
this.populateBean(style.getFormat());
}
@Override
/**
* update
*/
public Style update(Style style) {
return updateByGlobalNamedSetting(style);
}

16
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -79,14 +79,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private FixedPopupPane currentPopupPane;
private UIButton currentButton;
private static final int CONTAINER_WIDTH = containerWidth();
private static final int TAB_WIDTH = 42;
private static final int TAB_BUTTON_WIDTH = 40;
private static final int TAB_BUTTON_HEIGHT = 40;
private static final int TAB_WIDTH = FineUIScale.scale(42);
private static final int TAB_BUTTON_WIDTH = FineUIScale.scale(40);
private static final int TAB_BUTTON_HEIGHT = FineUIScale.scale(40);
private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH;
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30;
private static final int ARROW_RANGE_START = CONTENT_WIDTH - FineUIScale.scale(30);
// 弹出对话框高度
private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_DEFAULT_HEIGHT = 356;
private static final int POPUP_MIN_HEIGHT = FineUIScale.scale(145);
private static final int POPUP_DEFAULT_HEIGHT = FineUIScale.scale(356);
public static final String KEY_CELL_ELEMENT = "cellElement";
public static final String KEY_CELL_ATTR = "cellAttr";
public static final String KEY_FLOAT_ELEMENT = "floatElement";
@ -416,14 +416,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 左侧按钮面板
private void initLeftPane() {
leftPane = new JPanel();
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 1, 0));
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0));
for (PropertyItem item : propertyItemMap.values()) {
if (item.isPoppedOut() || !item.isVisible()) {
continue;
}
leftPane.add(item.getButton());
}
leftPane.setBorder(new FlatLineBorder(new Insets(0,0,0,0), UIManager.getColor("East.border")));
leftPane.setBorder(new FlatLineBorder(new Insets(0,1,0,1), UIManager.getColor("East.border")));
replaceLeftPane(leftPane);
}

31
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java

@ -1,20 +1,20 @@
package com.fr.design.mainframe.backgroundpane;
import com.fine.swing.ui.layout.Layouts;
import com.fr.base.background.GradientBackground;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.background.gradient.GradientBar;
import com.fr.general.Background;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author zhou
* @since 2012-5-30上午10:36:21
@ -39,24 +39,17 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane {
}
private void constructPane(){
String[] textArray = {com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom")};
String[] textArray = {com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Report_Utils_Left_To_Right"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Top_To_Bottom")};
Integer[] valueArray = {GradientBackground.LEFT2RIGHT, GradientBackground.TOP2BOTTOM};
directionPane = new UIButtonGroup<Integer>(textArray, valueArray);
directionPane = new UIButtonGroup<>(textArray, valueArray);
directionPane.setSelectedIndex(0);
gradientBar = new GradientBar(4, this.gradientBarWidth);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p,};
Component[][] components = new Component[][]{
new Component[]{gradientBar, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Gradient_Direction")), directionPane}
};
JPanel Gradient = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(Gradient, BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(gradientBar),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Gradient_Direction"))).weight(1), cell(directionPane).weight(2))
).getComponent(), BorderLayout.CENTER);
}
public void populateBean(Background background) {

54
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java

@ -1,15 +1,16 @@
package com.fr.design.mainframe.backgroundpane;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.GraphHelper;
import com.fr.base.background.PatternBackground;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.Background;
@ -22,6 +23,9 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Rectangle2D;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author zhou
* @since 2012-5-29下午1:12:33
@ -29,7 +33,6 @@ import java.awt.geom.Rectangle2D;
public class PatternBackgroundQuickPane extends BackgroundQuickPane {
private int patternIndex = 0; // pattern setIndex.
private final static int DEFAULT_DIM_HEIGHT = 210;
private final static Color DEFAULT_FOREGROUND = Color.lightGray;
private final static Color DEFAULT_BACKGROUND = Color.black;
private ColorSelectBox foregroundColorPane;
@ -40,11 +43,11 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
this.setLayout(new BorderLayout(0, 4));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(contentPane, BorderLayout.NORTH);
contentPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5));
contentPane.setBorder(new FineRoundBorder());
JPanel typePane2 = new JPanel();
contentPane.add(typePane2);
typePane2.setLayout(new GridLayout(0, 8, 1, 1));
typePane2.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
typePane2.setBorder(new ScaledEmptyBorder(8, 8, 8, 8));
ButtonGroup patternButtonGroup = new ButtonGroup();
patternButtonArray = new PatternButton[PatternBackground.PATTERN_COUNT];
for (int i = 0; i < PatternBackground.PATTERN_COUNT; i++) {
@ -52,41 +55,22 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane {
patternButtonGroup.add(patternButtonArray[i]);
typePane2.add(patternButtonArray[i]);
}
foregroundColorPane = new ColorSelectBox(60);
backgroundColorPane = new ColorSelectBox(60);
foregroundColorPane = new ColorSelectBox(FineUIScale.scale(60));
backgroundColorPane = new ColorSelectBox(FineUIScale.scale(60));
foregroundColorPane.setSelectObject(DEFAULT_FOREGROUND);
foregroundColorPane.setSelectObject(DEFAULT_BACKGROUND);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT), foregroundColorPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT), backgroundColorPane},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
JPanel colorPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE);
this.add(colorPane, BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT)).weight(1),
cell(foregroundColorPane).weight(4)),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)).weight(1),
cell(backgroundColorPane).weight(4))
).with(it -> it.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0))).getComponent(), BorderLayout.CENTER);
foregroundColorPane.addSelectChangeListener(colorChangeListener);
backgroundColorPane.addSelectChangeListener(colorChangeListener);
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = DEFAULT_DIM_HEIGHT;
return dim;
}
private JPanel createLabelColorPane(String text, JComponent colorPane) {
JPanel labelColorPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
labelColorPane.add(new UILabel(text));
labelColorPane.add(colorPane);
return labelColorPane;
}
public void populateBean(Background background) {
PatternBackground patternBackground = (PatternBackground) background;
int patternIndex = patternBackground.getPatternIndex();

7
designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.design.beans.FurtherBasicBeanPane;
@ -54,7 +55,7 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<ThemedCellStyl
});
setLayout(FRGUIPaneFactory.createBorderLayout());
add(styleList, BorderLayout.CENTER);
setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));
setBorder(new ScaledEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));
}
public void addChangeListener(ChangeListener changeListener) {
@ -122,8 +123,8 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<ThemedCellStyl
public RadioButtonListCellRangeRenderer(boolean supportInnerBorder) {
super();
setLayout(new BorderLayout(5, 0));
setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
setLayout(new BorderLayout());
setBorder(new ScaledEmptyBorder(5, 0, 5, 0));
previewArea = new CellRectangleStylePreviewPane(supportInnerBorder);
add(previewArea, BorderLayout.CENTER);
}

45
designer-base/src/main/java/com/fr/design/present/dict/DatabaseDictPane.java

@ -1,5 +1,6 @@
package com.fr.design.present.dict;
import com.fine.swing.ui.layout.Layouts;
import com.fr.base.BaseFormula;
import com.fr.base.TableData;
import com.fr.data.core.DataCoreUtils;
@ -23,22 +24,23 @@ import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
public class DatabaseDictPane extends FurtherBasicBeanPane<DatabaseDictionary> implements Previewable, UIObserver {
/**
* richer:数据字典和数据链面板
*/
private static final int GAP_HUGER = 32;
protected com.fr.data.impl.Connection database;
protected DoubleDeckValueEditorPane keyColumnPane;
protected DoubleDeckValueEditorPane valueDictPane;
@ -60,31 +62,32 @@ public class DatabaseDictPane extends FurtherBasicBeanPane<DatabaseDictionary> i
private void initBasicComponet() {
// keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
keyColumnPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Formula"));
formulaEditor.setEnabled(true);
// valueDictPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor});
valueDictPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor});
}
private void initComponet() {
chooseTable = new VerticalChoosePane(this);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p, p, p};
int[][] rowCount = {{1, 1}, {1, 3}, {1, 3}};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), UILabel.LEFT), keyColumnPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), UILabel.LEFT), valueDictPane}
};
JPanel dbDictPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, GAP_HUGER, LayoutConstants.VGAP_LARGE);
this.setLayout(new BorderLayout(0, 4));
this.add(chooseTable, BorderLayout.NORTH);
this.add(dbDictPanel, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(chooseTable),
row(
column(LayoutConstants.VERTICAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), UILabel.LEFT)).weight(1),
flex(1)
).weight(1),
cell(keyColumnPane).weight(2)
),
row(
column(LayoutConstants.VERTICAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), UILabel.LEFT)).weight(1),
flex(1)
).weight(1),
cell(valueDictPane).weight(2)
)
).getComponent(), BorderLayout.CENTER);
}

28
designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java

@ -1,5 +1,6 @@
package com.fr.design.present.dict;
import com.fine.swing.ui.layout.Layouts;
import com.fr.data.Dictionary;
import com.fr.data.impl.DynamicSQLDict;
import com.fr.design.beans.FurtherBasicBeanPane;
@ -8,8 +9,6 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import javax.swing.*;
@ -17,6 +16,9 @@ import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author zhou
* @since 2012-5-31下午12:20:41
@ -29,20 +31,14 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(0, 4));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Set"), UILabel.LEFT), jcb},
new Component[]{null, null}
};
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_MEDIUM);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Set"), UILabel.LEFT)).weight(1),
cell(jcb).weight(2)
),
cell(cardPane)
).getComponent());
}
@Override

6
designer-base/src/main/java/com/fr/design/present/dict/FormulaDictPane.java

@ -1,5 +1,6 @@
package com.fr.design.present.dict;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.data.impl.FormulaDictionary;
@ -34,8 +35,7 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
keyFormulaEditor.setColumns(EDITOR_COLUMN);
JPanel keyFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0));
keyFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER));
keyFormulaEditor.setPreferredSize(new Dimension(144, 20));
Icon icon = BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png");
Icon icon = new LazyIcon("formula");
keyFormulaContainer.add(new JLabel(icon));
keyFormulaContainer.add(keyFormulaEditor);
@ -50,7 +50,6 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
UILabel tag = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula_Dictionary_Display_Examples_Html"));
tag.setForeground(new Color(143, 143, 146));
tag.setPreferredSize(new Dimension(225, 80));
JPanel t = new JPanel(new BorderLayout());
t.add(tag, BorderLayout.CENTER);
@ -59,7 +58,6 @@ public class FormulaDictPane extends FurtherBasicBeanPane<FormulaDictionary> {
JPanel valueFormulaContainer = new JPanel(new FlowLayout(FlowLayout.RIGHT, LEFT_BORDER, 0));
valueFormulaContainer.setBorder(BorderFactory.createEmptyBorder(0, -LEFT_BORDER, 0, -LEFT_BORDER));
valueFormulaEditor.setPreferredSize(new Dimension(144, 20));
valueFormulaContainer.add(new JLabel(icon));
valueFormulaContainer.add(valueFormulaEditor);

47
designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java

@ -1,5 +1,6 @@
package com.fr.design.present.dict;
import com.fine.swing.ui.layout.Layouts;
import com.fr.base.BaseFormula;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
@ -27,24 +28,20 @@ import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* 数据字典的数据查询面板
@ -55,9 +52,7 @@ import java.util.concurrent.ExecutionException;
public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary> implements Previewable, UIObserver, Prepare4DataSourceChange {
private static final int BEGIN = 1;
private static final int END = 10;
private static final int VGAP = 24;
private static final long serialVersionUID = -5469742115988153206L;
private static final int SELECTED_NO_TABLEDATA = -2;
public TableDataComboBox tableDataNameComboBox;
private DoubleDeckValueEditorPane keyColumnPane;
private DoubleDeckValueEditorPane valueDictPane;
@ -89,35 +84,32 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
tdChange(e);
}
});
// keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
keyColumnPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
formulaEditor.setEnabled(true);
// valueDictPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor});
valueDictPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor(), formulaEditor});
}
private void initComponents() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p, p, p};
int[][] rowCount = {{1, 1}, {1, 3}, {1, 3}};
JPanel firstLine = new JPanel(new BorderLayout(4, 0));
firstLine.add(tableDataNameComboBox, BorderLayout.CENTER);
firstLine.add(new PreviewLabel(this), BorderLayout.EAST);
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Table_Data") + " ", UILabel.LEFT), firstLine},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value") + " ", UILabel.LEFT), keyColumnPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value") + " ", UILabel.LEFT), valueDictPane},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, VGAP, LayoutConstants.VGAP_MEDIUM);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Table_Data"), UILabel.LEFT)).weight(1),
cell(firstLine).weight(2)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Actual_Value"), UILabel.LEFT)).weight(1),
cell(keyColumnPane).weight(2)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value"), UILabel.LEFT)).weight(1),
cell(valueDictPane).weight(2)
)
).getComponent(), BorderLayout.CENTER);
}
@ -195,9 +187,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
}
@Override
/**
*
*/
public void populateBean(TableDataDictionary tableDataDict) {
populate(tableDataDict, "");
}

5
designer-base/src/main/resources/com/fine/theme/icon/cellelement.svg

@ -0,0 +1,5 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#149;&#229;&#133;&#131;&#230;&#160;&#188;&#229;&#133;&#131;&#231;&#180;&#160;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M0 2C0 0.895431 0.895431 0 2 0H21H27C27.5523 0 28 0.447715 28 1C28 1.55228 27.5523 2 27 2H22V10H27C27.5523 10 28 10.4477 28 11C28 11.5523 27.5523 12 27 12L22 12V20H27C27.5523 20 28 20.4477 28 21C28 21.5523 27.5523 22 27 22H22V27C22 27.5523 21.5523 28 21 28C20.4477 28 20 27.5523 20 27V22H12V26.9995V27C12 27.5523 11.5523 28 11 28C10.4477 28 10 27.5523 10 27V22H2L2 27C2 27.5523 1.55228 28 1 28C0.447715 28 0 27.5523 0 27V2ZM2 20H11H20V11L20 2H2L2 20Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 756 B

5
designer-base/src/main/resources/com/fine/theme/icon/cellelement_disable.svg

@ -0,0 +1,5 @@
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#149;&#229;&#133;&#131;&#230;&#160;&#188;&#229;&#133;&#131;&#231;&#180;&#160;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M0 2C0 0.895431 0.895431 0 2 0H21H27C27.5523 0 28 0.447715 28 1C28 1.55228 27.5523 2 27 2H22V10H27C27.5523 10 28 10.4477 28 11C28 11.5523 27.5523 12 27 12L22 12V20H27C27.5523 20 28 20.4477 28 21C28 21.5523 27.5523 22 27 22H22V27C22 27.5523 21.5523 28 21 28C20.4477 28 20 27.5523 20 27V22H12V26.9995V27C12 27.5523 11.5523 28 11 28C10.4477 28 10 27.5523 10 27V22H2L2 27C2 27.5523 1.55228 28 1 28C0.447715 28 0 27.5523 0 27V2ZM2 20H11H20V11L20 2H2L2 20Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 757 B

10
designer-base/src/main/resources/com/fine/theme/icon/close/close.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5109_80552)">
<path d="M14.5858 16L7.51472 23.0711C7.12419 23.4616 7.12419 24.0948 7.51472 24.4853C7.90524 24.8758 8.53841 24.8758 8.92893 24.4853L16 17.4142L23.0711 24.4853C23.4616 24.8758 24.0948 24.8758 24.4853 24.4853C24.8758 24.0948 24.8758 23.4616 24.4853 23.0711L17.4142 16L24.4853 8.92893C24.8758 8.5384 24.8758 7.90524 24.4853 7.51471C24.0948 7.12419 23.4616 7.12419 23.0711 7.51472L16 14.5858L8.92893 7.51472C8.53841 7.12419 7.90524 7.12419 7.51472 7.51472C7.12419 7.90524 7.12419 8.5384 7.51472 8.92893L14.5858 16Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5109_80552">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 800 B

10
designer-base/src/main/resources/com/fine/theme/icon/close/close_disable.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_6669_103725)">
<path d="M14.5858 16L7.51472 23.0711C7.12419 23.4616 7.12419 24.0948 7.51472 24.4853C7.90524 24.8758 8.53841 24.8758 8.92893 24.4853L16 17.4142L23.0711 24.4853C23.4616 24.8758 24.0948 24.8758 24.4853 24.4853C24.8758 24.0948 24.8758 23.4616 24.4853 23.0711L17.4142 16L24.4853 8.92894C24.8758 8.53842 24.8758 7.90525 24.4853 7.51473C24.0948 7.12421 23.4616 7.12421 23.0711 7.51473L16 14.5858L8.92893 7.51473C8.53841 7.12421 7.90524 7.12421 7.51472 7.51473C7.12419 7.90525 7.12419 8.53842 7.51472 8.92894L14.5858 16Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_6669_103725">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 805 B

11
designer-base/src/main/resources/com/fine/theme/icon/close/close_round.svg

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5827_104846)">
<circle cx="16" cy="16" r="16" fill="#2576EF"/>
<path d="M14.6667 16L7.99999 22.6667C7.6318 23.0349 7.6318 23.6318 7.99999 24L-nan -nanL7.99999 24C8.36819 24.3682 8.96514 24.3682 9.33333 24L16 17.3333L22.6667 24C23.0349 24.3682 23.6318 24.3682 24 24L-nan -nanL24 24C24.3682 23.6318 24.3682 23.0349 24 22.6667L17.3333 16L24 9.33334C24.3682 8.96515 24.3682 8.3682 24 8.00001L-nan -nanL24 8.00001C23.6318 7.63182 23.0349 7.63182 22.6667 8.00001L16 14.6667L9.33333 8.00001C8.96514 7.63182 8.36818 7.63182 7.99999 8.00001L-nan -nanL7.99999 8.00001C7.6318 8.3682 7.6318 8.96515 7.99999 9.33334L14.6667 16Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_5827_104846">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 869 B

11
designer-base/src/main/resources/com/fine/theme/icon/close/close_round_disable.svg

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_6669_103730)">
<circle cx="16" cy="16" r="16" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M14.6667 16L7.99999 22.6667C7.6318 23.0349 7.6318 23.6318 7.99999 24L-nan -nanL7.99999 24C8.36819 24.3682 8.96514 24.3682 9.33333 24L16 17.3333L22.6667 24C23.0349 24.3682 23.6318 24.3682 24 24L-nan -nanL24 24C24.3682 23.6318 24.3682 23.0349 24 22.6667L17.3333 16L24 9.33334C24.3682 8.96515 24.3682 8.3682 24 8.00001L-nan -nanL24 8.00001C23.6318 7.63182 23.0349 7.63182 22.6667 8.00001L16 14.6667L9.33333 8.00001C8.96514 7.63182 8.36818 7.63182 7.99999 8.00001L-nan -nanL7.99999 8.00001C7.6318 8.3682 7.6318 8.96515 7.99999 9.33334L14.6667 16Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_6669_103730">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 889 B

4
designer-base/src/main/resources/com/fine/theme/icon/font/add_parenthesis.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30.0005 15.9863C30.0005 21.117 27.8277 25.2953 24.483 28.5692C24.2132 28.8332 23.8068 28.8947 23.4653 28.7339C22.8734 28.4552 22.7492 27.666 23.1984 27.1903C26.1013 24.1162 27.8405 20.4084 27.8405 15.9863C27.8405 11.5889 26.1013 7.88355 23.1984 4.80968C22.7492 4.33403 22.8734 3.54479 23.4653 3.2661C23.8068 3.1053 24.2132 3.1668 24.483 3.43084C27.8277 6.70464 30.0005 10.8818 30.0005 15.9863Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M2 15.9863C2 10.8818 4.17272 6.70464 7.51751 3.43084C7.78727 3.1668 8.19363 3.1053 8.53515 3.2661C9.12704 3.54479 9.25125 4.33403 8.80206 4.80968C5.89919 7.88355 4.16 11.5889 4.16 15.9863C4.16 20.4084 5.89919 24.1162 8.80207 27.1903C9.25124 27.666 9.12704 28.4552 8.53515 28.7339C8.19363 28.8947 7.78727 28.8332 7.51751 28.5692C4.17272 25.2953 2 21.117 2 15.9863Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 954 B

4
designer-base/src/main/resources/com/fine/theme/icon/font/add_parenthesis_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30.0005 15.9863C30.0005 21.117 27.8277 25.2953 24.483 28.5692C24.2132 28.8332 23.8068 28.8947 23.4653 28.7339C22.8734 28.4552 22.7492 27.666 23.1984 27.1903C26.1013 24.1162 27.8405 20.4084 27.8405 15.9863C27.8405 11.5889 26.1013 7.88355 23.1984 4.80968C22.7492 4.33403 22.8734 3.54479 23.4653 3.2661C23.8068 3.1053 24.2132 3.1668 24.483 3.43084C27.8277 6.70464 30.0005 10.8818 30.0005 15.9863Z" fill="#0A1C38" fill-opacity="0.29"/>
<path d="M2 15.9863C2 10.8818 4.17272 6.70464 7.51751 3.43084C7.78727 3.1668 8.19363 3.1053 8.53515 3.2661C9.12704 3.54479 9.25125 4.33403 8.80206 4.80968C5.89919 7.88355 4.16 11.5889 4.16 15.9863C4.16 20.4084 5.89919 24.1162 8.80207 27.1903C9.25124 27.666 9.12704 28.4552 8.53515 28.7339C8.19363 28.8947 7.78727 28.8332 7.51751 28.5692C4.17272 25.2953 2 21.117 2 15.9863Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 956 B

11
designer-base/src/main/resources/com/fine/theme/icon/font/remove_parenthesis.svg

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5516_63926)">
<path d="M0.706956 5.70711C1.09748 5.31658 1.73064 5.31658 2.12117 5.70711L26.1628 29.7487C26.5533 30.1393 26.5533 30.7724 26.1628 31.163C25.7723 31.5535 25.1391 31.5535 24.7486 31.163L0.706956 7.12132C0.316432 6.7308 0.316431 6.09763 0.706956 5.70711Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.3174 24.6606L26.7639 26.1071C28.7812 23.2689 30 19.9085 30 16.0055C30 10.8245 27.8303 6.58419 24.4895 3.26012C24.2164 2.98835 23.8009 2.9251 23.4533 3.09133C22.8632 3.37356 22.7387 4.16057 23.1846 4.63923C26.0955 7.76411 27.84 11.5323 27.84 16.0055C27.84 19.2614 26.9261 22.136 25.3174 24.6606ZM5.81511 5.15826C6.33779 4.49534 6.9049 3.86268 7.51049 3.26012C7.78362 2.98835 8.19909 2.9251 8.54669 3.09133C9.13685 3.37356 9.26132 4.16056 8.81543 4.63923C8.23913 5.25789 7.70855 5.90176 7.22818 6.57132L5.81511 5.15826ZM2.26731 12.9242C2.09201 13.9115 2 14.9385 2 16.0055C2 21.2129 4.16968 25.4544 7.51049 28.7786C7.78362 29.0503 8.19909 29.1136 8.54669 28.9473C9.13685 28.6651 9.26131 27.8781 8.81544 27.3994C5.90453 24.2743 4.16 20.5038 4.16 16.0055C4.16 15.617 4.17316 15.2338 4.19909 14.8559L2.26731 12.9242Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5516_63926">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

11
designer-base/src/main/resources/com/fine/theme/icon/font/remove_parenthesis_disable.svg

@ -0,0 +1,11 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_167077)">
<path d="M0.706956 5.70711C1.09748 5.31658 1.73064 5.31658 2.12117 5.70711L26.1628 29.7487C26.5533 30.1393 26.5533 30.7724 26.1628 31.163C25.7723 31.5535 25.1391 31.5535 24.7486 31.163L0.706956 7.12132C0.316432 6.7308 0.316431 6.09763 0.706956 5.70711Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.3174 24.6606L26.7639 26.1071C28.7812 23.2689 30 19.9085 30 16.0055C30 10.8245 27.8303 6.58419 24.4895 3.26012C24.2164 2.98835 23.8009 2.9251 23.4533 3.09133C22.8632 3.37356 22.7387 4.16057 23.1846 4.63923C26.0955 7.76411 27.84 11.5323 27.84 16.0055C27.84 19.2614 26.9261 22.136 25.3174 24.6606ZM5.81511 5.15826C6.33779 4.49534 6.9049 3.86268 7.51049 3.26012C7.78362 2.98835 8.19909 2.9251 8.54669 3.09133C9.13685 3.37356 9.26132 4.16056 8.81543 4.63923C8.23913 5.25789 7.70855 5.90176 7.22818 6.57132L5.81511 5.15826ZM2.26731 12.9242C2.09201 13.9115 2 14.9385 2 16.0055C2 21.2129 4.16968 25.4544 7.51049 28.7786C7.78362 29.0503 8.19909 29.1136 8.54669 28.9473C9.13685 28.6651 9.26131 27.8781 8.81544 27.3994C5.90453 24.2743 4.16 20.5038 4.16 16.0055C4.16 15.617 4.17316 15.2338 4.19909 14.8559L2.26731 12.9242Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_167077">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

17
designer-base/src/main/resources/com/fine/theme/icon/font/shadow.svg

@ -0,0 +1,17 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_5856_25936)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 17.0102C15.5 17.0102 17.5 17.0102 16.5 17.0102C11 17.0102 6.5 14.5102 6.5 9.51019C6.5 5.36806 10.7533 2.01019 16 2.01019C20.5558 2.01019 24.3627 4.54197 25.2862 7.92058C25.4435 8.4959 24.9677 9.01019 24.3713 9.01019C23.8563 9.01019 23.434 8.61981 23.2633 8.13399C22.4302 5.76241 19.4941 4.01019 16 4.01019C11.8579 4.01019 8.5 6.47263 8.5 9.51019C8.50981 13.5102 13.5 15.0102 16.5 15.0102C23.4792 15.0102 25.5 18.5 25.5 22.5C25.5 26.5 21.2259 30 15.9792 30C11.4235 30 7.61674 27.4683 6.69307 24.0899C6.53578 23.5145 7.01157 23.0002 7.60801 23.0002C8.12293 23.0002 8.54528 23.3906 8.71597 23.8764C9.5492 26.2479 12.4852 28 15.9792 28C20.1214 28 23.4792 25.5376 23.4792 22.5C23.4792 19.4624 21.5 17.0102 16.5 17.0102Z" fill="#0A1C38" fill-opacity="0.9" shape-rendering="crispEdges"/>
</g>
<defs>
<filter id="filter0_d_5856_25936" x="5.5" y="2.01019" width="21" height="29.9898" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5856_25936"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5856_25936" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

17
designer-base/src/main/resources/com/fine/theme/icon/font/shadow_disable.svg

@ -0,0 +1,17 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_5863_26091)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 17.0102C15.5 17.0102 17.5 17.0102 16.5 17.0102C11 17.0102 6.5 14.5102 6.5 9.51019C6.5 5.36806 10.7533 2.01019 16 2.01019C20.5558 2.01019 24.3627 4.54197 25.2862 7.92058C25.4435 8.4959 24.9677 9.01019 24.3713 9.01019C23.8563 9.01019 23.434 8.61981 23.2633 8.13399C22.4302 5.76241 19.4941 4.01019 16 4.01019C11.8579 4.01019 8.5 6.47263 8.5 9.51019C8.50981 13.5102 13.5 15.0102 16.5 15.0102C23.4792 15.0102 25.5 18.5 25.5 22.5C25.5 26.5 21.2259 30 15.9792 30C11.4235 30 7.61674 27.4683 6.69307 24.0899C6.53578 23.5145 7.01157 23.0002 7.60801 23.0002C8.12293 23.0002 8.54528 23.3906 8.71597 23.8764C9.5492 26.2479 12.4852 28 15.9792 28C20.1214 28 23.4792 25.5376 23.4792 22.5C23.4792 19.4624 21.5 17.0102 16.5 17.0102Z" fill="#0A1C38" fill-opacity="0.29" shape-rendering="crispEdges"/>
</g>
<defs>
<filter id="filter0_d_5863_26091" x="5.5" y="2.01019" width="21" height="29.9898" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_5863_26091"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_5863_26091" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/font/strike.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 9.5C6 10.7649 6.44131 11.9559 7.20382 13H9.91785C8.73919 12.0491 8 10.8296 8 9.5C8 6.46243 11.3579 4 15.5 4C18.9941 4 21.9302 5.75222 22.7633 8.12379C22.934 8.60962 23.3563 9 23.8713 9C24.4677 9 24.9435 8.48571 24.7862 7.91039C23.8627 4.53177 20.0558 2 15.5 2C10.2533 2 6 5.35786 6 9.5ZM23.8905 19H21.2818C22.3426 19.9513 22.9792 21.1672 22.9792 22.4898C22.9792 25.5274 19.6214 27.9898 15.4792 27.9898C11.9852 27.9898 9.0492 26.2377 8.21597 23.8662C8.04528 23.3804 7.62293 22.99 7.10801 22.99C6.51157 22.99 6.03578 23.5043 6.19307 24.0797C7.11674 27.4582 10.9235 29.9898 15.4792 29.9898C20.7259 29.9898 24.9792 26.6319 24.9792 22.4898C24.9792 21.2299 24.5857 20.0425 23.8905 19ZM3 15C2.44772 15 2 15.4477 2 16C2 16.5523 2.44771 17 3 17H29C29.5523 17 30 16.5523 30 16C30 15.4477 29.5523 15 29 15H3Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 990 B

3
designer-base/src/main/resources/com/fine/theme/icon/font/strike_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 9.5C6 10.7649 6.44131 11.9559 7.20382 13H9.91785C8.73919 12.0491 8 10.8296 8 9.5C8 6.46243 11.3579 4 15.5 4C18.9941 4 21.9302 5.75222 22.7633 8.12379C22.934 8.60962 23.3563 9 23.8713 9C24.4677 9 24.9435 8.48571 24.7862 7.91039C23.8627 4.53177 20.0558 2 15.5 2C10.2533 2 6 5.35786 6 9.5ZM23.8905 19H21.2818C22.3426 19.9513 22.9792 21.1672 22.9792 22.4898C22.9792 25.5274 19.6214 27.9898 15.4792 27.9898C11.9852 27.9898 9.0492 26.2377 8.21597 23.8662C8.04528 23.3804 7.62293 22.99 7.10801 22.99C6.51157 22.99 6.03578 23.5043 6.19307 24.0797C7.11674 27.4582 10.9235 29.9898 15.4792 29.9898C20.7259 29.9898 24.9792 26.6319 24.9792 22.4898C24.9792 21.2299 24.5857 20.0425 23.8905 19ZM3 15C2.44772 15 2 15.4477 2 16C2 16.5523 2.44771 17 3 17H29C29.5523 17 30 16.5523 30 16C30 15.4477 29.5523 15 29 15H3Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 991 B

3
designer-base/src/main/resources/com/fine/theme/icon/font/sub.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 13L11 11H9H4V5L24 5V11H19H17V13L17 27H11V13ZM4 13H7H9V15L9 27C9 28.1046 9.89543 29 11 29H17C18.1046 29 19 28.1046 19 27V15V13H21H24C25.1046 13 26 12.1046 26 11V5C26 3.89543 25.1046 3 24 3H4C2.89543 3 2 3.89543 2 5V11C2 12.1046 2.89543 13 4 13ZM28 24C28 23.4477 27.5523 23 27 23H25C24.4477 23 24 23.4477 24 24C24 24.5523 24.4477 25 25 25H26V28H25C24.4477 28 24 28.4477 24 29C24 29.5523 24.4477 30 25 30H29C29.5523 30 30 29.5523 30 29C30 28.4477 29.5523 28 29 28H28V24Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 661 B

3
designer-base/src/main/resources/com/fine/theme/icon/font/sub_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 13L11 11H9H4V5L24 5V11H19H17V13L17 27H11V13ZM4 13H7H9V15L9 27C9 28.1046 9.89543 29 11 29H17C18.1046 29 19 28.1046 19 27V15V13H21H24C25.1046 13 26 12.1046 26 11V5C26 3.89543 25.1046 3 24 3H4C2.89543 3 2 3.89543 2 5V11C2 12.1046 2.89543 13 4 13ZM28 24C28 23.4477 27.5523 23 27 23H25C24.4477 23 24 23.4477 24 24C24 24.5523 24.4477 25 25 25H26V28H25C24.4477 28 24 28.4477 24 29C24 29.5523 24.4477 30 25 30H29C29.5523 30 30 29.5523 30 29C30 28.4477 29.5523 28 29 28H28V24Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 662 B

3
designer-base/src/main/resources/com/fine/theme/icon/font/super.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 3C30 2.44772 29.5523 2 29 2H27C26.4477 2 26 2.44772 26 3C26 3.55228 26.4477 4 27 4L28 4V7H27C26.4477 7 26 7.44772 26 8C26 8.55228 26.4477 9 27 9H31C31.5523 9 32 8.55228 32 8C32 7.44772 31.5523 7 31 7H30V3ZM9 13V11H7H2V5H22V11H17H15V13L15 27H9L9 13ZM2 13H5H7V15L7 27C7 28.1046 7.89543 29 9 29H15C16.1046 29 17 28.1046 17 27V15V13H19H22C23.1046 13 24 12.1046 24 11V5C24 3.89543 23.1046 3 22 3H2C0.895431 3 0 3.89543 0 5V11C0 12.1046 0.89543 13 2 13Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 641 B

3
designer-base/src/main/resources/com/fine/theme/icon/font/super_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 3C30 2.44772 29.5523 2 29 2H27C26.4477 2 26 2.44772 26 3C26 3.55228 26.4477 4 27 4L28 4V7H27C26.4477 7 26 7.44772 26 8C26 8.55228 26.4477 9 27 9H31C31.5523 9 32 8.55228 32 8C32 7.44772 31.5523 7 31 7H30V3ZM9 13V11H7H2V5H22V11H17H15V13L15 27H9L9 13ZM2 13H5H7V15L7 27C7 28.1046 7.89543 29 9 29H15C16.1046 29 17 28.1046 17 27V15V13H19H22C23.1046 13 24 12.1046 24 11V5C24 3.89543 23.1046 3 22 3H2C0.895431 3 0 3.89543 0 5V11C0 12.1046 0.89543 13 2 13Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 642 B

4
designer-base/src/main/resources/com/fine/theme/icon/select.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M28 14.0234V4C28 2.89543 27.1046 2 26 2H10.9199C10.336 2 9.78132 2.25513 9.40136 2.69842L4.48149 8.43827C4.17078 8.80075 4 9.26243 4 9.73985V27C4 28.1046 4.89543 29 6 29H15.3558C14.7333 28.6102 14.1448 28.1446 13.6034 27.6032C13.4082 27.4081 13.2229 27.2068 13.0475 27H6L6 9.73985L10.9199 4L26 4V12.3018C26.5675 12.6715 27.1053 13.1053 27.6033 13.6033C27.7404 13.7404 27.8726 13.8805 28 14.0234Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.6519 25.2377C28.9469 22.2501 28.7265 17.9515 25.9908 15.2158C23.0154 12.2404 18.1913 12.2404 15.2158 15.2158C12.2404 18.1912 12.2404 23.0153 15.2158 25.9907C17.9516 28.7264 22.2501 28.9468 25.2376 26.6519L27.7929 29.2071C28.1834 29.5976 28.8166 29.5976 29.2071 29.2071C29.5976 28.8166 29.5976 28.1834 29.2071 27.7929L26.6519 25.2377ZM24.5766 24.5765C26.7709 22.3821 26.7709 18.8244 24.5766 16.63C22.3822 14.4356 18.8244 14.4356 16.6301 16.63C14.4357 18.8244 14.4357 22.3821 16.63 24.5765C18.8244 26.7709 22.3822 26.7709 24.5766 24.5765Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

4
designer-base/src/main/resources/com/fine/theme/icon/select_disable.svg

@ -0,0 +1,4 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M28 14.0234V4C28 2.89543 27.1046 2 26 2H10.9199C10.336 2 9.78132 2.25513 9.40136 2.69842L4.48149 8.43827C4.17078 8.80075 4 9.26243 4 9.73985V27C4 28.1046 4.89543 29 6 29H15.3558C14.7333 28.6102 14.1448 28.1446 13.6034 27.6032C13.4082 27.4081 13.2229 27.2068 13.0475 27H6L6 9.73985L10.9199 4L26 4V12.3018C26.5675 12.6715 27.1053 13.1053 27.6033 13.6033C27.7404 13.7404 27.8726 13.8805 28 14.0234Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.6519 25.2377C28.9469 22.2501 28.7265 17.9515 25.9908 15.2158C23.0154 12.2404 18.1913 12.2404 15.2158 15.2158C12.2404 18.1912 12.2404 23.0153 15.2158 25.9907C17.9516 28.7264 22.2501 28.9468 25.2376 26.6519L27.7929 29.2071C28.1834 29.5976 28.8166 29.5976 29.2071 29.2071C29.5976 28.8166 29.5976 28.1834 29.2071 27.7929L26.6519 25.2377ZM24.5766 24.5765C26.7709 22.3821 26.7709 18.8244 24.5766 16.63C22.3822 14.4356 18.8244 14.4356 16.6301 16.63C14.4357 18.8244 14.4357 22.3821 16.63 24.5765C18.8244 26.7709 22.3822 26.7709 24.5766 24.5765Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/sort/fill/nosort.svg

@ -0,0 +1,6 @@
<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#135;&#229;&#186;&#143;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M9.05792 14.7326C9.08149 14.7842 9.11322 14.8326 9.15311 14.8755C9.34596 15.0832 9.65779 15.0861 9.85394 14.882L13.2778 11.3201C13.4788 11.111 13.4816 10.765 13.284 10.5522C13.0911 10.3445 12.7793 10.3416 12.5831 10.5457L10.0005 13.2325L10.0005 1.49972C10.0005 1.22358 9.77662 0.999722 9.50048 0.999722C9.22434 0.999722 9.00049 1.22358 9.00049 1.49972L9.00049 14.4997C9.00049 14.5838 9.02125 14.663 9.05792 14.7326Z" fill="#{fillColor}" fill-opacity="0.9"/>
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M4.10362 1.1952C4.11843 1.17596 4.13461 1.15784 4.15201 1.14097C4.34645 0.92878 4.66481 0.927069 4.86119 1.13856C4.9809 1.26748 5.02736 1.44582 4.99999 1.6131L5 14.5C5 14.7761 4.77614 15 4.5 15C4.22386 15 4.00001 14.7761 4.00001 14.5L4 2.86647L1.56076 5.60372C1.36681 5.82137 1.04468 5.82493 0.846611 5.61163C0.654224 5.40445 0.651026 5.06961 0.839414 4.85821L4.10362 1.1952Z" fill="#{fillColor}" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

8
designer-base/src/main/resources/com/fine/theme/icon/sort/fill/sort_asc.svg

@ -0,0 +1,8 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#135;&#229;&#186;&#143;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M4.47705 1.17871C4.47705 0.902567 4.25319 0.678711 3.97705 0.678711C3.79979 0.678711 3.64408 0.770951 3.55529 0.910051L0.353546 4.35808C0.158284 4.56836 0.158284 4.9093 0.353546 5.11958C0.548808 5.32986 0.86539 5.32986 1.06065 5.11958L3.47705 2.5173L3.47706 13.1787C3.47706 13.4549 3.70091 13.6787 3.97705 13.6787C4.25319 13.6787 4.47705 13.4549 4.47705 13.1787L4.47705 1.17871Z" fill="#{fillColor}" fill-opacity="0.9"/>
<path id="Rectangle 34625512" d="M10.5 10.5C10.5 10.7761 10.2761 11 10 11H6C5.72386 11 5.5 10.7761 5.5 10.5C5.5 10.2239 5.72386 10 6 10H10C10.2761 10 10.5 10.2239 10.5 10.5Z" fill="#{fillColor}" fill-opacity="0.9"/>
<path id="Rectangle 34625513" d="M12.5 6.5C12.5 6.77614 12.2761 7 12 7H6C5.72386 7 5.5 6.77614 5.5 6.5C5.5 6.22386 5.72386 6 6 6H12C12.2761 6 12.5 6.22386 12.5 6.5Z" fill="#{fillColor}" fill-opacity="0.9"/>
<path id="Rectangle 34625514" d="M14 2.5C14 2.77614 13.7761 3 13.5 3H6C5.72386 3 5.5 2.77614 5.5 2.5C5.5 2.22386 5.72386 2 6 2H13.5C13.7761 2 14 2.22386 14 2.5Z" fill="#{fillColor}" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

8
designer-base/src/main/resources/com/fine/theme/icon/sort/fill/sort_desc.svg

@ -0,0 +1,8 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#233;&#153;&#141;&#229;&#186;&#143;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M4.47705 13C4.47705 13.2761 4.25319 13.5 3.97705 13.5C3.79979 13.5 3.64408 13.4078 3.55529 13.2687L0.353546 9.82063C0.158284 9.61035 0.158284 9.26941 0.353546 9.05913C0.548808 8.84885 0.86539 8.84885 1.06065 9.05913L3.47705 11.6614L3.47706 0.999996C3.47706 0.723856 3.70091 0.5 3.97705 0.5C4.25319 0.5 4.47705 0.723856 4.47705 0.999996L4.47705 13Z" fill="#{fillColor}" fill-opacity="0.9"/>
<path id="Rectangle 34625512" d="M10.5 10.5C10.5 10.7761 10.2761 11 10 11H6C5.72386 11 5.5 10.7761 5.5 10.5C5.5 10.2239 5.72386 10 6 10H10C10.2761 10 10.5 10.2239 10.5 10.5Z" fill="#{fillColor}" fill-opacity="0.9"/>
<path id="Rectangle 34625513" d="M12.5 6.5C12.5 6.77614 12.2761 7 12 7H6C5.72386 7 5.5 6.77614 5.5 6.5C5.5 6.22386 5.72386 6 6 6H12C12.2761 6 12.5 6.22386 12.5 6.5Z" fill="#{fillColor}" fill-opacity="0.9"/>
<path id="Rectangle 34625514" d="M14 2.5C14 2.77614 13.7761 3 13.5 3H6C5.72386 3 5.5 2.77614 5.5 2.5C5.5 2.22386 5.72386 2 6 2H13.5C13.7761 2 14 2.22386 14 2.5Z" fill="#{fillColor}" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/sort/nosort.svg

@ -0,0 +1,6 @@
<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#135;&#229;&#186;&#143;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M9.05792 14.7326C9.08149 14.7842 9.11322 14.8326 9.15311 14.8755C9.34596 15.0832 9.65779 15.0861 9.85394 14.882L13.2778 11.3201C13.4788 11.111 13.4816 10.765 13.284 10.5522C13.0911 10.3445 12.7793 10.3416 12.5831 10.5457L10.0005 13.2325L10.0005 1.49972C10.0005 1.22358 9.77662 0.999722 9.50048 0.999722C9.22434 0.999722 9.00049 1.22358 9.00049 1.49972L9.00049 14.4997C9.00049 14.5838 9.02125 14.663 9.05792 14.7326Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M4.10362 1.1952C4.11843 1.17596 4.13461 1.15784 4.15201 1.14097C4.34645 0.92878 4.66481 0.927069 4.86119 1.13856C4.9809 1.26748 5.02736 1.44582 4.99999 1.6131L5 14.5C5 14.7761 4.77614 15 4.5 15C4.22386 15 4.00001 14.7761 4.00001 14.5L4 2.86647L1.56076 5.60372C1.36681 5.82137 1.04468 5.82493 0.846611 5.61163C0.654224 5.40445 0.651026 5.06961 0.839414 4.85821L4.10362 1.1952Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/sort/nosort_disable.svg

@ -0,0 +1,6 @@
<svg width="26" height="30" viewBox="0 0 26 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#135;&#229;&#186;&#143;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M17.1158 28.4658C17.163 28.569 17.2264 28.6657 17.3062 28.7516C17.6919 29.167 18.3156 29.1728 18.7079 28.7647L25.5556 21.6409C25.9577 21.2226 25.9632 20.5307 25.568 20.105C25.1823 19.6897 24.5586 19.6839 24.1663 20.092L19.001 25.4656L19.001 2.00004C19.001 1.44776 18.5532 1.00005 18.001 1.00005C17.4487 1.00005 17.001 1.44776 17.001 2.00005L17.001 28.0001C17.001 28.1682 17.0425 28.3267 17.1158 28.4658Z" fill="#0A1C38" fill-opacity="0.29"/>
<path id="Union_2" fill-rule="evenodd" clip-rule="evenodd" d="M7.20723 1.39046C7.23685 1.35198 7.26922 1.31573 7.30403 1.28198C7.69292 0.857611 8.32962 0.854191 8.72238 1.27717C8.96181 1.53501 9.05473 1.89169 8.99999 2.22624L9 28.0001C9 28.5523 8.55229 29 8.00001 29C7.44773 29 7.00001 28.5523 7.00001 28.0001L7.00001 4.73298L2.12153 10.2075C1.73363 10.6428 1.08936 10.6499 0.693222 10.2233C0.308449 9.80894 0.302052 9.13927 0.678827 8.71646L7.20723 1.39046Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

8
designer-base/src/main/resources/com/fine/theme/icon/sort/sort_asc.svg

@ -0,0 +1,8 @@
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#135;&#229;&#186;&#143;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M4.47705 1.17871C4.47705 0.902567 4.25319 0.678711 3.97705 0.678711C3.79979 0.678711 3.64408 0.770951 3.55529 0.910051L0.353546 4.35808C0.158284 4.56836 0.158284 4.9093 0.353546 5.11958C0.548808 5.32986 0.86539 5.32986 1.06065 5.11958L3.47705 2.5173L3.47706 13.1787C3.47706 13.4549 3.70091 13.6787 3.97705 13.6787C4.25319 13.6787 4.47705 13.4549 4.47705 13.1787L4.47705 1.17871Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Rectangle 34625512" d="M10.5 10.5C10.5 10.7761 10.2761 11 10 11H6C5.72386 11 5.5 10.7761 5.5 10.5C5.5 10.2239 5.72386 10 6 10H10C10.2761 10 10.5 10.2239 10.5 10.5Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Rectangle 34625513" d="M12.5 6.5C12.5 6.77614 12.2761 7 12 7H6C5.72386 7 5.5 6.77614 5.5 6.5C5.5 6.22386 5.72386 6 6 6H12C12.2761 6 12.5 6.22386 12.5 6.5Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Rectangle 34625514" d="M14 2.5C14 2.77614 13.7761 3 13.5 3H6C5.72386 3 5.5 2.77614 5.5 2.5C5.5 2.22386 5.72386 2 6 2H13.5C13.7761 2 14 2.22386 14 2.5Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

8
designer-base/src/main/resources/com/fine/theme/icon/sort/sort_asc_disable.svg

@ -0,0 +1,8 @@
<svg width="28" height="27" viewBox="0 0 28 27" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#229;&#141;&#135;&#229;&#186;&#143;">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8.95409 1.35717C8.95409 0.804889 8.50638 0.357178 7.9541 0.357178C7.59959 0.357178 7.28816 0.541658 7.11058 0.819856L0.707093 7.71592C0.316569 8.13648 0.316568 8.81835 0.707092 9.23892C1.09762 9.65948 1.73078 9.65948 2.12131 9.23892L6.95411 4.03436L6.95412 25.3572C6.95412 25.9095 7.40183 26.3572 7.95411 26.3572C8.50639 26.3572 8.9541 25.9095 8.9541 25.3572L8.95409 1.35717Z" fill="#0A1C38" fill-opacity="0.29"/>
<path id="Rectangle 34625512" d="M21 20C21 20.5523 20.5523 21 20 21H12C11.4477 21 11 20.5523 11 20C11 19.4477 11.4477 19 12 19H20C20.5523 19 21 19.4477 21 20Z" fill="#0A1C38" fill-opacity="0.29"/>
<path id="Rectangle 34625513" d="M25 12C25 12.5523 24.5523 13 24 13H12C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11H24C24.5523 11 25 11.4477 25 12Z" fill="#0A1C38" fill-opacity="0.29"/>
<path id="Rectangle 34625514" d="M28 4C28 4.55228 27.5523 5 27 5H12C11.4477 5 11 4.55228 11 4C11 3.44772 11.4477 3 12 3H27C27.5523 3 28 3.44772 28 4Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

0
designer-base/src/main/resources/com/fine/theme/icon/toolbar/sort_asc.svg → designer-base/src/main/resources/com/fine/theme/icon/sort/sort_desc.svg

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
designer-base/src/main/resources/com/fine/theme/icon/toolbar/sort_asc_disable.svg → designer-base/src/main/resources/com/fine/theme/icon/sort/sort_desc_disable.svg

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

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

@ -49,6 +49,7 @@ Component.defaultVGap=10
@BrandHoverColor = #5493F2
@BrandPressedColor = #105DD1
@BrandHoverColorSP = #2576EF 12%
@BrandTipColor = #0a1c3877
@marginSmall = 4
@marginLarge = 10
@ -139,7 +140,7 @@ tooltip.disabled=#A3ADBD
#---- Button ----
Button.border = com.formdev.flatlaf.ui.FlatButtonBorder
Button.arc = 3
Button.arc = 6
Button.minimumWidth = 72
Button.margin = 2,12,2,12
Button.iconTextGap = 4
@ -354,6 +355,9 @@ FormattedTextField.selectionBackground=$color.brand4
FormattedTextField.placeholderForeground = @disabledForeground
FormattedTextField.iconTextGap = 4
# ---- Label ----
Label.tipColor = @BrandTipColor
#---- HelpButton ----
HelpButton.questionMarkColor = @accentCheckmarkColor
@ -993,7 +997,6 @@ ToggleButton.margin = $Button.margin
ToggleButton.compact.margin = 2,0,2,0
ToggleButton.iconTextGap = $Button.iconTextGap
ToggleButton.rollover = $Button.rollover
ToggleButton.background = $Button.background
ToggleButton.pressedBackground = @BrandPressedColor
ToggleButton.selectedBackground = @BrandColor
@ -1112,7 +1115,7 @@ Tree.hash = darken($Tree.background,10%)
West.border = $defaultBorderColor
#---- ExpandablePane ----
ExpandablePane.HeaderPane.borderInsets=0, 6, 0, 6
ExpandablePane.HeaderPane.hGap=2
ExpandablePane.HeaderPane.hGap=0
ExpandablePane.HeaderPane.foreground=$text.highlight
ExpandablePane.vGap=5
HeaderPane.width=248

76
designer-realize/src/main/java/com/fr/design/expand/ExpandFatherPane.java

@ -1,10 +1,12 @@
package com.fr.design.expand;
import com.fr.base.BaseUtils;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.gui.columnrow.ColumnRowPane;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.ElementCasePane;
@ -20,8 +22,8 @@ import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import static com.fine.swing.ui.layout.Layouts.cell;
public abstract class ExpandFatherPane extends JPanel implements GlobalNameObserver {
@ -33,24 +35,15 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
private String expandFatherName = "";
private GlobalNameListener globalNameListener = null;
private boolean isAlreadyAddListener = false;
public JPanel customPane;
private CardLayout cardLayout;
private ReactiveCardPane cardPane;
public ExpandFatherPane() {
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL));
this.setLayout(new BorderLayout());
comboBox = new UIComboBox(new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_None"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")});
cardLayout = new CardLayout();
customPane = new JPanel(cardLayout);
customParentColumnRowPane = new ColumnRowPane() {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 20);
}
public void setGlobalName() {
if (shouldResponseNameListener()) {
globalNameListener.setGlobalName(expandFatherName);
@ -58,54 +51,31 @@ public abstract class ExpandFatherPane extends JPanel implements GlobalNameObser
}
};
UIButton imageButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/buttonicon/select.png"));
imageButton.setPreferredSize(new Dimension(24, 20));
UIButton imageButton = new UIButton(new LazyIcon("select"));
JPanel cc = new JPanel(new BorderLayout(LayoutConstants.HGAP_SMALL, 0));
cc.add(customParentColumnRowPane, BorderLayout.CENTER);
cc.add(imageButton, BorderLayout.EAST);
customPane.add(cc, "content");
customPane.add(new JPanel(), "none");
customPane.setPreferredSize(new Dimension(0, 0));
this.add(comboBox, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
comboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (comboBox.getSelectedIndex() == 2) {
customPane.setPreferredSize(new Dimension(100, 20));
cardLayout.show(customPane, "content");
} else {
cardLayout.show(customPane, "none");
customPane.setPreferredSize(new Dimension(0, 0));
}
// cardLayout.show(customPane, comboBox.getSelectedIndex() == 2 ? "content" : "none");
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(expandFatherName);
}
}
});
imageButton.addActionListener(imageActionListener);
comboBox.setSelectedIndex(1);
}
ItemListener comboBoxItemListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
cardPane = ReactiveCardPane.create()
.addSupplier("content", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(comboBox),
cell(cc)).getComponent())
.addSupplier("none", () -> Layouts.cell(comboBox).getComponent());
cardPane.select("none").populate();
this.add(cardPane);
comboBox.addItemListener(e -> {
if (comboBox.getSelectedIndex() == 2) {
customPane.setPreferredSize(new Dimension(100, 20));
cardLayout.show(customPane, "content");
cardPane.select("content").populate();
} else {
cardLayout.show(customPane, "none");
customPane.setPreferredSize(new Dimension(0, 0));
cardPane.select("none").populate();
}
// cardLayout.show(customPane, comboBox.getSelectedIndex() == 2 ? "content" : "none");
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(expandFatherName);
}
}
};
});
imageButton.addActionListener(imageActionListener);
comboBox.setSelectedIndex(1);
}
ActionListener imageActionListener = new ActionListener() {
@Override

28
designer-realize/src/main/java/com/fr/design/mainframe/AbstractAttrPane.java

@ -1,9 +1,9 @@
package com.fr.design.mainframe;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import javax.swing.*;
import java.awt.*;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
@ -15,15 +15,12 @@ import java.awt.event.MouseWheelListener;
* 几点子类不需要写构造函数了所有的组件都放在createContentPane()方法生成的pane里面,它不需要考虑border
*/
public abstract class AbstractAttrPane extends AbstractAttrNoScrollPane {
private static final int MAXVALUE = 100;
private static final int TITLE_HEIGHT = 50;
private static final int MOUSE_WHEEL_SPEED = 5;
private static final int CONTENTPANE_WIDTH_GAP = 4;
private static final int SCROLLBAR_WIDTH = 8;
private int maxHeight = 280;
private int beginY = 0;
private static final int MAXVALUE = FineUIScale.scale(100);
private static final int TITLE_HEIGHT = FineUIScale.scale(50);
private static final int MOUSE_WHEEL_SPEED = 5;
private int maxHeight = FineUIScale.scale(280);
private UIScrollBar scrollBar;
private final UIScrollBar scrollBar;
public AbstractAttrPane() {
this.setLayout(new BarLayout());
@ -98,21 +95,16 @@ public abstract class AbstractAttrPane extends AbstractAttrNoScrollPane {
@Override
public void layoutContainer(Container parent) {
maxHeight = getMaxHeight();
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
beginY = 0;
} else {
int beginY = 0;
if ((MAXVALUE - scrollBar.getVisibleAmount()) != 0) {
int preferredHeight = leftContentPane.getPreferredSize().height;
int value = scrollBar.getValue();
beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount());
}
int width = parent.getWidth();
int height = parent.getHeight();
if (leftContentPane.getPreferredSize().height > maxHeight) {
leftContentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - CONTENTPANE_WIDTH_GAP, height + beginY);
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height);
} else {
leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENTPANE_WIDTH_GAP, height);
}
leftContentPane.setBounds(0, -beginY, width - scrollBar.getWidth(), height + beginY);
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height);
leftContentPane.validate();
}
}

39
designer-realize/src/main/java/com/fr/design/mainframe/cell/CellElementEditPane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.cell;
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.CellAttributeProvider;
@ -12,7 +14,6 @@ import com.fr.design.mainframe.cell.settingpane.CellExpandAttrPane;
import com.fr.design.mainframe.cell.settingpane.CellOtherSetPane;
import com.fr.design.mainframe.cell.settingpane.CellPresentPane;
import com.fr.design.mainframe.cell.settingpane.CellStylePane;
import com.fr.design.mainframe.cell.settingpane.*;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
@ -23,14 +24,14 @@ import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* the new 单元格属性表 !!!:只对当前选中的设置面板进行数据的populate和update操作
*
@ -38,8 +39,8 @@ import java.util.List;
* @since 2012-5-8下午12:18:53
*/
public class CellElementEditPane extends BasicPane {
private static final int LEFT_BORDER = -5;
private static final int RIGHT_BORDER = 5;
private static final int LEFT_BORDER = 10;
private static final int RIGHT_BORDER = 10;
private List<AbstractCellAttrPane> paneList;
private TemplateCellElement cellelement;
private ElementCasePane ePane;
@ -48,14 +49,12 @@ public class CellElementEditPane extends BasicPane {
private boolean isEditing;
private CardLayout card;
private JPanel center;
private JPanel downTitle;
private TitleChangeListener titleChangeListener = null;
private CellAttributeProvider cellAttributeProvider = null;
public CellElementEditPane() {
setLayout(new BorderLayout());
initPaneList();
String[] iconArray = new String[paneList.size()];
card = new CardLayout();
@ -65,7 +64,6 @@ public class CellElementEditPane extends BasicPane {
iconArray[i] = pane.getIconPath();
center.add(pane, pane.title4PopupWindow());
}
tabsHeaderIconPane = new UIHeadGroup(iconArray) {
@Override
public void tabChanged(int index) {
@ -76,22 +74,18 @@ public class CellElementEditPane extends BasicPane {
}
}
};
downTitle = new JPanel();
downTitle.setLayout(new BorderLayout());
downTitle.add(tabsHeaderIconPane, BorderLayout.NORTH);
center.setBorder(BorderFactory.createEmptyBorder(0, LEFT_BORDER, 0, 0));
downTitle.add(center, BorderLayout.CENTER);
this.add(downTitle, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(Layouts.column(
cell(tabsHeaderIconPane),
cell(center)
).with(it -> it.setBorder(new ScaledEmptyBorder(0,LEFT_BORDER,0,RIGHT_BORDER))).getComponent());
}
public void setSelectedIndex(String... id) {
String firstid = id[0];
String firstId = id[0];
for (int i = 0; i < paneList.size(); i++) {
if (ComparatorUtils.equals(firstid, paneList.get(i).title4PopupWindow())) {
if (ComparatorUtils.equals(firstId, paneList.get(i).title4PopupWindow())) {
tabsHeaderIconPane.setSelectedIndex(i);
if (id.length == 2) {
paneList.get(i).setSelectedByIds(1, id);
@ -178,13 +172,8 @@ public class CellElementEditPane extends BasicPane {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellElement_Property_Table");
}
@Override
public Dimension getPreferredSize() {
return new Dimension(240, 340);
}
private void initPaneList() {
paneList = new ArrayList<AbstractCellAttrPane>();
paneList = new ArrayList<>();
paneList.add(new CellExpandAttrPane());
paneList.add(new CellStylePane());
paneList.add(new CellPresentPane());

78
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java

@ -1,7 +1,8 @@
package com.fr.design.mainframe.cell.settingpane;
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.expand.ExpandLeftFatherPane;
import com.fr.design.expand.ExpandUpFatherPane;
import com.fr.design.foldablepane.UIExpandablePane;
@ -9,8 +10,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.sort.cellexpand.CellExpandSortPane;
import com.fr.general.ComparatorUtils;
@ -21,18 +20,21 @@ import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Constants;
import javax.swing.Icon;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Rectangle;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.fix;
/**
* 单元格扩展属性面板是属性表面板的一个种类
*/
public class CellExpandAttrPane extends AbstractCellAttrPane {
private static final int SENIOR_HORIZONTAL_GAP = 12;
private static final int BASIC_HORIZONTAL_GAP = 20;
private UIButtonGroup<Byte> expandDirectionButton;
private ExpandLeftFatherPane leftFatherPane;
private ExpandUpFatherPane rightFatherPane;
@ -66,6 +68,13 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
return layoutPane();
}
protected void initContentPane() {
leftContentPane = createContentPane();
if (leftContentPane != null) {
this.add(leftContentPane, BorderLayout.CENTER);
}
}
private void initAllNames() {
expandDirectionButton.setGlobalName(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"));
leftFatherPane.setGlobalName(Toolkit.i18nText("Fine-Design_Report_LeftParent"));
@ -75,19 +84,19 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
}
private JPanel layoutPane() {
layoutPane = new JPanel(new BorderLayout());
basicPane = new JPanel();
seniorPane = new JPanel();
basicPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), 223, 24, basicPane());
seniorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 223, 24, seniorPane());
JPanel sortUIExpandablePane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Expend_Sort"),
223, 24, cellExpandSortPane = new CellExpandSortPane(this));
layoutPane.add(basicPane, BorderLayout.NORTH);
layoutPane.add(seniorPane, BorderLayout.CENTER);
layoutPane.add(sortUIExpandablePane, BorderLayout.SOUTH);
layoutPane = Layouts.column(
cell(basicPane),
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))),
cell(seniorPane),
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))),
cell(sortUIExpandablePane)
).getComponent();
extraPane = CellExpandExtraAttrPane.getInstance();
JPanel content = new JPanel(new BorderLayout());
content.add(layoutPane, BorderLayout.NORTH);
content.add(extraPane, BorderLayout.CENTER);
@ -95,43 +104,23 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
}
private JPanel basicPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel direction = new UILabel(Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Direction"), SwingConstants.LEFT);
JPanel directionPane = new JPanel(new BorderLayout());
directionPane.add(direction, BorderLayout.NORTH);
UILabel left = new UILabel(Toolkit.i18nText("Fine-Design_Report_LeftParent"), SwingConstants.LEFT);
JPanel leftPane = new JPanel(new BorderLayout());
leftPane.add(left, BorderLayout.NORTH);
UILabel up = new UILabel(Toolkit.i18nText("Fine-Design_Report_ExpandD_Up_Father_Cell"), SwingConstants.LEFT);
JPanel upPane = new JPanel(new BorderLayout());
upPane.add(up, BorderLayout.NORTH);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{directionPane, expandDirectionButton},
new Component[]{leftPane, leftFatherPane},
new Component[]{upPane, rightFatherPane},
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, BASIC_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE);
return Layouts.column(LayoutConstants.VERTICAL_GAP,
row(cell(direction).weight(1.2), cell(expandDirectionButton).weight(3.0)),
row(cell(left).weight(1.2), cell(leftFatherPane).weight(3.0)),
row(cell(up).weight(1.2), cell(rightFatherPane).weight(3.0))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))
).getComponent();
}
private JPanel seniorPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
horizontalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
verticalExpandableCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{horizontalExpandableCheckBox, null},
new Component[]{verticalExpandableCheckBox, null},
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, SENIOR_HORIZONTAL_GAP, LayoutConstants.VGAP_LARGE);
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(horizontalExpandableCheckBox),
cell(verticalExpandableCheckBox)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))
).getComponent();
}
@ -174,7 +163,6 @@ public class CellExpandAttrPane extends AbstractCellAttrPane {
@Override
public String getIconPath() {
// return "com/fr/design/images/expand/cellAttr.gif";
return Toolkit.i18nText("Fine-Design_Report_Expand");
}

554
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -1,14 +1,16 @@
package com.fr.design.mainframe.cell.settingpane;
import com.fine.theme.utils.FineUIScale;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Style;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -17,10 +19,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.locale.impl.DataMaskMark;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JTemplate;
@ -46,19 +44,18 @@ import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
/**
* @author zhou
* @since 2012-5-11下午5:24:31
@ -67,12 +64,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private static final int HEAD_WDITH = 290;
private static final int HEAD_HEIGTH = 24;
private static final int COMBO_WIDTH = 154;
private static final int BUTTON_GROUP_WIDTH = 140;
private static final double f = TableLayout.FILL;
private static final double p = TableLayout.PREFERRED;
// normal
private UIButtonGroup autoshrik;
private static final int DOWNLOAD_INDEX = 3;
private UICheckBox previewCellContent;
private UICheckBox printAndExportContent;
@ -81,22 +73,20 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
private UIComboBox showContent;
//内容提示
private ReactiveCardPane showContentPane;
private UIButtonGroup tooltipButtonGroup;
private CardLayout tooltipLayout;
private JPanel tooltipPane;
private ReactiveCardPane tooltipPane;
private UITextField tooltipTextField;
private UITextField fileNameTextField;
//文本超出时隐藏
private ReactiveCardPane overflowPane;
private UICheckBox textOverflowCheckBox;
private int curSelectedIndex;
private UIComboBox showPartComboBox;
private CardLayout showPartLayout;
private JPanel showPartPane;
private UISpinner showCharNums;
private UIComboBox textOverflowTypeComboBox;
private UITextField fileNameTextField;
// 分页
private UICheckBox pageBeforeRowCheckBox;
private UICheckBox pageAfterRowCheckBox;
@ -121,21 +111,22 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
// 插入行策略
private UIButtonGroup insertRowPolicyButtonGroup;
private ValueEditorPane valueEditor;
private CardLayout insertRowLayout;
private JPanel insertRowPane;
private JPanel insertRowPolicyPane;
private JPanel defaultValuePane;
private ReactiveCardPane insertRowPolicyPane;
private UILabel insertRowPolicyLabel;
// 数据脱敏
private UILabel scopeLabel;
private UIRadioButton exportButton;
private UIRadioButton previewAndExportButton;
private UIRadioButton[] desensitizationButtons;
private CellDesensitizationGroupsPane groupsPane;
private final int EXPORT_SCOPE = CellDesensitizationAttr.EXPORT_SCOPE;
private final int PREVIEW_AND_EXPORT_SCOPE = CellDesensitizationAttr.PREVIEW_AND_EXPORT_SCOPE;
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92);
private static Color TIPS_FONT_COLOR = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption");
protected void initContentPane() {
leftContentPane = createContentPane();
if (leftContentPane != null) {
this.add(leftContentPane, BorderLayout.CENTER);
}
}
/**
* 初始化
@ -143,18 +134,17 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
* @return 面板
*/
public JPanel createContentPane() {
Component[][] components = new Component[][]{
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), HEAD_WDITH, HEAD_HEIGTH, basicPane())},
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advaced"), HEAD_WDITH, HEAD_HEIGTH, seniorPane())},
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Pagination"), HEAD_WDITH, HEAD_HEIGTH, pagePane())},
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Desensitization"), HEAD_WDITH, HEAD_HEIGTH, desensitizePane())}
};
JPanel tableLayoutPane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p, p}, new double[]{f});
JPanel pane = Layouts.column(
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), HEAD_WDITH, HEAD_HEIGTH, basicPane())),
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))),
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advaced"), HEAD_WDITH, HEAD_HEIGTH, seniorPane())),
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))),
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Pagination"), HEAD_WDITH, HEAD_HEIGTH, pagePane())),
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))),
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Desensitization"), HEAD_WDITH, HEAD_HEIGTH, desensitizePane()))
).getComponent();
initAllNames();
return tableLayoutPane;
return pane;
}
private JPanel desensitizePane() {
@ -174,24 +164,22 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
);
groupsPane = new CellDesensitizationGroupsPane(this);
JPanel contentPane = FRGUIPaneFactory.createVerticalFlowLayout_F_Pane(true, VerticalFlowLayout.TOP, 0, 10, true);
contentPane.add(scopePane);
contentPane.add(hyperlink);
contentPane.add(groupsPane);
return contentPane;
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(scopePane),
cell(hyperlink),
cell(groupsPane)
).getComponent();
}
/**
* 脱敏设置应用范围panel
* @return
*/
private JPanel initScopePane() {
scopeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Scope"));
// 数据脱敏
UILabel scopeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Scope"));
exportButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Desensitization_Export"));
previewAndExportButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Desensitization_Preview_Export"));
desensitizationButtons = new UIRadioButton[]{
UIRadioButton[] desensitizationButtons = new UIRadioButton[]{
exportButton, previewAndExportButton
};
@ -199,13 +187,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
for (UIRadioButton radioButton : desensitizationButtons) {
buttonGroup.add(radioButton);
}
JPanel head = new JPanel();
head.setLayout(new BorderLayout());
head.add(scopeLabel, BorderLayout.NORTH);
head.add(exportButton, BorderLayout.CENTER);
head.add(previewAndExportButton, BorderLayout.SOUTH);
return head;
return row(
cell(scopeLabel).weight(1.2), cell(exportButton).weight(1.2), cell(previewAndExportButton).weight(1.8)
).getComponent();
}
private JPanel basicPane() {
@ -216,228 +200,211 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
adjustRadioButtons = new UIRadioButton[]{
defaultAutoRadioButton, noAutoRadioButton, autoHeightRadioButton, autoWidthRadioButton
};
// 指定分组
ButtonGroup autoBG = new ButtonGroup();
for (UIRadioButton radioButton : adjustRadioButtons) {
autoBG.add(radioButton);
}
JPanel basicPane = new JPanel() {
@Override
public Insets getInsets() {
return new Insets(LayoutConstants.VGAP_MEDIUM, 0, LayoutConstants.VGAP_MEDIUM, 0);
}
};
VerticalFlowLayout verticalFlowLayout = new VerticalFlowLayout(VerticalFlowLayout.CENTER, 0, 0);
verticalFlowLayout.setAlignLeft(true);
basicPane.setLayout(verticalFlowLayout);
basicPane.add(defaultAutoRadioButton);
basicPane.add(noAutoRadioButton);
basicPane.add(autoHeightRadioButton);
basicPane.add(autoWidthRadioButton);
return basicPane;
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(defaultAutoRadioButton),
cell(noAutoRadioButton),
cell(autoHeightRadioButton),
cell(autoWidthRadioButton)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0))
).getComponent();
}
private JPanel seniorPane() {
initInsertRowPolicyPane();
JPanel seniorPane = new JPanel(new BorderLayout());
seniorPane.add(seniorUpPane(), BorderLayout.NORTH);
seniorPane.add(insertRowPolicyPane, BorderLayout.CENTER);
insertRowPolicyPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return seniorPane;
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(seniorUpPane()),
cell(insertRowPolicyPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0))
).getComponent();
}
private void initInsertRowPolicyPane() {
// 插入行策略
insertRowPolicyButtonGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"),
insertRowPolicyButtonGroup = new UIButtonGroup(new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_COPY")});
defaultValuePane = new JPanel(new BorderLayout(4, 0));
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
defaultValuePane.add(valueEditor, BorderLayout.CENTER);
insertRowLayout = new CardLayout();
insertRowPane = new JPanel(insertRowLayout);
insertRowPane.add(new JPanel(), "none");
insertRowPane.add(defaultValuePane, "content");
insertRowPane.setPreferredSize(new Dimension(0, 0));
insertRowPolicyButtonGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height"))));
insertRowLayout.show(insertRowPane, "content");
} else {
insertRowLayout.show(insertRowPane, "none");
insertRowPane.setPreferredSize(new Dimension(0, 0));
}
}
});
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel insertRowPolicyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy", SwingConstants.LEFT));
insertRowPolicyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy", SwingConstants.LEFT));
UIComponentUtils.setLineWrap(insertRowPolicyLabel);
// 如果右侧需要很宽的空间,就用3行1列的布局
if (insertRowPolicyButtonGroup.getPreferredSize().getWidth() > BUTTON_GROUP_WIDTH) {
double[] rowSize = {p, p, p};
double[] columnSize = {f};
Component[][] components = new Component[][]{
new Component[]{insertRowPolicyLabel},
new Component[]{insertRowPolicyButtonGroup},
new Component[]{insertRowPane},
};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
} else {
double[] rowSize = {p, p};
double[] columnSize = {f, BUTTON_GROUP_WIDTH};
Component[][] components = new Component[][]{
new Component[]{insertRowPolicyLabel, insertRowPolicyButtonGroup},
new Component[]{null, insertRowPane},
};
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
}
insertRowPolicyPane = ReactiveCardPane.create()
.addSupplier("empty", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(insertRowPolicyLabel).weight(1.2),
cell(insertRowPolicyButtonGroup).weight(3)
)
).getComponent())
.addSupplier("default", () -> Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(insertRowPolicyLabel).weight(1.2),
cell(insertRowPolicyButtonGroup).weight(3)
),
row(
flex(1.2),
cell(valueEditor).weight(3)
)
).getComponent()
);
insertRowPolicyPane.select("empty").populate();
insertRowPolicyButtonGroup.addChangeListener(e -> {
String key = insertRowPolicyButtonGroup.getSelectedIndex() == 1 ? "default" : "empty";
insertRowPolicyPane.select(key).populate();
});
}
private JPanel seniorUpPane() {
JPanel pane = new JPanel(new BorderLayout());
// TODO: 方法之间的耦合还比较严重。现在必须先执行 createShowContentPane,再执行 createSeniorCheckPane。否则出现 npe。
pane.add(createTextOverflowPane(), BorderLayout.SOUTH);
pane.add(createShowContentPane(), BorderLayout.CENTER);
pane.add(createSeniorCheckPane(), BorderLayout.NORTH);
return pane;
initTextOverflowPane();
initShowContentPane();
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(createSeniorCheckPane()),
cell(showContentPane),
cell(overflowPane)
).getComponent();
}
private JPanel createShowContentPane() {
double[] rowSize = {p, p, p, p};
double[] colSize = {f, COMBO_WIDTH};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel fileNamePane = createNormal();
fileNamePane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
private void initShowContentPane() {
showContent = new UIComboBox(new String[]{
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_Image"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_HTML"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_As_Download")});
UILabel downloadLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_File_Name_For_Download"));
fileNameTextField = new UITextField();
UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT);
UIComponentUtils.setLineWrap(showContentLabel);
UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"));
tooltipLayout = new CardLayout();
tooltipPane = new JPanel(tooltipLayout);
tooltipPane.add(new JPanel(), "none");
tooltipPane.add(tooltipTextField, "content");
tooltipPane.setPreferredSize(new Dimension(0, 0));
tooltipButtonGroup = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Custom"), Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_CellValue")});
tooltipButtonGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (tooltipButtonGroup.getSelectedIndex() == 0) {
tooltipPane.setPreferredSize(new Dimension(154, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height"))));
tooltipLayout.show(tooltipPane, "content");
initTooltipPane();
showContentPane = ReactiveCardPane.create()
.addSupplier("default", () -> column(LayoutConstants.VERTICAL_GAP,
row(
cell(showContentLabel).weight(1.2), cell(showContent).weight(3.0)
),
cell(tooltipPane)
).getComponent())
.addSupplier("download", () -> column(LayoutConstants.VERTICAL_GAP,
row(
cell(showContentLabel).weight(1.2), cell(showContent).weight(3.0)
),
row(
cell(downloadLabel).weight(1.2), cell(fileNameTextField).weight(3.0)
),
cell(tooltipPane)
).getComponent());
showContentPane.select("default").populate();
showContent.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
if (showContent.getSelectedIndex() == DOWNLOAD_INDEX) {
showContentPane.select("download").populate();
} else {
tooltipLayout.show(tooltipPane, "none");
tooltipPane.setPreferredSize(new Dimension(0, 0));
showContentPane.select("default").populate();
}
handleCellShowStyleChange(e);
}
});
}
Component[][] components = new Component[][]{
new Component[]{showContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(showContent)},
new Component[]{fileNamePane, null}, // 选择"用下载连接显示二进制内容"时,会显示这一行的面板
new Component[]{toolTipLabel, tooltipButtonGroup}, // “自定义”or"单元格值"
new Component[]{null, tooltipPane} // 选择“自定义”时显示这一行
};
JPanel showContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
showContentPane.setBorder(BorderFactory.createEmptyBorder(6, 0, 6, 0));
return showContentPane;
private void initTooltipPane() {
UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"));
tooltipButtonGroup = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Custom"),
Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_CellValue")});
tooltipTextField = new UITextField();
tooltipPane = ReactiveCardPane.create()
.addSupplier("define", () -> column(LayoutConstants.VERTICAL_GAP,
row(
cell(toolTipLabel).weight(1.2), cell(tooltipButtonGroup).weight(3.0)
),
row(
flex(1.2), cell(tooltipTextField).weight(3.0)
)
).getComponent())
.addSupplier("cellValue", () -> column(LayoutConstants.VERTICAL_GAP,
row(
cell(toolTipLabel).weight(1.2), cell(tooltipButtonGroup).weight(3.0)
)
).getComponent());
tooltipPane.select("define").populate();
tooltipButtonGroup.addChangeListener(e -> {
if (tooltipButtonGroup.getSelectedIndex() == 0) {
tooltipPane.select("define").populate();
} else {
tooltipPane.select("cellValue").populate();
}
});
}
private JPanel createTextOverflowPane() {
showPartLayout = new CardLayout();
showPartPane = new JPanel(showPartLayout);
private void initTextOverflowPane() {
showCharNums = new UISpinner(0, Integer.MAX_VALUE, 1, 10);
JPanel showPartNumPane = new JPanel(new BorderLayout(4, 0));
showPartNumPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Nums")), BorderLayout.WEST);
showPartNumPane.add(showCharNums, BorderLayout.CENTER);
showPartPane.add(new JPanel(), "none");
showPartPane.add(showPartNumPane, "content");
UILabel numberLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Nums"));
showPartComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_CharNum"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_CellWidth")});
showPartComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
textOverflowTypeComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol")});
UILabel showPartLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_ShowPart"));
UILabel hideTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType"));
textOverflowCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow"));
overflowPane = ReactiveCardPane.create()
.addSupplier("empty", () -> column(LayoutConstants.VERTICAL_GAP,
cell(textOverflowCheckBox)
).getComponent())
.addSupplier("showChar", () -> column(LayoutConstants.VERTICAL_GAP,
cell(textOverflowCheckBox),
row(cell(showPartLabel).weight(1.2), cell(showPartComboBox).weight(1.6), flex(0.1), cell(numberLabel).weight(0.5), cell(showCharNums).weight(0.8)),
row(cell(hideTypeLabel).weight(1.2), cell(textOverflowTypeComboBox).weight(3.0))
).getComponent())
.addSupplier("showCell", () -> column(LayoutConstants.VERTICAL_GAP,
cell(textOverflowCheckBox),
row(cell(showPartLabel).weight(1.2), cell(showPartComboBox).weight(3.0)),
row(cell(hideTypeLabel).weight(1.2), cell(textOverflowTypeComboBox).weight(3.0))
).getComponent());
overflowPane.select("empty").populate();
showPartComboBox.addItemListener(e -> {
if (showPartComboBox.getSelectedIndex() == 0) {
overflowPane.select("showChar").populate();
} else {
overflowPane.select("showCell").populate();
}
});
textOverflowCheckBox.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
if (showPartComboBox.getSelectedIndex() == 0) {
showPartPane.setPreferredSize(new Dimension(70, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height"))));
showPartLayout.show(showPartPane, "content");
overflowPane.select("showChar").populate();
} else {
showPartLayout.show(showPartPane, "none");
showPartPane.setPreferredSize(new Dimension(0, 0));
overflowPane.select("showCell").populate();
}
}
});
textOverflowTypeComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol")});
UILabel showPartLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_ShowPart") + ":");
UILabel hideTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType") + ":");
Component[][] textOverflowComponents = new Component[][]{
new Component[]{showPartLabel, showPartComboBox, showPartPane},
new Component[]{hideTypeLabel, textOverflowTypeComboBox, null}
};
JPanel textOverflowComPane = TableLayoutHelper.createTableLayoutPane(textOverflowComponents, new double[]{p, p}, new double[]{p, f, p});
textOverflowComPane.setVisible(false);
textOverflowCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow"));
textOverflowCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
textOverflowComPane.setVisible(e.getStateChange() == ItemEvent.SELECTED);
if (e.getStateChange() == ItemEvent.SELECTED) {
if (showPartComboBox.getSelectedIndex() == 0) {
showPartPane.setPreferredSize(new Dimension(70, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height"))));
showPartLayout.show(showPartPane, "content");
} else {
showPartLayout.show(showPartPane, "none");
showPartPane.setPreferredSize(new Dimension(0, 0));
}
// 记录目前自动调整哪个被选中
for (int i = 0; i < adjustRadioButtons.length; i++) {
if (adjustRadioButtons[i].isSelected()) {
curSelectedIndex = i;
break;
}
// 记录目前自动调整哪个被选中
for (int i = 0; i < adjustRadioButtons.length; i++) {
if (adjustRadioButtons[i].isSelected()) {
curSelectedIndex = i;
break;
}
noAutoRadioButton.setSelected(true);
} else {
adjustRadioButtons[curSelectedIndex].setSelected(true);
}
noAutoRadioButton.setSelected(true);
} else {
overflowPane.select("empty").populate();
adjustRadioButtons[curSelectedIndex].setSelected(true);
}
});
JPanel dynamicPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
dynamicPaneWrapper.add(textOverflowComPane);
JPanel textOverflowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
textOverflowPane.add(textOverflowCheckBox, BorderLayout.NORTH);
textOverflowPane.add(dynamicPaneWrapper, BorderLayout.CENTER);
textOverflowPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return textOverflowPane;
}
private JPanel createSeniorCheckPane() {
previewCellContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
printAndExportContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
printAndExportBackground.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{previewCellContent, null},
new Component[]{printAndExportContent, null},
new Component[]{printAndExportBackground, null},
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE);
previewCellContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Preview_Cell_Content"));
printAndExportContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Content"));
printAndExportBackground = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Background"));
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(previewCellContent),
cell(printAndExportContent),
cell(printAndExportBackground)
).getComponent();
}
private JPanel pagePane() {
@ -451,73 +418,31 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
canBreakOnPaginateCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellPage_Can_Break_On_Paginate"));
repeatCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellPage_Repeat_Content_When_Paging"));
pageFixedRowDataCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_Page_Fixed_Row_Cell"));
currentPageFixedRowDataTipLabel = new UILabel(" (" + Toolkit.i18nText("Fine-Design_Report_CellWrite_No_Page_Fixed_Row_Cell") +")");
pageBeforeRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
pageAfterRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
pageBeforeColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
pageAfterColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
canBreakOnPaginateCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
repeatCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
pageFixedRowDataCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
currentPageFixedRowDataTipLabel.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
currentPageFixedRowDataTipLabel.setForeground(TIPS_FONT_COLOR);
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p, p};
double[] columnSize = {p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{null},
new Component[]{pageBeforeRowCheckBox},
new Component[]{pageAfterRowCheckBox},
new Component[]{null},
new Component[]{pageBeforeColumnCheckBox},
new Component[]{pageAfterColumnCheckBox},
new Component[]{null},
new Component[]{canBreakOnPaginateCheckBox},
new Component[]{repeatCheckBox},
new Component[]{null},
new Component[]{pageFixedRowDataCheckBox},
new Component[]{currentPageFixedRowDataTipLabel}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE);
currentPageFixedRowDataTipLabel = new UILabel(" (" + Toolkit.i18nText("Fine-Design_Report_CellWrite_No_Page_Fixed_Row_Cell") +")", SwingConstants.LEFT);
}
currentPageFixedRowDataTipLabel.setForeground(TIPS_FONT_COLOR);
return Layouts.column(
cell(pageBeforeRowCheckBox),
fix(LayoutConstants.VERTICAL_GAP),
cell(pageAfterRowCheckBox),
fix(LayoutConstants.VGAP_SMALL + LayoutConstants.VERTICAL_GAP),
cell(pageBeforeColumnCheckBox),
fix(LayoutConstants.VERTICAL_GAP),
cell(pageAfterColumnCheckBox),
fix(LayoutConstants.VGAP_SMALL + LayoutConstants.VERTICAL_GAP),
cell(canBreakOnPaginateCheckBox),
fix(LayoutConstants.VERTICAL_GAP),
cell(repeatCheckBox),
fix(LayoutConstants.VGAP_SMALL + LayoutConstants.VERTICAL_GAP),
cell(pageFixedRowDataCheckBox),
fix(LayoutConstants.VERTICAL_GAP),
cell(currentPageFixedRowDataTipLabel)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0))
).getComponent();
private JPanel createNormal() {
previewCellContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Preview_Cell_Content"));
printAndExportContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Content"));
printAndExportBackground = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Background"));
showContent = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_Image"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_HTML"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_As_Download")});
final CardLayout fileNameLayout = new CardLayout();
final JPanel fileNamePane = new JPanel(fileNameLayout);
JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0));
fileNameCCPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_File_Name_For_Download")), BorderLayout.WEST);
fileNameTextField = new UITextField();
tooltipTextField = new UITextField();
tooltipTextField.getUI();
fileNamePane.add(new JPanel(), "none");
fileNamePane.add(fileNameCCPane, "content");
fileNamePane.setPreferredSize(new Dimension(0, 0));
fileNameCCPane.add(fileNameTextField, BorderLayout.CENTER);
showContent.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
if (showContent.getSelectedIndex() == 3) {
fileNamePane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height"))));
fileNameLayout.show(fileNamePane, "content");
} else {
fileNameLayout.show(fileNamePane, "none");
fileNamePane.setPreferredSize(new Dimension(0, 0));
}
handleCellShowStyleChange(e);
}
}
});
return fileNamePane;
}
private void handleCellShowStyleChange(ItemEvent itemEvent) {
@ -567,7 +492,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
@Override
public String getIconPath() {
// return "com/fr/design/images/m_format/cellstyle/otherset.png";
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other");
}
@ -632,11 +556,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
tooltipButtonGroup.setSelectedIndex(1);
}
if (tooltipButtonGroup.getSelectedIndex() == 0) {
tooltipPane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height"))));
tooltipLayout.show(tooltipPane, "content");
tooltipPane.select("define").populate();
} else {
tooltipLayout.show(tooltipPane, "none");
tooltipPane.setPreferredSize(new Dimension(0, 0));
tooltipPane.select("cellValue").populate();
}
tooltipPane.setVisible(true);
if (cellGUIAttr.isHideTextWhenOverflow()) {
@ -647,7 +569,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
} else {
showPartComboBox.setSelectedIndex(1);
}
showPartPane.setVisible(true);
if (cellGUIAttr.isTextOverflowEllipsis()) {
textOverflowTypeComboBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis"));
} else {
@ -684,19 +605,13 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
insertRowPolicyButtonGroup.setSelectedIndex(0);
this.valueEditor.populate(StringUtils.EMPTY);
}
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) {
insertRowPane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height"))));
insertRowLayout.show(insertRowPane, "content");
} else {
insertRowLayout.show(insertRowPane, "none");
insertRowPane.setPreferredSize(new Dimension(0, 0));
}
String key = insertRowPolicyButtonGroup.getSelectedIndex() == 1 ? "default" : "empty";
insertRowPolicyPane.select(key).populate();
insertRowPolicyPane.setVisible(true);
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (!jTemplate.isJWorkBook()) { //表单中报表块编辑屏蔽掉 插入行策略
insertRowPolicyPane.setVisible(false);
insertRowPolicyPane.select("empty").populate();
}
populateDesensitizationBean(cellElement);
}
@ -816,7 +731,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
if (cellDesensitizationAttr == null) {
cellDesensitizationAttr = new CellDesensitizationAttr();
}
cellDesensitizationAttr.setScope(exportButton.isSelected() ? EXPORT_SCOPE : PREVIEW_AND_EXPORT_SCOPE);
int previewAndExportScope = CellDesensitizationAttr.PREVIEW_AND_EXPORT_SCOPE;
cellDesensitizationAttr.setScope(exportButton.isSelected() ? EXPORT_SCOPE : previewAndExportScope);
cellDesensitizationAttr.setDesensitizationBeans(new ArrayList<>(groupsPane.update()));
cellElement.addCellAttr(cellDesensitizationAttr);
}

43
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java

@ -1,15 +1,14 @@
package com.fr.design.mainframe.cell.settingpane.desensitization;
import com.fr.design.constants.UIConstants;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.cell.settingpane.AbstractCellAttrPane;
import com.fr.design.mainframe.cell.settingpane.desensitization.model.CellDesensitizationTableModel;
import com.fr.report.cell.desensitization.CellDesensitizationBean;
@ -17,11 +16,11 @@ import com.fr.report.cell.desensitization.CellDesensitizationBean;
import javax.swing.JPanel;
import javax.swing.JTable;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.util.List;
import java.util.Objects;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* 数据脱敏规则设置面板
*
@ -40,18 +39,17 @@ public class CellDesensitizationGroupsPane extends JPanel {
public CellDesensitizationGroupsPane(AbstractCellAttrPane pane) {
model = new CellDesensitizationTableModel(pane, this);
initComponent();
}
private void initComponent() {
this.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 10, true));
this.setLayout(new BorderLayout());
addRulePane = initAddPane(model);
editorPane = initEditorPane(model);
this.add(addRulePane);
this.add(editorPane);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(addRulePane),
cell(editorPane)
).weight(1.0).getComponent());
}
/**
@ -63,17 +61,10 @@ public class CellDesensitizationGroupsPane extends JPanel {
private JPanel initAddPane(CellDesensitizationTableModel model) {
UIButton addButton = new UIButton(model.getAction());
UILabel addLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Setting"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{addLabel, addButton}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 20, 0);
return Layouts.row(
cell(addLabel).weight(1.2),
cell(addButton).weight(3.0)
).getComponent();
}
/**
@ -89,14 +80,9 @@ public class CellDesensitizationGroupsPane extends JPanel {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JTable editTable = getTableModel().createTable();
editTable.getTableHeader().setBackground(UIConstants.DEFAULT_BG_RULER);
setEditTable(editTable);
initbuttonPane(action);
getbuttonPane().setBackground(UIConstants.DEFAULT_BG_RULER);
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
controlPane.setBackground(Color.WHITE);
controlPane.add(getbuttonPane(), BorderLayout.WEST);
JPanel pane = new JPanel(new BorderLayout(4, 4));
@ -106,6 +92,7 @@ public class CellDesensitizationGroupsPane extends JPanel {
this.add(pane, BorderLayout.CENTER);
}
};
tableEditorPane.setBorder(new FineRoundBorder());
return tableEditorPane;
}

115
designer-realize/src/main/java/com/fr/design/present/BarCodePane.java

@ -1,10 +1,12 @@
package com.fr.design.present;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fr.code.bar.core.BarcodeAttr;
import com.fr.code.BarcodeImpl;
import com.fr.code.bar.core.BarCodeUtils;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -14,8 +16,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.cellattr.BarcodePresent;
@ -38,6 +38,12 @@ import java.text.AttributedString;
import java.util.HashMap;
import java.util.Map;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.fix;
/**
* @author zhou
* @since 2012-6-4下午6:49:59
@ -65,10 +71,8 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
barCodePreviewPane = new BarCodePreviewPane();
this.barWidthSpinner = new UISpinner(1,100.0,1.0,10.0);
this.barHeightSpinner = new UISpinner(1,100.0,1.0,30);
this.barWidthSpinner.setPreferredSize(new Dimension(60, 20));
this.barHeightSpinner.setPreferredSize(new Dimension(60, 20));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR);
TitledBorder titledBorder = new TitledBorder(new FineRoundBorder(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR);
borderPane.setBorder(titledBorder);
borderPane.add(barCodePreviewPane, BorderLayout.CENTER);
setTypeComboBox();
@ -82,21 +86,9 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
drawingTextCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bar_CodeD_Drawing_Text"));
drawingTextCheckBox.setSelected(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p, p, p, p, p, p};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
barCodePreviewPane.setPreferredSize(new Dimension(0, 125));
typeComboBox.setPreferredSize(new Dimension(155,20));
drawingTextCheckBox.setBorder(null);
barCodePreviewPane.setPreferredSize(new Dimension(0, FineUIScale.scale(110)));
final JPanel centerPane = new JPanel(new CardLayout());
Component[][] components = new Component[][]{
new Component[]{typeSetLabel, typeComboBox},
new Component[]{borderPane, null},
new Component[]{centerPane, null}
};
JPanel barCode = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_LARGE);
centerPane.add(getNormalPane(), "normal");
centerPane.add(getSpecialPane(), "special");
typeComboBox.addItemListener(new ItemListener() {
@ -107,8 +99,15 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
repaintPreviewBarCode();
}
});
this.setLayout(new BorderLayout());
this.add(barCode, BorderLayout.CENTER);
this.add(column(LayoutConstants.VERTICAL_GAP,
row(
cell(typeSetLabel).weight(1.2), cell(typeComboBox).weight(2.8)
),
cell(borderPane),
cell(centerPane)
).getComponent(), BorderLayout.CENTER);
}
private void setTypeComboBox() {
@ -135,51 +134,43 @@ public class BarCodePane extends FurtherBasicBeanPane<BarcodePresent> {
}
private JPanel getNormalPane() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f, f};
int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
JPanel barWidthContainer = new JPanel(new BorderLayout());
barWidthContainer.add(barWidthSpinner);
JPanel barHeightContainer = new JPanel(new BorderLayout());
barHeightContainer.add(barHeightSpinner);
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_Width"), UILabel.RIGHT);
uiLabel.setPreferredSize(typeSetLabel.getPreferredSize());
JPanel drawingTextCheckBoxPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
drawingTextCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER);
drawingTextCheckBoxPane.add(drawingTextCheckBox);
Component[][] components_normal = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Barcode_Size"), UILabel.LEFT), barWidthContainer, barHeightContainer},
new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_Width"), UILabel.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_Height"), UILabel.CENTER)},
new Component[]{drawingTextCheckBoxPane, null, null}
};
JPanel normalPane = TableLayoutHelper.createGapTableLayoutPane(components_normal, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE);
return normalPane;
return Layouts.column(
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Barcode_Size"), UILabel.LEFT)).weight(1.2),
cell(barWidthSpinner).weight(1.4),
fix(4),
cell(barHeightSpinner).weight(1.4)
),
fix(1),
row(
flex(1.2),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_Width"), UILabel.CENTER)).weight(1.4),
fix(4),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_Height"), UILabel.CENTER)).weight(1.4)
),
fix(10),
row(
cell(drawingTextCheckBox)
)
).getComponent();
}
private JPanel getSpecialPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Version"), UILabel.LEFT);
uiLabel.setPreferredSize(typeSetLabel.getPreferredSize());
versionComboBox.setPreferredSize(new Dimension(155,20));
errorCorrectComboBox.setPreferredSize(new Dimension(155,20));
sizeSpinner.setPreferredSize(new Dimension(155,20));
Component[][] components_special = new Component[][]{
new Component[]{uiLabel, versionComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Error_Correct"), UILabel.LEFT), errorCorrectComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCodeDrawPix"), UILabel.LEFT), sizeSpinner}
};
JPanel specialPane = TableLayoutHelper.createGapTableLayoutPane(components_special, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_LARGE);
return specialPane;
return Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Version"), UILabel.LEFT)).weight(1.2),
cell(versionComboBox).weight(2.8)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Error_Correct"), UILabel.LEFT)).weight(1.2),
cell(errorCorrectComboBox).weight(2.8)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCodeDrawPix"), UILabel.LEFT)).weight(1.2),
cell(sizeSpinner).weight(2.8)
)
).getComponent();
}
private void addListener() {

80
designer-realize/src/main/java/com/fr/design/present/CurrencyLinePane.java

@ -1,16 +1,16 @@
package com.fr.design.present;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fr.code.bar.BarcodeException;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.cellattr.CurrencyLineAttr;
@ -25,27 +25,25 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author zhou
* @since 2012-6-4下午7:34:52
*/
public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent> {
private static final int VS_NUM = 4;
private static final int VG_NUM = 6;
private static final Dimension NORMAL_DIMENSION = new Dimension(155, 20);
private UISpinner intPartSpinner;
private UISpinner deciPartSpinner;
private UITextField textField;
private CurrencyLinePreviewPane CurrencyLinePreviewPane;
private int intPart = 9;
private int deciPart = 3;
private CurrencyLinePreviewPane currencyLinePreviewPane;
private static final int POSITION = 8;
ChangeListener listener2 = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
CurrencyLinePreviewPane.setObject(textField.getText(), update());
currencyLinePreviewPane.setObject(textField.getText(), update());
}
};
@ -53,17 +51,17 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
DocumentListener listener = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
CurrencyLinePreviewPane.setObject(textField.getText(), update());
currencyLinePreviewPane.setObject(textField.getText(), update());
}
@Override
public void removeUpdate(DocumentEvent e) {
CurrencyLinePreviewPane.setObject(textField.getText(), update());
currencyLinePreviewPane.setObject(textField.getText(), update());
}
@Override
public void changedUpdate(DocumentEvent e) {
CurrencyLinePreviewPane.setObject(textField.getText(), update());
currencyLinePreviewPane.setObject(textField.getText(), update());
}
};
@ -74,43 +72,36 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
protected void initComponents() {
// 整数位选择
intPartSpinner = new UISpinner(1, 20, 1, 9);
intPartSpinner.setPreferredSize(NORMAL_DIMENSION);
// 小数位选择
deciPartSpinner = new UISpinner(1, 10, 1, 2);
deciPartSpinner.setPreferredSize(NORMAL_DIMENSION);
// 预览区域
textField = new UITextField(10);
CurrencyLinePreviewPane = new CurrencyLinePreviewPane();
CurrencyLinePreviewPane.setPreferredSize(new Dimension(0, 145));
currencyLinePreviewPane = new CurrencyLinePreviewPane();
currencyLinePreviewPane.setPreferredSize(new Dimension(0, FineUIScale.scale(145)));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR);
TitledBorder titledBorder = new TitledBorder(new FineRoundBorder(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR);
borderPane.setBorder(titledBorder);
borderPane.add(CurrencyLinePreviewPane, BorderLayout.CENTER);
borderPane.add(currencyLinePreviewPane, BorderLayout.CENTER);
textField.requestFocus();
double vs = VS_NUM;
double vg = VG_NUM;
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p, p};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Data"), UILabel.LEFT), textField},
new Component[]{borderPane, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_IntPart"), UILabel.LEFT), groupPane(intPartSpinner)},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Deci_Part"), UILabel.LEFT), groupPane(deciPartSpinner)}
};
JPanel linePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_LARGE);
this.setLayout(new BorderLayout());
this.add(linePane, BorderLayout.CENTER);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Data"), UILabel.LEFT)).weight(1.2),
cell(textField).weight(3)
),
cell(borderPane),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_IntPart"), UILabel.LEFT)).weight(1.2),
cell(intPartSpinner).weight(3)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Deci_Part"), UILabel.LEFT)).weight(1.2),
cell(deciPartSpinner).weight(3)
)
).getComponent(), BorderLayout.CENTER);
textField.getDocument().addDocumentListener(listener);
intPartSpinner.addChangeListener(listener2);
@ -141,14 +132,12 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
*
*/
public void setintPart(int intpart) {
this.intPart = intpart;
}
/**
*
*/
public void setdeciPart(int decipart) {
this.deciPart = decipart;
}
private class CurrencyLinePreviewPane extends JPanel {
@ -156,7 +145,6 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
CurrencyLineAttr currencyLineAttr;
public CurrencyLinePreviewPane() {
// setBackground(Color.WHITE);
}
public void setObject(String text, CurrencyLineAttr currencyLineAttr) {
@ -185,14 +173,6 @@ public class CurrencyLinePane extends FurtherBasicBeanPane<CurrencyLinePresent>
}
protected static JPanel groupPane(JComponent comp) {
JPanel jp = new JPanel();
jp.setBorder(null);
jp.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
jp.add(comp);
return jp;
}
@Override
/**
* 是否为该类型

6
designer-realize/src/main/java/com/fr/design/sort/celldscolumn/CellDSColumnSortItemPane.java

@ -2,7 +2,6 @@ package com.fr.design.sort.celldscolumn;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.sort.common.AbstractSortItemPane;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.report.core.sort.sortexpression.SortExpression;
import javax.swing.*;
@ -18,10 +17,9 @@ public class CellDSColumnSortItemPane extends AbstractSortItemPane {
}
@Override
public void initMainSortAreaPane(JPanel sortAreaPane) {
public Component getSortAreaComponent(JPanel sortAreaPane) {
sortAreaUiComboBox = new UIComboBox(new String[0]);
sortAreaUiComboBox.setPreferredSize(new Dimension(sortItemPaneRightWidth, AbstractSortPane.PANE_COMPONENT_HEIGHT));
sortAreaPane.add(sortAreaUiComboBox);
return sortAreaUiComboBox;
}
public void populateBean(SortExpression sortExpression) {

8
designer-realize/src/main/java/com/fr/design/sort/cellexpand/CellExpandSortItemPane.java

@ -1,12 +1,12 @@
package com.fr.design.sort.cellexpand;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.design.sort.common.SortColumnRowPane;
import com.fr.design.sort.common.AbstractSortItemPane;
import com.fr.report.core.sort.sortexpression.SortExpression;
import com.fr.stable.ColumnRow;
import javax.swing.*;
import java.awt.Component;
public class CellExpandSortItemPane extends AbstractSortItemPane {
SortColumnRowPane columnRowPane;
@ -16,9 +16,9 @@ public class CellExpandSortItemPane extends AbstractSortItemPane {
}
@Override
public void initMainSortAreaPane(JPanel sortAreaPane) {
columnRowPane = new SortColumnRowPane(sortItemPaneRightWidth + 4, AbstractSortPane.PANE_COMPONENT_HEIGHT);
sortAreaPane.add(columnRowPane);
public Component getSortAreaComponent(JPanel sortAreaPane) {
columnRowPane = new SortColumnRowPane();
return columnRowPane;
}
public void populateBean(SortExpression sortExpression) {

29
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortGroupPane.java

@ -1,6 +1,7 @@
package com.fr.design.sort.common;
import com.fr.base.svg.IconUtils;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.event.ComponentChangeListener;
import com.fr.design.event.ComponentChangeObserver;
import com.fr.design.gui.ibutton.UIButton;
@ -15,6 +16,8 @@ import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
public abstract class AbstractSortGroupPane extends JPanel implements ComponentChangeObserver {
@ -34,7 +37,6 @@ public abstract class AbstractSortGroupPane extends JPanel implements ComponentC
public AbstractSortGroupPane(int sortGroupPaneWidth, int sortGroupPaneRightWidth) {
this.sortGroupPaneRightWidth = sortGroupPaneRightWidth;
this.sortGroupPaneWidth = sortGroupPaneWidth;
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
initComponents();
}
@ -42,8 +44,11 @@ public abstract class AbstractSortGroupPane extends JPanel implements ComponentC
addSortItemBar = new AddSortItemBar(this);
sortItemListPane = new JPanel();
sortItemListPane.setLayout(new BoxLayout(sortItemListPane, BoxLayout.Y_AXIS));
this.add(sortItemListPane);
this.add(addSortItemBar);
this.setLayout(new BorderLayout());
this.add(Layouts.column(
cell(sortItemListPane),
cell(addSortItemBar)
).getComponent(), BorderLayout.CENTER);
}
public void populateBean(List<SortExpression> sortExpressions, String selfSortArea) {
@ -51,8 +56,8 @@ public abstract class AbstractSortGroupPane extends JPanel implements ComponentC
this.selfSortArea = selfSortArea;
this.sortExpressions = sortExpressions;
this.sortUIExpandablePanes = new ArrayList<>();
for (int i = 0; i < sortExpressions.size(); i++) {
addSortItem(sortExpressions.get(i));
for (SortExpression sortExpression : sortExpressions) {
addSortItem(sortExpression);
}
refresh();
}
@ -153,19 +158,13 @@ public abstract class AbstractSortGroupPane extends JPanel implements ComponentC
AddSortItemBar(AbstractSortGroupPane sortGroupPane) {
init();
this.sortGroupPane = sortGroupPane;
this.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
}
void init() {
uiButton = new UIButton(Toolkit.i18nText("Fine-Design_Sort_Add_Second_Sort"),
IconUtils.readIcon("/com/fr/design/images/sort/add.png"));
uiButton.setPreferredSize(new Dimension(sortGroupPaneWidth - 4, AbstractSortPane.PANE_COMPONENT_HEIGHT));
uiButton = new UIButton(Toolkit.i18nText("Fine-Design_Sort_Add_Second_Sort"),new LazyIcon("add"));
this.setLayout(new BorderLayout());
this.add(uiButton);
uiButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
sortGroupPane.addSortItem(null);
}
});
uiButton.addActionListener(e -> sortGroupPane.addSortItem(null));
}
}
}

99
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortItemPane.java

@ -1,5 +1,9 @@
package com.fr.design.sort.common;
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -14,11 +18,12 @@ import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.cell;
public abstract class AbstractSortItemPane extends JPanel {
protected int sortItemPaneWidth;
protected int sortItemPaneRightWidth;
@ -29,13 +34,40 @@ public abstract class AbstractSortItemPane extends JPanel {
UIComboBox sortBasisUiComboBox;
JPanel sortAreaPane;
JPanel sortRulePane;
SortExpressionPane formulaExpressionPane;
SortExpressionPane customExpressionPane;
ReactiveCardPane cardPane;
public AbstractSortItemPane(int sortItemPaneWidth, int sortItemPaneRightWidth) {
this.sortItemPaneWidth = sortItemPaneWidth;
this.sortItemPaneRightWidth = sortItemPaneRightWidth;
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
registerSortExpressionPanes();
initComponents();
initLayouts();
}
private void initLayouts() {
cardPane = ReactiveCardPane.create()
.addSupplier("cell", () -> column(LayoutConstants.VERTICAL_GAP,
cell(sortAreaPane),
cell(sortBasisPanel),
cell(sortRulePane)
).getComponent())
.addSupplier("formula", () -> column(LayoutConstants.VERTICAL_GAP,
cell(sortBasisPanel),
cell(formulaExpressionPane),
cell(sortRulePane)
).getComponent())
.addSupplier("custom", () -> column(LayoutConstants.VERTICAL_GAP,
cell(sortAreaPane),
cell(sortBasisPanel),
cell(currentSortExpressionPane),
cell(sortRulePane)
).getComponent());
cardPane.select("cell").populate();
cardPane.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, LayoutConstants.VERTICAL_GAP, 0));
this.setLayout(new BorderLayout());
this.add(cardPane, BorderLayout.CENTER);
}
private void initComponents() {
@ -46,54 +78,43 @@ public abstract class AbstractSortItemPane extends JPanel {
private void registerSortExpressionPanes() {
sortExpressionPanes.add(new CellSortExpressionPane(sortItemPaneRightWidth));
sortExpressionPanes.add(new FormulaSortExpressionPane(sortItemPaneRightWidth));
sortExpressionPanes.add(new CustomSequenceSortExpressionPane(sortItemPaneWidth, sortItemPaneRightWidth));
sortExpressionPanes.add(formulaExpressionPane = new FormulaSortExpressionPane(sortItemPaneRightWidth));
sortExpressionPanes.add(customExpressionPane = new CustomSequenceSortExpressionPane(sortItemPaneWidth, sortItemPaneRightWidth));
}
void initSortAreaPane() {
sortAreaPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP));
sortAreaPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Area"), SwingConstants.LEFT));
sortAreaPane.add(AbstractSortPane.createIntervalUILabel());
initMainSortAreaPane(sortAreaPane);
this.add(sortAreaPane);
sortAreaPane = new JPanel(new BorderLayout());
Component component = getSortAreaComponent(sortAreaPane);
sortAreaPane.add(Layouts.row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Area"), SwingConstants.LEFT)).weight(1.2),
cell(component).weight(3)
).getComponent());
}
public abstract void initMainSortAreaPane(JPanel sortAreaPane);
public abstract Component getSortAreaComponent(JPanel sortAreaPane);
void initSortRulePane() {
sortRulePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP));
sortRuleUiComboBox = new UIComboBox(new String[]{SortRule.ASC.getDescription(),
SortRule.DES.getDescription(), SortRule.NO_SORT.getDescription()});
sortRuleUiComboBox.setPreferredSize(new Dimension(sortItemPaneRightWidth, AbstractSortPane.PANE_COMPONENT_HEIGHT));
sortRulePane.add(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Rule"), SwingConstants.LEFT));
sortRulePane.add(AbstractSortPane.createIntervalUILabel());
sortRulePane.add(sortRuleUiComboBox);
this.add(sortRulePane);
sortRulePane = Layouts.row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Rule"), SwingConstants.LEFT)).weight(1.2),
cell(sortRuleUiComboBox).weight(3)
).getComponent();
}
void initSortBasisPanel() {
sortBasisPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, AbstractSortPane.PANE_COMPONENT_V_GAP));
sortBasisUiComboBox = new UIComboBox(getSortNames());
sortBasisUiComboBox.setPreferredSize(new Dimension(sortItemPaneRightWidth, AbstractSortPane.PANE_COMPONENT_HEIGHT));
sortBasisUiComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (sortExpressionPanes.get(sortBasisUiComboBox.getSelectedIndex()) != currentSortExpressionPane) {
if (currentSortExpressionPane != null) {
currentSortExpressionPane.setVisible(false);
}
triggerItemChanged(sortBasisUiComboBox.getSelectedIndex());
}
sortBasisUiComboBox.addItemListener(e -> {
if (sortExpressionPanes.get(sortBasisUiComboBox.getSelectedIndex()) != currentSortExpressionPane) {
triggerItemChanged(sortBasisUiComboBox.getSelectedIndex());
}
});
sortBasisPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Basis"), SwingConstants.LEFT));
sortBasisPanel.add(AbstractSortPane.createIntervalUILabel());
sortBasisPanel.add(sortBasisUiComboBox);
this.add(sortBasisPanel);
for (SortExpressionPane sortExpressionPane : sortExpressionPanes) {
this.add(sortExpressionPane);
sortExpressionPane.setVisible(false);
}
sortBasisPanel = Layouts.row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Sort_Sort_Basis"), SwingConstants.LEFT)).weight(1.2),
cell(sortBasisUiComboBox).weight(3)
).getComponent();
}
void triggerItemChanged(Integer index) {
@ -102,9 +123,13 @@ public abstract class AbstractSortItemPane extends JPanel {
}
private void refreshCurrentSortExpressionPane() {
currentSortExpressionPane.setVisible(true);
sortAreaPane.setVisible(currentSortExpressionPane.needSortArea());
sortRulePane.setVisible(currentSortExpressionPane.needSortRule());
if (currentSortExpressionPane instanceof FormulaSortExpressionPane) {
cardPane.select("formula").populate();
} else if (currentSortExpressionPane instanceof CustomSequenceSortExpressionPane) {
cardPane.select("custom").populate();
} else {
cardPane.select("cell").populate();
}
}
private String[] getSortNames() {

42
designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java

@ -1,5 +1,7 @@
package com.fr.design.sort.common;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.Style;
import com.fr.base.background.ColorBackground;
import com.fr.base.svg.IconUtils;
@ -27,22 +29,21 @@ import com.fr.stable.StringUtils;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import static com.fine.swing.ui.layout.Layouts.cell;
public class SortColumnRowPane extends JPanel implements UIObserver {
int paneWidth;
int paneHeight;
int jTextFieldWidth;
JTextField colJTextField;
JTextField rowJTextField;
UIButton selectButton;
UILabel elementLabel;
private boolean isAlreadyAddListener = false;
private CellSelection oldSelection;
private SelectionListener gridSelectionChangeListener;
@ -54,28 +55,30 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
HeaderAreaPane.CellSelectionManager cellSelectionManager;
public SortColumnRowPane(int paneWidth, int paneHeight) {
this.paneWidth = paneWidth;
this.paneHeight = paneHeight;
public SortColumnRowPane() {
initComponents();
}
private void initComponents() {
initSize();
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
intUILabel();
initTextField();
initSelectButton();
this.setSize(new Dimension(paneWidth, paneHeight));
initLayout();
}
void initSize() {
jTextFieldWidth = (paneWidth - 40) / 2;
private void initLayout() {
this.setLayout(new BorderLayout());
this.add(Layouts.row(2,
cell(elementLabel).weight(1),
cell(colJTextField).weight(2),
cell(rowJTextField).weight(2),
cell(selectButton).weight(1)
).getComponent());
}
void intUILabel() {
UILabel uiLabel = new UILabel(IconUtils.readIcon("/com/fr/design/images/buttonicon/propertiestab/cellelement_normal.png"));
this.add(uiLabel);
elementLabel = new UILabel(new LazyIcon("cellelement_small"));
}
public static boolean isAvailableColumnRow(ColumnRow columnRow) {
@ -87,17 +90,12 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
colJTextField.setEditable(false);
rowJTextField = new JTextField();
rowJTextField.setEditable(false);
colJTextField.setPreferredSize(new Dimension(jTextFieldWidth, paneHeight));
rowJTextField.setPreferredSize(new Dimension(jTextFieldWidth, paneHeight));
this.add(colJTextField);
this.add(rowJTextField);
}
void initSelectButton() {
selectButton = new UIButton(ENABLE_ICON);
selectActionListener = new SelectActionListener(this);
selectButton.addMouseListener(selectActionListener);
this.add(selectButton);
}
public void populateBean(ColumnRow columnRow, boolean enabled, HeaderAreaPane.CellSelectionManager cellSelectionManager) {
@ -129,7 +127,9 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
public void setColumnRow(ColumnRow columnRow) {
populateBean(columnRow);
uiObserverListener.doChange();
if (uiObserverListener != null) {
uiObserverListener.doChange();
}
}
public ColumnRow updateBean() {

41
designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java

@ -1,12 +1,14 @@
package com.fr.design.sort.common;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import javax.swing.*;
@ -14,6 +16,9 @@ import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
public class SortUIExpandablePane extends JPanel {
private static final long serialVersionUID = 1L;
@ -31,12 +36,12 @@ public class SortUIExpandablePane extends JPanel {
public SortUIExpandablePane(AbstractSortItemPane contentPane, AbstractSortGroupPane sortGroupPane) {
super();
this.setLayout(new BorderLayout());
this.sortGroupPane = sortGroupPane;
this.contentPane = contentPane;
initComponents();
wrapPane.setBorder(BorderFactory.createLineBorder(new Color(217, 218, 221), 1));
wrapPane.setBorder(new FineRoundBorder());
wrapPane.setBackground(Color.WHITE);
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 5));
}
@ -51,11 +56,12 @@ public class SortUIExpandablePane extends JPanel {
}
});
headerPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(217, 218, 221)));
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
contentPane.setBorder(new ScaledEmptyBorder(0, 5, 0, 5));
wrapPane.add(headerPane, BorderLayout.NORTH);
wrapPane.add(contentPane, BorderLayout.CENTER);
setContentPanelShow(true);
this.add(wrapPane);
this.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0));
}
@ -77,20 +83,14 @@ public class SortUIExpandablePane extends JPanel {
HeaderPane(AbstractSortGroupPane sortGroupPane) {
this.sortGroupPane = sortGroupPane;
this.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0));
initComponents();
this.setBorder(new ScaledEmptyBorder(5, 0, 5, 0));
}
private void initComponents() {
iconUiLabel = new UILabel();
this.add(iconUiLabel);
tipUILabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Second_Sort"));
this.add(tipUILabel);
this.add(AbstractSortPane.createIntervalUILabel( DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.sort.expand.header.pane")));
closeButton = new UILabel(IconUtils.readIcon("/com/fr/design/images/control/close.png"));
closeButton.setPreferredSize(new Dimension(16, 20));
this.add(closeButton);
closeButton = new UILabel(new LazyIcon("close"));
closeButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@ -100,14 +100,19 @@ public class SortUIExpandablePane extends JPanel {
}
}
});
this.setPreferredSize(new Dimension(contentPane.sortItemPaneWidth + 7, AbstractSortPane.PANE_COMPONENT_HEIGHT));
this.setLayout(new BorderLayout());
this.add(Layouts.row(
cell(iconUiLabel), cell(tipUILabel), flex(), cell(closeButton)
)
.getComponent(), BorderLayout.CENTER);
this.setPreferredSize(new Dimension(contentPane.sortItemPaneWidth + FineUIScale.scale(7), FineUIScale.scale(24)));
}
public void setShow(boolean show) {
if (show) {
iconUiLabel.setIcon(IconUtils.readIcon("/com/fr/design/images/sort/down_arrow.png"));
iconUiLabel.setIcon(new LazyIcon("triangle_down"));
} else {
iconUiLabel.setIcon(IconUtils.readIcon("/com/fr/design/images/sort/left_arrow.png"));
iconUiLabel.setIcon(new LazyIcon("triangle_right"));
}
}

28
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequencePane.java

@ -1,11 +1,12 @@
package com.fr.design.sort.expressionpane;
import com.fr.base.svg.IconUtils;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.report.core.sort.sortexpression.CustomSequenceSortExpression;
import javax.swing.*;
@ -14,27 +15,25 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
public class CustomSequencePane extends JPanel {
protected UITextField textField;
protected UIButton button;
List<String> customSequence;
public CustomSequencePane(int width) {
this.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
this.initComponents(width);
public CustomSequencePane() {
this.setLayout(new BorderLayout());
this.initComponents();
}
protected void initComponents(int width) {
protected void initComponents() {
textField = new UITextField();
textField.setEditable(false);
textField.setPreferredSize(new Dimension(width - 20, AbstractSortPane.PANE_COMPONENT_HEIGHT));
Icon icon = IconUtils.readIcon("/com/fr/design/images/sort/sequence.png");
button = new UIButton(icon);
button.setBackground(Color.RED);
button = new UIButton(new LazyIcon("nosort"));
button.setOpaque(false);
button.setCursor(new Cursor(Cursor.HAND_CURSOR));
button.setPreferredSize(new Dimension(20, AbstractSortPane.PANE_COMPONENT_HEIGHT));
MouseAdapter mouseAdapter = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@ -46,13 +45,14 @@ public class CustomSequencePane extends JPanel {
triggerOk(CustomSequenceSortExpression.customSequenceToString(customSequence, ","),
CustomSequenceSortExpression.isReferenceCustomSequence(customSequence));
}
}, new Dimension(700, 400)).setVisible(true);
}, FineUIScale.scale(new Dimension(700, 400))).setVisible(true);
}
};
button.addMouseListener(mouseAdapter);
textField.addMouseListener(mouseAdapter);
this.add(textField);
this.add(button);
this.add(Layouts.row(
cell(textField).weight(6), cell(button).weight(1)
).getComponent());
}
private void triggerOk(String customSequence, Boolean referenceCustomSequence) {

14
designer-realize/src/main/java/com/fr/design/sort/expressionpane/CustomSequenceSortExpressionPane.java

@ -1,21 +1,25 @@
package com.fr.design.sort.expressionpane;
import com.fr.design.sort.common.AbstractSortPane;
import com.fine.swing.ui.layout.Layouts;
import com.fr.locale.InterProviderFactory;
import com.fr.report.core.sort.sortexpression.CustomSequenceSortExpression;
import javax.swing.*;
import java.awt.*;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
public class CustomSequenceSortExpressionPane extends SortExpressionPane<CustomSequenceSortExpression> {
CustomSequencePane customSequencePane;
public CustomSequenceSortExpressionPane(int width, int rightWidth) {
this.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 0));
customSequencePane = new CustomSequencePane(rightWidth + 5);
this.add(customSequencePane);
this.setLayout(new BorderLayout());
customSequencePane = new CustomSequencePane();
this.add(Layouts.row(
flex(1.2), cell(customSequencePane).weight(3)
).getComponent());
}
@Override

12
designer-realize/src/main/java/com/fr/design/sort/expressionpane/FormulaSortExpressionPane.java

@ -1,21 +1,25 @@
package com.fr.design.sort.expressionpane;
import com.fine.swing.ui.layout.Layouts;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.locale.InterProviderFactory;
import com.fr.report.core.sort.sortexpression.FormulaSortExpression;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
public class FormulaSortExpressionPane extends SortExpressionPane<FormulaSortExpression> {
TinyFormulaPane tinyFormulaPane;
public FormulaSortExpressionPane(int width) {
this.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 0));
this.setLayout(new BorderLayout());
tinyFormulaPane = new TinyFormulaPane();
tinyFormulaPane.setPreferredSize(new Dimension(width + 5, AbstractSortPane.PANE_COMPONENT_HEIGHT));
this.add(tinyFormulaPane);
this.add(Layouts.row(
flex(1.2), cell(tinyFormulaPane).weight(3)
).getComponent());
}
@Override

196
designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

@ -1,35 +1,28 @@
package com.fr.design.sort.header;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.design.sort.common.SortColumnRowPane;
import com.fr.design.sort.common.SortUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.core.sort.common.CellSortable;
import com.fr.report.core.sort.header.SortHeader;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ColumnRow;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
public class HeaderAreaPane extends JPanel {
@ -37,31 +30,63 @@ public class HeaderAreaPane extends JPanel {
protected int headerAreaPaneRightWidth;
private CellSelectionManager cellSelectionManager = new CellSelectionManager();
TemplateCellElement cellElement;
AreaJLayeredPane areaJLayeredPane;
SortColumnRowPane columnRowPane;
ReactiveCardPane cardPane;
UIComboBox uiComboBox;
UILabel headerLabel;
HeaderAreaPane(int headerAreaPaneWidth, int headerAreaPaneRightWidth) {
this.headerAreaPaneWidth = headerAreaPaneWidth;
this.headerAreaPaneRightWidth = headerAreaPaneRightWidth;
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
initComponents();
}
void initComponents() {
initUILabel();
initLayeredPane();
headerLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Area"), SwingConstants.LEFT);
uiComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_None"), Toolkit.i18nText("Fine-Design_Basic_Custom")});
columnRowPane = new SortColumnRowPane();
initCardPane();
initChangeListener();
this.setLayout(new BorderLayout());
this.add(cardPane);
}
void initUILabel() {
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Area"), SwingConstants.LEFT);
this.add(uiLabel);
this.add(AbstractSortPane.createIntervalUILabel());
private void initChangeListener() {
uiComboBox.addItemListener(e -> {
if (uiComboBox.getSelectedIndex() == 0) {
cardPane.select("none").populate();
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean());
columnRowPane.cancelSelectState();
} else {
cardPane.select("custom").populate();
ColumnRow columnRow = columnRowPane.updateBean();
if (cellSelectionManager.isNotSelectables(columnRow)) {
columnRowPane.setColumnRow(ColumnRow.ERROR);
} else {
cellSelectionManager.addNotSelectables(columnRow);
}
}
});
uiComboBox.setEnabled(false);
}
void initLayeredPane() {
areaJLayeredPane = new AreaJLayeredPane();
this.add(areaJLayeredPane);
private void initCardPane() {
cardPane = ReactiveCardPane.create()
.addSupplier("none", () -> column(LayoutConstants.VERTICAL_GAP,
row(
cell(headerLabel).weight(1.2), cell(uiComboBox).weight(3)
)
).getComponent())
.addSupplier("custom", () -> column(LayoutConstants.VERTICAL_GAP,
row(
cell(headerLabel).weight(1.2), cell(uiComboBox).weight(3)
),
row(
flex(1.2), cell(columnRowPane).weight(3)
)
).getComponent());
cardPane.select("none").populate();
}
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, TemplateCellElement cellElement) {
@ -71,7 +96,18 @@ public class HeaderAreaPane extends JPanel {
if (elementCasePane != null) {
enabled = elementCasePane.isSelectedOneCell();
}
areaJLayeredPane.populateBean(columnRow, showHeaderArea, enabled);
populateColumnRowPane(columnRow, showHeaderArea, enabled);
}
private void populateColumnRowPane(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) {
cellSelectionManager.build(cellElement, columnRow);
if(showHeaderArea){
columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow);
}
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager);
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0);
uiComboBox.setEnabled(enabled);
}
public ColumnRow updateBean(TemplateCellElement cellElement) {
@ -81,7 +117,15 @@ public class HeaderAreaPane extends JPanel {
return getOldColumnRow(cellElement);
}
}
return areaJLayeredPane.updateBean();
return updateColumnRowBean();
}
private ColumnRow updateColumnRowBean() {
if (uiComboBox.getSelectedIndex() == 0) {
return null;
} else {
return columnRowPane.updateBean();
}
}
private ColumnRow getOldColumnRow(TemplateCellElement cellElement) {
@ -99,100 +143,6 @@ public class HeaderAreaPane extends JPanel {
}
}
class AreaJLayeredPane extends JPanel {
SortColumnRowPane columnRowPane;
JLayeredPane jLayeredPane;
UIComboBox uiComboBox;
boolean showHeaderArea;
AreaJLayeredPane() {
this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
initComponents();
}
private void initComponents() {
initUIComboBox();
initJLayeredPane();
}
void initUIComboBox() {
uiComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Basic_None"), Toolkit.i18nText("Fine-Design_Basic_Custom")});
uiComboBox.setSize(new Dimension(headerAreaPaneRightWidth, AbstractSortPane.PANE_COMPONENT_HEIGHT));
uiComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if ((showHeaderArea ? 1 : 0) != uiComboBox.getSelectedIndex()) {
triggerItemChanged(uiComboBox.getSelectedIndex());
}
}
});
uiComboBox.setEnabled(false);
}
void triggerItemChanged(Integer index) {
setSortColumnRowPaneShow(index == 1);
if (index == 1) {
ColumnRow columnRow = columnRowPane.updateBean();
if (cellSelectionManager.isNotSelectables(columnRow)) {
columnRowPane.setColumnRow(ColumnRow.ERROR);
} else {
cellSelectionManager.addNotSelectables(columnRow);
}
} else {
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean());
columnRowPane.cancelSelectState();
}
}
void setSortColumnRowPaneShow(boolean show) {
if (show) {
jLayeredPane.setLayer(columnRowPane, JLayeredPane.POPUP_LAYER);
jLayeredPane.setLayer(uiComboBox, JLayeredPane.MODAL_LAYER);
} else {
jLayeredPane.setLayer(uiComboBox, JLayeredPane.POPUP_LAYER);
jLayeredPane.setLayer(columnRowPane, JLayeredPane.MODAL_LAYER);
}
showHeaderArea = show;
refresh();
}
void initJLayeredPane() {
jLayeredPane = new JLayeredPane();
columnRowPane = new SortColumnRowPane(headerAreaPaneRightWidth - 18, AbstractSortPane.PANE_COMPONENT_HEIGHT);
jLayeredPane.setPreferredSize(new Dimension(headerAreaPaneRightWidth, AbstractSortPane.PANE_COMPONENT_HEIGHT));
jLayeredPane.add(columnRowPane, JLayeredPane.MODAL_LAYER);
jLayeredPane.add(uiComboBox, JLayeredPane.POPUP_LAYER);
this.add(jLayeredPane);
}
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) {
cellSelectionManager.build(cellElement, columnRow);
if(showHeaderArea){
columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow);
}
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager);
setSortColumnRowPaneShow(showHeaderArea);
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0);
uiComboBox.setEnabled(enabled);
}
public ColumnRow updateBean() {
if (uiComboBox.getSelectedIndex() == 0) {
return null;
} else {
return columnRowPane.updateBean();
}
}
public void refresh() {
validate();
repaint();
revalidate();
}
}
public static class CellSelectionManager {
ElementCasePane elementCase;
java.util.List<ColumnRow> notSelectables = new ArrayList<>();

37
designer-realize/src/main/java/com/fr/design/sort/header/HeaderSettingPane.java

@ -1,9 +1,9 @@
package com.fr.design.sort.header;
import com.fine.swing.ui.layout.Column;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.sort.common.AbstractSortPane;
import com.fr.general.GeneralContext;
import com.fr.report.core.sort.header.SortHeader;
@ -13,6 +13,9 @@ import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.Locale;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class HeaderSettingPane extends JPanel {
protected int headerSettingPaneWidth;
protected int headerSettingPaneRightWidth;
@ -22,34 +25,30 @@ public class HeaderSettingPane extends JPanel {
HeaderSettingPane(int headerSettingPaneWidth, int headerSettingPaneRightWidth) {
this.headerSettingPaneWidth = headerSettingPaneWidth;
this.headerSettingPaneRightWidth = headerSettingPaneRightWidth;
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setLayout(new BorderLayout());
initComponents();
}
void initComponents() {
initUILabel();
initHeaderSortRulePane();
}
void initUILabel() {
JPanel jPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 2));
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Setting"));
UILabel emptyUILabel = new UILabel();
emptyUILabel.setPreferredSize(new Dimension(10, 10));
uiCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Sort_Allow_User_Click_Sort_Order"));
addToolTipText();
uiCheckBox.setPreferredSize(new Dimension(headerSettingPaneRightWidth - 10, AbstractSortPane.PANE_COMPONENT_HEIGHT));
uiCheckBox.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
headerSortRulePane.setVisible(uiCheckBox.isSelected());
}
});
jPanel.add(uiLabel);
jPanel.add(emptyUILabel);
jPanel.add(uiCheckBox);
this.add(jPanel);
headerSortRulePane = new HeaderSortRulePane();
headerSortRulePane.setVisible(false);
Column corePane = new Column();
corePane.setSpacing(10);
corePane.add(
row(cell(uiLabel).weight(1.2),cell(uiCheckBox).weight(3.0)),
row(cell(headerSortRulePane).weight(1))
);
this.add(corePane, BorderLayout.CENTER);
}
private void addToolTipText() {
@ -58,12 +57,6 @@ public class HeaderSettingPane extends JPanel {
}
}
void initHeaderSortRulePane() {
headerSortRulePane = new HeaderSortRulePane();
this.add(headerSortRulePane);
headerSortRulePane.setVisible(false);
}
protected void refresh() {
validate();
repaint();

47
designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java

@ -1,15 +1,16 @@
package com.fr.design.sort.header;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fr.base.FineColor;
import com.fr.base.svg.SVGIcon;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorControlWindow;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.core.sort.header.HeaderIconBuilder;
@ -25,6 +26,10 @@ import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
public class HeaderSortRulePane extends JPanel {
IconButton ascIconButton;
IconButton desIconButton;
@ -38,32 +43,23 @@ public class HeaderSortRulePane extends JPanel {
HeaderSortRulePane() {
initComponents();
initState(true);
this.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15));
}
void initComponents() {
this.setLayout(new BorderLayout());
initUILabel();
initSortRuleItem();
this.setPreferredSize(new Dimension(160, 160));
}
void initUILabel() {
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Sort_Basis"), SwingConstants.LEFT);
this.add(uiLabel, BorderLayout.NORTH);
}
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Header_Sort_Basis"), SwingConstants.LEFT);
ascUICheckBox = new UICheckBox(SortRule.ASC.getDescription());
ascIconButton = new IconButton(SortRule.ASC);
desUICheckBox = new UICheckBox(SortRule.DES.getDescription());
desIconButton = new IconButton(SortRule.DES);
nosortUICheckBox = new UICheckBox(SortRule.NO_SORT.getDescription());
nosortIconButton = new IconButton(SortRule.NO_SORT);
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP,
row(cell(label).weight(1.5), cell(ascUICheckBox).weight(2), flex(), cell(ascIconButton)),
row(flex(1.5), cell(desUICheckBox).weight(2), flex(), cell(desIconButton)),
row(flex(1.5), cell(nosortUICheckBox).weight(2), flex(), cell(nosortIconButton))
).getComponent());
void initSortRuleItem() {
Component[][] components = new Component[][]{
new Component[]{ascUICheckBox = new UICheckBox(SortRule.ASC.getDescription()), ascIconButton = new IconButton(SortRule.ASC)},
new Component[]{desUICheckBox = new UICheckBox(SortRule.DES.getDescription()), desIconButton = new IconButton(SortRule.DES)},
new Component[]{nosortUICheckBox = new UICheckBox(SortRule.NO_SORT.getDescription()), nosortIconButton = new IconButton(SortRule.NO_SORT)},
};
double[] rowSize = {ICON_LENGTH + 10, ICON_LENGTH + 10, ICON_LENGTH + 10};
double[] columnSize =
{DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.sort.rule.item").getWidth(), ICON_LENGTH + 10};
JPanel sortRuleItem = TableLayoutHelper.createCommonTableLayoutPane(components, rowSize, columnSize, 0);
this.add(sortRuleItem, BorderLayout.CENTER);
initUICheckBoxChange(ascUICheckBox, ascIconButton);
initUICheckBoxChange(desUICheckBox, desIconButton);
initUICheckBoxChange(nosortUICheckBox, nosortIconButton);
@ -108,7 +104,7 @@ public class HeaderSortRulePane extends JPanel {
public void setActiveState(boolean activeState) {
if (activeState) {
borderUiLabel.setBorder(BorderFactory.createLineBorder(Color.gray, 1));
borderUiLabel.setBorder(new FineRoundBorder());
} else {
borderUiLabel.setBorder(null);
}
@ -145,8 +141,7 @@ public class HeaderSortRulePane extends JPanel {
Icon getIcon(FineColor fineColor) {
BufferedImage bufferedImage = HeaderIconBuilder.getIcon(sortRule, fineColor);
Icon icon = new SVGIcon(bufferedImage);
return icon;
return new SVGIcon(bufferedImage);
}
void refreshIconLabel(BufferedImage bufferedImage) {

28
designer-realize/src/main/java/com/fr/design/sort/header/SortHeaderPane.java

@ -1,11 +1,16 @@
package com.fr.design.sort.header;
import com.fr.design.sort.common.SortColumnRowPane;
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.sort.header.SortHeader;
import com.fr.stable.ColumnRow;
import javax.swing.*;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
public class SortHeaderPane extends JPanel {
int sortHeaderPaneWidth;
@ -16,22 +21,16 @@ public class SortHeaderPane extends JPanel {
TemplateCellElement cellElement;
public SortHeaderPane(int sortHeaderPaneWidth, int sortHeaderPaneRightWidth) {
this.setLayout(new BorderLayout());
this.sortHeaderPaneWidth = sortHeaderPaneWidth;
this.sortHeaderPaneRightWidth = sortHeaderPaneRightWidth;
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
initHeaderArea();
initHeaderSetting();
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
}
void initHeaderArea() {
this.headerAreaPane = new HeaderAreaPane(sortHeaderPaneWidth, sortHeaderPaneRightWidth);
this.add(headerAreaPane);
}
void initHeaderSetting() {
this.headerSettingPane = new HeaderSettingPane(sortHeaderPaneWidth, sortHeaderPaneRightWidth);
this.add(headerSettingPane);
this.add(
Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(headerAreaPane), cell(headerSettingPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent(),
BorderLayout.CENTER);
}
public void populateBean(SortHeader sortHeader, String defaultHeaderArea,TemplateCellElement cellElement) {
@ -59,7 +58,6 @@ public class SortHeaderPane extends JPanel {
if (columnRow != null) {
headerArea = columnRow.toString();
}
SortHeader sortHeader = new SortHeader(headerArea, null, items);
return sortHeader;
return new SortHeader(headerArea, null, items);
}
}

73
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -1,9 +1,12 @@
package com.fr.quickeditor;
import com.fine.swing.ui.layout.Layouts;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.GraphHelper;
import com.fr.base.Style;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icombobox.UIComboBox;
@ -12,8 +15,6 @@ import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.style.TextFormatPaneContainer;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
@ -36,7 +37,6 @@ import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
@ -50,6 +50,9 @@ import java.util.ArrayList;
import java.util.Objects;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/**
* @author zhou, yaoh.wu
* @version 2017年8月7日16点54分
@ -116,23 +119,14 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
}
private void createPanelBody() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
leftContentPane = Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(multipleLabelTip),
cell(topContentContainer),
cell(formatPane),
cell(centerBodyContainer)).getComponent();
if (isScrollAll()) {
double[] scrollAllRowSize = {p, p, p, p};
prepareScrollBar();
multipleLabelTip.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 0, this.getBackground()));
topContentContainer.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground()));
formatPane.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground()));
centerBodyContainer.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground()));
Component[][] components = new Component[][]{
new Component[]{multipleLabelTip},
new Component[]{topContentContainer},
new Component[]{formatPane},
new Component[]{centerBodyContainer}
};
leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, scrollAllRowSize, columnSize, HGAP, VGAP);
leftContentPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 0));
this.setLayout(new CellElementBarLayout(leftContentPane) {
@Override
public void layoutContainer(Container parent) {
@ -147,31 +141,17 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
}
int width = parent.getWidth();
int height = parent.getHeight();
if (leftContentPane.getPreferredSize().height > maxHeight) {
leftContentPane.setBounds(0, -beginY, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height + beginY);
scrollBar.setBounds(width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, 0, SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, height);
} else {
leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height);
}
leftContentPane.setBounds(0, -beginY, width - SCROLLBAR_WIDTH, height + beginY);
scrollBar.setBounds(width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, 0, SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, height);
leftContentPane.validate();
}
});
this.add(scrollBar);
this.add(leftContentPane);
} else {
double[] scrollContentRowSize = {p, p, p, f};
multipleLabelTip.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 0, this.getBackground()));
topContentContainer.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 10, this.getBackground()));
formatPane.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 10, this.getBackground()));
centerBodyContainer.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground()));
Component[][] components = new Component[][]{
new Component[]{multipleLabelTip},
new Component[]{topContentContainer},
new Component[]{formatPane},
new Component[]{centerBodyContainer}
};
leftContentPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createGapTableLayoutPane(components, scrollContentRowSize, columnSize, HGAP, VGAP), BorderLayout.CENTER);
this.add(leftContentPane, BorderLayout.CENTER);
}
}
@ -303,19 +283,20 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private JPanel initTopContent() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f};
double[] rowSize = {p, p};
cellLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Cell"));
UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element"));
columnRowTextField = initColumnRowTextField();
initCellElementEditComboBox();
Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(comboBox)},
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
return Layouts.column(LayoutConstants.VERTICAL_GAP,
row(
cell(cellLabel).weight(1.2),
cell(columnRowTextField).weight(3)
),
row(
cell(insertContentLabel).weight(1.2),
cell(UIComponentUtils.wrapWithBorderLayoutPane(comboBox)).weight(3)
)
).getComponent();
}
private void prepareScrollBar() {

42
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -1,9 +1,11 @@
package com.fr.quickeditor.cellquick;
import com.fine.swing.ui.layout.Layouts;
import com.fr.base.BaseFormula;
import com.fr.design.actions.columnrow.DSColumnConditionAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.DSColumnCellAction;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.DialogActionAdapter;
@ -60,6 +62,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.EVEN;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.ODD;
@ -120,12 +123,10 @@ public class CellDSColumnEditor extends CellQuickEditor {
public JComponent createCenterBody() {
this.createPanes();
this.createSwitchTab();
JPanel dsColumnRegion = new JPanel(new BorderLayout());
dsColumnRegion.add(tabsHeaderIconPane, BorderLayout.NORTH);
dsColumnRegion.add(cardContainer, BorderLayout.CENTER);
JPanel centerPane = new JPanel(new BorderLayout());
centerPane.add(dsColumnRegion, BorderLayout.CENTER);
return centerPane;
return Layouts.column(10,
cell(tabsHeaderIconPane),
cell(cardContainer)
).getComponent();
}
@Override
@ -261,7 +262,6 @@ public class CellDSColumnEditor extends CellQuickEditor {
dataPane.release();
}
/**
* 创建有内容的面板显示信息
*
@ -270,24 +270,22 @@ public class CellDSColumnEditor extends CellQuickEditor {
@Override
protected JPanel createContentPane() {
initComponents();
double[] columnSize = {F};
double[] rowSize = {P, P, P};
Component[][] components = new Component[][]{
//数据集列选择
new Component[]{this.dataPane},
//数据分组设置
new Component[]{this.groupPane},
//条件过滤
new Component[]{this.conditionPane}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
return Layouts.column(LayoutConstants.VERTICAL_GAP,
cell(dataPane), cell(groupPane), cell(conditionPane)
).getComponent();
}
protected void initContentPane() {
leftContentPane = createContentPane();
if (leftContentPane != null) {
this.add(leftContentPane, BorderLayout.CENTER);
}
}
private void initComponents(){
dataPane = new SelectedDataColumnPane(true, true);
groupPane = new ResultSetGroupDockingPane();
initListener();
double[] rowSize = {P}, columnSize = {60, F};
UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Filter_Conditions"));
condition = new DSColumnConditionAction();
if (tc != null) {
@ -297,11 +295,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
condition.setSmallIcon(UIConstants.EMPTY_ICON);
condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit"));
conditionUIButton = new UIButton(condition);
Component[][] components = new Component[][]{
new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)}
};
conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
conditionPane = Layouts.row(cell(uiLabel).weight(1.2),cell(conditionUIButton).weight(3)).getComponent();
}
private void initListener() {

39
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

@ -1,7 +1,7 @@
package com.fr.quickeditor.cellquick;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula;
import com.fr.base.Style;
import com.fr.base.TextFormat;
@ -12,8 +12,6 @@ import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.grid.selection.CellSelection;
@ -23,20 +21,16 @@ import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.ColumnRow;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Arrays;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
/**
* 公式快速编辑面板同文本数字编辑拆分
@ -88,7 +82,6 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
*/
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
formulaTextField = new UITextField();
formulaTextField.addKeyListener(new KeyAdapter() {
@Override
@ -98,14 +91,9 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
}
}
});
JPanel textFieldPane = new JPanel(new BorderLayout());
textFieldPane.add(formulaTextField, BorderLayout.CENTER);
textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
UIButton formulaButton = new UIButton(new LazyIcon("formula"));
formulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "...");
Dimension dimension = new Dimension(UIManager.getInt("FormulaPane.buttonWidth"), UIManager.getInt("FormulaPane.buttonHeight"));
formulaButton.setPreferredSize(FineUIScale.scale(dimension));
formulaButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula();
@ -134,22 +122,9 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
}
});
JPanel pane = new JPanel(new BorderLayout());
pane.add(textFieldPane, BorderLayout.CENTER);
pane.add(formulaButton, BorderLayout.EAST);
content.add(pane, BorderLayout.NORTH);
Component[][] componentLines = new Component[][] {
new Component[]{EMPTY_LABEL, content},
};
double[] rowSize = new double[componentLines.length];
Arrays.fill(rowSize, TableLayout.PREFERRED);
double[] columnSize = new double[] {TableLayout.PREFERRED, TableLayout.FILL };
return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{EMPTY_LABEL, content},
},
rowSize, columnSize, HGAP, VGAP);
return Layouts.row(
flex(1.2), cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaButton).weight(0.5)
).getComponent();
}

4
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellStringQuickEditor.java

@ -3,7 +3,6 @@ package com.fr.quickeditor.cellquick;
import com.fr.base.BaseFormula;
import com.fr.base.Style;
import com.fr.base.TextFormat;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.grid.GridKeyListener;
@ -61,7 +60,7 @@ public class CellStringQuickEditor extends CellQuickEditor {
*/
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout(0, IntervalConstants.INTERVAL_L1));
JPanel content = new JPanel(new BorderLayout());
stringTextArea = new UITextArea();
stringTextArea.addKeyListener(new KeyAdapter() {
@ -89,7 +88,6 @@ public class CellStringQuickEditor extends CellQuickEditor {
}
});
content.add(stringTextArea, BorderLayout.NORTH);
return content;
}

Loading…
Cancel
Save