From 4860a9c94c4f7c171f07cb7885e8c8a0db1348f2 Mon Sep 17 00:00:00 2001 From: Hans Date: Mon, 21 Sep 2020 14:02:37 +0800 Subject: [PATCH] =?UTF-8?q?MOBILE-29516=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91tab=E6=89=8B=E5=8A=BF=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E3=80=8B=E5=9C=86=E7=82=B9=E6=8C=87=E7=A4=BA?= =?UTF-8?q?=E5=99=A8=E8=AE=BE=E7=BD=AE=E9=A1=B9=E5=9C=A8=E4=B8=8D=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E6=BB=91=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=E4=B9=9F?= =?UTF-8?q?=E4=BC=9A=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9=20=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E4=BA=A4=E4=BA=92=E7=9A=84=E8=AE=BE=E8=AE=A1=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=98=BE=E7=A4=BA=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/MobileTabCommonSettingPane.java | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index cf4923aed3..85475fd688 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -112,20 +112,10 @@ public class MobileTabCommonSettingPane extends BasicPane { JPanel selectDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{selectColor, selectDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; - double[] columnSize = {TableLayout.FILL}; - int[][] rowCount = {{1}, {1}, {1}}; - double[] verticalGaps = {10, 10, 10}; + double[] verticalGaps = {IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1}; double[] dotSettingColumnSize = {TableLayout.PREFERRED, TableLayout.FILL}; - Component[][] components = new Component[][]{ - new Component[]{this.showTabTitleCheck}, - new Component[]{this.tabSlideCheck}, - new Component[]{this.showTabDotIndicatorCheck} - }; - - JPanel tabBaseConfigPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, - IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); - tabBaseConfigPane.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); + final JPanel tabBaseConfigPanel = createTableConfigJPanel(); JPanel dotIndicatorSettingPanel = TableLayoutHelper.createDiffVGapTableLayoutPane(new JComponent[][]{ {label, dotIndicatorShowTypePane}, @@ -135,11 +125,18 @@ public class MobileTabCommonSettingPane extends BasicPane { BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1, 0) ); - final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - jPanel.add(tabBaseConfigPane, BorderLayout.NORTH); - jPanel.add(dotIndicatorSettingPanel, BorderLayout.CENTER); + final JPanel tableConfigJPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + tableConfigJPanel.add(tabBaseConfigPanel, BorderLayout.NORTH); + tableConfigJPanel.add(dotIndicatorSettingPanel, BorderLayout.CENTER); + this.add(tableConfigJPanel, BorderLayout.CENTER); - this.add(jPanel, BorderLayout.CENTER); + tabSlideCheck.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + showTabDotIndicatorCheck.setVisible(tabSlideCheck.isSelected()); + dotIndicatorSettingPanel.setVisible(tabSlideCheck.isSelected() && showTabDotIndicatorCheck.isSelected()); + } + }); showTabDotIndicatorCheck.addChangeListener(new ChangeListener() { @Override @@ -200,4 +197,15 @@ public class MobileTabCommonSettingPane extends BasicPane { colorBox.setSelectObject(color); } } + + private JPanel createTableConfigJPanel() { + final JPanel jPanel = new JPanel(); + BorderLayout borderLayout = new BorderLayout(0, IntervalConstants.INTERVAL_L1); + jPanel.setLayout(borderLayout); + jPanel.add(this.showTabTitleCheck, BorderLayout.NORTH); + jPanel.add(this.tabSlideCheck, BorderLayout.CENTER); + jPanel.add(this.showTabDotIndicatorCheck, BorderLayout.SOUTH); + jPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, IntervalConstants.INTERVAL_L1, 0)); + return jPanel; + } }