Package com.nnamo.view.customcomponents
Class CustomGbc
java.lang.Object
java.awt.GridBagConstraints
com.nnamo.view.customcomponents.CustomGbc
- All Implemented Interfaces:
Serializable
,Cloneable
Custom
GridBagConstraints
class that provides a more manageable way to set the properties of a GridBagConstraints
object.
This class allows you to chain method calls to set the properties of the GridBagConstraints
object, making it easier to read and maintain, with a simil Builder Pattern.
- Author:
- Riccardo Finocchiaro
- See Also:
-
Field Summary
Fields inherited from class java.awt.GridBagConstraints
ABOVE_BASELINE, ABOVE_BASELINE_LEADING, ABOVE_BASELINE_TRAILING, anchor, BASELINE, BASELINE_LEADING, BASELINE_TRAILING, BELOW_BASELINE, BELOW_BASELINE_LEADING, BELOW_BASELINE_TRAILING, BOTH, CENTER, EAST, fill, FIRST_LINE_END, FIRST_LINE_START, gridheight, gridwidth, gridx, gridy, HORIZONTAL, insets, ipadx, ipady, LAST_LINE_END, LAST_LINE_START, LINE_END, LINE_START, NONE, NORTH, NORTHEAST, NORTHWEST, PAGE_END, PAGE_START, RELATIVE, REMAINDER, SOUTH, SOUTHEAST, SOUTHWEST, VERTICAL, weightx, weighty, WEST
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetAnchor
(int anchor) set the anchor of theGridBagConstraints
object.setFill
(int fill) set the fill of theGridBagConstraints
object.setHeight
(int height) set the height of theGridBagConstraints
object.setInsets
(int top, int left, int bottom, int right) set the insets of theGridBagConstraints
object.setIpad
(int ipadx, int ipady) set the ipad of theGridBagConstraints
object.setPosition
(int x, int y) set the position of theGridBagConstraints
object.setWeight
(double weightX, double weightY) set the weight of theGridBagConstraints
object.setWidth
(int width) set the width of theGridBagConstraints
object.Methods inherited from class java.awt.GridBagConstraints
clone
-
Constructor Details
-
CustomGbc
public CustomGbc()
-
-
Method Details
-
setAnchor
set the anchor of theGridBagConstraints
object.- Parameters:
anchor
- the anchor value to set- Returns:
- CustomGbc
- See Also:
-
setFill
set the fill of theGridBagConstraints
object.- Parameters:
fill
- the fill value to set- Returns:
- CustomGbc
- See Also:
-
setHeight
set the height of theGridBagConstraints
object.- Parameters:
height
- the height value to set- Returns:
- CustomGbc
- See Also:
-
setWidth
set the width of theGridBagConstraints
object.- Parameters:
width
- the width value to set- Returns:
- CustomGbc
- See Also:
-
setPosition
set the position of theGridBagConstraints
object.- Parameters:
x
- the x value to sety
- the y value to set- Returns:
- CustomGbc
- See Also:
-
setInsets
set the insets of theGridBagConstraints
object.- Parameters:
top
- the top inset valueleft
- the left inset valuebottom
- the bottom inset valueright
- the right inset value- Returns:
- CustomGbc
- See Also:
-
setIpad
set the ipad of theGridBagConstraints
object.- Parameters:
ipadx
- the horizontal internal paddingipady
- the vertical internal padding- Returns:
- CustomGbc
- See Also:
-
setWeight
set the weight of theGridBagConstraints
object.- Parameters:
weightX
- the weight in the x directionweightY
- the weight in the y direction- Returns:
- CustomGbc
- See Also:
-