Browse Source

无JIRA任务,修复设计器移动端控件顺序错误。

master
方磊 7 years ago
parent
commit
b212c1ef84
  1. 18
      designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java

18
designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import java.awt.*; import java.awt.*;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -246,25 +247,32 @@ public class MobileWidgetTable extends JTable {
* @return String[][] 二维数组[0][0]widgetName * @return String[][] 二维数组[0][0]widgetName
*/ */
private String[][] getData() { private String[][] getData() {
List<String> mobileWidgetList = new ArrayList<String>();
if (designer.isFormParaDesigner()) { if (designer.isFormParaDesigner()) {
return new String[0][0]; return new String[0][0];
} }
WFitLayout body = (WFitLayout) designer.getRootComponent().toData(); WSortLayout body = (WSortLayout) designer.getRootComponent().toData();
if (body == null || !body.acceptType(WSortLayout.class)) { if (body == null) {
return new String[0][0]; return new String[0][0];
} }
List<String> mobileWidgetList = body.getOrderedMobileWidgetList(); body.setSorted(false);
if (body.getWidgetCount() > 0 && body.getWidget(0).acceptType(WAbsoluteBodyLayout.class)) {
WAbsoluteBodyLayout absoluteBodyLayout = (WAbsoluteBodyLayout) ((WAbsoluteLayout.BoundsWidget) body.getWidget(0)).getWidget();
mobileWidgetList = absoluteBodyLayout.getOrderedMobileWidgetList();
} else {
mobileWidgetList = body.getOrderedMobileWidgetList();
}
String[][] widgetName = new String[mobileWidgetList.size() + 1][1]; String[][] widgetName = new String[mobileWidgetList.size() + 1][1];
widgetName[0][0] = Inter.getLocText("FR-Designer_WidgetOrder"); widgetName[0][0] = Inter.getLocText("FR-Designer_WidgetOrder");
for (int i = 0; i < mobileWidgetList.size(); i++) { for (int i = 0; i < mobileWidgetList.size(); i++) {
widgetName[i + 1][0] = mobileWidgetList.get(i); widgetName[i + 1][0] = mobileWidgetList.get(i);
} }
if (!body.isSorted()) {
body.setSorted(true); body.setSorted(true);
}
return widgetName; return widgetName;
} }

Loading…
Cancel
Save