Skip navigation links
Draw2d
3.10.1.201508170204
org.eclipse.draw2d

Class GridLayout

    • Field Detail

      • numColumns

        public int numColumns
        numColumns specifies the number of cell columns in the layout. The default value is 1.
      • makeColumnsEqualWidth

        public boolean makeColumnsEqualWidth
        makeColumnsEqualWidth specifies whether all columns in the layout will be forced to have the same width. The default value is false.
      • marginWidth

        public int marginWidth
        marginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout. The default value is 5.
      • marginHeight

        public int marginHeight
        marginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout. The default value is 5.
      • horizontalSpacing

        public int horizontalSpacing
        horizontalSpacing specifies the number of pixels between the right edge of one cell and the left edge of its neighbouring cell to the right. The default value is 5.
      • verticalSpacing

        public int verticalSpacing
        verticalSpacing specifies the number of pixels between the bottom edge of one cell and the top edge of its neighbouring cell underneath. The default value is 5.
      • constraints

        protected java.util.Map constraints
        The layout contraints
    • Constructor Detail

      • GridLayout

        public GridLayout()
        Default Constructor
      • GridLayout

        public GridLayout(int numColumns,
                          boolean makeColumnsEqualWidth)
        Constructs a new instance of this class given the number of columns, and whether or not the columns should be forced to have the same width.
        Parameters:
        numColumns - the number of columns in the grid
        makeColumnsEqualWidth - whether or not the columns will have equal width
    • Method Detail

      • getChildSize

        protected Dimension getChildSize(IFigure child,
                                         int wHint,
                                         int hHint)
        Parameters:
        child -
        wHint -
        hHint -
        Returns:
        the child size.
      • calculatePreferredSize

        protected Dimension calculatePreferredSize(IFigure container,
                                                   int wHint,
                                                   int hHint)
        Description copied from class: AbstractLayout
        Calculates the preferred size of the given figure, using width and height hints.
        Specified by:
        calculatePreferredSize in class AbstractLayout
        Parameters:
        container - The figure
        wHint - The width hint
        hHint - The height hint
        Returns:
        The preferred size
      • layout

        public void layout(IFigure container)
        Description copied from interface: LayoutManager
        Lays out the given figure.
        Parameters:
        container - The figure

Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.