From c19bb8edeb53d4c7cc911fe3e6a9d14c5afea91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 11:29:57 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-63499=20=E6=8C=89=E9=92=AE=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=A0=91=E8=8A=82=E7=82=B9=E9=85=8D=E7=BD=AE=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E4=BA=8B=E4=BB=B6=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=B8=8A=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/controlpane/UIListGroupControlPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index 6ec5f496a..e82cbac82 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -122,10 +122,11 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li protected void populateNameObjects(Widget widget) { ArrayList nameObjectList = new ArrayList<>(); - for (int i = 0, size = widget.getListenerSize(); i < size; i++) { + for (int i = 0, j = 0, size = widget.getListenerSize(); i < size; i++) { Listener listener = widget.getListener(i); if (!listener.isDefault()) { - nameObjectList.add(i, new NameObject(switchLang(listener.getEventName()) + (i + 1), listener)); + nameObjectList.add(j, new NameObject(switchLang(listener.getEventName()) + (j + 1), listener)); + j++; } } populate(getHelper().processCatalog(nameObjectList)); From 72b7bdacaef2cd278727d73ba32f9848cf6178cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 13:49:59 +0800 Subject: [PATCH 2/5] REPORT-63499 --- .../fr/design/gui/controlpane/UIListGroupControlPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index e82cbac82..063491f88 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -122,11 +122,12 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li protected void populateNameObjects(Widget widget) { ArrayList nameObjectList = new ArrayList<>(); - for (int i = 0, j = 0, size = widget.getListenerSize(); i < size; i++) { + for (int i = 0, size = widget.getListenerSize(); i < size; i++) { Listener listener = widget.getListener(i); if (!listener.isDefault()) { - nameObjectList.add(j, new NameObject(switchLang(listener.getEventName()) + (j + 1), listener)); - j++; + String eventName = switchLang(listener.getEventName()) + (nameObjectList.size() + 1); + NameObject nameObject = new NameObject(eventName, listener); + nameObjectList.add(nameObject); } } populate(getHelper().processCatalog(nameObjectList)); From ca2fcb358e038e9564ac0f5edc6aad48c554316d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 14:55:46 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-63092=20=E6=BC=8F=E4=BC=A0=E4=BA=86i?= =?UTF-8?q?mport=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-form/src/main/java/com/fr/design/mainframe/JForm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index d8680e4ad..66dc972c4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/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.base.mode.DesignModeContext; import com.fr.design.cell.FloatElementsProvider; +import com.fr.design.constants.TableDataConstants; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.TargetComponent; import com.fr.design.designer.beans.actions.CopyAction; From a0798b48218e0f93de6a42859ff3504c4e22d5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 16:36:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?REPORT-63106=20=E5=86=B3=E7=AD=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8-=E4=B8=A4=E4=B8=AA=E7=BB=84=E4=BB=B6=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=97=B6=E6=8B=96=E6=8B=BD=E5=88=B0=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=EF=BC=8C=E7=84=B6=E5=90=8E=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E4=BB=BB=E6=84=8F=E4=B8=80=E4=B8=AA=EF=BC=8C?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E7=BB=84=E4=BB=B6=E4=BC=9A=E8=B7=B3=E5=9B=9E?= =?UTF-8?q?=E5=88=9A=E6=89=8D=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ArrangementType.java | 33 ++++++++ .../mainframe/MultiSelectionArrangement.java | 81 ++++++++++++++----- ...stractMultiSelectionArrangementButton.java | 14 ++++ .../buttons/BottomAlignButton.java | 15 ++-- .../buttons/HorizontalCenterButton.java | 15 ++-- .../buttons/HorizontalDistributionButton.java | 15 ++-- .../arrangement/buttons/LeftAlignButton.java | 15 ++-- .../MultiSelectionArrangementButton.java | 4 + .../arrangement/buttons/RightAlignButton.java | 15 ++-- .../arrangement/buttons/TopAlignButton.java | 15 ++-- .../buttons/VerticalCenterButton.java | 13 +-- .../buttons/VerticalDistributionButton.java | 13 +-- .../widget/ui/FormMultiWidgetCardPane.java | 5 +- 13 files changed, 149 insertions(+), 104 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java b/designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java new file mode 100644 index 000000000..58f4b3464 --- /dev/null +++ b/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; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java index 49dbc8c97..3ffe7d94a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java @@ -15,67 +15,103 @@ import java.util.Comparator; import java.util.List; public class MultiSelectionArrangement { + private static final int DEFAULT_GAP = 10; + private FormDesigner designer; - private XLayoutContainer parent; // 当前选中的那些组件所在父容器 private List selectedCreators; private Rectangle rec; public MultiSelectionArrangement(FormDesigner 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) { creator.setLocation(rec.x, creator.getY()); } - update(); } - public void rightAlign() { + private void rightAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(rec.x + rec.width - creator.getWidth(), creator.getY()); } - update(); } - public void topAlign() { + private void topAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(creator.getX(), rec.y); } - update(); } - public void bottomAlign() { + private void bottomAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(creator.getX(), rec.y + rec.height - creator.getHeight()); } - update(); } - public void horizontalCenterAlign() { + private void horizontalCenterAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(rec.x + rec.width / 2 - creator.getWidth() / 2, creator.getY()); } - update(); } - public void verticalCenterAlign() { + private void verticalCenterAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(creator.getX(), rec.y + rec.height / 2 - creator.getHeight() / 2); } - update(); } // 水平分布,自动,间距由selectedCreators和border共同计算而来 - public void horizontalAutoDistribution() { + private void horizontalAutoDistribution() { sortHorizontal(); int[] gaps = calculateHorizontalGaps(); horizontalDistribution(gaps); } // 水平分布,手动,传入一个间距,排列selectedCreators - public void horizontalManualDistribution(int gap) { + private void horizontalManualDistribution(int gap) { sortHorizontal(); reSizeRecByHorizontal(gap); horizontalDistribution(fillGaps(gap, selectedCreators.size() - 1)); @@ -87,7 +123,6 @@ public class MultiSelectionArrangement { XCreator preCreator = selectedCreators.get(i - 1); creator.setLocation(preCreator.getX() + preCreator.getWidth() + gaps[i - 1], creator.getY()); } - update(); } private void reSizeRecByHorizontal(int gap) { @@ -145,13 +180,13 @@ public class MultiSelectionArrangement { return calculateIntegerGaps(distanceBetweenHeadAndTailCreators - sum, gapCount); } - public void verticalAutoDistribution() { + private void verticalAutoDistribution() { sortVertical(); int[] gaps = calculateVerticalGaps(); verticalDistribution(gaps); } - public void verticalManualDistribution(int gap) { + private void verticalManualDistribution(int gap) { sortVertical(); reSizeRecByVertical(gap); verticalDistribution(fillGaps(gap, selectedCreators.size() - 1)); @@ -163,7 +198,6 @@ public class MultiSelectionArrangement { XCreator preCreator = selectedCreators.get(i - 1); creator.setLocation(creator.getX(), preCreator.getY() + preCreator.getHeight() + gaps[i - 1]); } - update(); } private void reSizeRecByVertical(int gap) { @@ -252,12 +286,15 @@ public class MultiSelectionArrangement { return gaps; } - private void update() { + private void updatePosition() { FormSelection selection = designer.getSelectionModel().getSelection(); this.selectedCreators = Arrays.asList(selection.getSelectedCreators()); 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) { // 这里要修改修改engine里面的对象才能成功保存,光修改设计器对象没用 WLayout wabs = parent.toData(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java index dc268f4c5..947429504 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java +++ b/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.mainframe.MultiSelectionArrangement; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + public abstract class AbstractMultiSelectionArrangementButton extends UIButton implements MultiSelectionArrangementButton, UIObserver { private static final long serialVersionUID = -2114423583742242771L; protected MultiSelectionArrangement arrangement; @@ -29,4 +32,15 @@ public abstract class AbstractMultiSelectionArrangementButton extends UIButton i public boolean shouldResponseChangeListener() { return true; } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.doArrangement(getArrangementType()); + uiObserverListener.doChange(); + } + }; + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java index 99bf3a6c3..97974298a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class BottomAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 2397455240682353024L; + public BottomAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class BottomAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.bottomAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.BOTTOM_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java index 6dc9c09b4..ec8f315df 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 6290178236460051049L; + public HorizontalCenterButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class HorizontalCenterButton extends AbstractMultiSelectionArrangementBut } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.horizontalCenterAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.HORIZONTAL_CENTER_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java index 0a0e225fc..0702248ed 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 5052092252720664954L; + public HorizontalDistributionButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class HorizontalDistributionButton extends AbstractMultiSelectionArrangem } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.horizontalAutoDistribution(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.HORIZONTAL_AUTO_DISTRIBUTION; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java index 20a25a87c..02a6a2c79 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class LeftAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = -8177637788632733710L; + public LeftAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class LeftAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.leftAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.LEFT_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java index 99b763570..96f576598 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java +++ b/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; +import com.fr.design.mainframe.ArrangementType; + import javax.swing.Icon; import java.awt.event.ActionListener; @@ -9,4 +11,6 @@ public interface MultiSelectionArrangementButton { String getTipText(); ActionListener getActionListener(); + + ArrangementType getArrangementType(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java index 5fac70bd7..1b047b6ba 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class RightAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = -8698936349956288409L; + public RightAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class RightAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.rightAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.RIGHT_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java index ebb2c4d21..0adfb9378 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class TopAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 2896267783075870924L; + public TopAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class TopAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.topAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.TOP_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java index 9898f9002..4fb8b62a2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton { public VerticalCenterButton(MultiSelectionArrangement arrangement) { @@ -24,13 +23,7 @@ public class VerticalCenterButton extends AbstractMultiSelectionArrangementButto } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.verticalCenterAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.VERTICAL_CENTER_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java index 50ec6ac89..76dcf9427 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java +++ b/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; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton { public VerticalDistributionButton(MultiSelectionArrangement arrangement) { @@ -24,13 +23,7 @@ public class VerticalDistributionButton extends AbstractMultiSelectionArrangemen } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.verticalAutoDistribution(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.VERTICAL_AUTO_DISTRIBUTION; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java index ffd2a0f74..cf59b595c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java +++ b/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.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.MultiSelectionArrangement; 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)); numberField.setValue(gap); if (isVertical) { - arrangement.verticalManualDistribution(gap); + arrangement.doArrangement(ArrangementType.VERTICAL_MANUAL_DISTRIBUTION, gap); } else { - arrangement.horizontalManualDistribution(gap); + arrangement.doArrangement(ArrangementType.HORIZONTAL_MANUAL_DISTRIBUTION, gap); } attributeChanged(); } From 123b0ce7e144e9952abf6aac425c657f9fafc70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 7 Dec 2021 22:02:38 +0800 Subject: [PATCH 5/5] =?UTF-8?q?REPORT-62804=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=9A=84=E9=93=BE=E6=8E=A5=E6=94=B9?= =?UTF-8?q?=E5=8A=A8(=E7=A4=BE=E5=8C=BAurl=E6=94=B9=E5=8A=A8=E9=9C=80?= =?UTF-8?q?=E6=B1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/community/BugAction.java | 2 +- .../design/actions/community/NeedAction.java | 2 +- .../actions/community/StudyPlanAction.java | 17 +++++++++++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 2 ++ .../com/fr/design/images/bbs/studyPlan.png | Bin 0 -> 1129 bytes .../fr/design/images/bbs/studyPlan_normal.svg | 1 + .../com/fr/start/preload/ImagePreLoader.java | 1 + 7 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan_normal.svg diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index a16257100..bb2de54ba 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -17,7 +17,7 @@ public class BugAction extends AbstractDesignerSSO { @Override 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() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index c8b2ccdae..4a9b80a9b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -18,7 +18,7 @@ public class NeedAction extends AbstractDesignerSSO { @Override 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() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java b/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java new file mode 100644 index 000000000..d0dcc4195 --- /dev/null +++ b/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"); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index cfc4483c9..5043e8307 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/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.QuestionAction; 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.TechSupportAction; import com.fr.design.actions.community.TemplateStoreAction; @@ -597,6 +598,7 @@ public abstract class ToolBarMenuDock { shortCuts.add(new TutorialAction()); } }, SupportLocaleImpl.TUTORIAL_COMMUNITY); + shortCuts.add(new StudyPlanAction()); shortCuts.add(new QuestionAction()); shortCuts.add(new TechSolutionAction()); diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png b/designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png new file mode 100644 index 0000000000000000000000000000000000000000..1a27244653e92d08f20967f7b423605328f3cea3 GIT binary patch literal 1129 zcmb`_KS-NF7{~ETjhb2_#){TB=-^N*D1uTaAt9v(N-CmA9IP(R1sytwgPV(pINE}U z|3IY$r5!@RE`p#Gp(@(OMZrZx92}Iy?=N^EDam9X_`G-TbN3$aJ$K_Bp||cLZ;>&^ z9c&MD(w2y;fM@k}Vu0r9$M*1$F{Q)ehz(YMGR9dI4EVZQJ&qFRfpaut3#%wc)^L%H;wNge%y>?29$LI2%ea{!xe5J+ z2hWf#W=KZtfUSX-gjR0E8P<`HLnso^{->d1)7%e;s6dK7==3xp4nI!u6$j8lVccL3 zszVbtY!P4b@(T(rFp6zdKF}W)LklQ&@Jb!09)wzZDN5;UkIQK}x@HPL)FJMW{MIh; zm&9w05H&c)2yD3N=x*51{m?h5&=#(sqtdn(Z~`qPx(iWgOm$OTx{(n}ye+0>G*KrZ zDq0H^YIkA(Ub$qH@zn8rL9RQHoS6Qw_rT^}(3wR8=Ade;V5+$ELU$q+|1Mw$d~|wH g2kkqCZ_vGnl \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java index 138e7df2b..24d23565c 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java +++ b/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/sign_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/signature.png", "com/fr/design/images/m_file/switch.png",