fm.liveswitch.LayoutManager< T > Class Template Referenceabstract

A class that supplies simple video frame layout management. More...

Public Member Functions

void addOnLayout (fm.liveswitch.IAction1< fm.liveswitch.Layout > value)
 Adds a handler that is raised when a layout is calculated. More...
 
boolean addRemoteMedia (fm.liveswitch.IViewableMedia< T > remoteMedia)
 Adds remote media to the layout. More...
 
boolean addRemoteView (String idValue, T view)
 Adds a remote view to the layout. More...
 
boolean addRemoteViews (String[] ids, T[] views)
 Adds remote views to the layout. More...
 
fm.liveswitch.LayoutOrigin getLayoutOrigin ()
 Gets the layout origin. More...
 
getLocalView ()
 Gets the local view from the layout. More...
 
getRemoteView (String idValue)
 Gets a remote view from the layout. More...
 
String[] getRemoteViewIds ()
 Gets the IDs of the remote views in the layout. More...
 
java.util.ArrayList< T > getRemoteViews ()
 Gets all remote views from the layout. More...
 
java.util.ArrayList< T > getRemoteViews (String[] ids)
 Gets remote views from the layout. More...
 
abstract void layout ()
 Positions the local and remote views within the layout. More...
 
 LayoutManager ()
 Initializes a new instance of the fm.liveswitch.LayoutManager class. More...
 
 LayoutManager (fm.liveswitch.LayoutPreset preset)
 Initializes a new instance of the fm.liveswitch.LayoutManager class. More...
 
void layoutOnMainThread ()
 Positions the local and remote views within the layout after dispatching to the main thread. More...
 
void removeOnLayout (fm.liveswitch.IAction1< fm.liveswitch.Layout > value)
 Removes a handler that is raised when a layout is calculated. More...
 
boolean removeRemoteMedia (fm.liveswitch.IViewableMedia< T > remoteMedia)
 Removes remote media from the layout. More...
 
boolean removeRemoteView (String idValue)
 Removes a remote view from the layout. More...
 
void removeRemoteViews ()
 Removes all remote views from the layout. More...
 
boolean removeRemoteViews (String[] ids)
 Removes remote views from the layout. More...
 
void reset ()
 Removes all remote views from the layout, then removes the local view from the layout. More...
 
boolean setLocalMedia (fm.liveswitch.IViewableMedia< T > localMedia)
 Adds the local media to the layout. More...
 
boolean setLocalView (T view)
 Adds the local view to the layout. More...
 
boolean swapRemoteMedia (fm.liveswitch.IViewableMedia< T > remoteMediaToRemove, fm.liveswitch.IViewableMedia< T > remoteMediaToAdd)
 Swaps remote media in the layout. More...
 
boolean swapRemoteView (String idToRemove, String idToAdd, T viewToAdd)
 Swaps a remote view in the layout. More...
 
boolean swapRemoteViews (String[] idsToRemove, String[] idsToAdd, T[] viewsToAdd)
 Swaps remote views in the layout. More...
 
boolean unsetLocalView ()
 Removes the local view from the layout. More...
 
- Public Member Functions inherited from fm.liveswitch.LayoutPreset
void applyPreset (fm.liveswitch.LayoutPreset preset)
 Applies a preset. More...
 
fm.liveswitch.Layout calculateLayout (int layoutWidth, int layoutHeight, boolean local, int remoteCount, fm.liveswitch.LayoutOrigin origin, fm.liveswitch.Size localVideoSize, fm.liveswitch.Size[] remoteVideoSizes)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout calculateLayout (int layoutWidth, int layoutHeight, int remoteCount, fm.liveswitch.LayoutOrigin origin)
 Gets a video frame layout. More...
 
void copyToPreset (fm.liveswitch.LayoutPreset preset)
 Copies this preset's properties to another preset. More...
 
fm.liveswitch.LayoutAlignment getAlignment ()
 Gets the alignment of the layout. More...
 
int getBlockHeight ()
 Gets the height of block elements in pixels. More...
 
double getBlockHeightPercent ()
 Gets the height of block elements as a percent of the container height between 0.0 and 1.0. More...
 
int getBlockMarginX ()
 Gets the X-margin between block elements and the layout edge in pixels. More...
 
double getBlockMarginXPercent ()
 Gets the X-margin between block elements and the layout edge as a percent of the container width between 0.0 and 1.0. More...
 
int getBlockMarginY ()
 Gets the Y-margin between block elements and the layout edge in pixels. More...
 
double getBlockMarginYPercent ()
 Gets the Y-margin between block elements and the layout edge as a percent of the container height between 0.0 and 1.0. More...
 
int getBlockWidth ()
 Gets the width of block elements in pixels. More...
 
double getBlockWidthPercent ()
 Gets the width of block elements as a percent of the container width between 0.0 and 1.0. More...
 
fm.liveswitch.LayoutDirection getDirection ()
 Gets the direction of the layout flow. More...
 
int getFloatHeight ()
 Gets the height of floating elements in pixels. More...
 
double getFloatHeightPercent ()
 Gets the height of floating elements as a percent of the container height between 0.0 and 1.0. More...
 
int getFloatMarginX ()
 Gets the X-margin between floating elements and the layout edge in pixels. More...
 
double getFloatMarginXPercent ()
 Gets the X-margin between floating elements and the layout edge as a percent of the container width between 0.0 and 1.0. More...
 
int getFloatMarginY ()
 Gets the Y-margin between floating elements and the layout edge in pixels. More...
 
double getFloatMarginYPercent ()
 Gets the Y-margin between floating elements and the layout edge as a percent of the container height between 0.0 and 1.0. More...
 
int getFloatWidth ()
 Gets the width of floating elements in pixels. More...
 
double getFloatWidthPercent ()
 Gets the width of floating elements as a percent of the container width between 0.0 and 1.0. More...
 
int getInlineMargin ()
 Gets the size of the margin in pixels to use between inline elements. More...
 
fm.liveswitch.LayoutMode getMode ()
 Gets the mode used by the layout engine. More...
 
 LayoutPreset ()
 Initializes a new instance of the fm.liveswitch.LayoutPreset class. More...
 
void setAlignment (fm.liveswitch.LayoutAlignment value)
 Sets the alignment of the layout. More...
 
void setBlockHeight (int value)
 Sets the height of block elements in pixels. More...
 
void setBlockHeightPercent (double value)
 Sets the height of block elements as a percent of the container height between 0.0 and 1.0. More...
 
void setBlockMarginX (int value)
 Sets the X-margin between block elements and the layout edge in pixels. More...
 
void setBlockMarginXPercent (double value)
 Sets the X-margin between block elements and the layout edge as a percent of the container width between 0.0 and 1.0. More...
 
void setBlockMarginY (int value)
 Sets the Y-margin between block elements and the layout edge in pixels. More...
 
void setBlockMarginYPercent (double value)
 Sets the Y-margin between block elements and the layout edge as a percent of the container height between 0.0 and 1.0. More...
 
void setBlockWidth (int value)
 Sets the width of block elements in pixels. More...
 
void setBlockWidthPercent (double value)
 Sets the width of block elements as a percent of the container width between 0.0 and 1.0. More...
 
void setDirection (fm.liveswitch.LayoutDirection value)
 Sets the direction of the layout flow. More...
 
void setFloatHeight (int value)
 Sets the height of floating elements in pixels. More...
 
void setFloatHeightPercent (double value)
 Sets the height of floating elements as a percent of the container height between 0.0 and 1.0. More...
 
void setFloatMarginX (int value)
 Sets the X-margin between floating elements and the layout edge in pixels. More...
 
void setFloatMarginXPercent (double value)
 Sets the X-margin between floating elements and the layout edge as a percent of the container width between 0.0 and 1.0. More...
 
void setFloatMarginY (int value)
 Sets the Y-margin between floating elements and the layout edge in pixels. More...
 
void setFloatMarginYPercent (double value)
 Sets the Y-margin between floating elements and the layout edge as a percent of the container height between 0.0 and 1.0. More...
 
void setFloatWidth (int value)
 Sets the width of floating elements in pixels. More...
 
void setFloatWidthPercent (double value)
 Sets the width of floating elements as a percent of the container width between 0.0 and 1.0. More...
 
void setInlineMargin (int value)
 Sets the size of the margin in pixels to use between inline elements. More...
 
void setMode (fm.liveswitch.LayoutMode value)
 Sets the mode used by the layout engine. More...
 
- Public Member Functions inherited from fm.liveswitch.Dynamic
java.util.HashMap< String, Object > getDynamicProperties ()
 Gets all dynamic properties on this instance. More...
 
Object getDynamicValue (String key)
 Gets a property value from the local cache. More...
 
void setDynamicValue (String key, Object value)
 Sets a property value in the local cache. More...
 
boolean unsetDynamicValue (String key)
 Removes a property value from the local cache. More...
 

Protected Member Functions

abstract void addView (T view)
 Adds a view to the container. More...
 
abstract void dispatchToMainThread (fm.liveswitch.IAction2< Object, Object > action, Object arg1, Object arg2)
 Dispatches an action to the main thread. More...
 
doGetLocalView ()
 Gets the local view. More...
 
java.util.ArrayList< T > doGetRemoteViews (String idValue)
 Gets the remote views for a given remote view ID. More...
 
String[] doGetRemoteViewsIds ()
 Gets the remote view IDs. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, boolean local, int remoteCount)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, boolean local, int remoteCount, String[] remoteViewIds)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, boolean local, int remoteCount, String[] remoteViewIds, fm.liveswitch.Size localVideoSize, fm.liveswitch.Size[] remoteVideoSizes)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, int remoteCount)
 Gets a video frame layout. More...
 
fm.liveswitch.Layout getLayout (int layoutWidth, int layoutHeight, int remoteCount, String[] remoteViewIds)
 Gets a video frame layout. More...
 
abstract void removeView (T view)
 Removes a view from the container. More...
 
void setLayoutOrigin (fm.liveswitch.LayoutOrigin value)
 Sets the layout origin. More...
 
- Protected Member Functions inherited from fm.liveswitch.Dynamic
 Dynamic ()
 
- Protected Member Functions inherited from fm.liveswitch.Serializable
boolean getIsDirty ()
 Gets a value indicating whether this instance is dirty. More...
 
 Serializable ()
 Initializes a new instance of the fm.liveswitch.Serializable class. More...
 
void setIsDirty (boolean value)
 Sets a value indicating whether this instance is dirty. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from fm.liveswitch.LayoutPreset
static fm.liveswitch.LayoutPreset getFacetime ()
 Gets a Facetime-style layout preset. More...
 
static fm.liveswitch.LayoutPreset getGoogleHangouts ()
 Gets a Google Hangouts-style layout preset. More...
 
static fm.liveswitch.LayoutPreset getSkype ()
 Gets a Skype-style layout preset. More...
 

Detailed Description

A class that supplies simple video frame layout management.

Constructor & Destructor Documentation

◆ LayoutManager() [1/2]

Initializes a new instance of the fm.liveswitch.LayoutManager class.

◆ LayoutManager() [2/2]

Initializes a new instance of the fm.liveswitch.LayoutManager class.

Member Function Documentation

◆ addOnLayout()

Adds a handler that is raised when a layout is calculated.

◆ addRemoteMedia()

boolean fm.liveswitch.LayoutManager< T >.addRemoteMedia ( fm.liveswitch.IViewableMedia< T >  remoteMedia)

Adds remote media to the layout.

Parameters
remoteMediaThe remote media.
Returns
true
if successful; otherwise,
false
.

◆ addRemoteView()

boolean fm.liveswitch.LayoutManager< T >.addRemoteView ( String  idValue,
view 
)

Adds a remote view to the layout.

Parameters
idValueThe remote view ID.
viewThe remote view.
Returns
true
if successful; otherwise,
false
. Check the logs for additional information.

◆ addRemoteViews()

boolean fm.liveswitch.LayoutManager< T >.addRemoteViews ( String[]  ids,
T[]  views 
)

Adds remote views to the layout.

Parameters
idsThe remote view IDs.
viewsThe remote views.
Returns
true
if successful; otherwise,
false
. Check the logs for additional information.

◆ addView()

abstract void fm.liveswitch.LayoutManager< T >.addView ( view)
abstractprotected

Adds a view to the container.

Parameters
viewThe view to add.

◆ dispatchToMainThread()

abstract void fm.liveswitch.LayoutManager< T >.dispatchToMainThread ( fm.liveswitch.IAction2< Object, Object >  action,
Object  arg1,
Object  arg2 
)
abstractprotected

Dispatches an action to the main thread.

Parameters
actionThe action to invoke.
arg1The first argument.
arg2The second argument.

◆ doGetLocalView()

T fm.liveswitch.LayoutManager< T >.doGetLocalView ( )
protected

Gets the local view.

Returns
The local view.

◆ doGetRemoteViews()

java.util.ArrayList<T> fm.liveswitch.LayoutManager< T >.doGetRemoteViews ( String  idValue)
protected

Gets the remote views for a given remote view ID.

Parameters
idValueThe remote view ID.
Returns
The remote views.

◆ doGetRemoteViewsIds()

String [] fm.liveswitch.LayoutManager< T >.doGetRemoteViewsIds ( )
protected

Gets the remote view IDs.

Returns
The remote view IDs.

◆ getLayout() [1/5]

fm.liveswitch.Layout fm.liveswitch.LayoutManager< T >.getLayout ( int  layoutWidth,
int  layoutHeight,
boolean  local,
int  remoteCount 
)
protected

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
localWhether a local frame is needed.
remoteCountThe number of remote frames.
Returns
The video frame layout.

◆ getLayout() [2/5]

fm.liveswitch.Layout fm.liveswitch.LayoutManager< T >.getLayout ( int  layoutWidth,
int  layoutHeight,
boolean  local,
int  remoteCount,
String[]  remoteViewIds 
)
protected

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
localWhether a local frame is needed.
remoteCountThe number of remote frames.
remoteViewIdsThe remote view IDs.
Returns
The video frame layout.

◆ getLayout() [3/5]

fm.liveswitch.Layout fm.liveswitch.LayoutManager< T >.getLayout ( int  layoutWidth,
int  layoutHeight,
boolean  local,
int  remoteCount,
String[]  remoteViewIds,
fm.liveswitch.Size  localVideoSize,
fm.liveswitch.Size[]  remoteVideoSizes 
)
protected

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
localWhether a local frame is needed.
remoteCountThe number of remote frames.
remoteViewIdsThe remote view IDs.
localVideoSizeThe local video size.
remoteVideoSizesThe remote video sizes.
Returns
The video frame layout.

◆ getLayout() [4/5]

fm.liveswitch.Layout fm.liveswitch.LayoutManager< T >.getLayout ( int  layoutWidth,
int  layoutHeight,
int  remoteCount 
)
protected

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
remoteCountThe number of remote frames.
Returns
The video frame layout.

◆ getLayout() [5/5]

fm.liveswitch.Layout fm.liveswitch.LayoutManager< T >.getLayout ( int  layoutWidth,
int  layoutHeight,
int  remoteCount,
String[]  remoteViewIds 
)
protected

Gets a video frame layout.

Parameters
layoutWidthThe total width of the layout.
layoutHeightThe total height of the layout.
remoteCountThe number of remote frames.
remoteViewIdsThe remote view IDs.
Returns
The video frame layout.

◆ getLayoutOrigin()

Gets the layout origin.

Defaults to TopLeft.

◆ getLocalView()

T fm.liveswitch.LayoutManager< T >.getLocalView ( )

Gets the local view from the layout.

Returns
The local view.

◆ getRemoteView()

T fm.liveswitch.LayoutManager< T >.getRemoteView ( String  idValue)

Gets a remote view from the layout.

Parameters
idValueThe remote view ID.
Returns
The remote view.

◆ getRemoteViewIds()

String [] fm.liveswitch.LayoutManager< T >.getRemoteViewIds ( )

Gets the IDs of the remote views in the layout.

Returns
The remote view IDs.

◆ getRemoteViews() [1/2]

java.util.ArrayList<T> fm.liveswitch.LayoutManager< T >.getRemoteViews ( )

Gets all remote views from the layout.

Returns
The remote views.

◆ getRemoteViews() [2/2]

java.util.ArrayList<T> fm.liveswitch.LayoutManager< T >.getRemoteViews ( String[]  ids)

Gets remote views from the layout.

Parameters
idsThe remote view IDs.
Returns
The remote views.

◆ layout()

abstract void fm.liveswitch.LayoutManager< T >.layout ( )
abstract

Positions the local and remote views within the layout.

◆ layoutOnMainThread()

void fm.liveswitch.LayoutManager< T >.layoutOnMainThread ( )

Positions the local and remote views within the layout after dispatching to the main thread.

◆ removeOnLayout()

Removes a handler that is raised when a layout is calculated.

◆ removeRemoteMedia()

boolean fm.liveswitch.LayoutManager< T >.removeRemoteMedia ( fm.liveswitch.IViewableMedia< T >  remoteMedia)

Removes remote media from the layout.

Parameters
remoteMediaThe remote media.
Returns
true
if successful; otherwise,
false
.

◆ removeRemoteView()

boolean fm.liveswitch.LayoutManager< T >.removeRemoteView ( String  idValue)

Removes a remote view from the layout.

Parameters
idValueThe remote view ID.
Returns
true
if successful; otherwise,
false
. Check the logs for additional information.

◆ removeRemoteViews() [1/2]

void fm.liveswitch.LayoutManager< T >.removeRemoteViews ( )

Removes all remote views from the layout.

◆ removeRemoteViews() [2/2]

boolean fm.liveswitch.LayoutManager< T >.removeRemoteViews ( String[]  ids)

Removes remote views from the layout.

Parameters
idsThe remote view IDs.
Returns
true
if successful; otherwise,
false
. Check the logs for additional information.

◆ removeView()

abstract void fm.liveswitch.LayoutManager< T >.removeView ( view)
abstractprotected

Removes a view from the container.

Parameters
viewThe view to remove.

◆ reset()

void fm.liveswitch.LayoutManager< T >.reset ( )

Removes all remote views from the layout, then removes the local view from the layout.

◆ setLayoutOrigin()

void fm.liveswitch.LayoutManager< T >.setLayoutOrigin ( fm.liveswitch.LayoutOrigin  value)
protected

Sets the layout origin.

Defaults to TopLeft.

◆ setLocalMedia()

boolean fm.liveswitch.LayoutManager< T >.setLocalMedia ( fm.liveswitch.IViewableMedia< T >  localMedia)

Adds the local media to the layout.

Parameters
localMediaThe local media.
Returns
true
if successful; otherwise,
false
.

◆ setLocalView()

boolean fm.liveswitch.LayoutManager< T >.setLocalView ( view)

Adds the local view to the layout.

Parameters
viewThe local view.
Returns
true
if successful; otherwise,
false
. Check the logs for additional information.

◆ swapRemoteMedia()

boolean fm.liveswitch.LayoutManager< T >.swapRemoteMedia ( fm.liveswitch.IViewableMedia< T >  remoteMediaToRemove,
fm.liveswitch.IViewableMedia< T >  remoteMediaToAdd 
)

Swaps remote media in the layout.

Parameters
remoteMediaToRemoveThe remote media to remove.
remoteMediaToAddThe remote media to add.

◆ swapRemoteView()

boolean fm.liveswitch.LayoutManager< T >.swapRemoteView ( String  idToRemove,
String  idToAdd,
viewToAdd 
)

Swaps a remote view in the layout.

Parameters
idToRemoveThe remote view ID to remove.
idToAddThe remote view ID to add.
viewToAddThe remote view to add.

◆ swapRemoteViews()

boolean fm.liveswitch.LayoutManager< T >.swapRemoteViews ( String[]  idsToRemove,
String[]  idsToAdd,
T[]  viewsToAdd 
)

Swaps remote views in the layout.

Parameters
idsToRemoveThe remote view IDs to remove.
idsToAddThe remote view IDs to add.
viewsToAddThe remote views to add.
Returns
true
if successful; otherwise,
false
. Check the logs for additional information.

◆ unsetLocalView()

boolean fm.liveswitch.LayoutManager< T >.unsetLocalView ( )

Removes the local view from the layout.

Returns
true
if successful; otherwise,
false
. Check the logs for additional information.