ImFusion Web SDK

DisplayAutoLayouter

This class facilitates the layouting of Views inside a Display by encapsulating logic to generate layouts for dynamic view configurations based on a customizable set of layouting algorithms.

Extends

Methods

MethodDescription
setLayoutMode()Sets the current view layout mode.
currentMode()Returns the current view layout mode.
setMaximizedView()Sets an optional view that should be shown alone in a maximized fashion.
isViewHidden()Returns whether view should be hidden in the generated DisplayLayout.
setViewHidden()Sets whether view should be hidden in the generated DisplayLayout.
onModeChanged()Fires when the layout mode changes.
onViewHiddenChanged()Fires when a view's hidden state changes.

Inherited from ClassHandle

MethodDescription
isAliasOf()Returns true if this handle and other alias the same underlying C++ object.
delete()Releases this JavaScript handle.
deleteLater()Schedules this handle for deferred deletion and returns this handle.
isDeleted()Returns true if this handle has already been deleted.
[dispose]()Releases this handle when the enclosing scope exits, so a handle can be declared with using instead of calling delete() later manually.
clone()Returns a new JavaScript handle aliasing the same underlying C++ object.

setLayoutMode()

ts
setLayoutMode(mode: DisplayLayoutMode): void;

Sets the current view layout mode.

Parameters

ParameterType
modeDisplayLayoutMode

Returns

void


currentMode()

ts
currentMode(): DisplayLayoutMode;

Returns the current view layout mode.

Returns

DisplayLayoutMode


setMaximizedView()

ts
setMaximizedView(view: View | null): void;

Sets an optional view that should be shown alone in a maximized fashion.

Parameters

ParameterType
viewView | null

Returns

void


isViewHidden()

ts
isViewHidden(view: View | null): boolean;

Returns whether view should be hidden in the generated DisplayLayout.

Note that the naming of this function was chosen carefully to express the visibility logic of DisplayAutoLayouter. The "hidden" state of a view serves only as input to the layouting algorithm. Marking a view as hidden means that it will never be considered during layouting and thus never be visible. However, a view that is not marked hidden may still not appear in the resulting currentLayout():

Parameters

ParameterType
viewView | null

Returns

boolean


setViewHidden()

ts
setViewHidden(view: View | null, value: boolean): void;

Sets whether view should be hidden in the generated DisplayLayout.

Parameters

ParameterTypeDescription
viewView | null-
valuebooleanWhether the view should be hidden

Returns

void

See

isViewHidden()


onModeChanged()

ts
onModeChanged(callback: (mode: DisplayLayoutMode) => void): () => void;

Fires when the layout mode changes.

Parameters

ParameterType
callback(mode: DisplayLayoutMode) => void

Returns

Unsubscribe function.

() => void


onViewHiddenChanged()

ts
onViewHiddenChanged(callback: (view: View, hidden: boolean) => void): () => void;

Fires when a view's hidden state changes.

Parameters

ParameterTypeDescription
callback(view: View, hidden: boolean) => voidCalled with the view and its new hidden state.

Returns

Unsubscribe function.

() => void

On this page