Members
(constant) BorderStyle :string
Border style enum. Use in a border object..
- string
| Name | Type | Description |
|---|---|---|
None | string | No border. |
Line | string | Solid line. |
Dashed | string | Dashed border. |
Metal | string | Metallic style. |
EtchedRaised | string | Etched raised border. |
EtchedLowered | string | Etched lowered border. |
BevelRaised | string | Bevel raised border. |
BevelLowered | string | Bevel lowered border. |
SoftRaised | string | Soft raised border. |
SoftLowered | string | Soft lowered border. |
<h2>Setting a new border:</h2>
let border = {style: BorderStyle.Dashed, size: 2, color: "#002288"}
panel.border(border);(constant) Cursor :number
Enum for available mouse cursors.
- number
| Name | Type | Description |
|---|---|---|
Default | number | Default cursor. |
Crosshair | number | Crosshair. |
Text | number | Text input cursor. |
Wait | number | Wait/busy cursor. |
ResizeSW | number | Resize south-west. |
ResizeSE | number | Resize south-east. |
ResizeNW | number | Resize north-west. |
ResizeNE | number | Resize north-east. |
ResizeN | number | Resize north. |
ResizeS | number | Resize south. |
ResizeW | number | Resize west. |
ResizeE | number | Resize east. |
Hand | number | Pointing hand. |
Move | number | Move cursor. |
<h2>Sets "Wait" cursor to Panel component:</h2>
panel.cursor(Cursor.Wait);(constant) DataType :string
Enum for data types used with drag and drop. Used with dragDataType(), dropDataType(), and to check if certain data type was dragged onto component.
- string
| Name | Type | Description |
|---|---|---|
None | string | No data. |
All | string | Accept any type. Used only for dropDataType(). |
Text | string | Plain text. |
HTML | string | HTML content. |
Image | string | Image data. |
FileList | string | Files from system clipboard or drag. |
URIList | string | List of URIs. |
URL | string | A single URL string. |
JSON | string | JSON-encoded data. |
Components | string | UI components ( |
<h2>Sets the type of data list items represent when dragged:</h2>
list.dragDataType(DataType.FileList);<h2>Sets the type of data Table component accepts:</h2>
table.dropDataType([DataType.FileList, DataType.URIList, DataType.URL]);<h2>Check if expected data type was dragged onto Label:</h2>
label.dropAction(DragDropAction.CopyOrMove).dropDataType(DataType.FileList).onDropEvents(e => {
if(e.type === "drop" && Array.isArray(e.data[DataType.FileList]))
{
// set first file as label's icon image
e.target.icon(e.data[DataType.FileList][0]);
}
});(constant) DragDropAction :string
Enum for drag and drop actions. Used with dragAction() and dropAction().
- string
| Name | Type | Description |
|---|---|---|
None | string | No action. |
Copy | string | Copy action. |
Move | string | Move action. |
CopyOrMove | string | Copy or move action. |
Link | string | Link action. |
list.dragAction(DragDropAction.CopyOrMove);
list.dropAction(DragDropAction.CopyOrMove);(constant) DropMode :string
Used with dropMode() in Table, List, and Tree
- string
| Name | Type | Description |
|---|---|---|
On | string | Drop on items. |
Insert | string | Insert between items |
OnOrInsert | string | Drop on items and between items |
- See
- List.dropMode()
- Table.dropMode()
- Tree.dropMode()
table.dropMode(DropMode.OnOrInsert);(constant) FontFamily :string
An enum for generic font family names to use instead of a font name that may not be installed on target operating systems. Use with component.font(), Text() shape, font property of a List item, Tree item, ComboBox item, Table column, and everywhere else where font can be set.
- string
| Name | Type | Description |
|---|---|---|
Serif | string | Proportional font with small decorative strokes at the ends of letters (e.g., Times New Roman, Georgia, Garamond, Cambria.). |
SansSerif | string | Proportional font without decorative strokes; clean and modern (e.g., Arial, Helvetica, Verdana, Calibri, Open Sans). |
Monospaced | string | Fixed-width font where every character has the same width (e.g., Courier New, Consolas, Lucida Console, Menlo). |
Cursive | string | Flowing, handwritten-style font (e.g., Brush Script, Comic Sans MS, Pacifico, Lobster). |
System | string | The system UI font provided by the operating system. (e.g., Segoe UI (Windows), San Francisco (macOS/iOS), Roboto (Android/Linux)). |
Fantasy | string | Decorative or themed font (e.g., Impact, Papyrus, Jokerman, Copperplate). |
<h2>Setting component font:</h2>
textarea.font({name: FontFamily.SansSerif});<h2>Setting Text shape font:</h2>
let text = new Text("Hello World", {name: FontFamily.Fantasy, size: 30});(constant) KeyAction :number
Keyboard key actions. Used with ui.keyboardAction(action, value) to perform key actions.
- number
| Name | Type | Description |
|---|---|---|
Press | number | Key press. |
Release | number | Key release. |
Type | number | Key typed (typed character input). |
<h2>Performing a key type action:</h2>
ui.keyboardAction(KeyAction.Type, "A");(constant) LineWrap :number
Enum for word wrapping styles. Used with lineWrap() method in TextArea and DocumentEditor to control how text is wrapped.
- number
| Name | Type | Description |
|---|---|---|
None | number | Disable line wrapping. |
Word | number | Wrap line when a full word doesn't fit. |
Character | number | Wrap line when a character doesn't fit. |
<h2>Setting line wrapping style:</h2>
textarea.lineWrapping(LineWrap.Word);(constant) MessageIcon :number
Enum for standard message dialog icons. Used in alert(), dialog() and TrayIcon.showNotification().
- number
| Name | Type | Description |
|---|---|---|
Error | number | Error icon. |
Info | number | Information icon. |
Warning | number | Warning icon. |
Question | number | Question icon. |
alert("This file doesn't exist!", "File Absent", MessageIcon.Warning);(constant) MouseAction :number
Enum for mouse actions. Used with ui.mouseAction(action, button).
- number
| Name | Type | Description |
|---|---|---|
Press | number | Mouse button press. |
Release | number | Mouse button release. |
Click | number | Single click. |
DoubleClick | number | Double click. |
VerticalScroll | number | Vertical wheel scroll. |
HorizontalScroll | number | Horizontal wheel scroll. |
<h2>Performing a mouse click:</h2>
ui.mouseAction(MouseAction.Click, MouseButton.Left);(constant) MouseButton :number
Enum for mouse buttons. Compare to mouseEvent.button on mouse events or use with ui.mouseAction(action, button).
- number
| Name | Type | Description |
|---|---|---|
Left | number | Left mouse button. |
Right | number | Right mouse button. |
Middle | number | Middle mouse button. |
<h2>Checking if right mouse button was clicked:</h2>
if(mouseEvent.button === MouseButton.Right)
{
console.log("Right click);
}<h2>Performing a mouse click:</h2>
ui.mouseAction(MouseAction.Click, MouseButton.Left);(constant) Orientation :number
Enum for component orientation, such as Slider or Toolbar.
- number
| Name | Type | Description |
|---|---|---|
Horizontal | number | Horizontal orientation. |
Vertical | number | Vertical orientation. |
<h2>Setting orientation to a component:</h2>
toolbar.orientation(Orientation.Vertical);(constant) SelectionMode :number
Enum for selection modes in UI components like Table, List, Tree. Used with selectionMode() to set of get a selection mode of a list of items or rows.
- number
| Name | Type | Description |
|---|---|---|
Single | number | Single item selection. |
Range | number | Range selection (shift-click). |
Multiple | number | Multiple selection (ctrl/cmd-click). |
table.selectionMode(SelectionMode.Single);(constant) TextAction :number
Enum for actions on text components (TextField, TextArea, etc.). To be used in text() method.
- number
| Name | Type | Description |
|---|---|---|
Set | number | Replace all text. |
Prepend | number | Add text at the beginning. |
Append | number | Add text at the end. |
Insert | number | Insert at current caret position. |
ReplaceSelection | number | Replace selected text. |
<h2>Appending text to TextArea component:</h2>
let textarea = new TextArea("Hello").text(" World!", TextAction.Append);
// text area will contain text "Hello World!"(readonly) ui :SwingUI
This is a global instance of the main SwingUI class. Use this variable to call functions of SwingUI class.
- See
let _screens = ui.screens; // enumerates screens in Array
const data = ui.clipboard(); // retrieves data copied to clipboardMethods
alert(message, titleopt, iconopt, ownerWindowopt) → {void}
Displays a dialog window with a specified error message and an error icon.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
message | string | A message to be displayed in the dialog window | ||
title | string | <optional> | "Message" | Dialog window title bar text |
icon | MessageIcon | <optional> | MessageIcon.Info | Icon to show in the dialog window. Valid value are:
|
ownerWindow | Window | <optional> | null | If set, the message dialog window will attempts to be centered at specified window |
Does not return a value
- Type:
- void
<h2>Simple usage with only one parameter:</h2>
alert("File name is invalid. Please try again");<h2>Usage example when passing all parameters:</h2>
alert("File name is invalid. Please try again","Invalid File", MessageIcon.Warning, this);confirm(message, windowopt) → {boolean}
Displays a confirmation dialog to user and returns user's response as boolean.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
message | string | Message to display to user | ||
window | Window | <optional> | null | Window which dialog window will overlay. |
Returns true if user confirms the message, or false otherwise.
- Type:
- boolean
if(confirm("Delete this file?", this))
{
// delete code
}dialog(message, titleopt, buttonsopt, iconopt, windowopt) → {string|undefined}
Shows a custom dialog window that allows the user to respond by clicking one of provided buttons.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
message | string | String message to user. It can be plain text or HTML. | ||
title | string | <optional> | "" | Dialog window title shown in the title bar of the window |
buttons | string | <optional> | "OK|Cancel" | A string of button names separated by "|" character. Indicate which button should be selected by default by surrounding the button with square brackets like so: "OK|[Cancel]" |
icon | MessageIcon | | <optional> | null | One of MessageIcon icons, or an absolute path to an image from a file system. |
window | Window | <optional> | null | Owner window that will be overlaid by this dialog window. |
Returns a string of the clicked button, or undefined if user close the window without clicking on one of provided buttons.
- Type:
- string |
undefined
let response = dialog("Are you ready?", "Confirm readiness", "Yes|No|[Maybe]", MessageIcon.Question, this);
if(response !== "Yes") return; // do not continue
let response = dialog("Is this you?", "Question #5", "Yes|[No]", "C://User/John/profile_icon.jpg", this);error(message, show_stack_traceopt) → {void}
Displays a dialog windows with error message and error icon.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
message | string | Error message to display. | ||
show_stack_trace | boolean | <optional> | true | Whether to show stack trace to be able to trace the error. |
Does not return a value
- Type:
- void
<h2>Showing an error message only:</h2>
error("Invalid parameters passed.", false);<h2>Showing an error message with a stack trace:</h2>
error("Invalid parameters passed.");isAbsolutePath(path) → {boolean}
Checks if the provided path is absolute (mainly for the purpose to know if a directory should be prepended to the path to make it absolute). Note that it returns true for empty string.
| Name | Type | Description |
|---|---|---|
path | string | File path (supports local files, network drive paths, Windows paths with drive letter, unix root /) |
Throws error if provided path is not a string type.
- Type
- Error
Returns true if the path is absolute or an empty string.
- Type:
- boolean
prompt(message, default_valueopt, ownerWindowopt) → {string|undefined}
Requests user for text input in a dialog window. Returns a string as user's input or undefined when user declined to input.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
message | string | Message to user about this text input. | ||
default_value | string | <optional> | "" | Default string that will be already present in the dialog window. |
ownerWindow | Window | <optional> | null | Window that will be overlaid by the dialog window. |
Returns user provided string, or undefined if user canceled input.
- Type:
- string |
undefined
let response = prompt("Please enter your name:", "John Doe", this);
console.log("You entered: " + response);Type Definitions
ActionEvent
Action event received by the onAction() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
command | string | The command string, usually the button text or a custom value set with | |
modifiers | number | <optional> | Keyboard modifiers (bitmask or flags). |
alt | boolean | <optional> | Indicates if ALT key was pressed. |
shift | boolean | <optional> | Indicates if SHIFT key was pressed. |
ctrl | boolean | <optional> | Indicates if CTRL key was pressed. |
type | string | One of | |
x | number | <optional> | Mouse X position relative to the component. |
y | number | <optional> | Mouse Y position relative to the component. |
screenX | number | <optional> | Mouse X position relative to the screen. |
screenY | number | <optional> | Mouse Y position relative to the screen. |
interactive | boolean | <optional> | Indicates if the action was triggered by user interaction (not programmatically). |
selected | boolean | <optional> | Indicates selection state when applicable. |
- See
AncestorEvent
Ancestor event received by the onAncestorEvents() handler callback.
- Object
| Name | Type | Description |
|---|---|---|
target | object | The component that triggered the event. |
type | string | One of |
ancestor | object | The ancestor component related to this event. |
AudioDevice
Represents an audio input or output device, such as a microphone, audio card, etc.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
name | string | Name of the audio device (required when setting an audio input device). | |
id | string | <optional> | ID of the audio device. |
formats | Array.<AudioFormat> | <optional> | List of available audio formats provided when retrieving a list of installed audio devices. |
format | AudioFormat | <optional> | Specifies the chosen audio format to use when setting audio input device. |
AudioFormat
Represents an audio format for an audio device.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
channels | number | Number of audio channels. (1-Mono, 2-Stereo, etc.) | |
bits | number | Bits per audio sample. | |
rate | number | <optional> | Sample rate in Hz (only available for audio input devices). |
encoding | string | <optional> | Audio encoding (e.g., "PCM_UNSIGNED", "PCM_SIGNED"); (only available for audio output device formats). |
- See
AudioStream
Describes an audio stream in the media.
- Object
| Name | Type | Description |
|---|---|---|
sampleRate | number | Sample rate of the audio stream in Hz. |
channels | number | Number of audio channels (1 - mono, 2 - stereo, etc.) |
bitDepth | number | Bit depth of the audio samples. |
codec | string | Codec used to encode the audio stream (e.g., |
default | boolean | Indicates if this is the default audio stream. |
CaretEvent
Caret event received by the onCaretEvents() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | Always | |
position | number | The new caret position. | |
selectionStart | number | Start position of selected text. | |
selectionEnd | number | End position of selected text. | |
line | number | <optional> | Line number where the caret is located. Present in components like |
column | number | <optional> | Column number (offset from line start) of the caret. Present in multi-line components like |
styles | object | <optional> | Text formatting information at the caret’s position. Present only for |
path | Array.<string> | <optional> | HTML tag hierarchy at the caret’s position. Present only for |
ChangeEvent
Change event received by the onChange() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
action | string | <optional> | One of |
position | number | <optional> | The position at which text was inserted. Present when |
length | number | <optional> | The number of characters inserted or removed. Present when |
- See
ComponentEvent
Component event received by the onComponentEvents() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
interactive | boolean | <optional> | Indicates if the event was triggered by user interaction (not programmatically). Present for |
x | number | <optional> | New X position of the component. |
y | number | <optional> | New Y position of the component. |
width | number | <optional> | New width of the component. Present when type is |
height | number | <optional> | New height of the component. Present when type is |
innerWidth | number | <optional> | New width of the content area. Present for |
innerHeight | number | <optional> | New height of the content area. Present for |
ContainerEvent
Container event received by the onContainerEvents() handler callback.
- Object
| Name | Type | Description |
|---|---|---|
target | object | The container component that triggered the event. |
type | string | One of |
child | object | The child component that was added or removed. |
DisposeEvent
A dispose event object received by the onDispose() handler callback when a component gets disposed.
- Object
| Name | Type | Description |
|---|---|---|
target | object | The component that triggered the event. |
- See
DragEvent
Drag event received by the onDragEvents() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
action | string | <optional> | One of the values of enum DragDropAction. Present when applicable. |
x | number | <optional> | X position of the pointer relative to this component. Present when type is |
y | number | <optional> | Y position of the pointer relative to this component. Present when type is |
screenX | number | <optional> | X position of the pointer relative to the screen. Present when type is |
screenY | number | <optional> | Y position of the pointer relative to the screen. Present when type is |
button | number | <optional> | Indicates a pointing device button involved in dragging. Value of |
modifiers | number | <optional> | Keyboard modifiers (bitmask or flags). Present when type is |
modifiersText | string | <optional> | Human-readable keyboard modifiers. Present when type is |
alt | boolean | <optional> | Indicates if ALT key was pressed. Present when type is |
shift | boolean | <optional> | Indicates if SHIFT key was pressed. Present when type is |
ctrl | boolean | <optional> | Indicates if CTRL key was pressed. Present when type is |
selected | Array.<number> | <optional> | Selected indexes of a |
DropEvent
Drop event received by the onDropEvents() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
action | string | <optional> | One of the values of enum DragDropAction. Present when applicable. |
data | object | <optional> | Contains the data being dropped. Present only when type is |
source | object | <optional> | The component being dragged onto this component. Present only for component-to-component drag and when |
x | number | <optional> | X position of the pointer relative to this component. Present when type is |
y | number | <optional> | Y position of the pointer relative to this component. Present when type is |
screenX | number | <optional> | X position of the pointer relative to the screen. Present when type is |
screenY | number | <optional> | Y position of the pointer relative to the screen. Present when type is |
selected | Array.<number> | <optional> | Selected indexes of a |
ErrorEvent
An error event object received by the onError() handler callback when error occurs.
- Object
| Name | Type | Description |
|---|---|---|
target | object | The component that triggered the event. |
messsage | string | An error message. |
- See
FocusEvent
Focus event received by the onFocusEvents() handler callback.
- Object
| Name | Type | Description |
|---|---|---|
target | object | The component that triggered the event. |
type | string | One of |
cause | string | One of |
temporary | boolean | Identifies if the focus change is temporary or permanent. |
Font
Font object used in most UI components, ListItem, TableColumn, Text shape and other text-rendering components.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
name | string | | <optional> | Font family name (e.g., |
size | number | <optional> | Font size in pixels. |
bold | boolean | <optional> | Whether the text is bold. |
italic | boolean | <optional> | Whether the text is italic. |
underlined | boolean | <optional> | Whether the text is underlined. |
strikethrough | boolean | <optional> | Whether the text has a strikethrough. |
direction | string | <optional> | Text direction: |
kerning | boolean | <optional> | Enable or disable kerning. |
ligatures | boolean | <optional> | Enable or disable font ligatures. |
tracking | number | <optional> | Letter spacing adjustment: -1, 0 (default), or 1. |
KeyEvent
Key event received by the onKey() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
keyCode | number | Numeric code associated with the key. | |
extendedKeyCode | number | Unique id assigned to a key depending on the current keyboard layout. | |
keyChar | string | The character produced by the key. | |
modifiers | number | <optional> | Keyboard modifiers (bitmask or flags). |
modifiersText | string | <optional> | Human-readable representation of modifiers. |
alt | boolean | <optional> | Indicates if ALT key was pressed. |
shift | boolean | <optional> | Indicates if SHIFT key was pressed. |
ctrl | boolean | <optional> | Indicates if CTRL key was pressed. |
keyLocation | string | <optional> | One of |
- See
LinkEvent
Event object passed to hyperlink event handlers in DocumentEditor#onLinkEvents.
- Object
| Name | Type | Description |
|---|---|---|
target | DocumentEditor | The component that triggered the event. |
type | string | The event type: |
url | string | The |
text | string | The text content of the hyperlink. |
shift | boolean | Whether the Shift key was pressed. |
ctrl | boolean | Whether the Ctrl key was pressed. |
alt | boolean | Whether the Alt key was pressed. |
modifiers | string | Keyboard modifiers mask. |
modifiersText | string | String representation of the keyboard modifiers. |
ListItem
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
text | string | <optional> | Item text. (Required for a new list item). |
id | string | | <optional> | Value that can be used by software logic to identify this item. |
value | string | | <optional> | Additional value to be stored in the item for later use. |
icon | string | | <optional> | Absolute/relative path to icon image, base64 encoded image string, or |
color | string | <optional> | Item text color as a 6-character hex string (e.g. |
background | string | <optional> | Item background color as a 6-character hex string (e.g. |
tooltip | string | <optional> | Tooltip text shown when hovering the item (only in List and Tree components). |
font | Font | <optional> | Font formatted object. |
Media
Describes metadata and streams of the media.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
duration | number | <optional> | Duration of the media in seconds. Not present for live streams. |
videoStreams | Array.<VideoStream> | Array of video streams available in the media. | |
audioStreams | Array.<AudioStream> | Array of audio streams available in the media. | |
subtitleStreams | Array.<SubtitleStream> | Array of subtitle streams available in the media. |
MouseEvent
Mouse event received by the onMouseEvents() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
button | number | Button number. One of | |
clicks | number | <optional> | Number of times the button was clicked. Present when applicable. |
modifiers | number | <optional> | Keyboard modifiers (bitmask or flags). |
alt | boolean | <optional> | Indicates if ALT key was pressed. |
shift | boolean | <optional> | Indicates if SHIFT key was pressed. |
ctrl | boolean | <optional> | Indicates if CTRL key was pressed. |
x | number | <optional> | Mouse X position relative to the component. Present when applicable. |
y | number | <optional> | Mouse Y position relative to the component. Present when applicable. |
screenX | number | <optional> | Mouse X position relative to the screen. Present when applicable. |
screenY | number | <optional> | Mouse Y position relative to the screen. Present when applicable. |
MouseMotionEvent
Mouse motion event received by the onMouseMotion() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
button | number | <optional> | Button number. One of |
modifiers | number | <optional> | Keyboard modifiers (bitmask or flags). |
x | number | Mouse X position relative to the component. | |
y | number | Mouse Y position relative to the component. | |
screenX | number | Mouse X position relative to the screen. | |
screenY | number | Mouse Y position relative to the screen. |
MouseWheelEvent
Mouse wheel event received by the onMouseWheel() handler callback.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | Always | |
button | number | <optional> | Button number. One of |
scrollAmount | number | Number of units to scroll per wheel click. | |
rotation | number | Number of wheel "clicks" rotated. Can be zero until a full click is accumulated on high-resolution wheels. | |
modifiers | number | <optional> | Keyboard modifiers (bitmask or flags). |
alt | boolean | <optional> | Indicates if ALT key was pressed. |
shift | boolean | <optional> | Indicates if SHIFT key was pressed. |
ctrl | boolean | <optional> | Indicates if CTRL key was pressed. |
x | number | Mouse X position relative to the component. | |
y | number | Mouse Y position relative to the component. | |
screenX | number | Mouse X position relative to the screen. | |
screenY | number | Mouse Y position relative to the screen. |
PlayerEvent
Event object passed to MediaPlayer event handlers.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
type | string | Indicates the type of event triggered by the player. One of: | |
mediaType | string | <optional> | Type of media loaded in the player. One of: |
media | Media | <optional> | A Media object containing details about the loaded media. |
currentTime | number | <optional> | Current playback time in seconds. |
duration | number | <optional> | Total duration of the media in seconds. Present when |
reason | string | <optional> | Reason for stopping playback. One of: |
Point
Represents a point in 2D space with X and Y coordinates. Used when setting or getting position of UI component, Shape position, or Shape's anchor.
- Object
| Name | Type | Description |
|---|---|---|
x | number | The x-coordinate. |
y | number | The y-coordinate. |
<h2>Example of a Point object:</h2>
const point = {x: 300, y: 200};PopupEvent
Popup list event received by the onPopupEvents() handler callback in ComboBox, Menu and ContextMenu components.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
target | object | The component that triggered the event. | |
type | string | One of | |
x | number | <optional> | Component's X position relative to invoker. For |
y | number | <optional> | Component's Y position relative to invoker. For |
interactive | boolean | Indicates if the popup was triggered by user's interaction (not programmatically). | |
screenX | number | <optional> | X position of a |
screenY | number | <optional> | Y position of a |
invoker | object | <optional> | UI Component that invoked the popup, or |
PropertyChangeEvent
Property change event received by the onPropertyChange() handler callback.
- Object
| Name | Type | Description |
|---|---|---|
target | object | The component that triggered the event. |
type | string | Always |
property | string | The property that was changed. |
oldValue | any | Previous value of the changed property. |
newValue | any | New value of the changed property. |
ScrollEvent
Scroll event received by the onScroll() handler callback.
- Object
| Name | Type | Description |
|---|---|---|
target | object | The component that triggered the event. |
type | string | One of |
x | number | The new horizontal scroll position. |
y | number | The new vertical scroll position. |
maxX | number | The maximum horizontal scroll position. |
maxY | number | The maximum vertical scroll position. |
- See
Size
Represents the size of a 2D object. Used when setting or getting the size of UI component, Shape size, and more.
- Object
| Name | Type | Description |
|---|---|---|
width | number | The width dimension. |
height | number | The height dimension. |
<h2>Example of a Size object:</h2>
const size = {width: 300, height: 200};SubtitleStream
Describes a subtitle stream in the media.
- Object
| Name | Type | Description |
|---|---|---|
language | string | Language of the subtitle stream (e.g., |
codec | string | Codec used for the subtitle stream (e.g., |
default | boolean | Indicates if this is the default subtitle stream. |
TableColumn
Table column configuration object used in Table components.
- Object
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
text | string | The text to be displayed in the column header. (Required when creating a new column) | ||
type | string | <optional> | "text" | Type of component to display/edit cell data. Possible values:
|
sorting | Table. | <optional> | Table.Sorting.Natural | Sorting mode. |
icon_size | number | <optional> | For | |
cache_capacity | number | <optional> | 10 | For |
resizable | boolean | <optional> | true | Indicates if the column can be resized by the user. |
auto_resize | boolean | <optional> | true | Indicates if column auto-resizes with table (ignored if table auto resize is |
width | number | <optional> | Initial desired width of the column. | |
min_width | number | <optional> | Minimum width column can be resized to. | |
max_width | number | <optional> | Maximum width column can be resized to. | |
hidden | boolean | <optional> | false | Whether the column is hidden (width 0). |
character | string | <optional> | Mask character for | |
editable | boolean | <optional> | false | Whether text fields are editable. |
clicksToEdit | boolean | <optional> | Number of clicks required to make cell editable (only if editable). | |
options | Array.<string> | <optional> | List of values for |
<h2>Creating a simple column object:</h2>
let column = {
text: "New Column",
header_align: "center"
};VideoDevice
Represents a video input device, such as WebCam, video capture device, etc. Used when getting input devices with videoInputDevices getter and when setting input device with setInputDevice() method.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
name | string | <optional> | Name of the video input device (only present when retrieving a list of video input devices). |
id | string | ID of the video input device. | |
formats | Array.<VideoFormat> | <optional> | List of available video formats (only present when retrieving a list of video input devices). |
format | VideoFormat | <optional> | Chosen video format to use (required when setting a video input device). |
<h2>Setting a video input device:</h2>
const devices = player.videoInputDevices;
console.log(devices[0].formats[0]); // prints first format of a first device
const first_format = devices[0].formats[0];
// create new VideoDevice formatted object
const video_device = {
id: devices[0].id,
format: {
size: first_format.size,
fps: first_format.max_fps,
pixel_format: first_format.pixel_format, // set pixel_format in case when it is used instead of vcodec
vcodec: first_format.vcodec // set vcodec in case when it is used instead of pixel format
}
}
// set the video device and start playing
player.setInputDevice(video_device).play();VideoFormat
Represents a video format for a VideoDevice. When using this VideoFormat for video input device, make sure that either "pixel_format" or "vcodec" is specified as it was set when you retrieved the supported formats.
- Object
| Name | Type | Attributes | Description |
|---|---|---|---|
size | string | Video frame size in pixels (e.g., "1920x1080"). | |
min_fps | number | <optional> | Minimum available frame rate (e.g., 7.5). (provided when retrieving video input devices) |
max_fps | number | <optional> | Maximum available frame rate (e.g., 30). (provided when retrieving video input devices) |
fps | number | <optional> | Frame rate in frames per second (required when setting a video input device). |
pixel_format | string | <optional> | Frame image pixel format coming out of the device (e.g., "yuyv422"). If this is present, then |
vcodec | string | <optional> | Encoded video format that the video device supports (e.g., "mjpeg", "h264"). If this is present, then |
- See
<h2>Example of a VideoFormat object when retrieved with input devices:</h2>
const devices = player.videoInputDevices;
const first_format = devices[0].formats[0];
console.log(first_format); // prints first format of a first device
// outputs something like:
{
size: "1920x1080",
min_fps: 5,
max_fps: 30,
pixel_format: "yuyv422"
}<h2>Setting a video input device:</h2>
const devices = player.videoInputDevices;
console.log(devices[0].formats[0]); // prints first format of a first device
const first_format = devices[0].formats[0];
// create new VideoDevice formatted object
const video_device = {
id: devices[0].id,
format: {
size: first_format.size,
fps: first_format.max_fps,
pixel_format: first_format.pixel_format, // set pixel_format in case when it is used instead of vcodec
vcodec: first_format.vcodec // set vcodec in case when it is used instead of pixel format
}
}
// set the video device and start playing
player.setInputDevice(video_device).play();VideoStream
Describes a video stream in the media.
- Object
| Name | Type | Description |
|---|---|---|
sampleWidth | number | Original width of the video frame in pixels. |
sampleHeight | number | Original height of the video frame in pixels. |
width | number | Display width of the video. |
height | number | Display height of the video. |
pixelAspectRatio | string | Pixel aspect ratio (e.g., |
displayAspectRatio | string | Display aspect ratio (e.g., |
frameRate | number | Frame rate of the video stream. |
codec | string | Codec used to encode the video stream (e.g., |
pixelFormat | string | Pixel format of the video stream (e.g., |
progressive | boolean | Whether the video stream is progressive or interlaced. |
default | boolean | Indicates if this is the default video stream. |