Interface Insetter
-
public interface InsetterAn insetter defines the relationship between the bounds of a component and the bounds of a region of the component. For example, a combo box could have an insetter relating the combo box bounds to the bounds of the text field. It could have a different insetter relating the combo box bounds to the bounds of the combo box button.
An insetter is a generalization of AWT insets, which define a simple mapping between component (outer) bounds and region (inner) bounds by adding or removing fixed amounts to or from each side.
Unlike AWT insets, which only support fixed inset values, an insetter can support (inner) regions whose dimensions are fixed along one or both axes. For example, the button portion of a combo box probably has a fixed width, regardless of the width of the combo box. An insetter can represent this relationship by calculating the button region from the combo box bounds.
Some, but not all insetters are invertible, which means that given the size of the (inner) region, the insetter can determine the size of the (outer) component. For example, an insetter for the text field region of a combo box probably can compute the size of the combo box given the size of the text field. This operation could be used to compute the preferred size of the combo box based on the expected text. In contrast, knowing the size of the combo box button would not be enough to determine the size of the entire combo box.
Insets with fixed values, such as AWT insets, are trivially invertible. Other invertible insetters are possible in theory, but unlikely in practice.