Package org.esa.snap.ui
Class GridBagUtils
java.lang.Object
org.esa.snap.ui.GridBagUtils
A utility class providing helper methods for
JPanel
s with a GridBagLayout
layout manager.- Version:
- $Revision$ $Date$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addHorizontalFiller
(JPanel panel, GridBagConstraints gbc) static void
addToPanel
(JPanel panel, Component comp, GridBagConstraints gbc) Adds a component to a panel with a grid bag layout.static void
addToPanel
(JPanel panel, Component comp, GridBagConstraints gbc, String code) Adds a component to a panel with a grid bag layout.static void
addVerticalFiller
(JPanel panel, GridBagConstraints gbc) static GridBagConstraints
createConstraints
(String code) Creates aGridBagConstraints
instance with the attributes given as a comma separated key-value pairs in a text string.static GridBagConstraints
Creates aGridBagConstraints
instance with the following attributes:anchor
=WESTinsets.top
=0insets.left
=3insets.bottom
=0insets.right
=3static JPanel
static JPanel
static GridBagConstraints
setAttributes
(GridBagConstraints gbc, String code) Sets the attributes of a givenGridBagConstraints
instance to the attribute values given as a comma separated key-value pairs in a text string.
-
Constructor Details
-
GridBagUtils
public GridBagUtils()
-
-
Method Details
-
createPanel
-
createDefaultEmptyBorderPanel
-
createConstraints
Creates aGridBagConstraints
instance with the attributes given as a comma separated key-value pairs in a text string.According to the public
GridBagConstraints
attributes, the following key-value pairs are can occur in the text string:gridx
=RELATIVE|integergridy
=RELATIVE|integergridwidth
=REMAINDER|RELATIVE|integergridheight
=REMAINDER|RELATIVE|integerweightx
=doubleweighty
=doubleanchor
=CENTER|NORTH|NORTHEAST|EAST|SOUTHEAST|SOUTH|SOUTHWEST|WEST|NORTHWEST|integerfill
=NONE|HORIZONTAL|VERTICAL|BOTH|integerinsets.bottom
=integerinsets.left
=integerinsets.right
=integerinsets.top
=integeripadx
=integeripady
=integer
- Parameters:
code
- a textual representation of the attributes to be set
-
createDefaultConstraints
Creates aGridBagConstraints
instance with the following attributes:anchor
=WESTinsets.top
=0insets.left
=3insets.bottom
=0insets.right
=3
-
addToPanel
Adds a component to a panel with a grid bag layout.- Parameters:
panel
- the panel to which to add the componentcomp
- the component to be addedgbc
- the grid bag constraints to be used, can benull
ifcode
is notnull
-
addToPanel
Adds a component to a panel with a grid bag layout.For the
code
parameter, see alsosetAttributes(GridBagConstraints, String)
.- Parameters:
panel
- the panel to which to add the componentcomp
- the component to be addedgbc
- the grid bag constraints to be used, can benull
ifcode
is notnull
code
- the code containing the constraints, can benull
ifgbc
is notnull
- See Also:
-
addHorizontalFiller
-
addVerticalFiller
-
setAttributes
Sets the attributes of a givenGridBagConstraints
instance to the attribute values given as a comma separated key-value pairs in a text string.According to the public
GridBagConstraints
attributes, the following key-value pairs are can occur in the text string:gridx
=RELATIVE|integergridy
=RELATIVE|integergridwidth
=REMAINDER|RELATIVE|integergridheight
=REMAINDER|RELATIVE|integerweightx
=doubleweighty
=doubleanchor
=CENTER|NORTH|NORTHEAST|EAST|SOUTHEAST|SOUTH|SOUTHWEST|WEST|NORTHWEST|integerfill
=NONE|HORIZONTAL|VERTICAL|BOTH|integerinsets.bottom
=integerinsets.left
=integerinsets.right
=integerinsets.top
=integeripadx
=integeripady
=integer
- Parameters:
gbc
- the grid bag constraints whose attributes are to be set, must not be nullcode
- a textual representation of the attributes to be set
-