use of com.intellij.uiDesigner.core.AbstractLayout in project intellij-community by JetBrains.
the class HGapProperty method setValueImpl.
protected void setValueImpl(final RadContainer component, final Integer value) throws Exception {
if (component.getLayout() instanceof BorderLayout) {
BorderLayout layout = (BorderLayout) component.getLayout();
layout.setHgap(value.intValue());
} else if (component.getLayout() instanceof FlowLayout) {
FlowLayout layout = (FlowLayout) component.getLayout();
layout.setHgap(value.intValue());
} else if (component.getLayout() instanceof CardLayout) {
CardLayout layout = (CardLayout) component.getLayout();
layout.setHgap(value.intValue());
} else {
final AbstractLayout layoutManager = (AbstractLayout) component.getLayout();
layoutManager.setHGap(value.intValue());
}
}
use of com.intellij.uiDesigner.core.AbstractLayout in project intellij-community by JetBrains.
the class RadContainer method setLayout.
public final void setLayout(final LayoutManager layout) {
// some components (for example, JXCollapsiblePanel from SwingX) have asymmetrical getLayout/setLayout - a different
// layout is returned compared to what was passed to setLayout(). to avoid crashes, we store the layout we passed to
// the component.
myDelegeeLayout = layout;
getDelegee().setLayout(layout);
if (layout instanceof AbstractLayout) {
AbstractLayout aLayout = (AbstractLayout) layout;
for (int i = 0; i < getComponentCount(); i++) {
final RadComponent c = getComponent(i);
aLayout.addLayoutComponent(c.getDelegee(), c.getConstraints());
}
}
}
use of com.intellij.uiDesigner.core.AbstractLayout in project intellij-community by JetBrains.
the class AbstractGridLayoutProperty method setValueImpl.
protected void setValueImpl(final RadContainer component, final Boolean value) throws Exception {
final AbstractLayout layoutManager = (AbstractLayout) component.getLayout();
if (!(layoutManager instanceof GridLayoutManager)) {
throw new IllegalArgumentException("grid layout expected: " + layoutManager);
}
final GridLayoutManager gridLayoutManager = (GridLayoutManager) layoutManager;
setGridLayoutPropertyValue(gridLayoutManager, value.booleanValue());
}
use of com.intellij.uiDesigner.core.AbstractLayout in project intellij-community by JetBrains.
the class MarginProperty method setValueImpl.
protected void setValueImpl(final RadContainer component, @NotNull final Insets value) throws Exception {
final AbstractLayout layoutManager = (AbstractLayout) component.getLayout();
layoutManager.setMargin(value);
}
use of com.intellij.uiDesigner.core.AbstractLayout in project intellij-community by JetBrains.
the class RadXYLayoutManager method writeLayout.
public void writeLayout(final XmlWriter writer, final RadContainer radContainer) {
final AbstractLayout layout = (AbstractLayout) radContainer.getLayout();
// It has sense to save hpap and vgap even for XY layout. The reason is
// that XY was previously GRID with non default gaps, so when the user
// compose XY into the grid again then he will get the same non default gaps.
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_HGAP, layout.getHGap());
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_VGAP, layout.getVGap());
// Margins
final Insets margin = layout.getMargin();
writer.startElement("margin");
try {
writer.writeInsets(margin);
} finally {
// margin
writer.endElement();
}
}
Aggregations