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 TypeMethodDescriptiondefault Optional<SyComponentType> ancestorMatching(Predicate<SyComponentType> predicate) Find an ancestor component matching the given predicate.default voidchildAdd(SyComponentType component) A convenience function to add a component as a child of this component.default voidchildRemove(SyComponentType component) A convenience function to remove a component from this component.default voidA convenience function to remove all child components of this component.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()window()Methods inherited from interface SyActiveReadableType
isMouseOverMethods inherited from interface SyActiveType
activity, setActiveMethods inherited from interface SyBoundedReadableType
boundingAreaMethods inherited from interface SyBoundedType
position, setPositionMethods inherited from interface SyComponentReadableType
ancestorMatchingReadable, childCount, isActive, isVisible, nodeReadable, relativePositionOf, screen, viewportPositionOf, windowReadableMethods inherited from interface SyEventReceiverType
eventSendMethods inherited from interface SyKeyboardFocusableType
keyboardFocusBehaviorMethods inherited from interface SyMouseFocusAcceptingReadableType
isMouseQueryAcceptingMethods inherited from interface SyMouseFocusAcceptingType
setMouseQueryAcceptingMethods inherited from interface SySizedType
setSize, setSizeUpperLimit, size, sizeUpperLimitMethods inherited from interface SyThemeableReadableType
themeClassesDefaultForComponent, themeClassesExtra, themeClassesInPreferenceOrderMethods 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 contextconstraints- 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 positioncontext- The viewport accumulatorquery- 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
A convenience function to add a component as a child of this component.- Parameters:
component- The child component
-
childRemove
A convenience function to remove a component from this component.- Parameters:
component- The child component
-
ancestorMatching
Find an ancestor component matching the given predicate.- Parameters:
predicate- The predicate- Returns:
- The ancestor component, if any
-