|
|
|
@ -219,17 +219,26 @@ public class XWTitleLayout extends DedicateLayoutContainer {
|
|
|
|
|
public void convert() { |
|
|
|
|
isRefreshing = true; |
|
|
|
|
WTitleLayout layout = this.toData(); |
|
|
|
|
XBorderStyleWidgetCreator bodyCreator = null; |
|
|
|
|
this.removeAll(); |
|
|
|
|
for (int i = 0, num = layout.getWidgetCount(); i < num; i++) { |
|
|
|
|
BoundsWidget bw = (BoundsWidget) layout.getWidget(i); |
|
|
|
|
if (bw != null) { |
|
|
|
|
Rectangle bounds = bw.getBounds(); |
|
|
|
|
XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget()); |
|
|
|
|
String constraint = bw.getWidget().acceptType(Label.class) ? WTitleLayout.TITLE : WTitleLayout.BODY; |
|
|
|
|
boolean isTitleWidget = bw.getWidget().acceptType(Label.class); |
|
|
|
|
String constraint = isTitleWidget ? WTitleLayout.TITLE : WTitleLayout.BODY; |
|
|
|
|
this.add(comp, constraint); |
|
|
|
|
comp.setBounds(bounds); |
|
|
|
|
if (!isTitleWidget && comp instanceof XBorderStyleWidgetCreator) { |
|
|
|
|
bodyCreator = (XBorderStyleWidgetCreator) comp; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 刷新时重置下样式
|
|
|
|
|
if (bodyCreator != null) { |
|
|
|
|
bodyCreator.initStyle(); |
|
|
|
|
} |
|
|
|
|
isRefreshing = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|