diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 711a7a58dd..8980c09a12 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -862,7 +862,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } } - public boolean isInAbsoluteContainer() { + public boolean isParentAbsolute() { return ((XCreator) this.getParent()).acceptType(XWAbsoluteLayout.class); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index af8efcd264..9f49de1d89 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1770,11 +1770,11 @@ public class FormDesigner extends TargetComponent
implements TreeSelection XCreator[] creators = this.getSelectionModel().getSelection().getSelectedCreators(); if (creators != null && creators.length > 1) { for (int i = 0; i < creators.length - 1; i++) { - if (creators[i].getParent() != creators[i + 1].getParent() || !creators[i].isInAbsoluteContainer()) { + if (creators[i].getParent() != creators[i + 1].getParent() || !creators[i].isParentAbsolute()) { return false; } } - return creators[creators.length - 1].isInAbsoluteContainer(); + return creators[creators.length - 1].isParentAbsolute(); } return false; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java index a9f01dcad2..8061613197 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java @@ -36,11 +36,11 @@ public class FormSpacingLineDrawer { public void draw(Graphics g) { this.selectedRec = designer.getSelectionModel().getSelection().getSelctionBounds(); - if (isSelectedForm() || isSelectedRootComponent() || isHoveredForm() || isHoveredRootComponent() || !isMouseMoveEvent) { + if (!isDrawSpacingLine()) { return; } - if (!hoverCreator.isInAbsoluteContainer()) { + if (!hoverCreator.isParentAbsolute()) { return; } @@ -259,4 +259,16 @@ public class FormSpacingLineDrawer { private boolean isHoveredCreatorRightYSpacingLine() { return hoverCreator.getX() > selectedRec.x + selectedRec.width / 2; } + + private boolean isSelectedRootPane() { + return isSelectedForm() || isSelectedRootComponent(); + } + + private boolean isHoveredRootPane() { + return isHoveredForm() || isHoveredRootComponent(); + } + + private boolean isDrawSpacingLine() { + return !isSelectedRootPane() && !isHoveredRootPane() && isMouseMoveEvent; + } } 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 new file mode 100644 index 0000000000..ac687d4256 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java @@ -0,0 +1,23 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.mainframe.MultiSelectionArrangement; + +public abstract class AbstractMultiSelectionArrangementButton implements MultiSelectionArrangementButton { + protected MultiSelectionArrangement arrangement; + + public AbstractMultiSelectionArrangementButton(MultiSelectionArrangement arrangement) { + this.arrangement = arrangement; + } + + @Override + public UIButton create() { + UIButton btn = new UIButton(); + btn.setNormalPainted(false); + btn.setBorderPaintedOnlyWhenPressed(true); + btn.setIcon(getIcon()); + btn.setToolTipText(getTipText()); + btn.addActionListener(getActionListener()); + return btn; + } +} 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 new file mode 100644 index 0000000000..41318ff67b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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 { + public BottomAlignButton(MultiSelectionArrangement arrangement) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_bottom_align.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Bottom_Align"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.bottomAlign(); + } + }; + } +} 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 new file mode 100644 index 0000000000..7eface48f4 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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 { + public HorizontalCenterButton(MultiSelectionArrangement arrangement) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_center_align.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Horizontal_Center_Align"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.horizontalCenterAlign(); + } + }; + } +} 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 new file mode 100644 index 0000000000..678ce895bf --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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 { + public HorizontalDistributionButton(MultiSelectionArrangement arrangement) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_auto_spacing.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Horizontal_Spacing"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.horizontalAutoDistribution(); + } + }; + } +} 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 new file mode 100644 index 0000000000..3f8d685c77 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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 { + public LeftAlignButton(MultiSelectionArrangement arrangement) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_left_align.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Left_Align"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.leftAlign(); + } + }; + } +} 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 new file mode 100644 index 0000000000..06bc2026be --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java @@ -0,0 +1,16 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.gui.ibutton.UIButton; + +import javax.swing.Icon; +import java.awt.event.ActionListener; + +public interface MultiSelectionArrangementButton { + Icon getIcon(); + + String getTipText(); + + ActionListener getActionListener(); + + UIButton create(); +} 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 new file mode 100644 index 0000000000..02f20fc45e --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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 { + public RightAlignButton(MultiSelectionArrangement arrangement) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_right_align.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Right_Align"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.rightAlign(); + } + }; + } +} 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 new file mode 100644 index 0000000000..7100b3b960 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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 { + public TopAlignButton(MultiSelectionArrangement arrangement) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_top_align.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Top_Align"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.topAlign(); + } + }; + } +} 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 new file mode 100644 index 0000000000..81d86d5583 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_center_align.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Vertical_Center_Align"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.verticalCenterAlign(); + } + }; + } +} 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 new file mode 100644 index 0000000000..538463b6b3 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java @@ -0,0 +1,35 @@ +package com.fr.design.mainframe.widget.arrangement.buttons; + +import com.fr.design.i18n.Toolkit; +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) { + super(arrangement); + } + + @Override + public Icon getIcon() { + return IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_auto_spacing.png"); + } + + @Override + public String getTipText() { + return Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Vertical_Spacing"); + } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.verticalAutoDistribution(); + } + }; + } +} 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 ba7c5156ef..77e6a67d86 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,14 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.MultiSelectionArrangement; +import com.fr.design.mainframe.widget.arrangement.buttons.BottomAlignButton; +import com.fr.design.mainframe.widget.arrangement.buttons.HorizontalCenterButton; +import com.fr.design.mainframe.widget.arrangement.buttons.HorizontalDistributionButton; +import com.fr.design.mainframe.widget.arrangement.buttons.LeftAlignButton; +import com.fr.design.mainframe.widget.arrangement.buttons.RightAlignButton; +import com.fr.design.mainframe.widget.arrangement.buttons.TopAlignButton; +import com.fr.design.mainframe.widget.arrangement.buttons.VerticalCenterButton; +import com.fr.design.mainframe.widget.arrangement.buttons.VerticalDistributionButton; import com.fr.general.IOUtils; import com.fr.stable.StableUtils; @@ -16,21 +24,10 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; public class FormMultiWidgetCardPane extends FormWidgetCardPane { - private static final int LEFT_ALIGN = 1; - private static final int RIGHT_ALIGN = 2; - private static final int HORIZONTAL_CENTER_ALIGN = 3; - private static final int TOP_ALIGN = 4; - private static final int BOTTOM_ALIGN = 5; - private static final int VERTICAL_CENTER_ALIGN = 6; - private static final int HORIZONTAL_AUTO_SPACING = 7; - private static final int VERTICAL_AUTO_SPACING = 8; - private MultiSelectionArrangement arrangement; public FormMultiWidgetCardPane(FormDesigner designer) { @@ -74,12 +71,12 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane { }; Component[][] components = new Component[][] { new Component[] { - createArrangementButton(LEFT_ALIGN), - createArrangementButton(HORIZONTAL_CENTER_ALIGN), - createArrangementButton(RIGHT_ALIGN), - createArrangementButton(TOP_ALIGN), - createArrangementButton(VERTICAL_CENTER_ALIGN), - createArrangementButton(BOTTOM_ALIGN) + new LeftAlignButton(arrangement).create(), + new HorizontalCenterButton(arrangement).create(), + new RightAlignButton(arrangement).create(), + new TopAlignButton(arrangement).create(), + new VerticalCenterButton(arrangement).create(), + new BottomAlignButton(arrangement).create() } }; JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 18, 0); @@ -93,8 +90,8 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane { TableLayout.PREFERRED, TableLayout.PREFERRED }; - UIButton horizontalAutoSpacingBtn = createArrangementButton(HORIZONTAL_AUTO_SPACING); - UIButton verticalAutoSpacingBtn = createArrangementButton(VERTICAL_AUTO_SPACING); + UIButton horizontalAutoSpacingBtn = new HorizontalDistributionButton(arrangement).create(); + UIButton verticalAutoSpacingBtn = new VerticalDistributionButton(arrangement).create(); if (designer.getSelectionModel().getSelection().size() < 3) { horizontalAutoSpacingBtn.setEnabled(false); verticalAutoSpacingBtn.setEnabled(false); @@ -178,94 +175,4 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane { jPanel.add(centerPane, BorderLayout.CENTER); return jPanel; } - - private UIButton createArrangementButton(int btnType) { - UIButton btn = new UIButton(); - btn.setNormalPainted(false); - btn.setBorderPaintedOnlyWhenPressed(true); - switch (btnType) { - case LEFT_ALIGN: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_left_align.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Left_Align")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.leftAlign(); - } - }); - break; - case RIGHT_ALIGN: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_right_align.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Right_Align")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.rightAlign(); - } - }); - break; - case TOP_ALIGN: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_top_align.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Top_Align")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.topAlign(); - } - }); - break; - case BOTTOM_ALIGN: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_bottom_align.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Bottom_Align")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.bottomAlign(); - } - }); - break; - case HORIZONTAL_CENTER_ALIGN: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_center_align.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Horizontal_Center_Align")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.horizontalCenterAlign(); - } - }); - break; - case VERTICAL_CENTER_ALIGN: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_center_align.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Vertical_Center_Align")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.verticalCenterAlign(); - } - }); - break; - case HORIZONTAL_AUTO_SPACING: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_horizontal_auto_spacing.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Horizontal_Spacing")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.horizontalAutoDistribution(); - } - }); - break; - case VERTICAL_AUTO_SPACING: - btn.setIcon(IOUtils.readIcon("/com/fr/design/images/buttonicon/multi_selection_vertical_auto_spacing.png")); - btn.setToolTipText(Toolkit.i18nText("Fine-Design_Multi_Selection_Auto_Vertical_Spacing")); - btn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.verticalAutoDistribution(); - } - }); - break; - default: break; - } - return btn; - } }