# Interface SyComponentReadableType

All Superinterfaces:
  `SyActiveReadableType, SyBoundedReadableType<SySpaceParentRelativeType>, SyKeyboardFocusableReadableType, SyMouseFocusAcceptingReadableType, SySizedReadableType<SySpaceParentRelativeType>, SyThemeableReadableType, SyVisibleReadableType`

All Known Subinterfaces:
  `SyButtonReadableType, SyButtonType, SyButtonWithTextReadableType, SyButtonWithTextType, SyCheckboxReadableType, SyCheckboxType, SyComponentType, SyContainerReadableType, SyContainerType, SyGridViewReadableType, SyGridViewType, SyImageViewReadableType, SyImageViewType, SyListViewReadableType, SyListViewType, SyMenuBarItemType, SyMenuBarReadableType, SyMenuBarType, SyMenuItemAtomType, SyMenuItemSeparatorType, SyMenuItemSubmenuType, SyMenuItemType, SyMenuReadableType, SyMenuType, SyMeterReadableType, SyScrollBarHorizontalReadableType, SyScrollBarHorizontalType, SyScrollBarReadableType, SyScrollBarType, SyScrollBarVerticalReadableType, SyScrollBarVerticalType, SyScrollPaneReadableType, SyScrollPaneType, SyTextAreaReadableType, SyTextAreaType, SyTextFieldReadableType, SyTextFieldType, SyTextMultiLineViewReadableType, SyTextMultiLineViewType, SyTextViewReadableType, SyTextViewType`

public interface SyComponentReadableType extends SyActiveReadableType, SyVisibleReadableType, SyKeyboardFocusableReadableType, SyMouseFocusAcceptingReadableType, SyBoundedReadableType<SySpaceParentRelativeType>, SyThemeableReadableType
The type of readable components.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default Optional<SyComponentReadableType>`
  `ancestorMatchingReadable(Predicate<SyComponentReadableType> predicate)`
  Find an ancestor component matching the given predicate.
  `default int`
  `childCount()`
  A convenience method to return the number of children of this component.
  `default boolean`
  `isActive()`
  Components may be active or inactive.
  `default boolean`
  `isVisible()`
  Determine whether this component is visible or not based on the visibility of its ancestors.
  `com.io7m.jorchard.core.JOTreeNodeReadableType<SyComponentReadableType>`
  `nodeReadable()`
  `default com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceParentRelativeType>`
  `relativePositionOf(com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceViewportType> position)`
  Determine the parent-relative position of the given viewport position for component.
  `SyScreenType`
  `screen()`
  `default com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceViewportType>`
  `viewportPositionOf(com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceParentRelativeType> position)`
  Determine the viewport position of the given parent-relative position relative to this component.
  `Optional<SyWindowReadableType>`
  `windowReadable()`

  ### Methods inherited from interface SyActiveReadableType

  `activity, isMouseOver`

  ### Methods inherited from interface SyBoundedReadableType

  `boundingArea, position`

  ### Methods inherited from interface SyKeyboardFocusableReadableType

  `keyboardFocusBehavior`

  ### Methods inherited from interface SyMouseFocusAcceptingReadableType

  `isMouseQueryAccepting`

  ### Methods inherited from interface SySizedReadableType

  `size, sizeUpperLimit`

  ### Methods inherited from interface SyThemeableReadableType

  `themeClassesDefaultForComponent, themeClassesExtra, themeClassesInPreferenceOrder`

  ### Methods inherited from interface SyVisibleReadableType

  `visibility`

- ## Method Details

  - ### screen

    SyScreenType screen()
    Returns:
      The screen that owns the component

  - ### windowReadable

    Optional<SyWindowReadableType> windowReadable()
    Returns:
      The window to which this component belongs

  - ### nodeReadable

    com.io7m.jorchard.core.JOTreeNodeReadableType<SyComponentReadableType> nodeReadable()
    Returns:
      The tree node for this component

  - ### isVisible

    default boolean isVisible()
    Description copied from interface: `SyVisibleReadableType`
    Determine whether this component is visible or not based on the visibility of its ancestors.
    Specified by:
      `isVisible` in interface `SyVisibleReadableType`
    Returns:
      `true` iff this component is visible

  - ### isActive

    default boolean isActive()
    Description copied from interface: `SyActiveReadableType`
    Components may be active or inactive. A component that is inactive will not receive input events, and will typically be rendered as "greyed" out by renderers.
    Specified by:
      `isActive` in interface `SyActiveReadableType`
    Returns:
      `true` iff this component is active

  - ### childCount

    default int childCount()
    A convenience method to return the number of children of this component.
    Returns:
      The number of children

  - ### ancestorMatchingReadable

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

  - ### viewportPositionOf

    default com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceViewportType> viewportPositionOf(com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceParentRelativeType> position)
    Determine the viewport position of the given parent-relative position relative to this component. The method will fail if this component is not attached to a window.
    Parameters:
      `position` - The source position
    Returns:
      The viewport position

  - ### relativePositionOf

    default com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceParentRelativeType> relativePositionOf(com.io7m.jtensors.core.parameterized.vectors.PVector2I<SySpaceViewportType> position)
    Determine the parent-relative position of the given viewport position for component. The method will fail if this component is not attached to a window.
    Parameters:
      `position` - The source position
    Returns:
      The viewport position