Zebra API Doc

zebra.ui.ViewSet Class

ViewSet view. The view set is a special view container that includes number of views accessible by a key and allows only one view be active in a particular time. Active is view that has to be rendered. The view set can be used to store number of decorative elements where only one can be rendered depending from an UI component state.

Constructor

zebra.ui.ViewSet

(
  • args
)

Parameters:

  • args Object

    object that represents views instances that have to be included in the ViewSet

Methods

activate

(
  • id
)
Boolean

Activate the given view from the given set.

Parameters:

  • id String

    a key of a view from the set to be activated


Return: Boolean

true if new view has been activated, false otherwise

getBottom

() Integer

Inherited from zebra.ui.View:

Get bottom gap. The method informs UI component that uses the view as a border view how much space bottom side of the border occupies


Return: Integer

a bottom gap

getLeft

() Integer

Inherited from zebra.ui.View:

Get left gap. The method informs UI component that uses the view as a border view how much space left side of the border occupies


Return: Integer

a left gap

getPreferredSize

() Object

Inherited from zebra.ui.View:

Return preferred size the view desires to have


Return: Object

getRight

() Integer

Inherited from zebra.ui.View:

Get right gap. The method informs UI component that uses the view as a border view how much space right side of the border occupies


Return: Integer

a right gap

getTop

() Integer

Inherited from zebra.ui.View:

Get top gap. The method informs UI component that uses the view as a border view how much space top side of the border occupies


Return: Integer

a top gap

paint

(
  • g
  • x
  • y
  • w
  • h
  • c
)

Inherited from zebra.ui.View:

The method is called to render the decorative element on the given surface of the specified UI component

Parameters:

  • g Canvas 2D context

    graphical context

  • x Integer

    x coordinate

  • y Integer

    y coordinate

  • w Integer

    required width

  • h Integer

    required height

  • c zebra.ui.Panel

    an UI component on which the view element has to be drawn

Attributes

activeView

View readonly

Active in the set view

Default: null

bottom

Integer private readonly

Inherited from zebra.ui.CompositeView:

Bottom padding

left

Integer private readonly

Inherited from zebra.ui.CompositeView:

Left padding

right

Integer private readonly

Inherited from zebra.ui.CompositeView:

Right padding

top

Integer private readonly

Inherited from zebra.ui.CompositeView:

Top padding

views

Object readonly

Views set

Default: {}