Browse Source

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

* commit 'bdfe04055c0dbb7eb0ac84a4b7d6ee3562013016':
  REPORT-3706 [9.0一轮回归]设计器报表参数界面无添加参数生成
  REPORT-3163 合作开发9.0设计器=>入口跳转=>条件属性
  REPORT-3163 合作开发9.0设计器=>入口跳转=>单元格属性调整
  REPORT-3163 合作开发9.0设计器=>入口跳转=>单元格属性
  REPORT-3163 合作开发9.0设计器=>入口跳转=>超级链接
  REPORT-3163 合作开发9.0设计器=>菜单项跳转到tab=>控件设置
master
superman 7 years ago
parent
commit
78c0487b5a
  1. 4
      designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java
  2. 62
      designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java
  3. 28
      designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java
  4. 1
      designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  5. 29
      designer/src/com/fr/design/actions/edit/HyperlinkAction.java
  6. 2
      designer/src/com/fr/design/cell/editor/AbstractCellEditor.java
  7. 1
      designer/src/com/fr/design/mainframe/CellElementPropertyPane.java
  8. 6
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  9. 4
      designer/src/com/fr/grid/GridMouseAdapter.java
  10. 5
      designer/src/com/fr/grid/selection/CellSelection.java
  11. 7
      designer/src/com/fr/grid/selection/FloatSelection.java
  12. 5
      designer/src/com/fr/poly/creator/ECBlockPane.java
  13. 33
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  14. 2
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  15. 7
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  16. 2
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

4
designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java

@ -1,10 +1,10 @@
package com.fr.design.actions.cell; package com.fr.design.actions.cell;
import java.awt.event.ActionEvent;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.CellElementPropertyPane;
import java.awt.event.ActionEvent;
/** /**
* 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表 * 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表
* *

62
designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java

@ -1,24 +1,18 @@
package com.fr.design.actions.cell; package com.fr.design.actions.cell;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.dialog.BasicPane; import java.awt.event.ActionEvent;
import com.fr.form.ui.Widget;
import com.fr.general.FRLogger;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.TemplateCellElement;
/** /**
* Cell Widget Attribute. * Cell Widget Attribute.
*/ */
public class CellWidgetAttrAction extends AbstractCellElementAction { public class CellWidgetAttrAction extends UpdateAction {
public CellWidgetAttrAction(ElementCasePane t) { public CellWidgetAttrAction() {
super(t);
this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR); this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName()); this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
@ -26,47 +20,7 @@ public class CellWidgetAttrAction extends AbstractCellElementAction {
} }
@Override @Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) { public void actionPerformed(ActionEvent e) {
CellWriteAttrPane pane = new CellWriteAttrPane(this.getEditingComponent()); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
//got simple cell element from column and row.
pane.populate(cellElement);
return pane;
}
@Override
protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) {
CellWriteAttrPane pane = (CellWriteAttrPane) bp;
if (cellElement.getWidget() == null) {
pane.update(cellElement);
return;
}
try {
Widget oldWidget = (Widget) cellElement.getWidget().clone();
pane.update(cellElement);
//这边需要重新设置权限细粒度的hashset是因为Update是直接生成一个新的来update的,所以以前里面的hashset都没有了
Widget newWidget = cellElement.getWidget();
if (newWidget.getClass() == oldWidget.getClass()) {
newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone());
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
}
@Override
protected boolean isNeedShinkToFit() {
return true;
}
@Override
public void update() {
ElementCasePane ePane = this.getEditingComponent();
Selection sel = ePane.getSelection();
if (sel instanceof CellSelection) {
this.setEnabled(true);
} else {
this.setEnabled(false);
}
} }
} }

28
designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java

@ -0,0 +1,28 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.menu.KeySetUtils;
import java.awt.event.ActionEvent;
/**
* Condition Attributes.
*/
public class ConditionAttributesAction extends UpdateAction {
public ConditionAttributesAction() {
this.setMenuKeySet(KeySetUtils.CONDITION_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/highlight.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CONDITION_ATTR);
}
}

1
designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java

@ -186,6 +186,7 @@ public class GlobalStyleMenuDef extends MenuDef {
} }
stylePane.updateGlobalStyle(getEditingComponent()); stylePane.updateGlobalStyle(getEditingComponent());
CellElementPropertyPane.getInstance().GoToPane(Inter.getLocText("FR-Designer-Widget_Style"));
return true; return true;
} }

29
designer/src/com/fr/design/actions/edit/HyperlinkAction.java

@ -0,0 +1,29 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.menu.KeySetUtils;
import java.awt.event.ActionEvent;
/**
* HyperlinkAction.
*/
public class HyperlinkAction extends UpdateAction {
public HyperlinkAction() {
this.setMenuKeySet(KeySetUtils.HYPER_LINK);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK);
}
}

2
designer/src/com/fr/design/cell/editor/AbstractCellEditor.java

@ -7,6 +7,7 @@ import java.awt.Point;
import javax.swing.event.EventListenerList; import javax.swing.event.EventListenerList;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.event.CellEditorEvent; import com.fr.grid.event.CellEditorEvent;
import com.fr.grid.event.CellEditorListener; import com.fr.grid.event.CellEditorListener;
@ -114,6 +115,7 @@ public abstract class AbstractCellEditor implements CellEditor {
} }
if(ePane != null) { if(ePane != null) {
ePane.fireSelectionChangeListener(); ePane.fireSelectionChangeListener();
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ELEMENT);
} }
} }

1
designer/src/com/fr/design/mainframe/CellElementPropertyPane.java

@ -176,6 +176,7 @@ public class CellElementPropertyPane extends DockingView {
*/ */
public void GoToPane(String... id) { public void GoToPane(String... id) {
cellElementEditPane.setSelectedIndex(id); cellElementEditPane.setSelectedIndex(id);
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR);
EastRegionContainerPane.getInstance().setWindow2PreferWidth(); EastRegionContainerPane.getInstance().setWindow2PreferWidth();
} }

6
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
@ -169,12 +170,13 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic()); MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic());
menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellExpandAttrAction());
menuDef.addShortCut(new CellWidgetAttrAction(this)); menuDef.addShortCut(new CellWidgetAttrAction());
menuDef.addShortCut(new GlobalStyleMenuDef(this)); menuDef.addShortCut(new GlobalStyleMenuDef(this));
menuDef.addShortCut(new ConditionAttributesAction());
// 单元格形态 // 单元格形态
menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this));
menuDef.addShortCut(new HyperlinkAction());
menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(SeparatorDef.DEFAULT);
menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new MergeCellAction(this));
menuDef.addShortCut(new UnmergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this));

4
designer/src/com/fr/grid/GridMouseAdapter.java

@ -6,6 +6,7 @@ import com.fr.base.ScreenResolution;
import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JSliderPane; import com.fr.design.mainframe.JSliderPane;
import com.fr.design.present.CellWriteAttrPane; import com.fr.design.present.CellWriteAttrPane;
@ -204,7 +205,6 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
*/ */
private void showWidetWindow(TemplateCellElement cellElement, TemplateElementCase report) { private void showWidetWindow(TemplateCellElement cellElement, TemplateElementCase report) {
// int resolution = ScreenResolution.getScreenResolution();
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report); DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report); DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
double fixed_pos_x = this.oldEvtX - columnWidthList.getRangeValue(grid.getHorizontalValue(), cellElement.getColumn()).toPixD(resolution); double fixed_pos_x = this.oldEvtX - columnWidthList.getRangeValue(grid.getHorizontalValue(), cellElement.getColumn()).toPixD(resolution);
@ -212,7 +212,7 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
double cell_width = columnWidthList.getRangeValue(cellElement.getColumn(), cellElement.getColumn() + cellElement.getColumnSpan()).toPixD(resolution); double cell_width = columnWidthList.getRangeValue(cellElement.getColumn(), cellElement.getColumn() + cellElement.getColumnSpan()).toPixD(resolution);
double cell_height = rowHeightList.getRangeValue(cellElement.getRow(), cellElement.getRow() + cellElement.getRowSpan()).toPixD(resolution); double cell_height = rowHeightList.getRangeValue(cellElement.getRow(), cellElement.getRow() + cellElement.getRowSpan()).toPixD(resolution);
if (fitSizeToShow(cell_width, cell_height, fixed_pos_x, fixed_pos_y)) { if (fitSizeToShow(cell_width, cell_height, fixed_pos_x, fixed_pos_y)) {
CellWriteAttrPane.showWidgetWindow(grid.getElementCasePane()); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
} }
} }

5
designer/src/com/fr/grid/selection/CellSelection.java

@ -8,6 +8,7 @@ import com.fr.design.actions.cell.GlobalStyleMenuDef.GlobalStyleSelection;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.CopyAction;
import com.fr.design.actions.edit.CutAction; import com.fr.design.actions.edit.CutAction;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.actions.edit.PasteAction; import com.fr.design.actions.edit.PasteAction;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.CellElementsClip;
@ -456,11 +457,13 @@ public class CellSelection extends Selection {
} }
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook()){ //表单中报表块编辑屏蔽掉 控件设置 if (jTemplate.isJWorkBook()){ //表单中报表块编辑屏蔽掉 控件设置
popup.add(new CellWidgetAttrAction(ePane).createMenuItem()); popup.add(new CellWidgetAttrAction().createMenuItem());
} }
popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(new CellExpandAttrAction().createMenuItem());
popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu()); popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu());
popup.add(new CellAttributeAction().createMenuItem()); popup.add(new CellAttributeAction().createMenuItem());
popup.add(new ConditionAttributesAction().createMenuItem());
popup.add(new HyperlinkAction().createMenuItem());
// cut, copy and paste // cut, copy and paste
popup.addSeparator(); popup.addSeparator();
popup.add(new CutAction(ePane).createMenuItem()); popup.add(new CutAction(ePane).createMenuItem());

7
designer/src/com/fr/grid/selection/FloatSelection.java

@ -9,11 +9,7 @@ import com.fr.base.FRContext;
import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.CleanAuthorityAction;
import com.fr.design.actions.cell.FloatStyleAction; import com.fr.design.actions.cell.FloatStyleAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.*;
import com.fr.design.actions.edit.CutAction;
import com.fr.design.actions.edit.DeleteAction;
import com.fr.design.actions.edit.EditFloatElementNameAction;
import com.fr.design.actions.edit.PasteAction;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.CellElementsClip;
import com.fr.design.cell.clipboard.ElementsTransferable; import com.fr.design.cell.clipboard.ElementsTransferable;
@ -125,6 +121,7 @@ public class FloatSelection extends Selection {
} }
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu()); popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
popup.add(new FloatStyleAction(ePane).createMenuItem()); popup.add(new FloatStyleAction(ePane).createMenuItem());
popup.add(new HyperlinkAction().createMenuItem());
// cut, copy and paste // cut, copy and paste
popup.addSeparator(); popup.addSeparator();

5
designer/src/com/fr/poly/creator/ECBlockPane.java

@ -4,6 +4,7 @@
package com.fr.poly.creator; package com.fr.poly.creator;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
@ -142,12 +143,14 @@ public class ECBlockPane extends PolyElementCasePane {
MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic()); MenuDef menuDef = new MenuDef(KeySetUtils.CELL.getMenuKeySetName(), KeySetUtils.CELL.getMnemonic());
menuDef.addShortCut(new CellExpandAttrAction()); menuDef.addShortCut(new CellExpandAttrAction());
menuDef.addShortCut(new CellWidgetAttrAction(this)); menuDef.addShortCut(new CellWidgetAttrAction());
menuDef.addShortCut(new GlobalStyleMenuDef(this)); menuDef.addShortCut(new GlobalStyleMenuDef(this));
menuDef.addShortCut(new ConditionAttributesAction());
// 单元格形态 // 单元格形态
menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this));
menuDef.addShortCut(new HyperlinkAction());
menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(SeparatorDef.DEFAULT);
menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new MergeCellAction(this));
menuDef.addShortCut(new UnmergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this));

33
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -39,17 +39,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final int POPUP_MIN_HEIGHT = 145; private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_MAX_HEIGHT = 480; private static final int POPUP_MAX_HEIGHT = 480;
private static final int POPUP_DEFAULT_HEIGHT = 360; private static final int POPUP_DEFAULT_HEIGHT = 360;
private static final String KEY_CELL_ELEMENT = "cellElement"; public static final String KEY_CELL_ELEMENT = "cellElement";
private static final String KEY_CELL_ATTR = "cellAttr"; public static final String KEY_CELL_ATTR = "cellAttr";
private static final String KEY_FLOAT_ELEMENT = "floatElement"; public static final String KEY_FLOAT_ELEMENT = "floatElement";
private static final String KEY_WIDGET_SETTINGS = "widgetSettings"; public static final String KEY_WIDGET_SETTINGS = "widgetSettings";
private static final String KEY_CONDITION_ATTR = "conditionAttr"; public static final String KEY_CONDITION_ATTR = "conditionAttr";
private static final String KEY_HYPERLINK = "hyperlink"; public static final String KEY_HYPERLINK = "hyperlink";
private static final String KEY_WIDGET_LIB = "widgetLib"; public static final String KEY_WIDGET_LIB = "widgetLib";
private static final String KEY_AUTHORITY_EDITION = "authorityEdition"; public static final String KEY_AUTHORITY_EDITION = "authorityEdition";
private static final String KEY_CONFIGURED_ROLES = "editedRoles"; public static final String KEY_CONFIGURED_ROLES = "editedRoles";
private static final String DEFAULT_PANE = "defaultPane"; public static final String DEFAULT_PANE = "defaultPane";
private static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane"; public static final String DEFAULT_AUTHORITY_PANE = "defaultAuthorityPane";
private JPanel defaultPane; // "无可用配置项"面板 private JPanel defaultPane; // "无可用配置项"面板
private JPanel defaultAuthorityPane; // "该元素不支持权限编辑" private JPanel defaultAuthorityPane; // "该元素不支持权限编辑"
@ -359,6 +359,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
propertyItemMap.get(KEY_WIDGET_SETTINGS).removeHeaderPane(); propertyItemMap.get(KEY_WIDGET_SETTINGS).removeHeaderPane();
} }
public void switchTabTo(String tabName) {
PropertyItem propertyItem = propertyItemMap.get(tabName);
if (propertyItem == null) {
return;
}
if (propertyItem.isVisible() && propertyItem.isEnabled() && !propertyItem.isPoppedOut()) {
propertyCard.show(rightPane, tabName);
propertyItem.setTabButtonSelected();
}
}
/** /**
* 刷新右面板 * 刷新右面板
*/ */

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

@ -114,7 +114,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
FormWidgetDetailPane.getInstance(this)); FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) { if (!BaseUtils.isAuthorityEditing()) {
ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(this); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(this);
parameterPropertyPane.setAddParaPaneVisible(true); parameterPropertyPane.refreshState();
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane( EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(

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

@ -45,7 +45,7 @@ public class ParameterPropertyPane extends JPanel{
revalidate(); revalidate();
} }
public ParameterPropertyPane() { private ParameterPropertyPane() {
toolbarPane = new ParameterToolBarPane(); toolbarPane = new ParameterToolBarPane();
BasicScrollPane basicScrollPane = new BasicScrollPane() { BasicScrollPane basicScrollPane = new BasicScrollPane() {
@Override @Override
@ -77,6 +77,11 @@ public class ParameterPropertyPane extends JPanel{
this.add(addParaPane, BorderLayout.CENTER); this.add(addParaPane, BorderLayout.CENTER);
} }
// 显示或隐藏添加参数面板
public void refreshState() {
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem());
}
public void setAddParaPaneVisible(boolean isVisible) { public void setAddParaPaneVisible(boolean isVisible) {
if (isVisible == addParaPane.isVisible()) { if (isVisible == addParaPane.isVisible()) {
return; return;

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

@ -82,6 +82,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(label); this.add(label);
if (parameterArray.length == 0) { if (parameterArray.length == 0) {
ParameterPropertyPane.getInstance().refreshState();
this.setVisible(false); this.setVisible(false);
this.repaint(); this.repaint();
return; return;
@ -102,6 +103,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(addAll); this.add(addAll);
this.doLayout(); this.doLayout();
ParameterPropertyPane.getInstance().refreshState();
this.repaint(); this.repaint();
} }

Loading…
Cancel
Save