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