Zebra API Doc

zebra.ui.Border Class

Extends zebra.ui.View

Border view. Can be used to render CSS-like border. Border can be applied to any zebra UI component by calling setBorder method:

   // create label component
   var lab = new zebra.ui.Label("Test label");

   // set red border to the label component 
   lab.setBorder(new zebra.ui.Border("red"));

Constructor

zebra.ui.Border

(
  • [c]
  • [w]
  • [r]
)

Parameters:

  • [c] String optional

    border color

  • [w] Integer optional

    border width

  • [r] Integer optional

    border corners radius

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

outline

(
  • g
  • x
  • y
  • w
  • h
  • d
)
Boolean

Defines border outline for the given 2D Canvas context

Parameters:

  • g 2D Canvas context
  • x Integer

    x coordinate

  • y Integer

    y coordinate

  • w Integer

    required width

  • h Integer

    required height

  • d Integer

    target UI component


Return: Boolean

true if the outline has to be applied as an UI component shape

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

color

String readonly

Border color

Default: "gray"

radius

Integer readonly

Border radius

Default: 0

width

Integer readonly

Border line width

Default: 1