Zebra API Doc

zebra.ui.TitledBorder Class

Extends zebra.ui.Render

Render class that allows developers to render a border with a title area. The title area has to be specified by an UI component that uses the border by defining "getTitleInfo()"" method. The method has to return object that describes title size, location and alignment:

 {
   x: {Integer}, y: {Integer},
   width: {Integer}, height: {Integer},
   orient: {Integer}
 }

Constructor

zebra.ui.TitledBorder

(
  • border
  • [lineAlignment]
)

Parameters:

  • border zebra.ui.View

    a border to be rendered with a title area

  • [lineAlignment] Integer | String optional

    a line alignment. Specifies how a title area has to be aligned relatively border line:

     BOTTOM or "bottom"  - title area will be placed on top of border line:
                   ___| Title area |___
    
    
     CENTER or "center"  - title area will be centered relatively to border line:
                   ---| Title area |-----
    
    
     TOP or "top"  - title area will be placed underneath of border line:
                    ____              ________
                        |  Title area |

Methods

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

setTarget

(
  • o
)

Inherited from zebra.ui.Render:

Set the given target object. The method triggers "targetWasChanged(oldTarget, newTarget)" execution if the method is declared. Implement the method if you need to track a target object updating.

Parameters:

  • o Object

    a target object to be visualized

Attributes

target

Object readonly

Inherited from zebra.ui.Render:

Target object to be visualized

Default: null