Class/Object

net.sf.jguiraffe.gui.platform.javafx.layout

ContainerWrapper

Related Docs: object ContainerWrapper | package layout

Permalink

class ContainerWrapper extends AnyRef

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ContainerWrapper
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ContainerWrapper(sizeHandler: Option[UnitSizeHandler], paneTransformer: Option[PaneTransformer])

    Permalink

    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.

    sizeHandler

    an optional UnitSizeHandler

    paneTransformer

    an optional function for transforming the resulting pane

    returns

    the new instance

  2. new ContainerWrapper(sizeHandler: Option[UnitSizeHandler] = None, paneTransformer: Option[PaneTransformer] = None, parentWrapper: ⇒ Option[ContainerWrapper] = None)

    Permalink

    sizeHandler

    an optional UnitSizeHandler

    paneTransformer

    an optional function for transforming the resulting pane

    parentWrapper

    an optional parent reference; containers may be organized in a hierarchy; if defined, this points to the parent container

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addComponent(component: AnyRef, constraints: AnyRef): Unit

    Permalink

    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.

    component

    the component to be added

    constraints

    optional constraints

    Annotations
    @throws( classOf[FormBuilderException] )
    Exceptions thrown

    FormBuilderException if an unsupported component is added

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def createContainer(): Pane

    Permalink

    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.

    returns

    a newly created container

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. var font: Option[Font]

    Permalink

    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.

  12. var fontInitializer: Option[TextFontInitializer]

    Permalink

    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.

    Since

    1.3.1

  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def getComponents: List[Node]

    Permalink

    Returns a list with all components stored in this wrapper.

    Returns a list with all components stored in this wrapper.

    returns

    a list with the components in this wrapper

  15. def getContainerFont: Font

    Permalink

    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.

    returns

    the font of this container

  16. def getFontInitializer: TextFontInitializer

    Permalink

    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.

    returns

    a TextFontInitializer for this container

    Since

    1.3.1

  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. def initLayout(percLayout: PercentLayoutBase): Unit

    Permalink

    Initializes the layout for the represented container.

    Initializes the layout for the represented container.

    percLayout

    the layout

  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. val paneTransformer: Option[PaneTransformer]

    Permalink

    an optional function for transforming the resulting pane

  24. lazy val parent: Option[ContainerWrapper]

    Permalink

    An optional reference to the parent container.

  25. val sizeHandler: Option[UnitSizeHandler]

    Permalink

    an optional UnitSizeHandler

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped