コード例 #1
0
 public void processCellResized(
     RadContainer container, final boolean isRow, final int cell, final int newSize) {
   int cellCount = isRow ? container.getGridRowCount() : container.getGridColumnCount();
   if (container.getParent().isXY() && cell == cellCount - 1) {
     processRootContainerResize(container, isRow, newSize);
   } else {
     for (RadComponent component : container.getComponents()) {
       GridConstraints c = component.getConstraints();
       if (c.getCell(isRow) == cell && c.getSpan(isRow) == 1) {
         Dimension preferredSize = new Dimension(c.myPreferredSize);
         if (isRow) {
           preferredSize.height = newSize;
           if (preferredSize.width == -1) {
             preferredSize.width = component.getDelegee().getPreferredSize().width;
           }
         } else {
           preferredSize.width = newSize;
           if (preferredSize.height == -1) {
             preferredSize.height = component.getDelegee().getPreferredSize().height;
           }
         }
         PreferredSizeProperty.getInstance(container.getProject())
             .setValueEx(component, preferredSize);
       }
     }
   }
 }
コード例 #2
0
 @Override
 public Property[] getComponentProperties(final Project project, final RadComponent component) {
   return new Property[] {
     HSizePolicyProperty.getInstance(project),
     VSizePolicyProperty.getInstance(project),
     HorzAlignProperty.getInstance(project),
     VertAlignProperty.getInstance(project),
     IndentProperty.getInstance(project),
     UseParentLayoutProperty.getInstance(project),
     MinimumSizeProperty.getInstance(project),
     PreferredSizeProperty.getInstance(project),
     MaximumSizeProperty.getInstance(project)
   };
 }