Interface SyComponentType

All Superinterfaces:
SyActiveReadableType, SyActiveType, SyBoundedReadableType<SySpaceParentRelativeType>, SyBoundedType<SySpaceParentRelativeType>, SyComponentReadableType, SyEventReceiverType, SyKeyboardFocusableReadableType, SyKeyboardFocusableType, SyMouseFocusAcceptingReadableType, SyMouseFocusAcceptingType, SySizedReadableType<SySpaceParentRelativeType>, SySizedType<SySpaceParentRelativeType>, SyThemeableReadableType, SyThemeableType, SyVisibleReadableType, SyVisibleType
All Known Subinterfaces:
SyButtonType, SyButtonWithTextType, SyCheckboxType, SyContainerType, SyGridViewType, SyImageViewType, SyListViewType, SyMenuBarItemType, SyMenuBarType, SyMenuItemAtomType, SyMenuItemSeparatorType, SyMenuItemSubmenuType, SyMenuItemType, SyMenuType, SyScrollBarHorizontalType, SyScrollBarType, SyScrollBarVerticalType, SyScrollPaneType, SyTextAreaType, SyTextFieldType, SyTextMultiLineViewType, SyTextViewType

  • Method Details

    • node

      com.io7m.jorchard.core.JOTreeNodeType<SyComponentType> node()
      Returns:
      The tree node for this component
    • window

      Returns:
      The window to which the component is attached, if any
    • layout

      default com.io7m.jregions.core.parameterized.sizes.PAreaSizeI<SySpaceParentRelativeType> layout(SyLayoutContextType layoutContext, SyConstraints constraints)
      Specify a size for this component in response to a set of size constraints. This default implementation simply sets the size of the component to the maximum size allowed by the constraints.
      Parameters:
      layoutContext - The current layout context
      constraints - The size constraints
      Returns:
      A size for this component
    • componentForWindowRelative

      Optional<SyComponentType> componentForWindowRelative(com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceWindowType> windowPosition, SyWindowViewportAccumulatorType context, SyComponentQuery query)
      Find the component under the given window-relative position. The method can return this component if applicable, but should return a child component if one overlaps the given position.
      Parameters:
      windowPosition - The window position
      context - The viewport accumulator
      query - The type of query
      Returns:
      The component, if any
    • childrenClear

      default void childrenClear()
      A convenience function to remove all child components of this component.
    • childAdd

      default void childAdd(SyComponentType component)
      A convenience function to add a component as a child of this component.
      Parameters:
      component - The child component
    • childRemove

      default void childRemove(SyComponentType component)
      A convenience function to remove a component from this component.
      Parameters:
      component - The child component
    • ancestorMatching

      default Optional<SyComponentType> ancestorMatching(Predicate<SyComponentType> predicate)
      Find an ancestor component matching the given predicate.
      Parameters:
      predicate - The predicate
      Returns:
      The ancestor component, if any