Browse Source

REPORT-3163 合作开发9.0设计器=>参数面板=》实现基本交互

master
plough 7 years ago
parent
commit
2a0f62deef
  1. 3
      designer_base/src/com/fr/design/constants/UIConstants.java
  2. 2
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  3. 6
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  4. 11
      designer_form/src/com/fr/design/mainframe/JForm.java
  5. 47
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  6. 4
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

3
designer_base/src/com/fr/design/constants/UIConstants.java

@ -22,6 +22,8 @@ public interface UIConstants {
public static final int SIZE = 17; public static final int SIZE = 17;
public static final int GAP_NORMAL = 10; // 10px
/** /**
* Cell default cursor. * Cell default cursor.
*/ */
@ -93,6 +95,7 @@ public interface UIConstants {
public static final Color RULER_LINE_COLOR = new Color(0xababab); public static final Color RULER_LINE_COLOR = new Color(0xababab);
public static final Color RULER_SCALE_COLOR = new Color(0x4e504f); public static final Color RULER_SCALE_COLOR = new Color(0x4e504f);
public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd); public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd);
public static final Color SPLIT_LINE = new Color(201, 198, 184);
public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png"); public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png");

2
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -162,7 +162,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { p, f, 155}; double[] columnSize = { p, f, 155};
double[] rowSize = {20}; double[] rowSize = {p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(getAddItemText()), null, topToolBar}, new Component[]{new UILabel(getAddItemText()), null, topToolBar},
}; };

6
designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java

@ -113,8 +113,10 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
EastRegionContainerPane.getInstance().replaceWidgetLibPane( EastRegionContainerPane.getInstance().replaceWidgetLibPane(
FormWidgetDetailPane.getInstance(this)); FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) { if (!BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this)); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(this);
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); parameterPropertyPane.setAddParaPaneVisible(true);
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane( EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(
WidgetPropertyPane.getInstance(this)); WidgetPropertyPane.getInstance(this));
} else { } else {

11
designer_form/src/com/fr/design/mainframe/JForm.java

@ -300,8 +300,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
private void setPropertyPaneChange(XComponent comp) { private void setPropertyPaneChange(XComponent comp) {
if (comp == null) { if (comp == null) {
ParameterPropertyPane.getInstance().setAddParaPaneVisible(false);
return; return;
} }
ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout);
editingComponent = comp.createToolPane(this, formDesign); editingComponent = comp.createToolPane(this, formDesign);
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
@ -677,10 +679,11 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign));
if (formDesign.getParaComponent() != null) { ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign);
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign)); parameterPropertyPane.setAddParaPaneVisible(false);
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(formDesign).getPreferredSize().height); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
} EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) { if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) {
new Thread() { new Thread() {
public void run() { public void run() {

47
designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

@ -1,5 +1,6 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
@ -14,11 +15,14 @@ import java.awt.event.MouseEvent;
public class ParameterPropertyPane extends JPanel{ public class ParameterPropertyPane extends JPanel{
private ParameterToolBarPane toolbarPane; private ParameterToolBarPane toolbarPane;
private BasicScrollPane basicScrollPane;
private ParaDefinitePane paraPane; private ParaDefinitePane paraPane;
private JPanel formHierarchyTreePaneWrapper; // 封装一层,加边框
private JPanel addParaPane;
public static ParameterPropertyPane THIS;
private static ParameterPropertyPane THIS;
private boolean isEditing = false; private boolean isEditing = false;
private static final int HIDE_HEIGHT = 40;
public static final ParameterPropertyPane getInstance() { public static final ParameterPropertyPane getInstance() {
if(THIS == null) { if(THIS == null) {
@ -43,7 +47,7 @@ public class ParameterPropertyPane extends JPanel{
public ParameterPropertyPane() { public ParameterPropertyPane() {
toolbarPane = new ParameterToolBarPane(); toolbarPane = new ParameterToolBarPane();
basicScrollPane = new BasicScrollPane() { BasicScrollPane basicScrollPane = new BasicScrollPane() {
@Override @Override
protected JPanel createContentPane() { protected JPanel createContentPane() {
return toolbarPane; return toolbarPane;
@ -59,15 +63,42 @@ public class ParameterPropertyPane extends JPanel{
return null; return null;
} }
}; };
initParameterListener(); JPanel scrollPaneWrapperInner = new JPanel(new BorderLayout());
scrollPaneWrapperInner.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 5));
scrollPaneWrapperInner.add(basicScrollPane, BorderLayout.CENTER);
addParaPane = new JPanel(new BorderLayout());
addParaPane.add(scrollPaneWrapperInner, BorderLayout.CENTER);
addParaPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.SPLIT_LINE));
initParameterListener();
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout(0, 6));
this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
this.add(basicScrollPane, BorderLayout.CENTER); this.add(addParaPane, BorderLayout.CENTER);
} }
public void setAddParaPaneVisible(boolean isVisible) {
if (isVisible == addParaPane.isVisible()) {
return;
}
if (isVisible && toolbarPane.hasSelectedLabelItem()) {
addParaPane.setVisible(true);
this.setPreferredSize(null);
} else {
addParaPane.setVisible(false);
this.setPreferredSize(new Dimension(getWidth(), HIDE_HEIGHT));
}
repaintContainer();
}
private void setEditor(FormDesigner editor) { private void setEditor(FormDesigner editor) {
this.remove(FormHierarchyTreePane.getInstance()); if (formHierarchyTreePaneWrapper == null) {
this.add(FormHierarchyTreePane.getInstance(editor), BorderLayout.NORTH); formHierarchyTreePaneWrapper = new JPanel(new BorderLayout());
formHierarchyTreePaneWrapper.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
this.add(formHierarchyTreePaneWrapper, BorderLayout.SOUTH);
}
formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance());
formHierarchyTreePaneWrapper.add(FormHierarchyTreePane.getInstance(editor), BorderLayout.CENTER);
} }
private void initParameterListener() { private void initParameterListener() {

4
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -57,6 +57,10 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
} }
public boolean hasSelectedLabelItem() {
return !parameterSelectedLabellist.isEmpty();
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return null; return null;

Loading…
Cancel
Save