xiaoxia 8 years ago
parent
commit
db5a843390
  1. 3
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  2. 27
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  3. 6
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

3
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -14,6 +14,7 @@ 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;
@ -139,7 +140,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();
}

27
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,8 +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 {
paraPane.addingParameter2EditorWithQueryButton(toolbarPane.getTargetParameter(parameterSelectedLabel));
}

6
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;
@ -23,7 +22,7 @@ import com.fr.general.Inter;
* @author: august
* */
public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private Parameter[] parameterList;
public Parameter[] parameterList;
private ArrayList<UIButton> parameterSelectedLabellist = new ArrayList<UIButton>();
private MouseListener paraMouseListner;
private UIButton addAll;
@ -35,7 +34,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
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<Parameter[]> {
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);
}

Loading…
Cancel
Save