# 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`

public interface SyComponentType extends SyComponentReadableType, SyVisibleType, SyActiveType, SyEventReceiverType, SyKeyboardFocusableType, SyMouseFocusAcceptingType, SyBoundedType<SySpaceParentRelativeType>, SyThemeableType
The type of components.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default Optional<SyComponentType>`
  `ancestorMatching(Predicate<SyComponentType> predicate)`
  Find an ancestor component matching the given predicate.
  `default void`
  `childAdd(SyComponentType component)`
  A convenience function to add a component as a child of this component.
  `default void`
  `childRemove(SyComponentType component)`
  A convenience function to remove a component from this component.
  `default void`
  `childrenClear()`
  A convenience function to remove all child components of this component.
  `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.
  `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.
  `com.io7m.jorchard.core.JOTreeNodeType<SyComponentType>`
  `node()`
  `Optional<SyWindowType>`
  `window()`

  ### Methods inherited from interface SyActiveReadableType

  `isMouseOver`

  ### Methods inherited from interface SyActiveType

  `activity, setActive`

  ### Methods inherited from interface SyBoundedReadableType

  `boundingArea`

  ### Methods inherited from interface SyBoundedType

  `position, setPosition`

  ### Methods inherited from interface SyComponentReadableType

  `ancestorMatchingReadable, childCount, isActive, isVisible, nodeReadable, relativePositionOf, screen, viewportPositionOf, windowReadable`

  ### Methods inherited from interface SyEventReceiverType

  `eventSend`

  ### Methods inherited from interface SyKeyboardFocusableType

  `keyboardFocusBehavior`

  ### Methods inherited from interface SyMouseFocusAcceptingReadableType

  `isMouseQueryAccepting`

  ### Methods inherited from interface SyMouseFocusAcceptingType

  `setMouseQueryAccepting`

  ### Methods inherited from interface SySizedType

  `setSize, setSizeUpperLimit, size, sizeUpperLimit`

  ### Methods inherited from interface SyThemeableReadableType

  `themeClassesDefaultForComponent, themeClassesExtra, themeClassesInPreferenceOrder`

  ### Methods inherited from interface SyVisibleType

  `setVisible, visibility`

- ## Method Details

  - ### node

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

  - ### window

    Optional<SyWindowType> 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