Browse Source

Pull request #13536: REPORT-111995 【UI翻新】控件面板布局整体翻新

Merge in DESIGN/design from ~LEVY.XIE/design:newui to newui

* commit '3c20c124644230da54a2dfd3bfa78c09fb7488dd':
  REPORT-111995 【UI翻新】控件面板布局整体翻新
newui
Levy.Xie-解安森 10 months ago
parent
commit
f655df6178
  1. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  2. 19
      designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java
  3. 10
      designer-base/src/main/java/com/fr/design/constants/LayoutConstants.java
  4. 16
      designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java
  5. 19
      designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java
  6. 38
      designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java
  7. 195
      designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java
  8. 41
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java
  9. 57
      designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  10. 51
      designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java
  11. 52
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  12. 46
      designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java
  13. 4
      designer-base/src/main/java/com/fr/design/widget/mobile/WidgetMobilePane.java
  14. 5
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  15. 20
      designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java
  16. 57
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java
  17. 50
      designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java
  18. 4
      designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java
  19. 60
      designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java
  20. 44
      designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java
  21. 71
      designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java
  22. 40
      designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java
  23. 42
      designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  24. 21
      designer-realize/src/main/java/com/fr/design/widget/ui/ComboBoxDefinePane.java
  25. 41
      designer-realize/src/main/java/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java
  26. 20
      designer-realize/src/main/java/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java
  27. 171
      designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java
  28. 36
      designer-realize/src/main/java/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  29. 77
      designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java
  30. 57
      designer-realize/src/main/java/com/fr/design/widget/ui/IframeEditorDefinePane.java
  31. 14
      designer-realize/src/main/java/com/fr/design/widget/ui/ListEditorDefinePane.java
  32. 42
      designer-realize/src/main/java/com/fr/design/widget/ui/MultiFileEditorPane.java
  33. 41
      designer-realize/src/main/java/com/fr/design/widget/ui/NumberEditorDefinePane.java
  34. 29
      designer-realize/src/main/java/com/fr/design/widget/ui/RadioGroupDefinePane.java
  35. 40
      designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  36. 41
      designer-realize/src/main/java/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java
  37. 60
      designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java
  38. 30
      designer-realize/src/main/java/com/fr/design/widget/ui/WaterMarkDictPane.java
  39. 12
      designer-realize/src/main/java/com/fr/design/widget/ui/WritableRepeatEditorPane.java
  40. 44
      designer-realize/src/main/java/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java
  41. 13
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java
  42. 52
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java
  43. 45
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java
  44. 41
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java
  45. 27
      designer-realize/src/main/java/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java
  46. 30
      designer-realize/src/main/java/com/fr/design/widget/ui/mobile/MultiFileEditorMobilePane.java
  47. 10
      designer-realize/src/main/java/com/fr/design/widget/ui/mobile/TextEditorMobilePane.java

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

@ -28,6 +28,7 @@ public interface FineUIStyle {
String BRAND_COLOR_LABEL = "brandColorLabel";
String BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel";
String LABEL_TIP = "tipLabel";
String MENU_TOOL_BAR = "menuToolBar";
String MENU_ITEM_TOOL_BAR = "menuItemToolBar";

19
designer-base/src/main/java/com/fr/design/border/FineBorderFactory.java

@ -34,4 +34,23 @@ public class FineBorderFactory {
return createUnderlineBorder(FineUIUtils.getUIColor("Label.borderColor", "defaultBorderColor"));
}
/**
* 创建一个上边缘线边框
*
* @param color 上边缘线颜色
* @return 边框
*/
public static Border createToplineBorder(Color color) {
return BorderFactory.createMatteBorder(1, 0, 0, 0, color);
}
/**
* 创建默认的上划线边框
*
* @return 边框
*/
public static Border createDefaultTopBorder() {
return createToplineBorder(FineUIUtils.getUIColor("Label.borderColor", "defaultBorderColor"));
}
}

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

@ -52,4 +52,14 @@ public class LayoutConstants {
* 主题化布局垂直间隙
*/
public static final int VERTICAL_GAP = 10;
/**
* 主题化布局常规布局左侧比例
*/
public static final double LEFT_WEIGHT = 1.2;
/**
* 主题化布局常规布局右侧比例
*/
public static final double RIGHT_WEIGHT = 3;
}

16
designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java

@ -1,10 +1,17 @@
package com.fr.design.dialog;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.MouseWheelEvent;
@ -104,7 +111,6 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
protected void layoutContentPane() {
leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 5, original));
this.add(leftcontentPane);
}
@ -176,7 +182,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height);
} else {
int hideBarWidth = hideBarWidth() ? scrollBar.getWidth() : 0;
leftcontentPane.setBounds(0, 0, width - DET_WIDTH + hideBarWidth, height);
leftcontentPane.setBounds(0, 0, width + hideBarWidth, height);
}
}
@ -205,7 +211,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
this.setLayout(new BarLayout());
this.add(scrollBar);
leftcontentPane = pane;
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 5, original));
leftcontentPane.setBorder(new ScaledEmptyBorder(0, 6, 0, 6));
this.add(leftcontentPane);
}
}

19
designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java

@ -1,6 +1,5 @@
package com.fr.design.gui.columnrow;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ispinner.ColumnRowSpinner;
@ -15,8 +14,8 @@ import com.fr.stable.StringUtils;
import javax.swing.JFormattedTextField;
import javax.swing.JPanel;
import javax.swing.JSpinner.DefaultEditor;
import javax.swing.SpinnerListModel;
import javax.swing.JSpinner.DefaultEditor;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
@ -27,7 +26,10 @@ import javax.swing.text.BadLocationException;
import javax.swing.text.DocumentFilter;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
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;
/**
* the component to edit ColumnRow
@ -96,11 +98,16 @@ public class ColumnRowPane extends JPanel implements UIObserver {
* 初始化元素
*/
public void initComponents() {
this.setLayout(new GridLayout(0, 2, IntervalConstants.INTERVAL_L6, 0));
this.setLayout(new BorderLayout());
initColSpinner();
this.add(columnSpinner, BorderLayout.WEST);
initRowSpinner();
this.add(rowSpinner);
this.add(
row(
cell(columnSpinner).weight(1),
fix(2),
cell(rowSpinner).weight(1)
).getComponent()
);
this.addDocumentListener(d);
}

38
designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java

@ -3,23 +3,19 @@ package com.fr.design.gui.frpane;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.NoneReg;
import com.fr.form.ui.reg.RegExp;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* Created by kerry on 2017/9/4.
@ -37,22 +33,17 @@ public class RegFieldPane extends RegPane {
}
public void initComponents() {
this.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0));
regErrorMsgPane = new RegErrorMsgPane();
final RegChangeListener regChangeListener = new RegChangeListener() {
@Override
public void regChangeAction() {
RegExp regExp = (RegExp) getRegComboBox().getSelectedItem();
if (regExp instanceof NoneReg) {
regErrorMsgPane.setVisible(false);
return;
}
regErrorMsgPane.setVisible(true);
final RegChangeListener regChangeListener = () -> {
RegExp regExp = (RegExp) getRegComboBox().getSelectedItem();
if (regExp instanceof NoneReg) {
regErrorMsgPane.setVisible(false);
return;
}
regErrorMsgPane.setVisible(true);
};
corePane.add(regErrorMsgPane);
this.addRegChangeListener(regChangeListener);
this.add(regErrorMsgPane, BorderLayout.CENTER);
}
@Override
@ -80,11 +71,10 @@ public class RegFieldPane extends RegPane {
private void setStyle() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"));
tipLabel.setPreferredSize(new Dimension(60, 20));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tipLabel, errorMsgTextFieldAdapter.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM);
this.add(panel);
this.add(row(
cell(tipLabel).weight(LEFT_WEIGHT), cell(errorMsgTextFieldAdapter.getErrorMsgTextField()).weight(RIGHT_WEIGHT)
).getComponent());
}
private void initRegErrorMsgField() {

195
designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java

@ -1,16 +1,14 @@
package com.fr.design.gui.frpane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
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.form.ui.reg.*;
import com.fr.general.ComparatorUtils;
@ -18,13 +16,14 @@ import com.fr.stable.StringUtils;
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.util.EventListener;
import java.util.EventObject;
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;
public class RegPane extends BasicPane {
public static final RegExp[] ALL_REG_TYPE = {
new NoneReg(),
@ -54,7 +53,7 @@ public class RegPane extends BasicPane {
private RegPhonePane regPhonePane;
private DefaultRegPane defaultRegPane;
private CustomRegRexPane customRegRexPane;
protected JPanel corePane;
public UIComboBox getRegComboBox(){
return regComboBox;
@ -71,49 +70,51 @@ public class RegPane extends BasicPane {
private void initComponents(){
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
corePane = column(LayoutConstants.VERTICAL_GAP).getComponent();
this.add(corePane);
regComboBox = new UIComboBox(regType);
regComboBox.setRenderer(listCellRender);
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Input_Rule")), regComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(contentPane, BorderLayout.NORTH);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
detailedCardLayout = new CardLayout();
cardPane.setLayout(detailedCardLayout);
cardPane.add((defaultRegPane = new DefaultRegPane()), "Default");
cardPane.add((regLengthPane = new RegLengthPane()), "Length");
cardPane.add((regPhonePane = new RegPhonePane()), "Phone");
cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom");
centerPane.add(cardPane, BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER);
this.add(jPanel, BorderLayout.NORTH);
regComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp)regComboBox.getSelectedItem();
if(regExp instanceof PhoneReg) {
cardPane.setPreferredSize(new Dimension(220, 30));
Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem();
String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString();
firePhoneRegAction(regString);
detailedCardLayout.show(cardPane, "Phone");
JPanel comboPane = row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Input_Rule"))).weight(1.2),
cell(regComboBox).weight(3)
).getComponent();
defaultRegPane = new DefaultRegPane();
regLengthPane = new RegLengthPane();
regPhonePane = new RegPhonePane();
customRegRexPane = new CustomRegRexPane();
final ReactiveCardPane cardPane = ReactiveCardPane.create()
.addSupplier("Length", () -> regLengthPane)
.addSupplier("Phone", () -> regPhonePane)
.addSupplier("Custom", () -> customRegRexPane);
cardPane.setVisible(false);
corePane.add(comboPane);
corePane.add(cardPane);
initComboListener(cardPane);
}
private void initComboListener(ReactiveCardPane cardPane) {
regComboBox.addActionListener(e -> {
RegExp regExp = (RegExp)regComboBox.getSelectedItem();
if(regExp instanceof PhoneReg) {
Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem();
String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString();
firePhoneRegAction(regString);
cardPane.select("Phone").populate();
} else {
if (regExp instanceof LengthReg){
cardPane.select("Length").populate();
} else if (regExp instanceof CustomReg){
cardPane.select("Custom").populate();
} else {
if (regExp instanceof LengthReg){
cardPane.setPreferredSize(new Dimension(220, 60));
detailedCardLayout.show(cardPane, "Length");
} else if (regExp instanceof CustomReg){
cardPane.setPreferredSize(new Dimension(220, 30));
detailedCardLayout.show(cardPane, "Custom");
} else {
cardPane.setPreferredSize(new Dimension(0,0 ));
detailedCardLayout.show(cardPane, "Default");
}
cardPane.setVisible(false);
}
fireRegChangeAction();
}
fireRegChangeAction();
});
}
@ -174,16 +175,24 @@ public class RegPane extends BasicPane {
public abstract void populate(RegExp regRex);
public abstract RegExp update();
public DisplayPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(createContentPane(), BorderLayout.CENTER);
}
protected JPanel createContentPane() {
return new JPanel();
}
}
private static class DefaultRegPane extends DisplayPane {
public RegExp regRex;
public DefaultRegPane(){
this.setVisible(false);
}
@Override
protected String title4PopupWindow() {
return "Default";
@ -328,38 +337,40 @@ public class RegPane extends BasicPane {
private static final String EMB_REG3 = "025 85679591";
private static final int LIMIT_LENGTH = 20;
private static final String REG_PATTERN = "0123456789-*# ";
private static final int CUSTOM_OPTION_INDEX = 3;
private UIComboBox dataTypeComboBox;
private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")};
DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType);
public RegPhonePane() {
this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel);
private DefaultComboBoxModel defaultComboBoxModel;
@Override
protected JPanel createContentPane() {
String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")};
defaultComboBoxModel = new DefaultComboBoxModel(dataType);
dataTypeComboBox = new UIComboBox(defaultComboBoxModel);
JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent());
UILabel dataTypeLable = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Data_Type"));
dataTypeLable.setPreferredSize(new Dimension(60, 20));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{dataTypeLable, dataTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, 0);
this.add(panel);
UILabel dataTypeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Data_Type"));
editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN));
dataTypeComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED) {
if(ComparatorUtils.equals(e.getItem(), dataType[3])) {
dataTypeComboBox.setSelectedItem(null);
dataTypeComboBox.setEditable(true);
firePhoneRegAction(EMB_REG1);
} else {
dataTypeComboBox.setEditable(false);
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString());
}
dataTypeComboBox.addItemListener(e -> {
if(e.getStateChange() == ItemEvent.SELECTED) {
if(ComparatorUtils.equals(e.getItem(), dataType[CUSTOM_OPTION_INDEX])) {
dataTypeComboBox.setSelectedItem(null);
dataTypeComboBox.setEditable(true);
firePhoneRegAction(EMB_REG1);
} else {
dataTypeComboBox.setEditable(false);
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString());
}
}
});
dataTypeComboBox.setSelectedIndex(0);
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString());
return row(
cell(dataTypeLabel).weight(1.2), cell(dataTypeComboBox).weight(3)
).getComponent();
}
@Override
protected String title4PopupWindow() {
return "PHONE";
@ -372,7 +383,7 @@ public class RegPane extends BasicPane {
}
String regstr = ((PhoneReg)regRex).getRegString();
if (checkEmbedded(regstr)){
DefaultComboBoxModel.addElement(regstr);
defaultComboBoxModel.addElement(regstr);
}
dataTypeComboBox.setSelectedItem(((PhoneReg)regRex).getRegString());
}
@ -394,34 +405,21 @@ public class RegPane extends BasicPane {
private static class RegLengthPane extends DisplayPane {
private UISpinner minLenSpinner;
private UISpinner maxLenSpinner;
private final int DEFAULT_WIDTH = 60;
public RegLengthPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
this.setPreferredSize(new Dimension(210, 56));
@Override
protected JPanel createContentPane() {
minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
UILabel minLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reg_Min_Length"));
UILabel maxLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reg_Max_Length"));
int minLabelWidth = Math.max(minLabel.getPreferredSize().width, DEFAULT_WIDTH);
int maxLabelWidth = Math.max(maxLabel.getPreferredSize().width, DEFAULT_WIDTH);
minLabel.setPreferredSize(new Dimension(minLabelWidth, 20));
maxLabel.setPreferredSize(new Dimension(maxLabelWidth, 20));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{minLabel, minLenSpinner },
new Component[]{maxLabel, maxLenSpinner},
};
double[] rowSize = {p, p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1},{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, LayoutConstants.VGAP_MEDIUM);
this.add(panel);
return column(LayoutConstants.VERTICAL_GAP,
row(
cell(minLabel).weight(1.2), cell(minLenSpinner).weight(3)
),
row(
cell(maxLabel).weight(1.2), cell(maxLenSpinner).weight(3)
)
).getComponent();
}
@Override
@ -453,15 +451,16 @@ public class RegPane extends BasicPane {
}
}
private static class CustomRegRexPane extends DisplayPane{
private static class CustomRegRexPane extends DisplayPane {
private UITextField regTextField;
public CustomRegRexPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
@Override
protected JPanel createContentPane() {
regTextField = new UITextField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reg_Expressions")), regTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM);
this.add(panel);
return row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reg_Expressions"))).weight(1.2),
cell(regTextField).weight(3)
).getComponent();
}
@Override

41
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java

@ -1,6 +1,7 @@
package com.fr.design.gui.itree.refreshabletree;
import com.fr.data.impl.TreeAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
@ -8,11 +9,15 @@ import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class TreeRootPane extends BasicPane {
@ -30,38 +35,20 @@ public class TreeRootPane extends BasicPane {
private final UICheckBox returnFullPathCheckBox;
public TreeRootPane() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JPanel checkTypePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setLayout(new BorderLayout());
checkTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Mutiple_Selection_Or_Not"));
checkTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkTypePane.add(checkTypeCheckBox);
this.add(checkTypePane);
JPanel loadTypePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async"));
loadTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypePane.add(loadTypeCheckBox);
this.add(loadTypePane);
JPanel leafSelectPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
leafSelectPane.add(layerTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Select_Leaf_Only")));
layerTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.add(leafSelectPane);
layerTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Select_Leaf_Only"));
returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path"));
JPanel returnFullPathPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0();
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path")));
returnFullPathCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
addCheckBoxListener();
this.add(returnFullPathPane);
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(checkTypeCheckBox),
cell(loadTypeCheckBox),
cell(layerTypeCheckBox),
cell(returnFullPathCheckBox)
).getComponent());
}

57
designer-base/src/main/java/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -4,19 +4,22 @@ import java.awt.*;
import javax.swing.*;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleIconEditor;
import com.fr.form.ui.Button;
import com.fr.stable.StableUtils;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* Created by IntelliJ IDEA.
* Author : Richer
@ -34,32 +37,38 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
}
private void initComponents() {
this.setLayout(new BorderLayout(7, 7));
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p, p, p};
double columnSize[] = {p, f};
JPanel labelPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
this.setLayout(new BorderLayout());
JPanel advancePane = column(VERTICAL_GAP).getComponent();
iconPane = new AccessibleIconEditor();
labelPane.add(iconPane);
Component comp = createCenterPane();
Component[][] n_components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createCustomButtonTypeComboBox()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField = new UITextField()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Icon")), iconPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField = new UITextField()},
};
buttonNameTextField = new UITextField();
hotkeysTextField = new UITextField();
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel, BorderLayout.NORTH);
Component comp = createCenterPane();
advancePane.add(column(VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type"))).weight(LEFT_WEIGHT),
cell(createCustomButtonTypeComboBox()).weight(RIGHT_WEIGHT)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name"))).weight(LEFT_WEIGHT),
cell(buttonNameTextField).weight(RIGHT_WEIGHT)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Button_Icon"))).weight(LEFT_WEIGHT),
cell(iconPane).weight(RIGHT_WEIGHT)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys"))).weight(LEFT_WEIGHT),
cell(hotkeysTextField).weight(RIGHT_WEIGHT)
)
).getComponent());
if(comp != null ) {
advancePane.add(comp,BorderLayout.CENTER);
advancePane.add(comp);
}
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Advanced"), 280, 20, advancePane);
this.add(uiExpandablePane);
}
protected abstract Component createCenterPane();

51
designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.component;
import com.fine.swing.ui.layout.Column;
import com.fr.base.BaseFormula;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.DateEditor;
@ -7,55 +8,65 @@ import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.editor.editor.NoneEditor;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
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 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;
/**
* Created by ibm on 2017/8/8.
* 日期设置面板
*
* @author ibm
* @since 10.0
* Created on 2017/08/08
*/
public class DateValuePane extends JPanel {
public class DateValuePane extends Column {
private UIButtonGroup widgetValueHead;
private Editor[] editor;
private static final String NONE_EDITOR_NAME = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None");
private static final String DATE_EDITOR_NAME = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date");
private static final String FORMULA_EDITOR_NAME = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Parameter_Formula");
public DateValuePane() {
this(StringUtils.EMPTY);
}
public DateValuePane(String title) {
setSpacing(LayoutConstants.VERTICAL_GAP);
UILabel titleLabel = new UILabel(title);
editor = new Editor[]{
new NoneEditor(null, NONE_EDITOR_NAME),
new DateEditor(true, DATE_EDITOR_NAME),
new FormulaEditor(FORMULA_EDITOR_NAME)
};
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL));
final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout);
final JPanel customRow = row(flex(1.2), cell(customPane).weight(3)).getComponent();
final String[] tabTitles = new String[editor.length];
for (int i = 0; i < editor.length; i++) {
customPane.add(editor[i], editor[i].getName());
tabTitles[i] = editor[i].getName();
}
widgetValueHead = new UIButtonGroup(tabTitles);
widgetValueHead.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int index = widgetValueHead.getSelectedIndex();
if (ComparatorUtils.equals(tabTitles[index], com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"))) {
customPane.setVisible(false);
} else {
customPane.setVisible(true);
}
cardLayout.show(customPane, tabTitles[index]);
}
widgetValueHead.addChangeListener(e -> {
int index = widgetValueHead.getSelectedIndex();
customRow.setVisible(!ComparatorUtils.equals(tabTitles[index],
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None")));
cardLayout.show(customPane, tabTitles[index]);
});
this.add(widgetValueHead, BorderLayout.NORTH);
this.add(customPane, BorderLayout.CENTER);
this.add(
row(
cell(titleLabel).weight(1.2), cell(widgetValueHead).weight(3)
),
cell(customRow)
);
}

52
designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -3,30 +3,31 @@ package com.fr.design.widget.component;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.icheckbox.UICheckBox;
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.form.ui.NumberEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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;
/**
* Created by kerry on 2017/9/10.
*/
@ -63,45 +64,40 @@ public class NumberEditorValidatePane extends JPanel {
private void initComponent() {
initListeners();
this.allowDecimalsCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Allow_Decimals"));
allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener);
this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16);
this.allowNegativeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Allow_Negative"));
this.allowNegativeCheckBox.addActionListener(allowNegativeListener);
allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMaxValueCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Need_Max_Value"), false);
setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.maxValueSpinner = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1D, 0D);
this.setMaxValueCheckBox.addActionListener(setMaxListener);
this.maxValueSpinner.addChangeListener(maxValueChangeListener);
this.setMinValueCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Need_Min_Value"), false);
this.minValueSpinner = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1D, 0D);
minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
initErrorMsgPane();
JPanel errorMsgBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
errorMsgBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L1, 0));
errorMsgBorderPane.add(errorMsgTextFieldPane, BorderLayout.CENTER);
UILabel numberLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Decimal_Digits"));
limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
limitNumberPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{allowDecimalsCheckBox, null},
new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{setMinValueCheckBox, minValueSpinner},
new Component[]{errorMsgBorderPane, 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}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
this.add(panel);
limitNumberPane = row(
cell(numberLabel).weight(1.2),
cell(decimalLength).weight(3)
).getComponent();
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(allowDecimalsCheckBox),
cell(limitNumberPane),
cell(allowNegativeCheckBox),
row(
cell(setMaxValueCheckBox).weight(1), cell(maxValueSpinner).weight(1.5)
),
row(
cell(setMinValueCheckBox).weight(1), cell(minValueSpinner).weight(1.5)
),
cell(errorMsgBorderPane)
).getComponent());
}
private void initErrorMsgPane() {
@ -128,10 +124,8 @@ public class NumberEditorValidatePane extends JPanel {
public void actionPerformed(ActionEvent e) {
if (allowDecimalsCheckBox.isSelected()) {
limitNumberPane.setVisible(true);
limitNumberPane.setPreferredSize(new Dimension(215, 20));
} else {
limitNumberPane.setVisible(false);
limitNumberPane.setPreferredSize(new Dimension(0, 0));
}
}
};

46
designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java

@ -1,18 +1,18 @@
package com.fr.design.widget.component;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.ReturnTypeProvider;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
public class ReturnTypePane extends JPanel {
@ -31,22 +31,32 @@ public class ReturnTypePane extends JPanel {
startComboBox.setEditable(true);
endComboBox = new DictionaryComboBox(DictionaryConstants.symbols, DictionaryConstants.symbolDisplays);
endComboBox.setEditable(true);
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delimiter")), delimiterComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_Start_Symbol")), startComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_End_Symbol")), endComboBox}
};
returnStringPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
returnStringPane = column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delimiter"))).weight(1.2),
cell(delimiterComboBox).weight(3)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_Start_Symbol"))).weight(1.2),
cell(startComboBox).weight(3)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Combo_CheckBox_End_Symbol"))).weight(1.2),
cell(endComboBox).weight(3)
)
).getComponent();
returnTypeComboBox = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Array"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")});
returnTypeComboBox.addActionListener(e -> checkVisible(returnTypeComboBox.getSelectedIndex()));
JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(headPane, BorderLayout.NORTH);
jPanel.add(returnStringPane, BorderLayout.CENTER);
returnStringPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));
this.add(jPanel);
this.add(column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type"))).weight(1.2),
cell(returnTypeComboBox).weight(3)
),
cell(returnStringPane)
).getComponent());
}
public void setReturnType(ReturnType returnType) {

4
designer-base/src/main/java/com/fr/design/widget/mobile/WidgetMobilePane.java

@ -4,8 +4,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.Widget;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
@ -17,7 +15,7 @@ public class WidgetMobilePane extends JPanel {
public static WidgetMobilePane DEFAULT_PANE = new WidgetMobilePane();
public WidgetMobilePane() {
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
this.setBorder(null);
init();
}

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

@ -1299,4 +1299,7 @@ CellOtherSetPane.height=$Component.defaultHeight
toolbar.pressedBackground: null
[style]Label.boldLabel = \
font: bold $defaultFont
font: bold $defaultFont
[style]Label.tipLabel = \
foreground: $Label.tipColor

20
designer-form/src/main/java/com/fr/design/widget/ui/btn/AbstractExtraButtonPane.java

@ -1,7 +1,9 @@
package com.fr.design.widget.ui.btn;
import com.fine.swing.ui.layout.Column;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.icombobox.DictionaryComboBox;
@ -21,6 +23,8 @@ import javax.swing.JPanel;
import java.awt.Component;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/**
@ -116,14 +120,14 @@ public abstract class AbstractExtraButtonPane<T extends Button> extends ButtonWi
*/
protected Component createExtraPane(@Nullable BasicPane pane) {
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{pane, null},
new Component[]{extraPane, null}
};
double[] rowSize = {P, P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1},{1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
Column column = column(VERTICAL_GAP).getComponent();
if (pane != null) {
column.add(pane);
}
if (extraPane != null) {
column.add(extraPane);
}
return column;
}
}

57
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTextFieldInputSettingPane.java

@ -8,15 +8,15 @@ 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.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
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 hades
@ -47,23 +47,23 @@ public class MobileTextFieldInputSettingPane extends BasicBeanPane<MobileScanCod
initComponents();
// 初始状态,内容类型面板不可见
nfcContentTypePane.setVisible(false);
nfcContentTypePane.setPreferredSize(new Dimension(0, 0));
}
private void initComponents() {
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Input_Way")), manualInputCheckBox},
new Component[]{null, scanCodeCheckBox},
new Component[]{null, nfcInputCheckBox},
new Component[]{null, nfcContentTypePane},
};
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel settingPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.HGAP_LARGE, LayoutConstants.VGAP_LARGE);
this.add(settingPane, BorderLayout.NORTH);
JPanel settingPane = column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Mobile_Input_Way"))).weight(1),
cell(manualInputCheckBox).weight(2)
),
row(
flex(1), cell(scanCodeCheckBox).weight(2)
),
row(
flex(1), cell(nfcInputCheckBox).weight(2)
),
cell(nfcContentTypePane)
).getComponent();
this.add(settingPane);
}
@Override
@ -95,11 +95,6 @@ public class MobileTextFieldInputSettingPane extends BasicBeanPane<MobileScanCod
* @param contentType 内容类型
*/
private void updateNfcContentTypePane(boolean visible, MobileScanCodeAttr.NFCContentType contentType) {
if (visible) {
nfcContentTypePane.setPreferredSize(new Dimension(400, 60));
} else {
nfcContentTypePane.setPreferredSize(new Dimension(0, 0));
}
nfcContentTypePane.setVisible(visible);
nfcContentTypePane.setSelectedType(contentType);
}
@ -125,9 +120,7 @@ public class MobileTextFieldInputSettingPane extends BasicBeanPane<MobileScanCod
private UIRadioButton uidTypeButton;
NfcContentTypePane() {
VerticalFlowLayout layout = new VerticalFlowLayout();
layout.setAlignLeft(true);
this.setLayout(layout);
this.setLayout(new BorderLayout());
contentTypeButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_NFC_Content_Type_Content"));
uidTypeButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Mobile_NFC_Content_Type_UID"));
@ -138,8 +131,14 @@ public class MobileTextFieldInputSettingPane extends BasicBeanPane<MobileScanCod
buttonGroup.add(contentTypeButton);
buttonGroup.add(uidTypeButton);
this.add(contentTypeButton);
this.add(uidTypeButton);
this.add(column(LayoutConstants.VERTICAL_GAP,
row(
flex(1), cell(contentTypeButton).weight(2)
),
row(
flex(1), cell(uidTypeButton).weight(2)
)
).getComponent());
}
/**

50
designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java

@ -1,6 +1,7 @@
package com.fr.design.widget;
import com.fr.design.constants.UIConstants;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.dialog.AttrScrollPane;
import com.fr.design.dialog.BasicPane;
@ -14,12 +15,16 @@ import com.fr.design.widget.ui.BasicWidgetPropertySettingPane;
import com.fr.form.event.Listener;
import com.fr.form.ui.Widget;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
/*
* carl :单独弄出来
*/
@ -62,7 +67,23 @@ public class CellWidgetCardPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new CardLayout();
center = new JPanel(tabbedPane);
this.add(center, BorderLayout.CENTER);
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
tabbedPane.show(center, tabTitles[index]);
}
};
this.add(column(
row(
fix(10),
cell(tabsHeaderIconPane).weight(1),
fix(10)
),
cell(center).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)))
).getComponent());
// 属性
attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -73,16 +94,19 @@ public class CellWidgetCardPane extends BasicPane {
}
};
widgetPropertyPane = new BasicWidgetPropertySettingPane();
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), 280, 24, widgetPropertyPane);
attriTabPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
attriTabPane.add(uiExpandablePane, BorderLayout.NORTH);
UIExpandablePane basicPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), 280, 24, widgetPropertyPane);
attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
attriTabPane.add(attriCardPane, BorderLayout.CENTER);
attriCardLayout = (CardLayout) attriCardPane.getLayout();
attriTabPane.add(column(
cell(basicPane),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())),
cell(attriCardPane)
).getComponent()
);
// 事件
eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
eventPane = initWidgetEventPane(pane);
eventTabPane.add(eventPane, BorderLayout.CENTER);
@ -97,16 +121,6 @@ public class CellWidgetCardPane extends BasicPane {
center.add(mobileTabPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal"));
initPaneList();
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")};
tabsHeaderIconPane = new UIHeadGroup(tabTitles) {
@Override
public void tabChanged(int index) {
tabbedPane.show(center, tabTitles[index]);
}
};
tabsHeaderIconPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.SHADOW_GREY));
this.add(tabsHeaderIconPane, BorderLayout.NORTH);
}
private void initPaneList() {

4
designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java

@ -1,6 +1,7 @@
package com.fr.design.widget;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListGroupControlPane;
@ -23,7 +24,6 @@ import com.fr.stable.AssistUtils;
import com.fr.stable.Nameable;
import com.fr.write.JavaScriptResourceInfo;
import javax.swing.BorderFactory;
import java.lang.reflect.Constructor;
public class WidgetEventPane extends UIListGroupControlPane {
@ -40,7 +40,7 @@ public class WidgetEventPane extends UIListGroupControlPane {
if (pane != null) {
selection = pane.getSelection();
}
setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0));
setBorder(new ScaledEmptyBorder(10, 0, 10, 0));
}
@Override

60
designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java

@ -1,5 +1,6 @@
package com.fr.design.widget;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.WidgetDesignHandler;
import com.fr.design.gui.core.WidgetOption;
@ -9,27 +10,36 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
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.CellWidgetPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.widget.btn.ButtonConstants;
import com.fr.form.ui.Button;
import com.fr.form.ui.*;
import com.fr.form.ui.NameWidget;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetConfig;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import javax.swing.*;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.*;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Vector;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* CellEditorDef Pane.
*/
@ -38,7 +48,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
private EditorTypeComboBox editorTypeComboBox;
private CellWidgetCardPane cellEditorCardPane;
private boolean shouldFireSelectedEvent = true;
private JPanel northPane;
private JComponent northPane;
public WidgetPane() {
this(null);
@ -58,36 +68,32 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
protected void initComponents(ElementCasePane pane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
editorTypeComboBox = new EditorTypeComboBox(pane != null);
editorTypeComboBox.setPreferredSize(new Dimension(155, 30));
editorTypeComboBox.setMaximumRowCount(16);
northPane = initNorthPane();
northPane.setBorder(BorderFactory.createEmptyBorder(12, 10, 10, 15));
this.add(northPane, BorderLayout.NORTH);
northPane.setBorder(new ScaledEmptyBorder(10, 10, 0, 10));
editorTypeComboBox.addItemListener(this);
cellEditorCardPane = initWidgetCardPane(pane);
this.add(cellEditorCardPane, BorderLayout.CENTER);
this.addAttributeChangeListener(listener);
this.add(column(
10,
cell(northPane),
cell(cellEditorCardPane)
).getComponent()
);
}
public JPanel initNorthPane() {
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Widget")), emptyLabel, editorTypeComboBox},
};
JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return jPanel;
return column(
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Widget"))).weight(LEFT_WEIGHT),
cell(editorTypeComboBox).weight(RIGHT_WEIGHT)
)
).getComponent();
}
protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) {

44
designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java

@ -1,21 +1,22 @@
package com.fr.design.widget.ui;
import com.fr.design.designer.IntervalConstants;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.dialog.BasicPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class BasicWidgetPropertySettingPane extends BasicPane {
@ -26,27 +27,20 @@ public class BasicWidgetPropertySettingPane extends BasicPane {
public BasicWidgetPropertySettingPane() {
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
enableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Enabled"), true);
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
visibleCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Form_Widget_Visible"), true);
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
widgetNameComboBox = new ParameterTreeComboBox();
widgetNameComboBox.refreshTree();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Name")), widgetNameComboBox},
new Component[]{enableCheckBox, null},
new Component[]{visibleCheckBox, null},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
pane.setBorder(BorderFactory.createEmptyBorder(10,0,10,0));
this.add(pane, BorderLayout.CENTER);
this.add(column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Name"))).weight(LEFT_WEIGHT),
cell(widgetNameComboBox).weight(RIGHT_WEIGHT)
),
cell(enableCheckBox),
cell(visibleCheckBox)
).getComponent());
}
@Override

71
designer-realize/src/main/java/com/fr/design/widget/ui/ButtonGroupDictPane.java

@ -1,26 +1,27 @@
package com.fr.design.widget.ui;
import java.awt.*;
import java.awt.event.ActionEvent;
import com.fr.data.Dictionary;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import java.awt.event.ActionListener;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.ButtonGroup;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class ButtonGroupDictPane extends JPanel {
@ -28,6 +29,7 @@ public class ButtonGroupDictPane extends JPanel {
private UICheckBox adaptiveCheckbox;
private UILabel columnLabel;
private AccessibleDictionaryEditor dictPane;
private ReactiveCardPane reactiveCardPane;
public ButtonGroupDictPane() {
@ -45,36 +47,45 @@ public class ButtonGroupDictPane extends JPanel {
adaptiveCheckbox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
columnLabel.setVisible(!adaptiveCheckbox.isSelected());
boolean selected = adaptiveCheckbox.isSelected();
if (selected) {
reactiveCardPane.select("adaptive").populate();
} else {
reactiveCardPane.select("inadaptive").populate();
}
}
});
UILabel dictLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary"));
this.columnLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Group_Display_Columns") + ":", dictLabel.getPreferredSize().width);
columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
Component[][] components = {
new Component[] {dictLabel, dictPane},
new Component[] {adaptiveCheckbox, null},
new Component[] {columnLabel, columnSpinner}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel);
reactiveCardPane = ReactiveCardPane.create()
.addSupplier("adaptive", () -> column(
10,
row(cell(dictLabel).weight(LEFT_WEIGHT), cell(dictPane).weight(RIGHT_WEIGHT)),
row(cell(adaptiveCheckbox)),
row(cell(columnLabel).weight(LEFT_WEIGHT), cell(columnSpinner).weight(RIGHT_WEIGHT))
).getComponent()
).addSupplier("inadaptive", () -> column(
10,
row(cell(dictLabel).weight(LEFT_WEIGHT), cell(dictPane).weight(RIGHT_WEIGHT)),
row(cell(adaptiveCheckbox))
).getComponent());
reactiveCardPane.select("inadaptive").populate();
this.add(reactiveCardPane);
}
public void populate(ButtonGroup buttonGroup) {
dictPane.setValue(buttonGroup.getDictionary());
adaptiveCheckbox.setSelected(buttonGroup.isAdaptive());
columnSpinner.setVisible(!adaptiveCheckbox.isSelected());
columnLabel.setVisible(!adaptiveCheckbox.isSelected());
boolean selected = adaptiveCheckbox.isSelected();
if (selected) {
reactiveCardPane.select("adaptive").populate();
} else {
reactiveCardPane.select("inadaptive").populate();
}
columnSpinner.setValue(buttonGroup.getColumnsInRow());
}

40
designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -2,26 +2,28 @@ package com.fr.design.widget.ui;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeCreatorPaneAdder;
import com.fr.form.ui.CheckBox;
import com.fr.general.GeneralContext;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.collections.CollectionUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.Component;
import java.awt.BorderLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* 复选框pane
@ -46,18 +48,28 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UITextField();
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text")), text},
new Component[]{extraPane, null},
};
double[] rowSize = {P,P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 24, pane);
pane.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 0));
JPanel content = new JPanel(new BorderLayout());
if (extraPane == null) {
content.add(
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"))).weight(LEFT_WEIGHT),
cell(text).weight(RIGHT_WEIGHT)
).getComponent()
);
} else {
content.add(
column(
10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"))).weight(LEFT_WEIGHT),
cell(text)).weight(RIGHT_WEIGHT),
row(cell(extraPane))
).getComponent()
);
}
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 24, content);
this.add(uiExpandablePane);
}

42
designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -1,25 +1,16 @@
package com.fr.design.widget.ui;
import java.awt.*;
import java.util.Set;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.icheckbox.UICheckBox;
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.widget.component.ReturnTypePane;
import com.fr.form.ui.CheckBoxGroup;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup> {
private ReturnTypePane returnTypePane;
@ -44,27 +35,18 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override
protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Provide_Choose_All"));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
buttonGroupDictPane = new ButtonGroupDictPane();
returnTypePane = new ReturnTypePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{buttonGroupDictPane, null },
new Component[]{checkbox, null },
new Component[]{returnTypePane, null },
new Component[]{extraPane, null}
};
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
advancePane.add(panel);
return advancePane;
return column(LayoutConstants.VERTICAL_GAP,
cell(buttonGroupDictPane),
cell(checkbox),
cell(returnTypePane),
cell(extraPane)
).getComponent();
}

21
designer-realize/src/main/java/com/fr/design/widget/ui/ComboBoxDefinePane.java

@ -3,20 +3,15 @@ package com.fr.design.widget.ui;
import javax.swing.*;
import com.fr.data.Dictionary;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.form.ui.ComboBox;
import java.awt.*;
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.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox> {
protected AccessibleDictionaryEditor dictPane;
@ -32,10 +27,10 @@ public class ComboBoxDefinePane extends CustomWritableRepeatEditorPane<ComboBox>
protected JPanel setForthContentPane () {
dictPane = new AccessibleDictionaryEditor();
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return jPanel;
return row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary"))).weight(LEFT_WEIGHT),
cell(dictPane).weight(RIGHT_WEIGHT)
).getComponent();
}
@Override

41
designer-realize/src/main/java/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java

@ -1,24 +1,22 @@
package com.fr.design.widget.ui;
import com.fr.data.Dictionary;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.icheckbox.UICheckBox;
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.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.ComboCheckBox;
import javax.swing.*;
import java.awt.*;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> {
private ReturnTypePane returnTypePane;
@ -34,23 +32,14 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
dictPane = new AccessibleDictionaryEditor();
returnTypePane = new ReturnTypePane();
supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true);
supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane },
new Component[]{returnTypePane, null },
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
advancePane.add(panel);
return advancePane;
return column(LayoutConstants.VERTICAL_GAP,
cell(supportTagCheckBox),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary"))).weight(LEFT_WEIGHT),
cell(dictPane).weight(RIGHT_WEIGHT)
),
cell(returnTypePane)
).getComponent();
}
@Override

20
designer-realize/src/main/java/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java

@ -1,14 +1,9 @@
package com.fr.design.widget.ui;
import com.fr.base.GraphHelper;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.CustomWriteAbleRepeatEditor;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
/**
* Author : Shockway
@ -18,8 +13,6 @@ import java.awt.*;
public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> {
private UICheckBox customDataCheckBox;
private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Custom_Data")) + 30;
private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30;
public CustomWritableRepeatEditorPane() {
this.initComponents();
@ -27,21 +20,14 @@ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRe
@Override
protected JPanel setThirdContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.customDataCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Custom_Data"), false);
this.customDataCheckBox.setPreferredSize(
new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT));
this.customDataCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel otherContentPane = this.setForthContentPane();
return otherContentPane;
return this.setForthContentPane();
}
public JPanel setValidatePane(){
JPanel otherContentPane = super.setValidatePane();
JPanel jPanel = GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 0);
otherContentPane.add(jPanel, BorderLayout.CENTER);
otherContentPane.add(customDataCheckBox);
return otherContentPane;
}

171
designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -1,19 +1,15 @@
package com.fr.design.widget.ui;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.FRContext;
import com.fr.data.core.FormatField;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.constants.LayoutConstants;
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.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.DateValuePane;
import com.fr.design.widget.component.UIComboBoxNoArrow;
import com.fr.design.widget.ui.designer.date.DateFormatCheckManager;
@ -22,28 +18,31 @@ import com.fr.form.ui.DateEditor;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIButtonGroup returnTypeComboBox;
private UIButtonGroup returnTypeButtonGroup;
private DateValuePane startDv;
private DateValuePane endDv;
private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel;
private UIButtonGroup fomatHeadGroup;
private static final int SAMPLE_LABEL_PADDING = 4;
private UILabel currentSampleLabel;
private UIButtonGroup formatButtonGroup;
public DateEditorDefinePane() {
}
@ -55,33 +54,22 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override
protected JPanel setSecondContentPane() {
returnTypeComboBox = new UIButtonGroup<>(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") , com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")});
returnTypeButtonGroup = new UIButtonGroup<>(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") ,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")});
JPanel formatHead = createFormatHead();
startDv = new DateValuePane();
endDv = new DateValuePane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format"));
formatLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel startDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_Start_Date"));
startDateLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel endDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date"));
endDateLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{
new Component[]{formatLabel, formatHead},
new Component[]{startDateLabel, startDv},
new Component[]{endDateLabel, endDv},
new Component[]{waterMarkDictPane, null},
new Component[]{extraPane, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox }
};
double[] rowSize = {p, p, p, p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
return panel;
startDv = new DateValuePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_Start_Date"));
endDv = new DateValuePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date"));
UILabel returnTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type"));
return column(LayoutConstants.VERTICAL_GAP,
cell(formatHead),
cell(startDv),
cell(endDv),
cell(waterMarkDictPane),
row(
cell(returnTypeLabel).weight(LEFT_WEIGHT), cell(returnTypeButtonGroup).weight(RIGHT_WEIGHT)
)
).getComponent();
}
@Override
@ -90,20 +78,19 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}
private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){
Color tipColor = FlatUIUtils.getUIColor("Label.tipColor", Color.GRAY);
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"), 4, 2, this.getFont(), UIConstants.LINE_COLOR);
previewPane.setBorder(titledBorder);
TitledBorder titledBorder = new TitledBorder(new UIRoundedBorder(tipColor, 1, 5),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"), TitledBorder.LEADING, TitledBorder.TOP,
this.getFont(), tipColor);
JPanel sampleLabelWrapper = new JPanel(new BorderLayout());
sampleLabelWrapper.setBorder(BorderFactory.createEmptyBorder(0, SAMPLE_LABEL_PADDING, SAMPLE_LABEL_PADDING, SAMPLE_LABEL_PADDING));
sampleLabelWrapper.add(sampleLabel, BorderLayout.CENTER);
previewPane.setBorder(titledBorder);
previewPane.add(sampleLabel, BorderLayout.CENTER);
return column(LayoutConstants.VERTICAL_GAP,
cell(previewPane),
cell(formatComboBox)
previewPane.add(sampleLabelWrapper, BorderLayout.CENTER);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(previewPane, BorderLayout.NORTH);
jPanel.add(formatComboBox, BorderLayout.CENTER);
return jPanel;
).getComponent();
}
private UILabel createSamplePane(){
@ -120,53 +107,45 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}
private JPanel createFormatHead(){
UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format"));
String[] dateArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.DATE);
String[] timeArray = FormatField.getInstance().getFormatArray(FormatField.FormatContents.TIME);
final UIComboBox dateFormatComboBox = new UIComboBoxNoArrow(dateArray);
final UIComboBox timeFormatComboBox = new UIComboBoxNoArrow(timeArray);
dateFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
refreshPreviewLabel();
}
});
timeFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
refreshPreviewLabel();
}
});
dateFormatComboBox.addActionListener(e -> refreshPreviewLabel());
timeFormatComboBox.addActionListener(e -> refreshPreviewLabel());
final UILabel dateSampleLabel = createSamplePane();
final UILabel timeSampleLabel = createSamplePane();
JPanel fomatHeadPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final CardLayout cardLayout = new CardLayout();
final JPanel customPane = new JPanel(cardLayout);
JPanel dateFormatPane = createFormatPane(dateFormatComboBox, dateSampleLabel);
JPanel timeFormatPane = createFormatPane(timeFormatComboBox, timeSampleLabel);
customPane.add(dateFormatPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"));
customPane.add(timeFormatPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time"));
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")};
fomatHeadGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")});
fomatHeadGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int newSelectedIndex = fomatHeadGroup.getSelectedIndex();
cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox;
currentSamplelabel = dateSampleLabel;
}else{
currentFormatComboBox = timeFormatComboBox;
currentSamplelabel = timeSampleLabel;
}
refreshPreviewLabel();
final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")};
formatButtonGroup = new UIButtonGroup<>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")});
formatButtonGroup.addChangeListener(e -> {
int newSelectedIndex = formatButtonGroup.getSelectedIndex();
cardLayout.show(customPane, tabTitles[newSelectedIndex]);
if(newSelectedIndex == 0){
currentFormatComboBox = dateFormatComboBox;
currentSampleLabel = dateSampleLabel;
}else{
currentFormatComboBox = timeFormatComboBox;
currentSampleLabel = timeSampleLabel;
}
refreshPreviewLabel();
});
fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH);
fomatHeadPane.add(customPane, BorderLayout.CENTER);
return fomatHeadPane;
return column(LayoutConstants.VERTICAL_GAP,
row(
cell(formatLabel).weight(LEFT_WEIGHT), cell(formatButtonGroup).weight(RIGHT_WEIGHT)
),
row(flex(LEFT_WEIGHT), cell(customPane).weight(RIGHT_WEIGHT))
).getComponent();
}
private void refreshPreviewLabel() {
String text = (String) currentFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) {
@ -174,14 +153,14 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text);
String sample = simpleDateFormat.format(new Date());
DateFormatCheckResult result = DateFormatCheckManager.check(sample, text);
currentSamplelabel.setText(result.getSample());
currentSamplelabel.setForeground(result.getColor());
currentSampleLabel.setText(result.getSample());
currentSampleLabel.setForeground(result.getColor());
} catch (Exception exp) {
currentSamplelabel.setForeground(Color.red);
currentSamplelabel.setText(exp.getMessage());
currentSampleLabel.setForeground(Color.red);
currentSampleLabel.setText(exp.getMessage());
}
} else {
currentSamplelabel.setText(new Date().toString());
currentSampleLabel.setText(new Date().toString());
}
}
@ -201,11 +180,11 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override
protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText();
fomatHeadGroup.setSelectedIndex(getDateType(e));
fomatHeadGroup.populateBean();
formatButtonGroup.setSelectedIndex(getDateType(e));
formatButtonGroup.populateBean();
currentFormatComboBox.setSelectedItem(formatText);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 0 : 1);
returnTypeButtonGroup.setSelectedIndex(e.isReturnDate() ? 0 : 1);
startDv.populate(e.getStartDate());
endDv.populate(e.getEndDate());
}
@ -214,7 +193,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected DateEditor updateSubDirectWriteEditorBean() {
DateEditor ob = new DateEditor();
ob.setFormatText(this.getSimpleDateFormat().toPattern());
ob.setReturnDate(returnTypeComboBox.getSelectedIndex() == 0);
ob.setReturnDate(returnTypeButtonGroup.getSelectedIndex() == 0);
ob.setStartDate(startDv.update());
ob.setEndDate(endDv.update());

36
designer-realize/src/main/java/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java

@ -1,16 +1,15 @@
package com.fr.design.widget.ui;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.DirectWriteEditor;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
//richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树
@ -22,35 +21,26 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
super();
}
@Override
protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel contentPane = column(LayoutConstants.VERTICAL_GAP).getComponent();
directWriteCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Edit"), false);
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
waterMarkDictPane = new WaterMarkDictPane();
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{waterMarkDictPane, null},
new Component[]{extraPane, null},
};
double[] rowSize = {P, P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
contentPane.add(panel, BorderLayout.NORTH);
contentPane.add(column(LayoutConstants.VERTICAL_GAP,
cell(waterMarkDictPane),
cell(extraPane)
).getComponent());
JPanel otherContentPane = this.setSecondContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane, BorderLayout.CENTER);
contentPane.add(otherContentPane);
}
return contentPane;
}
public JPanel setValidatePane(){
JPanel otherContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel jPanel = GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 0);
otherContentPane.add(jPanel, BorderLayout.NORTH);
JPanel otherContentPane = column(LayoutConstants.VERTICAL_GAP).getComponent();
otherContentPane.add(directWriteCheckBox);
return otherContentPane;
}

77
designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -1,19 +1,20 @@
package com.fr.design.widget.ui;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
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.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeCreatorPaneAdder;
import com.fr.form.ui.FieldEditor;
import com.fr.general.GeneralContext;
@ -22,16 +23,18 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.collections.CollectionUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
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.Set;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* 字段编辑pane
*
@ -47,6 +50,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected final List<BasicBeanPane<T>> extraPaneList = new ArrayList<>();
protected JPanel extraPane;
protected JPanel corePane;
protected static double F = TableLayout.FILL;
protected static double P = TableLayout.PREFERRED;
@ -56,15 +60,15 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
corePane = column().getComponent();
JPanel contentPane = this.setFirstContentPane();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(contentPane, BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 24, jPanel);
this.add(uiExpandablePane, BorderLayout.NORTH);
contentPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
UIExpandablePane advancedPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 24, contentPane);
corePane.add(advancedPane);
}
this.addValidatePane();
corePane.add(addValidatePane());
this.add(corePane, BorderLayout.CENTER);
}
@ -86,6 +90,10 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initExtraPane() {
initPluginListener();
refreshExtraAdvancedPane();
if (extraPane == null) {
extraPane = new JPanel();
extraPane.setVisible(false);
}
}
protected void refreshExtraAdvancedPane() {
@ -146,41 +154,30 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
}
protected void addValidatePane() {
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"));
protected JPanel addValidatePane() {
validatePane = column(LayoutConstants.VERTICAL_GAP).getComponent();
final UILabel errorTipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"));
initErrorMsgPane();
allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM);
errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
borderPane.add(errorTipPane, BorderLayout.CENTER);
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected();
errorTipPane.setVisible(!isSelected);
}
final JPanel errorTipPane = row(
cell(errorTipLabel).weight(LEFT_WEIGHT), cell(errorMsgTextField.getErrorMsgTextField()).weight(RIGHT_WEIGHT)
).getComponent();
allowBlankCheckBox.addItemListener(e -> {
boolean selected = allowBlankCheckBox.isSelected();
errorTipPane.setVisible(!selected);
});
errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
Component[][] components = new Component[][]{
new Component[]{allowBlankCheckBox},
new Component[]{borderPane},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, 5, 5);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0));
validatePane.add(panel, BorderLayout.NORTH);
validatePane.add(column(LayoutConstants.VERTICAL_GAP,
cell(allowBlankCheckBox),
cell(errorTipPane)
).getComponent());
JPanel contentPane = this.setValidatePane();
if (contentPane != null) {
validatePane.add(contentPane, BorderLayout.CENTER);
validatePane.add(contentPane);
}
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Validate"), 280, 24, validatePane);
this.add(uiExpandablePane, BorderLayout.CENTER);
UIExpandablePane expandValidatePane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Basic_Validate"), 280, 24, validatePane);
expandValidatePane.setBorder(FineBorderFactory.createDefaultTopBorder());
return expandValidatePane;
}
public JPanel setValidatePane() {

57
designer-realize/src/main/java/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -1,6 +1,7 @@
package com.fr.design.widget.ui;
import com.fr.design.designer.IntervalConstants;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
import com.fr.design.foldablepane.UIExpandablePane;
@ -10,21 +11,24 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.IframeEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ParameterProvider;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private static final int P_W = 610;
@ -43,36 +47,29 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
attr.add(horizontalCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Preference_Horizontal_Scroll_Bar_Visible")));
attr.add(verticalCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Preference_Vertical_Scroll_Bar_Visible")));
contentPane.add(attr);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, f};
horizontalCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Preference_Horizontal_Scroll_Bar_Visible"));
verticalCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Preference_Vertical_Scroll_Bar_Visible"));
parameterViewPaneButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
parameterViewPaneButton.addActionListener(parameterListener);
parameterViewPane = new ReportletParameterViewPane();
horizontalCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
verticalCheck.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
java.awt.Component[][] coms = {
{horizontalCheck, null},
{verticalCheck, null},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Url")), srcTextField = new UITextField()},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters")), parameterViewPaneButton}};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
contentPane.add(panel);
srcTextField = new UITextField();
JPanel contentPane = column(LayoutConstants.VERTICAL_GAP,
cell(horizontalCheck),
cell(verticalCheck),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Url"))).weight(LEFT_WEIGHT),
cell(srcTextField).weight(RIGHT_WEIGHT)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"))).weight(LEFT_WEIGHT),
cell(parameterViewPaneButton).weight(RIGHT_WEIGHT)
)
).getComponent();
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 24, contentPane);
this.add(uiExpandablePane, BorderLayout.NORTH);
this.add(uiExpandablePane);
}
@ -101,7 +98,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
parameterViewPane.update(list);
}
});
dialog.setSize(P_W, P_H);
dialog.setSize(FineUIScale.scale(new Dimension(P_W, P_H)));
dialog.setVisible(true);
}
};

14
designer-realize/src/main/java/com/fr/design/widget/ui/ListEditorDefinePane.java

@ -4,15 +4,17 @@ import com.fr.data.Dictionary;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.form.ui.ListEditor;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
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 ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor> {
private UICheckBox needHeadCheckBox;
private AccessibleDictionaryEditor dictPane;
@ -34,12 +36,8 @@ public class ListEditorDefinePane extends WriteUnableRepeatEditorPane<ListEditor
@Override
protected JPanel setThirdContentPane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
needHeadCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_List_Need_Head"));
needHeadCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
jPanel.add(needHeadCheckBox, BorderLayout.CENTER);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return jPanel;
return row(cell(needHeadCheckBox), flex()).getComponent();
}
@Override

42
designer-realize/src/main/java/com/fr/design/widget/ui/MultiFileEditorPane.java

@ -1,21 +1,21 @@
package com.fr.design.widget.ui;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.form.ui.MultiFileEditor;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
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.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor> {
private DictionaryComboBox acceptType;
@ -34,15 +34,12 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
@Override
protected JPanel setFirstContentPane() {
JPanel contenter = new JPanel(new BorderLayout());
JPanel center = new JPanel(new BorderLayout());
singleFileCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Single_File_Upload"));
UIComponentUtils.setLineWrap(singleFileCheckBox);
singleFileCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
// acceptType.setPreferredSize(new Dimension(100, 20));
fileSizeField = new UISpinner(0, Integer.MAX_VALUE, 1, -1);
fileSizeField.setPreferredSize(new Dimension(140, 20));
JPanel fileSizePane = new JPanel(new BorderLayout());
UILabel fileTypeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type"));
@ -50,20 +47,17 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
fileSizePane.add(fileSizeField, BorderLayout.CENTER);
fileSizePane.add(new UILabel(" KB"), BorderLayout.EAST);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{singleFileCheckBox, null},
new Component[]{fileTypeLabel, acceptType},
new Component[]{fileSizeLabel, fileSizePane},
};
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
contenter.add(panel, BorderLayout.CENTER);
center.add(column(LayoutConstants.VERTICAL_GAP,
cell(singleFileCheckBox),
row(
cell(fileTypeLabel).weight(LEFT_WEIGHT), cell(acceptType).weight(RIGHT_WEIGHT)
),
row(
cell(fileSizeLabel).weight(LEFT_WEIGHT), cell(fileSizePane).weight(RIGHT_WEIGHT)
)
).getComponent());
return contenter;
return center;
}
@Override

41
designer-realize/src/main/java/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -1,19 +1,14 @@
package com.fr.design.widget.ui;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.NumberEditorValidatePane;
import com.fr.form.ui.NumberEditor;
import java.awt.Component;
import java.util.Set;
import javax.swing.JPanel;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor> {
/**
@ -38,15 +33,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
waterMarkDictPane = new WaterMarkDictPane();
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{waterMarkDictPane, null},
new Component[]{extraPane, null}
};
double[] rowSize = {P, P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
content.add(panel);
if (extraPane == null) {
content.add(
column(VERTICAL_GAP,
cell(waterMarkDictPane)
).getComponent()
);
} else {
content.add(
column(VERTICAL_GAP,
cell(waterMarkDictPane),
cell(extraPane)
).getComponent()
);
}
return content;
}

29
designer-realize/src/main/java/com/fr/design/widget/ui/RadioGroupDefinePane.java

@ -1,20 +1,13 @@
package com.fr.design.widget.ui;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.RadioGroup;
import java.awt.Component;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
@ -34,17 +27,11 @@ public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
protected JPanel setFirstContentPane() {
buttonGroupDictPane = new ButtonGroupDictPane();
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{buttonGroupDictPane, null},
new Component[]{extraPane, null}
};
double[] rowSize = {P, P, P, P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(panel);
return content;
return column(LayoutConstants.VERTICAL_GAP,
cell(buttonGroupDictPane),
cell(extraPane)
).getComponent();
}
@Override

40
designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -1,23 +1,21 @@
package com.fr.design.widget.ui;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.fun.RegPaneProvider;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.TextEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import javax.swing.JPanel;
import java.awt.Component;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Set;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegFieldPane regPane;
@ -38,13 +36,11 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
regPane.removeRegChangeListener(this);
}
};
final RegPane.PhoneRegListener pl = new RegPane.PhoneRegListener() {
public void phoneRegChangeAction(RegPane.PhoneRegEvent e) {
if (StringUtils.isNotEmpty(e.getPhoneRegString())
&& StringUtils.isEmpty(waterMarkDictPane.getWaterMark())) {
waterMarkDictPane.setWaterMark(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":" + e.getPhoneRegString());
regPane.addRegChangeListener(rl);
}
final RegPane.PhoneRegListener pl = e -> {
if (StringUtils.isNotEmpty(e.getPhoneRegString())
&& StringUtils.isEmpty(waterMarkDictPane.getWaterMark())) {
waterMarkDictPane.setWaterMark(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":" + e.getPhoneRegString());
regPane.addRegChangeListener(rl);
}
};
regPane.addPhoneRegListener(pl);
@ -57,17 +53,11 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
}
});
initExtraPane();
Component[][] components = new Component[][]{
new Component[]{waterMarkDictPane, null},
new Component[]{extraPane, null}
};
double[] rowSize = {P, P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(panel);
return content;
return column(LayoutConstants.VERTICAL_GAP,
cell(waterMarkDictPane),
cell(extraPane)
).getComponent();
}
public JPanel setValidatePane() {

41
designer-realize/src/main/java/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java

@ -1,25 +1,21 @@
package com.fr.design.widget.ui;
import java.awt.*;
import java.util.Set;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
protected AccessibleTreeModelEditor treeSettingPane;
@ -34,12 +30,8 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
@Override
protected JPanel setForthContentPane() {
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane();
content.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
content.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane);
@ -47,21 +39,22 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
}
});
content.add(treeRootPane, BorderLayout.NORTH);
return content;
return column(LayoutConstants.VERTICAL_GAP,
cell(treeRootPane),
cell(returnTypePane)
).getComponent();
}
@Override
protected JPanel setFirstContentPane() {
treeSettingPane = new AccessibleTreeModelEditor();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel north = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Create_Tree")), treeSettingPane}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
north.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
JPanel center = super.setFirstContentPane();
jPanel.add(north, BorderLayout.NORTH);
jPanel.add(center, BorderLayout.CENTER);
return jPanel;
return column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Create_Tree"))).weight(LEFT_WEIGHT),
cell(treeSettingPane).weight(RIGHT_WEIGHT)
),
cell(super.setFirstContentPane())
).getComponent();
}
@Override

60
designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -1,23 +1,22 @@
package com.fr.design.widget.ui;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeEditor;
import javax.swing.*;
import java.awt.*;
import java.util.Set;
import javax.swing.JPanel;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/*
@ -63,29 +62,24 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
}
protected JPanel setSecondContentPane() {
JPanel contentPane = column(LayoutConstants.VERTICAL_GAP).getComponent();
accessibleTreeModelEditor = new AccessibleTreeModelEditor();
JPanel createTree = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Create_Tree")), accessibleTreeModelEditor}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
createTree.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
initExtraPane();
double[] rowSize = {P, P};
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1},{1, 1}};
Component[][] components = new Component[][]{
new Component[]{createTree, null},
new Component[]{extraPane, null},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
contentPane.add(contenter,BorderLayout.NORTH);
removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Remove_Repeat_Data"), false);
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
contenter.add(panel, BorderLayout.NORTH);
contenter.add(removeRepeatCheckBox, BorderLayout.CENTER);
initExtraPane();
contentPane.add(column(LayoutConstants.VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Create_Tree"))).weight(LEFT_WEIGHT),
cell(accessibleTreeModelEditor).weight(RIGHT_WEIGHT)
),
cell(extraPane),
cell(removeRepeatCheckBox)
).getComponent());
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER);
contentPane.add(otherContentPane);
}
return contentPane;
}
@ -96,12 +90,8 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
}
protected JPanel setThirdContentPane() {
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane();
content.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
content.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane);
@ -109,8 +99,10 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
}
});
//content.add(treeRootPane, BorderLayout.NORTH);
return content;
return column(LayoutConstants.VERTICAL_GAP,
cell(treeRootPane),
cell(returnTypePane)
).getComponent();
}
@Override

30
designer-realize/src/main/java/com/fr/design/widget/ui/WaterMarkDictPane.java

@ -1,17 +1,18 @@
package com.fr.design.widget.ui;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WaterMark;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.event.KeyListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class WaterMarkDictPane extends JPanel {
private UITextField waterMarkTextField;
@ -21,17 +22,12 @@ public class WaterMarkDictPane extends JPanel {
waterMarkTextField = new UITextField();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), waterMarkTextField},
};
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1);
// panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER);
this.add(
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"))).weight(LEFT_WEIGHT),
cell(waterMarkTextField).weight(RIGHT_WEIGHT)
).getComponent()
);
}
public void populate(WaterMark waterMark) {

12
designer-realize/src/main/java/com/fr/design/widget/ui/WritableRepeatEditorPane.java

@ -1,10 +1,11 @@
package com.fr.design.widget.ui;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.form.ui.WriteAbleRepeatEditor;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import static com.fine.swing.ui.layout.Layouts.column;
public abstract class WritableRepeatEditorPane<E extends WriteAbleRepeatEditor> extends DirectWriteEditorDefinePane<E> {
@ -15,11 +16,10 @@ public abstract class WritableRepeatEditorPane<E extends WriteAbleRepeatEditor>
@Override
protected JPanel setSecondContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contentPane = column(LayoutConstants.VERTICAL_GAP).getComponent();
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER);
contentPane.add(otherContentPane);
}
return contentPane;
}

44
designer-realize/src/main/java/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java

@ -1,17 +1,18 @@
package com.fr.design.widget.ui;
import java.awt.*;
import javax.swing.BorderFactory;
import java.awt.Component;
import javax.swing.JPanel;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.WriteUnableRepeatEditor;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEditor> extends FieldEditorDefinePane<WriteUnableRepeatEditor> {
// richer:是否去除重复的值
@ -23,26 +24,21 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override
protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createYBoxEmptyBorderPane();
JPanel contentPane = column(LayoutConstants.VERTICAL_GAP).getComponent();
removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Remove_Repeat_Data"), false);
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
Component[] dicPane = createDicPane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
dicPane,
new Component[]{removeRepeatCheckBox, null},
};
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1,1},{1,1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
contentPane.add(panel);
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null)
contentPane.add(otherContentPane,BorderLayout.CENTER);
contentPane.add(column(LayoutConstants.VERTICAL_GAP,
row(
cell(dicPane[0]).weight(LEFT_WEIGHT), cell(dicPane[1]).weight(RIGHT_WEIGHT)
),
cell(removeRepeatCheckBox)
).getComponent());
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane);
}
return contentPane;
}

13
designer-realize/src/main/java/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java

@ -1,16 +1,10 @@
package com.fr.design.widget.ui.btn;
import com.fr.base.IconManager;
import com.fr.report.web.button.write.AppendRowButton;
import java.awt.*;
/**
* 插入行按钮
*
@ -21,13 +15,6 @@ import java.awt.*;
public class AppendRowButtonDefinePane<T extends AppendRowButton> extends AbstractExtraButtonPane<AppendRowButton> {
private DefineAppendColumnRowPane defineColumnRowPane;
// @Override
// protected void initComponents() {
// super.initComponents();
// defineColumnRowPane = new DefineAppendColumnRowPane();
// add(defineColumnRowPane, BorderLayout.SOUTH);
// }
@Override
protected Component createCenterPane() {
defineColumnRowPane = new DefineAppendColumnRowPane();

52
designer-realize/src/main/java/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java

@ -7,9 +7,8 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
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.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.style.background.BackgroundButtonPane;
import com.fr.form.ui.FreeButton;
@ -20,12 +19,19 @@ import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
public class ButtonSytleDefinedPane extends BasicPane {
protected AccessibleBackgroundEditor initBackgroundPane;
protected AccessibleBackgroundEditor overBackgroundPane;
@ -40,20 +46,30 @@ public class ButtonSytleDefinedPane extends BasicPane {
initBackgroundPane = new AccessibleBackgroundEditor();
overBackgroundPane = new AccessibleBackgroundEditor();
clickBackgroundPane = new AccessibleBackgroundEditor();
double f = TableLayout.FILL;
final double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1},{1, 1},{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial")), initBackgroundPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over")), overBackgroundPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Click")), clickBackgroundPane},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.CENTER);
this.add(row(
column(VERTICAL_GAP,
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Background_Setting"))).weight(1),
flex(1),
flex(1)
).weight(LEFT_WEIGHT),
column(VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial"))).weight(1),
fix(2),
cell(initBackgroundPane).weight(1)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over"))).weight(1),
fix(2),
cell(overBackgroundPane).weight(1)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Click"))).weight(1),
fix(2),
cell(clickBackgroundPane).weight(1)
)
).weight(RIGHT_WEIGHT)
).getComponent());
}
public void populate(FreeButton button) {

45
designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java

@ -1,23 +1,22 @@
package com.fr.design.widget.ui.btn;
import java.awt.Color;
import java.awt.Component;
import javax.swing.BorderFactory;
import com.fr.design.designer.IntervalConstants;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.ColumnRowEditor;
import com.fr.report.web.button.write.AppendRowButton;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-16 Time
* : 上午9:34
@ -32,27 +31,25 @@ public class DefineAppendColumnRowPane extends BasicPane {
}
private void initComponents() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = { p, p ,p};
double columnSize[] = { p, f};
crEditor = new ColumnRowEditor();
jNumberEditor = new UISpinner(0, 100 , 1, 0);
rowCountLable = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit_Row_Count"));
JPanel lpane = FRGUIPaneFactory.createBorderLayout_S_Pane();
lpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Append_Delete_Row_Message"));
label.setForeground(new Color(0x8F8F92));
lpane.add(label);
Component[][] components = { { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify_Cell")), crEditor }, { rowCountLable, jNumberEditor } ,{lpane,null}};
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Append_Delete_Row_Message"));
FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(contentPane);
this.add(column(VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify_Cell"))).weight(LEFT_WEIGHT),
cell(crEditor).weight(RIGHT_WEIGHT)
),
row(
cell(rowCountLable).weight(LEFT_WEIGHT),
cell(jNumberEditor).weight(RIGHT_WEIGHT)
),
cell(tipLabel)
).getComponent());
}
@Override

41
designer-realize/src/main/java/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java

@ -1,26 +1,25 @@
package com.fr.design.widget.ui.btn;
import javax.swing.*;
import com.fr.design.designer.IntervalConstants;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.ColumnRowEditor;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.report.web.button.write.DeleteRowButton;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* Created by IntelliJ IDEA. Author : Richer Version: 6.5.6 Date : 11-11-16 Time
* : 上午10:56
*/
public class DefineDeleteColumnRowPane extends BasicPane {
private static final int BORDER_LEFT = -10;
private ColumnRowEditor crEditor;
@ -29,22 +28,20 @@ public class DefineDeleteColumnRowPane extends BasicPane {
}
private void initComponents() {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = { p, p};
double columnSize[] = { p, f};
crEditor = new ColumnRowEditor();
crEditor = new ColumnRowEditor();
UILabel messageLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Append_Delete_Row_Message"));
messageLabel.setForeground(new Color(0x8F8F92));
Component[][] components = {
{ new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify_Cell")), crEditor },
{ messageLabel, null}};
JPanel contentPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
setLayout(FRGUIPaneFactory.createBorderLayout());
add(contentPane);
FineUIStyle.setStyle(messageLabel, FineUIStyle.LABEL_TIP);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(column(VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify_Cell"))).weight(LEFT_WEIGHT),
cell(crEditor).weight(RIGHT_WEIGHT)
),
cell(messageLabel)
).getComponent());
}
@Override

27
designer-realize/src/main/java/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

@ -1,11 +1,8 @@
package com.fr.design.widget.ui.btn;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.foldablepane.UIExpandablePane;
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.form.ui.Button;
import com.fr.report.web.button.form.TreeNodeToggleButton;
@ -13,6 +10,11 @@ import com.fr.report.web.button.form.TreeNodeToggleButton;
import javax.swing.*;
import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* 树节点按钮
*
@ -28,19 +30,14 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double rowSize[] = {p};
double columnSize[] = {p, f};
initExtraPane();
Component[][] n_components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type")), createCustomButtonTypeComboBox()},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, 8);
JPanel borderPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
borderPanel.add(panel, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
UIExpandablePane advancedPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, borderPanel);
JPanel panel = row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Button_Type"))).weight(LEFT_WEIGHT),
cell(createCustomButtonTypeComboBox()).weight(RIGHT_WEIGHT)
).getComponent();
UIExpandablePane advancedPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panel);
this.add(advancedPane);
}

30
designer-realize/src/main/java/com/fr/design/widget/ui/mobile/MultiFileEditorMobilePane.java

@ -2,24 +2,22 @@ package com.fr.design.widget.ui.mobile;
import com.fr.base.mobile.FileUploadModeState;
import com.fr.base.mobile.MultiFileUploaderMobileAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.properties.items.Item;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox;
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.widget.mobile.WidgetMobilePane;
import com.fr.form.ui.MultiFileEditor;
import com.fr.form.ui.Widget;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* Created by plough on 2018/4/25.
@ -60,20 +58,10 @@ public class MultiFileEditorMobilePane extends WidgetMobilePane {
private UIExpandablePane getMobileSettingsPane() {
initUploadModeComboBox();
// 以后可能会扩展
Component[][] components = new Component[][]{
new Component[] {new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Upload_Mode"), SwingConstants.LEFT), uploadModeComboBox}
};
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
double[] columnSize = {p,f};
int[][] rowCount = {{1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 30, LayoutConstants.VGAP_LARGE);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
final JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
panelWrapper.add(panel, BorderLayout.NORTH);
final JPanel panelWrapper = row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Upload_Mode"))).weight(LEFT_WEIGHT),
cell(uploadModeComboBox).weight(RIGHT_WEIGHT)
).getComponent();
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Terminal"), 280, 20, panelWrapper);
}

10
designer-realize/src/main/java/com/fr/design/widget/ui/mobile/TextEditorMobilePane.java

@ -12,6 +12,9 @@ import com.fr.form.ui.Widget;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/**
* 文本控件移动端属性面板
*
@ -32,12 +35,13 @@ public class TextEditorMobilePane extends WidgetMobilePane {
@Override
protected void init() {
JPanel container = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane();
settingPane = new MobileTextFieldInputSettingPane();
textSettingPane = new MobileTextEditSettingPane();
container.add(settingPane);
container.add(textSettingPane);
container.add(column(
cell(settingPane),cell(textSettingPane)
).getComponent());
this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, container), BorderLayout.NORTH);
}

Loading…
Cancel
Save