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 TypeMethodDescriptiondefault Optional<SyComponentReadableType> ancestorMatchingReadable(Predicate<SyComponentReadableType> predicate) Find an ancestor component matching the given predicate.default intA convenience method to return the number of children of this component.default booleanisActive()Components may be active or inactive.default booleanDetermine whether this component is visible or not based on the visibility of its ancestors.com.io7m.jorchard.core.JOTreeNodeReadableType<SyComponentReadableType> 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.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.Methods inherited from interface SyActiveReadableType
activity, isMouseOverMethods inherited from interface SyBoundedReadableType
boundingArea, positionMethods inherited from interface SyKeyboardFocusableReadableType
keyboardFocusBehaviorMethods inherited from interface SyMouseFocusAcceptingReadableType
isMouseQueryAcceptingMethods inherited from interface SySizedReadableType
size, sizeUpperLimitMethods inherited from interface SyThemeableReadableType
themeClassesDefaultForComponent, themeClassesExtra, themeClassesInPreferenceOrderMethods 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:SyVisibleReadableTypeDetermine whether this component is visible or not based on the visibility of its ancestors.- Specified by:
isVisiblein interfaceSyVisibleReadableType- Returns:
trueiff this component is visible
-
isActive
default boolean isActive()Description copied from interface:SyActiveReadableTypeComponents 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:
isActivein interfaceSyActiveReadableType- Returns:
trueiff 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
-