Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~kerry/design into release/9.0

master
kerry 7 years ago
parent
commit
6693bc4291
  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
  6. 2
      designer_base/src/com/fr/design/locale/designer.properties
  7. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  8. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  9. 2
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  10. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  11. 2
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  12. 55
      designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.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();
}
}
}
}

2
designer_base/src/com/fr/design/locale/designer.properties

@ -2130,3 +2130,5 @@ 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
FR-Designer_Label=
FR-Designer_Widgetname=Widget Name

2
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2126,3 +2126,5 @@ 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
FR-Designer_Label=Label
FR-Designer_Widgetname=Widget Name

2
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

2
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2125,3 +2125,5 @@ FR-Designer_Mobile-Height-Limit=
FR-Designer-Download_Online_Sources=
FR-Designer_Select_Color=
FR-Designer-Basic_Dynamic_Parameter_Injection=
FR-Designer_Label=\uB808\uC774\uBE14
FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984

2
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2137,3 +2137,5 @@ 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
FR-Designer_Label=\u6807\u7B7E
FR-Designer_Widgetname=\u63A7\u4EF6\u540D

2
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

55
designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java

@ -36,33 +36,37 @@ 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[] 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 = 40;
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();
this.setTableProperties();
this.setDefaultEditor(Object.class, new MobileCellEditor());
TableModel defaultModel = new BeanTableModel();
this.setModel(defaultModel);
this.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
this.setModel(new BeanTableModel());
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());
refreshData();
this.addMouseListener(mouseAdapter);
this.addMouseMotionListener(mouseAdapter);
}
MobileParaWidgetTable(FormDesigner designer) {
init(designer);
add(moveComponent);
}
@ -140,24 +144,27 @@ 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)) {
int count = getEditingDesigner().getParaComponent().getComponentCount();
@ -222,7 +229,7 @@ class MobileParaWidgetTable extends JTable {
private String[][] getData() {
XLayoutContainer paraContainer = designer.getParaComponent();
if (paraContainer == null || !paraContainer.acceptType(XWParameterLayout.class)) {
return new String[0][1];
return new String[0][0];
}
WParameterLayout para = (WParameterLayout) (paraContainer.toData());
@ -342,7 +349,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,10 +370,10 @@ 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();
}
/**
@ -377,7 +384,7 @@ class MobileParaWidgetTable extends JTable {
* @return 是否可编辑
*/
public boolean isCellEditable(int row, int column) {
return false;
return column != 1;
}
}

Loading…
Cancel
Save