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;
         }
     }
 }
 public virtual void InvalidateLayout(CompositeCellAreaComponent target)
 {
 }
        public virtual CellAreaDim PreferredLayoutSize(CompositeCellAreaComponent
			 target)
        {
            CellAreaDim dim = new CellAreaDim(0,
                0);
            CellAreaComponent c = null;
            if ((c = GetChild(EAST)) != null)
            {
                CellAreaDim d = c.GetPreferredSize();
                dim.width += d.width + hgap;
                dim.height = System.Math.Max(d.height, dim.height);
            }
            if ((c = GetChild(WEST)) != null)
            {
                CellAreaDim d = c.GetPreferredSize();
                dim.width += d.width + hgap;
                dim.height = System.Math.Max(d.height, dim.height);
            }
            if ((c = GetChild(CENTER)) != null)
            {
                CellAreaDim d = c.GetPreferredSize();
                dim.width += d.width;
                dim.height = System.Math.Max(d.height, dim.height);
            }
            if ((c = GetChild(NORTH)) != null)
            {
                CellAreaDim d = c.GetPreferredSize();
                dim.width = System.Math.Max(d.width, dim.width);
                dim.height += d.height + vgap;
            }
            if ((c = GetChild(SOUTH)) != null)
            {
                CellAreaDim d = c.GetPreferredSize();
                dim.width = System.Math.Max(d.width, dim.width);
                dim.height += d.height + vgap;
            }
            //        Insets insets = target.getInsets();
            //        dim.width += insets.left + insets.right;
            //        dim.height += insets.top + insets.bottom;
            return dim;
        }
        public virtual void LayoutContainer(CompositeCellAreaComponent
			 target)
        {
            //        Insets insets = target.getInsets();
            int top = 0;
            // insets.top;
            int bottom = target.GetHeight();
            // - insets.bottom;
            int left = 0;
            // insets.left;
            int right = target.GetColsCount();
            // - insets.right;
            CellAreaComponent c = null;
            if ((c = GetChild(NORTH)) != null)
            {
                c.SetSize(right - left, c.GetRowsCount());
                CellAreaDim d = c.GetPreferredSize();
                c.SetBounds(left, top, right - left, d.height);
                top += d.height + vgap;
            }
            if ((c = GetChild(SOUTH)) != null)
            {
                c.SetSize(right - left, c.GetRowsCount());
                CellAreaDim d = c.GetPreferredSize();
                c.SetBounds(left, bottom - d.height, right - left, d.height);
                bottom -= d.height + vgap;
            }
            if ((c = GetChild(EAST)) != null)
            {
                c.SetSize(c.width, bottom - top);
                CellAreaDim d = c.GetPreferredSize();
                c.SetBounds(right - d.width, top, d.width, bottom - top);
                right -= d.width + hgap;
            }
            if ((c = GetChild(WEST)) != null)
            {
                c.SetSize(c.width, bottom - top);
                CellAreaDim d = c.GetPreferredSize();
                c.SetBounds(left, top, d.width, bottom - top);
                left += d.width + hgap;
            }
            if ((c = GetChild(CENTER)) != null)
            {
                c.SetBounds(left, top, right - left, bottom - top);
            }
        }