Browse Source

Merge pull request #1212 in BA/design from ~PLOUGH/design:release/9.0 to release/9.0

* commit '4281202edffaac9ebd0ed78a05c1ab502025f678':
  无JIRA任务,代码规范
  REPORT-4421 改代码规范
  无JIRA任务,cpt无法切换到表单-超级链接面板错误
  REPORT-4421 以下参数未生成问题=>修复空指针错误=>调整代码
  REPORT-4421 以下参数未生成问题=>修复空指针错误
master
neil 7 years ago
parent
commit
49d7750f4e
  1. 4
      designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  2. 28
      designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java
  3. 2
      designer_form/src/com/fr/design/mainframe/JForm.java
  4. 31
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

4
designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -229,8 +229,8 @@ public class FormElementCaseDesigner<T extends FormElementCaseProvider, E extend
return conditionAttributesGroupPane; return conditionAttributesGroupPane;
} }
public JPanel getHyperlinkPane() { public JPanel getHyperlinkPane(JTemplate jt) {
return DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance()); return jt.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
} }

28
designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java

@ -6,6 +6,7 @@ import java.awt.image.BufferedImage;
import javax.swing.JComponent; import javax.swing.JComponent;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
@ -13,78 +14,79 @@ import com.fr.form.FormElementCaseProvider;
public interface FormECDesignerProvider { public interface FormECDesignerProvider {
public static final String XML_TAG = "FormElementCaseDesigner"; String XML_TAG = "FormElementCaseDesigner";
/** /**
* 选中目标的 对应Menu * 选中目标的 对应Menu
* @return 返回MenuDef数组. * @return 返回MenuDef数组.
*/ */
public MenuDef[] menus4Target(); MenuDef[] menus4Target();
/** /**
* 获取焦点 * 获取焦点
*/ */
public void requestFocus() ; void requestFocus() ;
/** /**
* 工具栏菜单字体字号等 * 工具栏菜单字体字号等
* @return 工具栏菜单数组 * @return 工具栏菜单数组
*/ */
public ToolBarDef[] toolbars4Target(); ToolBarDef[] toolbars4Target();
/** /**
* 表单的报表块的工具按钮复制剪切那行 * 表单的报表块的工具按钮复制剪切那行
* @return 工具按钮 * @return 工具按钮
*/ */
public JComponent[] toolBarButton4Form(); JComponent[] toolBarButton4Form();
/** /**
* 模板菜单 * 模板菜单
* @return 返回菜单 * @return 返回菜单
*/ */
public ShortCut[] shortcut4TemplateMenu(); ShortCut[] shortcut4TemplateMenu();
/** /**
*当前正在编辑的elementcase *当前正在编辑的elementcase
* @return 当前正在编辑的elementcase * @return 当前正在编辑的elementcase
*/ */
public FormElementCaseProvider getEditingElementCase(); FormElementCaseProvider getEditingElementCase();
/** /**
* 右上角属性表 * 右上角属性表
* @return 属性面板 * @return 属性面板
*/ */
public JComponent getEastDownPane(); JComponent getEastDownPane();
/** /**
* 右下角控件树或者扩展属性 * 右下角控件树或者扩展属性
* @return 属性面板 * @return 属性面板
*/ */
public JComponent getEastUpPane(); JComponent getEastUpPane();
/** /**
* 条件属性面板 * 条件属性面板
* @return 属性面板 * @return 属性面板
*/ */
public JComponent getConditionAttrPane(); JComponent getConditionAttrPane();
/** /**
* 超级链接面板 * 超级链接面板
* @param jt 当前模板JForm
* @return 属性面板 * @return 属性面板
*/ */
public JComponent getHyperlinkPane(); JComponent getHyperlinkPane(JTemplate jt);
/** /**
* 超级链接面板 * 超级链接面板
* @return 属性面板 * @return 属性面板
*/ */
public TargetComponent getEditingElementCasePane(); TargetComponent getEditingElementCasePane();
/** /**
* 获取当前ElementCase的缩略图 * 获取当前ElementCase的缩略图
* @param elementCaseContainerSize 缩略图的大小 * @param elementCaseContainerSize 缩略图的大小
* @return * @return
*/ */
public BufferedImage getElementCaseImage(Dimension elementCaseContainerSize); BufferedImage getElementCaseImage(Dimension elementCaseContainerSize);
} }

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

@ -683,7 +683,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane()); EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane()); EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(elementCaseDesign.getConditionAttrPane()); EastRegionContainerPane.getInstance().replaceConditionAttrPane(elementCaseDesign.getConditionAttrPane());
EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane()); EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane(this));
return; return;
} }

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

@ -26,16 +26,19 @@ public class ParameterPropertyPane extends JPanel{
private static ParameterPropertyPane THIS; private static ParameterPropertyPane THIS;
private boolean isEditing = false; private boolean isEditing = false;
private static final int HIDE_HEIGHT = 40; private static final int HIDE_HEIGHT = 40;
private static final int PADDING_SMALL = 5;
private static final int PADDING_MIDDLE = 10;
private static final int PADDING_LARGE = 15;
public static final ParameterPropertyPane getInstance() { public static final ParameterPropertyPane getInstance() {
if(THIS == null) { if (THIS == null) {
THIS = new ParameterPropertyPane(); THIS = new ParameterPropertyPane();
} }
return THIS; return THIS;
} }
public static final ParameterPropertyPane getInstance(FormDesigner editor) { public static final ParameterPropertyPane getInstance(FormDesigner editor) {
if(THIS == null) { if (THIS == null) {
THIS = new ParameterPropertyPane(); THIS = new ParameterPropertyPane();
} }
THIS.setEditor(editor); THIS.setEditor(editor);
@ -49,6 +52,10 @@ public class ParameterPropertyPane extends JPanel{
} }
private ParameterPropertyPane() { private ParameterPropertyPane() {
init();
}
private void init() {
toolbarPane = new ParameterToolBarPane(); toolbarPane = new ParameterToolBarPane();
BasicScrollPane basicScrollPane = new BasicScrollPane() { BasicScrollPane basicScrollPane = new BasicScrollPane() {
@Override @Override
@ -58,7 +65,7 @@ public class ParameterPropertyPane extends JPanel{
@Override @Override
public void populateBean(Object ob) { public void populateBean(Object ob) {
// do nothing
} }
@Override @Override
@ -67,16 +74,15 @@ public class ParameterPropertyPane extends JPanel{
} }
}; };
JPanel scrollPaneWrapperInner = new JPanel(new BorderLayout()); JPanel scrollPaneWrapperInner = new JPanel(new BorderLayout());
scrollPaneWrapperInner.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 5)); scrollPaneWrapperInner.setBorder(BorderFactory.createEmptyBorder(0, PADDING_MIDDLE, PADDING_MIDDLE, PADDING_SMALL));
scrollPaneWrapperInner.add(basicScrollPane, BorderLayout.CENTER); scrollPaneWrapperInner.add(basicScrollPane, BorderLayout.CENTER);
addParaPane = new JPanel(new BorderLayout()); addParaPane = new JPanel(new BorderLayout());
addParaPane.add(scrollPaneWrapperInner, BorderLayout.CENTER); addParaPane.add(scrollPaneWrapperInner, BorderLayout.CENTER);
addParaPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.SPLIT_LINE)); addParaPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.SPLIT_LINE));
initParameterListener(); initParameterListener();
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout(0, 6));
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); this.setBorder(BorderFactory.createEmptyBorder(PADDING_MIDDLE, 0, PADDING_MIDDLE, 0));
this.add(addParaPane, BorderLayout.CENTER); this.add(addParaPane, BorderLayout.CENTER);
} }
@ -90,8 +96,13 @@ public class ParameterPropertyPane extends JPanel{
return; return;
} }
// 表单中,只有添加并选中参数面板时,才显示 // 表单中,只有添加并选中参数面板时,才显示
boolean hideInJForm = DesignerContext.getDesignerFrame().getSelectedJTemplate() instanceof JForm && boolean hideInJForm;
try {
hideInJForm = DesignerContext.getDesignerFrame().getSelectedJTemplate() instanceof JForm &&
!(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout); !(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout);
} catch (NullPointerException ex) {
hideInJForm = true;
}
if (isVisible && toolbarPane.hasSelectedLabelItem() && !hideInJForm) { if (isVisible && toolbarPane.hasSelectedLabelItem() && !hideInJForm) {
addParaPane.setVisible(true); addParaPane.setVisible(true);
this.setPreferredSize(null); this.setPreferredSize(null);
@ -105,7 +116,7 @@ public class ParameterPropertyPane extends JPanel{
private void setEditor(FormDesigner editor) { private void setEditor(FormDesigner editor) {
if (formHierarchyTreePaneWrapper == null) { if (formHierarchyTreePaneWrapper == null) {
formHierarchyTreePaneWrapper = new JPanel(new BorderLayout()); formHierarchyTreePaneWrapper = new JPanel(new BorderLayout());
formHierarchyTreePaneWrapper.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15)); formHierarchyTreePaneWrapper.setBorder(BorderFactory.createEmptyBorder(0, PADDING_MIDDLE, 0, PADDING_LARGE));
this.add(formHierarchyTreePaneWrapper, BorderLayout.SOUTH); this.add(formHierarchyTreePaneWrapper, BorderLayout.SOUTH);
} }
formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance()); formHierarchyTreePaneWrapper.remove(FormHierarchyTreePane.getInstance());
@ -116,7 +127,7 @@ public class ParameterPropertyPane extends JPanel{
toolbarPane.setParaMouseListener(new MouseAdapter() { toolbarPane.setParaMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if(paraPane == null) { if (paraPane == null) {
return; return;
} }
final UIButton parameterSelectedLabel = (UIButton) e.getSource(); final UIButton parameterSelectedLabel = (UIButton) e.getSource();
@ -137,7 +148,7 @@ public class ParameterPropertyPane extends JPanel{
toolbarPane.addActionListener(new ActionListener() { toolbarPane.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(paraPane == null) { if (paraPane == null) {
return; return;
} }
paraPane.addingAllParameter2Editor(); paraPane.addingAllParameter2Editor();

Loading…
Cancel
Save