yu.ac.bg.etf.javaqx.qswing.layouts
Class GridLayout

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.layouts.GridLayout
All Implemented Interfaces:
LayoutManager

public class GridLayout
extends java.lang.Object
implements LayoutManager

Grid Layout.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Constructor Summary
GridLayout()
          Constructs new GridLayout object.
GridLayout(int rows, int columns)
          Constructs new GridLayout object.
GridLayout(int rows, int columns, int hgap, int vgap)
          Constructs new GridLayout object.
 
Method Summary
 void addLayoutComponent(JQComponent comp, java.lang.Object constraints)
          Adds the specified component to the layout.
 int getColumns()
          Returns the number of columns.
 int getHgap()
          Returns the horizontal gap between components.
 int getRows()
          Returns the number of rows.
 int getVgap()
          Returns the vertical gap between components.
 void invalidateLayout(JQContainer target)
          Invalidates the layout.
 void layoutContainer(JQContainer target)
          Lays out the specified container.
 Dimension maximumLayoutSize(JQContainer target)
          Calculates the maximum size dimensions for the specified container.
 Dimension minimumLayoutSize(JQContainer target)
          Calculates the minimum size dimensions for the specified containers.
 Dimension preferredLayoutSize(JQContainer target)
          Calculates the preferred size dimensions for the specified container.
 void removeLayoutComponent(JQComponent comp)
          Removes the specified component from the layout.
 void setColumns(int columns)
          Sets the number of columns.
 void setHgap(int hgap)
          Sets the horizontal gap between components.
 void setRows(int rows)
          Sets the number of rows.
 void setVgap(int vgap)
          Sets the vertical gap between components.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridLayout

public GridLayout()
Constructs new GridLayout object.


GridLayout

public GridLayout(int rows,
                  int columns)
Constructs new GridLayout object.

Parameters:
rows - the number of rows
columns - the number of columns

GridLayout

public GridLayout(int rows,
                  int columns,
                  int hgap,
                  int vgap)
Constructs new GridLayout object.

Parameters:
rows - the number of rows
columns - the number of columns
hgap - the horizontal gap between components
vgap - the vertical gap between components
Method Detail

getRows

public int getRows()
Returns the number of rows.

Returns:
the number of rows

setRows

public void setRows(int rows)
Sets the number of rows.

Parameters:
rows - the number of rows

getColumns

public int getColumns()
Returns the number of columns.

Returns:
the number of columns

setColumns

public void setColumns(int columns)
Sets the number of columns.

Parameters:
columns - the number of columns

getHgap

public int getHgap()
Returns the horizontal gap between components.

Returns:
the horizontal gap between components

setHgap

public void setHgap(int hgap)
Sets the horizontal gap between components.

Parameters:
hgap - the horizontal gap between components

getVgap

public int getVgap()
Returns the vertical gap between components.

Returns:
the vertical gap between components

setVgap

public void setVgap(int vgap)
Sets the vertical gap between components.

Parameters:
vgap - the vertical gap between components

addLayoutComponent

public void addLayoutComponent(JQComponent comp,
                               java.lang.Object constraints)
Adds the specified component to the layout.

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be added
constraints - the layout constraints

removeLayoutComponent

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

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public Dimension preferredLayoutSize(JQContainer target)
Calculates the preferred size dimensions for the specified container.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
target - the container to be laid out
Returns:
the preferred size of the specified container

maximumLayoutSize

public Dimension maximumLayoutSize(JQContainer target)
Calculates the maximum size dimensions for the specified container.

Specified by:
maximumLayoutSize in interface LayoutManager
Parameters:
target - the component to be laid out
Returns:
the maximum size of the specified container

minimumLayoutSize

public Dimension minimumLayoutSize(JQContainer target)
Calculates the minimum size dimensions for the specified containers.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
target - the component to be laid out
Returns:
the minimum size of the specified container

layoutContainer

public void layoutContainer(JQContainer target)
Lays out the specified container.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
target - the container to be laid out

invalidateLayout

public void invalidateLayout(JQContainer target)
Invalidates the layout.

Specified by:
invalidateLayout in interface LayoutManager
Parameters:
target - the container to be laid out

toString

public java.lang.String toString()



Copyright © 2007 ETF and contributors. All Rights Reserved.