WrappedNode
An easy way to build a control which has a single child.
Many Glok controls are final
, so you cannot extend them. This is deliberate for two reasons :
Inheritance breaks encapsulation (google it!)
An API which allow inheritance is fragile, and future versions are much more likely to break old code. (this may be saying the same thing twice).
So, for example, suppose you want a custom ToolBar
. Instead of creating a subclass of ToolBar
, extend WrappedNode, and make inner a ToolBar
.
A WrappedNode has a single child : inner, which is a Node of type N.
Inheritors
Properties
The base class Node has no children, so this is an empty list.
Functions
The default implementation returns NO_MAXIMUM (an arbitrary large number : 100,000).
The default implementation returns NO_MAXIMUM (an arbitrary large number : 100,000).
Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinHeight. The default implementation returns 0.
Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinWidth. The default implementation returns 0.
Each subclass of node can determine its preferred height. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.
Each subclass of node can determine its preferred width. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.