本文整理汇总了Java中com.intellij.uiDesigner.core.GridConstraints.setColumn方法的典型用法代码示例。如果您正苦于以下问题:Java GridConstraints.setColumn方法的具体用法?Java GridConstraints.setColumn怎么用?Java GridConstraints.setColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.uiDesigner.core.GridConstraints
的用法示例。
在下文中一共展示了GridConstraints.setColumn方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addComponent
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private static int addComponent(JComponent parent, JComponent component, int row, int column, boolean isLast) {
GridConstraints gridConstraints = new GridConstraints();
gridConstraints.setRow(row);
gridConstraints.setColumn(column);
boolean isGreedyComponent = component instanceof JTextField || component instanceof Spacer ||
component instanceof LabelWithEditLink || component instanceof TextAccessor ||
component instanceof EditorComboBox;
int columnSpan = (isLast && isGreedyComponent) ? COLUMN_COUNT - column : 1;
gridConstraints.setColSpan(columnSpan);
gridConstraints.setAnchor(GridConstraints.ALIGN_LEFT);
gridConstraints.setHSizePolicy(isGreedyComponent
? GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW
: GridConstraints.SIZEPOLICY_CAN_SHRINK);
gridConstraints.setVSizePolicy(component instanceof Spacer
? GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW
: GridConstraints.SIZEPOLICY_FIXED);
gridConstraints.setFill(GridConstraints.FILL_HORIZONTAL);
parent.add(component, gridConstraints);
if (isLast && !isGreedyComponent && column < COLUMN_COUNT - 1) {
addComponent(parent, new Spacer(), row, column + 1, true);
}
return columnSpan;
}
示例2: createGridConstraints
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private GridConstraints createGridConstraints(boolean grab, int columnSpan) {
GridConstraints gridConstraints = new GridConstraints();
gridConstraints.setRow(componentNumber / COLUMN_COUNT);
final int column = componentNumber % COLUMN_COUNT;
gridConstraints.setColumn(column);
if (grab) {
gridConstraints.setHSizePolicy(GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW);
}
gridConstraints.setFill(GridConstraints.FILL_HORIZONTAL);
gridConstraints.setColSpan(columnSpan);
componentNumber += columnSpan;
return gridConstraints;
}
示例3: layout
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private void layout(JPanel panel, int row, int ident) {
GridConstraints c = new GridConstraints();
c.setVSizePolicy(GridConstraints.SIZEPOLICY_FIXED);
c.setRow(row);
c.setColumn(0);
c.setFill(GridConstraints.FILL_NONE);
c.setAnchor(GridConstraints.ANCHOR_WEST);
c.setRow(row);
c.setIndent(ident);
panel.add(myLabel, c);
c.setIndent(0);
c.setColumn(1);
c.setFill(GridConstraints.FILL_HORIZONTAL);
panel.add(myMinSdkCombobox, c);
}
示例4: addToCell
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private static void addToCell(final GridConstraints constraints, final boolean isRow, final int delta){
if (isRow) {
constraints.setRow(constraints.getRow() + delta);
}
else {
constraints.setColumn(constraints.getColumn() + delta);
}
}
示例5: createTwoDimensionGrid
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private static GridLayoutManager createTwoDimensionGrid(final RadComponent[] selection){
final int[] x = new int[selection.length];
final int[] y = new int[selection.length];
final int[] colSpans = new int[selection.length];
final int[] rowSpans = new int[selection.length];
for (int i = selection.length - 1; i >= 0; i--) {
x[i] = selection[i].getX();
y[i] = selection[i].getY();
rowSpans[i] = selection[i].getHeight();
colSpans[i] = selection[i].getWidth();
}
final Couple<Integer> pair = layoutInGrid(x, y, rowSpans, colSpans);
for (int i = 0; i < selection.length; i++) {
final RadComponent component = selection[i];
final GridConstraints constraints = component.getConstraints();
constraints.setRow(y[i]);
constraints.setRowSpan(rowSpans[i]);
constraints.setColumn(x[i]);
constraints.setColSpan(colSpans[i]);
}
return new GridLayoutManager(pair.first.intValue(), pair.second.intValue());
}
示例6: flattenGrid
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private static void flattenGrid(final RadContainer container) {
RadContainer parent = container.getParent();
GridConstraints containerConstraints = (GridConstraints) container.getConstraints().clone();
// ensure there will be enough rows and columns to fit the container contents
for(int i=containerConstraints.getRowSpan(); i<container.getGridRowCount(); i++) {
GridChangeUtil.splitRow(parent, containerConstraints.getRow());
}
for(int i=containerConstraints.getColSpan(); i<container.getGridColumnCount(); i++) {
GridChangeUtil.splitColumn(parent, containerConstraints.getColumn());
}
ArrayList<RadComponent> contents = new ArrayList<RadComponent>();
for(int i=container.getComponentCount()-1; i >= 0; i--) {
contents.add(0, container.getComponent(i));
container.removeComponent(container.getComponent(i));
}
if (contents.size() == 1) {
contents.get(0).setCustomLayoutConstraints(container.getCustomLayoutConstraints());
}
FormEditingUtil.deleteComponents(Collections.singletonList(container), false);
for(RadComponent child: contents) {
final GridConstraints childConstraints = child.getConstraints();
childConstraints.setRow(childConstraints.getRow() + containerConstraints.getRow());
childConstraints.setColumn(childConstraints.getColumn() + containerConstraints.getColumn());
parent.addComponent(child);
child.revalidate();
}
}
示例7: moveComponent
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
@Override
public void moveComponent(RadComponent c, int rowDelta, int colDelta, final int rowSpanDelta, final int colSpanDelta) {
GridConstraints constraints = c.getConstraints();
GridConstraints oldConstraints = (GridConstraints)constraints.clone();
constraints.setRow(getNewRow(c, rowDelta));
constraints.setColumn(getNewColumn(c, colDelta));
constraints.setRowSpan(getNewRowSpan(c, rowSpanDelta));
constraints.setColSpan(getNewColSpan(c, colSpanDelta));
c.fireConstraintsChanged(oldConstraints);
}
示例8: readChildConstraints
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
void readChildConstraints(final Element constraintsElement, final LwComponent component) {
// Read Grid constraints
final Element gridElement = LwXmlReader.getChild(constraintsElement, "grid");
if(gridElement != null){
final GridConstraints constraints=new GridConstraints();
constraints.setRow(LwXmlReader.getRequiredInt(gridElement, "row"));
constraints.setColumn(LwXmlReader.getRequiredInt(gridElement, "column"));
constraints.setRowSpan(LwXmlReader.getRequiredInt(gridElement, "row-span"));
constraints.setColSpan(LwXmlReader.getRequiredInt(gridElement, "col-span"));
constraints.setVSizePolicy(LwXmlReader.getRequiredInt(gridElement, "vsize-policy"));
constraints.setHSizePolicy(LwXmlReader.getRequiredInt(gridElement, "hsize-policy"));
constraints.setAnchor(LwXmlReader.getRequiredInt(gridElement, "anchor"));
constraints.setFill(LwXmlReader.getRequiredInt(gridElement, "fill"));
constraints.setIndent(LwXmlReader.getOptionalInt(gridElement, UIFormXmlConstants.ATTRIBUTE_INDENT, 0));
constraints.setUseParentLayout(LwXmlReader.getOptionalBoolean(gridElement, UIFormXmlConstants.ATTRIBUTE_USE_PARENT_LAYOUT, false));
// minimum size
final Element minSizeElement = LwXmlReader.getChild(gridElement, "minimum-size");
if (minSizeElement != null) {
constraints.myMinimumSize.width = LwXmlReader.getRequiredInt(minSizeElement, "width");
constraints.myMinimumSize.height = LwXmlReader.getRequiredInt(minSizeElement, "height");
}
// preferred size
final Element prefSizeElement = LwXmlReader.getChild(gridElement, "preferred-size");
if (prefSizeElement != null) {
constraints.myPreferredSize.width = LwXmlReader.getRequiredInt(prefSizeElement, "width");
constraints.myPreferredSize.height = LwXmlReader.getRequiredInt(prefSizeElement, "height");
}
// maximum size
final Element maxSizeElement = LwXmlReader.getChild(gridElement, "maximum-size");
if (maxSizeElement != null) {
constraints.myMaximumSize.width = LwXmlReader.getRequiredInt(maxSizeElement, "width");
constraints.myMaximumSize.height = LwXmlReader.getRequiredInt(maxSizeElement, "height");
}
component.getConstraints().restore(constraints);
}
}
示例9: copyCellToGridConstraints
import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private static void copyCellToGridConstraints(final GridConstraints gc, final CellConstraints cc) {
gc.setColumn(cc.gridX-1);
gc.setRow(cc.gridY-1);
gc.setColSpan(cc.gridWidth);
gc.setRowSpan(cc.gridHeight);
}