net.sf.jguiraffe.gui.platform.javafx.layout
Creates a new instance of ContainerWrapper with a size handler and a pane transformer.
Creates a new instance of ContainerWrapper with a size handler and a pane transformer. This constructor mainly exists for reasons of backwards compatibility.
an optional UnitSizeHandler
an optional function for transforming the resulting pane
the new instance
an optional UnitSizeHandler
an optional function for transforming the resulting pane
an optional parent reference; containers may be organized in a hierarchy; if defined, this points to the parent container
Adds the specified component to the container represented by this class.
Adds the specified component to the container represented by this class. An optional constraints object can be provided which is evaluated by the container's layout object. This method expects the component to be either a Node or another ContainerWrapper. In the latter case, the wrapper's container is requested and added to the children of this container.
the component to be added
optional constraints
FormBuilderException
if an unsupported component is added
Creates the Java FX container described by this wrapper object.
Creates the Java FX container described by this wrapper object. This method is called after the container has been initialized with its children and an optional layout object. Based on the layout, an appropriate sub class of Pane is returned.
a newly created container
Stores an optional font of this container.
Stores an optional font of this container. If defined, this font is used for size calculations. Note: This field mainly exists for backwards compatibility reasons.
An optional font initializer.
An optional font initializer. This field is typically set during the build process with a function that can apply the current font for this container.
1.3.1
Returns a list with all components stored in this wrapper.
Returns a list with all components stored in this wrapper.
a list with the components in this wrapper
Returns the Font for this container.
Returns the Font for this container. If a font has been set, it is returned. Otherwise, result is the default system font.
the font of this container
Returns a TextFontInitializer for this container.
Returns a TextFontInitializer for this container. This is used to obtain information (typically size information) about the font used by this container. If a TextFontInitializer has been assigned explicitly, it is returned. Otherwise, if a font has been set, an initializer for this font is returned. If this is not the case and a parent wrapper exists, the initializer is queried from this parent. As a last resource, an initializer for the default font is returned.
a TextFontInitializer for this container
1.3.1
Initializes the layout for the represented container.
Initializes the layout for the represented container.
the layout
an optional function for transforming the resulting pane
An optional reference to the parent container.
an optional UnitSizeHandler
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.