Exemplo n.º 1
0
  private void fillLayout(LayoutConstraints<?>[] oldConstraints) {
    RADVisualComponent<?>[] radComps = radContainer.getSubComponents();
    int componentCount = radComps.length;
    Component[] primaryComps = new Component[componentCount];
    LayoutConstraints<?>[] newConstraints = new LayoutConstraints<?>[componentCount];

    for (int i = 0; i < componentCount; i++) {
      primaryComps[i] = radComps[i].getBeanInstance();
      newConstraints[i] = radComps[i].getLayoutConstraints(layoutDelegate.getClass());
    }

    layoutDelegate.convertConstraints(oldConstraints, newConstraints, primaryComps);

    if (componentCount > 0) {
      layoutDelegate.acceptNewComponents(radComps, newConstraints, 0);
      layoutDelegate.addComponents(radComps, newConstraints, 0);

      for (int i = 0; i < componentCount; i++) {
        radComps[i].resetConstraintsProperties();
      }
    }

    // setup primary container
    Container cont = getPrimaryContainer();
    Container contDel = getPrimaryContainerDelegate();
    layoutDelegate.setLayoutToContainer(cont, contDel);
    if (componentCount > 0) {
      layoutDelegate.addComponentsToContainer(cont, contDel, primaryComps, 0);
    }
  }
Exemplo n.º 2
0
 // data validation
 public void acceptNewComponents(
     RADVisualComponent<?>[] components, LayoutConstraints<?>[] constraints, int index) {
   layoutDelegate.acceptNewComponents(components, constraints, index);
 }