From 4f6b2bf6e2e93e00244c8b902289f53d12c440d7 Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Mon, 13 Sep 2021 09:39:38 +0200 Subject: [PATCH] template stuff for components --- dist/r3.js | 1599 +++++++++++++---- package.json | 2 +- r3.php | 315 ++-- src/r3/r3-component/r3-canvas.js | 219 --- src/r3/r3-component/r3-component-canvas.js | 153 +- src/r3/r3-component/r3-component-d-o-m.js | 188 +- src/r3/r3-component/r3-component-graphics.js | 160 +- src/r3/r3-component/r3-component-image.js | 140 +- src/r3/r3-component/r3-component-input.js | 160 +- src/r3/r3-component/r3-component-material.js | 140 +- src/r3/r3-component/r3-component-mesh.js | 140 +- src/r3/r3-component/r3-component-texture.js | 140 +- src/r3/r3-component/r3-component-touch.js | 140 +- src/r3/r3-component/r3-component.js | 85 +- src/r3/r3-entity/r3-entity-slider.js | 81 +- src/r3/r3-entity/r3-entity.js | 89 +- src/r3/r3-event.js | 28 +- src/r3/r3-r3.js | 8 +- src/r3/r3-system/r3-system-d-o-m.js | 6 + src/r3/r3-system/r3-system-input.js | 6 + src/r3/r3-system/r3-system-linking.js | 6 + src/r3/r3-system/r3-system-render.js | 6 + src/r3/r3-system/r3-system-runtime.js | 30 + src/r3/r3-system/r3-system-socket.js | 6 + src/templates/component_base.template | 36 +- .../component_base_constructor.template | 5 + src/templates/component_extends.template | 44 +- .../component_extends_constructor.template | 3 + src/templates/entity_base.template | 3 +- .../entity_base_constructor.template | 6 +- src/templates/entity_extends.template | 2 + ...erated_custom_static_options_init.template | 3 + src/templates/token.db | 14 + src/templates/update_from_instance.template | 3 + src/templates/update_instance.template | 3 + utils.php | 2 +- version | 2 +- 37 files changed, 2870 insertions(+), 1103 deletions(-) delete mode 100644 src/r3/r3-component/r3-canvas.js diff --git a/dist/r3.js b/dist/r3.js index d8a2e28..f139495 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,57 +1,8 @@ class R3 { - static version = '2.0.579'; - static compileDate = '2021 Sep 11 - 06:49:25 am'; + static version = '2.0.645'; + static compileDate = '2021 Sep 13 - 09:34:27 am'; } -class Entity { - - constructor(options) { - - Event.Emit(Event.OBJECT_CREATED, this); - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - - /** - * initialize() - * - Should raise an event(s) which indicates that this object initialized - */ - initialize() { - - if (this.initialized) { - console.warn('Multiple calls to initialize() - check your callstack'); - } else { - delete this.callDepth; - this.initialized = true; - } - - Event.Emit(Event.OBJECT_INITIALIZED, this); - Event.Emit(Event.ENTITY_INITIALIZED, this); - - } - -} - -Entity.ENTITY_SLIDER = 0x0; -Entity.MAX_ENTITY = 0x1; - class Runtime { constructor() { @@ -353,13 +304,13 @@ class Event { } -Event.BEFORE_RENDER = 0x1; -Event.COMPONENT_CREATED = 0x2; -Event.COMPONENT_INITIALIZED = 0x3; -Event.CREATE_INSTANCE_BEFORE = 0x4; -Event.DISPOSE_INSTANCE = 0x5; -Event.DISPOSE_OBJECT = 0x6; -Event.DOM_COMPONENT_INITIALIZED = 0x7; +Event.COMPONENT_CREATED = 0x1; +Event.COMPONENT_INITIALIZED = 0x2; +Event.CREATE_INSTANCE_BEFORE = 0x3; +Event.DISPOSE_INSTANCE = 0x4; +Event.DISPOSE_OBJECT = 0x5; +Event.DOM_COMPONENT_INITIALIZED = 0x6; +Event.ENTITY_CREATED = 0x7; Event.ENTITY_INITIALIZED = 0x8; Event.GET_RUNTIME = 0x9; Event.GET_WINDOW_SIZE = 0xa; @@ -394,13 +345,13 @@ Event.MAX_EVENTS = 0x25; Event.GetEventName = function(eventId) { switch(eventId) { - case 0x1 : return 'before_render'; - case 0x2 : return 'component_created'; - case 0x3 : return 'component_initialized'; - case 0x4 : return 'create_instance_before'; - case 0x5 : return 'dispose_instance'; - case 0x6 : return 'dispose_object'; - case 0x7 : return 'dom_component_initialized'; + case 0x1 : return 'component_created'; + case 0x2 : return 'component_initialized'; + case 0x3 : return 'create_instance_before'; + case 0x4 : return 'dispose_instance'; + case 0x5 : return 'dispose_object'; + case 0x6 : return 'dom_component_initialized'; + case 0x7 : return 'entity_created'; case 0x8 : return 'entity_initialized'; case 0x9 : return 'get_runtime'; case 0xa : return 'get_window_size'; @@ -1709,80 +1660,6 @@ class Utils { } -/** - - Class R3.Entity.Slider - [Inherited from Entity] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - Inherited Static Methods: - - - - [Belonging to EntitySlider] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - **/ - -class EntitySlider extends Entity { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.initialized === 'undefined') { - options.initialized = false; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - Object.assign(this, options); - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - } - -} - /** Class R3.Runtime.Bullet @@ -2437,7 +2314,13 @@ class SystemDOM extends System { } +/** + * static Started - No comment + */ SystemDOM.Started = false; +/** + * static Subscriptions - No comment + */ SystemDOM.Subscriptions = {}; /** @@ -2709,7 +2592,13 @@ class SystemInput extends System { } +/** + * static Started - No comment + */ SystemInput.Started = false; +/** + * static Subscriptions - No comment + */ SystemInput.Subscriptions = {}; /** @@ -2861,7 +2750,13 @@ class SystemLinking extends System { } +/** + * static Started - No comment + */ SystemLinking.Started = false; +/** + * static Subscriptions - No comment + */ SystemLinking.Subscriptions = {}; /** @@ -2979,7 +2874,13 @@ class SystemRender extends System { } +/** + * static Started - No comment + */ SystemRender.Started = false; +/** + * static Subscriptions - No comment + */ SystemRender.Subscriptions = {}; /** @@ -3139,15 +3040,45 @@ class SystemRuntime extends System { } +/** + * static Started - No comment + */ SystemRuntime.Started = false; +/** + * static Subscriptions - No comment + */ SystemRuntime.Subscriptions = {}; +/** + * static Projects - No comment + */ SystemRuntime.Projects = []; +/** + * static CurrentProject - No comment + */ SystemRuntime.CurrentProject = null; +/** + * static RuntimeCoder - No comment + */ SystemRuntime.RuntimeCoder = {}; +/** + * static RuntimeDOM - No comment + */ SystemRuntime.RuntimeDOM = {}; +/** + * static RuntimeGUI - No comment + */ SystemRuntime.RuntimeGUI = {}; +/** + * static RuntimeGraphics - No comment + */ SystemRuntime.RuntimeGraphics = {}; +/** + * static RuntimePhysics - No comment + */ SystemRuntime.RuntimePhysics = {}; +/** + * static RuntimeStatistics - No comment + */ SystemRuntime.RuntimeStatistics = {}; /** @@ -3241,7 +3172,13 @@ class SystemSocket extends System { } +/** + * static Started - No comment + */ SystemSocket.Started = false; +/** + * static Subscriptions - No comment + */ SystemSocket.Subscriptions = {}; /** @@ -3775,6 +3712,141 @@ class RuntimeStats extends RuntimeStatistics { } +/** + + Class R3.Event.Object.Entity + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Should raise an event(s) which indicates that this object initialized + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - id (Default value Utils.RandomId(10)) + - name (Default value 'Object ' + options.id) + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Overrides for R3.Event.initialize() + + Inherited Static Methods: + + + + [Belonging to Entity] + + Properties: + + + + Static Properties: + + + + Methods: + + - initialize() + Overrides for R3.Event.R3Object.initialize() + + Static Methods: + + + + **/ + +class Entity extends R3Object { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + this.emit(Event.ENTITY_CREATED, this); + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialize(); + } else { + options.callDepth--; + } + + } + + /** + * initialize() + * - Should raise an event(s) which indicates that this object initialized + */ + initialize() { + + if (this.initialized) { + console.warn('Multiple calls to initialize() - check your callstack'); + } else { + delete this.callDepth; + this.initialized = true; + } + + Event.Emit(Event.OBJECT_INITIALIZED, this); + Event.Emit(Event.ENTITY_INITIALIZED, this); + + } + +} + +Entity.ENTITY_SLIDER = 0x0; +Entity.MAX_ENTITY = 0x1; + /** Class R3.Event.Object.Component @@ -3850,25 +3922,32 @@ class RuntimeStats extends RuntimeStatistics { Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Static Methods: + TEMPLATE_OPTIONS_START + register=true + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + StaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_METHODS_START + initialize() - Should raises an event(s) which indicates that this object initialized + createInstance() - Creates an instance of this object based on the current runtime + dispose() - Disposes of this object by disposing the instance first. + disposeInstance() - Disposes of the runtime instance. + setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + Test() - A static template Test method + TEMPLATE_STATIC_METHODS_END + **/ class Component extends R3Object { @@ -3889,6 +3968,13 @@ class Component extends R3Object { this.emit(Event.COMPONENT_CREATED, this); + /** + * register - No comment + */ + if (typeof options.register === 'undefined') { + options.register = true; + } + Object.assign(this, options); if (options.callDepth === 0) { @@ -3979,8 +4065,21 @@ class Component extends R3Object { } + /** + * Test() + * - A static template Test method + */ + static Test() { + + } + } +/** + * static StaticOptionTest - A static test option + */ +Component.StaticOptionTest = true; + Component.COMPONENT_DOM = 0x0; Component.COMPONENT_CANVAS = 0x1; Component.COMPONENT_GRAPHICS = 0x2; @@ -4125,6 +4224,154 @@ class Project extends R3Object { } +/** + + Class R3.Event.Object.Entity.Slider + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Should raise an event(s) which indicates that this object initialized + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - id (Default value Utils.RandomId(10)) + - name (Default value 'Object ' + options.id) + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Overrides for R3.Event.initialize() + + Inherited Static Methods: + + + + [Inherited from Entity] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Overrides for R3.Event.R3Object.initialize() + + Inherited Static Methods: + + + + [Belonging to EntitySlider] + + Properties: + + - parent (Default value null) + - components (Default value [] - A list of components that this entity is composed of) + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + **/ + +class EntitySlider extends Entity { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + if (typeof options.initialized === 'undefined') { + options.initialized = false; + } + + if (typeof options.callDepth === 'undefined') { + options.callDepth = 0; + } else { + options.callDepth++; + } + + super(options); + + /** + * parent - No comment + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } + /** + * components - A list of components that this entity is composed of + */ + if (typeof options.components === 'undefined') { + options.components = []; + } + + Object.assign(this, options); + + if (options.callDepth === 0) { + this.initialize(); + } else { + options.callDepth--; + } + + } + +} + /** Class R3.Event.Object.Component.DOM @@ -4200,20 +4447,7 @@ class Project extends R3Object { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -4240,7 +4474,31 @@ class Project extends R3Object { + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -4264,6 +4522,25 @@ class ComponentDOM extends Component { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } + /** + * instance - Holds the current instance of this object as determined (built) by the runtime object. + */ + if (typeof options.instance === 'undefined') { + options.instance = null; + } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ @@ -4281,6 +4558,92 @@ class ComponentDOM extends Component { } + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + if (property === 'instance') { + this.instance.instance = this.instance; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : instance, + instanceProperty : instance + } + ); + if (property !== 'all') { + return; + } + } + + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + if (property === 'instance' || property === 'all') { + this.instance = this.instance.instance; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : instance, + instanceProperty : instance + } + ); + if (property !== 'all') { + return; + } + } + + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + /** * initialize() * - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an @@ -4303,6 +4666,11 @@ class ComponentDOM extends Component { } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentDOM.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.Graphics @@ -4378,20 +4746,7 @@ class ComponentDOM extends Component { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -4401,8 +4756,7 @@ class ComponentDOM extends Component { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -4418,7 +4772,31 @@ class ComponentDOM extends Component { + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -4442,12 +4820,24 @@ class ComponentGraphics extends Component { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } Object.assign(this, options); @@ -4459,6 +4849,62 @@ class ComponentGraphics extends Component { } + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + /** * initialize() * - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an @@ -4481,6 +4927,11 @@ class ComponentGraphics extends Component { } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentGraphics.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.Input @@ -4556,20 +5007,7 @@ class ComponentGraphics extends Component { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -4579,8 +5017,7 @@ class ComponentGraphics extends Component { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -4596,7 +5033,31 @@ class ComponentGraphics extends Component { + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -4620,12 +5081,24 @@ class ComponentInput extends Component { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } Object.assign(this, options); @@ -4637,6 +5110,62 @@ class ComponentInput extends Component { } + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + } + /** * initialize() * - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an @@ -4659,6 +5188,11 @@ class ComponentInput extends Component { } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentInput.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.DOM.Canvas @@ -4734,20 +5268,7 @@ class ComponentInput extends Component { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -4778,8 +5299,6 @@ class ComponentInput extends Component { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) - type (Default value 'canvas') - width (Default value 500 - The initial width of the canvas (You can override it with CSS)) - height (Default value 500 - The initial height of the canvas (You can override it with CSS)) @@ -4791,17 +5310,39 @@ class ComponentInput extends Component { Methods: - - updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. - - - updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + Static Methods: + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + type + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -4825,12 +5366,25 @@ class ComponentCanvas extends ComponentDOM { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + /** * type - No comment */ @@ -4875,20 +5429,6 @@ class ComponentCanvas extends ComponentDOM { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); - if (property === 'type') { - this.instance.type = this.type; - this.emit( - Event.UPDATE_INSTANCE_PROPERTY, - { - component : this, - property : type, - instanceProperty : type - } - ); - if (property !== 'all') { - return; - } - } if (property === 'width') { this.instance.width = this.width; this.emit( @@ -4932,6 +5472,21 @@ class ComponentCanvas extends ComponentDOM { } } + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_INSTANCE_AFTER, this); } @@ -4945,20 +5500,6 @@ class ComponentCanvas extends ComponentDOM { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); - if (property === 'type' || property === 'all') { - this.type = this.instance.type; - this.emit( - Event.UPDATE_PROPERTY_FROM_INSTANCE, - { - component : this, - property : type, - instanceProperty : type - } - ); - if (property !== 'all') { - return; - } - } if (property === 'width' || property === 'all') { this.width = this.instance.width; this.emit( @@ -5002,12 +5543,32 @@ class ComponentCanvas extends ComponentDOM { } } + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); } } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentCanvas.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.Graphics.Image @@ -5083,20 +5644,7 @@ class ComponentCanvas extends ComponentDOM { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -5106,8 +5654,7 @@ class ComponentCanvas extends ComponentDOM { Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -5127,8 +5674,7 @@ class ComponentCanvas extends ComponentDOM { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -5136,17 +5682,37 @@ class ComponentCanvas extends ComponentDOM { Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -5170,12 +5736,24 @@ class ComponentImage extends ComponentGraphics { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } Object.assign(this, options); @@ -5189,30 +5767,67 @@ class ComponentImage extends ComponentGraphics { /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_INSTANCE_AFTER, this); } /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); } } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentImage.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.Graphics.Material @@ -5288,20 +5903,7 @@ class ComponentImage extends ComponentGraphics { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -5311,8 +5913,7 @@ class ComponentImage extends ComponentGraphics { Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -5332,8 +5933,7 @@ class ComponentImage extends ComponentGraphics { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -5341,17 +5941,37 @@ class ComponentImage extends ComponentGraphics { Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -5375,12 +5995,24 @@ class ComponentMaterial extends ComponentGraphics { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } Object.assign(this, options); @@ -5394,30 +6026,67 @@ class ComponentMaterial extends ComponentGraphics { /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_INSTANCE_AFTER, this); } /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); } } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentMaterial.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.Graphics.Mesh @@ -5493,20 +6162,7 @@ class ComponentMaterial extends ComponentGraphics { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -5516,8 +6172,7 @@ class ComponentMaterial extends ComponentGraphics { Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -5537,8 +6192,7 @@ class ComponentMaterial extends ComponentGraphics { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -5546,17 +6200,37 @@ class ComponentMaterial extends ComponentGraphics { Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -5580,12 +6254,24 @@ class ComponentMesh extends ComponentGraphics { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } Object.assign(this, options); @@ -5599,30 +6285,67 @@ class ComponentMesh extends ComponentGraphics { /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_INSTANCE_AFTER, this); } /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); } } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentMesh.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.Graphics.Texture @@ -5698,20 +6421,7 @@ class ComponentMesh extends ComponentGraphics { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -5721,8 +6431,7 @@ class ComponentMesh extends ComponentGraphics { Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -5742,8 +6451,7 @@ class ComponentMesh extends ComponentGraphics { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -5751,17 +6459,37 @@ class ComponentMesh extends ComponentGraphics { Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -5785,12 +6513,24 @@ class ComponentTexture extends ComponentGraphics { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } Object.assign(this, options); @@ -5804,30 +6544,67 @@ class ComponentTexture extends ComponentGraphics { /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_INSTANCE_AFTER, this); } /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); } } +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentTexture.ExtendsStaticOptionTest = true; + /** Class R3.Event.Object.Component.Input.Touch @@ -5903,20 +6680,7 @@ class ComponentTexture extends ComponentGraphics { Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -5926,8 +6690,7 @@ class ComponentTexture extends ComponentGraphics { Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -5947,8 +6710,7 @@ class ComponentTexture extends ComponentGraphics { Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -5956,17 +6718,37 @@ class ComponentTexture extends ComponentGraphics { Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END **/ @@ -5990,12 +6772,24 @@ class ComponentTouch extends ComponentInput { super(options); + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } Object.assign(this, options); @@ -6009,36 +6803,73 @@ class ComponentTouch extends ComponentInput { /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_INSTANCE_AFTER, this); } /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); } } -R3.Entity = Entity; +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentTouch.ExtendsStaticOptionTest = true; + R3.Runtime = Runtime; R3.System = System; R3.Event = Event; R3.Utils = Utils; R3.Object = R3Object; +R3.Entity = Entity; R3.Component = Component; R3.Project = Project; R3.DOM = ComponentDOM; diff --git a/package.json b/package.json index bd696d5..221df57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.579", + "version" : "2.0.645", "description": "", "private": true, "dependencies": { diff --git a/r3.php b/r3.php index b00cf25..31ad4f3 100755 --- a/r3.php +++ b/r3.php @@ -6,36 +6,41 @@ include "graph.php"; global $files; -function getTokens($type) +function getTokens($types) { - $fn = fopen('src/templates/token.db', "r"); $tokens = []; - while (!feof($fn)) { + foreach ($types as $type) { - $line = fgets($fn); + $fn = fopen('src/templates/token.db', "r"); + + while (!feof($fn)) { + + $line = fgets($fn); + + $matches = []; + if (preg_match('/^(' . $type . '.*$)/', $line, $matches)) { + $tokens[$matches[1]] = []; + } - $matches = []; - if (preg_match('/^(' . $type . '.*$)/', $line, $matches)) { - $tokens[$matches[1]] = []; } + fclose($fn); } - fclose($fn); - return $tokens; } /** + * Warning - does not do nested token extractions * @throws ErrorException */ -function loadSaved($file, $tokens) { +function loadSaved($file, $tokens, $extract = false) { - $saveFile = $file . '.saved'; + $saveFile = $file; - echo "loading file " . $saveFile . "\n"; +// echo "loading file " . $saveFile . "\n"; $loadedTokens = []; @@ -53,8 +58,13 @@ function loadSaved($file, $tokens) { $tokenFound = false; + $justFound = false; + foreach ($tokens as $key => $store) { - if (preg_match('/\b' . $key . '\b/', $line)) + if ( + preg_match('/\b' . $key . '\b/', $line) || + ($extract && preg_match('/\b' . $key . '_START\b/', $line)) + ) { if (array_key_exists($key, $loadedTokens)) { throw new ErrorException("TOKEN ALREADY EXISTS! : $key\n"); @@ -66,8 +76,14 @@ function loadSaved($file, $tokens) { } } + if ($extract && preg_match('/\b' . $currentTokenKey . '_END\b/', $line)) { + $currentTokenKey = null; + } + if (!$tokenFound && $line != false) { - array_push($loadedTokens[$currentTokenKey], $line); + if ($currentTokenKey != null) { + array_push($loadedTokens[$currentTokenKey], $line); + } } } @@ -114,7 +130,7 @@ function getFileData($file, &$tokens) function save($file, $tokens) { - echo "saving file " . $file . "\n"; +// echo "saving file " . $file . "\n"; getFileData($file, $tokens); @@ -136,7 +152,7 @@ function save($file, $tokens) { file_put_contents($saveFile, $saved); - echo "saved file $saveFile\n"; +// echo "saved file $saveFile\n"; return [ $saveFile, @@ -275,7 +291,7 @@ function doGetInheritedTemplateUpdates($node, $restoreTokens, $inherited = true, if (!file_exists($saveFile)) { save($node->file, $restoreTokens); } - $tokens = loadSaved($node->file, $restoreTokens); + $tokens = loadSaved($node->file . '.saved', $restoreTokens); if ($node->parent !== null) { $parentSaveFile = $node->parent->file . '.saved'; @@ -283,7 +299,7 @@ function doGetInheritedTemplateUpdates($node, $restoreTokens, $inherited = true, save($node->parent->file, $restoreTokens); } } - $parentTokens = loadSaved($node->parent->file, $restoreTokens); + $parentTokens = loadSaved($node->parent->file . '.saved', $restoreTokens); } catch (ErrorException $e) { echo $e->getMessage(); @@ -431,7 +447,7 @@ function generateInherited($file, $restoreTokens) function generateConstructors($file, $command) { - echo $file; +// echo $file; $constructor = null; $token = 'GENERATED_CONSTRUCTOR'; @@ -485,80 +501,79 @@ function generateConstructors($file, $command) } -function generateInitOptions($file, $tokens) +function extractOption($item, $template) { - $token = 'CUSTOM_OPTIONS'; + + $item = trim($item); + + $key_value = preg_split('/=/', $item); + if ($key_value === false) { + return ''; + } + + $key = $key_value[0]; + $value = $key_value[1]; + + $comment_value = preg_split('/\s+-\s+/', $value); + $comment = ''; + if ($comment_value != false) { + $value = $comment_value[0]; + if (array_key_exists(1, $comment_value)) { + $comment = $comment_value[1]; + } else { + $comment = 'No comment'; + } + $comment = wordwrap($comment, 100, "\n * "); + } + $updated = str_replace('COMMENT', $comment, $template); + $updated = str_replace('KEY', $key, $updated); + $updated = str_replace('VALUE', $value, $updated); + return $updated; + +} + +function generateInitOptions($file, $tokens, $token, $section) +{ + $store = getTokenStore($token, $tokens); if (sizeof($store) <= 0) { return; } - echo "Will be building options for $token\n"; +// echo "Will be building options for $token\n"; $template = file_get_contents('src/templates/generated_custom_options_init.template'); $updates = ''; foreach ($store as $item) { - $item = trim($item); - $key_value = preg_split('/=/', $item); - if ($key_value === false) { - continue; - } - - $key = $key_value[0]; - $value = $key_value[1]; - - $comment_value = preg_split('/\s+-\s+/', $value); - $comment = ''; - if ($comment_value != false) { - $value = $comment_value[0]; - if (array_key_exists(1, $comment_value)) { - $comment = $comment_value[1]; - } else { - $comment = 'No comment'; - } - $comment = wordwrap($comment, 100, "\n * "); - } - $updated = str_replace('COMMENT', $comment, $template); - $updated = str_replace('KEY', $key, $updated); - $updated = str_replace('VALUE', $value, $updated); - $updates .= $updated; + $updates .= extractOption($item, $template); } - updateSection($file, 'GENERATED_OPTIONS_INIT' , $updates); + updateSection($file, $section , $updates); } -function generateInitStaticOptions($file, $tokens) +function generateInitStaticOptions($file, $tokens, $token, $section) { - $token = 'CUSTOM_STATIC_OPTIONS'; + $store = getTokenStore($token, $tokens); if (sizeof($store) <= 0) { return; } - echo "Will be building static options for $token\n"; +// echo "Will be building static options for $token\n"; $template = file_get_contents('src/templates/generated_custom_static_options_init.template'); $updates = ''; foreach ($store as $item) { - $item = trim($item); - $key_value = preg_split('/=/', $item); - if ($key_value === false) { - continue; - } - $key = $key_value[0]; - $value = $key_value[1]; - $updated = str_replace('KEY', $key, $template); - $updated = str_replace('VALUE', $value, $updated); - $updates .= $updated; + $updates .= extractOption($item, $template); } - updateSection($file, 'GENERATED_STATIC_OPTIONS_INIT' , $updates); + updateSection($file, $section , $updates); } function getTokenStore($tokenName, $tokens) @@ -569,11 +584,11 @@ function getTokenStore($tokenName, $tokens) return []; } -function getInstanceMappings($tokens) +function getInstanceMappings($tokens, $token) { $instanceMappings = []; - foreach (getTokenStore('CUSTOM_INSTANCE_OPTIONS_MAPPING', $tokens) as $mapping) { + foreach (getTokenStore($token, $tokens) as $mapping) { $mapping = trim($mapping); @@ -592,14 +607,14 @@ function getInstanceMappings($tokens) return $instanceMappings; } -function isExcluded($key, $tokens) +function isExcluded($key, $tokens, $excludedToken) { - if (array_key_exists('CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS', $tokens)) { + if (array_key_exists($excludedToken, $tokens)) { $excluded = []; - foreach ($tokens['CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS'] as $exclude) { + foreach ($tokens[$excludedToken] as $exclude) { array_push($excluded, trim($exclude)); } @@ -612,23 +627,19 @@ function isExcluded($key, $tokens) return false; } -function doInstanceUpdate($template, $tokens, $asArray = false) +function doInstanceUpdate($template, $tokens, $token, $mappingToken, $excludedToken) { - $token = 'CUSTOM_OPTIONS'; + $store = getTokenStore($token, $tokens); if (sizeof($store) <= 0) { return null; } - $instanceMappings = getInstanceMappings($tokens); + $instanceMappings = getInstanceMappings($tokens, $mappingToken); $updates = ''; - if ($asArray) { - $updates = []; - } - foreach ($store as $item) { $item = trim($item); @@ -646,67 +657,49 @@ function doInstanceUpdate($template, $tokens, $asArray = false) $value = $instanceMappings[$key]; } - if (isExcluded($key, $tokens)){ + if (isExcluded($key, $tokens, $excludedToken)){ continue; } $updated = str_replace('INSTANCE_KEY', $value, $template); $updated = str_replace('KEY', $key, $updated); - if ($asArray) { - array_push($updates, $updated); - } else { - $updates .= $updated; - } + $updates .= $updated; } return $updates; } -function generateCreateInstanceOptions($file, $tokens) -{ - $template = file_get_contents('src/templates/generated_create_instance_options.template'); - - $updates = doInstanceUpdate($template, $tokens, true); - - if ($updates) { - echo "Updating create instance options\n"; - updateSection($file, 'GENERATED_CREATE_INSTANCE_OPTIONS', $updates, ",\n"); - } else { - echo "No create instance options found to generate\n"; - } -} - /** * Process updateInstance options */ -function generateUpdateInstanceOptions($file, $tokens) +function generateUpdateInstanceOptions($file, $tokens, $token, $section, $mappingToken, $excludedToken) { $template = file_get_contents('src/templates/generated_update_instance_options.template'); - $updates = doInstanceUpdate($template, $tokens); + $updates = doInstanceUpdate($template, $tokens, $token, $mappingToken, $excludedToken); if ($updates) { - echo "Updating update instance options\n"; - updateSection($file, 'GENERATED_UPDATE_INSTANCE_OPTIONS', $updates); +// echo "Updating update instance options\n"; + updateSection($file, $section, $updates); } else { - echo "No update instance options found to generate\n"; +// echo "No update instance options found to generate\n"; } } /** * Process updateFromInstance options */ -function generateUpdateFromInstanceOptions($file, $tokens) +function generateUpdateFromInstanceOptions($file, $tokens, $token, $section, $mappingToken, $excludedToken) { $template = file_get_contents('src/templates/generated_update_from_instance_options.template'); - $updates = doInstanceUpdate($template, $tokens); + $updates = doInstanceUpdate($template, $tokens, $token, $mappingToken, $excludedToken); if ($updates) { - echo "Updating update from instance options\n"; - updateSection($file, 'GENERATED_UPDATE_FROM_INSTANCE_OPTIONS', $updates); +// echo "Updating update from instance options\n"; + updateSection($file, $section, $updates); } else { - echo "No update from instance options found to generate\n"; +// echo "No update from instance options found to generate\n"; } } @@ -942,9 +935,9 @@ function doMethodUpdate($template, $tokens, $token) $updated = $template; - if ($token === 'CUSTOM_METHODS') { + if ($token === 'CUSTOM_METHODS' || $token === 'TEMPLATE_METHODS') { $potentialTemplate = strtolower('src/templates/' . $methodTokenName . '.template'); - } else { + } else if ($token === 'CUSTOM_STATIC_METHODS' || $token === 'TEMPLATE_STATIC_METHODS') { $potentialTemplate = strtolower('src/templates/static_' . $methodTokenName . '.template'); } @@ -966,19 +959,17 @@ function doMethodUpdate($template, $tokens, $token) return $updates; } -function generateStaticMethods($file, $tokens) +function generateStaticMethods($file, $tokens, $token, $section) { - $token = 'CUSTOM_STATIC_METHODS'; - $template = file_get_contents('src/templates/generated_static_methods.template'); $updates = doMethodUpdate($template, $tokens, $token); if ($updates) { - echo "Updating static methods\n"; - updateSection($file, 'GENERATED_STATIC_METHODS', $updates); +// echo "Updating static methods\n"; + updateSection($file, $section, $updates); } else { - echo "No static methods found to generate\n"; +// echo "No static methods found to generate\n"; } } @@ -1102,10 +1093,10 @@ function generateEventListenerMethods($file, $tokens) $updates = getEventListenerUpdates($template, $tokens, $token); if ($updates) { - echo "Updating event listeners.. \n"; +// echo "Updating event listeners.. \n"; updateSection($file, 'GENERATED_EVENT_LISTENER_METHODS', $updates); } else { - echo "No event listeners found to generate\n"; +// echo "No event listeners found to generate\n"; } } @@ -1119,27 +1110,25 @@ function generateStaticEventListenerMethods($file, $tokens) $updates = getStaticEventListenerUpdates($template, $tokens, $token); if ($updates) { - echo "Updating static event listeners.. \n"; +// echo "Updating static event listeners.. \n"; updateSection($file, 'GENERATED_STATIC_EVENT_LISTENER_METHODS', $updates); } else { - echo "No static event listeners found to generate\n"; +// echo "No static event listeners found to generate\n"; } } -function generateMethods($file, $tokens) +function generateMethods($file, $tokens, $token, $section) { - $token = 'CUSTOM_METHODS'; $template = file_get_contents('src/templates/generated_methods.template'); $updates = doMethodUpdate($template, $tokens, $token); if ($updates) { - echo "Updating methods\n"; - updateSection($file, 'GENERATED_METHODS', $updates); + updateSection($file, $section, $updates); } else { - echo "No methods found to generate\n"; +// echo "No methods found to generate\n"; } } @@ -1246,9 +1235,9 @@ function generateR3($nodes, $graph) $r3File = 'src/r3/r3-r3.js'; - save($r3File, getTokens('CUSTOM')); + save($r3File, getTokens(['CUSTOM'])); - $tokens = loadSaved($r3File, getTokens('CUSTOM')); + $tokens = loadSaved($r3File . '.saved', getTokens(['CUSTOM'])); $template = file_get_contents('src/templates/r3_base.template'); @@ -1298,6 +1287,9 @@ function generateR3($nodes, $graph) function generateEvents() { + + echo "Generating Events\n"; + global $files; $events = []; @@ -1313,7 +1305,7 @@ function generateEvents() !preg_match('/r3\-event/', $file) ) { - echo "processing file " . $file . "\n"; +// echo "processing file " . $file . "\n"; $fn = fopen($file, "r"); @@ -1373,8 +1365,8 @@ function generateEvents() $eventFunction .= "\t}\n\n"; $eventFunction .= "};\n"; - echo $eventList; - echo $eventFunction; +// echo $eventList; +// echo $eventFunction; updateSection('./src/r3/r3-event.js', 'GENERATED_EVENTS' , $eventList . $eventFunction); @@ -1400,8 +1392,8 @@ function generateR3Dist($nodes) $template = str_replace('VERSION', $version, $template); fwrite($r3js, $template); - $generateTokens = getTokens('GENERATED'); - $customTokens = getTokens('CUSTOM'); + $generateTokens = getTokens(['GENERATED']); + $customTokens = getTokens(['CUSTOM']); $savedGenerate = save($r3jsSource, $generateTokens)[1]; $savedCustom = save($r3jsSource, $customTokens)[1]; @@ -1503,7 +1495,7 @@ function generateR3Dist($nodes) function updateParentSystems($nodes) { foreach ($nodes as $node) { - if (preg_match('/System/', $node->name)) { + if (preg_match('/(System|Component|Entity|Runtime)/', $node->name)) { $className = $node->name; $parentName = $node->parent->name; @@ -1528,7 +1520,7 @@ function updateParentSystems($nodes) function buildNodeList($file) { - echo "loading file $file\n"; +// echo "loading file $file\n"; global $nodeList; @@ -1671,7 +1663,7 @@ foreach ($files as $file) { exit(0); } - $tokens = getTokens('CUSTOM'); + $tokens = getTokens(['CUSTOM']); $result = save($file, $tokens); @@ -1681,17 +1673,27 @@ foreach ($files as $file) { $saveFile = $file . '.saved'; - $restoreTokens = getTokens('CUSTOM'); + $restoreTokens = getTokens(['CUSTOM']); $restoreTokenKeys = array_keys($restoreTokens); try { - $tokens = loadSaved($file, $restoreTokens); + $tokens = loadSaved($file . '.saved', $restoreTokens); } catch (ErrorException $e) { echo $e->getMessage(); exit(0); } + $templateTokens = getTokens(['TEMPLATE']); + try { + $tokenData = loadSaved($file, $templateTokens, true); + } catch (ErrorException $e) { + echo $e->getMessage(); + exit(0); + } + + $tokens = array_merge($tokens, $tokenData); + $skipped = []; foreach ($tokens as $token => $store) { @@ -1700,38 +1702,45 @@ foreach ($files as $file) { } } - /** - * Check if we have no saved custom methods but introduced them - * from a template - */ - if (!in_array('CUSTOM_METHODS', array_keys($tokens))){ - $methodTokens = getTokens('CUSTOM_METHODS'); - getFileData($file, $methodTokens); - - if (sizeof($methodTokens['CUSTOM_METHODS']) > 0) { - $tokens['CUSTOM_METHODS'] = $methodTokens['CUSTOM_METHODS']; - } - } + echo "Generating Constructors\n"; generateConstructors($file, $argv[3]); - generateMethods($file, $tokens); + echo "Generating Methods\n"; - generateStaticMethods($file, $tokens); + generateMethods($file, $tokens, 'TEMPLATE_METHODS', 'GENERATED_TEMPLATE_METHODS'); + + generateMethods($file, $tokens, 'CUSTOM_METHODS', 'GENERATED_METHODS'); + + generateStaticMethods($file, $tokens, 'CUSTOM_STATIC_METHODS', 'GENERATED_STATIC_METHODS'); + + generateStaticMethods($file, $tokens, 'TEMPLATE_STATIC_METHODS', 'GENERATED_TEMPLATE_STATIC_METHODS'); generateEventListenerMethods($file, $tokens); generateStaticEventListenerMethods($file, $tokens); - generateInitOptions($file, $tokens); + echo "Generating Options\n"; - generateInitStaticOptions($file, $tokens); + generateInitOptions($file, $tokens, 'TEMPLATE_OPTIONS', 'GENERATED_TEMPLATE_OPTIONS_INIT'); - generateCreateInstanceOptions($file, $tokens); + generateInitOptions($file, $tokens, 'CUSTOM_OPTIONS', 'GENERATED_OPTIONS_INIT'); - generateUpdateInstanceOptions($file, $tokens); + generateInitStaticOptions($file, $tokens, 'CUSTOM_STATIC_OPTIONS', 'GENERATED_STATIC_OPTIONS_INIT'); - generateUpdateFromInstanceOptions($file, $tokens); + generateInitStaticOptions($file, $tokens, 'TEMPLATE_STATIC_OPTIONS', 'GENERATED_TEMPLATE_STATIC_OPTIONS_INIT'); + +// generateCreateInstanceOptions($file, $tokens); + + generateUpdateInstanceOptions($file, $tokens, 'CUSTOM_OPTIONS', 'GENERATED_UPDATE_INSTANCE_OPTIONS', 'CUSTOM_INSTANCE_OPTIONS_MAPPING', 'CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS'); + + generateUpdateInstanceOptions($file, $tokens, 'TEMPLATE_OPTIONS', 'GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS', 'TEMPLATE_INSTANCE_OPTIONS_MAPPING', 'TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS'); + + generateUpdateFromInstanceOptions($file, $tokens, 'CUSTOM_OPTIONS', 'GENERATED_UPDATE_FROM_INSTANCE_OPTIONS', 'CUSTOM_INSTANCE_OPTIONS_MAPPING', 'CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS'); + + generateUpdateFromInstanceOptions($file, $tokens, 'TEMPLATE_OPTIONS', 'GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS', 'TEMPLATE_INSTANCE_OPTIONS_MAPPING', 'TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS'); + + echo "Generating Event Listeners\n"; generateEventListenersStart($file, $tokens); @@ -1786,7 +1795,7 @@ if ($argv[2] == 'build-dist') { $nodeList ); - $restoreTokens = getTokens('CUSTOM'); + $restoreTokens = getTokens(['CUSTOM']); $restoreTokenKeys = array_keys($restoreTokens); @@ -1824,6 +1833,8 @@ if ($argv[2] == 'build-dist') { ] ); + echo "Building Distribution\n"; + generateR3($nodes, $graph); generateR3Dist($nodes); diff --git a/src/r3/r3-component/r3-canvas.js b/src/r3/r3-component/r3-canvas.js deleted file mode 100644 index c665ecb..0000000 --- a/src/r3/r3-component/r3-canvas.js +++ /dev/null @@ -1,219 +0,0 @@ -const Event = require('.././r3-event'); -const Utils = require('.././r3-utils'); -const DOM = require('.././r3-d-o-m.js'); - -/** - - GENERATED_INHERITED_START - - Class R3.Event.Object.Component.DOM.Canvas - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raise an event(s) which indicates that this object initialized - - - async(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Async()' passing it the arguments - - - emit(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Emit()' passing it the arguments - - - subscribe(eventId, callback) - Simply calls 'Subscribe()' passing it the arguments - - Inherited Static Methods: - - - Async(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as - arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the - error as argument. - - - Emit(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after - the event result is obtained, passing it the result. If an exception occurs during execution, the - clientErrorCallback is called with the error as argument. - - - Subscribe(eventId, callback) - Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised - - [Inherited from R3Object] - - Inherited Properties: - - - id (Default value Utils.RandomId(10)) - - name (Default value 'Object ' + options.id) - - register (Default value true) - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Overrides for R3.Event.initialize() - - Inherited Static Methods: - - - - [Inherited from Component] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - updateFromInstance() - Updates this object by copying the values of its instance into the current object. - - - getRuntime() - Gets the current runtime object - - Inherited Static Methods: - - - - [Inherited from DOM] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - initialize() - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an - Event.DOM_COMPONENT_INITIALIZED - - Inherited Static Methods: - - - - [Belonging to Canvas] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - GENERATED_INHERITED_END - - CUSTOM_OPTIONS_START - CUSTOM_OPTIONS_END - - CUSTOM_INSTANCE_OPTIONS_MAPPING_START - CUSTOM_INSTANCE_OPTIONS_MAPPING_END - - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END - - CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END - - CUSTOM_METHODS_START - CUSTOM_METHODS_END - - CUSTOM_STATIC_METHODS_START - CUSTOM_STATIC_METHODS_END - - **/ - -class Canvas extends DOM { - - //GENERATED_CONSTRUCTOR_START - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - if (typeof options.callDepth === 'undefined') { - options.callDepth = 0; - } else { - options.callDepth++; - } - - super(options); - - //GENERATED_OPTIONS_INIT_START - //GENERATED_OPTIONS_INIT_END - - //CUSTOM_OPTIONS_INIT_START - //CUSTOM_OPTIONS_INIT_END - - Object.assign(this, options); - - //CUSTOM_BEFORE_INIT_START - //CUSTOM_BEFORE_INIT_END - - if (options.callDepth === 0) { - this.initialize(); - } else { - options.callDepth--; - } - - //CUSTOM_AFTER_INIT_START - //CUSTOM_AFTER_INIT_END - } - //GENERATED_CONSTRUCTOR_END - - //GENERATED_METHODS_START - //GENERATED_METHODS_END - - //GENERATED_STATIC_METHODS_START - //GENERATED_STATIC_METHODS_END - - //CUSTOM_IMPLEMENTATION_START - //CUSTOM_IMPLEMENTATION_END -} - -//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START -//GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END - -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START -//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END - -module.exports = Canvas; diff --git a/src/r3/r3-component/r3-component-canvas.js b/src/r3/r3-component/r3-component-canvas.js index 4be144d..2fc0622 100644 --- a/src/r3/r3-component/r3-component-canvas.js +++ b/src/r3/r3-component/r3-component-canvas.js @@ -79,20 +79,7 @@ const ComponentDOM = require('.././r3-component-d-o-m.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -123,8 +110,6 @@ const ComponentDOM = require('.././r3-component-d-o-m.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) - type (Default value 'canvas') - width (Default value 500 - The initial width of the canvas (You can override it with CSS)) - height (Default value 500 - The initial height of the canvas (You can override it with CSS)) @@ -136,11 +121,7 @@ const ComponentDOM = require('.././r3-component-d-o-m.js'); Methods: - - updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. - - - updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + Static Methods: @@ -148,29 +129,52 @@ const ComponentDOM = require('.././r3-component-d-o-m.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START type='canvas' width=500 - The initial width of the canvas (You can override it with CSS) height=500 - The initial height of the canvas (You can override it with CSS) style='border:1px solid #000000;' CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance + type CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END - CUSTOM_METHODS_START + TEMPLATE_METHODS_START updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + CUSTOM_METHODS_START CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -197,13 +201,28 @@ class ComponentCanvas extends ComponentDOM { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START /** * type - No comment */ @@ -249,7 +268,7 @@ class ComponentCanvas extends ComponentDOM { } //GENERATED_CONSTRUCTOR_END - //GENERATED_METHODS_START + //GENERATED_TEMPLATE_METHODS_START /** * updateInstance() @@ -262,20 +281,6 @@ class ComponentCanvas extends ComponentDOM { this.emit(Event.UPDATE_INSTANCE_BEFORE, this); //GENERATED_UPDATE_INSTANCE_OPTIONS_START - if (property === 'type') { - this.instance.type = this.type; - this.emit( - Event.UPDATE_INSTANCE_PROPERTY, - { - component : this, - property : type, - instanceProperty : type - } - ); - if (property !== 'all') { - return; - } - } if (property === 'width') { this.instance.width = this.width; this.emit( @@ -320,6 +325,23 @@ class ComponentCanvas extends ComponentDOM { } //GENERATED_UPDATE_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_INSTANCE_AFTER, this); //GENERATED_UPDATE_INSTANCE_METHOD_END @@ -339,20 +361,6 @@ class ComponentCanvas extends ComponentDOM { this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START - if (property === 'type' || property === 'all') { - this.type = this.instance.type; - this.emit( - Event.UPDATE_PROPERTY_FROM_INSTANCE, - { - component : this, - property : type, - instanceProperty : type - } - ); - if (property !== 'all') { - return; - } - } if (property === 'width' || property === 'all') { this.width = this.instance.width; this.emit( @@ -397,6 +405,23 @@ class ComponentCanvas extends ComponentDOM { } //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END @@ -405,8 +430,14 @@ class ComponentCanvas extends ComponentDOM { //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -414,6 +445,16 @@ class ComponentCanvas extends ComponentDOM { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentCanvas.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-d-o-m.js b/src/r3/r3-component/r3-component-d-o-m.js index e5d7a40..6391e8e 100644 --- a/src/r3/r3-component/r3-component-d-o-m.js +++ b/src/r3/r3-component/r3-component-d-o-m.js @@ -79,20 +79,7 @@ const Component = require('.././r3-component.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -121,24 +108,49 @@ const Component = require('.././r3-component.js'); GENERATED_INHERITED_END + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component + instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + CUSTOM_OPTIONS_START instance=null - Holds the current instance of this object as determined (built) by the runtime object. CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START initialize() - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an Event.DOM_COMPONENT_INITIALIZED CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -165,6 +177,27 @@ class ComponentDOM extends Component { super(options); + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } + /** + * instance - Holds the current instance of this object as determined (built) by the runtime object. + */ + if (typeof options.instance === 'undefined') { + options.instance = null; + } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + //GENERATED_OPTIONS_INIT_START /** * instance - Holds the current instance of this object as determined (built) by the runtime object. @@ -193,6 +226,114 @@ class ComponentDOM extends Component { } //GENERATED_CONSTRUCTOR_END + //GENERATED_TEMPLATE_METHODS_START + + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + if (property === 'instance') { + this.instance.instance = this.instance; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : instance, + instanceProperty : instance + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'instance' || property === 'all') { + this.instance = this.instance.instance; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : instance, + instanceProperty : instance + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } + //GENERATED_TEMPLATE_METHODS_END + //GENERATED_METHODS_START /** @@ -220,6 +361,9 @@ class ComponentDOM extends Component { } //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -227,6 +371,16 @@ class ComponentDOM extends Component { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentDOM.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-graphics.js b/src/r3/r3-component/r3-component-graphics.js index da95b3f..5d4585a 100644 --- a/src/r3/r3-component/r3-component-graphics.js +++ b/src/r3/r3-component/r3-component-graphics.js @@ -79,20 +79,7 @@ const Component = require('.././r3-component.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -102,8 +89,7 @@ const Component = require('.././r3-component.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -121,24 +107,48 @@ const Component = require('.././r3-component.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START initialize() - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an Event.GRAPHICS_COMPONENT_INITIALIZED CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -165,13 +175,28 @@ class ComponentGraphics extends Component { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -193,6 +218,86 @@ class ComponentGraphics extends Component { } //GENERATED_CONSTRUCTOR_END + //GENERATED_TEMPLATE_METHODS_START + + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } + //GENERATED_TEMPLATE_METHODS_END + //GENERATED_METHODS_START /** @@ -220,6 +325,9 @@ class ComponentGraphics extends Component { } //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -227,6 +335,16 @@ class ComponentGraphics extends Component { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentGraphics.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-image.js b/src/r3/r3-component/r3-component-image.js index 6395856..0212b0e 100644 --- a/src/r3/r3-component/r3-component-image.js +++ b/src/r3/r3-component/r3-component-image.js @@ -79,20 +79,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -102,8 +89,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -123,8 +109,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -132,11 +117,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: @@ -144,25 +125,47 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START - updateInstance() - updateFromInstance() CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -189,13 +192,28 @@ class ComponentImage extends ComponentGraphics { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -217,13 +235,14 @@ class ComponentImage extends ComponentGraphics { } //GENERATED_CONSTRUCTOR_END - //GENERATED_METHODS_START + //GENERATED_TEMPLATE_METHODS_START /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { //GENERATED_UPDATE_INSTANCE_METHOD_START this.emit(Event.UPDATE_INSTANCE_BEFORE, this); @@ -231,6 +250,23 @@ class ComponentImage extends ComponentGraphics { //GENERATED_UPDATE_INSTANCE_OPTIONS_START //GENERATED_UPDATE_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_INSTANCE_AFTER, this); //GENERATED_UPDATE_INSTANCE_METHOD_END @@ -241,9 +277,10 @@ class ComponentImage extends ComponentGraphics { /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); @@ -251,6 +288,23 @@ class ComponentImage extends ComponentGraphics { //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END @@ -259,8 +313,14 @@ class ComponentImage extends ComponentGraphics { //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -268,6 +328,16 @@ class ComponentImage extends ComponentGraphics { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentImage.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-input.js b/src/r3/r3-component/r3-component-input.js index 19c4d0e..cfc0a84 100644 --- a/src/r3/r3-component/r3-component-input.js +++ b/src/r3/r3-component/r3-component-input.js @@ -79,20 +79,7 @@ const Component = require('.././r3-component.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -102,8 +89,7 @@ const Component = require('.././r3-component.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -121,24 +107,48 @@ const Component = require('.././r3-component.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START initialize() - In addition to firing an Event.OBJECT_INITIALIZED and Event.COMPONENT_INITIALIZED, it also fires an Event.INPUT_COMPONENT_INITIALIZED CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -165,13 +175,28 @@ class ComponentInput extends Component { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -193,6 +218,86 @@ class ComponentInput extends Component { } //GENERATED_CONSTRUCTOR_END + //GENERATED_TEMPLATE_METHODS_START + + /** + * updateInstance() + * - Updates this object by copying the values of the current object into it's instance object. + * @param property + */ + updateInstance(property) { + + //GENERATED_UPDATE_INSTANCE_METHOD_START + this.emit(Event.UPDATE_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_INSTANCE_AFTER, this); + //GENERATED_UPDATE_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_INSTANCE_METHOD_START + //CUSTOM_UPDATE_INSTANCE_METHOD_END + + } + + /** + * updateFromInstance() + * - Updates this object by copying the values of its instance into the current object. + * @param property + */ + updateFromInstance(property) { + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START + this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); + + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); + + //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END + + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_START + //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END + + } + //GENERATED_TEMPLATE_METHODS_END + //GENERATED_METHODS_START /** @@ -220,6 +325,9 @@ class ComponentInput extends Component { } //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -227,6 +335,16 @@ class ComponentInput extends Component { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentInput.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-material.js b/src/r3/r3-component/r3-component-material.js index 65a5d28..86aedca 100644 --- a/src/r3/r3-component/r3-component-material.js +++ b/src/r3/r3-component/r3-component-material.js @@ -79,20 +79,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -102,8 +89,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -123,8 +109,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -132,11 +117,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: @@ -144,25 +125,47 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START - updateInstance() - updateFromInstance() CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -189,13 +192,28 @@ class ComponentMaterial extends ComponentGraphics { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -217,13 +235,14 @@ class ComponentMaterial extends ComponentGraphics { } //GENERATED_CONSTRUCTOR_END - //GENERATED_METHODS_START + //GENERATED_TEMPLATE_METHODS_START /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { //GENERATED_UPDATE_INSTANCE_METHOD_START this.emit(Event.UPDATE_INSTANCE_BEFORE, this); @@ -231,6 +250,23 @@ class ComponentMaterial extends ComponentGraphics { //GENERATED_UPDATE_INSTANCE_OPTIONS_START //GENERATED_UPDATE_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_INSTANCE_AFTER, this); //GENERATED_UPDATE_INSTANCE_METHOD_END @@ -241,9 +277,10 @@ class ComponentMaterial extends ComponentGraphics { /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); @@ -251,6 +288,23 @@ class ComponentMaterial extends ComponentGraphics { //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END @@ -259,8 +313,14 @@ class ComponentMaterial extends ComponentGraphics { //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -268,6 +328,16 @@ class ComponentMaterial extends ComponentGraphics { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentMaterial.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-mesh.js b/src/r3/r3-component/r3-component-mesh.js index 459d38d..5ecf22e 100644 --- a/src/r3/r3-component/r3-component-mesh.js +++ b/src/r3/r3-component/r3-component-mesh.js @@ -79,20 +79,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -102,8 +89,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -123,8 +109,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -132,11 +117,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: @@ -144,25 +125,47 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START - updateInstance() - updateFromInstance() CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -189,13 +192,28 @@ class ComponentMesh extends ComponentGraphics { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -217,13 +235,14 @@ class ComponentMesh extends ComponentGraphics { } //GENERATED_CONSTRUCTOR_END - //GENERATED_METHODS_START + //GENERATED_TEMPLATE_METHODS_START /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { //GENERATED_UPDATE_INSTANCE_METHOD_START this.emit(Event.UPDATE_INSTANCE_BEFORE, this); @@ -231,6 +250,23 @@ class ComponentMesh extends ComponentGraphics { //GENERATED_UPDATE_INSTANCE_OPTIONS_START //GENERATED_UPDATE_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_INSTANCE_AFTER, this); //GENERATED_UPDATE_INSTANCE_METHOD_END @@ -241,9 +277,10 @@ class ComponentMesh extends ComponentGraphics { /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); @@ -251,6 +288,23 @@ class ComponentMesh extends ComponentGraphics { //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END @@ -259,8 +313,14 @@ class ComponentMesh extends ComponentGraphics { //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -268,6 +328,16 @@ class ComponentMesh extends ComponentGraphics { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentMesh.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-texture.js b/src/r3/r3-component/r3-component-texture.js index ab19ad5..60c2b23 100644 --- a/src/r3/r3-component/r3-component-texture.js +++ b/src/r3/r3-component/r3-component-texture.js @@ -79,20 +79,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -102,8 +89,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -123,8 +109,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -132,11 +117,7 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: @@ -144,25 +125,47 @@ const ComponentGraphics = require('.././r3-component-graphics.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START - updateInstance() - updateFromInstance() CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -189,13 +192,28 @@ class ComponentTexture extends ComponentGraphics { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -217,13 +235,14 @@ class ComponentTexture extends ComponentGraphics { } //GENERATED_CONSTRUCTOR_END - //GENERATED_METHODS_START + //GENERATED_TEMPLATE_METHODS_START /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { //GENERATED_UPDATE_INSTANCE_METHOD_START this.emit(Event.UPDATE_INSTANCE_BEFORE, this); @@ -231,6 +250,23 @@ class ComponentTexture extends ComponentGraphics { //GENERATED_UPDATE_INSTANCE_OPTIONS_START //GENERATED_UPDATE_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_INSTANCE_AFTER, this); //GENERATED_UPDATE_INSTANCE_METHOD_END @@ -241,9 +277,10 @@ class ComponentTexture extends ComponentGraphics { /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); @@ -251,6 +288,23 @@ class ComponentTexture extends ComponentGraphics { //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END @@ -259,8 +313,14 @@ class ComponentTexture extends ComponentGraphics { //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -268,6 +328,16 @@ class ComponentTexture extends ComponentGraphics { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentTexture.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component-touch.js b/src/r3/r3-component/r3-component-touch.js index d9b0711..ff80eab 100644 --- a/src/r3/r3-component/r3-component-touch.js +++ b/src/r3/r3-component/r3-component-touch.js @@ -79,20 +79,7 @@ const ComponentInput = require('.././r3-component-input.js'); Inherited Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Inherited Static Methods: @@ -102,8 +89,7 @@ const ComponentInput = require('.././r3-component-input.js'); Inherited Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Inherited Static Properties: @@ -123,8 +109,7 @@ const ComponentInput = require('.././r3-component-input.js'); Properties: - - instance (Default value null - Holds the current instance of this object as determined (built) by - the runtime object.) + Static Properties: @@ -132,11 +117,7 @@ const ComponentInput = require('.././r3-component-input.js'); Methods: - - updateInstance() - No comment - - - updateFromInstance() - No comment + Static Methods: @@ -144,25 +125,47 @@ const ComponentInput = require('.././r3-component-input.js'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + TEMPLATE_METHODS_START + updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. + updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + CUSTOM_METHODS_START - updateInstance() - updateFromInstance() CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -189,13 +192,28 @@ class ComponentTouch extends ComponentInput { super(options); - //GENERATED_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * parent - The parent R3.Object of this component + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } /** * instance - Holds the current instance of this object as determined (built) by the runtime object. */ if (typeof options.instance === 'undefined') { options.instance = null; } + /** + * name - No comment + */ + if (typeof options.name === 'undefined') { + options.name = 'hello'; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START @@ -217,13 +235,14 @@ class ComponentTouch extends ComponentInput { } //GENERATED_CONSTRUCTOR_END - //GENERATED_METHODS_START + //GENERATED_TEMPLATE_METHODS_START /** * updateInstance() - * - No comment + * - Updates this object by copying the values of the current object into it's instance object. + * @param property */ - updateInstance() { + updateInstance(property) { //GENERATED_UPDATE_INSTANCE_METHOD_START this.emit(Event.UPDATE_INSTANCE_BEFORE, this); @@ -231,6 +250,23 @@ class ComponentTouch extends ComponentInput { //GENERATED_UPDATE_INSTANCE_OPTIONS_START //GENERATED_UPDATE_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + if (property === 'name') { + this.instance.name = this.name; + this.emit( + Event.UPDATE_INSTANCE_PROPERTY, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_INSTANCE_AFTER, this); //GENERATED_UPDATE_INSTANCE_METHOD_END @@ -241,9 +277,10 @@ class ComponentTouch extends ComponentInput { /** * updateFromInstance() - * - No comment + * - Updates this object by copying the values of its instance into the current object. + * @param property */ - updateFromInstance() { + updateFromInstance(property) { //GENERATED_UPDATE_FROM_INSTANCE_METHOD_START this.emit(Event.UPDATE_FROM_INSTANCE_BEFORE, this); @@ -251,6 +288,23 @@ class ComponentTouch extends ComponentInput { //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + if (property === 'name' || property === 'all') { + this.name = this.instance.name; + this.emit( + Event.UPDATE_PROPERTY_FROM_INSTANCE, + { + component : this, + property : name, + instanceProperty : name + } + ); + if (property !== 'all') { + return; + } + } + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); //GENERATED_UPDATE_FROM_INSTANCE_METHOD_END @@ -259,8 +313,14 @@ class ComponentTouch extends ComponentInput { //CUSTOM_UPDATE_FROM_INSTANCE_METHOD_END } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -268,6 +328,16 @@ class ComponentTouch extends ComponentInput { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static ExtendsStaticOptionTest - A static test option + */ +ComponentTouch.ExtendsStaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/r3/r3-component/r3-component.js b/src/r3/r3-component/r3-component.js index ded02ee..bd58d52 100644 --- a/src/r3/r3-component/r3-component.js +++ b/src/r3/r3-component/r3-component.js @@ -79,20 +79,7 @@ const R3Object = require('.././r3-r3-object.js'); Methods: - - initialize() - Should raises an event(s) which indicates that this object initialized - - - createInstance() - Creates an instance of this object based on the current runtime - - - dispose() - Disposes of this object by disposing the instance first. - - - disposeInstance() - Disposes of the runtime instance. - - - setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + Static Methods: @@ -100,17 +87,35 @@ const R3Object = require('.././r3-r3-object.js'); GENERATED_INHERITED_END + TEMPLATE_OPTIONS_START + register=true + TEMPLATE_OPTIONS_END + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END - CUSTOM_METHODS_START + TEMPLATE_STATIC_OPTIONS_START + StaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_METHODS_START initialize() - Should raises an event(s) which indicates that this object initialized createInstance() - Creates an instance of this object based on the current runtime dispose() - Disposes of this object by disposing the instance first. disposeInstance() - Disposes of the runtime instance. setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + TEMPLATE_METHODS_END + + CUSTOM_METHODS_START CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + Test() - A static template Test method + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -133,11 +138,21 @@ class Component extends R3Object { super(options); + this.emit(Event.COMPONENT_CREATED, this); + + //GENERATED_TEMPLATE_OPTIONS_INIT_START + /** + * register - No comment + */ + if (typeof options.register === 'undefined') { + options.register = true; + } + //GENERATED_TEMPLATE_OPTIONS_INIT_END + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START - this.emit(Event.COMPONENT_CREATED, this); //CUSTOM_OPTIONS_INIT_END Object.assign(this, options); @@ -156,10 +171,7 @@ class Component extends R3Object { } //GENERATED_CONSTRUCTOR_END - //CUSTOM_IMPLEMENTATION_START - //CUSTOM_IMPLEMENTATION_END - - //GENERATED_METHODS_START + //GENERATED_TEMPLATE_METHODS_START /** * initialize() @@ -265,13 +277,46 @@ class Component extends R3Object { //CUSTOM_SET_RUNTIME_METHOD_END } + //GENERATED_TEMPLATE_METHODS_END + + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + + /** + * Test() + * - A static template Test method + */ + static Test() { + + //GENERATED_STATIC_TEST_METHOD_START + //GENERATED_STATIC_TEST_METHOD_END + + //CUSTOM_STATIC_TEST_METHOD_START + //CUSTOM_STATIC_TEST_METHOD_END + + } + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END + //CUSTOM_IMPLEMENTATION_START + //CUSTOM_IMPLEMENTATION_END + } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +/** + * static StaticOptionTest - A static test option + */ +Component.StaticOptionTest = true; +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START Component.COMPONENT_DOM = 0x0; Component.COMPONENT_CANVAS = 0x1; diff --git a/src/r3/r3-entity/r3-entity-slider.js b/src/r3/r3-entity/r3-entity-slider.js index 5c36aa4..0800a56 100644 --- a/src/r3/r3-entity/r3-entity-slider.js +++ b/src/r3/r3-entity/r3-entity-slider.js @@ -6,8 +6,8 @@ const Entity = require('.././r3-entity.js'); GENERATED_INHERITED_START - Class R3.Entity.Slider - [Inherited from Entity] + Class R3.Event.Object.Entity.Slider + [Inherited from Event] Inherited Properties: @@ -22,6 +22,66 @@ const Entity = require('.././r3-entity.js'); - initialize() Should raise an event(s) which indicates that this object initialized + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - id (Default value Utils.RandomId(10)) + - name (Default value 'Object ' + options.id) + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Overrides for R3.Event.initialize() + + Inherited Static Methods: + + + + [Inherited from Entity] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Overrides for R3.Event.R3Object.initialize() + Inherited Static Methods: @@ -30,7 +90,8 @@ const Entity = require('.././r3-entity.js'); Properties: - + - parent (Default value null) + - components (Default value [] - A list of components that this entity is composed of) Static Properties: @@ -47,6 +108,8 @@ const Entity = require('.././r3-entity.js'); GENERATED_INHERITED_END CUSTOM_OPTIONS_START + parent=null + components=[] - A list of components that this entity is composed of CUSTOM_OPTIONS_END CUSTOM_INSTANCE_OPTIONS_MAPPING_START @@ -88,6 +151,18 @@ class EntitySlider extends Entity { super(options); //GENERATED_OPTIONS_INIT_START + /** + * parent - No comment + */ + if (typeof options.parent === 'undefined') { + options.parent = null; + } + /** + * components - A list of components that this entity is composed of + */ + if (typeof options.components === 'undefined') { + options.components = []; + } //GENERATED_OPTIONS_INIT_END //CUSTOM_OPTIONS_INIT_START diff --git a/src/r3/r3-entity/r3-entity.js b/src/r3/r3-entity/r3-entity.js index 7b10304..92a23b5 100644 --- a/src/r3/r3-entity/r3-entity.js +++ b/src/r3/r3-entity/r3-entity.js @@ -1,10 +1,91 @@ const Event = require('.././r3-event'); const Utils = require('.././r3-utils'); +const R3Object = require('.././r3-r3-object.js'); /** GENERATED_INHERITED_START + Class R3.Event.Object.Entity + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Should raise an event(s) which indicates that this object initialized + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - id (Default value Utils.RandomId(10)) + - name (Default value 'Object ' + options.id) + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + - initialize() + Overrides for R3.Event.initialize() + + Inherited Static Methods: + + + + [Belonging to Entity] + + Properties: + + + + Static Properties: + + + + Methods: + + - initialize() + Overrides for R3.Event.R3Object.initialize() + + Static Methods: + + + GENERATED_INHERITED_END CUSTOM_OPTIONS_START @@ -19,13 +100,11 @@ const Utils = require('.././r3-utils'); **/ -class Entity { +class Entity extends R3Object { //GENERATED_CONSTRUCTOR_START constructor(options) { - Event.Emit(Event.OBJECT_CREATED, this); - if (typeof options === 'undefined') { options = {}; } @@ -36,6 +115,10 @@ class Entity { options.callDepth++; } + super(options); + + this.emit(Event.ENTITY_CREATED, this); + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END diff --git a/src/r3/r3-event.js b/src/r3/r3-event.js index 712ea29..1b4dbdd 100644 --- a/src/r3/r3-event.js +++ b/src/r3/r3-event.js @@ -342,13 +342,13 @@ class Event { //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_EVENTS_START -Event.BEFORE_RENDER = 0x1; -Event.COMPONENT_CREATED = 0x2; -Event.COMPONENT_INITIALIZED = 0x3; -Event.CREATE_INSTANCE_BEFORE = 0x4; -Event.DISPOSE_INSTANCE = 0x5; -Event.DISPOSE_OBJECT = 0x6; -Event.DOM_COMPONENT_INITIALIZED = 0x7; +Event.COMPONENT_CREATED = 0x1; +Event.COMPONENT_INITIALIZED = 0x2; +Event.CREATE_INSTANCE_BEFORE = 0x3; +Event.DISPOSE_INSTANCE = 0x4; +Event.DISPOSE_OBJECT = 0x5; +Event.DOM_COMPONENT_INITIALIZED = 0x6; +Event.ENTITY_CREATED = 0x7; Event.ENTITY_INITIALIZED = 0x8; Event.GET_RUNTIME = 0x9; Event.GET_WINDOW_SIZE = 0xa; @@ -383,13 +383,13 @@ Event.MAX_EVENTS = 0x25; Event.GetEventName = function(eventId) { switch(eventId) { - case 0x1 : return 'before_render'; - case 0x2 : return 'component_created'; - case 0x3 : return 'component_initialized'; - case 0x4 : return 'create_instance_before'; - case 0x5 : return 'dispose_instance'; - case 0x6 : return 'dispose_object'; - case 0x7 : return 'dom_component_initialized'; + case 0x1 : return 'component_created'; + case 0x2 : return 'component_initialized'; + case 0x3 : return 'create_instance_before'; + case 0x4 : return 'dispose_instance'; + case 0x5 : return 'dispose_object'; + case 0x6 : return 'dom_component_initialized'; + case 0x7 : return 'entity_created'; case 0x8 : return 'entity_initialized'; case 0x9 : return 'get_runtime'; case 0xa : return 'get_window_size'; diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index b158ec8..7e7f27d 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,26 +1,26 @@ class R3 { - static version = '2.0.579'; - static compileDate = '2021 Sep 11 - 06:49:25 am'; + static version = '2.0.645'; + static compileDate = '2021 Sep 13 - 09:34:27 am'; } //GENERATED_IMPORTS_START -const Entity = require('./r3-entity/'); const Runtime = require('./r3-runtime/'); const System = require('./r3-system/'); const Event = require('./r3-event.js'); const Utils = require('./r3-utils.js'); const R3Object = require('./r3-r3-object.js'); +const Entity = require('./r3-entity/'); const Component = require('./r3-component/'); const Project = require('./r3-project.js'); //GENERATED_IMPORTS_END //GENERATED_DEFINES_START -R3.Entity = Entity; R3.Runtime = Runtime; R3.System = System; R3.Event = Event; R3.Utils = Utils; R3.Object = R3Object; +R3.Entity = Entity; R3.Component = Component; R3.Project = Project; R3.DOM = ComponentDOM; diff --git a/src/r3/r3-system/r3-system-d-o-m.js b/src/r3/r3-system/r3-system-d-o-m.js index b309e13..851a8cf 100644 --- a/src/r3/r3-system/r3-system-d-o-m.js +++ b/src/r3/r3-system/r3-system-d-o-m.js @@ -194,7 +194,13 @@ class SystemDOM extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +/** + * static Started - No comment + */ SystemDOM.Started = false; +/** + * static Subscriptions - No comment + */ SystemDOM.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/src/r3/r3-system/r3-system-input.js b/src/r3/r3-system/r3-system-input.js index cdbdffd..d78cf13 100644 --- a/src/r3/r3-system/r3-system-input.js +++ b/src/r3/r3-system/r3-system-input.js @@ -418,7 +418,13 @@ class SystemInput extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +/** + * static Started - No comment + */ SystemInput.Started = false; +/** + * static Subscriptions - No comment + */ SystemInput.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/src/r3/r3-system/r3-system-linking.js b/src/r3/r3-system/r3-system-linking.js index 3043a3b..0b86a26 100644 --- a/src/r3/r3-system/r3-system-linking.js +++ b/src/r3/r3-system/r3-system-linking.js @@ -247,7 +247,13 @@ class SystemLinking extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +/** + * static Started - No comment + */ SystemLinking.Started = false; +/** + * static Subscriptions - No comment + */ SystemLinking.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/src/r3/r3-system/r3-system-render.js b/src/r3/r3-system/r3-system-render.js index 45e2b81..d447c72 100644 --- a/src/r3/r3-system/r3-system-render.js +++ b/src/r3/r3-system/r3-system-render.js @@ -200,7 +200,13 @@ class SystemRender extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +/** + * static Started - No comment + */ SystemRender.Started = false; +/** + * static Subscriptions - No comment + */ SystemRender.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/src/r3/r3-system/r3-system-runtime.js b/src/r3/r3-system/r3-system-runtime.js index c6faa1a..75c8de0 100644 --- a/src/r3/r3-system/r3-system-runtime.js +++ b/src/r3/r3-system/r3-system-runtime.js @@ -248,15 +248,45 @@ class SystemRuntime extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +/** + * static Started - No comment + */ SystemRuntime.Started = false; +/** + * static Subscriptions - No comment + */ SystemRuntime.Subscriptions = {}; +/** + * static Projects - No comment + */ SystemRuntime.Projects = []; +/** + * static CurrentProject - No comment + */ SystemRuntime.CurrentProject = null; +/** + * static RuntimeCoder - No comment + */ SystemRuntime.RuntimeCoder = {}; +/** + * static RuntimeDOM - No comment + */ SystemRuntime.RuntimeDOM = {}; +/** + * static RuntimeGUI - No comment + */ SystemRuntime.RuntimeGUI = {}; +/** + * static RuntimeGraphics - No comment + */ SystemRuntime.RuntimeGraphics = {}; +/** + * static RuntimePhysics - No comment + */ SystemRuntime.RuntimePhysics = {}; +/** + * static RuntimeStatistics - No comment + */ SystemRuntime.RuntimeStatistics = {}; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/src/r3/r3-system/r3-system-socket.js b/src/r3/r3-system/r3-system-socket.js index b97edda..fc5375c 100644 --- a/src/r3/r3-system/r3-system-socket.js +++ b/src/r3/r3-system/r3-system-socket.js @@ -171,7 +171,13 @@ class SystemSocket extends System { } //GENERATED_STATIC_OPTIONS_INIT_START +/** + * static Started - No comment + */ SystemSocket.Started = false; +/** + * static Subscriptions - No comment + */ SystemSocket.Subscriptions = {}; //GENERATED_STATIC_OPTIONS_INIT_END diff --git a/src/templates/component_base.template b/src/templates/component_base.template index a5a99e3..f2991b3 100644 --- a/src/templates/component_base.template +++ b/src/templates/component_base.template @@ -8,17 +8,35 @@ const R3Object = require('.././r3-r3-object.js'); GENERATED_INHERITED_END + TEMPLATE_OPTIONS_START + register=true + TEMPLATE_OPTIONS_END + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END - CUSTOM_METHODS_START + TEMPLATE_STATIC_OPTIONS_START + StaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_METHODS_START initialize() - Should raises an event(s) which indicates that this object initialized createInstance() - Creates an instance of this object based on the current runtime dispose() - Disposes of this object by disposing the instance first. disposeInstance() - Disposes of the runtime instance. setRuntime() - Sets the runtime property of this component required for constructing an instance of this component. + TEMPLATE_METHODS_END + + CUSTOM_METHODS_START CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + Test() - A static template Test method + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -29,17 +47,29 @@ class CLASS_NAME extends R3Object { //GENERATED_CONSTRUCTOR_START //GENERATED_CONSTRUCTOR_END - //CUSTOM_IMPLEMENTATION_START - //CUSTOM_IMPLEMENTATION_END + //GENERATED_TEMPLATE_METHODS_START + //GENERATED_TEMPLATE_METHODS_END //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END + //CUSTOM_IMPLEMENTATION_START + //CUSTOM_IMPLEMENTATION_END + } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/templates/component_base_constructor.template b/src/templates/component_base_constructor.template index a32508d..29e2baa 100644 --- a/src/templates/component_base_constructor.template +++ b/src/templates/component_base_constructor.template @@ -12,6 +12,11 @@ super(options); + this.emit(Event.COMPONENT_CREATED, this); + + //GENERATED_TEMPLATE_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_END + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END diff --git a/src/templates/component_extends.template b/src/templates/component_extends.template index a6ec262..2712602 100644 --- a/src/templates/component_extends.template +++ b/src/templates/component_extends.template @@ -8,25 +8,47 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); GENERATED_INHERITED_END - CUSTOM_OPTIONS_START + TEMPLATE_OPTIONS_START + parent=null - The parent R3.Object of this component instance=null - Holds the current instance of this object as determined (built) by the runtime object. + name='hello' + TEMPLATE_OPTIONS_END + + CUSTOM_OPTIONS_START CUSTOM_OPTIONS_END + TEMPLATE_STATIC_OPTIONS_START + ExtendsStaticOptionTest=true - A static test option + TEMPLATE_STATIC_OPTIONS_END + + CUSTOM_STATIC_OPTIONS_START + CUSTOM_STATIC_OPTIONS_END + + TEMPLATE_INSTANCE_OPTIONS_MAPPING_START + TEMPLATE_INSTANCE_OPTIONS_MAPPING_END + CUSTOM_INSTANCE_OPTIONS_MAPPING_START CUSTOM_INSTANCE_OPTIONS_MAPPING_END - CUSTOM_LINKED_OBJECTS_START - CUSTOM_LINKED_OBJECTS_END + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_START + parent + instance + TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS_END CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START - instance CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END - CUSTOM_METHODS_START + TEMPLATE_METHODS_START updateInstance(property) - Updates this object by copying the values of the current object into it's instance object. updateFromInstance(property) - Updates this object by copying the values of its instance into the current object. + TEMPLATE_METHODS_END + + CUSTOM_METHODS_START CUSTOM_METHODS_END + TEMPLATE_STATIC_METHODS_START + TEMPLATE_STATIC_METHODS_END + CUSTOM_STATIC_METHODS_START CUSTOM_STATIC_METHODS_END @@ -37,9 +59,15 @@ class CLASS_NAME extends EXTEND_CLASS { //GENERATED_CONSTRUCTOR_START //GENERATED_CONSTRUCTOR_END + //GENERATED_TEMPLATE_METHODS_START + //GENERATED_TEMPLATE_METHODS_END + //GENERATED_METHODS_START //GENERATED_METHODS_END + //GENERATED_TEMPLATE_STATIC_METHODS_START + //GENERATED_TEMPLATE_STATIC_METHODS_END + //GENERATED_STATIC_METHODS_START //GENERATED_STATIC_METHODS_END @@ -47,6 +75,12 @@ class CLASS_NAME extends EXTEND_CLASS { //CUSTOM_IMPLEMENTATION_END } +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_START +//GENERATED_TEMPLATE_STATIC_OPTIONS_INIT_END + +//GENERATED_STATIC_OPTIONS_INIT_START +//GENERATED_STATIC_OPTIONS_INIT_END + //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_START //GENERATED_OUT_OF_CLASS_IMPLEMENTATION_END diff --git a/src/templates/component_extends_constructor.template b/src/templates/component_extends_constructor.template index d7c5fcd..583df48 100644 --- a/src/templates/component_extends_constructor.template +++ b/src/templates/component_extends_constructor.template @@ -16,6 +16,9 @@ super(options); + //GENERATED_TEMPLATE_OPTIONS_INIT_START + //GENERATED_TEMPLATE_OPTIONS_INIT_END + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END diff --git a/src/templates/entity_base.template b/src/templates/entity_base.template index 290e9db..b15a206 100644 --- a/src/templates/entity_base.template +++ b/src/templates/entity_base.template @@ -1,5 +1,6 @@ const Event = require('INCLUDE_PATH/r3-event'); const Utils = require('INCLUDE_PATH/r3-utils'); +const R3Object = require('.././r3-r3-object.js'); /** @@ -19,7 +20,7 @@ const Utils = require('INCLUDE_PATH/r3-utils'); **/ -class CLASS_NAME { +class CLASS_NAME extends R3Object { //GENERATED_CONSTRUCTOR_START //GENERATED_CONSTRUCTOR_END diff --git a/src/templates/entity_base_constructor.template b/src/templates/entity_base_constructor.template index 32b7f17..947cc8b 100644 --- a/src/templates/entity_base_constructor.template +++ b/src/templates/entity_base_constructor.template @@ -1,7 +1,5 @@ constructor(options) { - Event.Emit(Event.OBJECT_CREATED, this); - if (typeof options === 'undefined') { options = {}; } @@ -12,6 +10,10 @@ options.callDepth++; } + super(options); + + this.emit(Event.ENTITY_CREATED, this); + //GENERATED_OPTIONS_INIT_START //GENERATED_OPTIONS_INIT_END diff --git a/src/templates/entity_extends.template b/src/templates/entity_extends.template index 4d15164..f2572ff 100644 --- a/src/templates/entity_extends.template +++ b/src/templates/entity_extends.template @@ -9,6 +9,8 @@ const EXTEND_CLASS = require('INCLUDE_PATH/EXTEND_CLASS_FILE_NAME'); GENERATED_INHERITED_END CUSTOM_OPTIONS_START + parent=null + components=[] - A list of components that this entity is composed of CUSTOM_OPTIONS_END CUSTOM_INSTANCE_OPTIONS_MAPPING_START diff --git a/src/templates/generated_custom_static_options_init.template b/src/templates/generated_custom_static_options_init.template index 3255d94..3910842 100644 --- a/src/templates/generated_custom_static_options_init.template +++ b/src/templates/generated_custom_static_options_init.template @@ -1 +1,4 @@ +/** + * static KEY - COMMENT + */ CLASS_NAME.KEY = VALUE; diff --git a/src/templates/token.db b/src/templates/token.db index 9cb9e8f..5a6bdc3 100644 --- a/src/templates/token.db +++ b/src/templates/token.db @@ -47,7 +47,14 @@ GENERATED_STATIC_OPTIONS_INIT GENERATED_STATIC_START_METHOD GENERATED_STATIC_STOP_METHOD GENERATED_STATIC_SUBSCRIBE_METHOD +GENERATED_STATIC_TEST_METHOD GENERATED_SUBSCRIBE_METHOD +GENERATED_TEMPLATE_METHODS +GENERATED_TEMPLATE_OPTIONS_INIT +GENERATED_TEMPLATE_STATIC_METHODS +GENERATED_TEMPLATE_STATIC_OPTIONS_INIT +GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS +GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS GENERATED_UPDATE_FROM_INSTANCE_METHOD GENERATED_UPDATE_FROM_INSTANCE_OPTIONS GENERATED_UPDATE_INSTANCE_METHOD @@ -102,6 +109,13 @@ CUSTOM_STATIC_OPTIONS CUSTOM_STATIC_START_METHOD CUSTOM_STATIC_STOP_METHOD CUSTOM_STATIC_SUBSCRIBE_METHOD +CUSTOM_STATIC_TEST_METHOD CUSTOM_SUBSCRIBE_METHOD CUSTOM_UPDATE_FROM_INSTANCE_METHOD CUSTOM_UPDATE_INSTANCE_METHOD +TEMPLATE_EXCLUDED_FROM_INSTANCE_OPTIONS +TEMPLATE_INSTANCE_OPTIONS_MAPPING +TEMPLATE_METHODS +TEMPLATE_OPTIONS +TEMPLATE_STATIC_METHODS +TEMPLATE_STATIC_OPTIONS diff --git a/src/templates/update_from_instance.template b/src/templates/update_from_instance.template index aea9ed4..a53357c 100644 --- a/src/templates/update_from_instance.template +++ b/src/templates/update_from_instance.template @@ -3,4 +3,7 @@ //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_START //GENERATED_UPDATE_FROM_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_START + //GENERATED_TEMPLATE_UPDATE_FROM_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_FROM_INSTANCE_AFTER, this); diff --git a/src/templates/update_instance.template b/src/templates/update_instance.template index 35f7504..fa0818c 100644 --- a/src/templates/update_instance.template +++ b/src/templates/update_instance.template @@ -3,4 +3,7 @@ //GENERATED_UPDATE_INSTANCE_OPTIONS_START //GENERATED_UPDATE_INSTANCE_OPTIONS_END + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_START + //GENERATED_TEMPLATE_UPDATE_INSTANCE_OPTIONS_END + this.emit(Event.UPDATE_INSTANCE_AFTER, this); \ No newline at end of file diff --git a/utils.php b/utils.php index 94afb7b..5b99fc1 100644 --- a/utils.php +++ b/utils.php @@ -23,7 +23,7 @@ function from_camel_case($input) { if (isset($argc)) { for ($i = 0; $i < $argc; $i++) { - echo "Argument #" . $i . " - " . $argv[$i] . "\n"; +// echo "Argument #" . $i . " - " . $argv[$i] . "\n"; } } else { diff --git a/version b/version index 30b82be..f936b51 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.579 \ No newline at end of file +2.0.645 \ No newline at end of file