cz.autel.dmi
Class HIGLayout

java.lang.Object
  |
  +--cz.autel.dmi.HIGLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable

public class HIGLayout
extends java.lang.Object
implements java.awt.LayoutManager2, java.io.Serializable

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

Version:
1.0 1/19/2002
Author:
Daniel Michalik (dmi@autel.cz), Romano Caserta (caserta@disy.net), Frank Behrens (frank@pinky.sax.de), Sven Behrens (behrens@disy.net) Alberto Ricart (aricart@smartsoft.com), Peter Reilly (Peter.Reilly@marconi.com)
See Also:
HIGConstraints, Serialized Form

Constructor Summary
HIGLayout(int[] widths, int[] heights)
          Construct a new layout object.
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
          Adds the specified component to the layout, using the HIGConstraints constraint object.
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Deprecated. replaced by addLayoutComponent(Component, Object). Throws UnsupportedOperationException.
 float getLayoutAlignmentX(java.awt.Container target)
          Returns 0.
 float getLayoutAlignmentY(java.awt.Container target)
          Returns 0.
 void invalidateLayout(java.awt.Container target)
          Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
 void layoutContainer(java.awt.Container target)
           
 java.awt.Dimension maximumLayoutSize(java.awt.Container target)
          Returns the maximum size of this component.
 java.awt.Dimension minimumLayoutSize(java.awt.Container target)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container target)
          Calculates the preferred size dimensions for the specified container given the components in the specified parent container.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the specified component from the layout.
 void setColumnWeight(int col, int weight)
          Sets weight of specified column.
 void setColumnWidth(int col, int width)
          Sets column width, realloc arrays if there is need.
 void setPreferredColumnWidth(int col, int width)
          Sets preferred width of specified column.
 void setPreferredRowHeight(int row, int height)
          Sets preferred height of specified row. of difference when resizing.
 void setRowHeight(int row, int height)
          Sets row height, realloc arrays if there is need.
 void setRowWeight(int row, int weight)
          Sets weight of specified row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

setColumnWidth

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

setRowHeight

public void setRowHeight(int row,
                         int height)
Sets row height, 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

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.

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.

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Deprecated. replaced by addLayoutComponent(Component, Object). Throws UnsupportedOperationException.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout.
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Calculates the preferred size dimensions for the specified container given the components in the specified parent container.
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - the component to be laid out
See Also:
minimumLayoutSize(java.awt.Container)

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container target)
Specified by:
layoutContainer in interface java.awt.LayoutManager

addLayoutComponent

public void addLayoutComponent(java.awt.Component comp,
                               java.lang.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.
Specified by:
addLayoutComponent in interface java.awt.LayoutManager2
Parameters:
comp - the component to be added
HIGConstraints - object determining where/how the component is added to the layout.
See Also:
HIGConstraints

maximumLayoutSize

public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
Returns the maximum size of this component.
Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2
See Also:
Component.getMinimumSize(), Component.getPreferredSize(), LayoutManager

getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container target)
Returns 0.
Specified by:
getLayoutAlignmentX in interface java.awt.LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container target)
Returns 0.
Specified by:
getLayoutAlignmentY in interface java.awt.LayoutManager2

invalidateLayout

public void invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
Specified by:
invalidateLayout in interface java.awt.LayoutManager2