Class GaugeCircle

Hierarchy

  • Canvas2D
    • GaugeCircle

Constructors

  • Parameters

    • Optional parent: Widget

    Returns GaugeCircle

Properties

m_animation: boolean = false
m_animationStep: number = 1.1
m_children: Widget[]
m_content: Widget
m_context: CanvasRenderingContext2D
m_currentValue: number = 0
m_dom: HTMLElement
m_endAngle: number = 0
m_frameHandle: number
m_freeColor: Color = ...
m_maxValue: number = 100
m_minValue: number = 0
m_parent: Widget
m_pointerColor: Color = ...
m_pointerStyle: PointerStyle = PointerStyle.Triangle
m_radiusY: number = 20
m_reverse: boolean = false
m_scaleColor: Color = ...
m_scaleMajor: number = 10
m_scaleMinor: number = 5
m_startAngle: number = 0
m_textColor: Color = ...
m_titleColor: Color = ...
m_usedColor: Color = ...
m_value: number = 0

Accessors

  • get animation(): boolean
  • Returns boolean

  • set animation(animation): void
  • Parameters

    • animation: boolean

    Returns void

  • get animationStep(): number
  • Returns number

  • set animationStep(animationStep): void
  • Parameters

    • animationStep: number

    Returns void

  • get blocked(): boolean
  • Returns true if events are blocked; otherwise returns false.

    Returns boolean

  • set blocked(blocked): void
  • If blocked is true, then events emitted by this event watcher will be blocked, meaning that emitting an event will not trigger any callback functions that are bound to it.

    Parameters

    • blocked: boolean

    Returns void

  • get characterHeight(): number
  • Returns the height of character.

    Returns number

  • get children(): readonly Widget[]
  • Returns the list of children.

    Returns readonly Widget[]

  • get context(): CanvasRenderingContext2D
  • Returns the context of this canvas. It is used for drawing shapes, text, images, and other objects.

    Returns CanvasRenderingContext2D

  • set css(style): void
  • Sets the style of this widget. See also id addClass.

    Parameters

    • style: Partial<StyleSheets>

    Returns void

  • get dom(): HTMLCanvasElement
  • Returns the dom of this canvas.

    Returns HTMLCanvasElement

  • get enabled(): boolean
  • Returns whether this widget or its parent chain is enabled or not. By default, the value of this property is true.

    Returns boolean

  • set enabled(enabled): void
  • Sets whether this widget is enabled or not. Disabling a widget implicitly disables all its children, it is not possible to explicitly enable a child widget while its parent widget remains disabled.

    Parameters

    • enabled: boolean

    Returns void

  • get endAngle(): number
  • Returns number

  • set endAngle(endAngle): void
  • Parameters

    • endAngle: number

    Returns void

  • get freeColor(): Color
  • Returns Color

  • set freeColor(freeColor): void
  • Parameters

    • freeColor: Color

    Returns void

  • get height(): number
  • Returns the height of this canvas.

    Returns number

  • set height(height): void
  • Sets the height of this canvas to the given height, taking pixel ratio into account.

    Parameters

    • height: number

      The unit of height is px.

    Returns void

  • get id(): string
  • Returns the id of this widget.

    Returns string

  • set id(id): void
  • Set the id of this widget to the given id. The id is utilized to set the style of the widget. See also css

    Parameters

    • id: string

    Returns void

  • get left(): number
  • Returns the left coordinate of this widget within its parent widget.

    Returns number

  • set left(left): void
  • Sets the left coordinate of this widget within its parent widget.

    Parameters

    • left: number

      The unit of left is px.

    Returns void

  • get maxValue(): number
  • Returns number

  • set maxValue(maxValue): void
  • Parameters

    • maxValue: number

    Returns void

  • get minValue(): number
  • Returns number

  • set minValue(minValue): void
  • Parameters

    • minValue: number

    Returns void

  • get parent(): Widget
  • Returns the parent of this widget, or undefined if it does not have any parent widget.

    Returns Widget

  • set parent(parent): void
  • Sets the parent of the widget to the given parent. If the new parent widget is the old parent widget, this function does nothing.

    Parameters

    • parent: Widget

    Returns void

  • get pixelHeight(): number
  • Returns the pixel height of this canvas.

    Returns number

  • get pixelRatio(): number
  • Returns the device pixel ratio. This property represents the ratio between the size of one CSS pixel and the size of one physical pixel. It is commonly used for HD-DPI devices to ensure that the output canvas is not blurred.

    Returns number

  • get pixelSize(): Size
  • Returns the pixel size of this canvas.

    Returns Size

  • get pixelWidth(): number
  • Returns the pixel width of this canvas.

    Returns number

  • get pointerColor(): Color
  • Returns Color

  • set pointerColor(pointerColor): void
  • Parameters

    • pointerColor: Color

    Returns void

  • get pointerStyle(): PointerStyle
  • Returns PointerStyle

  • set pointerStyle(pointerStyle): void
  • Parameters

    Returns void

  • get position(): Point
  • Returns the position of this widget within its parent widget.

    Returns Point

  • set position(position): void
  • Sets the position of this widget to the given position.

    Parameters

    • position: Point

      The unit of position is px.

    Returns void

  • get rect(): Rect
  • Returns the rect of this widget within the desktop.

    Returns Rect

  • get scaleColor(): Color
  • Returns Color

  • set scaleColor(scaleColor): void
  • Parameters

    • scaleColor: Color

    Returns void

  • get scaleMajor(): number
  • Returns number

  • set scaleMajor(scaleMajor): void
  • Parameters

    • scaleMajor: number

    Returns void

  • get scaleMinor(): number
  • Returns number

  • set scaleMinor(scaleMinor): void
  • Parameters

    • scaleMinor: number

    Returns void

  • get size(): Size
  • Returns the size of this canvas.

    Returns Size

  • set size(size): void
  • Sets the size of this canvas to the given size, taking pixel ratio into account.

    Parameters

    • size: Size

      The unit of size is px.

    Returns void

  • get startAngle(): number
  • Returns number

  • set startAngle(startAngle): void
  • Parameters

    • startAngle: number

    Returns void

  • get style(): CSSStyleDeclaration
  • Returns the style of this widget.

    Returns CSSStyleDeclaration

  • get textColor(): Color
  • Returns Color

  • set textColor(textColor): void
  • Parameters

    • textColor: Color

    Returns void

  • get titleColor(): Color
  • Returns Color

  • set titleColor(titleColor): void
  • Parameters

    • titleColor: Color

    Returns void

  • get tooltip(): string
  • Returns the tooltip of this widget. When the mouse hovers over the widget for a period of time(it can be set by Tooltip::WakeUpDelay), a message will automatically pop up, and it will disappear automatically when the mouse moves away. By default, the value of this property is an empty string.

    Returns string

  • set tooltip(tooltip): void
  • Sets the tooltip of this widget to the given tooltip.

    Parameters

    • tooltip: string

    Returns void

  • get top(): number
  • Returns the top coordinate of this widget within its parent widget.

    Returns number

  • set top(top): void
  • Sets the top coordinate of this widget to the given top.

    Parameters

    • top: number

      The unit of top is px.

    Returns void

  • get usedColor(): Color
  • Returns Color

  • set usedColor(usedColor): void
  • Parameters

    • usedColor: Color

    Returns void

  • get value(): number
  • Returns number

  • set value(value): void
  • Parameters

    • value: number

    Returns void

  • get visible(): boolean
  • Returns whether this widget or its parent chain is visible or not. By default, the value of this property is true.

    Returns boolean

  • set visible(visible): void
  • Sets whether this widget is visible or not. If an ancestor widget is not visible, the widget won't become visible until all its ancestors are visible.

    Parameters

    • visible: boolean

    Returns void

  • get width(): number
  • Returns the width of this canvas.

    Returns number

  • set width(width): void
  • Sets the width of this canvas to the given width, taking pixel ratio into account.

    Parameters

    • width: number

      The unit of width is px.

    Returns void

  • get sender(): EventWatcher
  • Returns the object that sent the event.

    Returns EventWatcher

Methods

  • Adds the attribute of this widget. The attribute is utilized to set the style. See also css

    Parameters

    • attr: string

    Returns void

  • Adds the class name of this widget. The class name is utilized to set the style. See also css. All widgets with the same class name use the same style.

    Parameters

    • className: string

    Returns void

  • Returns void

  • Adds a callback function that's going to be called when the event is emitted.

    Type Parameters

    • K extends keyof EventMap

    Parameters

    • name: K
    • callback: ((...data) => void)
        • (...data): void
        • Parameters

          • Rest ...data: EventMap[K]

          Returns void

    Returns void

  • Parameters

    • name: string
    • callback: ((...data) => void)
        • (...data): void
        • Parameters

          • Rest ...data: any[]

          Returns void

    Returns void

  • Erases the entire canvas.

    Returns void

  • Clears all widgets in the list of children.

    Returns void

  • Closes this widget. This function is equivalent to setting this widget's parent to undefined. If the widget has no resources to free, call this function directly.

    Returns void

  • Delegates this event watcher to handle the given watcher's event named name.

    Type Parameters

    • K extends keyof EventMap

    Parameters

    • watcher: EventWatcher
    • name: K

    Returns void

  • Parameters

    • watcher: EventWatcher
    • name: string

    Returns void

  • Destroys the widget, all the widget's children are destroyed first. The widget is destroyed when it's parent is destroyed. When the widget is destroyed, make sure to release all resources, such as timers, etc. Releases the resources in the protected function free(), and the system will call this function automatically when the parent widget or itself is destroyed. See also free.

    Returns void

  • Returns void

  • Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D

    Returns void

  • Emits an arbitrary set of arguments to the callback function which is bound to the event named name.

    Type Parameters

    • K extends keyof EventMap

    Parameters

    • name: K
    • Rest ...data: EventMap[K]

    Returns boolean

  • Parameters

    • name: string
    • Rest ...data: any[]

    Returns boolean

  • Returns void

  • Returns whether this widget contains the attribute.

    Parameters

    • attr: string

    Returns boolean

  • Returns whether this widget contains the class name.

    Parameters

    • className: string

    Returns boolean

  • Hides the widget and its child widgets. This function is equivalent to setting the visible property to false.

    Returns void

  • Inserts the child widget at index in the list of children.

    Parameters

    • index: number
    • widget: Widget

    Returns void

  • Raises this widget to the front of the parent widget's children. The display order of this widget is determined by the order in which they appear in the parent widget's children.

    Returns boolean

  • Removes the attribute of this widget.

    Parameters

    • attr: string

    Returns void

  • Removes the class name of this widget.

    Parameters

    • className: string

    Returns void

  • Sets whether the widget uses flex layout.

    Parameters

    Returns void

  • Parameters

    • minValue: number
    • maxValue: number

    Returns void

  • Shows the widget and its child widgets. This function is equivalent to setting the visible property to true.

    Returns void

  • Returns void

  • Returns void

  • If param attr is true, adds the attribute, otherwise removes the attribute.

    Parameters

    • attr: string
    • on: boolean

      true or false

    Returns void

  • If param on is true, adds the class name, otherwise removes the class name.

    Parameters

    • className: string
    • on: boolean

      true or false

    Returns void

  • Removes the specified watcher for the event named name.

    Type Parameters

    • K extends keyof EventMap

    Parameters

    • name: K

    Returns void

  • Parameters

    • name: string

    Returns void

  • Batchs draw. this function will not do immediate draw, it will schedule drawing to next tick. See also Canvas.draw

    Returns void

  • Updates the size of this canvas When CSS size or pixel ratio is changed.

    Returns void

  • Returns void

Generated using TypeDoc