Class SwingContainerWrapper

    • Field Detail

      • DB_CELL_OUTLINE

        private static final java.awt.Color DB_CELL_OUTLINE
        Debug color for cell outline.
    • Constructor Detail

      • SwingContainerWrapper

        public SwingContainerWrapper​(java.awt.Container c)
    • Method Detail

      • getComponents

        public ComponentWrapper[] getComponents()
        Description copied from interface: ContainerWrapper
        Returns the components of the container that wrapper is wrapping.
        Specified by:
        getComponents in interface ContainerWrapper
        Returns:
        The components of the container that wrapper is wrapping. Never null.
      • getComponentCount

        public int getComponentCount()
        Description copied from interface: ContainerWrapper
        Returns the number of components that this parent has.
        Specified by:
        getComponentCount in interface ContainerWrapper
        Returns:
        The number of components that this parent has.
      • getLayout

        public java.lang.Object getLayout()
        Description copied from interface: ContainerWrapper
        Returns the LayoutHandler (in Swing terms) that is handling the layout of this container. If there exist no such class the method should return the same as ComponentWrapper.getComponent(), which is the container itself.
        Specified by:
        getLayout in interface ContainerWrapper
        Returns:
        The layout handler instance. Never null.
      • isLeftToRight

        public final boolean isLeftToRight()
        Description copied from interface: ContainerWrapper
        Returns if this container is using left-to-right component ordering.
        Specified by:
        isLeftToRight in interface ContainerWrapper
        Returns:
        If this container is using left-to-right component ordering.
      • paintDebugCell

        public final void paintDebugCell​(int x,
                                         int y,
                                         int width,
                                         int height)
        Description copied from interface: ContainerWrapper
        Paints a cell to indicate where it is.
        Specified by:
        paintDebugCell in interface ContainerWrapper
        Parameters:
        x - The x coordinate to start the drawing.
        y - The x coordinate to start the drawing.
        width - The width to draw/fill
        height - The height to draw/fill
      • getComponentType

        public int getComponentType​(boolean disregardScrollPane)
        Description copied from interface: ComponentWrapper
        Returns the type of component that this wrapper is wrapping.

        This method can be invoked often so the result should be cached.

        Specified by:
        getComponentType in interface ComponentWrapper
        Overrides:
        getComponentType in class SwingComponentWrapper
        Parameters:
        disregardScrollPane - Is true any wrapping scroll pane should be disregarded and the type of the scrolled component should be returned.
        Returns:
        The type of component that this wrapper is wrapping. E.g. ComponentWrapper.TYPE_LABEL.
      • getLayoutHashCode

        public int getLayoutHashCode()
        Description copied from interface: ComponentWrapper
        Returns a hash code that should be reasonably different for anything that might change the layout. This value is used to know if the component layout needs to clear any caches.
        Specified by:
        getLayoutHashCode in interface ComponentWrapper
        Overrides:
        getLayoutHashCode in class SwingComponentWrapper
        Returns:
        A hash code that should be reasonably different for anything that might change the layout. Returns -1 if the widget is disposed.