Search in sources :

Example 1 with ConstantSize

use of com.jgoodies.forms.layout.ConstantSize 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);
}
Also used : ColumnSpec(com.jgoodies.forms.layout.ColumnSpec) ConstantSize(com.jgoodies.forms.layout.ConstantSize)

Example 2 with ConstantSize

use of com.jgoodies.forms.layout.ConstantSize 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);
}
Also used : ColumnSpec(com.jgoodies.forms.layout.ColumnSpec) ConstantSize(com.jgoodies.forms.layout.ConstantSize)

Example 3 with ConstantSize

use of com.jgoodies.forms.layout.ConstantSize in project intellij-community by JetBrains.

the class RadFormLayoutManagerTest method testResizeColumn.

public void testResizeColumn() {
    myManager.processCellResized(myContainer, false, 0, 210);
    final ColumnSpec spec = myLayout.getColumnSpec(1);
    assertTrue(spec.getSize() instanceof ConstantSize);
    ConstantSize cSize = (ConstantSize) spec.getSize();
    assertEquals(210, cSize.getPixelSize(myContainer.getDelegee()));
}
Also used : ColumnSpec(com.jgoodies.forms.layout.ColumnSpec) ConstantSize(com.jgoodies.forms.layout.ConstantSize)

Example 4 with ConstantSize

use of com.jgoodies.forms.layout.ConstantSize in project intellij-community by JetBrains.

the class RadFormLayoutManagerTest method testMoveColumnRight.

public void testMoveColumnRight() {
    myManager.insertGridCells(myContainer, 0, false, false, true);
    final ConstantSize colSize = new ConstantSize(17, ConstantSize.MM);
    myLayout.setColumnSpec(1, new ColumnSpec(colSize));
    RadComponent c = newComponent(0, 0, 1, 1);
    myContainer.addComponent(c);
    myManager.processCellsMoved(myContainer, false, new int[] { 0 }, 3);
    assertEquals(colSize, myLayout.getColumnSpec(3).getSize());
    assertEquals(3, myLayout.getConstraints(c.getDelegee()).gridX);
}
Also used : ColumnSpec(com.jgoodies.forms.layout.ColumnSpec) ConstantSize(com.jgoodies.forms.layout.ConstantSize)

Aggregations

ColumnSpec (com.jgoodies.forms.layout.ColumnSpec)4 ConstantSize (com.jgoodies.forms.layout.ConstantSize)4