Browse Source

REPORT-111995 【UI翻新】控件面板布局整体翻新(form部分)

newui
Levy.Xie-解安森 10 months ago
parent
commit
d1051efe53
  1. 10
      designer-base/src/main/java/com/fine/theme/light/ui/FineLightIconSet.java
  2. 2
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  3. 4
      designer-base/src/main/java/com/fr/design/dialog/BasicScrollPane.java
  4. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java
  5. 8
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  6. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java
  7. 8
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  8. 13
      designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java
  9. 17
      designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java
  10. 33
      designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java
  11. 1
      designer-base/src/main/java/com/fr/design/mainframe/widget/editors/StringEditor.java
  12. 19
      designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java
  13. 126
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  14. 55
      designer-base/src/main/java/com/fr/design/widget/component/BackgroundCompPane.java
  15. 6
      designer-base/src/main/resources/com/fine/theme/icon/cellstyle/h_justify.svg
  16. 8
      designer-base/src/main/resources/com/fine/theme/icon/cellstyle/h_normal.svg
  17. 10
      designer-base/src/main/resources/com/fine/theme/icon/cellstyle/v_bottom.svg
  18. 10
      designer-base/src/main/resources/com/fine/theme/icon/cellstyle/v_center.svg
  19. 10
      designer-base/src/main/resources/com/fine/theme/icon/cellstyle/v_top.svg
  20. 5
      designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_cut.svg
  21. 5
      designer-base/src/main/resources/com/fine/theme/icon/filetree/monochrome_cut_disable.svg
  22. 5
      designer-base/src/main/resources/com/fine/theme/icon/lock/locked.svg
  23. 5
      designer-base/src/main/resources/com/fine/theme/icon/lock/locked_disable.svg
  24. 5
      designer-base/src/main/resources/com/fine/theme/icon/lock/unlocked.svg
  25. 3
      designer-base/src/main/resources/com/fine/theme/icon/lock/unlocked_disable.svg
  26. 5
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/to_bottom.svg
  27. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/to_bottom_disable.svg
  28. 5
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/to_top.svg
  29. 5
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/to_top_disable.svg
  30. 7
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  31. 3
      designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java
  32. 3
      designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java
  33. 6
      designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java
  34. 5
      designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveDownAction.java
  35. 5
      designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveToBottomAction.java
  36. 7
      designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveToTopAction.java
  37. 5
      designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveUpAction.java
  38. 3
      designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java
  39. 32
      designer-form/src/main/java/com/fr/design/designer/creator/PropertyGroupPane.java
  40. 4
      designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java
  41. 2
      designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java
  42. 6
      designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java
  43. 34
      designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java
  44. 8
      designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java
  45. 13
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java
  46. 6
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java
  47. 28
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  48. 3
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  49. 10
      designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java
  50. 134
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java
  51. 76
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java
  52. 31
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java
  53. 54
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java
  54. 26
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  55. 5
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java
  56. 27
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  57. 7
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java
  58. 74
      designer-form/src/main/java/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  59. 81
      designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java
  60. 67
      designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  61. 33
      designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java
  62. 73
      designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java
  63. 54
      designer-form/src/main/java/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java
  64. 52
      designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  65. 15
      designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  66. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/WaterMarkDictPane.java
  67. 5
      designer-form/src/main/java/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java
  68. 57
      designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java
  69. 51
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java
  70. 17
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java
  71. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BaseTextEditorMobileDefinePane.java
  72. 30
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java

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

@ -152,6 +152,11 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("h_left", "com/fine/theme/icon/cellstyle/h_left.svg"), new SvgIconSource("h_left", "com/fine/theme/icon/cellstyle/h_left.svg"),
new SvgIconSource("h_center", "com/fine/theme/icon/cellstyle/h_center.svg"), new SvgIconSource("h_center", "com/fine/theme/icon/cellstyle/h_center.svg"),
new SvgIconSource("h_right", "com/fine/theme/icon/cellstyle/h_right.svg"), new SvgIconSource("h_right", "com/fine/theme/icon/cellstyle/h_right.svg"),
new SvgIconSource("h_justify", "com/fine/theme/icon/cellstyle/h_justify.svg"),
new SvgIconSource("h_normal", "com/fine/theme/icon/cellstyle/h_normal.svg"),
new SvgIconSource("v_top", "com/fine/theme/icon/cellstyle/v_top.svg"),
new SvgIconSource("v_center", "com/fine/theme/icon/cellstyle/v_center.svg"),
new SvgIconSource("v_bottom", "com/fine/theme/icon/cellstyle/v_bottom.svg"),
new SvgIconSource("noboder", "com/fine/theme/icon/noboder.svg", true), new SvgIconSource("noboder", "com/fine/theme/icon/noboder.svg", true),
new SvgIconSource("merge", "com/fine/theme/icon/merge/merge.svg", true), new SvgIconSource("merge", "com/fine/theme/icon/merge/merge.svg", true),
new SvgIconSource("unmerge", "com/fine/theme/icon/merge/unmerge.svg", true), new SvgIconSource("unmerge", "com/fine/theme/icon/merge/unmerge.svg", true),
@ -174,6 +179,8 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("move_up", "com/fine/theme/icon/toolbar/move_up.svg", true), new SvgIconSource("move_up", "com/fine/theme/icon/toolbar/move_up.svg", true),
new SvgIconSource("move_left", "com/fine/theme/icon/toolbar/move_left.svg", true), new SvgIconSource("move_left", "com/fine/theme/icon/toolbar/move_left.svg", true),
new SvgIconSource("move_right", "com/fine/theme/icon/toolbar/move_right.svg", true), new SvgIconSource("move_right", "com/fine/theme/icon/toolbar/move_right.svg", true),
new SvgIconSource("to_top", "com/fine/theme/icon/toolbar/to_top.svg", true),
new SvgIconSource("to_bottom", "com/fine/theme/icon/toolbar/to_bottom.svg", true),
new SvgIconSource("tool_edit", "com/fine/theme/icon/toolbar/edit.svg", true), new SvgIconSource("tool_edit", "com/fine/theme/icon/toolbar/edit.svg", true),
new SvgIconSource("tool_edit_white", "com/fine/theme/icon/toolbar/edit_white.svg", true), new SvgIconSource("tool_edit_white", "com/fine/theme/icon/toolbar/edit_white.svg", true),
new SvgIconSource("tool_more", "com/fine/theme/icon/toolbar/more.svg", true), new SvgIconSource("tool_more", "com/fine/theme/icon/toolbar/more.svg", true),
@ -188,6 +195,8 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("param_hide_pressed", "com/fine/theme/icon/param/hide_pressed.svg", true, 24), new SvgIconSource("param_hide_pressed", "com/fine/theme/icon/param/hide_pressed.svg", true, 24),
new SvgIconSource("param_view", "com/fine/theme/icon/param/view.svg", true, 18), new SvgIconSource("param_view", "com/fine/theme/icon/param/view.svg", true, 18),
new SvgIconSource("param", "com/fine/theme/icon/param/param.svg", true), new SvgIconSource("param", "com/fine/theme/icon/param/param.svg", true),
new SvgIconSource("locked", "com/fine/theme/icon/lock/locked.svg", true, 16),
new SvgIconSource("unlocked", "com/fine/theme/icon/lock/unlocked.svg", true, 16),
// 北区菜单栏 // 北区菜单栏
//文件 //文件
@ -304,6 +313,7 @@ public class FineLightIconSet extends AbstractIconSet {
new SvgIconSource("move", "com/fine/theme/icon/filetree/move.svg", true), new SvgIconSource("move", "com/fine/theme/icon/filetree/move.svg", true),
new SvgIconSource("monochrome_copy", "com/fine/theme/icon/filetree/monochrome_copy.svg", true), new SvgIconSource("monochrome_copy", "com/fine/theme/icon/filetree/monochrome_copy.svg", true),
new SvgIconSource("monochrome_paste", "com/fine/theme/icon/filetree/monochrome_paste.svg", true), new SvgIconSource("monochrome_paste", "com/fine/theme/icon/filetree/monochrome_paste.svg", true),
new SvgIconSource("monochrome_cut", "com/fine/theme/icon/filetree/monochrome_cut.svg", true),
// 控件 // 控件
new SvgIconSource("button", "com/fine/theme/icon/widget/button.svg", true), new SvgIconSource("button", "com/fine/theme/icon/widget/button.svg", true),

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

@ -29,6 +29,8 @@ public interface FineUIStyle {
String BUTTON_TAB_ACTION = "tabAction"; String BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel"; String LABEL_BOLD = "boldLabel";
String LABEL_TIP = "tipLabel"; String LABEL_TIP = "tipLabel";
String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup";
String MENU_TOOL_BAR = "menuToolBar"; String MENU_TOOL_BAR = "menuToolBar";
String MENU_ITEM_TOOL_BAR = "menuItemToolBar"; String MENU_ITEM_TOOL_BAR = "menuItemToolBar";

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

@ -1,6 +1,5 @@
package com.fr.design.dialog; package com.fr.design.dialog;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBar;
@ -178,7 +177,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
int width = parent.getWidth(); int width = parent.getWidth();
int height = parent.getHeight(); int height = parent.getHeight();
if (leftcontentPane.getPreferredSize().height > maxheight && scrollBar.isVisible()) { if (leftcontentPane.getPreferredSize().height > maxheight && scrollBar.isVisible()) {
leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() + getOverWidth() - DET_WIDTH_OVER_HEIGHT, height + beginY); leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth(), height + beginY);
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height); scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height);
} else { } else {
int hideBarWidth = hideBarWidth() ? scrollBar.getWidth() : 0; int hideBarWidth = hideBarWidth() ? scrollBar.getWidth() : 0;
@ -211,7 +210,6 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
this.setLayout(new BarLayout()); this.setLayout(new BarLayout());
this.add(scrollBar); this.add(scrollBar);
leftcontentPane = pane; leftcontentPane = pane;
leftcontentPane.setBorder(new ScaledEmptyBorder(0, 6, 0, 6));
this.add(leftcontentPane); this.add(leftcontentPane);
} }
} }

4
designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java

@ -148,6 +148,8 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
toolbarDef.addShortCut(sj.getShortCut()); toolbarDef.addShortCut(sj.getShortCut());
} }
toolBar = ToolBarDef.createJToolBar(); toolBar = ToolBarDef.createJToolBar();
toolBar.setBorder(FineBorderFactory.createUnderlineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.GRAY)));
toolBar.setBorderPainted(true);
toolbarDef.updateToolBar(toolBar); toolbarDef.updateToolBar(toolBar);
} }
@ -163,8 +165,6 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
} }
initToolBar(); initToolBar();
toolBar.setBorder(FineBorderFactory.createUnderlineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.GRAY)));
toolBar.setBorderPainted(true);
leftPane.add(toolBar, BorderLayout.NORTH); leftPane.add(toolBar, BorderLayout.NORTH);
return leftPane; return leftPane;
} }

8
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -4,6 +4,7 @@ import com.fine.theme.light.ui.FineButtonBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory;
@ -33,10 +34,7 @@ import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment; import java.awt.GraphicsEnvironment;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
@ -83,7 +81,7 @@ public abstract class UIControlPane extends JControlPane {
if (isNewStyle()) { if (isNewStyle()) {
createPopupEditDialog(cardPane); createPopupEditDialog(cardPane);
this.add(getLeftPane(), BorderLayout.CENTER); this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 15, 10)); this.setBorder(new ScaledEmptyBorder(10, 10, 15, 10));
} else { } else {
// 增加边框 // 增加边框
JPanel leftPaneWrapper = new JPanel(new BorderLayout()); JPanel leftPaneWrapper = new JPanel(new BorderLayout());
@ -143,7 +141,7 @@ public abstract class UIControlPane extends JControlPane {
ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut(); ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
JPanel leftTopPane = getLeftTopPane(topToolBar); JPanel leftTopPane = getLeftTopPane(topToolBar);
leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); leftTopPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
leftPane.add(leftTopPane, BorderLayout.NORTH); leftPane.add(leftTopPane, BorderLayout.NORTH);
return leftPane; return leftPane;

3
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java

@ -10,10 +10,8 @@ import com.fr.form.event.Listener;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener; import javax.swing.event.ListDataListener;
@ -77,7 +75,6 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon
nameableList = createJNameList(); nameableList = createJNameList();
nameableList.setName(LIST_NAME); nameableList.setName(LIST_NAME);
UIScrollPane scrollPane = new UIScrollPane(nameableList); UIScrollPane scrollPane = new UIScrollPane(nameableList);
scrollPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIManager.getColor("defaultBorderColor")));
leftPane.add(scrollPane, BorderLayout.CENTER); leftPane.add(scrollPane, BorderLayout.CENTER);
leftPane.setBorder(new FineRoundBorder()); leftPane.setBorder(new FineRoundBorder());

8
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -1,5 +1,7 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -19,7 +21,6 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListModel; import javax.swing.ListModel;
@ -80,6 +81,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
@Override @Override
protected void initLeftPane(JPanel leftPane) { protected void initLeftPane(JPanel leftPane) {
leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER); leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER);
leftPane.setBorder(new FineRoundBorder());
} }
@ -539,13 +541,11 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
super.paint(g); super.paint(g);
} }
}; };
label.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); label.setBorder(new ScaledEmptyBorder(0, 8, 0, 0));
label.setOpaque(true); label.setOpaque(true);
label.setBackground(Color.WHITE); label.setBackground(Color.WHITE);
label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); label.setForeground(UIManager.getColor("List.wrapper.text.fontColor"));
label.setFont(label.getFont().deriveFont(11F)); label.setFont(label.getFont().deriveFont(11F));
//预留 10px 的纵向滚动条的宽度
label.setPreferredSize(new Dimension(214, 26));
this.nameEdList = nameEdList; this.nameEdList = nameEdList;
this.add(label, BorderLayout.NORTH); this.add(label, BorderLayout.NORTH);
this.add(this.nameEdList, BorderLayout.CENTER); this.add(this.nameEdList, BorderLayout.CENTER);

13
designer-base/src/main/java/com/fr/design/gui/controlpane/UISimpleListControlPane.java

@ -1,6 +1,6 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -230,8 +230,7 @@ public class UISimpleListControlPane extends BasicPane {
public MoveUpItemAction() { public MoveUpItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
this.setMnemonic('U'); this.setMnemonic('U');
this.setSmallIcon(BaseUtils this.setSmallIcon(new LazyIcon("move_up"));
.readIcon("/com/fr/design/images/control/up.png"));
} }
@Override @Override
@ -263,8 +262,7 @@ public class UISimpleListControlPane extends BasicPane {
public MoveDownItemAction() { public MoveDownItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
this.setMnemonic('D'); this.setMnemonic('D');
this.setSmallIcon(BaseUtils this.setSmallIcon(new LazyIcon("move_down"));
.readIcon("/com/fr/design/images/control/down.png"));
} }
@Override @Override
@ -294,8 +292,7 @@ public class UISimpleListControlPane extends BasicPane {
public SortItemAction() { public SortItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort"));
this.setMnemonic('S'); this.setMnemonic('S');
this.setSmallIcon(BaseUtils this.setSmallIcon(new LazyIcon("sort_desc"));
.readIcon("/com/fr/design/images/control/sortAsc.png"));
} }
@Override @Override
@ -423,7 +420,7 @@ public class UISimpleListControlPane extends BasicPane {
private void initComponents() { private void initComponents() {
label = new UILabel(); label = new UILabel();
label.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 0)); // label.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 0));
initialLabelForeground = label.getForeground(); initialLabelForeground = label.getForeground();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(label, BorderLayout.CENTER); this.add(label, BorderLayout.CENTER);

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

@ -5,6 +5,7 @@ package com.fr.design.gui.style;
*/ */
import com.fine.swing.ui.layout.Layouts; import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
@ -91,18 +92,18 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
initTextRotationComboBox(); initTextRotationComboBox();
// todo: 换新图标及反白问题 // todo: 换新图标及反白问题
Icon[][] hAlignmentIconArray = {{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal_white.png")}, Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal_white.png")}, {new LazyIcon("h_center"), new LazyIcon("h_center").white()},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal_white.png")}, {new LazyIcon("h_right"), new LazyIcon("h_right").white()},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_s_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_s_normal_white.png")}, {new LazyIcon("h_justify"), new LazyIcon("h_justify").white()},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/defaultAlignment.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/defaultAlignment_white.png")}}; {new LazyIcon("h_normal"), new LazyIcon("h_normal").white()}};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT, Integer.valueOf(Constants.DISTRIBUTED), Constants.NULL}; Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT, Integer.valueOf(Constants.DISTRIBUTED), Constants.NULL};
hAlignmentPane = new UIButtonGroup<>(hAlignmentIconArray, hAlignment); hAlignmentPane = new UIButtonGroup<>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Left"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Center"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Right"), hAlignmentPane.setAllToolTips(new String[]{Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Left"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Center"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Right"),
Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Distributed"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_DEFAULT")}); Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Distributed"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_DEFAULT")});
Icon[][] vAlignmentIconArray = {{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal_white.png")}, Icon[][] vAlignmentIconArray = {{new LazyIcon("v_top"), new LazyIcon("v_top").white()},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal_white.png")}, {new LazyIcon("v_center"), new LazyIcon("v_center").white()},
{IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal.png"), IOUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal_white.png")}}; {new LazyIcon("v_bottom"), new LazyIcon("v_bottom").white()}};
Integer[] vAlignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM}; Integer[] vAlignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM};
vAlignmentPane = new UIButtonGroup<>(vAlignmentIconArray, vAlignment); vAlignmentPane = new UIButtonGroup<>(vAlignmentIconArray, vAlignment);
vAlignmentPane.setAllToolTips(new String[]{Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Top"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Center"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Bottom")}); vAlignmentPane.setAllToolTips(new String[]{Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Top"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Center"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Tooltips_Bottom")});

33
designer-base/src/main/java/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -1,29 +1,31 @@
package com.fr.design.mainframe.widget; package com.fr.design.mainframe.widget;
import com.fr.design.designer.IntervalConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.awt.event.FocusListener; import java.awt.event.FocusListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
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;
/** /**
* Created by plough on 2017/8/7. * Created by plough on 2017/8/7.
*/ */
public class BasicPropertyPane extends BasicPane { public class BasicPropertyPane extends BasicPane {
protected UITextField widgetName; protected UITextField widgetName;
protected JPanel corePane;
public BasicPropertyPane(){ public BasicPropertyPane(){
initContentPane(); initContentPane();
@ -31,7 +33,9 @@ public class BasicPropertyPane extends BasicPane {
protected void initContentPane() { protected void initContentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); corePane = column(LayoutConstants.VERTICAL_GAP).getComponent();
this.add(corePane, BorderLayout.CENTER);
widgetName = new UITextField() { widgetName = new UITextField() {
protected void initListener() { protected void initListener() {
if (shouldResponseChangeListener()) { if (shouldResponseChangeListener()) {
@ -58,17 +62,10 @@ public class BasicPropertyPane extends BasicPane {
} }
}; };
widgetName.setGlobalName(Toolkit.i18nText("Fine-Design_Report_Basic")); widgetName.setGlobalName(Toolkit.i18nText("Fine-Design_Report_Basic"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; corePane.add(row(
double[] rowSize = {p}; cell(new UILabel(obtainBasicName())).weight(LEFT_WEIGHT), cell(widgetName).weight(RIGHT_WEIGHT)
double[] columnSize = {p, f}; ).getComponent());
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(obtainBasicName()), widgetName},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.add(panel, BorderLayout.NORTH);
} }
public String obtainBasicName(){ public String obtainBasicName(){

1
designer-base/src/main/java/com/fr/design/mainframe/widget/editors/StringEditor.java

@ -25,7 +25,6 @@ public class StringEditor extends AbstractPropertyEditor {
panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
textField = new UITextField(); textField = new UITextField();
panel.add(textField, BorderLayout.CENTER); panel.add(textField, BorderLayout.CENTER);
textField.setBorder(null);
textField.getDocument().addDocumentListener(new DocumentListener() { textField.getDocument().addDocumentListener(new DocumentListener() {
@Override @Override

19
designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java

@ -2,17 +2,11 @@ package com.fr.design.menu;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import javax.swing.BorderFactory; import java.awt.*;
import javax.swing.JComponent;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -30,16 +24,7 @@ public class ToolBarDef {
* 一个static的方法生成一个JToolBar * 一个static的方法生成一个JToolBar
*/ */
public static UIToolbar createJToolBar(final Color background) { public static UIToolbar createJToolBar(final Color background) {
UIToolbar toolbar = new UIToolbar(FlowLayout.LEFT, new UIToolBarUI() { return new UIToolbar();
@Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(background);
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
toolbar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
return toolbar;
} }

126
designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -1,21 +1,25 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.design.designer.IntervalConstants; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit; 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 javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component; 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.fine.swing.ui.layout.Layouts.flex;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
import static com.fr.design.constants.LayoutConstants.HORIZONTAL_GAP;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/** /**
* Created by plough on 2017/8/7. * Created by plough on 2017/8/7.
*/ */
@ -44,23 +48,15 @@ public class WidgetBoundsPaneFactory {
} }
} }
private static final int RIGHT_PANE_WIDTH = 145;
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) { public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel boundsPane = column(VERTICAL_GAP,
double f = TableLayout.FILL; row(
double p = TableLayout.PREFERRED; cell(FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName())).weight(LEFT_WEIGHT),
Component[][] components = new Component[][]{ cell(ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)).weight(RIGHT_WEIGHT)
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()), ),
ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)}, cell(createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER),
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER)))
}; ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))).getComponent();
double[] rowSize = {p, p};
double[] columnSize = {f, RIGHT_PANE_WIDTH};
int[][] rowCount = ratioLocked != null ? new int[][]{{1, 1}, {1, 1, 1}} : new int[][]{{1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane);
} }
@ -69,33 +65,24 @@ public class WidgetBoundsPaneFactory {
} }
public static JPanel createRightPane(Component com1, Component com2) { public static JPanel createRightPane(Component com1, Component com2) {
double f = TableLayout.FILL; return row(HORIZONTAL_GAP,
double p = TableLayout.PREFERRED; cell(com1).weight(0.5), cell(com2).weight(0.5)
double[] rowSize = {p}; ).getComponent();
double[] columnSize = {f, f};
int[][] rowCount = {{1, 1}};
Component[][] components = new Component[][]{
new Component[]{com1, com2}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L1);
} }
public static JPanel createRightPane(Component com1, Component com2, Component com3) { public static JPanel createRightPane(Component com1, Component com2, Component com3) {
double f = TableLayout.FILL; if (com2 != null) {
double p = TableLayout.PREFERRED; return row(
double[] rowSize = {p}; cell(com1).weight(1), cell(com2).weight(0.3), cell(com3).weight(1)
double[] columnSize = {f, 24, f}; ).getComponent();
int[][] rowCount = {{1, 1, 1}};
Component[][] components = new Component[][]{
new Component[]{com1, com2, com3}
};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 0, IntervalConstants.INTERVAL_L1);
} }
return row(
cell(com1).weight(1), flex(0.3), cell(com3).weight(1)
).getComponent();
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) { }
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) {
UILabel positionLabel = FRWidgetFactory.createLineWrapLabel(nameAttribute.getPositionName()); UILabel positionLabel = FRWidgetFactory.createLineWrapLabel(nameAttribute.getPositionName());
UILabel xLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER); UILabel xLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER);
UILabel yLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER); UILabel yLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER);
@ -104,24 +91,24 @@ public class WidgetBoundsPaneFactory {
UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER); UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER);
UILabel heightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER); UILabel heightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER);
Component[][] northComponents = new Component[][]{ JPanel boundsPane = column(VERTICAL_GAP,
new Component[]{positionLabel, ratioLocked != null ? createRightPane(x, null, y) : createRightPane(x, y)}, row(
new Component[]{null, ratioLocked != null ? createRightPane(xLabel, null, yLabel) : createRightPane(xLabel, yLabel)}, cell(positionLabel).weight(LEFT_WEIGHT),
}; cell(ratioLocked != null ? createRightPane(x, null, y) : createRightPane(x, y)).weight(RIGHT_WEIGHT)
Component[][] centerComponents = new Component[][]{ ),
new Component[]{sizeLabel, ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)}, row(
new Component[]{null, ratioLocked != null ? createRightPane(widthLabel, null, heightLabel) : createRightPane(widthLabel, heightLabel)}, flex(LEFT_WEIGHT),
}; cell(ratioLocked != null ? createRightPane(xLabel, null, yLabel) : createRightPane(xLabel, yLabel)).weight(RIGHT_WEIGHT)
double[] rowSize = {p, p}; ),
double[] columnSize = {f, RIGHT_PANE_WIDTH}; row(
int[][] rowCount = ratioLocked != null ? new int[][]{{1, 1, 1}, {1, 1, 1}} : new int[][]{{1, 1}, {1, 1}}; cell(sizeLabel).weight(LEFT_WEIGHT),
final JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(northComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); cell(ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)).weight(RIGHT_WEIGHT)
final JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6); ),
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); row(
northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); flex(LEFT_WEIGHT),
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); cell(ratioLocked != null ? createRightPane(widthLabel, null, heightLabel) : createRightPane(widthLabel, heightLabel)).weight(RIGHT_WEIGHT)
boundsPane.add(northPanel, BorderLayout.NORTH); )
boundsPane.add(centerPanel, BorderLayout.CENTER); ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))).getComponent();
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 230, 24, boundsPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 230, 24, boundsPane);
} }
@ -135,18 +122,11 @@ public class WidgetBoundsPaneFactory {
public static UIExpandablePane createCardTagBoundPane(UISpinner width) { public static UIExpandablePane createCardTagBoundPane(UISpinner width) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel boundsPane = column(VERTICAL_GAP,
double f = TableLayout.FILL; cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size"))).weight(LEFT_WEIGHT),
double p = TableLayout.PREFERRED; cell(width).weight(RIGHT_WEIGHT)
Component[][] components = new Component[][]{ ).getComponent();
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Component_Size")), width},
};
double[] rowSize = {p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane);
} }
} }

55
designer-base/src/main/java/com/fr/design/widget/component/BackgroundCompPane.java

@ -1,20 +1,22 @@
package com.fr.design.widget.component; package com.fr.design.widget.component;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleImgBackgroundEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleImgBackgroundEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import javax.swing.BorderFactory;
import javax.swing.JPanel; 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.flex;
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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/** /**
* Created by ibm on 2017/8/6. * Created by ibm on 2017/8/6.
@ -35,25 +37,30 @@ public abstract class BackgroundCompPane<T extends Widget> extends BasicPane {
UILabel headLabel = createUILable(); UILabel headLabel = createUILable();
initBackgroundEditor(); initBackgroundEditor();
String [] titles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")}; String [] titles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")};
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")), initialBackgroundEditor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over")), overBackgroundEditor},
new Component[]{getClickLabel(), clickBackgroundEditor},
};
panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0));
backgroundHead = new UIButtonGroup(titles); backgroundHead = new UIButtonGroup(titles);
JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ panel = column(VERTICAL_GAP,
new Component[]{headLabel, backgroundHead}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1); row(
flex(LEFT_WEIGHT),
this.add(headPane, BorderLayout.NORTH); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Initial"))).weight(RIGHT_WEIGHT / 2),
this.add(panel, BorderLayout.CENTER); cell(initialBackgroundEditor).weight(RIGHT_WEIGHT / 2)
),
row(
flex(LEFT_WEIGHT),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Background_Over"))).weight(RIGHT_WEIGHT / 2),
cell(overBackgroundEditor).weight(RIGHT_WEIGHT / 2)
),
row(
flex(LEFT_WEIGHT),
cell(getClickLabel()).weight(RIGHT_WEIGHT / 2),
cell(clickBackgroundEditor).weight(RIGHT_WEIGHT / 2)
)
).getComponent();
this.add(column(VERTICAL_GAP,
row(
cell(headLabel).weight(LEFT_WEIGHT),
cell(backgroundHead).weight(RIGHT_WEIGHT)
)
).getComponent());
} }

6
designer-base/src/main/resources/com/fine/theme/icon/cellstyle/h_justify.svg

@ -0,0 +1,6 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.1 4.5C4.49249 4.5 4 4.99249 4 5.6C4 6.20751 4.49249 6.7 5.1 6.7H26.9C27.5075 6.7 28 6.20751 28 5.6C28 4.99249 27.5075 4.5 26.9 4.5H5.1Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M5.1 11.4333C4.49249 11.4333 4 11.9258 4 12.5333C4 13.1408 4.49249 13.6333 5.1 13.6333H26.9C27.5075 13.6333 28 13.1408 28 12.5333C28 11.9258 27.5075 11.4333 26.9 11.4333H5.1Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M4 19.4667C4 18.8592 4.49249 18.3667 5.1 18.3667H26.9C27.5075 18.3667 28 18.8592 28 19.4667C28 20.0742 27.5075 20.5667 26.9 20.5667H5.1C4.49249 20.5667 4 20.0742 4 19.4667Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M5.1 25.3C4.49249 25.3 4 25.7925 4 26.4C4 27.0075 4.49249 27.5 5.1 27.5H26.9C27.5075 27.5 28 27.0075 28 26.4C28 25.7925 27.5075 25.3 26.9 25.3H5.1Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 922 B

8
designer-base/src/main/resources/com/fine/theme/icon/cellstyle/h_normal.svg

@ -0,0 +1,8 @@
<svg width="24" height="24" viewBox="0 0 32 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 626515">
<path id="Union" d="M1.1 0C0.492487 0 0 0.492487 0 1.1C0 1.70751 0.492487 2.2 1.1 2.2H14.9C15.5075 2.2 16 1.70751 16 1.1C16 0.492487 15.5075 0 14.9 0H1.1Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_2" d="M9.1 7C8.49249 7 8 7.49249 8 8.1C8 8.70751 8.49249 9.2 9.1 9.2H22.9C23.5075 9.2 24 8.70751 24 8.1C24 7.49249 23.5075 7 22.9 7H9.1Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_3" d="M1.1 14C0.492487 14 0 14.4925 0 15.1C0 15.7075 0.492487 16.2 1.1 16.2H14.9C15.5075 16.2 16 15.7075 16 15.1C16 14.4925 15.5075 14 14.9 14H1.1Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_4" d="M9.1 21C8.49249 21 8 21.4925 8 22.1C8 22.7075 8.49249 23.2 9.1 23.2H22.9C23.5075 23.2 24 22.7075 24 22.1C24 21.4925 23.5075 21 22.9 21H9.1Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 912 B

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

@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 427319587">
<rect width="16" height="16" fill="none"/>
<g id="Group 626516">
<path id="Union" d="M2.55 10C2.24624 10 2 10.2462 2 10.55C2 10.8538 2.24624 11.1 2.55 11.1H9.45C9.75376 11.1 10 10.8538 10 10.55C10 10.2462 9.75376 10 9.45 10H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_2" d="M2.55 7C2.24624 7 2 7.24624 2 7.55C2 7.85376 2.24624 8.1 2.55 8.1H13.45C13.7538 8.1 14 7.85376 14 7.55C14 7.24624 13.7538 7 13.45 7H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_3" d="M2.55 13.2C2.24624 13.2 2 13.4462 2 13.75C2 14.0537 2.24624 14.3 2.55 14.3H13.45C13.7538 14.3 14 14.0537 14 13.75C14 13.4462 13.7538 13.2 13.45 13.2H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 816 B

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

@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 427319586">
<rect width="16" height="16" fill="none"/>
<g id="Group 626516">
<path id="Union" d="M2.55 7.5C2.24624 7.5 2 7.74624 2 8.05C2 8.35376 2.24624 8.6 2.55 8.6H9.45C9.75376 8.6 10 8.35376 10 8.05C10 7.74624 9.75376 7.5 9.45 7.5H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_2" d="M2.55 4.5C2.24624 4.5 2 4.74624 2 5.05C2 5.35376 2.24624 5.6 2.55 5.6H13.45C13.7538 5.6 14 5.35376 14 5.05C14 4.74624 13.7538 4.5 13.45 4.5H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_3" d="M2.55 10.7C2.24624 10.7 2 10.9462 2 11.25C2 11.5537 2.24624 11.8 2.55 11.8H13.45C13.7538 11.8 14 11.5537 14 11.25C14 10.9462 13.7538 10.7 13.45 10.7H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 823 B

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

@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 427319584">
<rect width="16" height="16" fill="none"/>
<g id="Group 626516">
<path id="Union" d="M2.55 5.1001C2.24624 5.1001 2 5.34634 2 5.6501C2 5.95385 2.24624 6.2001 2.55 6.2001H9.45C9.75376 6.2001 10 5.95385 10 5.6501C10 5.34634 9.75376 5.1001 9.45 5.1001H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_2" d="M2.55 2C2.24624 2 2 2.24624 2 2.55C2 2.85376 2.24624 3.1 2.55 3.1H13.45C13.7538 3.1 14 2.85376 14 2.55C14 2.24624 13.7538 2 13.45 2H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
<path id="Union_3" d="M2.55 8.19995C2.24624 8.19995 2 8.44619 2 8.74995C2 9.05371 2.24624 9.29995 2.55 9.29995H13.45C13.7538 9.29995 14 9.05371 14 8.74995C14 8.44619 13.7538 8.19995 13.45 8.19995H2.55Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 869 B

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

@ -0,0 +1,5 @@
<svg width="28" height="26" viewBox="0 0 28 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 7734">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M5.34282 0.320598C5.85553 -0.00528273 6.49828 0.0878681 6.77845 0.528656L14.0735 12.006L21.3516 0.55527C21.6411 0.0997692 22.2914 -0.0053094 22.8042 0.320571C23.3169 0.646451 23.4978 1.27989 23.2083 1.73539L17.1255 11.3055L15.3769 14.0567L17.7303 17.7595C18.68 16.1103 20.4603 15 22.5 15C25.5376 15 28 17.4624 28 20.5C28 23.5376 25.5376 26 22.5 26C19.5356 26 17.1189 23.6547 17.0043 20.7184L16.7631 20.339L15.9399 19.0438L14.2934 16.4533L14.0735 16.1073L13.822 16.503L12.1702 19.1017L11.3444 20.4011L11.0314 20.8934C11.0158 20.9181 10.9988 20.9418 10.9806 20.9645C10.7445 23.7845 8.38095 25.9995 5.5 25.9995C2.46243 25.9995 0 23.5371 0 20.4995C0 17.4619 2.46243 14.9995 5.5 14.9995C7.5901 14.9995 9.4079 16.1654 10.3386 17.8823L12.7701 14.0567L11.0004 11.2725L4.92175 1.70877C4.64159 1.26799 4.8301 0.646478 5.34282 0.320598ZM19.0054 20.3048C19.0018 20.3694 19 20.4345 19 20.5C19 22.433 20.567 24 22.5 24C24.433 24 26 22.433 26 20.5C26 18.567 24.433 17 22.5 17C20.7334 17 19.2725 18.3088 19.0341 20.0096C19.0401 20.1074 19.0302 20.207 19.0054 20.3048ZM5.5 23.9995C7.433 23.9995 9 22.4325 9 20.4995C9 18.5665 7.433 16.9995 5.5 16.9995C3.567 16.9995 2 18.5665 2 20.4995C2 22.4325 3.567 23.9995 5.5 23.9995Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

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

@ -0,0 +1,5 @@
<svg width="28" height="26" viewBox="0 0 28 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 7734">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M5.34282 0.320598C5.85553 -0.00528273 6.49828 0.0878681 6.77845 0.528656L14.0735 12.006L21.3516 0.55527C21.6411 0.0997692 22.2914 -0.0053094 22.8042 0.320571C23.3169 0.646451 23.4978 1.27989 23.2083 1.73539L17.1255 11.3055L15.3769 14.0567L17.7303 17.7595C18.68 16.1103 20.4603 15 22.5 15C25.5376 15 28 17.4624 28 20.5C28 23.5376 25.5376 26 22.5 26C19.5356 26 17.1189 23.6547 17.0043 20.7184L16.7631 20.339L15.9399 19.0438L14.2934 16.4533L14.0735 16.1073L13.822 16.503L12.1702 19.1017L11.3444 20.4011L11.0314 20.8934C11.0158 20.9181 10.9988 20.9418 10.9806 20.9645C10.7445 23.7845 8.38095 25.9995 5.5 25.9995C2.46243 25.9995 0 23.5371 0 20.4995C0 17.4619 2.46243 14.9995 5.5 14.9995C7.5901 14.9995 9.4079 16.1654 10.3386 17.8823L12.7701 14.0567L11.0004 11.2725L4.92175 1.70877C4.64159 1.26799 4.8301 0.646478 5.34282 0.320598ZM19.0054 20.3048C19.0018 20.3694 19 20.4345 19 20.5C19 22.433 20.567 24 22.5 24C24.433 24 26 22.433 26 20.5C26 18.567 24.433 17 22.5 17C20.7334 17 19.2725 18.3088 19.0341 20.0096C19.0401 20.1074 19.0302 20.207 19.0054 20.3048ZM5.5 23.9995C7.433 23.9995 9 22.4325 9 20.4995C9 18.5665 7.433 16.9995 5.5 16.9995C3.567 16.9995 2 18.5665 2 20.4995C2 22.4325 3.567 23.9995 5.5 23.9995Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

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

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#231;&#166;&#129;&#231;&#148;&#168;=off, &#229;&#188;&#128;=off">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8 10C8 5.58172 11.5817 2 16 2C20.4183 2 24 5.58172 24 10V14H26C27.1046 14 28 14.8954 28 16V28C28 29.1046 27.1046 30 26 30H6C4.89543 30 4 29.1046 4 28V16C4 14.8954 4.89543 14 6 14H8V10ZM22 10V14H10V10C10 6.68629 12.6863 4 16 4C19.3137 4 22 6.68629 22 10ZM6 16L6 28H26V16H6ZM16 19C15.4477 19 15 19.4477 15 20V24C15 24.5523 15.4477 25 16 25C16.5523 25 17 24.5523 17 24V20C17 19.4477 16.5523 19 16 19Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 678 B

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

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#231;&#166;&#129;&#231;&#148;&#168;=on, &#229;&#188;&#128;=off">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8 10C8 5.58172 11.5817 2 16 2C20.4183 2 24 5.58172 24 10V14H26C27.1046 14 28 14.8954 28 16V28C28 29.1046 27.1046 30 26 30H6C4.89543 30 4 29.1046 4 28V16C4 14.8954 4.89543 14 6 14H8V10ZM22 10V14H10V10C10 6.68629 12.6863 4 16 4C19.3137 4 22 6.68629 22 10ZM6 16L6 28H26V16H6ZM16 19C15.4477 19 15 19.4477 15 20V24C15 24.5523 15.4477 25 16 25C16.5523 25 17 24.5523 17 24V20C17 19.4477 16.5523 19 16 19Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 678 B

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

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#231;&#166;&#129;&#231;&#148;&#168;=off, &#229;&#188;&#128;=on">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8 10C8 5.58172 11.5817 2 16 2C19.7277 2 22.8599 4.54955 23.748 8H21.6586C20.8349 5.66962 18.6124 4 16 4C12.6863 4 10 6.68629 10 10V14H26C27.1046 14 28 14.8954 28 16V28C28 29.1046 27.1046 30 26 30H6C4.89543 30 4 29.1046 4 28V16C4 14.8954 4.89543 14 6 14H8V10ZM26 28V16H6L6 28H26ZM15 20C15 19.4477 15.4477 19 16 19C16.5523 19 17 19.4477 17 20V24C17 24.5523 16.5523 25 16 25C15.4477 25 15 24.5523 15 24V20Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 683 B

3
designer-base/src/main/resources/com/fine/theme/icon/lock/unlocked_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 10C8 5.58172 11.5817 2 16 2C19.7277 2 22.8599 4.54955 23.748 8H21.6586C20.8349 5.66962 18.6124 4 16 4C12.6863 4 10 6.68629 10 10V14H26C27.1046 14 28 14.8954 28 16V28C28 29.1046 27.1046 30 26 30H6C4.89543 30 4 29.1046 4 28V16C4 14.8954 4.89543 14 6 14H8V10ZM26 28V16H6L6 28H26ZM15 20C15 19.4477 15.4477 19 16 19C16.5523 19 17 19.4477 17 20V24C17 24.5523 16.5523 25 16 25C15.4477 25 15 24.5523 15 24V20Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 595 B

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

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#230;&#150;&#185;&#229;&#144;&#145;=&#231;&#189;&#174;&#229;&#186;&#149;, &#231;&#129;&#176;&#229;&#140;&#150;=off">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8.91417 19.5001L15 25.5859V10.0002C15 9.44787 15.4477 9.00015 16 9.00015C16.5523 9.00015 17 9.44787 17 10.0002V25.5858L23.0858 19.5001C23.4763 19.1096 24.1095 19.1096 24.5 19.5001C24.8905 19.8906 24.8905 20.5238 24.5 20.9143L16 29.4143L7.49995 20.9143C7.10943 20.5238 7.10943 19.8906 7.49995 19.5001C7.89048 19.1096 8.52364 19.1096 8.91417 19.5001ZM7 6.00015C6.44772 6.00015 6 5.55244 6 5.00015C6 4.44787 6.44772 4.00015 7 4.00015H25C25.5523 4.00015 26 4.44787 26 5.00015C26 5.55244 25.5523 6.00015 25 6.00015H7Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 844 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/to_bottom_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.91417 19.5001L15 25.5859V10.0002C15 9.44787 15.4477 9.00015 16 9.00015C16.5523 9.00015 17 9.44787 17 10.0002V25.5858L23.0858 19.5001C23.4763 19.1096 24.1095 19.1096 24.5 19.5001C24.8905 19.8906 24.8905 20.5238 24.5 20.9143L16 29.4143L7.49995 20.9143C7.10943 20.5238 7.10943 19.8906 7.49995 19.5001C7.89048 19.1096 8.52364 19.1096 8.91417 19.5001ZM7 6.00015C6.44772 6.00015 6 5.55244 6 5.00015C6 4.44787 6.44772 4.00015 7 4.00015H25C25.5523 4.00015 26 4.44787 26 5.00015C26 5.55244 25.5523 6.00015 25 6.00015H7Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 704 B

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

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#230;&#150;&#185;&#229;&#144;&#145;=&#231;&#189;&#174;&#233;&#161;&#182;, &#231;&#129;&#176;&#229;&#140;&#150;=off">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8.91417 12.5L15 6.41421V22C15 22.5523 15.4477 23 16 23C16.5523 23 17 22.5523 17 22V6.41427L23.0858 12.5C23.4763 12.8906 24.1095 12.8906 24.5 12.5C24.8905 12.1095 24.8905 11.4764 24.5 11.0858L16 2.58582L7.49995 11.0858C7.10943 11.4764 7.10943 12.1095 7.49995 12.5C7.89048 12.8906 8.52364 12.8906 8.91417 12.5ZM7 26C6.44772 26 6 26.4477 6 27C6 27.5523 6.44772 28 7 28H25C25.5523 28 26 27.5523 26 27C26 26.4477 25.5523 26 25 26H7Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 759 B

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

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="&#230;&#150;&#185;&#229;&#144;&#145;=&#231;&#189;&#174;&#233;&#161;&#182;, &#231;&#129;&#176;&#229;&#140;&#150;=on">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M8.91417 12.5L15 6.41421V22C15 22.5523 15.4477 23 16 23C16.5523 23 17 22.5523 17 22V6.41427L23.0858 12.5C23.4763 12.8906 24.1095 12.8906 24.5 12.5C24.8905 12.1095 24.8905 11.4764 24.5 11.0858L16 2.58582L7.49995 11.0858C7.10943 11.4764 7.10943 12.1095 7.49995 12.5C7.89048 12.8906 8.52364 12.8906 8.91417 12.5ZM7 26C6.44772 26 6 26.4477 6 27C6 27.5523 6.44772 28 7 28H25C25.5523 28 26 27.5523 26 27C26 26.4477 25.5523 26 25 26H7Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 759 B

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

@ -1305,3 +1305,10 @@ CellOtherSetPane.height=$Component.defaultHeight
[style]Label.tipLabel = \ [style]Label.tipLabel = \
foreground: $Label.tipColor foreground: $Label.tipColor
[style]Button.plainButton = \
border: null; \
background: null; \
hoverBackground : null; \
selectedBackground : null; \
pressedBackground : null

3
designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java

@ -1,5 +1,6 @@
package com.fr.design.designer.beans.actions; package com.fr.design.designer.beans.actions;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.beans.actions.behavior.CopyableEnable; import com.fr.design.designer.beans.actions.behavior.CopyableEnable;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
@ -15,7 +16,7 @@ public class CopyAction extends FormWidgetEditAction {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon("/com/fr/design/standard/copy/copy"); this.setSmallIcon(new LazyIcon("monochrome_copy"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));
setUpdateBehavior(new CopyableEnable()); setUpdateBehavior(new CopyableEnable());
this.setEnabled(!DesignModeContext.isBanCopyAndCut()); this.setEnabled(!DesignModeContext.isBanCopyAndCut());

3
designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java

@ -1,6 +1,7 @@
package com.fr.design.designer.beans.actions; package com.fr.design.designer.beans.actions;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.beans.actions.behavior.CutableEnable; import com.fr.design.designer.beans.actions.behavior.CutableEnable;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
@ -16,7 +17,7 @@ public class CutAction extends FormWidgetEditAction {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"));
this.setMnemonic('T'); this.setMnemonic('T');
this.setSmallIcon("/com/fr/design/standard/cut/cut"); this.setSmallIcon(new LazyIcon("monochrome_cut"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setUpdateBehavior(new CutableEnable()); this.setUpdateBehavior(new CutableEnable());
this.setEnabled(!DesignModeContext.isBanCopyAndCut()); this.setEnabled(!DesignModeContext.isBanCopyAndCut());

6
designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java

@ -5,8 +5,10 @@ package com.fr.design.designer.beans.actions;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import javax.swing.*; import javax.swing.JComponent;
import javax.swing.KeyStroke;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.designer.beans.actions.behavior.DeletableEnable; import com.fr.design.designer.beans.actions.behavior.DeletableEnable;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
@ -22,7 +24,7 @@ public class FormDeleteAction extends FormWidgetEditAction {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete"));
this.setMnemonic('D'); this.setMnemonic('D');
// Richie:删除菜单图标 // Richie:删除菜单图标
this.setSmallIcon("/com/fr/design/images/m_report/delete"); this.setSmallIcon(new LazyIcon("remove"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
this.setUpdateBehavior(new DeletableEnable()); this.setUpdateBehavior(new DeletableEnable());
} }

5
designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveDownAction.java

@ -1,6 +1,6 @@
package com.fr.design.designer.beans.actions; package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.design.designer.beans.actions.behavior.MovableDownEnable; import com.fr.design.designer.beans.actions.behavior.MovableDownEnable;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -8,7 +8,6 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelection;
import javax.swing.*; import javax.swing.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -25,7 +24,7 @@ public class MoveDownAction extends FormWidgetEditAction {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_Down")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_Down"));
this.setMnemonic('B'); this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png")); this.setSmallIcon(new LazyIcon("move_down"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER));
this.setUpdateBehavior(new MovableDownEnable()); this.setUpdateBehavior(new MovableDownEnable());
} }

5
designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveToBottomAction.java

@ -1,6 +1,6 @@
package com.fr.design.designer.beans.actions; package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.design.designer.beans.actions.behavior.MovableDownEnable; import com.fr.design.designer.beans.actions.behavior.MovableDownEnable;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -8,7 +8,6 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelection;
import javax.swing.*; import javax.swing.*;
import java.awt.event.InputEvent; import java.awt.event.InputEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -26,7 +25,7 @@ public class MoveToBottomAction extends FormWidgetEditAction {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_To_Bottom")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_To_Bottom"));
this.setMnemonic('K'); this.setMnemonic('K');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/to_bottom.png")); this.setSmallIcon(new LazyIcon("to_bottom"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER + InputEvent.SHIFT_MASK)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, DEFAULT_MODIFIER + InputEvent.SHIFT_MASK));
this.setUpdateBehavior(new MovableDownEnable()); this.setUpdateBehavior(new MovableDownEnable());
} }

7
designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveToTopAction.java

@ -1,6 +1,6 @@
package com.fr.design.designer.beans.actions; package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.design.designer.beans.actions.behavior.MovableUpEnable; import com.fr.design.designer.beans.actions.behavior.MovableUpEnable;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -8,8 +8,7 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelection;
import javax.swing.KeyStroke;
import javax.swing.*;
import java.awt.event.InputEvent; import java.awt.event.InputEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -26,7 +25,7 @@ public class MoveToTopAction extends FormWidgetEditAction {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_To_Top")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_To_Top"));
this.setMnemonic('T'); this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/to_top.png")); this.setSmallIcon(new LazyIcon("to_top"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER + InputEvent.SHIFT_MASK)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER + InputEvent.SHIFT_MASK));
this.setUpdateBehavior(new MovableUpEnable()); this.setUpdateBehavior(new MovableUpEnable());
} }

5
designer-form/src/main/java/com/fr/design/designer/beans/actions/MoveUpAction.java

@ -1,6 +1,6 @@
package com.fr.design.designer.beans.actions; package com.fr.design.designer.beans.actions;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.design.designer.beans.actions.behavior.MovableUpEnable; import com.fr.design.designer.beans.actions.behavior.MovableUpEnable;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -8,7 +8,6 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelection;
import javax.swing.*; import javax.swing.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
@ -25,7 +24,7 @@ public class MoveUpAction extends FormWidgetEditAction {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_Up")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Move_Up"));
this.setMnemonic('F'); this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png")); this.setSmallIcon(new LazyIcon("move_up"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, DEFAULT_MODIFIER));
this.setUpdateBehavior(new MovableUpEnable()); this.setUpdateBehavior(new MovableUpEnable());
} }

3
designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java

@ -1,5 +1,6 @@
package com.fr.design.designer.beans.actions; package com.fr.design.designer.beans.actions;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.beans.actions.behavior.PasteEnable; import com.fr.design.designer.beans.actions.behavior.PasteEnable;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
@ -15,7 +16,7 @@ public class PasteAction extends FormWidgetEditAction {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste"));
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon("/com/fr/design/standard/paste/paste"); this.setSmallIcon(new LazyIcon("monochrome_paste"));
this.setUpdateBehavior(new PasteEnable()); this.setUpdateBehavior(new PasteEnable());
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER));
} }

32
designer-form/src/main/java/com/fr/design/designer/creator/PropertyGroupPane.java

@ -1,17 +1,21 @@
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/** /**
* Created by kerry on 2017/9/7. * Created by kerry on 2017/9/7.
*/ */
@ -50,15 +54,23 @@ public class PropertyGroupPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
int count = crPropertyDescriptors.length; int count = crPropertyDescriptors.length;
crPropertyDescriptorPanes = new CRPropertyDescriptorPane[count]; crPropertyDescriptorPanes = new CRPropertyDescriptorPane[count];
Component[][] components = new Component[count][]; JPanel column = column(VERTICAL_GAP).getComponent();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
crPropertyDescriptorPanes[i] = new CRPropertyDescriptorPane(crPropertyDescriptors[i], xCreator, designer); crPropertyDescriptorPanes[i] = new CRPropertyDescriptorPane(crPropertyDescriptors[i], xCreator, designer);
components[i] = crPropertyDescriptorPanes[i].createTableLayoutComponent(); Component[] component = crPropertyDescriptorPanes[i].createTableLayoutComponent();
if(component[1] != null) {
column.add(row(
cell(component[0]).weight(LEFT_WEIGHT), cell(component[1]).weight(RIGHT_WEIGHT)
).getComponent());
} else {
column.add(component[0]);
}
}
if (count == 0) {
this.setVisible(false);
} else {
this.add(column, BorderLayout.CENTER);
} }
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
this.add(panel, BorderLayout.CENTER);
} }
public void populate(Widget widget) { public void populate(Widget widget) {
@ -67,6 +79,8 @@ public class PropertyGroupPane extends BasicPane {
} }
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "PropertyGroupPane"; return "PropertyGroupPane";

4
designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java

@ -1,10 +1,10 @@
package com.fr.design.designer.treeview; package com.fr.design.designer.treeview;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeCellRenderer;
@ -35,7 +35,7 @@ public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer {
} }
this.treeCellRender = ((XCreator) value).getComponentTreeCellRender(); this.treeCellRender = ((XCreator) value).getComponentTreeCellRender();
} }
this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBorder(new ScaledEmptyBorder(2, 0, 2, 0));
this.setBackgroundNonSelectionColor(getBackground()); this.setBackgroundNonSelectionColor(getBackground());
return this; return this;
} }

2
designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java

@ -1,5 +1,6 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.EventPropertyTable;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -22,6 +23,7 @@ public class EventPropertyPane extends UIListGroupControlPane {
public EventPropertyPane(FormDesigner designer) { public EventPropertyPane(FormDesigner designer) {
super(); super();
this.designer = designer; this.designer = designer;
setBorder(new ScaledEmptyBorder(10, 0, 10, 0));
} }

6
designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java

@ -10,7 +10,6 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.treeview.ComponentTreeCellRenderer; import com.fr.design.designer.treeview.ComponentTreeCellRenderer;
import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.itree.UITreeUI;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -47,7 +46,6 @@ public class ComponentTree extends JTree {
private FormDesigner designer; private FormDesigner designer;
private ComponentTreeModel model; private ComponentTreeModel model;
private UITreeUI uiTreeUI = new UITreeUI();
private PopupPreviewPane previewPane; private PopupPreviewPane previewPane;
private static final Map<String, List<TreePath>> treePathCache = new HashMap<>(); private static final Map<String, List<TreePath>> treePathCache = new HashMap<>();
@ -56,7 +54,6 @@ public class ComponentTree extends JTree {
public ComponentTree(FormDesigner designer) { public ComponentTree(FormDesigner designer) {
this.designer = designer; this.designer = designer;
// this.setBackground(UIConstants.TREE_BACKGROUND);
setRootVisible(true); setRootVisible(true);
setCellRenderer(new ComponentTreeCellRenderer()); setCellRenderer(new ComponentTreeCellRenderer());
getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION); getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
@ -66,7 +63,6 @@ public class ComponentTree extends JTree {
this.refreshTreeRoot(); this.refreshTreeRoot();
initListeners(); initListeners();
setEditable(true); setEditable(true);
// setUI(uiTreeUI);
setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0)); setBorder(BorderFactory.createEmptyBorder(PADDING_TOP, PADDING_LEFT, 0, 0));
} }
@ -162,7 +158,6 @@ public class ComponentTree extends JTree {
*/ */
public void refreshUI() { public void refreshUI() {
updateUI(); updateUI();
// setUI(uiTreeUI);
} }
@ -525,7 +520,6 @@ public class ComponentTree extends JTree {
PopupPreviewPane() { PopupPreviewPane() {
contentPane = new JPanel(); contentPane = new JPanel();
// contentPane.setBackground(Color.white);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(contentPane, BorderLayout.CENTER); this.add(contentPane, BorderLayout.CENTER);
this.setOpaque(false); this.setOpaque(false);

34
designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.actions.UndoableAction; import com.fr.design.actions.UndoableAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
@ -17,7 +17,6 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.design.parameter.HierarchyTreePane; import com.fr.design.parameter.HierarchyTreePane;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -35,7 +34,6 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
private static final int PARA = 0; private static final int PARA = 0;
private static final int BODY = 1; private static final int BODY = 1;
private static final int SHORTS_SEPARATOR_POS = 4; private static final int SHORTS_SEPARATOR_POS = 4;
private static final int TOOLBAR_PADDING_RIGHT = 10;
private ShortCut4JControlPane[] shorts; private ShortCut4JControlPane[] shorts;
private ComponentTree componentTree; private ComponentTree componentTree;
@ -160,42 +158,26 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
private JPanel getWidgetPane() { private JPanel getWidgetPane() {
shorts = createShortcuts(); shorts = createShortcuts();
JPanel widgetPane = new JPanel(); JPanel widgetPane = new JPanel();
widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout()); widgetPane.setLayout(FRGUIPaneFactory.createBorderLayout());
UIToolbar toolbar = getToolBar();
widgetPane.add(toolbar, BorderLayout.NORTH);
widgetPane.add(getToolBarPane(), BorderLayout.CENTER);
UIScrollPane scrollPane = new UIScrollPane(componentTree); UIScrollPane scrollPane = new UIScrollPane(componentTree);
scrollPane.setBorder(BorderFactory.createEmptyBorder()); scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(210, 170)));
scrollPane.setPreferredSize(new Dimension(210, 170)); widgetPane.add(scrollPane, BorderLayout.CENTER);
widgetPane.add(scrollPane, BorderLayout.SOUTH);
return widgetPane; return widgetPane;
} }
private JPanel getToolBarPane() { private UIToolbar getToolBar() {
UIToolbar toolBar = ToolBarDef.createJToolBar(); UIToolbar toolBar = ToolBarDef.createJToolBar();
// toolBar.setUI(new UIToolBarUI() {
// @Override
// public void paint(Graphics g, JComponent c) {
// Graphics2D g2 = (Graphics2D) g;
// g2.setColor(new Color(245, 245, 247));
// g2.fillRect(0, 0, c.getWidth(), c.getHeight());
// }
// });
for (int i = 0; i < shorts.length; i++) { for (int i = 0; i < shorts.length; i++) {
if (i == SHORTS_SEPARATOR_POS) { if (i == SHORTS_SEPARATOR_POS) {
toolBar.addSeparator(new Dimension(2, 16)); toolBar.addSeparator(FineUIScale.scale(new Dimension(2, 16)));
} }
shorts[i].getShortCut().intoJToolBar(toolBar); shorts[i].getShortCut().intoJToolBar(toolBar);
} }
return toolBar;
JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER);
toolBarPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.BARNOMAL));
JPanel toolBarPaneWrapper = new JPanel(new BorderLayout());
toolBarPaneWrapper.add(toolBarPane, BorderLayout.CENTER);
toolBarPaneWrapper.setBorder(BorderFactory.createEmptyBorder(1, 0, 2, TOOLBAR_PADDING_RIGHT));
return toolBarPaneWrapper;
} }
/** /**

8
designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XComponent; import com.fr.design.designer.creator.XComponent;
@ -29,7 +29,6 @@ import com.fr.design.mainframe.widget.ui.FormWidgetCardPaneFactory;
import com.fr.design.widget.ui.designer.mobile.MobileWidgetDefinePane; import com.fr.design.widget.ui.designer.mobile.MobileWidgetDefinePane;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
@ -46,8 +45,6 @@ import java.util.Set;
*/ */
public class WidgetPropertyPane extends FormDockView implements BaseWidgetPropertyPane { public class WidgetPropertyPane extends FormDockView implements BaseWidgetPropertyPane {
private static final int PADDING = 10;
private static final int PADDING_M = 12;
private FormWidgetCardPane formWidgetCardPane; // 控件的属性表 private FormWidgetCardPane formWidgetCardPane; // 控件的属性表
private EventPropertyPane eventTable; // 控件的事件表 private EventPropertyPane eventTable; // 控件的事件表
private List<AbstractPropertyTable> widgetPropertyTables; // 这个变量应该是保存控件拓展的属性tab private List<AbstractPropertyTable> widgetPropertyTables; // 这个变量应该是保存控件拓展的属性tab
@ -217,7 +214,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
for (WidgetPropertyUIProvider widgetAttrProvider : widgetAttrProviders) { for (WidgetPropertyUIProvider widgetAttrProvider : widgetAttrProviders) {
MobileWidgetDefinePane extraPane = (MobileWidgetDefinePane) widgetAttrProvider.createWidgetAttrPane(); MobileWidgetDefinePane extraPane = (MobileWidgetDefinePane) widgetAttrProvider.createWidgetAttrPane();
if (extraPane != null) { if (extraPane != null) {
extraPane.setBorder(BorderFactory.createEmptyBorder(PADDING, PADDING, PADDING, PADDING_M));
mobileExtraPropertyPanes.add(extraPane); mobileExtraPropertyPanes.add(extraPane);
wsp.add(extraPane); wsp.add(extraPane);
} }
@ -282,8 +278,8 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
tabbedPane.show(center, tabTitles[index]); tabbedPane.show(center, tabTitles[index]);
} }
}; };
tabsHeaderIconPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UIConstants.SHADOW_GREY));
this.add(tabsHeaderIconPane, BorderLayout.NORTH); this.add(tabsHeaderIconPane, BorderLayout.NORTH);
this.setBorder(new ScaledEmptyBorder(10, 10, 0, 10));
} }

13
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java

@ -1,14 +1,9 @@
package com.fr.design.mainframe.widget.ui; package com.fr.design.mainframe.widget.ui;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
/** /**
* Created by kerry on 2017/9/30. * Created by kerry on 2017/9/30.
*/ */
@ -20,18 +15,14 @@ public class BasicSetVisiblePropertyPane extends FormBasicPropertyPane {
} }
protected void initComponent() { protected void initComponent() {
JPanel pane2 = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
pane2.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UICheckBox otherOtherConfig = createOtherConfig(); UICheckBox otherOtherConfig = createOtherConfig();
if(otherOtherConfig != null){ if(otherOtherConfig != null){
pane2.add(otherOtherConfig); corePane.add(otherOtherConfig);
} }
visibleCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Visible"), true); visibleCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Visible"), true);
visibleCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic")); visibleCheckBox.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"));
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); corePane.add(visibleCheckBox);
pane2.add(visibleCheckBox);
this.add(pane2, BorderLayout.CENTER);
} }
public UICheckBox createOtherConfig(){ public UICheckBox createOtherConfig(){

6
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java

@ -1,13 +1,9 @@
package com.fr.design.mainframe.widget.ui; package com.fr.design.mainframe.widget.ui;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import javax.swing.BorderFactory;
import java.awt.Component;
/** /**
* Created by ibm on 2017/7/26. * Created by ibm on 2017/7/26.
*/ */
@ -21,8 +17,6 @@ public class FormBasicWidgetPropertyPane extends BasicSetVisiblePropertyPane {
public UICheckBox createOtherConfig() { public UICheckBox createOtherConfig() {
enableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Enabled"), true); enableCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Enabled"), true);
enableCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_Basic")); enableCheckBox.setGlobalName(Toolkit.i18nText("Fine-Design_Report_Basic"));
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return enableCheckBox; return enableCheckBox;
} }

28
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java

@ -1,6 +1,8 @@
package com.fr.design.mainframe.widget.ui; package com.fr.design.mainframe.widget.ui;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -8,7 +10,6 @@ import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
@ -32,19 +33,21 @@ import com.fr.form.main.WidgetUtil;
import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
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;
public class FormSingleWidgetCardPane extends FormWidgetCardPane { public class FormSingleWidgetCardPane extends FormWidgetCardPane {
private AttributeChangeListener listener; private AttributeChangeListener listener;
@ -114,18 +117,14 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.add(attriCardPane, BorderLayout.CENTER); content.add(attriCardPane, BorderLayout.CENTER);
content.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
final boolean isExtraWidget = FormWidgetDefinePaneFactoryBase.isExtraXWidget(innerCreator.toData()); final boolean isExtraWidget = FormWidgetDefinePaneFactoryBase.isExtraXWidget(innerCreator.toData());
this.listener = new AttributeChangeListener() { this.listener = () -> {
@Override
public void attributeChange() {
if (!isExtraWidget) { if (!isExtraWidget) {
updateCreator(); updateCreator();
} }
updateWidgetBound(); updateWidgetBound();
firePropertyEdit(); firePropertyEdit();
}
}; };
freshPropertyMode(innerCreator); freshPropertyMode(innerCreator);
@ -139,14 +138,19 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
} }
widgetPropertyPane = WidgetBasicPropertyPaneFactory.createBasicPropertyPane(innerCreator); widgetPropertyPane = WidgetBasicPropertyPaneFactory.createBasicPropertyPane(innerCreator);
widgetPropertyPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), 280, 20, widgetPropertyPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), 280, 20, widgetPropertyPane);
content.add(column(
content.add(uiExpandablePane, BorderLayout.NORTH); cell(uiExpandablePane),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder()))
).getComponent(), BorderLayout.NORTH);
widgetBoundPane = createWidgetBoundPane(xCreator); widgetBoundPane = createWidgetBoundPane(xCreator);
if (widgetBoundPane != null) { if (widgetBoundPane != null) {
attriCardPane.add(widgetBoundPane, BorderLayout.NORTH); attriCardPane.add(column(
cell(widgetBoundPane),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder()))
).getComponent(), BorderLayout.NORTH);
} }
} }

3
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -6,7 +6,6 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -49,8 +48,6 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
private void initLayout() { private void initLayout() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// 跟上方tab标题“属性”那一栏间距10
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
} }
protected JPanel createContentPaneInScrollPane() { protected JPanel createContentPaneInScrollPane() {

10
designer-form/src/main/java/com/fr/design/parameter/ParameterPropertyPane.java

@ -1,6 +1,7 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
@ -31,10 +32,7 @@ public class ParameterPropertyPane extends JPanel{
private static ParameterPropertyPane THIS; private static ParameterPropertyPane THIS;
private boolean isEditing = false; private boolean isEditing = false;
private static final int HIDE_HEIGHT = 40;
private static final int PADDING_SMALL = 5;
private static final int PADDING_MIDDLE = 10; private static final int PADDING_MIDDLE = 10;
private static final int PADDING_LARGE = 15;
private static final int ADD_PARA_PANE_MAX_HEIGHT = 95; private static final int ADD_PARA_PANE_MAX_HEIGHT = 95;
public static final ParameterPropertyPane getInstance() { public static final ParameterPropertyPane getInstance() {
@ -81,15 +79,13 @@ public class ParameterPropertyPane extends JPanel{
} }
}; };
JPanel scrollPaneWrapperInner = new JPanel(new BorderLayout()); JPanel scrollPaneWrapperInner = new JPanel(new BorderLayout());
scrollPaneWrapperInner.setBorder(BorderFactory.createEmptyBorder(PADDING_MIDDLE, PADDING_MIDDLE, PADDING_MIDDLE, PADDING_SMALL));
scrollPaneWrapperInner.add(basicScrollPane, BorderLayout.CENTER); scrollPaneWrapperInner.add(basicScrollPane, BorderLayout.CENTER);
addParaPane = new JPanel(new BorderLayout()); addParaPane = new JPanel(new BorderLayout());
addParaPane.add(scrollPaneWrapperInner, BorderLayout.CENTER); addParaPane.add(scrollPaneWrapperInner, BorderLayout.CENTER);
addParaPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.SPLIT_LINE));
initParameterListener(); initParameterListener();
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, PADDING_MIDDLE, 0)); this.setBorder(FineBorderFactory.createDefaultUnderlineBorder());
this.add(addParaPane, BorderLayout.NORTH); this.add(addParaPane, BorderLayout.NORTH);
} }

134
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -1,10 +1,11 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.BaseUtils; import com.fine.swing.ui.layout.Column;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.PropertyGroupPane; import com.fr.design.designer.creator.PropertyGroupPane;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -21,18 +22,16 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelection;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.UIBoundSpinner; import com.fr.design.widget.ui.designer.component.UIBoundSpinner;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WParameterLayout;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
@ -40,7 +39,6 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.stable.FormConstants; import com.fr.report.stable.FormConstants;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JCheckBox; import javax.swing.JCheckBox;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -51,6 +49,14 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; 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.fix;
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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/** /**
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
*/ */
@ -69,6 +75,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
private PropertyGroupPane extraPropertyGroupPane; private PropertyGroupPane extraPropertyGroupPane;
protected final List<BasicBeanPane<WParameterLayout>> extraPaneList = new ArrayList<>(); protected final List<BasicBeanPane<WParameterLayout>> extraPaneList = new ArrayList<>();
private JPanel backgroundPane; private JPanel backgroundPane;
private JPanel corePane;
public RootDesignDefinePane(XCreator xCreator) { public RootDesignDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -80,6 +87,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
public void initComponent() { public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
corePane = new Column();
this.add(corePane, BorderLayout.CENTER);
if (newForm) { if (newForm) {
paraHeight = new UIBoundSpinner(0, Integer.MAX_VALUE, 1, 0); paraHeight = new UIBoundSpinner(0, Integer.MAX_VALUE, 1, 0);
} else { } else {
@ -87,10 +96,11 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
} }
JPanel advancePane = createAdvancePane(); JPanel advancePane = createAdvancePane();
UIExpandablePane advanceExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, advancePane); UIExpandablePane advanceExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, advancePane);
this.add(advanceExpandablePane, BorderLayout.NORTH); corePane.add(advanceExpandablePane);
JPanel layoutPane = createBoundsPane(); JPanel layoutPane = createBoundsPane();
UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Size"), 280, 20, layoutPane); UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Size"), 280, 20, layoutPane);
this.add(layoutExpandablePane, BorderLayout.CENTER); corePane.add(fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())).getComponent());
corePane.add(layoutExpandablePane);
this.addExtraUIExpandablePaneFromPlugin(); this.addExtraUIExpandablePaneFromPlugin();
} }
@ -104,23 +114,21 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
panel.add(uiExpandablePane); panel.add(uiExpandablePane);
} }
} }
this.add(panel, BorderLayout.SOUTH); corePane.add(panel);
} }
public JPanel createBoundsPane() { public JPanel createBoundsPane() {
double f = TableLayout.FILL; if (newForm) {
double p = TableLayout.PREFERRED; return row(
double[] rowSize = {p}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Design_Height"))).weight(LEFT_WEIGHT),
double[] columnSize = {p, f}; cell(paraHeight).weight(RIGHT_WEIGHT)
int[][] rowCount = {{1, 1}}; ).getComponent();
Component[] component = newForm ? new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_Design_Height")), paraHeight} : } else {
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Desin_Width")), designerWidth}; return row(
Component[][] components = new Component[][]{component}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Desin_Width"))).weight(LEFT_WEIGHT),
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); cell(designerWidth).weight(RIGHT_WEIGHT)
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); ).getComponent();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); }
jPanel.add(panel);
return jPanel;
} }
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
@ -139,14 +147,12 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
* @date: 2020/11/05 15:36 * @date: 2020/11/05 15:36
*/ */
private JPanel getTemplateAdvancePane() { private JPanel getTemplateAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelNameTextField = new UITextField(); labelNameTextField = new UITextField();
displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query"));
UIComponentUtils.setLineWrap(displayReport); UIComponentUtils.setLineWrap(displayReport);
useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template"));
fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event"));
fireAfterEditor.setEnabled(false); fireAfterEditor.setEnabled(false);
fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
useParamsTemplate.addChangeListener(e -> { useParamsTemplate.addChangeListener(e -> {
boolean isSelected = ((UICheckBox) e.getSource()).isSelected(); boolean isSelected = ((UICheckBox) e.getSource()).isSelected();
fireAfterEditor.setEnabled(isSelected); fireAfterEditor.setEnabled(isSelected);
@ -154,37 +160,37 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
fireAfterEditor.setSelected(false); fireAfterEditor.setSelected(false);
} }
}); });
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()},
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), {new LazyIcon("h_center"), new LazyIcon("h_center").white()},
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),}; {new LazyIcon("h_right"), new LazyIcon("h_right").white()}};
Integer[] hAlignment = new Integer[]{FormConstants.LEFTPOSITION, FormConstants.CENTERPOSITION, FormConstants.RIGHTPOSITION}; Integer[] hAlignment = new Integer[]{FormConstants.LEFTPOSITION, FormConstants.CENTERPOSITION, FormConstants.RIGHTPOSITION};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane = new UIButtonGroup<>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left") hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left")
, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")}); , com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")});
backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.initExtraPane(); this.initExtraPane();
double f = TableLayout.FILL; CRPropertyDescriptor[] extraTableEditor = root.getExtraTableEditor();
double p = TableLayout.PREFERRED;
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}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane},
new Component[]{displayReport, null},
new Component[]{useParamsTemplate, null},
new Component[]{fireAfterEditor, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position")), hAlignmentPane}
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
CRPropertyDescriptor[] extraTableEditor = new CRPropertyDescriptor[0];
extraTableEditor = root.getExtraTableEditor();
extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, root); extraPropertyGroupPane = new PropertyGroupPane(extraTableEditor, root);
jPanel.add(panel, BorderLayout.NORTH); return column(VERTICAL_GAP,
jPanel.add(extraPropertyGroupPane, BorderLayout.CENTER); row(
return jPanel; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
cell(labelNameTextField).weight(RIGHT_WEIGHT)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"))).weight(LEFT_WEIGHT),
cell(backgroundPane).weight(RIGHT_WEIGHT)
),
cell(displayReport),
cell(useParamsTemplate),
cell(fireAfterEditor),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position"))).weight(LEFT_WEIGHT),
cell(hAlignmentPane).weight(RIGHT_WEIGHT)
),
cell(extraPropertyGroupPane)
).getComponent();
} }
private void initExtraPane() { private void initExtraPane() {
@ -244,14 +250,12 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
* @date: 2020/11/05 15:36 * @date: 2020/11/05 15:36
*/ */
private JPanel getNewFormAdvancePane() { private JPanel getNewFormAdvancePane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelNameTextField = new UITextField(); labelNameTextField = new UITextField();
displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query"));
UIComponentUtils.setLineWrap(displayReport); UIComponentUtils.setLineWrap(displayReport);
useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template"));
fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event")); fireAfterEditor = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Trigger_Editing_End_Event"));
fireAfterEditor.setEnabled(false); fireAfterEditor.setEnabled(false);
fireAfterEditor.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0));
useParamsTemplate.addChangeListener(e -> { useParamsTemplate.addChangeListener(e -> {
boolean isSelected = ((UICheckBox) e.getSource()).isSelected(); boolean isSelected = ((UICheckBox) e.getSource()).isSelected();
fireAfterEditor.setEnabled(isSelected); fireAfterEditor.setEnabled(isSelected);
@ -261,24 +265,20 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
}); });
backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.initExtraPane(); this.initExtraPane();
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane},
new Component[]{displayReport, null},
new Component[]{useParamsTemplate, null},
new Component[]{fireAfterEditor, null},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W0, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
jPanel.add(panel, BorderLayout.NORTH);
return jPanel; return column(VERTICAL_GAP,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
cell(labelNameTextField).weight(RIGHT_WEIGHT)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"))).weight(LEFT_WEIGHT),
cell(backgroundPane).weight(RIGHT_WEIGHT)
),
cell(displayReport),
cell(useParamsTemplate),
cell(fireAfterEditor)
).getComponent();
} }
@Override @Override

76
designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java

@ -3,15 +3,12 @@ package com.fr.design.widget.ui.designer;
import com.finebi.cbb.utils.CollectionUtils; import com.finebi.cbb.utils.CollectionUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleIconEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleIconEditor;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder; import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.widget.btn.ButtonConstants; import com.fr.design.widget.btn.ButtonConstants;
@ -20,9 +17,7 @@ import com.fr.general.GeneralContext;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.Component; import java.awt.Component;
@ -30,6 +25,13 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> { public abstract class ButtonDefinePane<T extends Button> extends AbstractDataModify<T> {
private UITextField hotkeysTextField; private UITextField hotkeysTextField;
private UITextField buttonNameTextField; private UITextField buttonNameTextField;
@ -80,55 +82,39 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
} }
private void refreshAdvancedPane(boolean containsExtraPane) { private void refreshAdvancedPane(boolean containsExtraPane) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
Component[] backgroundCompPane = createBackgroundComp(); Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane(); Component[] frFont = createFontPane();
double[] rowSize; hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
double[] columnSize; extraPane = column(VERTICAL_GAP,
int[][] rowCount; row(
Component[][] n_components; 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_Form_Label_Name"))).weight(LEFT_WEIGHT),
cell(labelNameTextField).weight(RIGHT_WEIGHT)
),
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_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 (containsExtraPane) { if (containsExtraPane) {
JPanel panel = FRGUIPaneFactory.createYBoxEmptyBorderPane(); JPanel panel = FRGUIPaneFactory.createYBoxEmptyBorderPane();
for (BasicBeanPane<T> pane : extraPaneList) { for (BasicBeanPane<T> pane : extraPaneList) {
panel.add(pane); panel.add(pane);
} }
rowSize = new double[]{p, p, p, p, p}; extraPane.add(panel);
columnSize = new double[]{p, f};
rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
n_components = getExtraAdvancedComponents(panel);
} else { } else {
rowSize = new double[]{p, p, p, p, p, p, p, p}; extraPane.add(column(VERTICAL_GAP,
columnSize = new double[]{p, f}; cell(backgroundCompPane[0]),
rowCount = new int[][]{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; cell(frFont[0])
n_components = getAdvancedComponents(backgroundCompPane, frFont); ).getComponent(), 2);
} }
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
extraPane = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
extraPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
}
@NotNull
private Component[][] getAdvancedComponents(Component[] backgroundCompPane, Component[] frFont) {
return new Component[][]{
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField},
backgroundCompPane,
frFont,
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")), iconPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField}
};
}
@NotNull
private Component[][] getExtraAdvancedComponents(JPanel panel) {
return new Component[][]{
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Name")), buttonNameTextField},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")), iconPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Button_Hot_keys")), hotkeysTextField},
{panel, null}
};
} }
protected void initPluginListener() { protected void initPluginListener() {

31
designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonGroupDictPane.java

@ -1,20 +1,22 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.ButtonGroup; import com.fr.form.ui.ButtonGroup;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public class ButtonGroupDictPane extends JPanel { public class ButtonGroupDictPane extends JPanel {
@ -32,23 +34,16 @@ public class ButtonGroupDictPane extends JPanel {
public void initComponents() { public void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true); adaptiveCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Adaptive"), true);
adaptiveCheckbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UILabel dictLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")); 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); 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)); columnSpinner = new UIBasicSpinner(new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = {
new Component[] {adaptiveCheckbox, null},
new Component[] {columnLabel, columnSpinner},
};
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(jPanel); this.add(column(VERTICAL_GAP,
cell(adaptiveCheckbox),
row(
cell(columnLabel).weight(LEFT_WEIGHT), cell(columnSpinner).weight(RIGHT_WEIGHT)
)
).getComponent());
} }
public void populate(ButtonGroup buttonGroup) { public void populate(ButtonGroup buttonGroup) {

54
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java

@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer;
import com.finebi.cbb.utils.CollectionUtils; import com.finebi.cbb.utils.CollectionUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
@ -11,7 +10,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder; import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.gui.frpane.FontSizeComboPane; import com.fr.design.gui.frpane.FontSizeComboPane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
@ -20,14 +18,18 @@ import com.fr.general.GeneralContext;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> { public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
private UITextField text; private UITextField text;
private FontSizeComboPane fontSizePane; private FontSizeComboPane fontSizePane;
@ -41,31 +43,28 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
public CheckBoxDefinePane(XCreator xCreator) { public CheckBoxDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
iniComoponents(); initComponents();
} }
private void iniComoponents() { private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
text = new UITextField(); text = new UITextField();
fontSizePane = new FontSizeComboPane(); fontSizePane = new FontSizeComboPane();
labelNameTextField = new UITextField(); labelNameTextField = new UITextField();
UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
initExtraPane(); initExtraPane();
Component[][] components = new Component[][]{ JPanel boundsPane = column(VERTICAL_GAP,
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text")), text }, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
new Component[]{widgetValueLabel, formWidgetValuePane }, cell(labelNameTextField).weight(RIGHT_WEIGHT)
new Component[]{extraPane, null}, ),
}; row(
double[] rowSize = {P, P, P, P, P, P}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"))).weight(LEFT_WEIGHT),
double[] columnSize = {P, F}; cell(text).weight(RIGHT_WEIGHT)
int[][] rowCount = {{1, 1},{1, 1}, {1, 3},{1, 1}}; ),
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); cell(formWidgetValuePane),
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); cell(extraPane)
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); ).getComponent();
boundsPane.add(panel);
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, boundsPane); UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, boundsPane);
this.add(uiExpandablePane); this.add(uiExpandablePane);
@ -94,13 +93,10 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
extraPane.add(pane); extraPane.add(pane);
} }
} else { } else {
Component[][] components = new Component[][]{ extraPane = row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane} cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"))).weight(LEFT_WEIGHT),
}; cell(fontSizePane).weight(RIGHT_WEIGHT)
double[] rowSize = {P}; ).getComponent();
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}};
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
} }
} }

26
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -1,19 +1,19 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.component.ReturnTypePane; import com.fr.design.widget.component.ReturnTypePane;
import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane; import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*;
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 CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
@ -39,19 +39,11 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){ public JPanel createOtherPane(){
checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Choose_Type_All")); checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Choose_Type_All"));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnTypePane = new ReturnTypePane(); returnTypePane = new ReturnTypePane();
double f = TableLayout.FILL; return column(VERTICAL_GAP,
double p = TableLayout.PREFERRED; cell(checkbox),
Component[][] components = new Component[][]{ cell(returnTypePane)
new Component[]{checkbox, null }, ).getComponent();
new Component[]{returnTypePane, 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);
return panel;
} }
@Override @Override

5
designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java

@ -7,9 +7,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.form.ui.ComboBox; import com.fr.form.ui.ComboBox;
import java.awt.Component;
import javax.swing.*;
import java.awt.*;
public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> { public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
@ -21,7 +19,6 @@ public class ComboBoxDefinePane extends DictEditorDefinePane<ComboBox> {
public UICheckBox createRepeatCheckBox(){ public UICheckBox createRepeatCheckBox(){
removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_No_Repeat")); removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_No_Repeat"));
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
return removeRepeatCheckBox; return removeRepeatCheckBox;
} }

27
designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java

@ -1,19 +1,20 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.component.ReturnTypePane; import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; 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.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
@ -27,7 +28,6 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public UICheckBox createRepeatCheckBox(){ public UICheckBox createRepeatCheckBox(){
removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_No_Repeat")); removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_No_Repeat"));
removeRepeatCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
return removeRepeatCheckBox; return removeRepeatCheckBox;
} }
@ -39,20 +39,11 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public JPanel createOtherPane(){ public JPanel createOtherPane(){
supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true); supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true);
supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnTypePane = new ReturnTypePane(); returnTypePane = new ReturnTypePane();
double f = TableLayout.FILL; return column(VERTICAL_GAP,
double p = TableLayout.PREFERRED; cell(supportTagCheckBox),cell(returnTypePane)
Component[][] components = new Component[][]{ ).getComponent();
new Component[]{supportTagCheckBox, null },
new Component[]{returnTypePane, 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);
return panel;
} }
protected void populateSubDictionaryEditorBean(ComboCheckBox ob){ protected void populateSubDictionaryEditorBean(ComboCheckBox ob){

7
designer-form/src/main/java/com/fr/design/widget/ui/designer/CustomWritableRepeatEditorPane.java

@ -2,12 +2,10 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.form.ui.CustomWriteAbleRepeatEditor;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*;
/** /**
* Author : Shockway * Author : Shockway
@ -25,9 +23,8 @@ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRe
public JPanel setValidatePane(){ public JPanel setValidatePane(){
this.customDataCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Custom_Data"), false); this.customDataCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Custom_Data"), false);
this.customDataCheckBox.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
JPanel otherContentPane = super.setValidatePane(); JPanel otherContentPane = super.setValidatePane();
otherContentPane.add(GUICoreUtils.createFlowPane(new JComponent[]{customDataCheckBox}, FlowLayout.LEFT, 0)); otherContentPane.add(customDataCheckBox);
return otherContentPane; return otherContentPane;
} }

74
designer-form/src/main/java/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -7,20 +7,18 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.widget.component.DateValuePane; import com.fr.design.widget.component.DateValuePane;
import com.fr.design.widget.component.UIComboBoxNoArrow; import com.fr.design.widget.component.UIComboBoxNoArrow;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.design.widget.ui.designer.date.DateFormatCheckManager; import com.fr.design.widget.ui.designer.date.DateFormatCheckManager;
import com.fr.design.widget.ui.designer.date.DateFormatCheckResult; import com.fr.design.widget.ui.designer.date.DateFormatCheckResult;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.form.ui.DateEditor; import com.fr.form.ui.DateEditor;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -33,13 +31,19 @@ import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> { public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> {
private UIButtonGroup returnTypeComboBox; private UIButtonGroup returnTypeComboBox;
private DateValuePane startDv; private DateValuePane startDv;
@ -65,37 +69,34 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format")); UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format"));
formatLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.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);
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
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")}); 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")});
JPanel formatHead = createFormatHead(); JPanel formatHead = createFormatHead();
startDv = new DateValuePane(); startDv = new DateValuePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_Start_Date"));
endDv = new DateValuePane(); endDv = new DateValuePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date"));
initExtraPane(); initExtraPane();
Component[][] components = new Component[][]{ return column(VERTICAL_GAP,
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, row(
new Component[]{widgetValueLabel, formWidgetValuePane}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
new Component[]{formatLabel, formatHead}, cell(labelNameTextField).weight(RIGHT_WEIGHT)
new Component[]{startDateLabel, startDv}, ),
new Component[]{endDateLabel, endDv}, cell(formWidgetValuePane),
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), waterMarkDictPane}, row(
new Component[]{extraPane, null}, cell(formatLabel).weight(LEFT_WEIGHT),
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox} cell(formatHead).weight(RIGHT_WEIGHT)
),
}; cell(startDv),
double[] rowSize = {P, P, P, P, P, P, P, P, P, P}; cell(endDv),
double[] columnSize = {P, F}; row(
int[][] rowCount = {{1, 1}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"))).weight(LEFT_WEIGHT),
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); cell(waterMarkDictPane).weight(RIGHT_WEIGHT)
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); ),
boundsPane.add(panel); cell(extraPane),
return boundsPane; row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type"))).weight(LEFT_WEIGHT),
cell(returnTypeComboBox).weight(RIGHT_WEIGHT)
)
).getComponent();
} }
protected void refreshExtraAdvancedPane() { protected void refreshExtraAdvancedPane() {
@ -116,13 +117,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
extraPane.add(pane); extraPane.add(pane);
} }
} else { } else {
Component[][] components = new Component[][]{ extraPane = row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"))).weight(LEFT_WEIGHT),
}; cell(fontSizePane).weight(RIGHT_WEIGHT)
double[] rowSize = {P}; ).getComponent();
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}};
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
} }
} }

81
designer-form/src/main/java/com/fr/design/widget/ui/designer/DirectWriteEditorDefinePane.java

@ -3,27 +3,27 @@ package com.fr.design.widget.ui.designer;
import com.finebi.cbb.utils.CollectionUtils; import com.finebi.cbb.utils.CollectionUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder; import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.DirectWriteEditor; import com.fr.form.ui.DirectWriteEditor;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.FlowLayout;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
//richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树 //richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树
public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> { public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> {
public UICheckBox directWriteCheckBox; public UICheckBox directWriteCheckBox;
@ -36,33 +36,36 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = column(VERTICAL_GAP).getComponent();
UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
Component[] removeRepeatPane = new Component[]{createRepeatCheckBox(), null}; UICheckBox repeatCheckBox = createRepeatCheckBox();
Component[] dicPane = createDictPane(); Component[] dicPane = createDictPane();
Component[] waterMarkComponent = createWaterMarkPane(); Component[] waterMarkComponent = createWaterMarkPane();
initExtraPane(); initExtraPane();
Component[][] components = new Component[][]{ JPanel panel = column(VERTICAL_GAP,
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, row(
new Component[]{widgetValueLabel, formWidgetValuePane }, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
dicPane, cell(labelNameTextField).weight(RIGHT_WEIGHT)
removeRepeatPane, ),
waterMarkComponent, cell(formWidgetValuePane),
new Component[]{extraPane, null} row(
}; cell(dicPane[0]).weight(LEFT_WEIGHT),
double[] rowSize = {P, P, P, P, P, P, P, P}; cell(dicPane[1]).weight(RIGHT_WEIGHT)
double[] columnSize = {P, F}; ),
int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1},{1,1},{1,1}}; cell(repeatCheckBox)
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); ).getComponent();
// panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); if (waterMarkComponent[0] != null && waterMarkComponent[1] != null) {
advancePane.add(panel, BorderLayout.NORTH); panel.add(row(
cell(waterMarkComponent[0]).weight(LEFT_WEIGHT),
cell(waterMarkComponent[1]).weight(RIGHT_WEIGHT)
).getComponent());
}
panel.add(extraPane);
advancePane.add(panel);
JPanel otherPane = createOtherPane(); JPanel otherPane = createOtherPane();
if(otherPane != null){ if(otherPane != null){
advancePane.add(otherPane, BorderLayout.CENTER); advancePane.add(otherPane);
} }
return advancePane; return advancePane;
} }
@ -84,18 +87,17 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
extraPane.add(pane); extraPane.add(pane);
} }
} else { } else {
Component[][] components = new Component[][]{ extraPane = row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane} cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"))).weight(LEFT_WEIGHT),
}; cell(fontSizePane).weight(RIGHT_WEIGHT)
double[] rowSize = {P}; ).getComponent();
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}};
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
} }
} }
public UICheckBox createRepeatCheckBox(){ public UICheckBox createRepeatCheckBox(){
return null; UICheckBox emptyCheckBox = new UICheckBox();
emptyCheckBox.setVisible(false);
return emptyCheckBox;
} }
public Component[] createWaterMarkPane() { public Component[] createWaterMarkPane() {
@ -112,11 +114,8 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
public JPanel setValidatePane(){ public JPanel setValidatePane(){
directWriteCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Edit"), false); directWriteCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Edit"), false);
directWriteCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); JPanel otherContentPane = column(LayoutConstants.VERTICAL_GAP).getComponent();
JPanel otherContentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); otherContentPane.add(directWriteCheckBox);
otherContentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
JPanel jPanel = GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 0);
otherContentPane.add(jPanel);
return otherContentPane; return otherContentPane;
} }

67
designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -1,11 +1,10 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.ErrorMsgTextFieldAdapter; import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter; import com.fr.design.beans.UITextFieldAdapter;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
@ -14,28 +13,30 @@ import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.TextFieldAdapterProvider; import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.frpane.FontSizeComboPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.gui.frpane.FontSizeComboPane;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; 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.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
protected UICheckBox allowBlankCheckBox; protected UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
@ -45,6 +46,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected UITextField labelNameTextField; protected UITextField labelNameTextField;
protected final List<BasicBeanPane<T>> extraPaneList = new ArrayList<>(); protected final List<BasicBeanPane<T>> extraPaneList = new ArrayList<>();
protected JPanel extraPane; protected JPanel extraPane;
protected JPanel corePane;
protected static double F = TableLayout.FILL; protected static double F = TableLayout.FILL;
protected static double P = TableLayout.PREFERRED; protected static double P = TableLayout.PREFERRED;
@ -56,17 +58,17 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
corePane = column().getComponent();
this.add(corePane, BorderLayout.CENTER);
labelNameTextField = new UITextField(); labelNameTextField = new UITextField();
allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null")); allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null"));
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
fontSizePane = new FontSizeComboPane(); fontSizePane = new FontSizeComboPane();
JPanel contentPane = this.setFirstContentPane(); 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) { if (contentPane != null) {
UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, jPanel); contentPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
this.add(uiExpandablePane, BorderLayout.NORTH); UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, contentPane);
corePane.add(uiExpandablePane);
} }
this.addValidatePane(); this.addValidatePane();
} }
@ -74,6 +76,10 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initExtraPane() { protected void initExtraPane() {
initPluginListener(); initPluginListener();
refreshExtraAdvancedPane(); refreshExtraAdvancedPane();
if (extraPane == null) {
extraPane = new JPanel();
extraPane.setVisible(false);
}
} }
protected void refreshExtraAdvancedPane() { protected void refreshExtraAdvancedPane() {
@ -136,32 +142,25 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void addValidatePane() { protected void addValidatePane() {
initErrorMsgPane(); initErrorMsgPane();
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); validatePane = column(VERTICAL_GAP).getComponent();
final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip"));
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final JPanel errorTipPane = row(
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); cell(uiLabel).weight(LEFT_WEIGHT), cell(errorMsgTextField.getErrorMsgTextField()).weight(RIGHT_WEIGHT)
errorTipPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0)); ).getComponent();
borderPane.add(errorTipPane, BorderLayout.CENTER); allowBlankCheckBox.addItemListener(e -> {
allowBlankCheckBox.addItemListener(new ItemListener() { boolean selected = allowBlankCheckBox.isSelected();
@Override errorTipPane.setVisible(!selected);
public void itemStateChanged(ItemEvent e) {
boolean isSelected = allowBlankCheckBox.isSelected();
errorTipPane.setVisible(!isSelected);
}
}); });
Component[][] components = new Component[][]{ validatePane.add(column(VERTICAL_GAP,
new Component[]{allowBlankCheckBox}, cell(allowBlankCheckBox),
new Component[]{borderPane}, cell(errorTipPane)
}; ).getComponent());
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L6, 0);
panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L1, 0));
validatePane.add(panel, BorderLayout.NORTH);
JPanel contentPane = this.setValidatePane(); JPanel contentPane = this.setValidatePane();
if (contentPane != null) { 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, 20, validatePane); UIExpandablePane uiExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Validate"), 280, 20, validatePane);
this.add(uiExpandablePane, BorderLayout.CENTER); this.add(uiExpandablePane, BorderLayout.CENTER);

33
designer-form/src/main/java/com/fr/design/widget/ui/designer/FreeButtonDefinePane.java

@ -3,14 +3,21 @@ package com.fr.design.widget.ui.designer;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.component.ButtonBackgroundPane; import com.fr.design.widget.component.ButtonBackgroundPane;
import com.fr.form.ui.FreeButton; import com.fr.form.ui.FreeButton;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; 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.fine.swing.ui.layout.Layouts.flex;
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 ibm on 2017/8/6. * Created by ibm on 2017/8/6.
@ -19,6 +26,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
private ButtonBackgroundPane backgroundCompPane; private ButtonBackgroundPane backgroundCompPane;
private FRFontPane frFontPane; private FRFontPane frFontPane;
private UILabel fontLabel; private UILabel fontLabel;
private JPanel fontPanel;
public FreeButtonDefinePane(XCreator xcreator) { public FreeButtonDefinePane(XCreator xcreator) {
super(xcreator); super(xcreator);
@ -30,14 +38,15 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
} }
public Component[] createFontPane() { public Component[] createFontPane() {
JPanel fontLabelPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
fontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font")); fontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font"));
fontLabelPanel.add(fontLabel, BorderLayout.CENTER);
fontLabel.setVerticalAlignment(SwingConstants.TOP);
frFontPane = new FRFontPane(); frFontPane = new FRFontPane();
JPanel fontPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); fontPanel = row(
fontPanel.add(frFontPane, BorderLayout.CENTER); column(VERTICAL_GAP,
return new Component[]{fontLabelPanel, fontPanel}; cell(fontLabel).weight(1), flex(1), flex(1)
).weight(LEFT_WEIGHT),
cell(frFontPane).weight(RIGHT_WEIGHT)
).getComponent();
return new Component[]{fontPanel, null};
} }
public void populateSubButtonPane(FreeButton e) { public void populateSubButtonPane(FreeButton e) {
@ -45,8 +54,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
return; return;
} }
backgroundCompPane.populate(e); backgroundCompPane.populate(e);
frFontPane.setVisible(e.isCustomStyle()); fontPanel.setVisible(e.isCustomStyle());
fontLabel.setVisible(e.isCustomStyle());
if (e.isCustomStyle()) { if (e.isCustomStyle()) {
FRFont frFont = e.getFont(); FRFont frFont = e.getFont();
if (frFont != null) { if (frFont != null) {
@ -59,8 +67,7 @@ public class FreeButtonDefinePane extends ButtonDefinePane<FreeButton> {
FreeButton freeButton = (FreeButton) creator.toData(); FreeButton freeButton = (FreeButton) creator.toData();
if (!containsExtraPane) { if (!containsExtraPane) {
backgroundCompPane.update(freeButton); backgroundCompPane.update(freeButton);
frFontPane.setVisible(freeButton.isCustomStyle()); fontPanel.setVisible(freeButton.isCustomStyle());
fontLabel.setVisible(freeButton.isCustomStyle());
if (freeButton.isCustomStyle()) { if (freeButton.isCustomStyle()) {
FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont(); FRFont frFont = freeButton.getFont() == null ? FRFont.getInstance() : freeButton.getFont();
freeButton.setFont(frFontPane.update(frFont)); freeButton.setFont(frFontPane.update(frFont));

73
designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -1,11 +1,10 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fine.theme.icon.LazyIcon;
import com.finebi.cbb.utils.CollectionUtils; import com.finebi.cbb.utils.CollectionUtils;
import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
@ -14,27 +13,29 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FRFontPane; import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.form.ui.Label; import com.fr.form.ui.Label;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/** /**
* 标签控件pane * 标签控件pane
@ -44,7 +45,6 @@ import java.util.Set;
* Created on 2023/11/13 * Created on 2023/11/13
*/ */
public class LabelDefinePane extends AbstractDataModify<Label> { public class LabelDefinePane extends AbstractDataModify<Label> {
private static final int WIDGET_VALUE_PANE_WIDTH = 150;
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
private UICheckBox isPageSetupVertically; private UICheckBox isPageSetupVertically;
private UICheckBox isStyleAlignmentWrapText; private UICheckBox isStyleAlignmentWrapText;
@ -53,8 +53,6 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
private final List<BasicBeanPane<Label>> extraPaneList = new ArrayList<>(); private final List<BasicBeanPane<Label>> extraPaneList = new ArrayList<>();
private JPanel extraPane; private JPanel extraPane;
private static final double F = TableLayout.FILL;
private static final double P = TableLayout.PREFERRED;
public LabelDefinePane(XCreator xCreator) { public LabelDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
@ -71,37 +69,27 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
public JPanel createAdvancePane() { public JPanel createAdvancePane() {
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
isPageSetupVertically = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Page_Setup_Vertically")); isPageSetupVertically = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Page_Setup_Vertically"));
isPageSetupVertically.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
isStyleAlignmentWrapText = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Wrap_Text")); isStyleAlignmentWrapText = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Wrap_Text"));
isStyleAlignmentWrapText.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()},
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), {new LazyIcon("h_center"), new LazyIcon("h_center").white()},
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), {new LazyIcon("h_right"), new LazyIcon("h_right").white()}};
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png"),};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}; Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment); hAlignmentPane = new UIButtonGroup<>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left") hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left")
, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")}); , com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")});
initExtraPane(); initExtraPane();
double[] rowSize = {P, P, P, P, P, P};
double[] columnSize = {F, WIDGET_VALUE_PANE_WIDTH}; return column(VERTICAL_GAP,
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; cell(formWidgetValuePane),
UILabel widgetValueLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value")); cell(isStyleAlignmentWrapText),
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); cell(isPageSetupVertically),
UILabel fontLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font")); row(
fontLabel.setVerticalAlignment(SwingConstants.TOP); cell(FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position_Similar"))).weight(LEFT_WEIGHT),
Component[][] components = new Component[][]{ cell(hAlignmentPane).weight(RIGHT_WEIGHT)
new Component[]{widgetValueLabel, formWidgetValuePane}, ),
new Component[]{isStyleAlignmentWrapText, null}, cell(extraPane)
new Component[]{isPageSetupVertically, null}, ).getComponent();
new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position_Similar")), hAlignmentPane},
new Component[]{extraPane, null},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W4 - 5, IntervalConstants.INTERVAL_L1);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
boundsPane.add(panel);
return boundsPane;
} }
private void initExtraPane() { private void initExtraPane() {
@ -129,13 +117,10 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
} else { } else {
// 字体大小是浮点数,因为涉及很多字体计算,不太好修改,为了完整显示字体,将FRFontPane中的fontSizeComboBox拉长一点 // 字体大小是浮点数,因为涉及很多字体计算,不太好修改,为了完整显示字体,将FRFontPane中的fontSizeComboBox拉长一点
frFontPane = new FRFontPane(LayoutConstants.VGAP_MEDIUM); frFontPane = new FRFontPane(LayoutConstants.VGAP_MEDIUM);
Component[][] components = new Component[][]{ extraPane = row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), frFontPane} cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"))).weight(LEFT_WEIGHT),
}; cell(frFontPane).weight(RIGHT_WEIGHT)
double[] rowSize = {P}; ).getComponent();
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}};
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
} }
} }

54
designer-form/src/main/java/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java

@ -3,26 +3,28 @@ package com.fr.design.widget.ui.designer;
import com.finebi.cbb.utils.CollectionUtils; import com.finebi.cbb.utils.CollectionUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.widget.component.NumberEditorValidatePane; import com.fr.design.widget.component.NumberEditorValidatePane;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFormattedTextField; import javax.swing.JFormattedTextField;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.Component;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/** /**
* 数字编辑控件pane * 数字编辑控件pane
* *
@ -53,25 +55,20 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
// richer:数字的允许直接编辑没有意义 // richer:数字的允许直接编辑没有意义
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
initExtraPane(); initExtraPane();
Component[][] components = new Component[][]{ return column(VERTICAL_GAP,
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, row(
new Component[]{widgetValueLabel, formWidgetValuePane}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), waterMarkDictPane}, cell(labelNameTextField).weight(RIGHT_WEIGHT)
new Component[]{extraPane, null} ),
}; cell(formWidgetValuePane),
double[] rowSize = {p, p, p, p, p, p}; row(
double[] columnSize = {p,f}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"))).weight(LEFT_WEIGHT),
int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1}}; cell(waterMarkDictPane).weight(RIGHT_WEIGHT)
JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); ),
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); cell(extraPane)
boundsPane.add(advancePane); ).getComponent();
return boundsPane;
} }
protected void refreshExtraAdvancedPane() { protected void refreshExtraAdvancedPane() {
@ -92,13 +89,10 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
extraPane.add(pane); extraPane.add(pane);
} }
} else { } else {
Component[][] components = new Component[][]{ extraPane = row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane} cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"))).weight(LEFT_WEIGHT),
}; cell(fontSizePane).weight(RIGHT_WEIGHT)
double[] rowSize = {P}; ).getComponent();
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}};
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
} }
} }

52
designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -3,7 +3,6 @@ package com.fr.design.widget.ui.designer;
import com.finebi.cbb.utils.CollectionUtils; import com.finebi.cbb.utils.CollectionUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.fun.RegPaneProvider; import com.fr.design.fun.RegPaneProvider;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
@ -12,20 +11,25 @@ import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.Component;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> { public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegFieldPane regPane; protected RegFieldPane regPane;
private UITextField waterMarkDictPane; private UITextField waterMarkDictPane;
@ -47,14 +51,12 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
regPane.removeRegChangeListener(this); regPane.removeRegChangeListener(this);
} }
}; };
final RegPane.PhoneRegListener pl = new RegPane.PhoneRegListener() { final RegPane.PhoneRegListener pl = e -> {
public void phoneRegChangeAction(RegPane.PhoneRegEvent e) {
if (StringUtils.isNotEmpty(e.getPhoneRegString()) if (StringUtils.isNotEmpty(e.getPhoneRegString())
&& StringUtils.isEmpty(waterMarkDictPane.getText())) { && StringUtils.isEmpty(waterMarkDictPane.getText())) {
waterMarkDictPane.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":" + e.getPhoneRegString()); waterMarkDictPane.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":" + e.getPhoneRegString());
regPane.addRegChangeListener(rl); regPane.addRegChangeListener(rl);
} }
}
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
waterMarkDictPane = new UITextField(); waterMarkDictPane = new UITextField();
@ -70,19 +72,18 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"), SwingConstants.LEFT); UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"), SwingConstants.LEFT);
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
initExtraPane(); initExtraPane();
Component[][] components = new Component[][]{ return column(VERTICAL_GAP,
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, row(
new Component[]{widgetValueLabel, formWidgetValuePane}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"), SwingConstants.LEFT), waterMarkDictPane}, cell(labelNameTextField).weight(RIGHT_WEIGHT)
new Component[]{extraPane, null} ),
}; cell(formWidgetValuePane),
double[] rowSize = {P, P, P, P, P}; row(
double[] columnSize = {P, F}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"))).weight(LEFT_WEIGHT),
int[][] rowCount = {{1, 1}, {1, 3}, {1, 1}, {1, 1}}; cell(waterMarkDictPane).weight(RIGHT_WEIGHT)
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); ),
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); cell(extraPane)
boundsPane.add(panel); ).getComponent();
return boundsPane;
} }
protected void refreshExtraAdvancedPane() { protected void refreshExtraAdvancedPane() {
@ -103,13 +104,10 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
extraPane.add(pane); extraPane.add(pane);
} }
} else { } else {
Component[][] components = new Component[][]{ extraPane = row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"), SwingConstants.LEFT), fontSizePane} cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"))).weight(LEFT_WEIGHT),
}; cell(fontSizePane).weight(RIGHT_WEIGHT)
double[] rowSize = {P}; ).getComponent();
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}};
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
} }
} }

15
designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java

@ -4,16 +4,17 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane; import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component; 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.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/* /*
* richer:tree editor * richer:tree editor
@ -31,10 +32,6 @@ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEdi
public JPanel createOtherPane() { public JPanel createOtherPane() {
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane(); returnTypePane = new ReturnTypePane();
JPanel panel = FRGUIPaneFactory.createBorderLayout_L_Pane();
panel.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
panel.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> { treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath(); boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane); returnTypePane.setVisible(showReturnTypePane);
@ -42,7 +39,9 @@ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEdi
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY); returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
} }
}); });
return panel; return column(VERTICAL_GAP,
cell(treeRootPane), cell(returnTypePane)
).getComponent();
} }
@Override @Override

3
designer-form/src/main/java/com/fr/design/widget/ui/designer/WaterMarkDictPane.java

@ -4,7 +4,7 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.WaterMark; import com.fr.form.ui.WaterMark;
import javax.swing.*; import javax.swing.JPanel;
public class WaterMarkDictPane extends JPanel{ public class WaterMarkDictPane extends JPanel{
@ -12,7 +12,6 @@ public class WaterMarkDictPane extends JPanel{
public WaterMarkDictPane() { public WaterMarkDictPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0));
waterMarkTextField = new UITextField(); waterMarkTextField = new UITextField();
this.add(waterMarkTextField); this.add(waterMarkTextField);
} }

5
designer-form/src/main/java/com/fr/design/widget/ui/designer/WriteUnableRepeatEditorPane.java

@ -6,8 +6,8 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.WriteUnableRepeatEditor; import com.fr.form.ui.WriteUnableRepeatEditor;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import java.awt.BorderLayout;
public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEditor> extends FieldEditorDefinePane<WriteUnableRepeatEditor> { public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEditor> extends FieldEditorDefinePane<WriteUnableRepeatEditor> {
// richer:是否去除重复的值 // richer:是否去除重复的值
@ -20,7 +20,6 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Remove_Repeat_Data"), false); removeRepeatCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Remove_Repeat_Data"), false);
contentPane.add(contenter); contentPane.add(contenter);

57
designer-form/src/main/java/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java

@ -4,13 +4,10 @@ import com.finebi.cbb.utils.CollectionUtils;
import com.fr.data.Dictionary; import com.fr.data.Dictionary;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.fun.WidgetAdvancedPaneProvider; import com.fr.design.fun.WidgetAdvancedPaneProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder; import com.fr.design.widgettheme.processor.WidgetThemeParaCreatorPaneAdder;
import com.fr.design.widget.ui.designer.ButtonGroupDictPane; import com.fr.design.widget.ui.designer.ButtonGroupDictPane;
@ -19,11 +16,15 @@ import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.ButtonGroup; import com.fr.form.ui.ButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.Set; 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;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/** /**
* Created by ibm on 2017/8/5. * Created by ibm on 2017/8/5.
*/ */
@ -39,30 +40,27 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = column(VERTICAL_GAP).getComponent();
dictionaryEditor = new AccessibleDictionaryEditor(); dictionaryEditor = new AccessibleDictionaryEditor();
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false);
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
initExtraPane(); initExtraPane();
Component[][] components = new Component[][]{ advancePane.add(column(VERTICAL_GAP,
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, row(
new Component[]{widgetValueLabel, formWidgetValuePane}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name"))).weight(LEFT_WEIGHT),
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictionaryEditor}, cell(labelNameTextField).weight(RIGHT_WEIGHT)
new Component[]{extraPane, null}, ),
new Component[]{buttonGroupDictPane, null} cell(formWidgetValuePane),
}; row(
double[] rowSize = {p, p, p, p, p, p, p}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary"))).weight(LEFT_WEIGHT),
double[] columnSize = {p, f}; cell(dictionaryEditor).weight(RIGHT_WEIGHT)
int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1},{1, 1}}; ),
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); cell(extraPane),
advancePane.add(panel, BorderLayout.NORTH); cell(buttonGroupDictPane)
).getComponent());
JPanel otherPane = createOtherPane(); JPanel otherPane = createOtherPane();
if (otherPane != null) { if (otherPane != null) {
advancePane.add(otherPane, BorderLayout.CENTER); advancePane.add(otherPane);
} }
return advancePane; return advancePane;
@ -86,13 +84,10 @@ public abstract class ButtonGroupDefinePane<T extends ButtonGroup> extends Field
extraPane.add(pane); extraPane.add(pane);
} }
} else { } else {
Component[][] components = new Component[][]{ extraPane = row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane} cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"))).weight(LEFT_WEIGHT),
}; cell(fontSizePane).weight(RIGHT_WEIGHT)
double[] rowSize = {P}; ).getComponent();
double[] columnSize = {P, F};
int[][] rowCount = {{1, 1}};
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
} }
} }

51
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/FormWidgetValuePane.java

@ -1,27 +1,32 @@
package com.fr.design.widget.ui.designer.component; package com.fr.design.widget.ui.designer.component;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.BooleanEditor; import com.fr.design.editor.editor.BooleanEditor;
import com.fr.design.editor.editor.DateEditor; import com.fr.design.editor.editor.DateEditor;
import com.fr.design.editor.editor.DoubleEditor; import com.fr.design.editor.editor.DoubleEditor;
import com.fr.design.editor.editor.Editor; import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.FormulaEditor; import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.gui.core.ReactiveCardPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.widget.editors.DataBindingEditor; import com.fr.design.mainframe.widget.editors.DataBindingEditor;
import com.fr.design.mainframe.widget.editors.DataTableEditor; import com.fr.design.mainframe.widget.editors.DataTableEditor;
import com.fr.design.mainframe.widget.editors.ServerDataBindingEditor; import com.fr.design.mainframe.widget.editors.ServerDataBindingEditor;
import com.fr.design.mainframe.widget.editors.ServerDataTableEditor; import com.fr.design.mainframe.widget.editors.ServerDataTableEditor;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.ui.DataControl; import com.fr.form.ui.DataControl;
import com.fr.form.ui.WidgetValue; import com.fr.form.ui.WidgetValue;
import com.fr.form.ui.concept.data.ValueInitializer; import com.fr.form.ui.concept.data.ValueInitializer;
import com.fr.general.ComparatorUtils;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.UIManager;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension; 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.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.VERTICAL_GAP;
/** /**
* Created by ibm on 2017/7/27. * Created by ibm on 2017/7/27.
@ -29,23 +34,32 @@ import java.awt.Dimension;
public class FormWidgetValuePane extends JPanel { public class FormWidgetValuePane extends JPanel {
private UIButtonGroup widgetValueHead; private UIButtonGroup widgetValueHead;
private Editor[] editor; private Editor[] editor;
private JPanel customPane; private ReactiveCardPane customPane;
private CardLayout cardLayout;
public FormWidgetValuePane(Object o, boolean onlyServer) { public FormWidgetValuePane(Object o, boolean onlyServer) {
DataControl widget = (DataControl) o; DataControl widget = (DataControl) o;
editor = createWidgetValueEditor(widget, onlyServer); editor = createWidgetValueEditor(widget, onlyServer);
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL)); this.setLayout(new BorderLayout());
cardLayout = new CardLayout(); customPane = ReactiveCardPane.create();
customPane = new JPanel(cardLayout);
final String[] tabTitles = new String[editor.length]; final String[] tabTitles = new String[editor.length];
for (int i = 0; i < editor.length; i++) { for (int i = 0; i < editor.length; i++) {
customPane.add(editor[i], editor[i].getName()); Editor currentEditor = editor[i];
customPane.addSupplier(editor[i].getName(), () -> currentEditor);
tabTitles[i] = editor[i].getName(); tabTitles[i] = editor[i].getName();
} }
customPane.select(editor[0].getName()).populate();
widgetValueHead = new UIButtonGroup(tabTitles); widgetValueHead = new UIButtonGroup(tabTitles);
this.add(widgetValueHead, BorderLayout.NORTH); UILabel widgetValueLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
this.add(customPane, BorderLayout.CENTER); this.add(column(VERTICAL_GAP,
row(
cell(widgetValueLabel).weight(LEFT_WEIGHT),
cell(widgetValueHead).weight(RIGHT_WEIGHT)
),
row(
flex(LEFT_WEIGHT),
cell(customPane).weight(RIGHT_WEIGHT)
)
).getComponent());
} }
@ -55,14 +69,7 @@ public class FormWidgetValuePane extends JPanel {
index = 0; index = 0;
widgetValueHead.setSelectedIndex(index); widgetValueHead.setSelectedIndex(index);
} }
int vgap = UIManager.getInt("DataBindingEditor.vgap"); customPane.select(editor[index].getName()).populate();
int height = UIManager.getInt("DataBindingEditor.height");
if (ComparatorUtils.equals(editor[index].getName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Field"))) {
customPane.setPreferredSize(new Dimension(100, FineUIScale.scale(height * 2 + vgap)));
} else {
customPane.setPreferredSize(new Dimension(100, FineUIScale.scale(height)));
}
cardLayout.show(customPane, editor[index].getName());
} }

17
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -1,5 +1,7 @@
package com.fr.design.widget.ui.designer.component; package com.fr.design.widget.ui.designer.component;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
@ -205,10 +207,10 @@ public class WidgetBoundPane extends BasicPane {
protected static class AspectRatioLockedButton extends JButton implements UIObserver, GlobalNameObserver { protected static class AspectRatioLockedButton extends JButton implements UIObserver, GlobalNameObserver {
private final Icon enabledLocked = IOUtils.readIcon("/com/fr/design/images/buttonicon/icon_lock_enabled.png"); private final Icon enabledLocked = new LazyIcon("locked");
private final Icon disabledLocked = IOUtils.readIcon("/com/fr/design/images/buttonicon/icon_lock_disabled.png"); private final Icon disabledLocked = new LazyIcon("locked").disabled();
private final Icon enabledUnLocked = IOUtils.readIcon("/com/fr/design/images/buttonicon/icon_unlock_enabled.png"); private final Icon enabledUnLocked = new LazyIcon("unlocked");
private final Icon disabledUnLocked = IOUtils.readIcon("/com/fr/design/images/buttonicon/icon_unlock_disabled.png"); private final Icon disabledUnLocked = new LazyIcon("unlocked").disabled();
private UIObserverListener uiObserverListener; private UIObserverListener uiObserverListener;
private GlobalNameListener globalNameListener; private GlobalNameListener globalNameListener;
@ -220,14 +222,9 @@ public class WidgetBoundPane extends BasicPane {
protected double aspectRatioBackup = 0; protected double aspectRatioBackup = 0;
public AspectRatioLockedButton(UISpinner widthSpinner, UISpinner heightSpinner) { public AspectRatioLockedButton(UISpinner widthSpinner, UISpinner heightSpinner) {
setUI(new BasicButtonUI());
setBorderPainted(false);
setBorder(null);
setContentAreaFilled(false);
setPreferredSize(new Dimension(24, 24));
this.mWidthSpinner = widthSpinner; this.mWidthSpinner = widthSpinner;
this.mHeightSpinner = heightSpinner; this.mHeightSpinner = heightSpinner;
FineUIStyle.setStyle(this, FineUIStyle.PLAIN_BUTTON);
addActionListener(new ActionListener() { addActionListener(new ActionListener() {
@Override @Override

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/BaseTextEditorMobileDefinePane.java

@ -1,5 +1,6 @@
package com.fr.design.widget.ui.designer.mobile; package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
@ -12,7 +13,8 @@ import com.fr.form.ui.TextEditor;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.FlowLayout;
import static com.fine.swing.ui.layout.Layouts.column;
/** /**
* <p> 文本类组件移动端高级属性的定义面板基础扩展可以直接继承此面板 * <p> 文本类组件移动端高级属性的定义面板基础扩展可以直接继承此面板
@ -34,7 +36,7 @@ public class BaseTextEditorMobileDefinePane extends MobileWidgetDefinePane {
@Override @Override
public void initPropertyGroups(Object source) { public void initPropertyGroups(Object source) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel container = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); JPanel container = column(LayoutConstants.VERTICAL_GAP).getComponent();
addPropertyPanesToContainer(container); addPropertyPanesToContainer(container);
this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, container), BorderLayout.NORTH); this.add(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, container), BorderLayout.NORTH);
this.repaint(); this.repaint();

30
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ButtonGroupDefinePane.java

@ -1,20 +1,21 @@
package com.fr.design.widget.ui.designer.mobile; package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.form.ui.ButtonGroup; import com.fr.form.ui.ButtonGroup;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class ButtonGroupDefinePane extends MobileWidgetDefinePane { public class ButtonGroupDefinePane extends MobileWidgetDefinePane {
@ -31,21 +32,12 @@ public class ButtonGroupDefinePane extends MobileWidgetDefinePane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel maxShowRowsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design-Mobile_Max_Show_Rows"), SwingConstants.LEFT); UILabel maxShowRowsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design-Mobile_Max_Show_Rows"), SwingConstants.LEFT);
this.maxShowRowsSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 5); this.maxShowRowsSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 5);
Component[][] components = new Component[][]{ final JPanel panel = row(
new Component[] {maxShowRowsLabel, maxShowRowsSpinner} cell(maxShowRowsLabel).weight(1.5),
}; cell(maxShowRowsSpinner).weight(2)
double f = TableLayout.FILL; ).getComponent();
double p = TableLayout.PREFERRED; UIExpandablePane folderPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panel);
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);
UIExpandablePane folderPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, panelWrapper);
this.add(folderPane, BorderLayout.NORTH); this.add(folderPane, BorderLayout.NORTH);
this.repaint();
} }
private void bindListeners2Widgets() { private void bindListeners2Widgets() {

Loading…
Cancel
Save