Renderable
Direct Subclass:
Indirect Subclass:
The base renderable that all other renderables extend from.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public get |
This renderables container or null if none. |
|
public |
|
|
public get |
|
|
public |
destroyed: * |
|
public get |
This renderables height in pixels. |
|
public get |
The injector used to create this renderable. |
|
public get |
Whether this renderable is destroyed. |
|
public get |
The amount of content items belonging to this renderable. |
|
public get |
This renderables page offset x. |
|
public get |
This renderables page offset y. |
|
public |
tags: * |
|
public get |
A unique identifier for this renderable. |
|
public get |
This renderables width in pixels. |
Method Summary
Public Methods | ||
public |
addChild(item: Renderable, options: AddChildArgs) Adds a child item to this renderable. |
|
public |
contains(item: Renderable): boolean Whether a renderable is a descendant of this renderable. |
|
public |
createChild(renderable: RenderableArg<T>, providers: ProviderArg[]): T Creates a child renderable using this renderable as it's container. |
|
public |
destroy(): void Destroys this renderable and all it's children. |
|
public |
emit(event: T) Emits a BusEvent on this renderable. |
|
public |
emitDown(event: T) Emits a BusEvent down to all descendants recursively. |
|
public |
emitUp(event: T) Emits a BusEvent up to all parents recursively. |
|
public |
Gets the renderable area of this renderable. |
|
public |
getAtIndex(index: number): Renderable | null Gets a content renderable at an index. |
|
public |
getChildren(): Renderable[] Returns this renderables children renderables. |
|
public |
getDescendants(): Renderable[] Gets all descendants of this renderable recursively. |
|
public |
getIndexOf(item: Renderable): number Gets the index of a content renderable. |
|
public |
Gets this renderables parent or any parent that is an instance of the passed in constructor. |
|
public |
getParents(Ctor: Type<T>): T | null Gets this renderables parents or any parents that are an instance of the passed in constructor. |
|
public |
Handles any cleanup from a drop. |
|
public |
Invoked when the Injector has been assigned and ready for use. |
|
public |
isContainedWithin(item: Renderable): boolean Whether this renderable is a descendant of another renderable. |
|
public |
isDroppable(target: Renderable): boolean Whether this renderable can be dropped on. |
|
public |
Determines whether this renderable is visible. |
|
public |
remove() Removes this item from it's parent. If there is no parent then this renderable will just be destroyed. |
|
public |
removeChild(item: Renderable, options: RemoveChildArgs) Removes a content item from this renderable. |
|
public |
replaceChild(item: Renderable, withItem: Renderable, options: RemoveChildArgs) Replaces a content item on this renderable with another content item. |
|
public |
resize() Sets this components size and triggers it's childrens sizing. |
|
public |
scope(Event: Type<T>): Observable<T> Creates an Observable scoped to a specific event type. |
|
public |
setContainer(container: Renderable | null) Sets the container of this renderable. |
|
public |
subscribe(Event: Type<T>, observer: PartialObserver<T> | function(event: T)): Subscription Subscribes to a BusEvent. |
Public Constructors
public constructor() source
Public Methods
public addChild(item: Renderable, options: AddChildArgs) source
Adds a child item to this renderable.
Params:
Name | Type | Attribute | Description |
item | Renderable | ||
options | AddChildArgs |
|
public contains(item: Renderable): boolean source
Whether a renderable is a descendant of this renderable.
Params:
Name | Type | Attribute | Description |
item | Renderable |
public createChild(renderable: RenderableArg<T>, providers: ProviderArg[]): T source
Creates a child renderable using this renderable as it's container.
Params:
Name | Type | Attribute | Description |
renderable | RenderableArg<T> | ||
providers | ProviderArg[] |
|
Return:
T |
public emit(event: T) source
Emits a BusEvent on this renderable.
Params:
Name | Type | Attribute | Description |
event | T |
public emitDown(event: T) source
Emits a BusEvent down to all descendants recursively. Propagation can be stopped by any descending renderable.
Params:
Name | Type | Attribute | Description |
event | T |
public emitUp(event: T) source
Emits a BusEvent up to all parents recursively. Propagation can be stopped by any parent renderable.
Params:
Name | Type | Attribute | Description |
event | T |
public getAtIndex(index: number): Renderable | null source
Gets a content renderable at an index.
Params:
Name | Type | Attribute | Description |
index | number |
public getChildren(): Renderable[] source
Returns this renderables children renderables. This differs from content items as children should contain all renderables we want as part of the render cycle.
public getIndexOf(item: Renderable): number source
Gets the index of a content renderable.
Params:
Name | Type | Attribute | Description |
item | Renderable |
public getParent(Ctor: Type<T>): T | null source
Gets this renderables parent or any parent that is an instance of the passed in constructor. If non is found then null is returned.
Params:
Name | Type | Attribute | Description |
Ctor | Type<T> |
|
public getParents(Ctor: Type<T>): T | null source
Gets this renderables parents or any parents that are an instance of the passed in constructor.
Params:
Name | Type | Attribute | Description |
Ctor | Type<T> |
|
public isContainedWithin(item: Renderable): boolean source
Whether this renderable is a descendant of another renderable.
Params:
Name | Type | Attribute | Description |
item | Renderable |
public isDroppable(target: Renderable): boolean source
Whether this renderable can be dropped on.
Params:
Name | Type | Attribute | Description |
target | Renderable |
public remove() source
Removes this item from it's parent. If there is no parent then this renderable will just be destroyed.
public removeChild(item: Renderable, options: RemoveChildArgs) source
Removes a content item from this renderable.
Params:
Name | Type | Attribute | Description |
item | Renderable | ||
options | RemoveChildArgs |
|
public replaceChild(item: Renderable, withItem: Renderable, options: RemoveChildArgs) source
Replaces a content item on this renderable with another content item.
Params:
Name | Type | Attribute | Description |
item | Renderable | ||
withItem | Renderable | ||
options | RemoveChildArgs |
|
public scope(Event: Type<T>): Observable<T> source
Creates an Observable scoped to a specific event type.
Params:
Name | Type | Attribute | Description |
Event | Type<T> |
public setContainer(container: Renderable | null) source
Sets the container of this renderable.
Params:
Name | Type | Attribute | Description |
container | Renderable | null |
public subscribe(Event: Type<T>, observer: PartialObserver<T> | function(event: T)): Subscription source
Subscribes to a BusEvent.