public virtual CellAreaDim PreferredLayoutSize(CompositeCellAreaComponent target)
 {
     CellAreaDim dim = new CellAreaDim();
     foreach (CellAreaComponent comp in target.GetComponents())
     {
         if (comp.IsVisible())
         {
             CellAreaDim d = comp.GetPreferredSize();
             dim.width += d.width + hgap;
             dim.height = System.Math.Max(d.height, dim.height);
         }
     }
     //        Insets insets = target.insets();
     //        dim.width += insets.left + insets.right;
     //        dim.height += insets.top + insets.bottom;
     return dim;
 }
 public virtual void LayoutContainer(CompositeCellAreaComponent target)
 {
     CellAreaDim targetSize = target.GetSize();
     //        Insets insets = target.insets();
     int top = 0;
     // insets.top;
     // final int bottom = targetSize.height; //- insets.bottom;
     int left = 0;
     // insets.left;
     int right = targetSize.width;
     // - insets.right;
     int width = right - left;
     int currY = top;
     foreach (CellAreaComponent comp in target.GetComponents())
     {
         if (comp.IsVisible())
         {
             CellAreaDim d = comp.GetPreferredSize();
             comp.SetBounds(left, currY, width, d.height);
             currY += d.height + vgap;
         }
     }
 }