Browse Source

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

* commit 'c9a21400fa70a47131ffd05af824f220bc9c4d69':
  代码规范
  REPORT-3952 [9.0一轮回归]插入悬浮元素选择插入图表点击取消时会触发保存按钮
  REPORT-4005 [9.0一轮回归] 设置事件编辑提交入库失败
  REPORT-3850 [9.0一轮回归]退出权限编辑后界面右侧仍显示权限编辑栏
master
superman 7 years ago
parent
commit
ff61f54b9b
  1. 9
      designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java
  2. 83
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  3. 46
      designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java
  4. 5
      designer/src/com/fr/poly/creator/ECBlockPane.java
  5. 63
      designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java

9
designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java

@ -30,6 +30,8 @@ import java.awt.*;
*/
public class ChartFloatAction extends ElementCaseAction {
private boolean isRecordNeeded;
/**
* 构造函数 图表插入悬浮元素
*/
@ -64,9 +66,10 @@ public class ChartFloatAction extends ElementCaseAction {
* @return 是则返回true
*/
public boolean executeActionReturnUndoRecordNeeded() {
isRecordNeeded = false;
final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (reportPane == null) {
return false;
return isRecordNeeded;
}
reportPane.stopEditing();
@ -78,7 +81,7 @@ public class ChartFloatAction extends ElementCaseAction {
chartDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
isRecordNeeded = true;
FloatElement newFloatElement;
try {
newFloatElement = new FloatElement(chartDialog.getChartCollection().clone());
@ -101,6 +104,6 @@ public class ChartFloatAction extends ElementCaseAction {
});
chartDialog.setVisible(true);
return true;
return isRecordNeeded;
}
}

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

@ -45,48 +45,12 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
public ElementCasePaneDelegate(WorkSheet sheet) {
super(sheet);
this.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
//在编辑权限,所以要更新权限编辑面板
if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
if (!isEditable()) {
return;
}
CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection();
// 模板初始化完成后,才能初始化超级链接面板
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (editingSelection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
JPanel floatPane = new JPanel(new BorderLayout());
floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH);
floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane);
} else {
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
}
EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane();
}
doOnSelectionChanged();
}
});
this.addTargetModifiedListener(new TargetModifiedListener() {
@ -97,6 +61,48 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
});
}
private void doOnSelectionChanged() {
//在编辑权限,所以要更新权限编辑面板
if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return;
}
CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
Selection editingSelection = ((ElementCasePaneDelegate)e.getSource()).getSelection();
// 模板初始化完成后,才能初始化超级链接面板
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (editingSelection instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
JPanel floatPane = new JPanel(new BorderLayout());
floatPane.add(ReportFloatPane.getInstance(), BorderLayout.NORTH);
floatPane.add(QuickEditorRegion.getInstance(), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceFloatElementPane(floatPane);
} else {
// 条件属性
ConditionAttributesGroupPane conditionAttributesGroupPane = ConditionAttributesGroupPane.getInstance();
conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance());
}
EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane();
}
}
@Override
protected boolean supportRepeatedHeaderFooter() {
return true;
@ -123,6 +129,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
*
* @return 不是必须在可见范围.
*/
@Override
public boolean mustInVisibleRange() {
return false;
}

46
designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java

@ -8,9 +8,7 @@ import java.awt.event.ActionEvent;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JRootPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableCellRenderer;
@ -34,10 +32,7 @@ import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.*;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.general.Inter;
@ -46,12 +41,15 @@ import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.stable.ColumnRow;
import com.fr.stable.ColumnRowGroup;
import com.fr.stable.StringUtils;
import com.fr.write.DMLConfigJob;
public class SmartInsertDBManipulationPane extends DBManipulationPane {
private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1);
private ElementCasePane ePane;
private static int CELL_GROUP_LIMIT = 6;
private static int TOP_PADDING = 30;
private static int LEFT_COLUMN_MAX_WIDTH = 40;
public SmartInsertDBManipulationPane(ElementCasePane ePane) {
super(ValueEditorPaneFactory.extendedCellGroupEditors());
@ -60,10 +58,14 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
public SmartInsertDBManipulationPane() {
super(ValueEditorPaneFactory.extendedCellGroupEditors());
JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
this.ePane = ((JWorkBook) jTemplate).getEditingElementCasePane();
init();
}
private void init() {
JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
this.ePane = ((JWorkBook) jTemplate).getEditingElementCasePane();
}
@Override
protected SubmitJobListPane createSubmitJobListPane() {
return new SmartInsertSubmitJobListPane();
@ -126,7 +128,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
}
};
bPane.setLayout(FRGUIPaneFactory.createBorderLayout());
bPane.setBorder(BorderFactory.createEmptyBorder(30, 0, 0, 0));
bPane.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, 0, 0));
final UIBasicSpinner columnSpinner = new UIBasicSpinner();
final UIBasicSpinner rowSpinner = new UIBasicSpinner();
Component[][] coms = new Component[][] { { new UILabel(Inter.getLocText("RWA-Row_Offset")), rowSpinner },{ new UILabel(Inter.getLocText("RWA-Column_Offset")), columnSpinner } };
@ -196,11 +198,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
/*
* 当前的ReportPane不可编辑,不可切换Sheet,加GridSelectionChangeListener
*/
ePane.setSelection(NO_SELECTION);
ePane.setEditable(false);
ePane.setSelection(NO_SELECTION);
ePane.getGrid().setNotShowingTableSelectPane(false);
BasicDialog dlg = bPane.showWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this));
BasicDialog dlg = bPane.showWindow(DesignerContext.getDesignerFrame());
dlg.setModal(false);
dlg.setVisible(true);
@ -292,11 +294,6 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
}
}
private boolean possibleParentContainer(Container p) {
return p instanceof Dialog || p instanceof BasicPane ||
p instanceof JPanel || p instanceof JRootPane || p instanceof JLayeredPane;
}
private class SmartJTablePane4DB extends SmartJTablePane {
// 是否是单元格组
@ -332,7 +329,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
* set Width
*/
TableColumn column0 = table.getColumnModel().getColumn(0);
column0.setMaxWidth(40);
column0.setMaxWidth(LEFT_COLUMN_MAX_WIDTH);
/*
* 设置Column 1的Renderer
*/
@ -413,7 +410,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
// 要考虑多选的情况 要结合之前的看看 可能是增加 也可能需要减少
ColumnRowGroup add = new ColumnRowGroup();
int removeCount = 0;
if (oriCellSelection != null && sameStartPoint(cellselection, oriCellSelection)) {
if (oriCellSelection != null && isSameStartPoint(cellselection, oriCellSelection)) {
removeCount = dealDragSelection(add, cellselection);
} else if (cellselection.getSelectedType() == CellSelection.CHOOSE_ROW || cellselection.getSelectedType() == CellSelection.CHOOSE_COLUMN) {
dealSelectColRow(add, cellselection);
@ -444,7 +441,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
return newValue;
}
private boolean sameStartPoint(CellSelection cs1, CellSelection cs2) {
private boolean isSameStartPoint(CellSelection cs1, CellSelection cs2) {
return cs1.getColumn() == cs2.getColumn() && cs1.getRow() == cs2.getRow();
}
@ -482,6 +479,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) {
@Override
public void doOk() {
// 遗留代码
}
@Override
@ -510,7 +508,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
if (((ColumnValue)value).obj != null) {
this.setText(((ColumnValue)value).obj.toString());
} else {
this.setText("");
this.setText(StringUtils.EMPTY);
}
}
@ -538,12 +536,12 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
Object cv = ((ColumnValue) value).obj;
if (cv instanceof ColumnRowGroup && ((ColumnRowGroup)cv).getSize() >= CELL_GROUP_LIMIT) {
text.setText("[" + Inter.getLocText(new String[]{"Has_Selected", "Classifier-Ge", "Cell"},
new String[]{((ColumnRowGroup)cv).getSize()+"", ""}) + "]");
new String[]{((ColumnRowGroup)cv).getSize()+StringUtils.EMPTY, StringUtils.EMPTY}) + "]");
tip = cv.toString() + " " + tip;
} else if (cv != null) {
text.setText(cv.toString());
} else {
text.setText("");
text.setText(StringUtils.EMPTY);
}
}
@ -571,12 +569,12 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane {
Object cv = ((ColumnValue) value).obj;
if (cv instanceof ColumnRowGroup && ((ColumnRowGroup)cv).getSize() >= CELL_GROUP_LIMIT) {
this.setText("[" + Inter.getLocText(new String[]{"Has_Selected", "Classifier-Ge", "Cell"},
new String[]{((ColumnRowGroup)cv).getSize()+"", ""}) + "]");
new String[]{((ColumnRowGroup)cv).getSize()+StringUtils.EMPTY, StringUtils.EMPTY}) + "]");
tip = cv.toString() + " " + tip;
} else if (cv != null) {
this.setText(cv.toString());
} else {
this.setText("");
this.setText(StringUtils.EMPTY);
}
}

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

@ -52,6 +52,9 @@ public class ECBlockPane extends PolyElementCasePane {
@Override
public void selectionChanged(SelectionEvent e) {
if (!isEditable()) {
return;
}
if (BaseUtils.isAuthorityEditing()) {
if (designer.getSelection().getEditingElementCasePane() == null) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED);
@ -116,7 +119,7 @@ public class ECBlockPane extends PolyElementCasePane {
// 插入菜单
private MenuDef createInsertMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("M-Insert"), 'I');
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Insert"), 'I');
// 单元格菜单
menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this));

63
designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java

@ -1 +1,62 @@
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.DesignModelAdapter; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; import com.fr.general.Inter; /** * Author : daisy * Date: 13-9-2 * Time: 下午3:36 */ public class ExitAuthorityEditAction extends TemplateComponentAction { public ExitAuthorityEditAction(TargetComponent t) { super(t); this.setName(Inter.getLocText(new String[]{"Exit", "DashBoard-Potence", "Edit"})); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png")); } public void prepare4Undo() { } public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } if (BaseUtils.isAuthorityEditing()) { BaseUtils.setAuthorityEditing(false); WestRegionContainerPane.getInstance().replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); EastRegionContainerPane.getInstance().replaceDownPane(tc.getEastDownPane()); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); DesignerContext.getDesignerFrame().refreshDottedLine(); fireAuthorityStateToNomal(); } return true; } /** * 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 */ private void fireAuthorityStateToNomal() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { //如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 if (opendedTemplate.get(i).isDoSomethingInAuthority()) { opendedTemplate.get(i).fireAuthorityStateToNomal(); } } } }
package com.fr.design.actions;
import com.fr.base.BaseUtils;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.DesignModelAdapter;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.*;
import com.fr.general.Inter;
/**
* Author : daisy
* Date: 13-9-2
* Time: 下午3:36
*/
public class ExitAuthorityEditAction extends TemplateComponentAction {
public ExitAuthorityEditAction(TargetComponent t) {
super(t);
this.setName(Inter.getLocText(new String[]{"Exit", "DashBoard-Potence", "Edit"}));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png"));
}
public void prepare4Undo() {
// 遗留代码
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
TargetComponent tc = getEditingComponent();
if (tc == null) {
return false;
}
if (BaseUtils.isAuthorityEditing()) {
BaseUtils.setAuthorityEditing(false);
WestRegionContainerPane.getInstance().replaceDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus());
DesignerContext.getDesignerFrame().needToAddAuhtorityPaint();
DesignerContext.getDesignerFrame().refreshDottedLine();
fireAuthorityStateToNomal();
}
return true;
}
/**
* 退出权限编辑时将所有的做过权限编辑的状态作为一个状态赋给报报表主体
*/
private void fireAuthorityStateToNomal() {
java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList();
for (int i = 0; i < opendedTemplate.size(); i++) {
//如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表
if (opendedTemplate.get(i).isDoSomethingInAuthority()) {
opendedTemplate.get(i).fireAuthorityStateToNomal();
}
}
}
}
Loading…
Cancel
Save