Browse Source

Merge pull request #7076 in DESIGN/design from release/10.0 to final/10.0

* commit '20970382920669c62ac950e8140be5ed1882069d':
  REPORT-62804 设计器工具栏的链接改动(社区url改动需求)
  REPORT-63106 决策报表-两个组件选中时拖拽到其他位置,然后点击对齐任意一个,两个组件会跳回刚才的位置
  REPORT-63092 漏传了import语句
  REPORT-63499
  REPORT-63499 按钮控件树节点配置控件事件,设计器上显示有问题
  update
  CHART-21584 feat:fvs.chart.font 单位px 范围6-200
  REPORT-63092 组件复用-拖入带数据集的复用组件,删除设计画布中的组件后,数据集没有被删除
  REPORT-60161 【组件背景分离】设置九点图的线在边界上后,其他操作回来发现恢复成默认井字型
  REPORT-56014 & REPORT-56015 【组件背景分离】【下个版本】组件复用-组件边框点九图,如果线重叠了的话,web端显示有问题
  REPORT-63322 决策报表及聚合报表,无法拖动组件
  REPORT-62691 11.0版本产出的组件,在10.0下正常安装,但复用时模板保存失败
  REPORT-63310 已保存的无边框tab块在绝对布局内调整组件大小后,自动生成了默认黑色边框 & REPORT-59963 调整Tab块样式会导致Tab标题背景色重置
final/10.0
superman 3 years ago
parent
commit
9887725d41
  1. 2
      designer-base/src/main/java/com/fr/design/actions/community/BugAction.java
  2. 2
      designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java
  3. 17
      designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java
  4. 5
      designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java
  5. 7
      designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java
  6. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  7. 2
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  8. BIN
      designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png
  9. 1
      designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan_normal.svg
  10. 8
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  11. 13
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java
  12. 18
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  13. 24
      designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java
  14. 18
      designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java
  15. 33
      designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java
  16. 22
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java
  17. 3
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  18. 81
      designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java
  19. 73
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  20. 14
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java
  21. 15
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java
  22. 15
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java
  23. 15
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java
  24. 15
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java
  25. 4
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java
  26. 15
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java
  27. 15
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java
  28. 13
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java
  29. 13
      designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java
  30. 5
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java
  31. 1
      designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

2
designer-base/src/main/java/com/fr/design/actions/community/BugAction.java

@ -17,7 +17,7 @@ public class BugAction extends AbstractDesignerSSO {
@Override @Override
public String getJumpUrl() { public String getJumpUrl() {
return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "http://bbs.fanruan.com/forum-156-1.html"); return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "https://service.fanruan.com/PF/FR/feedback");
} }
public static final MenuKeySet BUG = new MenuKeySet() { public static final MenuKeySet BUG = new MenuKeySet() {

2
designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java

@ -18,7 +18,7 @@ public class NeedAction extends AbstractDesignerSSO {
@Override @Override
public String getJumpUrl() { public String getJumpUrl() {
return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "http://bbs.fanruan.com/forum-56-1.html"); return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "https://service.fanruan.com/PF/FR/feedback");
} }
public static final MenuKeySet NEED = new MenuKeySet() { public static final MenuKeySet NEED = new MenuKeySet() {

17
designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java

@ -0,0 +1,17 @@
package com.fr.design.actions.community;
import com.fr.design.i18n.Toolkit;
import com.fr.design.login.AbstractDesignerSSO;
import com.fr.general.CloudCenter;
public class StudyPlanAction extends AbstractDesignerSSO {
public StudyPlanAction() {
this.setName(Toolkit.i18nText("Fine-Design_Study_Plan"));
this.setSmallIcon("/com/fr/design/images/bbs/studyPlan");
}
@Override
public String getJumpUrl() {
return CloudCenter.getInstance().acquireUrlByKind("bbs.studyPlan", "https://edu.fanruan.com/studypath/finereport");
}
}

5
designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java

@ -0,0 +1,5 @@
package com.fr.design.constants;
public class TableDataConstants {
public static final String SEPARATOR = "_";
}

7
designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java

@ -1,6 +1,7 @@
package com.fr.design.data; package com.fr.design.data;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.design.constants.TableDataConstants;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -11,8 +12,6 @@ import com.fr.stable.StringUtils;
* Created by hades on 2020/4/27 * Created by hades on 2020/4/27
*/ */
public abstract class BasicTableDataUtils { public abstract class BasicTableDataUtils {
private static final String SEPARATOR = "_";
private static final int LEN = 2; private static final int LEN = 2;
@ -38,10 +37,10 @@ public abstract class BasicTableDataUtils {
public static String getTableDataName(boolean isCover, TableDataSource tds, String tdName, String srcName, boolean isDsNameRepeaded) { public static String getTableDataName(boolean isCover, TableDataSource tds, String tdName, String srcName, boolean isDsNameRepeaded) {
if (isCover) { if (isCover) {
return srcName + SEPARATOR + tdName; return srcName + TableDataConstants.SEPARATOR + tdName;
} }
if (tds.getTableData(tdName) != null || isDsNameRepeaded) {//如果有同名的就拼上来源名称 if (tds.getTableData(tdName) != null || isDsNameRepeaded) {//如果有同名的就拼上来源名称
tdName = srcName + SEPARATOR + tdName; tdName = srcName + TableDataConstants.SEPARATOR + tdName;
} }
int i = 0; int i = 0;
while (tds.getTableData(tdName) != null) { while (tds.getTableData(tdName) != null) {

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

@ -125,7 +125,9 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
for (int i = 0, size = widget.getListenerSize(); i < size; i++) { for (int i = 0, size = widget.getListenerSize(); i < size; i++) {
Listener listener = widget.getListener(i); Listener listener = widget.getListener(i);
if (!listener.isDefault()) { if (!listener.isDefault()) {
nameObjectList.add(i, new NameObject(switchLang(listener.getEventName()) + (i + 1), listener)); String eventName = switchLang(listener.getEventName()) + (nameObjectList.size() + 1);
NameObject nameObject = new NameObject(eventName, listener);
nameObjectList.add(nameObject);
} }
} }
populate(getHelper().processCatalog(nameObjectList)); populate(getHelper().processCatalog(nameObjectList));

2
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -17,6 +17,7 @@ import com.fr.design.actions.community.FacebookFansAction;
import com.fr.design.actions.community.NeedAction; import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction; import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction; import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.StudyPlanAction;
import com.fr.design.actions.community.TechSolutionAction; import com.fr.design.actions.community.TechSolutionAction;
import com.fr.design.actions.community.TechSupportAction; import com.fr.design.actions.community.TechSupportAction;
import com.fr.design.actions.community.TemplateStoreAction; import com.fr.design.actions.community.TemplateStoreAction;
@ -597,6 +598,7 @@ public abstract class ToolBarMenuDock {
shortCuts.add(new TutorialAction()); shortCuts.add(new TutorialAction());
} }
}, SupportLocaleImpl.TUTORIAL_COMMUNITY); }, SupportLocaleImpl.TUTORIAL_COMMUNITY);
shortCuts.add(new StudyPlanAction());
shortCuts.add(new QuestionAction()); shortCuts.add(new QuestionAction());
shortCuts.add(new TechSolutionAction()); shortCuts.add(new TechSolutionAction());

BIN
designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

1
designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan_normal.svg

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>l</title><path d="M8.77.94A7.13,7.13,0,0,0,3.27,2.8,7.2,7.2,0,0,0,8.14,15.3a7.11,7.11,0,0,0,3.23-.77l-.54-1a6,6,0,1,1,2.34-2.08.59.59,0,0,0,1,.65A7.2,7.2,0,0,0,8.77.94Z"/><path d="M6.35,8.54h3.73a1.66,1.66,0,0,0,0-3.31H6.79a1.08,1.08,0,0,0-2.06.47A1.08,1.08,0,0,0,5.81,6.78a1.1,1.1,0,0,0,1-.61h3.29a.72.72,0,0,1,0,1.43H6.35a1.82,1.82,0,0,0,0,3.63H9.73a.87.87,0,0,0,.69.35.86.86,0,1,0-.73-1.29H6.35a.88.88,0,0,1,0-1.75ZM6.19,5.71a.38.38,0,1,1-.38-.38A.38.38,0,0,1,6.19,5.71ZM10.42,11a.28.28,0,0,1-.27-.28.27.27,0,0,1,.54,0A.28.28,0,0,1,10.42,11Z"/></svg>

After

Width:  |  Height:  |  Size: 655 B

8
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -13,6 +13,7 @@ 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.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
@ -29,16 +30,21 @@ public class ChartTextAttrPane extends BasicPane {
private static final long serialVersionUID = 6731679928019436869L; private static final long serialVersionUID = 6731679928019436869L;
public static final int FONT_START = 6; public static final int FONT_START = 6;
public static final int FONT_END = 72; public static final int FONT_END = 72;
public static final int FONT_END_4_DUCHAMP = 200;
private UIComboBox fontNameComboBox; private UIComboBox fontNameComboBox;
private UIComboBox fontSizeComboBox; private UIComboBox fontSizeComboBox;
private UIToggleButton bold; private UIToggleButton bold;
private UIToggleButton italic; private UIToggleButton italic;
private UIColorButton fontColor; private UIColorButton fontColor;
public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1];
private static Integer[] FONT_SIZES_4_DUCHAMP = new Integer[FONT_END_4_DUCHAMP - FONT_START + 1];
static { static {
for (int i = FONT_START; i <= FONT_END; i++) { for (int i = FONT_START; i <= FONT_END; i++) {
FONT_SIZES[i - FONT_START] = i; FONT_SIZES[i - FONT_START] = i;
} }
for (int i = FONT_START; i <= FONT_END_4_DUCHAMP; i++) {
FONT_SIZES_4_DUCHAMP[i - FONT_START] = i;
}
} }
public ChartTextAttrPane() { public ChartTextAttrPane() {
@ -176,7 +182,7 @@ public class ChartTextAttrPane extends BasicPane {
} }
protected Object[] getFontSizeComboBoxModel() { protected Object[] getFontSizeComboBoxModel() {
return FONT_SIZES; return ChartEditContext.duchampMode() ? FONT_SIZES_4_DUCHAMP : FONT_SIZES;
} }
protected void initState() { protected void initState() {

13
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java

@ -4,23 +4,30 @@ import com.fr.chart.base.ChartConstants;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.gui.ibutton.UIColorButtonWithAuto;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.type.FontAutoType; import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.plugin.chart.type.FontAutoType;
public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto");
private FontAutoType type; private FontAutoType type;
public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2]; public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2];
private static String[] FONT_SIZES_WITH_AUTO_4_DUCHAMP = new String[FONT_END_4_DUCHAMP - FONT_START + 2];
static { static {
FONT_SIZES_WITH_AUTO[0] = AUTO; FONT_SIZES_WITH_AUTO[0] = AUTO;
FONT_SIZES_WITH_AUTO_4_DUCHAMP[0] = AUTO;
for (int i = 1; i < FONT_SIZES_WITH_AUTO.length; i++) { for (int i = 1; i < FONT_SIZES_WITH_AUTO.length; i++) {
FONT_SIZES_WITH_AUTO[i] = FONT_START + i - 1 + ""; FONT_SIZES_WITH_AUTO[i] = FONT_START + i - 1 + "";
} }
for (int i = 1; i < FONT_SIZES_WITH_AUTO_4_DUCHAMP.length; i++) {
FONT_SIZES_WITH_AUTO_4_DUCHAMP[i] = FONT_START + i - 1 + "";
}
} }
public ChartTextAttrPaneWithAuto(FontAutoType type) { public ChartTextAttrPaneWithAuto(FontAutoType type) {
@ -42,7 +49,9 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
} }
protected Object[] getFontSizeComboBoxModel() { protected Object[] getFontSizeComboBoxModel() {
return isFontSizeAuto() ? FONT_SIZES_WITH_AUTO : FONT_SIZES; return isFontSizeAuto()
? (ChartEditContext.duchampMode() ? FONT_SIZES_WITH_AUTO_4_DUCHAMP : FONT_SIZES_WITH_AUTO)
: super.getFontSizeComboBoxModel();
} }
protected float updateFontSize() { protected float updateFontSize() {

18
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -62,10 +62,6 @@ public class XWCardLayout extends XLayoutContainer {
public static final String DEFAULT_NAME = "cardlayout"; public static final String DEFAULT_NAME = "cardlayout";
//默认蓝色标题背景
private static final Color TITLE_COLOR = new Color(51, 132, 240);
public XWCardLayout(WCardLayout widget, Dimension initSize) { public XWCardLayout(WCardLayout widget, Dimension initSize) {
super(widget, initSize); super(widget, initSize);
} }
@ -399,24 +395,10 @@ public class XWCardLayout extends XLayoutContainer {
@Override @Override
public void refreshStylePreviewEffect() { public void refreshStylePreviewEffect() {
BorderPacker style = toData().getBorderStyle(); BorderPacker style = toData().getBorderStyle();
initBorderTitleStyle(style);
refreshBorderAndBackgroundStylePreviewEffect(); refreshBorderAndBackgroundStylePreviewEffect();
clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)); clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE));
} }
private void initBorderTitleStyle(BorderPacker style) {
//初始化默认标题样式
if (!initFlag) {
return;
}
style.setType(LayoutBorderStyle.TITLE);
style.setBorder(Constants.LINE_THIN);
TitlePacker widgetTitle = style.getTitle();
widgetTitle.setBackground(ColorBackground.getInstance(TITLE_COLOR));
initFlag = false;
}
//隐藏或显示标题部分 //隐藏或显示标题部分
protected void clearOrShowTitleLayout(boolean isTitleStyle) { protected void clearOrShowTitleLayout(boolean isTitleStyle) {
XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) this.getBackupParent(); XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) this.getBackupParent();

24
designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java

@ -298,15 +298,16 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
Background borderImage = style.getBorderImage(); Background borderImage = style.getBorderImage();
if (borderImage instanceof ImageBackground) { if (borderImage instanceof ImageBackground) {
// 图片类型边框 // 图片类型边框
Image image = ((ImageBackground) borderImage).getImage(); ImageBackground imageBackground = (ImageBackground) borderImage;
int[] ninePoint = ((ImageBackground) borderImage).getNinePoint(); Image image = imageBackground.getImage();
if (image != null) { if (image != null) {
this.borderLineCombo.selectBorderImage(); this.borderLineCombo.selectBorderImage();
this.imagePreviewPane.setImageWithSuffix(((ImageBackground) borderImage).getImageWithSuffix()); this.imagePreviewPane.setImageWithSuffix(((ImageBackground) borderImage).getImageWithSuffix());
this.tweakNinePointButton.setEnabled(true); this.tweakNinePointButton.setEnabled(true);
this.borderImageOpacityPane.populateBean(style.getBorderImageOpacity()); this.borderImageOpacityPane.populateBean(style.getBorderImageOpacity());
if (ninePoint != null && ninePoint.length == 4 && ninePoint[0] > 0 && ninePoint[1] > 0 && ninePoint[2] > 0 && ninePoint[3] > 0) { int[] ninePoint = ((ImageBackground) borderImage).getNinePoint();
if (ninePoint != null && ninePoint.length == 4 && ninePoint[0] >= 0 && ninePoint[1] >= 0 && ninePoint[2] >= 0 && ninePoint[3] >= 0) {
this.ninePoint = Arrays.copyOf(ninePoint, 4); this.ninePoint = Arrays.copyOf(ninePoint, 4);
} else { } else {
this.ninePoint = new int[4]; this.ninePoint = new int[4];
@ -503,6 +504,7 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private int ninePointBottom = -1; private int ninePointBottom = -1;
private static final int MIN_NINE_POINT = 0; private static final int MIN_NINE_POINT = 0;
private static final int MIN_GAP_PARALLEL_LINES = 1;
private int imgWidth; private int imgWidth;
private int imgHeight; private int imgHeight;
@ -773,8 +775,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private void onNinePointTopChanged(int value) { private void onNinePointTopChanged(int value) {
if (value < MIN_NINE_POINT) { if (value < MIN_NINE_POINT) {
value = MIN_NINE_POINT; value = MIN_NINE_POINT;
} else if (value >= imgHeight - ninePointBottom) { } else if (value >= imgHeight - ninePointBottom - MIN_GAP_PARALLEL_LINES) {
value = imgHeight - ninePointBottom - MIN_NINE_POINT; value = imgHeight - ninePointBottom - MIN_GAP_PARALLEL_LINES;
} }
this.ninePointTop = value; this.ninePointTop = value;
repaint(); repaint();
@ -783,8 +785,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private void onNinePointBottomChanged(int value) { private void onNinePointBottomChanged(int value) {
if (value < MIN_NINE_POINT) { if (value < MIN_NINE_POINT) {
value = MIN_NINE_POINT; value = MIN_NINE_POINT;
} else if (value >= imgHeight - ninePointTop) { } else if (value >= imgHeight - ninePointTop - MIN_GAP_PARALLEL_LINES) {
value = imgHeight - ninePointTop - MIN_NINE_POINT; value = imgHeight - ninePointTop - MIN_GAP_PARALLEL_LINES;
} }
this.ninePointBottom = value; this.ninePointBottom = value;
repaint(); repaint();
@ -793,8 +795,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private void onNinePointLeftChanged(int value) { private void onNinePointLeftChanged(int value) {
if (value < MIN_NINE_POINT) { if (value < MIN_NINE_POINT) {
value = MIN_NINE_POINT; value = MIN_NINE_POINT;
} else if (value >= imgWidth - ninePointRight) { } else if (value >= imgWidth - ninePointRight - MIN_GAP_PARALLEL_LINES) {
value = imgWidth - ninePointRight - MIN_NINE_POINT; value = imgWidth - ninePointRight - MIN_GAP_PARALLEL_LINES;
} }
this.ninePointLeft = value; this.ninePointLeft = value;
repaint(); repaint();
@ -803,8 +805,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private void onNinePointRightChanged(int value) { private void onNinePointRightChanged(int value) {
if (value < MIN_NINE_POINT) { if (value < MIN_NINE_POINT) {
value = MIN_NINE_POINT; value = MIN_NINE_POINT;
} else if (value >= imgWidth - ninePointLeft) { } else if (value >= imgWidth - ninePointLeft - MIN_GAP_PARALLEL_LINES) {
value = imgWidth - ninePointLeft - MIN_NINE_POINT; value = imgWidth - ninePointLeft - MIN_GAP_PARALLEL_LINES;
} }
this.ninePointRight = value; this.ninePointRight = value;
repaint(); repaint();

18
designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java

@ -3,6 +3,8 @@
*/ */
package com.fr.design.gui.xpane; package com.fr.design.gui.xpane;
import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.JPanel; import javax.swing.JPanel;
/** /**
@ -10,6 +12,8 @@ import javax.swing.JPanel;
*/ */
public class CardTagLayoutStylePane extends LayoutStylePane { public class CardTagLayoutStylePane extends LayoutStylePane {
private LayoutBorderStyle backupStyleFromPopulating = new LayoutBorderStyle();
@Override @Override
protected JPanel createTitleStylePane(){ protected JPanel createTitleStylePane(){
JPanel panel = super.createTitleStylePane(); JPanel panel = super.createTitleStylePane();
@ -21,4 +25,18 @@ public class CardTagLayoutStylePane extends LayoutStylePane {
protected JPanel createBackgroundStylePane(boolean supportCornerRadius) { protected JPanel createBackgroundStylePane(boolean supportCornerRadius) {
return super.createBackgroundStylePane(false); return super.createBackgroundStylePane(false);
} }
@Override
public void populateBean(LayoutBorderStyle style) {
this.backupStyleFromPopulating = style;
super.populateBean(style);
}
@Override
public LayoutBorderStyle updateBean() {
LayoutBorderStyle style = super.updateBean();
style.setTitle(backupStyleFromPopulating.getTitle());
style.setType(backupStyleFromPopulating.getType());
return style;
}
} }

33
designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java

@ -0,0 +1,33 @@
package com.fr.design.mainframe;
public enum ArrangementType {
LEFT_ALIGN(0),
RIGHT_ALIGN(1),
TOP_ALIGN(2),
BOTTOM_ALIGN(3),
HORIZONTAL_CENTER_ALIGN(4),
VERTICAL_CENTER_ALIGN(5),
HORIZONTAL_AUTO_DISTRIBUTION(6),
HORIZONTAL_MANUAL_DISTRIBUTION(7),
VERTICAL_AUTO_DISTRIBUTION(8),
VERTICAL_MANUAL_DISTRIBUTION(9);
private int type;
ArrangementType(int type) {
this.type = type;
}
public int getType() {
return this.type;
}
public static ArrangementType parse(int type) {
for (ArrangementType arrangementType : ArrangementType.values()) {
if (arrangementType.getType() == type) {
return arrangementType;
}
}
return LEFT_ALIGN;
}
}

22
designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java

@ -18,6 +18,7 @@ import com.fr.design.designer.creator.XLayoutContainer;
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.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants; import com.fr.design.icon.IconPathConstants;
@ -31,12 +32,15 @@ import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.share.editor.SharableEditorProvider; import com.fr.form.share.editor.SharableEditorProvider;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JOptionPane;
import javax.swing.JWindow; import javax.swing.JWindow;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Point; import java.awt.Point;
@ -318,6 +322,24 @@ public class FormCreatorDropTarget extends DropTarget {
*/ */
@Override @Override
public synchronized void drop(DropTargetDropEvent dtde) { public synchronized void drop(DropTargetDropEvent dtde) {
try {
dropXCreator(dtde);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
if (addingModel.getXCreator().isShared()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Drag_Component_Error_Info"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon")
);
}
dtde.rejectDrop();
}
}
private void dropXCreator(DropTargetDropEvent dtde) {
Point loc = dtde.getLocation(); Point loc = dtde.getLocation();
this.adding(designer.getRelativeX(loc.x), designer.getRelativeY(loc.y)); this.adding(designer.getRelativeX(loc.x), designer.getRelativeY(loc.y));
// 放到事件末尾执行 // 放到事件末尾执行

3
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -16,6 +16,7 @@ import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.cell.FloatElementsProvider; import com.fr.design.cell.FloatElementsProvider;
import com.fr.design.constants.TableDataConstants;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CopyAction;
@ -1085,7 +1086,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
} }
Iterator tdIterator = sharableEditor.getTableDataSource().getTableDataNameIterator(); Iterator tdIterator = sharableEditor.getTableDataSource().getTableDataNameIterator();
while (tdIterator.hasNext()) { while (tdIterator.hasNext()) {
String tdName = bindInfo.getName() + "-" + tdIterator.next(); String tdName = bindInfo.getName() + TableDataConstants.SEPARATOR + tdIterator.next();
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).removeTableData(tdName); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).removeTableData(tdName);
} }
} }

81
designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java

@ -15,67 +15,103 @@ import java.util.Comparator;
import java.util.List; import java.util.List;
public class MultiSelectionArrangement { public class MultiSelectionArrangement {
private static final int DEFAULT_GAP = 10;
private FormDesigner designer; private FormDesigner designer;
private XLayoutContainer parent; // 当前选中的那些组件所在父容器
private List<XCreator> selectedCreators; private List<XCreator> selectedCreators;
private Rectangle rec; private Rectangle rec;
public MultiSelectionArrangement(FormDesigner designer) { public MultiSelectionArrangement(FormDesigner designer) {
this.designer = designer; this.designer = designer;
update();
} }
public void leftAlign() { public void doArrangement(ArrangementType type) {
doArrangement(type, DEFAULT_GAP);
}
public void doArrangement(ArrangementType type, int gap) {
updatePosition();
switch (type) {
case RIGHT_ALIGN:
rightAlign();
break;
case TOP_ALIGN:
topAlign();
break;
case BOTTOM_ALIGN:
bottomAlign();
break;
case HORIZONTAL_CENTER_ALIGN:
horizontalCenterAlign();
break;
case VERTICAL_CENTER_ALIGN:
verticalCenterAlign();
break;
case HORIZONTAL_AUTO_DISTRIBUTION:
horizontalAutoDistribution();
break;
case HORIZONTAL_MANUAL_DISTRIBUTION:
horizontalManualDistribution(gap);
break;
case VERTICAL_AUTO_DISTRIBUTION:
verticalAutoDistribution();
break;
case VERTICAL_MANUAL_DISTRIBUTION:
verticalManualDistribution(gap);
break;
case LEFT_ALIGN:
default:
leftAlign();
break;
}
updateModel();
}
private void leftAlign() {
for (XCreator creator : selectedCreators) { for (XCreator creator : selectedCreators) {
creator.setLocation(rec.x, creator.getY()); creator.setLocation(rec.x, creator.getY());
} }
update();
} }
public void rightAlign() { private void rightAlign() {
for (XCreator creator : selectedCreators) { for (XCreator creator : selectedCreators) {
creator.setLocation(rec.x + rec.width - creator.getWidth(), creator.getY()); creator.setLocation(rec.x + rec.width - creator.getWidth(), creator.getY());
} }
update();
} }
public void topAlign() { private void topAlign() {
for (XCreator creator : selectedCreators) { for (XCreator creator : selectedCreators) {
creator.setLocation(creator.getX(), rec.y); creator.setLocation(creator.getX(), rec.y);
} }
update();
} }
public void bottomAlign() { private void bottomAlign() {
for (XCreator creator : selectedCreators) { for (XCreator creator : selectedCreators) {
creator.setLocation(creator.getX(), rec.y + rec.height - creator.getHeight()); creator.setLocation(creator.getX(), rec.y + rec.height - creator.getHeight());
} }
update();
} }
public void horizontalCenterAlign() { private void horizontalCenterAlign() {
for (XCreator creator : selectedCreators) { for (XCreator creator : selectedCreators) {
creator.setLocation(rec.x + rec.width / 2 - creator.getWidth() / 2, creator.getY()); creator.setLocation(rec.x + rec.width / 2 - creator.getWidth() / 2, creator.getY());
} }
update();
} }
public void verticalCenterAlign() { private void verticalCenterAlign() {
for (XCreator creator : selectedCreators) { for (XCreator creator : selectedCreators) {
creator.setLocation(creator.getX(), rec.y + rec.height / 2 - creator.getHeight() / 2); creator.setLocation(creator.getX(), rec.y + rec.height / 2 - creator.getHeight() / 2);
} }
update();
} }
// 水平分布,自动,间距由selectedCreators和border共同计算而来 // 水平分布,自动,间距由selectedCreators和border共同计算而来
public void horizontalAutoDistribution() { private void horizontalAutoDistribution() {
sortHorizontal(); sortHorizontal();
int[] gaps = calculateHorizontalGaps(); int[] gaps = calculateHorizontalGaps();
horizontalDistribution(gaps); horizontalDistribution(gaps);
} }
// 水平分布,手动,传入一个间距,排列selectedCreators // 水平分布,手动,传入一个间距,排列selectedCreators
public void horizontalManualDistribution(int gap) { private void horizontalManualDistribution(int gap) {
sortHorizontal(); sortHorizontal();
reSizeRecByHorizontal(gap); reSizeRecByHorizontal(gap);
horizontalDistribution(fillGaps(gap, selectedCreators.size() - 1)); horizontalDistribution(fillGaps(gap, selectedCreators.size() - 1));
@ -87,7 +123,6 @@ public class MultiSelectionArrangement {
XCreator preCreator = selectedCreators.get(i - 1); XCreator preCreator = selectedCreators.get(i - 1);
creator.setLocation(preCreator.getX() + preCreator.getWidth() + gaps[i - 1], creator.getY()); creator.setLocation(preCreator.getX() + preCreator.getWidth() + gaps[i - 1], creator.getY());
} }
update();
} }
private void reSizeRecByHorizontal(int gap) { private void reSizeRecByHorizontal(int gap) {
@ -145,13 +180,13 @@ public class MultiSelectionArrangement {
return calculateIntegerGaps(distanceBetweenHeadAndTailCreators - sum, gapCount); return calculateIntegerGaps(distanceBetweenHeadAndTailCreators - sum, gapCount);
} }
public void verticalAutoDistribution() { private void verticalAutoDistribution() {
sortVertical(); sortVertical();
int[] gaps = calculateVerticalGaps(); int[] gaps = calculateVerticalGaps();
verticalDistribution(gaps); verticalDistribution(gaps);
} }
public void verticalManualDistribution(int gap) { private void verticalManualDistribution(int gap) {
sortVertical(); sortVertical();
reSizeRecByVertical(gap); reSizeRecByVertical(gap);
verticalDistribution(fillGaps(gap, selectedCreators.size() - 1)); verticalDistribution(fillGaps(gap, selectedCreators.size() - 1));
@ -163,7 +198,6 @@ public class MultiSelectionArrangement {
XCreator preCreator = selectedCreators.get(i - 1); XCreator preCreator = selectedCreators.get(i - 1);
creator.setLocation(creator.getX(), preCreator.getY() + preCreator.getHeight() + gaps[i - 1]); creator.setLocation(creator.getX(), preCreator.getY() + preCreator.getHeight() + gaps[i - 1]);
} }
update();
} }
private void reSizeRecByVertical(int gap) { private void reSizeRecByVertical(int gap) {
@ -252,12 +286,15 @@ public class MultiSelectionArrangement {
return gaps; return gaps;
} }
private void update() { private void updatePosition() {
FormSelection selection = designer.getSelectionModel().getSelection(); FormSelection selection = designer.getSelectionModel().getSelection();
this.selectedCreators = Arrays.asList(selection.getSelectedCreators()); this.selectedCreators = Arrays.asList(selection.getSelectedCreators());
this.rec = selection.getSelctionBounds(); this.rec = selection.getSelctionBounds();
this.parent = getParent(selection.getSelectedCreator()); }
private void updateModel() {
FormSelection selection = designer.getSelectionModel().getSelection();
XLayoutContainer parent = getParent(selection.getSelectedCreator());
if (parent != null) { if (parent != null) {
// 这里要修改修改engine里面的对象才能成功保存,光修改设计器对象没用 // 这里要修改修改engine里面的对象才能成功保存,光修改设计器对象没用
WLayout wabs = parent.toData(); WLayout wabs = parent.toData();

73
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.share.ui.block; package com.fr.design.mainframe.share.ui.block;
import com.fr.base.FRContext;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.iofile.attr.SharableAttrMark; import com.fr.base.iofile.attr.SharableAttrMark;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -37,17 +38,24 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.UIManager;
import java.awt.BorderLayout; 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.Font;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image; import java.awt.Image;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.dnd.DnDConstants; import java.awt.dnd.DnDConstants;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.font.FontRenderContext;
import java.awt.font.LineMetrics;
import java.util.UUID; import java.util.UUID;
/** /**
@ -67,6 +75,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
private boolean hover; private boolean hover;
private final Icon markedMode = IOUtils.readIcon("/com/fr/base/images/share/marked.png"); private final Icon markedMode = IOUtils.readIcon("/com/fr/base/images/share/marked.png");
private final Icon unMarkedMode = IOUtils.readIcon("/com/fr/base/images/share/unmarked.png"); private final Icon unMarkedMode = IOUtils.readIcon("/com/fr/base/images/share/unmarked.png");
private final Icon incompatibleMarker = IOUtils.readIcon("/com/fr/base/images/share/marker_incompatible.png");
public LocalWidgetBlock(DefaultSharableWidget provider, LocalWidgetSelectPane parentPane) { public LocalWidgetBlock(DefaultSharableWidget provider, LocalWidgetSelectPane parentPane) {
super(provider); super(provider);
@ -198,11 +207,24 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
Widget creatorSource; Widget creatorSource;
String shareId; String shareId;
if (source instanceof LocalWidgetBlock) { if (source instanceof LocalWidgetBlock) {
LocalWidgetBlock no = (LocalWidgetBlock) e.getSource(); LocalWidgetBlock widgetBlock = (LocalWidgetBlock) e.getSource();
if (no == null) { if (widgetBlock == null) {
return; return;
} }
shareId = no.getBindInfo().getId(); SharableWidgetProvider widget = widgetBlock.getWidget();
if (widget == null) {
return;
}
if (!widget.isCompatibleWithCurrentEnv()) {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Share_Drag_And_Make_Incompatible_Component_Tip"),
Toolkit.i18nText("Fine-Design_Basic_Error"),
JOptionPane.ERROR_MESSAGE,
UIManager.getIcon("OptionPane.errorIcon")
);
return;
}
shareId = widgetBlock.getBindInfo().getId();
creatorSource = getGroup().getElCaseEditorById(shareId); creatorSource = getGroup().getElCaseEditorById(shareId);
if (creatorSource == null) { if (creatorSource == null) {
ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info")); ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info"));
@ -211,7 +233,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
creatorSource.setWidgetID(UUID.randomUUID().toString()); creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
//tab布局WCardMainBorderLayout通过反射出来的大小是960*480 //tab布局WCardMainBorderLayout通过反射出来的大小是960*480
XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, no.getBindInfo()); XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, widgetBlock.getBindInfo());
WidgetToolBarPane.getTarget().startDraggingBean(xCreator); WidgetToolBarPane.getTarget().startDraggingBean(xCreator);
lastPressEvent = null; lastPressEvent = null;
this.setBorder(null); this.setBorder(null);
@ -221,6 +243,13 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
@Override @Override
public void paint(Graphics g) { public void paint(Graphics g) {
super.paint(g); super.paint(g);
Graphics2D g2d = (Graphics2D) g;
boolean isUnusable = !getWidget().isCompatibleWithCurrentEnv();
if (isUnusable) {
paintUnusableMask(g2d);
}
//绘制删除标志 //绘制删除标志
if (isEdit) { if (isEdit) {
Icon icon = isMarked ? markedMode : unMarkedMode; Icon icon = isMarked ? markedMode : unMarkedMode;
@ -235,6 +264,42 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
} }
} }
protected void paintUnusableMask(Graphics2D g2d) {
Color oldColor = g2d.getColor();
Font oldFont = g2d.getFont();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
Dimension coverDim = getCoverDimension();
double canvasX = 0;
double canvasY = 0;
double canvasW = coverDim.getWidth();
double canvasH = coverDim.getHeight();
g2d.setColor(new Color(0.0F, 0.0F, 0.0F, 0.4F));
GraphHelper.fillRect(g2d, canvasX, canvasY, canvasW, canvasH);
g2d.setColor(new Color(0.0F, 0.0F, 0.0F, 0.5F));
GraphHelper.fillRect(g2d, canvasX, canvasH - 16, canvasW, 16);
String tipText = Toolkit.i18nText("Fine-Design_Share_Incompatible_Version_Tip");
Font tipFont = FRContext.getDefaultValues().getFRFont().deriveFont(8.0F);
FontRenderContext frc = g2d.getFontRenderContext();
double tipTextWidth = GraphHelper.stringWidth(tipText, tipFont, frc);
LineMetrics metrics = tipFont.getLineMetrics(tipText, frc);
double tipTextHeight = metrics.getHeight();
g2d.setColor(Color.WHITE);
g2d.setFont(tipFont);
GraphHelper.drawString(g2d, tipText, canvasX + (canvasW - tipTextWidth) / 2.0F, canvasY + canvasH - (16 - tipTextHeight) / 2.0F);
int markerX = (int) (canvasX + (canvasW - incompatibleMarker.getIconWidth()) / 2);
int markerY = (int) (canvasY + (canvasH - incompatibleMarker.getIconHeight()) / 2);
incompatibleMarker.paintIcon(this, g2d, markerX, markerY);
g2d.setColor(oldColor);
g2d.setFont(oldFont);
}
/** /**
* 由鼠标释放时调用该方法来触发左键点击事件 * 由鼠标释放时调用该方法来触发左键点击事件
*/ */

14
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java

@ -5,6 +5,9 @@ import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public abstract class AbstractMultiSelectionArrangementButton extends UIButton implements MultiSelectionArrangementButton, UIObserver { public abstract class AbstractMultiSelectionArrangementButton extends UIButton implements MultiSelectionArrangementButton, UIObserver {
private static final long serialVersionUID = -2114423583742242771L; private static final long serialVersionUID = -2114423583742242771L;
protected MultiSelectionArrangement arrangement; protected MultiSelectionArrangement arrangement;
@ -29,4 +32,15 @@ public abstract class AbstractMultiSelectionArrangementButton extends UIButton i
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return true; return true;
} }
@Override
public ActionListener getActionListener() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
arrangement.doArrangement(getArrangementType());
uiObserverListener.doChange();
}
};
}
} }

15
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java

@ -1,14 +1,15 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class BottomAlignButton extends AbstractMultiSelectionArrangementButton { public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2397455240682353024L;
public BottomAlignButton(MultiSelectionArrangement arrangement) { public BottomAlignButton(MultiSelectionArrangement arrangement) {
super(arrangement); super(arrangement);
} }
@ -24,13 +25,7 @@ public class BottomAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.BOTTOM_ALIGN;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.bottomAlign();
uiObserverListener.doChange();
}
};
} }
} }

15
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java

@ -1,14 +1,15 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton { public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 6290178236460051049L;
public HorizontalCenterButton(MultiSelectionArrangement arrangement) { public HorizontalCenterButton(MultiSelectionArrangement arrangement) {
super(arrangement); super(arrangement);
} }
@ -24,13 +25,7 @@ public class HorizontalCenterButton extends AbstractMultiSelectionArrangementBut
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.HORIZONTAL_CENTER_ALIGN;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.horizontalCenterAlign();
uiObserverListener.doChange();
}
};
} }
} }

15
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java

@ -1,14 +1,15 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton { public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 5052092252720664954L;
public HorizontalDistributionButton(MultiSelectionArrangement arrangement) { public HorizontalDistributionButton(MultiSelectionArrangement arrangement) {
super(arrangement); super(arrangement);
} }
@ -24,13 +25,7 @@ public class HorizontalDistributionButton extends AbstractMultiSelectionArrangem
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.HORIZONTAL_AUTO_DISTRIBUTION;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.horizontalAutoDistribution();
uiObserverListener.doChange();
}
};
} }
} }

15
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java

@ -1,14 +1,15 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class LeftAlignButton extends AbstractMultiSelectionArrangementButton { public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8177637788632733710L;
public LeftAlignButton(MultiSelectionArrangement arrangement) { public LeftAlignButton(MultiSelectionArrangement arrangement) {
super(arrangement); super(arrangement);
} }
@ -24,13 +25,7 @@ public class LeftAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.LEFT_ALIGN;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.leftAlign();
uiObserverListener.doChange();
}
};
} }
} }

4
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.mainframe.ArrangementType;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -9,4 +11,6 @@ public interface MultiSelectionArrangementButton {
String getTipText(); String getTipText();
ActionListener getActionListener(); ActionListener getActionListener();
ArrangementType getArrangementType();
} }

15
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java

@ -1,14 +1,15 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class RightAlignButton extends AbstractMultiSelectionArrangementButton { public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = -8698936349956288409L;
public RightAlignButton(MultiSelectionArrangement arrangement) { public RightAlignButton(MultiSelectionArrangement arrangement) {
super(arrangement); super(arrangement);
} }
@ -24,13 +25,7 @@ public class RightAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.RIGHT_ALIGN;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.rightAlign();
uiObserverListener.doChange();
}
};
} }
} }

15
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java

@ -1,14 +1,15 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class TopAlignButton extends AbstractMultiSelectionArrangementButton { public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
private static final long serialVersionUID = 2896267783075870924L;
public TopAlignButton(MultiSelectionArrangement arrangement) { public TopAlignButton(MultiSelectionArrangement arrangement) {
super(arrangement); super(arrangement);
} }
@ -24,13 +25,7 @@ public class TopAlignButton extends AbstractMultiSelectionArrangementButton {
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.TOP_ALIGN;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.topAlign();
uiObserverListener.doChange();
}
};
} }
} }

13
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java

@ -1,12 +1,11 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton { public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton {
public VerticalCenterButton(MultiSelectionArrangement arrangement) { public VerticalCenterButton(MultiSelectionArrangement arrangement) {
@ -24,13 +23,7 @@ public class VerticalCenterButton extends AbstractMultiSelectionArrangementButto
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.VERTICAL_CENTER_ALIGN;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.verticalCenterAlign();
uiObserverListener.doChange();
}
};
} }
} }

13
designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java

@ -1,12 +1,11 @@
package com.fr.design.mainframe.widget.arrangement.buttons; package com.fr.design.mainframe.widget.arrangement.buttons;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.Icon; import javax.swing.Icon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton { public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton {
public VerticalDistributionButton(MultiSelectionArrangement arrangement) { public VerticalDistributionButton(MultiSelectionArrangement arrangement) {
@ -24,13 +23,7 @@ public class VerticalDistributionButton extends AbstractMultiSelectionArrangemen
} }
@Override @Override
public ActionListener getActionListener() { public ArrangementType getArrangementType() {
return new ActionListener() { return ArrangementType.VERTICAL_AUTO_DISTRIBUTION;
@Override
public void actionPerformed(ActionEvent e) {
arrangement.verticalAutoDistribution();
uiObserverListener.doChange();
}
};
} }
} }

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

@ -9,6 +9,7 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ArrangementType;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.MultiSelectionArrangement;
import com.fr.design.mainframe.widget.arrangement.buttons.BottomAlignButton; import com.fr.design.mainframe.widget.arrangement.buttons.BottomAlignButton;
@ -186,9 +187,9 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane {
int gap = (int) Math.floor(Float.parseFloat(text)); int gap = (int) Math.floor(Float.parseFloat(text));
numberField.setValue(gap); numberField.setValue(gap);
if (isVertical) { if (isVertical) {
arrangement.verticalManualDistribution(gap); arrangement.doArrangement(ArrangementType.VERTICAL_MANUAL_DISTRIBUTION, gap);
} else { } else {
arrangement.horizontalManualDistribution(gap); arrangement.doArrangement(ArrangementType.HORIZONTAL_MANUAL_DISTRIBUTION, gap);
} }
attributeChanged(); attributeChanged();
} }

1
designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

@ -175,6 +175,7 @@ public class ImagePreLoader {
"/com/fr/design/images/bbs/center_normal.svg", "/com/fr/design/images/bbs/center_normal.svg",
"/com/fr/design/images/bbs/sign_normal.svg", "/com/fr/design/images/bbs/sign_normal.svg",
"/com/fr/design/images/bbs/facebook_normal.svg", "/com/fr/design/images/bbs/facebook_normal.svg",
"/com/fr/design/images/bbs/studyPlan_normal.svg",
"/com/fr/design/images/update/update_new_normal.svg", "/com/fr/design/images/update/update_new_normal.svg",
"com/fr/design/images/signature.png", "com/fr/design/images/signature.png",
"com/fr/design/images/m_file/switch.png", "com/fr/design/images/m_file/switch.png",

Loading…
Cancel
Save