|
|
|
@ -9,6 +9,7 @@ import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
|
|
|
|
|
import com.fr.design.utils.gui.LayoutUtils; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
|
import com.fr.form.ui.container.WBodyLayoutType; |
|
|
|
|
import com.fr.general.FRLogger; |
|
|
|
|
import com.fr.general.FRScreen; |
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
@ -92,6 +93,43 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
|
|
|
|
|
} else { |
|
|
|
|
if (row == 0) { |
|
|
|
|
if (state == WBodyLayoutType.FIT.getTypeValue()) { |
|
|
|
|
return switch2FitBodyLayout(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (row == 1) { |
|
|
|
|
layout.setCompState(state); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
int state = 0; |
|
|
|
|
if(value instanceof Integer) { |
|
|
|
|
state = (Integer)value; |
|
|
|
|
} |
|
|
|
|
if (column == 0 || state < 0) { |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
if (row == 0) { |
|
|
|
|
layout.setCompState(state); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否可编辑 |
|
|
|
|
* @param row 行 |
|
|
|
|
* @return 否 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public boolean isEditable(int row) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean switch2FitBodyLayout() { |
|
|
|
|
try { |
|
|
|
|
XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent(); |
|
|
|
|
//备份一下组件间隔
|
|
|
|
|
int compInterval = xfl.toData().getCompInterval(); |
|
|
|
@ -133,40 +171,14 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
|
|
|
|
|
xfl.toData().setLayoutType(WBodyLayoutType.FIT); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (row == 1) { |
|
|
|
|
layout.setCompState(state); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
catch (Exception e){ |
|
|
|
|
FRLogger.getLogger().error(e.getMessage()); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
int state = 0; |
|
|
|
|
if(value instanceof Integer) { |
|
|
|
|
state = (Integer)value; |
|
|
|
|
} |
|
|
|
|
if (column == 0 || state < 0) { |
|
|
|
|
return false; |
|
|
|
|
} else { |
|
|
|
|
if (row == 0) { |
|
|
|
|
layout.setCompState(state); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 是否可编辑 |
|
|
|
|
* @param row 行 |
|
|
|
|
* @return 否 |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public boolean isEditable(int row) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 把绝对布局中的元素按规则移动到自适应布局中
|
|
|
|
|
// 规则:各元素按顺序放置,其中每行最多4个元素,超出则换行,各元素均分body的高度和宽度
|
|
|
|
|
private void moveComponents2FitLayout(XWFitLayout xwFitLayout) { |
|
|
|
|
int eachRowCount = 4; |
|
|
|
|
Component[] components = xwFitLayout.getComponents(); |
|
|
|
|