diff --git a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java index d16622184f..96eccfc595 100644 --- a/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java +++ b/designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java @@ -5,6 +5,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.DesignerContext; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.stable.collections.utils.MathUtils; import javax.swing.*; import java.awt.*; @@ -14,10 +15,12 @@ import java.awt.event.MouseMotionListener; public class UIResizableContainer extends JPanel { private static final long serialVersionUID = 1854340560790476907L; + private static final int MAX_PARA_HEIGHT = 240; private int containerWidth = 240; private int preferredWidth = 240; private int toolPaneY = 300; private int toolPaneHeight = 10; + private int bottomHeight = 30; private JComponent upPane; private JComponent downPane; @@ -139,7 +142,7 @@ public class UIResizableContainer extends JPanel { * @param height */ public void setParameterHeight(int height) { - paraHeight = hasParameterPane? height : 0; + paraHeight = hasParameterPane? Math.min(height, MAX_PARA_HEIGHT) : 0; refreshContainer(); } @@ -208,7 +211,7 @@ public class UIResizableContainer extends JPanel { if(isDownPaneVisible){ upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); horizontToolPane.setBounds(0, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight); - downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight-30); + downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight - bottomHeight); verticalToolPane.setBounds(containerWidth - toolPaneHeight, 0, toolPaneHeight, getHeight()); }else{ upPane.setBounds(0, 0, containerWidth - toolPaneHeight, getHeight()); diff --git a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java index f093a14327..01302299ea 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java @@ -1,5 +1,6 @@ package com.fr.design.parameter; +import com.fr.design.dialog.BasicScrollPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; @@ -13,13 +14,12 @@ import java.awt.event.MouseEvent; public class ParameterPropertyPane extends JPanel{ private ParameterToolBarPane toolbarPane; - -// private JWorkBook workbook; + private BasicScrollPane basicScrollPane; private ParaDefinitePane paraPane; public static ParameterPropertyPane THIS; private boolean isEditing = false; - + public static final ParameterPropertyPane getInstance() { if(THIS == null) { THIS = new ParameterPropertyPane(); @@ -43,12 +43,26 @@ public class ParameterPropertyPane extends JPanel{ public ParameterPropertyPane() { toolbarPane = new ParameterToolBarPane(); + basicScrollPane = new BasicScrollPane() { + @Override + protected JPanel createContentPane() { + return toolbarPane; + } - initParameterListener(); + @Override + public void populateBean(Object ob) { + + } + @Override + protected String title4PopupWindow() { + return null; + } + }; + initParameterListener(); this.setLayout(new BorderLayout(0, 6)); this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); - this.add(toolbarPane, BorderLayout.CENTER); + this.add(basicScrollPane, BorderLayout.CENTER); } private void setEditor(FormDesigner editor) { @@ -68,9 +82,9 @@ public class ParameterPropertyPane extends JPanel{ SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - if (paraPane.isWithQueryButton()) + if (paraPane.isWithQueryButton()) { paraPane.addingParameter2Editor(toolbarPane.getTargetParameter(parameterSelectedLabel)); - else { + } else { paraPane.addingParameter2EditorWithQueryButton(toolbarPane.getTargetParameter(parameterSelectedLabel)); } } diff --git a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java index aa7c11660a..cfae55b853 100644 --- a/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java +++ b/designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import javax.swing.BorderFactory; import com.fr.design.gui.ilable.UILabel; import javax.swing.SwingConstants; -import javax.swing.event.ChangeListener; import com.fr.base.Parameter; import com.fr.design.beans.BasicBeanPane; @@ -35,7 +34,6 @@ public class ParameterToolBarPane extends BasicBeanPane { private static final int GAP_BV = 4; private static final int BUTTON_HEIGHT = 20; private static final int WIDTH = 225; - private static final int L_H = 18; public ParameterToolBarPane() { @@ -133,7 +131,7 @@ public class ParameterToolBarPane extends BasicBeanPane { layoutContainer(parent); - int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); + int h= ((parameterSelectedLabellist.size() == 0) ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); return new Dimension(w, h); }