A helper class which manages panels as containers for other components.
The Java FX-based implementation of the PercentLayoutPlatformAdapter interface.
The Java FX-based implementation of the PercentLayoutPlatformAdapter interface.
This implementation operates on Java FX nodes and provides methods for querying their sizes and setting their bounds.
The Java FX-based implementation of the UnitSizeHandler interface.
The Java FX-based implementation of the UnitSizeHandler interface.
This class implements functionality for detecting screen properties and calculating font sizes based on the Java FX library. Unfortunately, some of these calculations are not trivial; especially, there is no easy way to determine the width and height of a text string. The workaround applied here makes use of Java FX components which are configured and layouted to obtain their size. This has to happen in the Java FX thread, so threading issues have to be taken into account.
Because the calculation of font sizes can be expensive, a cache is maintained which is shared by all instances. Access to the cache is protected so this class can be called from different threads. (This is required because size calculations will also have to take place in background threads executing builder scripts.)
A specialized Java FX Pane implementation which uses a percent layout to layout its children.
A specialized Java FX Pane implementation which uses a percent layout to layout its children.
This class implements typical layout methods of a Java FX pane in a way that the passed in PercentLayoutBase object is used to calculate component sizes and perform the layout.
The companion object for ContainerWrapper.
The companion object of JavaFxUnitSizeHandler.
The companion object of JavaFxUnitSizeHandler. This object maintains a shared cache with font sizes.
A helper class which manages panels as containers for other components.
The Java FX approach to layouts is a bit different from the model used by JGUIraffe: no layout objects are used, but there are special panel implementations providing specific layouting facilities. Therefore, based on the desired layout object, a specific panel class has to be created. This makes the creation of panels a bit more complex.
This class is used throughout the builder process to represent all panels (including root containers in windows). It is responsible for keeping track of the child components added to a panel and for eventually creating the correct panel implementation. It also stores some properties of a container which are not directly supported by Java FX, e.g. a font. (The semantic meaning of these properties is that they are set for all children of the container unless they are overridden there.)
The component manager makes use of this class in the implementation of its addContainerComponent() method and for creating panels and layout objects.
When creating panels with percent layout a UnitSizeHandler is required. Such an object can be passed to the constructor. (This is useful if the caller has access to a shared UnitSizeHandler instance.) If no size handler is provided, a new default instance is created if necessary.
Sometimes some additional decorations have to be added to a pane, or the pane has to be wrapped inside another container. This can be achieved by passing a transformer function to the constructor. When creating the represented pane this function is called with the object created by this ContainerWrapper; the function can then perform an arbitrary transformation.
Note: This class is not thread-safe. However, for the default usage scenario - creating and initializing an instance by a builder in a background thread and then using it in the Java FX thread - this should not be a problem.