Class VideoLayout

  • All Implemented Interfaces:
    LayoutManager

    public class VideoLayout
    extends FitLayout
    Implements the LayoutManager which lays out the local and remote videos in a video Call.
    Author:
    Lyubomir Marinov, Yana Stamcheva
    • Constructor Detail

      • VideoLayout

        public VideoLayout​(boolean conference)
        Creates an instance of VideoLayout by also indicating if this video layout is dedicated to a conference interface.
        Parameters:
        conference - true if the new instance will be dedicated to a conference; otherwise, false
    • Method Detail

      • addLayoutComponent

        public void addLayoutComponent​(String name,
                                       Component comp)
        Adds the given component in this layout on the specified by name position.
        Specified by:
        addLayoutComponent in interface LayoutManager
        Overrides:
        addLayoutComponent in class FitLayout
        Parameters:
        name - the constraint giving the position of the component in this layout
        comp - the component to add
      • areAspectRatiosEqual

        public static boolean areAspectRatiosEqual​(Dimension size,
                                                   int width,
                                                   int height)
        Determines whether the aspect ratio of a specific Dimension is to be considered equal to the aspect ratio of specific width and height.
        Parameters:
        size - the Dimension whose aspect ratio is to be compared to the aspect ratio of width and height
        width - the width which defines in combination with height the aspect ratio to be compared to the aspect ratio of size
        height - the height which defines in combination with width the aspect ratio to be compared to the aspect ratio of size
        Returns:
        true if the aspect ratio of size is to be considered equal to the aspect ratio of width and height; otherwise, false
      • getComponent

        protected Component getComponent​(Container parent)
        Returns the remote video component.
        Overrides:
        getComponent in class FitLayout
        Parameters:
        parent - the Container to retrieve the first Component of
        Returns:
        the remote video component
      • getComponentConstraints

        public Object getComponentConstraints​(Component c)
        Returns the constraints for the given component.
        Parameters:
        c - the component for which constraints we're looking for
        Returns:
        the constraints for the given component
      • getLocal

        public Component getLocal()
        Returns the local video component.
        Returns:
        the local video component
      • getLocalCloseButton

        public Component getLocalCloseButton()
        Returns the local video close button.
        Returns:
        the local video close button
      • layoutContainer

        public void layoutContainer​(Container parent)
        Lays out the specified Container (i.e. the Components it contains) in accord with the logic implemented by this LayoutManager.
        Specified by:
        layoutContainer in interface LayoutManager
        Overrides:
        layoutContainer in class FitLayout
        Parameters:
        parent - the Container to lay out
      • preferredLayoutSize

        public Dimension preferredLayoutSize​(Container parent)
        Returns the preferred layout size for the given container.
        Specified by:
        preferredLayoutSize in interface LayoutManager
        Overrides:
        preferredLayoutSize in class FitLayout
        Parameters:
        parent - the container which preferred layout size we're looking for
        Returns:
        a Dimension containing, the preferred layout size for the given container