cz.autel.dmi

Class HIGLayout

public class HIGLayout extends Object implements LayoutManager2, Serializable

Layout manager based on idea of design grid. For description please see tutorial included in download bundle.

See Also: HIGConstraints

Constructor Summary
HIGLayout(int[] widths, int[] heights)
Construct a new layout object.
Method Summary
voidaddLayoutComponent(String name, Component comp)
voidaddLayoutComponent(Component comp, Object constraints)
Adds the specified component to the layout, using the HIGConstraints constraint object.
floatgetLayoutAlignmentX(Container target)
Returns 0.
floatgetLayoutAlignmentY(Container target)
Returns 0.
voidinvalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
voidlayoutContainer(Container target)
DimensionmaximumLayoutSize(Container target)
Returns the maximum size of this component.
DimensionminimumLayoutSize(Container target)
DimensionpreferredLayoutSize(Container target)
Calculates the preferred size dimensions for the specified container given the components in the specified parent container.
voidremoveLayoutComponent(Component comp)
Removes the specified component from the layout.
voidsetColumnWeight(int col, int weight)
Sets weight of specified column.
voidsetColumnWidth(int col, int width)
Sets column width, realloc arrays if there is need.
voidsetPreferredColumnWidth(int col, int width)
Sets preferred width of specified column.
voidsetPreferredRowHeight(int row, int height)
Sets preferred height of specified row. of difference when resizing.
voidsetRowHeight(int row, int height)
Sets row height, realloc arrays if there is need.
voidsetRowWeight(int row, int weight)
Sets weight of specified row.

Constructor Detail

HIGLayout

public HIGLayout(int[] widths, int[] heights)
Construct a new layout object. Length of passed arrays define number of columns and number of rows. Each width or height can be less then 0, equal 0 or greater then 0. Passed arrays defines design grid - sizes and dependences between columns and rows. For details see tutorial.

Parameters: widths array of column widths. heights array of row heights.

Method Detail

addLayoutComponent

public void addLayoutComponent(String name, Component comp)

Deprecated: replaced by addLayoutComponent(Component, Object). Throws UnsupportedOperationException.

addLayoutComponent

public void addLayoutComponent(Component comp, Object constraints)
Adds the specified component to the layout, using the HIGConstraints constraint object. Constraints object is copied so passed instance can be safely modifed.

Parameters: comp the component to be added HIGConstraints object determining where/how the component is added to the layout.

See Also: HIGConstraints

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Returns 0.

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Returns 0.

invalidateLayout

public void invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.

layoutContainer

public void layoutContainer(Container target)

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)
Returns the maximum size of this component.

See Also: java.awt.Component#getMinimumSize() java.awt.Component#getPreferredSize() LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container target)

preferredLayoutSize

public Dimension preferredLayoutSize(Container target)
Calculates the preferred size dimensions for the specified container given the components in the specified parent container.

Parameters: parent the component to be laid out

See Also: HIGLayout

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

Parameters: comp the component to be removed

setColumnWeight

public void setColumnWeight(int col, int weight)
Sets weight of specified column. Weight determines distribution of difference when resizing.

Parameters: col index of column. Index must be > 0.

setColumnWidth

public void setColumnWidth(int col, int width)
Sets column width, realloc arrays if there is need.

Since: 0.97

setPreferredColumnWidth

public void setPreferredColumnWidth(int col, int width)
Sets preferred width of specified column.

Parameters: col index of column. Index must be > 0. width the width to use in pixels

Since: 1.0

setPreferredRowHeight

public void setPreferredRowHeight(int row, int height)
Sets preferred height of specified row. of difference when resizing.

Parameters: row index of row. Index must be > 0. height the height in pixels

Since: 1.0

setRowHeight

public void setRowHeight(int row, int height)
Sets row height, realloc arrays if there is need.

Since: 0.97

setRowWeight

public void setRowWeight(int row, int weight)
Sets weight of specified row. Weight determines distribution of difference when resizing.

Parameters: row index of row. Index must be > 0.