|
|
@ -17,6 +17,7 @@ import com.fr.form.ui.container.WAbsoluteBodyLayout; |
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout; |
|
|
|
import com.fr.form.ui.container.WAbsoluteLayout; |
|
|
|
import com.fr.form.ui.container.WBodyLayoutType; |
|
|
|
import com.fr.form.ui.container.WBodyLayoutType; |
|
|
|
import com.fr.form.ui.container.WFitLayout; |
|
|
|
import com.fr.form.ui.container.WFitLayout; |
|
|
|
|
|
|
|
import com.fr.general.FRLogger; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.table.DefaultTableCellRenderer; |
|
|
|
import javax.swing.table.DefaultTableCellRenderer; |
|
|
@ -145,19 +146,19 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { |
|
|
|
layout.setCompState(state); |
|
|
|
layout.setCompState(state); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
}else if (row == 0) { |
|
|
|
}else if (row == 0) { |
|
|
|
layout.setLayoutType(WBodyLayoutType.parse(state)); |
|
|
|
try { |
|
|
|
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) { |
|
|
|
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) { |
|
|
|
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body"); |
|
|
|
WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body"); |
|
|
|
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); |
|
|
|
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); |
|
|
|
Component[] components = xfl.getComponents(); |
|
|
|
Component[] components = xfl.getComponents(); |
|
|
|
xfl.removeAll(); |
|
|
|
xfl.removeAll(); |
|
|
|
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0,0)); |
|
|
|
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); |
|
|
|
xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); |
|
|
|
xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); |
|
|
|
for (Component component : components) { |
|
|
|
for (Component component : components) { |
|
|
|
XCreator xCreator = (XCreator)component; |
|
|
|
XCreator xCreator = (XCreator) component; |
|
|
|
//部分控件被ScaleLayout包裹着,绝对布局里面要放出来
|
|
|
|
//部分控件被ScaleLayout包裹着,绝对布局里面要放出来
|
|
|
|
if (xCreator.acceptType(XWScaleLayout.class)){ |
|
|
|
if (xCreator.acceptType(XWScaleLayout.class)) { |
|
|
|
if (xCreator.getComponentCount() > 0 && ((XCreator)xCreator.getComponent(0)).shouldScaleCreator()) { |
|
|
|
if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) { |
|
|
|
component = xCreator.getComponent(0); |
|
|
|
component = xCreator.getComponent(0); |
|
|
|
component.setBounds(xCreator.getBounds()); |
|
|
|
component.setBounds(xCreator.getBounds()); |
|
|
|
} |
|
|
|
} |
|
|
@ -167,12 +168,16 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel { |
|
|
|
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
formDesigner.getSelectionModel().setSelectedCreators( |
|
|
|
formDesigner.getSelectionModel().setSelectedCreators( |
|
|
|
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteBodyLayout})); |
|
|
|
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteBodyLayout})); |
|
|
|
} |
|
|
|
} else { |
|
|
|
else { |
|
|
|
|
|
|
|
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
formDesigner.getSelectionModel().setSelectedCreators( |
|
|
|
formDesigner.getSelectionModel().setSelectedCreators( |
|
|
|
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()})); |
|
|
|
FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()})); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
|
|
FRLogger.getLogger().error(e.getMessage()); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
layout.setLayoutType(WBodyLayoutType.parse(state)); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|