org.apache.batik.ext.swing

Class JGridBagPanel

public class JGridBagPanel extends JPanel implements GridBagConstants

An implementation of JPanel that uses the GridBagLayout.
Nested Class Summary
static interfaceJGridBagPanel.InsetsManager
Provides insets desired for a given grid cell
Field Summary
static JGridBagPanel.InsetsManagerDEFAULT_INSETS
An InsetsManager that uses padding for inside cells
JGridBagPanel.InsetsManagerinsetsManager
Used to get insets at any given cell location
static JGridBagPanel.InsetsManagerZERO_INSETS
An InsetsManager that uses zero insets
Constructor Summary
JGridBagPanel()
Sets the layout manager to GridBagLayout
JGridBagPanel(JGridBagPanel.InsetsManager insetsManager)
Initializes panel with a given insets manager
Method Summary
voidadd(Component cmp, int gridx, int gridy, int gridwidth, int gridheight, int anchor, int fill, double weightx, double weighty)
This version uses default insets and assumes that components are added in positive cell coordinates.
voidsetLayout(LayoutManager layout)
This method only takes effect if the LayoutManager is a GridBagLayout

Field Detail

DEFAULT_INSETS

public static final JGridBagPanel.InsetsManager DEFAULT_INSETS
An InsetsManager that uses padding for inside cells

insetsManager

public JGridBagPanel.InsetsManager insetsManager
Used to get insets at any given cell location

ZERO_INSETS

public static final JGridBagPanel.InsetsManager ZERO_INSETS
An InsetsManager that uses zero insets

Constructor Detail

JGridBagPanel

public JGridBagPanel()
Sets the layout manager to GridBagLayout

JGridBagPanel

public JGridBagPanel(JGridBagPanel.InsetsManager insetsManager)
Initializes panel with a given insets manager

Method Detail

add

public void add(Component cmp, int gridx, int gridy, int gridwidth, int gridheight, int anchor, int fill, double weightx, double weighty)
This version uses default insets and assumes that components are added in positive cell coordinates. Top inset for components added to the top is 0. Left inset for components added to the left is 0. For compoents at index gridx more than zero and index gridy more than zero, the insets are set to a default value.

Parameters: cmp Component to add to the panel gridx x position of the cell into which component should be added gridy y position of the cell into which component should be added gridwidth width, in cells, of the space occupied by the component in the grid gridheight height, in cells, of the space occupied by the component in the grid anchor placement of the component in its allocated space: WEST, NORTH, SOUTH, NORTHWEST, ... fill out should the component be resized within its space? NONE, BOTH, HORIZONTAL, VERTICAL. weightx what amount of extra horizontal space, if any, should be given to this component? weighty what amount of extra vertical space, if any, should be given to this component?

setLayout

public void setLayout(LayoutManager layout)
This method only takes effect if the LayoutManager is a GridBagLayout
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.