APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.colorchooser

pack-priv Class SmartGridLayout

extends Object
implements LayoutManager, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.awt.LayoutManager
Annotations
@SuppressWarnings:serial
Imports
javax.swing.*, java.awt.*, java.awt.event.*, javax.swing.event.*, javax.swing.text.*, java.io.Serializable

A better GridLayout class
Author
Steve Wilson

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv Component[][]
pack-priv int
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
public
SmartGridLayout(int numColumns, int numRows)

Method Summary

Modifier and TypeMethod and Description
public void
addLayoutComponent(String s, Component c)

Implements java.awt.LayoutManager.addLayoutComponent.

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

private void
private int
computeColumnWidth(int columnNum)

private int
computeRowHeight(int rowNum)

public void
layoutContainer(Container c)

Implements java.awt.LayoutManager.layoutContainer.

Lays out the specified container.

public Dimension
minimumLayoutSize(Container c)

Implements java.awt.LayoutManager.minimumLayoutSize.

Calculates the minimum size dimensions for the specified container, given the components it contains.

public Dimension
preferredLayoutSize(Container c)

Implements java.awt.LayoutManager.preferredLayoutSize.

Calculates the preferred size dimensions for the specified container, given the components it contains.

public void
removeLayoutComponent(Component c)

Implements java.awt.LayoutManager.removeLayoutComponent.

Removes the specified component from the layout.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnsback to summary
pack-priv int columns
componentCountback to summary
pack-priv int componentCount
layoutGridback to summary
pack-priv Component[][] layoutGrid
rowsback to summary
pack-priv int rows
xGapback to summary
pack-priv int xGap
yGapback to summary
pack-priv int yGap

Constructor Detail

SmartGridLayoutback to summary
public SmartGridLayout(int numColumns, int numRows)

Method Detail

addLayoutComponentback to summary
public void addLayoutComponent(String s, Component c)

Implements java.awt.LayoutManager.addLayoutComponent.

Doc from java.awt.LayoutManager.addLayoutComponent.

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

buildLayoutGridback to summary
private void buildLayoutGrid(Container c)
computeColumnWidthback to summary
private int computeColumnWidth(int columnNum)
computeRowHeightback to summary
private int computeRowHeight(int rowNum)
layoutContainerback to summary
public void layoutContainer(Container c)

Implements java.awt.LayoutManager.layoutContainer.

Doc from java.awt.LayoutManager.layoutContainer.

Lays out the specified container.

minimumLayoutSizeback to summary
public Dimension minimumLayoutSize(Container c)

Implements java.awt.LayoutManager.minimumLayoutSize.

Doc from java.awt.LayoutManager.minimumLayoutSize.

Calculates the minimum size dimensions for the specified container, given the components it contains.

preferredLayoutSizeback to summary
public Dimension preferredLayoutSize(Container c)

Implements java.awt.LayoutManager.preferredLayoutSize.

Doc from java.awt.LayoutManager.preferredLayoutSize.

Calculates the preferred size dimensions for the specified container, given the components it contains.

removeLayoutComponentback to summary
public void removeLayoutComponent(Component c)

Implements java.awt.LayoutManager.removeLayoutComponent.

Doc from java.awt.LayoutManager.removeLayoutComponent.

Removes the specified component from the layout.