use of com.jgoodies.forms.layout.ColumnSpec in project antlrworks by antlr.
the class DialogGenerate method initComponents.
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
// Generated using JFormDesigner Open Source Project license - ANTLR (www.antlr.org)
dialogPane = new JPanel();
contentPane = new JPanel();
label1 = new JLabel();
outputPathField = new JTextField();
browseButton = new JButton();
debugInfoButton = new JCheckBox();
buttonBar = new JPanel();
okButton = new JButton();
cancelButton = new JButton();
CellConstraints cc = new CellConstraints();
//======== this ========
setTitle("Generate");
Container contentPane2 = getContentPane();
contentPane2.setLayout(new BorderLayout());
//======== dialogPane ========
{
dialogPane.setBorder(Borders.DIALOG_BORDER);
dialogPane.setLayout(new BorderLayout());
//======== contentPane ========
{
contentPane.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(min;200dlu):grow"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC }));
//---- label1 ----
label1.setText("Output path:");
label1.setHorizontalAlignment(SwingConstants.RIGHT);
contentPane.add(label1, cc.xy(1, 1));
contentPane.add(outputPathField, cc.xy(3, 1));
//---- browseButton ----
browseButton.setText("Browse...");
contentPane.add(browseButton, cc.xy(5, 1));
//---- debugInfoButton ----
debugInfoButton.setText("Debug information");
contentPane.add(debugInfoButton, cc.xy(3, 3));
}
dialogPane.add(contentPane, BorderLayout.CENTER);
//======== buttonBar ========
{
buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
buttonBar.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref")));
//---- okButton ----
okButton.setText("OK");
buttonBar.add(okButton, cc.xy(2, 1));
//---- cancelButton ----
cancelButton.setText("Cancel");
buttonBar.add(cancelButton, cc.xy(4, 1));
}
dialogPane.add(buttonBar, BorderLayout.SOUTH);
}
contentPane2.add(dialogPane, BorderLayout.CENTER);
pack();
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
use of com.jgoodies.forms.layout.ColumnSpec in project intellij-community by JetBrains.
the class FormFirstComponentInsertLocation method processDrop.
@Override
public void processDrop(final GuiEditor editor, final RadComponent[] components, final GridConstraints[] constraintsToAdjust, final ComponentDragObject dragObject) {
RadAbstractGridLayoutManager gridLayout = myContainer.getGridLayoutManager();
if (myContainer.getGridRowCount() == 0) {
gridLayout.insertGridCells(myContainer, 0, true, true, true);
}
if (myContainer.getGridColumnCount() == 0) {
gridLayout.insertGridCells(myContainer, 0, false, true, true);
}
dropIntoGrid(myContainer, components, myRow, myColumn, dragObject);
FormLayout formLayout = (FormLayout) myContainer.getDelegee().getLayout();
if (myXPart == 0) {
formLayout.setColumnSpec(1, new ColumnSpec("d"));
} else if (myXPart == 2) {
gridLayout.insertGridCells(myContainer, 0, false, true, true);
}
if (myYPart == 0) {
formLayout.setRowSpec(1, new RowSpec("d"));
} else if (myYPart == 2) {
gridLayout.insertGridCells(myContainer, 0, true, true, true);
}
}
use of com.jgoodies.forms.layout.ColumnSpec in project intellij-community by JetBrains.
the class RadFormLayoutManagerTest method testMoveColumnLeft.
public void testMoveColumnLeft() {
myManager.insertGridCells(myContainer, 0, false, false, true);
final ConstantSize colSize = new ConstantSize(17, ConstantSize.MM);
myLayout.setColumnSpec(3, new ColumnSpec(colSize));
RadComponent c = newComponent(0, 2, 1, 1);
myContainer.addComponent(c);
myManager.processCellsMoved(myContainer, false, new int[] { 2 }, 0);
assertEquals(colSize, myLayout.getColumnSpec(1).getSize());
assertEquals(1, myLayout.getConstraints(c.getDelegee()).gridX);
}
use of com.jgoodies.forms.layout.ColumnSpec in project intellij-community by JetBrains.
the class FormLayoutSerializer method readLayout.
void readLayout(Element element, LwContainer container) {
FormLayout layout = new FormLayout();
final List rowSpecs = element.getChildren(UIFormXmlConstants.ELEMENT_ROWSPEC, element.getNamespace());
for (Iterator iterator = rowSpecs.iterator(); iterator.hasNext(); ) {
Element rowSpecElement = (Element) iterator.next();
final String spec = LwXmlReader.getRequiredString(rowSpecElement, UIFormXmlConstants.ATTRIBUTE_VALUE);
layout.appendRow(new RowSpec(spec));
}
final List colSpecs = element.getChildren(UIFormXmlConstants.ELEMENT_COLSPEC, element.getNamespace());
for (Iterator iterator = colSpecs.iterator(); iterator.hasNext(); ) {
Element colSpecElement = (Element) iterator.next();
final String spec = LwXmlReader.getRequiredString(colSpecElement, UIFormXmlConstants.ATTRIBUTE_VALUE);
layout.appendColumn(new ColumnSpec(spec));
}
int[][] rowGroups = readGroups(element, UIFormXmlConstants.ELEMENT_ROWGROUP);
int[][] colGroups = readGroups(element, UIFormXmlConstants.ELEMENT_COLGROUP);
if (rowGroups != null) {
layout.setRowGroups(rowGroups);
}
if (colGroups != null) {
layout.setColumnGroups(colGroups);
}
container.setLayout(layout);
}
use of com.jgoodies.forms.layout.ColumnSpec in project intellij-community by JetBrains.
the class RadFormLayoutManagerTest method testMoveMultipleColumnsRight.
public void testMoveMultipleColumnsRight() {
myManager.insertGridCells(myContainer, 0, false, false, true);
myManager.insertGridCells(myContainer, 0, false, false, true);
final ConstantSize colSize1 = new ConstantSize(17, ConstantSize.MM);
final ConstantSize colSize2 = new ConstantSize(19, ConstantSize.MM);
myLayout.setColumnSpec(1, new ColumnSpec(colSize1));
myLayout.setColumnSpec(3, new ColumnSpec(colSize2));
RadComponent c1 = newComponent(0, 0, 1, 1);
myContainer.addComponent(c1);
RadComponent c2 = newComponent(0, 2, 1, 1);
myContainer.addComponent(c2);
myManager.processCellsMoved(myContainer, false, new int[] { 0, 2 }, 5);
assertEquals(colSize1, myLayout.getColumnSpec(3).getSize());
assertEquals(colSize2, myLayout.getColumnSpec(5).getSize());
assertEquals(3, myLayout.getConstraints(c1.getDelegee()).gridX);
assertEquals(5, myLayout.getConstraints(c2.getDelegee()).gridX);
}
Aggregations