add jsdoc to mindplot module
--HG-- branch : mindplot_jsdoc
This commit is contained in:
@@ -16,8 +16,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.AddFeatureToTopicCommand = new Class({
|
||||
mindplot.commands.AddFeatureToTopicCommand = new Class(/** @lends AddFeatureToTopicCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command class handles do/undo of adding features to topics, e.g. an
|
||||
* icon or a note. For a reference of existing features, refer to {@link mindplot.TopicFeature}
|
||||
* @constructs
|
||||
* @param {String} topicId the id of the topic
|
||||
* @param {String} featureType the id of the feature type to add, e.g. "icon"
|
||||
* @param {Object} attributes the attribute(s) of the respective feature model
|
||||
* @extends mindplot.Command
|
||||
* @see mindplot.model.FeatureModel and subclasses
|
||||
*/
|
||||
initialize:function (topicId, featureType, attributes) {
|
||||
|
||||
$assert($defined(topicId), 'topicId can not be null');
|
||||
@@ -31,6 +41,9 @@ mindplot.commands.AddFeatureToTopicCommand = new Class({
|
||||
this._featureModel = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
|
||||
@@ -42,6 +55,10 @@ mindplot.commands.AddFeatureToTopicCommand = new Class({
|
||||
topic.addFeature(this._featureModel);
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
topic.removeFeature(this._featureModel);
|
||||
|
@@ -15,19 +15,34 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
mindplot.commands.AddRelationshipCommand = new Class({
|
||||
|
||||
mindplot.commands.AddRelationshipCommand = new Class(/** @lends AddRelationshipCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command class handles do/undo of adding a relationship to a topic.
|
||||
* @constructs
|
||||
* @param {XMLDOM} model
|
||||
* @extends mindplot.Command
|
||||
*/
|
||||
initialize:function (model) {
|
||||
$assert(model, 'Relationship model can not be null');
|
||||
|
||||
this.parent();
|
||||
this._model = model;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
var relationship = commandContext.addRelationship(this._model);
|
||||
relationship.setOnFocus(true);
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
var rel = commandContext.findRelationships(this._model.getId());
|
||||
commandContext.deleteRelationship(rel[0]);
|
||||
|
@@ -16,8 +16,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.AddTopicCommand = new Class({
|
||||
mindplot.commands.AddTopicCommand = new Class(/** @lends AddTopicCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command class handles do/undo of adding one or multiple topics to
|
||||
* the mindmap.
|
||||
* @constructs
|
||||
* @param {Array<mindplot.model.NodeModel>} models one or multiple models
|
||||
* @param {Array<String>} parentTopicsId ids of the parent topics to add the children to, or null
|
||||
* when attaching a dragged node or a node/branch from clipboard
|
||||
* @extends mindplot.Command
|
||||
*/
|
||||
initialize:function (models, parentTopicsId) {
|
||||
$assert(models, 'models can not be null');
|
||||
$assert(parentTopicsId == null || parentTopicsId.length == models.length, 'parents and models must have the same size');
|
||||
@@ -27,6 +36,9 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
this._parentsIds = parentTopicsId;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
|
||||
var me = this;
|
||||
@@ -57,6 +69,10 @@ mindplot.commands.AddTopicCommand = new Class({
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
// Delete disconnected the nodes. Create a copy of the topics ...
|
||||
var clonedModel = [];
|
||||
|
@@ -16,8 +16,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.ChangeFeatureToTopicCommand = new Class({
|
||||
mindplot.commands.ChangeFeatureToTopicCommand = new Class(/** @lends ChangeFeatureToTopicCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @extends mindplot.Command
|
||||
* @constructs
|
||||
* @param topicId
|
||||
* @param featureId
|
||||
* @param attributes
|
||||
* @throws will throw an error if topicId is null or undefined
|
||||
* @throws will throw an error if featureId is null or undefined
|
||||
* @throws will throw an error if attributes is null or undefined
|
||||
*/
|
||||
initialize: function(topicId, featureId, attributes) {
|
||||
$assert($defined(topicId), 'topicId can not be null');
|
||||
$assert($defined(featureId), 'featureId can not be null');
|
||||
@@ -29,6 +39,9 @@ mindplot.commands.ChangeFeatureToTopicCommand = new Class({
|
||||
this._attributes = attributes;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute: function(commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var feature = topic.findFeatureById(this._featureId);
|
||||
@@ -38,6 +51,10 @@ mindplot.commands.ChangeFeatureToTopicCommand = new Class({
|
||||
this._attributes = oldAttributes;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute: function(commandContext) {
|
||||
this.execute(commandContext);
|
||||
}
|
||||
|
@@ -16,8 +16,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.DeleteCommand = new Class({
|
||||
mindplot.commands.DeleteCommand = new Class(/** @lends mindplot.commands.DeleteCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command class handles do/undo of deleting a topic.
|
||||
* @constructs
|
||||
* @param {Array<String>} topicIds ids of the topics to delete
|
||||
* @param {Array<String>} relIds ids of the relationships connected to the topics
|
||||
* @extends mindplot.Command
|
||||
*/
|
||||
initialize:function (topicIds, relIds) {
|
||||
$assert($defined(relIds), 'topicIds can not be null');
|
||||
|
||||
@@ -29,6 +36,9 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
this._parentTopicIds = [];
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
|
||||
// If a parent has been selected for deletion, the children must be excluded from the delete ...
|
||||
@@ -76,6 +86,10 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
|
||||
// Add all the topics ...
|
||||
|
@@ -16,8 +16,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.DragTopicCommand = new Class({
|
||||
mindplot.commands.DragTopicCommand = new Class(/** @lends DragTopicCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command class handles do/undo of dragging a topic to a new position.
|
||||
* @constructs
|
||||
* @param {String} topicId id of the topic to drag
|
||||
* @param {Object} position
|
||||
* @param {Number} order the order property (children of one node are displayed in order from 0 to n)
|
||||
* @param {mindplot.Topic} parentTopic the topic to be made the dragged topic's new parent
|
||||
* @extends mindplot.Command
|
||||
*/
|
||||
initialize:function (topicId, position, order, parentTopic) {
|
||||
$assert(topicId, "topicId must be defined");
|
||||
|
||||
@@ -30,6 +39,9 @@ mindplot.commands.DragTopicCommand = new Class({
|
||||
this._order = order;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
|
||||
var topic = commandContext.findTopics(this._topicsId)[0];
|
||||
@@ -78,6 +90,10 @@ mindplot.commands.DragTopicCommand = new Class({
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
this.execute(commandContext);
|
||||
}
|
||||
|
@@ -16,8 +16,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.GenericFunctionCommand = new Class({
|
||||
mindplot.commands.GenericFunctionCommand = new Class(/** @lends GenericFunctionCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command handles do/undo of different actions, e.g. moving topics to
|
||||
* a different position, changing text or font,... (for full reference check the
|
||||
* StandaloneActionDispatcher i.e. the ActionDispatcher subclass in use)
|
||||
* @constructs
|
||||
* @param {Function} commandFunc the function the command shall execute
|
||||
* @param {String|Array<String>} topicsIds the ids of the topics affected
|
||||
* @param {Object} value arbitrary value necessary for the execution of the function,
|
||||
* e.g. color, font family or text
|
||||
* @extends mindplot.Command
|
||||
*/
|
||||
initialize:function (commandFunc, topicsIds, value) {
|
||||
$assert(commandFunc, "commandFunc must be defined");
|
||||
$assert($defined(topicsIds), "topicsIds must be defined");
|
||||
@@ -29,6 +40,9 @@ mindplot.commands.GenericFunctionCommand = new Class({
|
||||
this._oldValues = [];
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
if (!this.applied) {
|
||||
|
||||
@@ -60,6 +74,10 @@ mindplot.commands.GenericFunctionCommand = new Class({
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
if (this.applied) {
|
||||
var topics = commandContext.findTopics(this._topicsId);
|
||||
|
@@ -15,8 +15,20 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
mindplot.commands.MoveControlPointCommand = new Class({
|
||||
|
||||
mindplot.commands.MoveControlPointCommand = new Class(/** @lends MoveControlPointCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command handles do/undo of changing the control points of a relationship
|
||||
* arrow. These are the two points that appear when the relationship is on focus. They
|
||||
* influence how the arrow is drawn (not the source or the destination topic nor the arrow
|
||||
* direction)
|
||||
* @constructs
|
||||
* @param {ControlPoint} ctrlPointController
|
||||
* @param {Number} point 0 for the destination control point, 1 for the source control point
|
||||
* @param ctrlPointController {ControlPoint}
|
||||
* @param point {Number} 0 for the destination control point, 1 for the source control point
|
||||
*/
|
||||
initialize:function (ctrlPointController, point) {
|
||||
$assert(ctrlPointController, 'line can not be null');
|
||||
$assert($defined(point), 'point can not be null');
|
||||
@@ -40,6 +52,9 @@ mindplot.commands.MoveControlPointCommand = new Class({
|
||||
this._point = point;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
var model = this._line.getModel();
|
||||
switch (this._point) {
|
||||
@@ -64,6 +79,10 @@ mindplot.commands.MoveControlPointCommand = new Class({
|
||||
this._line.getLine().updateLine(this._point);
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
var line = this._line;
|
||||
var model = line.getModel();
|
||||
|
@@ -16,8 +16,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
||||
mindplot.commands.RemoveFeatureFromTopicCommand = new Class(/**@lends RemoveFeatureFromTopicCommand */{
|
||||
Extends:mindplot.Command,
|
||||
/**
|
||||
* @classdesc This command handles do/undo of removing a feature from a topic, e.g. an icon or
|
||||
* a note. For a reference of existing features, refer to {@link mindplot.TopicFeature}.
|
||||
* @constructs
|
||||
* @param {String} topicId id of the topic to remove the feature from
|
||||
* @param {String} featureId id of the feature to remove
|
||||
* @extends mindplot.Command
|
||||
*/
|
||||
initialize:function (topicId, featureId) {
|
||||
$assert($defined(topicId), 'topicId can not be null');
|
||||
$assert(featureId, 'iconModel can not be null');
|
||||
@@ -28,6 +36,9 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
||||
this._oldFeature = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
*/
|
||||
execute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var feature = topic.findFeatureById(this._featureId);
|
||||
@@ -35,6 +46,10 @@ mindplot.commands.RemoveFeatureFromTopicCommand = new Class({
|
||||
this._oldFeature = feature;
|
||||
},
|
||||
|
||||
/**
|
||||
* Overrides abstract parent method
|
||||
* @see {@link mindplot.Command.undoExecute}
|
||||
*/
|
||||
undoExecute:function (commandContext) {
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
topic.addFeature(this._oldFeature);
|
||||
|
Reference in New Issue
Block a user