From cc6eed1842ed74a93ae4f8856f7ceb74406e0d26 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 25 Oct 2017 14:08:51 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-5209=209.0=E6=8E=A7=E4=BB=B6=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=9D=A2=E6=9D=BF=E4=BA=A4=E4=BA=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/CellWidgetCardPane.java | 37 ++++++------------- .../widget/ui/DateEditorDefinePane.java | 13 +++++-- .../com/fr/design/dialog/AttrScrollPane.java | 30 +++++++++++++++ .../com/fr/design/dialog/BasicScrollPane.java | 15 ++++++-- .../widget/ui/FormWidgetCardPane.java | 15 ++------ .../ui/designer/CheckBoxDefinePane.java | 5 ++- .../ui/designer/DateEditorDefinePane.java | 16 ++++++-- .../designer/DirectWriteEditorDefinePane.java | 4 +- .../widget/ui/designer/LabelDefinePane.java | 4 +- .../ui/designer/NumberEditorDefinePane.java | 4 +- .../designer/TextFieldEditorDefinePane.java | 4 +- .../designer/btn/ButtonGroupDefinePane.java | 4 +- 12 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 designer_base/src/com/fr/design/dialog/AttrScrollPane.java diff --git a/designer/src/com/fr/design/widget/CellWidgetCardPane.java b/designer/src/com/fr/design/widget/CellWidgetCardPane.java index 043e3a7798..77d1542cbb 100644 --- a/designer/src/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer/src/com/fr/design/widget/CellWidgetCardPane.java @@ -2,7 +2,7 @@ package com.fr.design.widget; import com.fr.design.constants.UIConstants; import com.fr.design.data.DataCreatorUI; -import com.fr.design.designer.IntervalConstants; +import com.fr.design.dialog.AttrScrollPane; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.foldablepane.UIExpandablePane; @@ -51,38 +51,24 @@ public class CellWidgetCardPane extends BasicPane { this.removeAll(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); - final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - BasicScrollPane basicScrollPane = new BasicScrollPane() { - @Override - protected JPanel createContentPane() { - return jPanel; - } - - @Override - public void populateBean(Object ob) { - - } - - @Override - protected String title4PopupWindow() { - return null; - } - }; - this.add(basicScrollPane, BorderLayout.CENTER); - //k tabbedPane = new CardLayout(); center = new JPanel(tabbedPane); - jPanel.add(center, BorderLayout.CENTER); - jPanel.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L6, 0, 0)); + this.add(center, BorderLayout.CENTER); attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eventTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + eventTabPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); initPaneList(); eventPane = initWidgetEventPane(pane); eventTabPane.add(eventPane, BorderLayout.CENTER); //k - center.add(attriTabPane, Inter.getLocText("FR-Designer_Attribute")); + BasicScrollPane basicScrollPane = new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + return attriTabPane; + } + }; + center.add(basicScrollPane, Inter.getLocText("FR-Designer_Attribute")); center.add(eventTabPane, Inter.getLocText("FR-Designer_Event")); final String[] tabTitles = new String[]{Inter.getLocText("FR-Designer_Attribute"), Inter.getLocText("FR-Designer_Event")}; @@ -100,7 +86,8 @@ public class CellWidgetCardPane extends BasicPane { UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 24, widgetPropertyPane); - attriTabPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + + attriTabPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); attriTabPane.add(uiExpandablePane, BorderLayout.NORTH); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); diff --git a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java index 49c0d99282..6847745b7e 100644 --- a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java @@ -58,10 +58,17 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane extends BasicBeanPane{ protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) { int width = parent.getWidth(); int height = parent.getHeight(); - if (leftcontentPane.getPreferredSize().height > maxheight) { - leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - DET_WIDTH_OVER_HEIGHT, height + beginY); + if (leftcontentPane.getPreferredSize().height > maxheight && scrollBar.isVisible()) { + leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() + getOverWidth() - DET_WIDTH_OVER_HEIGHT, height + beginY); scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height); } else { - leftcontentPane.setBounds(0, 0, width - DET_WIDTH, height); + int hideBarWidth = hideBarWidth() ? scrollBar.getWidth() : 0; + leftcontentPane.setBounds(0, 0, width - DET_WIDTH + hideBarWidth, height); } } + protected int getOverWidth(){ + return 0; + } + + protected boolean hideBarWidth(){ + return false; + } + protected boolean isShowScrollBar() { return true; } diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 8f6e075c4b..1ac55c2eda 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe.widget.ui; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.*; +import com.fr.design.dialog.AttrScrollPane; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; @@ -112,26 +113,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { XCreator innerCreator = getXCreatorDedicated(); final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - BasicScrollPane basicScrollPane = new BasicScrollPane() { + BasicScrollPane basicScrollPane = new AttrScrollPane() { @Override protected JPanel createContentPane() { return jPanel; } - - @Override - public void populateBean(Object ob) { - - } - - @Override - protected String title4PopupWindow() { - return null; - } }; this.add(basicScrollPane, BorderLayout.CENTER); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); jPanel.add(attriCardPane, BorderLayout.CENTER); - jPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + jPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); final boolean isExtraWidget = FormWidgetDefinePaneFactoryBase.isExtraXWidget(innerCreator.toData()); this.listener = new AttributeChangeListener() { diff --git a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java index 133318fe2c..fc7a1dfdce 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java @@ -15,6 +15,7 @@ import com.fr.general.Inter; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.awt.Component; public class CheckBoxDefinePane extends AbstractDataModify { @@ -33,13 +34,15 @@ public class CheckBoxDefinePane extends AbstractDataModify { text = new UITextField(); fontSizePane = new FontSizeComboPane(); labelNameTextField = new UITextField(); + UILabel widgetValueLabel = new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")); + widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text }, - new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, + new Component[]{widgetValueLabel, formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}, }; double[] rowSize = {p, p, p, p, p, p}; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java index 2cdb311b5a..a46ed3830a 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java @@ -56,6 +56,14 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}); JPanel formatHead = createFormatHead(); @@ -65,10 +73,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane e @Override protected JPanel setFirstContentPane() { JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel widgetValueLabel = new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")); + widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); Component[] removeRepeatPane = new Component[]{createRepeatCheckBox(), null}; Component[] dicPane = createDictPane(); @@ -36,7 +38,7 @@ public abstract class DirectWriteEditorDefinePane e double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, - new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, + new Component[]{widgetValueLabel, formWidgetValuePane }, dicPane, removeRepeatPane, waterMarkComponent, diff --git a/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java index 2cf3c72bb6..549f4266fe 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java @@ -62,10 +62,12 @@ public class LabelDefinePane extends AbstractDataModify