本文整理汇总了Java中com.intellij.uiDesigner.UIFormXmlConstants类的典型用法代码示例。如果您正苦于以下问题:Java UIFormXmlConstants类的具体用法?Java UIFormXmlConstants怎么用?Java UIFormXmlConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UIFormXmlConstants类属于com.intellij.uiDesigner包,在下文中一共展示了UIFormXmlConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readChildConstraints
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
void readChildConstraints(final Element constraintsElement, final LwComponent component) {
super.readChildConstraints(constraintsElement, component);
GridBagConstraints gbc = new GridBagConstraints();
GridBagConverter.constraintsToGridBag(component.getConstraints(), gbc);
final Element gridBagElement = LwXmlReader.getChild(constraintsElement, UIFormXmlConstants.ELEMENT_GRIDBAG);
if (gridBagElement != null) {
if (gridBagElement.getAttributeValue(UIFormXmlConstants.ATTRIBUTE_TOP) != null) {
gbc.insets = LwXmlReader.readInsets(gridBagElement);
}
gbc.weightx = LwXmlReader.getOptionalDouble(gridBagElement, UIFormXmlConstants.ATTRIBUTE_WEIGHTX, 0.0);
gbc.weighty = LwXmlReader.getOptionalDouble(gridBagElement, UIFormXmlConstants.ATTRIBUTE_WEIGHTY, 0.0);
gbc.ipadx = LwXmlReader.getOptionalInt(gridBagElement, UIFormXmlConstants.ATTRIBUTE_IPADX, 0);
gbc.ipady = LwXmlReader.getOptionalInt(gridBagElement, UIFormXmlConstants.ATTRIBUTE_IPADY, 0);
}
component.setCustomLayoutConstraints(gbc);
}
示例2: createLayoutSerializer
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
private void createLayoutSerializer() {
if (UIFormXmlConstants.LAYOUT_BORDER.equals(myLayoutManager)) {
myLayoutSerializer = BorderLayoutSerializer.INSTANCE;
}
else if (UIFormXmlConstants.LAYOUT_FLOW.equals(myLayoutManager)) {
myLayoutSerializer = FlowLayoutSerializer.INSTANCE;
}
else if (UIFormXmlConstants.LAYOUT_CARD.equals(myLayoutManager)) {
myLayoutSerializer = CardLayoutSerializer.INSTANCE;
}
else if (UIFormXmlConstants.LAYOUT_XY.equals(myLayoutManager)) {
myLayoutSerializer = XYLayoutSerializer.INSTANCE;
}
else if (UIFormXmlConstants.LAYOUT_FORM.equals(myLayoutManager)) {
myLayoutSerializer = FormLayoutSerializer.INSTANCE;
}
else if (UIFormXmlConstants.LAYOUT_GRIDBAG.equals(myLayoutManager)) {
myLayoutSerializer = GridBagLayoutSerializer.INSTANCE;
}
else {
myLayoutSerializer = GridLayoutSerializer.INSTANCE;
}
}
示例3: readChildConstraints
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
void readChildConstraints(final Element constraintsElement, final LwComponent component) {
super.readChildConstraints(constraintsElement, component);
CellConstraints cc = new CellConstraints();
final Element formsElement = LwXmlReader.getChild(constraintsElement, UIFormXmlConstants.ELEMENT_FORMS);
if (formsElement != null) {
if (formsElement.getAttributeValue(UIFormXmlConstants.ATTRIBUTE_TOP) != null) {
cc.insets = LwXmlReader.readInsets(formsElement);
}
if (!LwXmlReader.getOptionalBoolean(formsElement, UIFormXmlConstants.ATTRIBUTE_DEFAULTALIGN_HORZ, true)) {
cc.hAlign = ourHorizontalAlignments [Utils.alignFromConstraints(component.getConstraints(), true)];
}
if (!LwXmlReader.getOptionalBoolean(formsElement, UIFormXmlConstants.ATTRIBUTE_DEFAULTALIGN_VERT, true)) {
cc.vAlign = ourVerticalAlignments [Utils.alignFromConstraints(component.getConstraints(), false)];
}
}
component.setCustomLayoutConstraints(cc);
}
示例4: readLayout
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
void readLayout(Element element, LwContainer container) {
final int rowCount = LwXmlReader.getRequiredInt(element, UIFormXmlConstants.ATTRIBUTE_ROW_COUNT);
final int columnCount = LwXmlReader.getRequiredInt(element, UIFormXmlConstants.ATTRIBUTE_COLUMN_COUNT);
final int hGap = LwXmlReader.getOptionalInt(element, UIFormXmlConstants.ATTRIBUTE_HGAP, -1);
final int vGap = LwXmlReader.getOptionalInt(element, UIFormXmlConstants.ATTRIBUTE_VGAP, -1);
// attribute is optional for compatibility with IDEA 4.0 forms
final boolean sameSizeHorizontally = LwXmlReader.getOptionalBoolean(element, UIFormXmlConstants.ATTRIBUTE_SAME_SIZE_HORIZONTALLY, false);
final boolean sameSizeVertically = LwXmlReader.getOptionalBoolean(element, UIFormXmlConstants.ATTRIBUTE_SAME_SIZE_VERTICALLY, false);
final Element marginElement = LwXmlReader.getRequiredChild(element, "margin");
final Insets margin = new Insets(
LwXmlReader.getRequiredInt(marginElement,"top"),
LwXmlReader.getRequiredInt(marginElement,"left"),
LwXmlReader.getRequiredInt(marginElement,"bottom"),
LwXmlReader.getRequiredInt(marginElement,"right")
);
final GridLayoutManager layout = new GridLayoutManager(rowCount, columnCount);
layout.setMargin(margin);
layout.setVGap(vGap);
layout.setHGap(hGap);
layout.setSameSizeHorizontally(sameSizeHorizontally);
layout.setSameSizeVertically(sameSizeVertically);
container.setLayout(layout);
}
示例5: getStringDescriptor
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
public static StringDescriptor getStringDescriptor(final Element element, final String valueAttr,
final String bundleAttr, final String keyAttr) {
final String title = element.getAttributeValue(valueAttr);
if (title != null) {
StringDescriptor descriptor = StringDescriptor.create(title);
descriptor.setNoI18n(getOptionalBoolean(element, UIFormXmlConstants.ATTRIBUTE_NOI18N, false));
return descriptor;
}
else {
final String bundle = element.getAttributeValue(bundleAttr);
if (bundle != null) {
final String key = getRequiredString(element, keyAttr);
return new StringDescriptor(bundle, key);
}
}
return null;
}
示例6: getColorDescriptor
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
public static ColorDescriptor getColorDescriptor(final Element element) throws Exception {
Attribute attr = element.getAttribute(UIFormXmlConstants.ATTRIBUTE_COLOR);
if (attr != null) {
return new ColorDescriptor(new Color(attr.getIntValue()));
}
String swingColor = element.getAttributeValue(UIFormXmlConstants.ATTRIBUTE_SWING_COLOR);
if (swingColor != null) {
return ColorDescriptor.fromSwingColor(swingColor);
}
String systemColor = element.getAttributeValue(UIFormXmlConstants.ATTRIBUTE_SYSTEM_COLOR);
if (systemColor != null) {
return ColorDescriptor.fromSystemColor(systemColor);
}
String awtColor = element.getAttributeValue(UIFormXmlConstants.ATTRIBUTE_AWT_COLOR);
if (awtColor != null) {
return ColorDescriptor.fromAWTColor(awtColor);
}
return new ColorDescriptor(null);
}
示例7: getComponentCodeGenerator
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
private LayoutCodeGenerator getComponentCodeGenerator(final LwContainer container) {
LayoutCodeGenerator generator = (LayoutCodeGenerator) myComponentLayoutCodeGenerators.get(container.getClass());
if (generator != null) {
return generator;
}
LwContainer parent = container;
while(parent != null) {
final String layoutManager = parent.getLayoutManager();
if (layoutManager != null && layoutManager.length() > 0) {
if (layoutManager.equals(UIFormXmlConstants.LAYOUT_FORM) &&
!myContainerLayoutCodeGenerators.containsKey(UIFormXmlConstants.LAYOUT_FORM)) {
myContainerLayoutCodeGenerators.put(UIFormXmlConstants.LAYOUT_FORM, new FormLayoutCodeGenerator());
}
generator = (LayoutCodeGenerator) myContainerLayoutCodeGenerators.get(layoutManager);
if (generator != null) {
return generator;
}
}
parent = parent.getParent();
}
return GridLayoutCodeGenerator.INSTANCE;
}
示例8: generateComponentLayout
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
public void generateComponentLayout(LwComponent lwComponent,
GeneratorAdapter generator,
int componentLocal,
int parentLocal) {
super.generateComponentLayout(lwComponent, generator, componentLocal, parentLocal);
String defaultCard = (String)lwComponent.getParent().getClientProperty(UIFormXmlConstants.LAYOUT_CARD);
if (lwComponent.getId().equals(defaultCard)) {
generator.loadLocal(parentLocal);
generator.invokeVirtual(ourContainerType, ourGetLayoutMethod);
generator.checkCast(myLayoutType);
generator.loadLocal(parentLocal);
generator.push((String) lwComponent.getCustomLayoutConstraints());
generator.invokeVirtual(myLayoutType, ourShowMethod);
}
}
示例9: writeLayout
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
@Override
public void writeLayout(final XmlWriter writer, final RadContainer radContainer) {
FormLayout layout = (FormLayout) radContainer.getLayout();
for(int i=1; i<=layout.getRowCount(); i++) {
RowSpec rowSpec = layout.getRowSpec(i);
writer.startElement(UIFormXmlConstants.ELEMENT_ROWSPEC);
try {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_VALUE, FormLayoutUtils.getEncodedSpec(rowSpec));
}
finally {
writer.endElement();
}
}
for(int i=1; i<=layout.getColumnCount(); i++) {
ColumnSpec columnSpec = layout.getColumnSpec(i);
writer.startElement(UIFormXmlConstants.ELEMENT_COLSPEC);
try {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_VALUE, FormLayoutUtils.getEncodedSpec(columnSpec));
}
finally {
writer.endElement();
}
}
writeGroups(writer, UIFormXmlConstants.ELEMENT_ROWGROUP, layout.getRowGroups());
writeGroups(writer, UIFormXmlConstants.ELEMENT_COLGROUP, layout.getColumnGroups());
}
示例10: writeChildConstraints
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
@Override
public void writeChildConstraints(final XmlWriter writer, final RadComponent child) {
writeGridConstraints(writer, child);
if (child.getCustomLayoutConstraints() instanceof CellConstraints) {
CellConstraints cc = (CellConstraints) child.getCustomLayoutConstraints();
writer.startElement(UIFormXmlConstants.ELEMENT_FORMS);
try {
if (!cc.insets.equals(new Insets(0, 0, 0, 0))) {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_TOP, cc.insets.top);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_LEFT, cc.insets.left);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_BOTTOM, cc.insets.bottom);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_RIGHT, cc.insets.right);
}
if (cc.hAlign != CellConstraints.DEFAULT) {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_DEFAULTALIGN_HORZ, false);
}
if (cc.vAlign != CellConstraints.DEFAULT) {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_DEFAULTALIGN_VERT, false);
}
}
finally {
writer.endElement();
}
}
}
示例11: writeChildConstraints
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
public void writeChildConstraints(final XmlWriter writer, final RadComponent child) {
writeGridConstraints(writer, child);
if (child.getCustomLayoutConstraints() instanceof GridBagConstraints) {
GridBagConstraints gbc = (GridBagConstraints)child.getCustomLayoutConstraints();
writer.startElement(UIFormXmlConstants.ELEMENT_GRIDBAG);
try {
if (!gbc.insets.equals(new Insets(0, 0, 0, 0))) {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_TOP, gbc.insets.top);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_LEFT, gbc.insets.left);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_BOTTOM, gbc.insets.bottom);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_RIGHT, gbc.insets.right);
}
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_WEIGHTX, gbc.weightx);
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_WEIGHTY, gbc.weighty);
if (gbc.ipadx != 0) {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_IPADX, gbc.ipadx);
}
if (gbc.ipady != 0) {
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_IPADY, gbc.ipady);
}
}
finally {
writer.endElement();
}
}
}
示例12: write
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
public void write(final XmlWriter writer) {
writer.startElement(UIFormXmlConstants.ELEMENT_SPLITPANE);
try {
writeId(writer);
writeClassIfDifferent(writer, JSplitPane.class.getName());
writeBinding(writer);
// Constraints and properties
writeConstraints(writer);
writeProperties(writer);
// Margin and border
writeBorder(writer);
writeChildren(writer);
}
finally {
writer.endElement(); // scrollpane
}
}
示例13: write
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
public void write(final XmlWriter writer) {
writer.startElement("form", Utils.FORM_NAMESPACE);
try{
writer.addAttribute("version", 1);
final String classToBind = getClassToBind();
if (classToBind != null){
writer.addAttribute("bind-to-class", classToBind);
}
final String mainComponentBinding = getMainComponentBinding();
if (mainComponentBinding != null) {
writer.addAttribute("stored-main-component-binding", mainComponentBinding);
}
writeChildrenImpl(writer);
if (myButtonGroups.size() > 0) {
writer.startElement(UIFormXmlConstants.ELEMENT_BUTTON_GROUPS);
for(RadButtonGroup group: myButtonGroups) {
group.write(writer);
}
writer.endElement();
}
writeInspectionSuppressions(writer);
}
finally{
writer.endElement(); // form
}
}
示例14: writeLayout
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
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 {
writer.endElement(); // margin
}
}
示例15: writeGridConstraints
import com.intellij.uiDesigner.UIFormXmlConstants; //导入依赖的package包/类
protected static void writeGridConstraints(final XmlWriter writer, final RadComponent child) {
// Constraints in Grid layout
writer.startElement("grid");
try {
final GridConstraints constraints = child.getConstraints();
writer.addAttribute("row",constraints.getRow());
writer.addAttribute("column",constraints.getColumn());
writer.addAttribute("row-span",constraints.getRowSpan());
writer.addAttribute("col-span",constraints.getColSpan());
writer.addAttribute("vsize-policy",constraints.getVSizePolicy());
writer.addAttribute("hsize-policy",constraints.getHSizePolicy());
writer.addAttribute("anchor",constraints.getAnchor());
writer.addAttribute("fill",constraints.getFill());
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_INDENT, constraints.getIndent());
writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_USE_PARENT_LAYOUT, constraints.isUseParentLayout());
// preferred size
writer.writeDimension(constraints.myMinimumSize,"minimum-size");
writer.writeDimension(constraints.myPreferredSize,"preferred-size");
writer.writeDimension(constraints.myMaximumSize,"maximum-size");
} finally {
writer.endElement(); // grid
}
}