From 2dc17259e7f60c785e82531fddac517cd5c525e9 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 20:13:53 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=9F=BA=E4=BA=8EUISpinner=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AD=97=E6=AF=8Dspinner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/columnrow/ColumnRowPane.java | 101 +++--------- .../gui/ispinner/FineUpperCaseSpinner.java | 150 ++++++++++++++++++ .../com/fr/design/gui/ispinner/UISpinner.java | 63 ++++++-- .../fr/design/write/submit/CustomJobPane.java | 1 + .../write/submit/SubmitVisitorListPane.java | 2 +- 5 files changed, 221 insertions(+), 96 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java index d23a1fd22f..6f0fd085aa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java @@ -1,32 +1,22 @@ package com.fr.design.gui.columnrow; -import com.fine.theme.utils.FineUIUtils; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; -import com.fr.design.gui.ispinner.ColumnRowSpinner; -import com.fr.design.gui.ispinner.UIBasicSpinner; -import com.fr.design.gui.ispinner.UpperCaseSpinner; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.gui.ispinner.FineUpperCaseSpinner; +import com.fr.design.gui.ispinner.UISpinner; + import com.fr.general.ComparatorUtils; import com.fr.stable.ColumnRow; import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; -import javax.swing.JFormattedTextField; import javax.swing.JPanel; -import javax.swing.SpinnerListModel; -import javax.swing.JSpinner.DefaultEditor; + import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.text.AbstractDocument; -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.DocumentFilter; + 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.fix; @@ -40,29 +30,17 @@ import static com.fine.swing.ui.layout.Layouts.row; public class ColumnRowPane extends JPanel implements UIObserver { private static final long serialVersionUID = 1L; - private static String[] columnarray = new String[1000]; - private static String[] rowarray = new String[5000]; - - protected UpperCaseSpinner columnSpinner; - protected UIBasicSpinner rowSpinner; - - static { - for (int i = 1; i <= 1000; i++) { - columnarray[i - 1] = StableUtils.convertIntToABC(i); - } - for (int i = 1; i <= 5000; i++) { - rowarray[i - 1] = StringUtils.EMPTY + i; - } - } + protected FineUpperCaseSpinner columnSpinner; + protected UISpinner rowSpinner; protected DocumentListener d = new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { - String rolText = ((DefaultEditor) columnSpinner.getEditor()).getTextField().getText(); - String rowText = ((DefaultEditor) rowSpinner.getEditor()).getTextField().getText(); + String rolText = columnSpinner.getTextFieldNew().getText(); + String rowText = rowSpinner.getTextField().getText(); if (rolText == null || rolText.length() == 0 || rowText == null || rowText.length() == 0) { return; } @@ -73,8 +51,8 @@ public class ColumnRowPane extends JPanel implements UIObserver { @Override public void insertUpdate(DocumentEvent e) { - int col = StableUtils.convertABCToInt(((DefaultEditor) columnSpinner.getEditor()).getTextField().getText()) - 1; - int row = Integer.parseInt(((DefaultEditor) rowSpinner.getEditor()).getTextField().getText()) - 1; + int col = StableUtils.convertABCToInt(columnSpinner.getTextFieldNew().getText()) - 1; + int row = Integer.parseInt(rowSpinner.getTextField().getText()) - 1; setColumnRow(ColumnRow.valueOf(col, row)); } @@ -128,58 +106,21 @@ public class ColumnRowPane extends JPanel implements UIObserver { protected void initRowSpinner() { - rowSpinner = new ColumnRowSpinner((new SpinnerListModel(rowarray))) { - public boolean shouldResponseChangeListener() { - return false; - } - - }; - rowSpinner.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); - JFormattedTextField rftf = GUICoreUtils.getSpinnerTextField(rowSpinner); - if (rftf != null) { - rftf.setColumns(4); // specify more width than we need - rftf.setHorizontalAlignment(UITextField.LEFT); - } + rowSpinner = new UISpinner(1, 5000, 1); } protected void initColSpinner() { - SpinnerListModel columnSpinnerListModel = new SpinnerListModel(columnarray); - columnSpinner = new UpperCaseSpinner(columnSpinnerListModel) { - public boolean shouldResponseChangeListener() { - return false; - } - }; - columnSpinner.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); - JFormattedTextField cftf = GUICoreUtils.getSpinnerTextField(columnSpinner); - if (cftf != null) { - cftf.setColumns(3); // specify more width than we need - cftf.setHorizontalAlignment(UITextField.LEFT); - }else { - throw new IllegalArgumentException("Spinner'Editor can not be null!"); - } - - ((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() { - public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { - fb.insertString(offset, string.toUpperCase(), attr); - } - - public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr) throws BadLocationException { - if (string != null) { - string = string.toUpperCase(); - } - fb.replace(offset, length, string, attr); - } - }); + columnSpinner = new FineUpperCaseSpinner(1, 5000, 1); } protected void addDocumentListener(DocumentListener l) { - ((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); - ((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); + columnSpinner.getTextFieldNew().getDocument().addDocumentListener(l); + rowSpinner.getTextField().getDocument().addDocumentListener(l); } private void removeDocumentListener(DocumentListener l) { - ((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); - ((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); + columnSpinner.getTextFieldNew().getDocument().removeDocumentListener(l); + rowSpinner.getTextField().getDocument().removeDocumentListener(l); } /** @@ -208,17 +149,13 @@ public class ColumnRowPane extends JPanel implements UIObserver { column = 0; } removeDocumentListener(d); - String colValue = StableUtils.convertIntToABC(column + 1); - columnSpinner.setValue(colValue); - ((DefaultEditor) columnSpinner.getEditor()).getTextField().setText(colValue); + columnSpinner.setValue(column+1); int row = columnRow.getRow(); // shoc 小于0就蹦了 if (row < 0) { row = 0; } - String rowValue = Integer.toString(row + 1); - rowSpinner.setValue(rowValue); - ((DefaultEditor) rowSpinner.getEditor()).getTextField().setText(rowValue); + rowSpinner.setValue(row+1); addDocumentListener(d); fireChanged(); } diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java new file mode 100644 index 0000000000..5d4538e4f4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java @@ -0,0 +1,150 @@ +package com.fr.design.gui.ispinner; + +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; + +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.AbstractDocument; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.DocumentFilter; +import java.awt.BorderLayout; +import java.awt.Insets; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * 字母spinner + * + * @author Renekton + * @since 11.0 + * @Cteated on 2024/09/11 + */ +public class FineUpperCaseSpinner extends UISpinner { + + private UITextField textField; + + public FineUpperCaseSpinner(double minValue, double maxValue, double dierta) { + super(minValue, maxValue, dierta); + } + + protected void initComponents() { + setLayout(new BorderLayout()); + textField = initTextField(); + Insets insets = FineUIUtils.getUIInsets("InputTextField.borderInsets", defaultInsets); + textField.setBorder(new ScaledEmptyBorder(insets.top, insets.left, insets.bottom, insets.right)); + textField.setOpaque(false); + add(textField, BorderLayout.CENTER); + setValue(value); + + initArrowPane(); + componentInitListeners(); + } + + protected void setTextField(double value) { + textField.getDocument().removeDocumentListener(docListener); + textField.setText(StableUtils.convertIntToABC((int)value).toUpperCase()); + textField.getDocument().addDocumentListener(docListener); + } + + + protected UITextField initTextField() { + int columns = this.numberFieldColumns == 0 ? DEFAULT_NUMBERFIELD_COLUMNS : this.numberFieldColumns; + UITextField textField = new UITextField(columns) { + public boolean shouldResponseChangeListener() { + return false; + } + }; + ((AbstractDocument) textField.getDocument()).setDocumentFilter(new DocumentFilter() { + public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { + fb.insertString(offset, string.toUpperCase(), attr); + } + + public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr) throws BadLocationException { + if (string != null) { + string = string.toUpperCase(); + } + fb.replace(offset, length, string, attr); + } + }); + return textField; + } + + protected DocumentListener docListener = new DocumentListener() { + @Override + public void removeUpdate(DocumentEvent e) { + setTextFieldValue(getTextValue()); + } + + @Override + public void insertUpdate(DocumentEvent e) { + setTextFieldValue(getTextValue()); + } + + @Override + public void changedUpdate(DocumentEvent e) { + setTextFieldValue(getTextValue()); + } + }; + + + protected void initTextFiledListeners() { + textField.getDocument().removeDocumentListener(docListener); + textField.getDocument().addDocumentListener(docListener); + textField.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + textFieldFocus = true; + } + + @Override + public void focusLost(FocusEvent e) { + textFieldFocus = false; + textField.getDocument().removeDocumentListener(docListener); + if (!preAction && !nextAction) { + textField.setText(StableUtils.convertIntToABC((int)value).toUpperCase()); + } + textField.getDocument().addDocumentListener(docListener); + } + }); + } + + protected void initTextMouseListener() { + textField.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + hover = true; + repaint(); + } + + @Override + public void mouseExited(MouseEvent e) { + hover = false; + repaint(); + } + }); + } + + public UITextField getTextFieldNew() { + return textField; + } + + private double getTextValue() { + try { + if (StringUtils.isEmpty(textField.getText())) { + return 1; + } else if (StringUtils.isNumber(textField.getText())) { + return Double.parseDouble(textField.getText()); + } + return StableUtils.convertABCToInt(textField.getText()); + } catch (NumberFormatException numberFormatException) { + return 1; + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index f6b75b7c4f..6e4965a8f0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -13,7 +13,6 @@ import com.fr.design.gui.itextfield.UINumberField; import com.fr.stable.CommonUtils; import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -46,11 +45,11 @@ import static com.fine.theme.utils.FineUIStyle.setStyle; */ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, HoverAware { - private final Insets defaultInsets = new Insets(0, 6, 0, 6); + protected final Insets defaultInsets = new Insets(0, 6, 0, 6); private final int defaultButtonSize = 24; private final int ICON_WIDTH = 12; protected double value; - private static final int DEFAULT_NUMBERFIELD_COLUMNS = 2; + protected static final int DEFAULT_NUMBERFIELD_COLUMNS = 2; private UINumberField textField; private UIButton preButton; private UIButton nextButton; @@ -64,10 +63,14 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, /** * Spinner内的数字文本框长度 */ - private int numberFieldColumns; - private boolean textFieldFocus = false; + protected int numberFieldColumns; + protected boolean textFieldFocus = false; - private boolean hover; + protected boolean hover; + + protected boolean preAction; + + protected boolean nextAction; private static final String UI_CLASS_ID = "InputUI"; @@ -116,6 +119,11 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, }); } + initTextMouseListener(); + + } + + protected void initTextMouseListener() { textField.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { @@ -129,7 +137,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, repaint(); } }); - } /** @@ -281,19 +288,24 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, return hover; } - private void initComponents() { + protected void initComponents() { + setLayout(new BorderLayout()); textField = initNumberField(); textField.setMaxValue(maxValue); textField.setMinValue(minValue); Insets insets = FineUIUtils.getUIInsets("InputTextField.borderInsets", defaultInsets); textField.setBorder(new ScaledEmptyBorder(insets.top, insets.left, insets.bottom, insets.right)); textField.setOpaque(false); + add(textField, BorderLayout.CENTER); setValue(value); + initArrowPane(); + componentInitListeners(); + } + + protected void initArrowPane() { preButton = createArrowButton(new LazyIcon("up_arrow", ICON_WIDTH)); nextButton = createArrowButton(new LazyIcon("down_arrow", ICON_WIDTH)); - setLayout(new BorderLayout()); - add(textField, BorderLayout.CENTER); JPanel arrowPane = new JPanel(); arrowPane.setLayout(new GridLayout(2, 1)); arrowPane.add(preButton); @@ -304,7 +316,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, int buttonHeight = FineUIUtils.getAndScaleInt("InputButton.height", defaultButtonSize); arrowPane.setPreferredSize(new Dimension(buttonWidth, buttonHeight)); add(arrowPane, BorderLayout.EAST); - componentInitListeners(); } private UIButton createArrowButton(Icon icon) { @@ -337,7 +348,8 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, textField.setMinValue(minValue); } - private void componentInitListeners() { + protected void componentInitListeners() { + initButtonFocusListeners(); preButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -362,6 +374,31 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, initTextFiledListeners(); } + protected void initButtonFocusListeners() { + preButton.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + preAction = true; + } + + @Override + public void focusLost(FocusEvent e) { + preAction = false; + } + }); + nextButton.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + nextAction = true; + } + + @Override + public void focusLost(FocusEvent e) { + nextAction = false; + } + }); + } + protected void initTextFiledListeners() { textField.getDocument().removeDocumentListener(docListener); textField.getDocument().addDocumentListener(docListener); @@ -391,7 +428,7 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, return numberField; } - private DocumentListener docListener = new DocumentListener() { + protected DocumentListener docListener = new DocumentListener() { @Override public void removeUpdate(DocumentEvent e) { setTextFieldValue(textField.getValue()); diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index 7b67d5137d..7229ad0b8b 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -50,6 +50,7 @@ public abstract class CustomJobPane extends BasicBeanPane { UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); UITextArea area = new UITextArea(2, 1); + area.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); browserButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java index 4cb4dea409..d930a3bfbf 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -196,7 +196,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane { JPanel typePane = new JPanel(new BorderLayout()); typePane.add(row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), - cell(csjConfigComboBox).weight(0.5)).getComponent()); + cell(csjConfigComboBox).weight(0.5), flex()).getComponent()); this.add(column( cell(FineUIUtils.wrapComponentWithTitle(typePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))), From 435470daa26a91596b9e3a1debce901c734547e5 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 20:21:25 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=BD=93button=E7=82=B9=E5=87=BB=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E8=BD=AC=E6=8D=A2=E6=88=90=E5=AD=97=E6=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/ispinner/FineUpperCaseSpinner.java | 2 ++ .../com/fr/design/gui/ispinner/UISpinner.java | 28 ++----------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java index 5d4538e4f4..0e650449de 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java @@ -111,6 +111,8 @@ public class FineUpperCaseSpinner extends UISpinner { textField.setText(StableUtils.convertIntToABC((int)value).toUpperCase()); } textField.getDocument().addDocumentListener(docListener); + preAction = false; + nextAction = false; } }); } diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java index 6e4965a8f0..e95d1d3ef4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java @@ -349,16 +349,17 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, } protected void componentInitListeners() { - initButtonFocusListeners(); preButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + preAction = true; setValue(value + dierta); } }); nextButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { + nextAction = true; setValue(value - dierta); } }); @@ -374,31 +375,6 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver, initTextFiledListeners(); } - protected void initButtonFocusListeners() { - preButton.addFocusListener(new FocusAdapter() { - @Override - public void focusGained(FocusEvent e) { - preAction = true; - } - - @Override - public void focusLost(FocusEvent e) { - preAction = false; - } - }); - nextButton.addFocusListener(new FocusAdapter() { - @Override - public void focusGained(FocusEvent e) { - nextAction = true; - } - - @Override - public void focusLost(FocusEvent e) { - nextAction = false; - } - }); - } - protected void initTextFiledListeners() { textField.getDocument().removeDocumentListener(docListener); textField.getDocument().addDocumentListener(docListener); From 95b0242787f08fd65dc2e7f381670baab54ab760 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 20:23:58 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java b/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java index 0e650449de..72929d6c76 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java +++ b/designer-base/src/main/java/com/fr/design/gui/ispinner/FineUpperCaseSpinner.java @@ -24,7 +24,7 @@ import java.awt.event.MouseEvent; * * @author Renekton * @since 11.0 - * @Cteated on 2024/09/11 + * @Created on 2024/09/11 */ public class FineUpperCaseSpinner extends UISpinner { From 4b7368f7c0efa5f6a4bb62f245e541af679cd0e7 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 21:53:45 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/write/submit/SubmitVisitorListPane.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java index d930a3bfbf..ecd2b2fc8a 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -13,8 +13,6 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; -import com.fr.design.scrollruler.ModLineBorder; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; @@ -39,6 +37,7 @@ 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.cell; import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fr.design.i18n.Toolkit.i18nText; public class SubmitVisitorListPane extends ObjectJControlPane { @@ -53,12 +52,12 @@ public class SubmitVisitorListPane extends ObjectJControlPane { */ public NameableCreator[] createNameableCreators() { return new NameableCreator[]{ - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Submit_Type_Build_In_Sql"), + new NameObjectCreator(i18nText("Fine-Design_Report_Submit_Type_Build_In_Sql"), new LazyIcon("dataLink"), BuiltInSQLSubmiter.class, BuildInSQLPane.class), new NameObjectCreator( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Submit_Type_Custom"), + i18nText("Fine-Design_Report_Submit_Type_Custom"), new LazyIcon("dataLink"), WClassSubmiter.class, CustomPane.class) @@ -195,11 +194,11 @@ public class SubmitVisitorListPane extends ObjectJControlPane { JPanel typePane = new JPanel(new BorderLayout()); typePane.add(row(10, - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), + cell(new UILabel(i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), cell(csjConfigComboBox).weight(0.5), flex()).getComponent()); this.add(column( - cell(FineUIUtils.wrapComponentWithTitle(typePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))), + cell(FineUIUtils.wrapComponentWithTitle(typePane, i18nText("Fine-Design_Report_Write_Submit_Type"))), cell(customCardPane).weight(1.0)).getComponent()); csjConfigComboBox.addItemListener(new ItemListener() { From f1b50f1e8c602d869c304ab18e665eda2541e286 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 21:57:08 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/write/submit/SubmitVisitorListPane.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java index ecd2b2fc8a..1ccbbaf3ff 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -25,6 +25,7 @@ import com.fr.stable.Nameable; import com.fr.write.BuiltInSQLSubmiterProvider; import com.fr.write.DBManipulation; import com.fr.write.WClassSubmiterProvider; +import com.fr.design.i18n.Toolkit; import javax.swing.*; import java.awt.*; @@ -37,7 +38,6 @@ 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.cell; import static com.fine.swing.ui.layout.Layouts.flex; -import static com.fr.design.i18n.Toolkit.i18nText; public class SubmitVisitorListPane extends ObjectJControlPane { @@ -52,12 +52,12 @@ public class SubmitVisitorListPane extends ObjectJControlPane { */ public NameableCreator[] createNameableCreators() { return new NameableCreator[]{ - new NameObjectCreator(i18nText("Fine-Design_Report_Submit_Type_Build_In_Sql"), + new NameObjectCreator(Toolkit.i18nText("Fine-Design_Report_Submit_Type_Build_In_Sql"), new LazyIcon("dataLink"), BuiltInSQLSubmiter.class, BuildInSQLPane.class), new NameObjectCreator( - i18nText("Fine-Design_Report_Submit_Type_Custom"), + Toolkit.i18nText("Fine-Design_Report_Submit_Type_Custom"), new LazyIcon("dataLink"), WClassSubmiter.class, CustomPane.class) @@ -194,11 +194,11 @@ public class SubmitVisitorListPane extends ObjectJControlPane { JPanel typePane = new JPanel(new BorderLayout()); typePane.add(row(10, - cell(new UILabel(i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), + cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), cell(csjConfigComboBox).weight(0.5), flex()).getComponent()); this.add(column( - cell(FineUIUtils.wrapComponentWithTitle(typePane, i18nText("Fine-Design_Report_Write_Submit_Type"))), + cell(FineUIUtils.wrapComponentWithTitle(typePane, Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))), cell(customCardPane).weight(1.0)).getComponent()); csjConfigComboBox.addItemListener(new ItemListener() { From 20cebab183c3f3d22788120a99c64f7e2a735c85 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 11 Sep 2024 22:00:51 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/write/submit/CustomJobPane.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index 7229ad0b8b..ba56aa792a 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -3,7 +3,6 @@ package com.fr.design.write.submit; import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; -import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; @@ -18,7 +17,7 @@ import com.fr.design.dialog.DialogActionAdapter; import com.fr.stable.ListMap; import com.fr.stable.StringUtils; -import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.i18n.Toolkit; import javax.swing.*; import java.awt.*; @@ -28,7 +27,6 @@ import java.awt.event.ActionListener; 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; /** * Author : Shockway @@ -45,12 +43,12 @@ public abstract class CustomJobPane extends BasicBeanPane { JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(); - UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); + UIButton browserButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Select")); - UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); + UIButton editButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Edit")); UITextArea area = new UITextArea(2, 1); - area.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); + area.setText(Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); browserButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { @@ -61,7 +59,7 @@ public abstract class CustomJobPane extends BasicBeanPane { new DialogActionAdapter() { public void doOk() { classNameTextField.setText(bPane.getClassPath()); - area.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); + area.setText(Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); checkAddButtonEnable(); } }).setVisible(true); @@ -75,7 +73,7 @@ public abstract class CustomJobPane extends BasicBeanPane { new DialogActionAdapter() { public void doOk() { classNameTextField.setText(javaEditorPane.getClassText()); - area.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); + area.setText(Toolkit.i18nText("Fine-Design_Basic_Extend_Class", "com.fr.data.AbstractSubmitTask")); checkAddButtonEnable(); } }); @@ -102,9 +100,9 @@ public abstract class CustomJobPane extends BasicBeanPane { dsPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); dsPane.add(area); this.add(column(20, - cell(FineUIUtils.wrapComponentWithTitle(reportletNamePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Name"))), - cell(FineUIUtils.wrapComponentWithTitle(objectProperiesPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"))).weight(1.0), - cell(FineUIUtils.wrapComponentWithTitle(dsPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Job_Description"))) + cell(FineUIUtils.wrapComponentWithTitle(reportletNamePane, Toolkit.i18nText("Fine-Design_Basic_Class_Name"))), + cell(FineUIUtils.wrapComponentWithTitle(objectProperiesPane, Toolkit.i18nText("Fine-Design_Basic_Property"))).weight(1.0), + cell(FineUIUtils.wrapComponentWithTitle(dsPane, Toolkit.i18nText("Fine-Design_Basic_Custom_Job_Description"))) ).getComponent()); checkAddButtonEnable(); } From ce1eddb869c50da1e6f7469db31a7d3a8184b5a8 Mon Sep 17 00:00:00 2001 From: renekton Date: Thu, 12 Sep 2024 09:58:10 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=A1=8C=E5=BC=8F=E6=94=BE=E4=B8=80?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/write/submit/SubmitVisitorListPane.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java index 1ccbbaf3ff..3dcdb44c55 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SubmitVisitorListPane.java @@ -193,9 +193,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane { csjConfigComboBox = new UIComboBox(configTypes.toArray()); JPanel typePane = new JPanel(new BorderLayout()); - typePane.add(row(10, - cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), - cell(csjConfigComboBox).weight(0.5), flex()).getComponent()); + typePane.add(row(10, cell(new UILabel(Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), cell(csjConfigComboBox).weight(0.5), flex()).getComponent()); this.add(column( cell(FineUIUtils.wrapComponentWithTitle(typePane, Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))),