Browse Source

Merge pull request #1114 in BA/design from ~HZZZ/design:REPORT-3973 to release/9.0

* commit '1cc5c6903eb3758e4aa86afece73ebfd2989e6a7':
  fix
  fix
  SonarQube
  SonarQube
  format
  tmp
  fix
master
superman 7 years ago
parent
commit
e387e9d3aa
  1. 2
      designer_base/src/com/fr/design/locale/designer.properties
  2. 2
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  3. 2
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  4. 2
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  5. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  6. 2
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  7. 55
      designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java

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