From f4ff6dd948fabf847be13937634683d28ab3a9f9 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 22 Aug 2017 16:37:01 +0800 Subject: [PATCH 01/11] =?UTF-8?q?REPORT-3850=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E9=80=80=E5=87=BA=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=90=8E=E7=95=8C=E9=9D=A2=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E4=BB=8D=E6=98=BE=E7=A4=BA=E6=9D=83=E9=99=90=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/ExitAuthorityEditAction.java | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java index 238e703f1..dfb7f1dd6 100644 --- a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java +++ b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java @@ -1 +1,61 @@ -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> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { //如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 if (opendedTemplate.get(i).isDoSomethingInAuthority()) { opendedTemplate.get(i).fireAuthorityStateToNomal(); } } } } \ No newline at end of file +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())); + HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); + DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); + DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); + DesignerContext.getDesignerFrame().refreshDottedLine(); + + fireAuthorityStateToNomal(); + } + return true; + } + + + /** + * 退出权限编辑时,将所有的做过权限编辑的状态,作为一个状态赋给报、报表主体 + */ + private void fireAuthorityStateToNomal() { + java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); + for (int i = 0; i < opendedTemplate.size(); i++) { + //如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 + if (opendedTemplate.get(i).isDoSomethingInAuthority()) { + opendedTemplate.get(i).fireAuthorityStateToNomal(); + } + } + } +} \ No newline at end of file From 72d14d396ba3eccd5caaeec64c29e7d62e5ac5e7 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 23 Aug 2017 09:48:53 +0800 Subject: [PATCH 02/11] =?UTF-8?q?REPORT-4005=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=20=E8=AE=BE=E7=BD=AE=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8F=90=E4=BA=A4=E5=85=A5=E5=BA=93=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/ElementCasePaneDelegate.java | 3 +++ .../write/submit/SmartInsertDBManipulationPane.java | 9 +++------ designer/src/com/fr/poly/creator/ECBlockPane.java | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index c5bd1e952..17eb28154 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -48,6 +48,9 @@ public class ElementCasePaneDelegate extends ElementCasePane { @Override public void selectionChanged(SelectionEvent e) { + if (!isEditable()) { + return; + } //在编辑权限,所以要更新权限编辑面板 if (BaseUtils.isAuthorityEditing()) { AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this); diff --git a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index e80d89c36..4c5cdb4e2 100644 --- a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -34,10 +34,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; @@ -196,11 +193,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); diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index edd93ce9a..ba6584767 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/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); From ee0c86589c37429a08ed54814b38c55756f8d2de Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:35:55 +0800 Subject: [PATCH 03/11] fix --- .../mainframe/MobileParaWidgetTable.java | 154 ++++++++++-------- 1 file changed, 88 insertions(+), 66 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index e32ba8cc5..57402df94 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -1,12 +1,41 @@ package com.fr.design.mainframe; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWParameterLayout; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.geom.RoundRectangle2D; +import java.util.EventObject; + +import javax.swing.AbstractCellEditor; +import javax.swing.BorderFactory; +import javax.swing.JTable; +import javax.swing.ListSelectionModel; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableColumn; +import javax.swing.table.TableModel; + import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itable.GroupRenderer; import com.fr.design.gui.itable.HeaderRenderer; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.form.ui.Label; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WParameterLayout; @@ -14,18 +43,6 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.StringUtils; -import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.*; -import java.awt.*; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.geom.RoundRectangle2D; -import java.util.EventObject; - /** * MobileParaWidgetTable主要显示参数面板容器的控件列表,与MobileWidgetTable的区别就是该表多了UITextField这一列 * Created with IntelliJ IDEA. @@ -36,12 +53,11 @@ import java.util.EventObject; */ class MobileParaWidgetTable extends JTable { - private final int WIDGET_NAME_COLUMN = 1; private FormDesigner designer; - private String[][] cellData; - private String[] headers = {Inter.getLocText("Form-Widget_Name")}; + private String[][] cellData ; + private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; - private static final int UITEXTFIELD_WIDTH = 40; + private static final int UITEXTFIELD_WIDTH = 0; private UILabel moveComponent = new UILabel(); // 作为拖动时候随鼠标移动的那个半透明控件 private int selectedRow = -1; private int selectedColumn = -1; @@ -55,11 +71,13 @@ class MobileParaWidgetTable extends JTable { this.setDefaultEditor(Object.class, new MobileCellEditor()); TableModel defaultModel = new BeanTableModel(); this.setModel(defaultModel); - this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); + this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); TableColumn tc = this.getColumn(this.getColumnName(0)); + tc.setMinWidth(UITEXTFIELD_WIDTH); + tc.setMaxWidth(UITEXTFIELD_WIDTH); tc.setPreferredWidth(UITEXTFIELD_WIDTH); this.repaint(); - this.setDefaultRenderer(Object.class, new MobileWidgetTableCellRenderer()); + this.setDefaultRenderer(Object.class,new MobileWidgetTableCellRenderer()); refreshData(); this.addMouseListener(mouseAdapter); this.addMouseMotionListener(mouseAdapter); @@ -96,12 +114,12 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseReleased(MouseEvent e) { - if (!draging) { + if(!draging){ return; } draging = false; moveComponent.setVisible(false); - int toIndex = e.getY() < GAP ? 0 : (int) Math.rint((e.getY() - GAP) / WIDGET_TABLE_ROW_HEIGHT) + 1; + int toIndex = e.getY() < GAP ? 0 : (int)Math.rint((e.getY() - GAP)/WIDGET_TABLE_ROW_HEIGHT) + 1; //当鼠标放开时,将选中的容器调整至新的顺序 ((WParameterLayout) designer.getParaComponent().toData()).adjustOrder(selectedRow, toIndex); //拿取排序后表格数据,然后重绘表格 @@ -119,13 +137,13 @@ class MobileParaWidgetTable extends JTable { public void mouseMoved(MouseEvent e) { int overColumn = e.getX() < getColumnModel().getColumn(0).getWidth() ? 0 : 1; // 判断当前鼠标在哪一列 int overRow = -1; - for (int i = 0; i < getRowCount(); i++) { + for (int i = 0;i < getRowCount();i++) { if (e.getY() > i * WIDGET_TABLE_ROW_HEIGHT && e.getY() <= (i + 1) * WIDGET_TABLE_ROW_HEIGHT) { overRow = i; //判断当前鼠标在哪一行 } } //如果鼠标移动到当前选中的行列上面的时候,并且不能在第一列 - if (overRow == selectedRow && overColumn == selectedColumn && overColumn != 0) { + if (overRow == selectedRow && overColumn == selectedColumn && overColumn !=0) { //把当前选中的那一列行的光标改成(除了第一列)移动样式MOVE_CURSOR setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); } else { @@ -140,31 +158,34 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseDragged(MouseEvent e) { - int width = getColumnModel().getColumn(0).getWidth(); - setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); - draging = true; - moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString()); - moveComponent.setLocation(getColumnModel().getColumn(0).getWidth(), e.getY() - GAP); - moveComponent.setSize(new Dimension(width, WIDGET_TABLE_ROW_HEIGHT)); - moveComponent.setVisible(true); - moveComponent.setForeground(Color.lightGray); - moveComponent.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + int width = getColumnModel().getColumn(1).getWidth(); + //如果点击选中的是第二列,就可以拖动 + if (selectedColumn == 1){ + setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); + draging = true; + moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString()); + moveComponent.setLocation(getColumnModel().getColumn(0).getWidth(), e.getY() - GAP); + moveComponent.setSize(new Dimension(width, WIDGET_TABLE_ROW_HEIGHT)); + moveComponent.setVisible(true); + moveComponent.setForeground(Color.lightGray); + moveComponent.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + } } /** - * 设置鼠标单击时处理的事件 + * 设置鼠标单击时处理的事件(单击第二列的控件列表进入控件属性表) * @param e */ @Override public void mouseClicked(MouseEvent e) { - if (getSelectedRow() != -1 && getSelectedColumn() == 0) { + if(getSelectedRow() != -1 && getSelectedColumn() == 1){ String widgetName = cellData[getSelectedRow()][getSelectedColumn()]; - if (StringUtils.isNotEmpty(widgetName)) { + if (StringUtils.isNotEmpty(widgetName)){ int count = getEditingDesigner().getParaComponent().getComponentCount(); - for (int i = 0; i < count; i++) { - XCreator xCreator = (XCreator) getEditingDesigner().getParaComponent().getComponent(i); + for (int i = 0; i < count; i++){ + XCreator xCreator = (XCreator)getEditingDesigner().getParaComponent().getComponent(i); Widget widget = xCreator.toData(); - if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName, widget.getWidgetName())) { + if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName,widget.getWidgetName())) { //设置选中的component,这句代码控制点击之后跳转到相应component属性表 getEditingDesigner().getSelectionModel().setSelectedCreator(xCreator); } @@ -185,12 +206,12 @@ class MobileParaWidgetTable extends JTable { } }; - public MobileParaWidgetTable getInstance() { + public MobileParaWidgetTable getInstance(){ return this; } - private FormDesigner getEditingDesigner() { - return designer; + private FormDesigner getEditingDesigner(){ + return designer; } /** @@ -210,7 +231,7 @@ class MobileParaWidgetTable extends JTable { /** * 重新get排序后的数据 */ - public void refreshData() { + public void refreshData(){ cellData = getData(); } @@ -219,10 +240,10 @@ class MobileParaWidgetTable extends JTable { * * @return String[][] 二维数组,[0][0]widgetTag, [0][1]widgetName */ - private String[][] getData() { + private String[][] getData(){ XLayoutContainer paraContainer = designer.getParaComponent(); - if (paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)) { - return new String[0][1]; + if(paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)){ + return new String[0][0]; } WParameterLayout para = (WParameterLayout) (paraContainer.toData()); @@ -232,14 +253,14 @@ class MobileParaWidgetTable extends JTable { /** * 自定义的tableRender类 */ - private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer { + private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer{ @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (column == 0) { + if (column == 0){ UITextField uiTableTextField; - if (getSelectedColumn() == column && getSelectedRow() == row) { + if (getSelectedColumn() == column && getSelectedRow() == row){ uiTableTextField = new UITableTextField(value.toString()); } else { uiTableTextField = new UITextField(value.toString()); @@ -256,8 +277,7 @@ class MobileParaWidgetTable extends JTable { */ private class MobileCellEditor extends AbstractCellEditor implements TableCellEditor { UITableTextField uiTableTextField; - - MobileCellEditor() { + MobileCellEditor(){ uiTableTextField = new UITableTextField(); uiTableTextField.addFocusListener(new FocusAdapter() { @Override @@ -288,7 +308,7 @@ class MobileParaWidgetTable extends JTable { * cell改变,相应的nametag改变 */ - private void firePropertyChange() { + private void firePropertyChange(){ ((WParameterLayout) designer.getParaComponent().toData()).add2NameTagMap(uiTableTextField.getText(), cellData[getSelectedRow()][1]); ((WParameterLayout) designer.getParaComponent().toData()).setNameTagModified(cellData[getSelectedRow()][1], @@ -296,7 +316,7 @@ class MobileParaWidgetTable extends JTable { } @Override - public Object getCellEditorValue() { + public Object getCellEditorValue(){ return uiTableTextField.getText(); } @@ -309,8 +329,8 @@ class MobileParaWidgetTable extends JTable { } @Override - public Component getTableCellEditorComponent(JTable table, Object value, - boolean isSelected, int row, int column) { + public Component getTableCellEditorComponent( JTable table,Object value, + boolean isSelected,int row,int column){ uiTableTextField.setText(value.toString()); return uiTableTextField; } @@ -342,7 +362,7 @@ class MobileParaWidgetTable extends JTable { } Object[] rowValue = cellData[row]; if (column > -1 && column < rowValue.length) { - return cellData[row][WIDGET_NAME_COLUMN]; + return cellData[row][column]; } return null; } @@ -363,21 +383,23 @@ class MobileParaWidgetTable extends JTable { return; } if (aValue == null) { - cellData[row][WIDGET_NAME_COLUMN] = null; + cellData[row][column] = null; return; } - cellData[row][WIDGET_NAME_COLUMN] = aValue.toString(); + cellData[row][column] = aValue.toString(); } /** - * 是否可编辑 控件标签列可以编辑,控件名不可编辑 - * - * @param row 行号 - * @param column 列号 + * 是否可编辑 控件标签列可以编辑,控件名不可编辑 + * @param row 行号 + * @param column 列号 * @return 是否可编辑 */ public boolean isCellEditable(int row, int column) { - return false; + if(column ==1){ + return false; + } + return true; } } @@ -386,11 +408,11 @@ class MobileParaWidgetTable extends JTable { * 继承自JTextField类,重写了编辑框的样式 */ private class UITableTextField extends UITextField { - public UITableTextField() { + public UITableTextField(){ super(); } - public UITableTextField(String string) { + public UITableTextField(String string){ super(string); } From 25ab70797fe974a52d8d02c86e45c0f4ba7df8fd Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:36:54 +0800 Subject: [PATCH 04/11] tmp --- .../mainframe/MobileParaWidgetTable.java | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 57402df94..5c3f3630d 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -1,41 +1,12 @@ package com.fr.design.mainframe; -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.RenderingHints; -import java.awt.event.FocusAdapter; -import java.awt.event.FocusEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.geom.RoundRectangle2D; -import java.util.EventObject; - -import javax.swing.AbstractCellEditor; -import javax.swing.BorderFactory; -import javax.swing.JTable; -import javax.swing.ListSelectionModel; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import javax.swing.table.DefaultTableCellRenderer; -import javax.swing.table.DefaultTableModel; -import javax.swing.table.JTableHeader; -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableColumn; -import javax.swing.table.TableModel; - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itable.GroupRenderer; -import com.fr.design.gui.itable.HeaderRenderer; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itable.HeaderRenderer; +import com.fr.design.gui.itextfield.UITextField; import com.fr.form.ui.Label; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WParameterLayout; @@ -43,6 +14,18 @@ import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.StringUtils; +import javax.swing.*; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.table.*; +import java.awt.*; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.geom.RoundRectangle2D; +import java.util.EventObject; + /** * MobileParaWidgetTable主要显示参数面板容器的控件列表,与MobileWidgetTable的区别就是该表多了UITextField这一列 * Created with IntelliJ IDEA. From 2c297d511b42b4463548b009078a28176c79e7ae Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:50:10 +0800 Subject: [PATCH 05/11] format --- .../mainframe/MobileParaWidgetTable.java | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 5c3f3630d..37555dd60 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -37,7 +37,7 @@ import java.util.EventObject; class MobileParaWidgetTable extends JTable { private FormDesigner designer; - private String[][] cellData ; + private String[][] cellData; private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; private static final int UITEXTFIELD_WIDTH = 0; @@ -60,7 +60,7 @@ class MobileParaWidgetTable extends JTable { tc.setMaxWidth(UITEXTFIELD_WIDTH); tc.setPreferredWidth(UITEXTFIELD_WIDTH); this.repaint(); - this.setDefaultRenderer(Object.class,new MobileWidgetTableCellRenderer()); + this.setDefaultRenderer(Object.class, new MobileWidgetTableCellRenderer()); refreshData(); this.addMouseListener(mouseAdapter); this.addMouseMotionListener(mouseAdapter); @@ -97,12 +97,12 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseReleased(MouseEvent e) { - if(!draging){ + if (!draging) { return; } draging = false; moveComponent.setVisible(false); - int toIndex = e.getY() < GAP ? 0 : (int)Math.rint((e.getY() - GAP)/WIDGET_TABLE_ROW_HEIGHT) + 1; + int toIndex = e.getY() < GAP ? 0 : (int) Math.rint((e.getY() - GAP) / WIDGET_TABLE_ROW_HEIGHT) + 1; //当鼠标放开时,将选中的容器调整至新的顺序 ((WParameterLayout) designer.getParaComponent().toData()).adjustOrder(selectedRow, toIndex); //拿取排序后表格数据,然后重绘表格 @@ -120,13 +120,13 @@ class MobileParaWidgetTable extends JTable { public void mouseMoved(MouseEvent e) { int overColumn = e.getX() < getColumnModel().getColumn(0).getWidth() ? 0 : 1; // 判断当前鼠标在哪一列 int overRow = -1; - for (int i = 0;i < getRowCount();i++) { + for (int i = 0; i < getRowCount(); i++) { if (e.getY() > i * WIDGET_TABLE_ROW_HEIGHT && e.getY() <= (i + 1) * WIDGET_TABLE_ROW_HEIGHT) { overRow = i; //判断当前鼠标在哪一行 } } //如果鼠标移动到当前选中的行列上面的时候,并且不能在第一列 - if (overRow == selectedRow && overColumn == selectedColumn && overColumn !=0) { + if (overRow == selectedRow && overColumn == selectedColumn && overColumn != 0) { //把当前选中的那一列行的光标改成(除了第一列)移动样式MOVE_CURSOR setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); } else { @@ -143,7 +143,7 @@ class MobileParaWidgetTable extends JTable { public void mouseDragged(MouseEvent e) { int width = getColumnModel().getColumn(1).getWidth(); //如果点击选中的是第二列,就可以拖动 - if (selectedColumn == 1){ + if (selectedColumn == 1) { setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); draging = true; moveComponent.setText(getValueAt(selectedRow, selectedColumn).toString()); @@ -161,14 +161,14 @@ class MobileParaWidgetTable extends JTable { */ @Override public void mouseClicked(MouseEvent e) { - if(getSelectedRow() != -1 && getSelectedColumn() == 1){ + if (getSelectedRow() != -1 && getSelectedColumn() == 1) { String widgetName = cellData[getSelectedRow()][getSelectedColumn()]; - if (StringUtils.isNotEmpty(widgetName)){ + if (StringUtils.isNotEmpty(widgetName)) { int count = getEditingDesigner().getParaComponent().getComponentCount(); - for (int i = 0; i < count; i++){ - XCreator xCreator = (XCreator)getEditingDesigner().getParaComponent().getComponent(i); + for (int i = 0; i < count; i++) { + XCreator xCreator = (XCreator) getEditingDesigner().getParaComponent().getComponent(i); Widget widget = xCreator.toData(); - if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName,widget.getWidgetName())) { + if (!widget.acceptType(Label.class) && ComparatorUtils.equals(widgetName, widget.getWidgetName())) { //设置选中的component,这句代码控制点击之后跳转到相应component属性表 getEditingDesigner().getSelectionModel().setSelectedCreator(xCreator); } @@ -189,12 +189,12 @@ class MobileParaWidgetTable extends JTable { } }; - public MobileParaWidgetTable getInstance(){ + public MobileParaWidgetTable getInstance() { return this; } - private FormDesigner getEditingDesigner(){ - return designer; + private FormDesigner getEditingDesigner() { + return designer; } /** @@ -214,7 +214,7 @@ class MobileParaWidgetTable extends JTable { /** * 重新get排序后的数据 */ - public void refreshData(){ + public void refreshData() { cellData = getData(); } @@ -223,9 +223,9 @@ class MobileParaWidgetTable extends JTable { * * @return String[][] 二维数组,[0][0]widgetTag, [0][1]widgetName */ - private String[][] getData(){ + private String[][] getData() { XLayoutContainer paraContainer = designer.getParaComponent(); - if(paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)){ + if (paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)) { return new String[0][0]; } @@ -236,14 +236,14 @@ class MobileParaWidgetTable extends JTable { /** * 自定义的tableRender类 */ - private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer{ + private class MobileWidgetTableCellRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (column == 0){ + if (column == 0) { UITextField uiTableTextField; - if (getSelectedColumn() == column && getSelectedRow() == row){ + if (getSelectedColumn() == column && getSelectedRow() == row) { uiTableTextField = new UITableTextField(value.toString()); } else { uiTableTextField = new UITextField(value.toString()); @@ -260,7 +260,8 @@ class MobileParaWidgetTable extends JTable { */ private class MobileCellEditor extends AbstractCellEditor implements TableCellEditor { UITableTextField uiTableTextField; - MobileCellEditor(){ + + MobileCellEditor() { uiTableTextField = new UITableTextField(); uiTableTextField.addFocusListener(new FocusAdapter() { @Override @@ -291,7 +292,7 @@ class MobileParaWidgetTable extends JTable { * cell改变,相应的nametag改变 */ - private void firePropertyChange(){ + private void firePropertyChange() { ((WParameterLayout) designer.getParaComponent().toData()).add2NameTagMap(uiTableTextField.getText(), cellData[getSelectedRow()][1]); ((WParameterLayout) designer.getParaComponent().toData()).setNameTagModified(cellData[getSelectedRow()][1], @@ -299,7 +300,7 @@ class MobileParaWidgetTable extends JTable { } @Override - public Object getCellEditorValue(){ + public Object getCellEditorValue() { return uiTableTextField.getText(); } @@ -312,8 +313,8 @@ class MobileParaWidgetTable extends JTable { } @Override - public Component getTableCellEditorComponent( JTable table,Object value, - boolean isSelected,int row,int column){ + public Component getTableCellEditorComponent(JTable table, Object value, + boolean isSelected, int row, int column) { uiTableTextField.setText(value.toString()); return uiTableTextField; } @@ -373,13 +374,14 @@ class MobileParaWidgetTable extends JTable { } /** - * 是否可编辑 控件标签列可以编辑,控件名不可编辑 - * @param row 行号 - * @param column 列号 + * 是否可编辑 控件标签列可以编辑,控件名不可编辑 + * + * @param row 行号 + * @param column 列号 * @return 是否可编辑 */ public boolean isCellEditable(int row, int column) { - if(column ==1){ + if (column == 1) { return false; } return true; @@ -391,11 +393,11 @@ class MobileParaWidgetTable extends JTable { * 继承自JTextField类,重写了编辑框的样式 */ private class UITableTextField extends UITextField { - public UITableTextField(){ + public UITableTextField() { super(); } - public UITableTextField(String string){ + public UITableTextField(String string) { super(string); } From 5f50ab43081338f9cb303f94cee068251494b5f8 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 13:54:42 +0800 Subject: [PATCH 06/11] SonarQube --- .../com/fr/design/mainframe/MobileParaWidgetTable.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 37555dd60..2c6c06372 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -41,15 +41,19 @@ class MobileParaWidgetTable extends JTable { private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; private static final int UITEXTFIELD_WIDTH = 0; + private static final int GAP = 11; private UILabel moveComponent = new UILabel(); // 作为拖动时候随鼠标移动的那个半透明控件 private int selectedRow = -1; private int selectedColumn = -1; - private int GAP = 11; private boolean draging = false; - MobileParaWidgetTable(FormDesigner designer) { + private void init(FormDesigner designer) { this.designer = designer; this.cellData = getData(); + } + + MobileParaWidgetTable(FormDesigner designer) { + init(designer); this.setTableProperties(); this.setDefaultEditor(Object.class, new MobileCellEditor()); TableModel defaultModel = new BeanTableModel(); From 6dd864e1811390f79adb179dc3861ca0765af6d0 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 14:40:16 +0800 Subject: [PATCH 07/11] SonarQube --- .../fr/design/mainframe/MobileParaWidgetTable.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 2c6c06372..940c2df58 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -50,14 +50,9 @@ class MobileParaWidgetTable extends JTable { private void init(FormDesigner designer) { this.designer = designer; this.cellData = getData(); - } - - MobileParaWidgetTable(FormDesigner designer) { - init(designer); this.setTableProperties(); this.setDefaultEditor(Object.class, new MobileCellEditor()); - TableModel defaultModel = new BeanTableModel(); - this.setModel(defaultModel); + this.setModel(new BeanTableModel()); this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); TableColumn tc = this.getColumn(this.getColumnName(0)); tc.setMinWidth(UITEXTFIELD_WIDTH); @@ -68,6 +63,10 @@ class MobileParaWidgetTable extends JTable { refreshData(); this.addMouseListener(mouseAdapter); this.addMouseMotionListener(mouseAdapter); + } + + MobileParaWidgetTable(FormDesigner designer) { + init(designer); add(moveComponent); } From 4ac4dcb2524b15cf05af157797893ffb9aeb0616 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 24 Aug 2017 15:05:12 +0800 Subject: [PATCH 08/11] =?UTF-8?q?REPORT-3952=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E6=8F=92=E5=85=A5=E6=82=AC=E6=B5=AE?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E9=80=89=E6=8B=A9=E6=8F=92=E5=85=A5=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=E6=97=B6=E4=BC=9A?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E4=BF=9D=E5=AD=98=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/insert/flot/ChartFloatAction.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java b/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java index 80b731c1a..ce05628da 100644 --- a/designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java +++ b/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; } } \ No newline at end of file From b4e4e6ea5f2453a2cbdc3a1d4e07f5b52632f8f6 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 15:56:26 +0800 Subject: [PATCH 09/11] fix --- designer_base/src/com/fr/design/locale/designer.properties | 4 +++- .../src/com/fr/design/locale/designer_en_US.properties | 4 +++- .../src/com/fr/design/locale/designer_ja_JP.properties | 2 ++ .../src/com/fr/design/locale/designer_ko_KR.properties | 4 +++- .../src/com/fr/design/locale/designer_zh_CN.properties | 4 +++- .../src/com/fr/design/locale/designer_zh_TW.properties | 2 ++ .../src/com/fr/design/mainframe/MobileParaWidgetTable.java | 2 +- 7 files changed, 17 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 9423c23a7..c048d29c5 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2129,4 +2129,6 @@ FR-Designer_Mobile-Height-Limit=Height Limit FR-Designer-AlphaFine_NO_Result=no search result FR-Designer-Download_Online_Sources= FR-Designer_Select_Color=Select Color -FR-Designer-Basic_Dynamic_Parameter_Injection=Injection \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection=Injection +FR-Designer_Label= +FR-Designer_Widgetname=Widget Name \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index bb48b927d..4a87f1620 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2125,4 +2125,6 @@ FS-Designer_DS_Filter_Specify_Tip=Specify_Tip FR-Designer-AlphaFine_NO_Result=no search result FR-Designer-Download_Online_Sources= FR-Designer_Select_Color=Select Color -FR-Designer-Basic_Dynamic_Parameter_Injection=Injection \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection=Injection +FR-Designer_Label=Label +FR-Designer_Widgetname=Widget Name \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 94768d087..05783bc7b 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2124,3 +2124,5 @@ FR-Designer_Mobile-Height-Limit= FR-Designer-Download_Online_Sources= FR-Designer_Select_Color= FR-Designer-Basic_Dynamic_Parameter_Injection=\ +FR-Designer_Label=\u30E9\u30D9\u30EBa +FR-Designer_Widgetname=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index c9cacdb7e..6a660743d 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2124,4 +2124,6 @@ FR-Designer_Mobile-Height-Percent= FR-Designer_Mobile-Height-Limit= FR-Designer-Download_Online_Sources= FR-Designer_Select_Color= -FR-Designer-Basic_Dynamic_Parameter_Injection= \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection= +FR-Designer_Label=\uB808\uC774\uBE14 +FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index d4cfbba9c..e9b593318 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2136,4 +2136,6 @@ FS-Designer_DS_Filter_Specify_Tip=\u63D0\u793A\uFF1A\u683C\u5F0F\u4E3A1,2-3,5,8\ FR-Designer-AlphaFine_NO_Result=\u65E0\u641C\u7D22\u7ED3\u679C FR-Designer-Download_Online_Sources=\u56FE\u8868\u9700\u8981\u4E0B\u8F7D\u6700\u65B0\u7684\u8D44\u6E90\u6587\u4EF6\uFF0C\u662F\u5426\u5B89\u88C5\uFF1F FR-Designer_Select_Color=\u9009\u62E9\u989C\u8272 -FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 \ No newline at end of file +FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 +FR-Designer_Label=\u6807\u7B7E +FR-Designer_Widgetname=\u63A7\u4EF6\u540D \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index fe2839aee..95c67c32a 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2129,3 +2129,5 @@ FR-Designer-AlphaFine_NO_Result=\u7121\u641C\u7D22\u7D50\u679C FR-Designer-Download_Online_Sources= FR-Designer_Select_Color= FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 +FR-Designer_Label=\u6A19\u7C3D +FR-Designer_Widgetname=\u63A7\u5236\u9805\u540D diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 940c2df58..5788f22f4 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -38,7 +38,7 @@ class MobileParaWidgetTable extends JTable { private FormDesigner designer; private String[][] cellData; - private String[] headers = {Inter.getLocText("FR-Utils_Label"), Inter.getLocText("Form-Widget_Name")}; + private String[] headers = {Inter.getLocText("FR-Designer_Label"), Inter.getLocText("FR-Designer_Widgetname")}; private static final int WIDGET_TABLE_ROW_HEIGHT = 22; private static final int UITEXTFIELD_WIDTH = 0; private static final int GAP = 11; From 1cc5c6903eb3758e4aa86afece73ebfd2989e6a7 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 24 Aug 2017 15:57:11 +0800 Subject: [PATCH 10/11] fix --- .../src/com/fr/design/mainframe/MobileParaWidgetTable.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 5788f22f4..e7e5089b5 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -384,10 +384,7 @@ class MobileParaWidgetTable extends JTable { * @return 是否可编辑 */ public boolean isCellEditable(int row, int column) { - if (column == 1) { - return false; - } - return true; + return column != 1; } } From c9a21400fa70a47131ffd05af824f220bc9c4d69 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 24 Aug 2017 15:59:05 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/ElementCasePaneDelegate.java | 84 ++++++++++--------- .../submit/SmartInsertDBManipulationPane.java | 37 ++++---- .../src/com/fr/poly/creator/ECBlockPane.java | 2 +- .../actions/ExitAuthorityEditAction.java | 3 +- 4 files changed, 66 insertions(+), 60 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 17eb28154..0e4c2aa58 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -45,51 +45,12 @@ public class ElementCasePaneDelegate extends ElementCasePane { public ElementCasePaneDelegate(WorkSheet sheet) { super(sheet); this.addSelectionChangeListener(new SelectionListener() { - @Override public void selectionChanged(SelectionEvent e) { if (!isEditable()) { return; } - //在编辑权限,所以要更新权限编辑面板 - 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(); - } + doOnSelectionChanged(); } }); this.addTargetModifiedListener(new TargetModifiedListener() { @@ -100,6 +61,48 @@ public class ElementCasePaneDelegate extends ElementCasePane { }); } + 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; @@ -126,6 +129,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { * * @return 不是必须在可见范围. */ + @Override public boolean mustInVisibleRange() { return false; } diff --git a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 4c5cdb4e2..36695d988 100644 --- a/designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/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; @@ -43,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()); @@ -57,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(); @@ -123,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 } }; @@ -289,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 { // 是否是单元格组 @@ -329,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 */ @@ -410,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); @@ -441,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(); } @@ -479,6 +479,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { private SmartJTablePaneAction a = new AbstractSmartJTablePaneAction(this, SmartInsertDBManipulationPane.this) { @Override public void doOk() { + // 遗留代码 } @Override @@ -507,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); } } @@ -535,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); } } @@ -568,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); } } diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index ba6584767..ebde8b3b4 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -119,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)); diff --git a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java index dfb7f1dd6..a470673a0 100644 --- a/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java +++ b/designer_base/src/com/fr/design/actions/ExitAuthorityEditAction.java @@ -23,9 +23,10 @@ public class ExitAuthorityEditAction extends TemplateComponentAction { public void prepare4Undo() { - + // 遗留代码 } + @Override public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) {