Decoratable
A component that paints through the decoration its modifier declares: what every decoration modifier and every DecorationModifierNode target.
The library writes decoration; the component stores it and applies it, as it applies its Border:
paintanswersdecoration.paint(this, g) { super.paint(it) };paintBorderpaints the border at Decoration.localLayoutBounds;both
getInsetsoverloads answer through Decoration.insets;containsanswers Decoration.contains;isOpaqueanswerssuper.isOpaque() && decoration.isOpaque(this), and the component paints its background inside Decoration.localLayoutBounds wheresuper.isOpaque();repaint(long, int, int, int, int)answersdecoration.repaint(this, tm, x, y, width, height);paintImmediately(int, int, int, int)answersdecoration.paintImmediately(this, x, y, w, h) { x, y, w, h -> super.paintImmediately(x, y, w, h) };a component with children also answers
isPaintingOriginwith Decoration.isDecorated, asJLayerdoes, so a repaint a child records is painted through its decoration.
Its size getters answer as for any Swing component: a size worked out from its content includes getInsets(), and a set size answers as set. A Foundation container gives it all its paint outsets. Any other parent gives it only the part of its decoration its PaintOutsets value leaves in layout, none by default, and clips the rest at its bounds.
Properties
The decoration this component paints through; Decoration.None until the library writes one.
Functions
Gathers the decoration the nodes declare and writes it to decoration. Not to be overridden.