Package org.jitsi.util.swing
Class VideoLayout
- java.lang.Object
-
- org.jitsi.util.swing.FitLayout
-
- org.jitsi.util.swing.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
-
-
Field Summary
Fields Modifier and Type Field Description static StringCANVASThe video canvas constraint.static StringCENTER_REMOTEThe center remote video constraint.static StringCLOSE_LOCAL_BUTTONThe close local video constraint.static StringEAST_REMOTEThe east remote video constraint.static StringLOCALThe local video constraint.-
Fields inherited from class org.jitsi.util.swing.FitLayout
DEFAULT_HEIGHT_OR_WIDTH
-
-
Constructor Summary
Constructors Constructor Description VideoLayout(boolean conference)Creates an instance of VideoLayout by also indicating if this video layout is dedicated to a conference interface.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLayoutComponent(String name, Component comp)Adds the given component in this layout on the specified by name position.static booleanareAspectRatiosEqual(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.protected ComponentgetComponent(Container parent)Returns the remote video component.ObjectgetComponentConstraints(Component c)Returns the constraints for the given component.ComponentgetLocal()Returns the local video component.ComponentgetLocalCloseButton()Returns the local video close button.voidlayoutContainer(Container parent)Lays out the specified Container (i.e.DimensionpreferredLayoutSize(Container parent)Returns the preferred layout size for the given container.voidremoveLayoutComponent(Component comp)Removes the given component from this layout.-
Methods inherited from class org.jitsi.util.swing.FitLayout
layoutComponent, layoutContainer, minimumLayoutSize
-
-
-
-
Field Detail
-
CANVAS
public static final String CANVAS
The video canvas constraint.- See Also:
- Constant Field Values
-
CENTER_REMOTE
public static final String CENTER_REMOTE
The center remote video constraint.- See Also:
- Constant Field Values
-
CLOSE_LOCAL_BUTTON
public static final String CLOSE_LOCAL_BUTTON
The close local video constraint.- See Also:
- Constant Field Values
-
EAST_REMOTE
public static final String EAST_REMOTE
The east remote video constraint.- See Also:
- Constant Field Values
-
LOCAL
public static final String LOCAL
The local video constraint.- See Also:
- Constant Field Values
-
-
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:
addLayoutComponentin interfaceLayoutManager- Overrides:
addLayoutComponentin classFitLayout- Parameters:
name- the constraint giving the position of the component in this layoutcomp- 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 heightwidth- the width which defines in combination with height the aspect ratio to be compared to the aspect ratio of sizeheight- 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:
getComponentin classFitLayout- 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:
layoutContainerin interfaceLayoutManager- Overrides:
layoutContainerin classFitLayout- Parameters:
parent- the Container to lay out
-
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
Returns the preferred layout size for the given container.- Specified by:
preferredLayoutSizein interfaceLayoutManager- Overrides:
preferredLayoutSizein classFitLayout- Parameters:
parent- the container which preferred layout size we're looking for- Returns:
- a Dimension containing, the preferred layout size for the given container
-
removeLayoutComponent
public void removeLayoutComponent(Component comp)
Removes the given component from this layout.- Specified by:
removeLayoutComponentin interfaceLayoutManager- Overrides:
removeLayoutComponentin classFitLayout- Parameters:
comp- the component to remove from the layout
-
-