mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-26 23:35:02 +02:00
Finish add fictional point.
This commit is contained in:
parent
304928b2ec
commit
fdfc46d827
@ -212,7 +212,7 @@ MapController.prototype.init_map = function() {
|
|||||||
|
|
||||||
self.ini_selection_rectangle();
|
self.ini_selection_rectangle();
|
||||||
|
|
||||||
self.init_events();
|
self.events();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1475,7 +1475,7 @@ MapController.prototype.events_for_nodes = function(id_node) {
|
|||||||
self.last_event = "drag";
|
self.last_event = "drag";
|
||||||
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)
|
if (!self.is_draggable(node))
|
||||||
return 1; // Continue
|
return 1; // Continue
|
||||||
|
|
||||||
var status_selection =
|
var status_selection =
|
||||||
@ -1523,12 +1523,68 @@ MapController.prototype.events_for_nodes = function(id_node) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MapController.prototype.is_draggable = function(node) {
|
||||||
|
var return_var = false;
|
||||||
|
|
||||||
|
switch (node.type) {
|
||||||
|
case ITEM_TYPE_AGENT_NETWORKMAP:
|
||||||
|
case ITEM_TYPE_FICTIONAL_NODE:
|
||||||
|
return_var = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return return_var;
|
||||||
|
}
|
||||||
|
|
||||||
|
MapController.prototype.is_relationshipy = function(node) {
|
||||||
|
var return_var = false;
|
||||||
|
|
||||||
|
switch (node.type) {
|
||||||
|
case ITEM_TYPE_AGENT_NETWORKMAP:
|
||||||
|
case ITEM_TYPE_FICTIONAL_NODE:
|
||||||
|
return_var = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return return_var;
|
||||||
|
}
|
||||||
|
|
||||||
|
MapController.prototype.is_selecty = function(node) {
|
||||||
|
var return_var = false;
|
||||||
|
|
||||||
|
switch (node.type) {
|
||||||
|
case ITEM_TYPE_AGENT_NETWORKMAP:
|
||||||
|
case ITEM_TYPE_FICTIONAL_NODE:
|
||||||
|
return_var = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return return_var;
|
||||||
|
}
|
||||||
|
|
||||||
|
MapController.prototype.is_delety = function(node) {
|
||||||
|
var return_var = false;
|
||||||
|
|
||||||
|
switch (node.type) {
|
||||||
|
case ITEM_TYPE_AGENT_NETWORKMAP:
|
||||||
|
case ITEM_TYPE_FICTIONAL_NODE:
|
||||||
|
return_var = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return return_var;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function init_events
|
* Function init_events
|
||||||
* Return boolean
|
* Return boolean
|
||||||
* This function init click events in the map
|
* This function init click events in the map
|
||||||
*/
|
*/
|
||||||
MapController.prototype.init_events = function() {
|
MapController.prototype.events = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.events_for_nodes();
|
self.events_for_nodes();
|
||||||
@ -1666,7 +1722,7 @@ MapController.prototype.init_events = function() {
|
|||||||
|
|
||||||
if (self._relationship_in_progress) {
|
if (self._relationship_in_progress) {
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)
|
if (!self.is_relationshipy(node))
|
||||||
return 1; // Continue
|
return 1; // Continue
|
||||||
|
|
||||||
var status_selection =
|
var status_selection =
|
||||||
@ -1715,7 +1771,7 @@ MapController.prototype.start_relationship_nodes = function(type) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)
|
if (!self.is_relationshipy(node))
|
||||||
return 1; // Continue
|
return 1; // Continue
|
||||||
|
|
||||||
var status_selection =
|
var status_selection =
|
||||||
@ -1838,7 +1894,7 @@ MapController.prototype.apply_temp_arrows = function(target_id) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)
|
if (!self.is_relationshipy(node))
|
||||||
return 1; // Continue
|
return 1; // Continue
|
||||||
|
|
||||||
var status_selection =
|
var status_selection =
|
||||||
@ -1959,7 +2015,7 @@ MapController.prototype.get_last_graph_id = function() {
|
|||||||
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node['graph_id'] > return_var) {
|
if (node['graph_id'] > return_var) {
|
||||||
return_var = node['graph_id'];
|
return_var = parseInt(node['graph_id']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -2087,7 +2143,7 @@ MapController.prototype.multiple_selection_select_nodes = function() {
|
|||||||
selection_box_dimensions["height"] / zoom.scale[1];
|
selection_box_dimensions["height"] / zoom.scale[1];
|
||||||
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)
|
if (!self.is_selecty(node))
|
||||||
return 1; // Continue
|
return 1; // Continue
|
||||||
|
|
||||||
var x = node.x;
|
var x = node.x;
|
||||||
@ -2144,7 +2200,7 @@ MapController.prototype.remove_selection_nodes = function() {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)
|
if (!self.is_selecty(node))
|
||||||
return 1; // Continue
|
return 1; // Continue
|
||||||
|
|
||||||
self.select_node(node.graph_id, "off");
|
self.select_node(node.graph_id, "off");
|
||||||
@ -2343,7 +2399,7 @@ MapController.prototype.deleteNode = function(self, target) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
$.each(nodes, function(i, node) {
|
$.each(nodes, function(i, node) {
|
||||||
if (node.type != ITEM_TYPE_AGENT_NETWORKMAP)
|
if (!self.is_delety(node))
|
||||||
return 1; // Continue
|
return 1; // Continue
|
||||||
|
|
||||||
var status_selection =
|
var status_selection =
|
||||||
|
@ -238,6 +238,42 @@ NetworkmapController.prototype.get_arrows_AMA = function(id_to, id_from) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NetworkmapController.prototype.get_arrow_AF_or_FF = function(id_to, id_from) {
|
||||||
|
var self = this;
|
||||||
|
var arrow_AF_or_FF;
|
||||||
|
var found = false;
|
||||||
|
|
||||||
|
$.each(edges, function(i, edge) {
|
||||||
|
|
||||||
|
if (self.get_node_type(id_to) == ITEM_TYPE_FICTIONAL_NODE ||
|
||||||
|
self.get_node_type(id_from) == ITEM_TYPE_FICTIONAL_NODE) {
|
||||||
|
|
||||||
|
var arrow = self.get_arrow(id_to, id_from);
|
||||||
|
|
||||||
|
arrow_AF_or_FF = {};
|
||||||
|
arrow_AF_or_FF['type'] = 'AF_or_FF';
|
||||||
|
arrow_AF_or_FF['graph_id'] = arrow['arrow']['graph_id'];
|
||||||
|
arrow_AF_or_FF['to'] = arrow['nodes']['to'];
|
||||||
|
arrow_AF_or_FF['to_module'] = null;
|
||||||
|
arrow_AF_or_FF['to_status'] = null;
|
||||||
|
arrow_AF_or_FF['to_title'] = null;
|
||||||
|
arrow_AF_or_FF['from'] = arrow['nodes']['from'];
|
||||||
|
arrow_AF_or_FF['from_module'] = null;
|
||||||
|
arrow_AF_or_FF['from_status'] = null;
|
||||||
|
arrow_AF_or_FF['from_title'] = null;
|
||||||
|
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
return arrow_AF_or_FF;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function get_arrow_AA
|
* Function get_arrow_AA
|
||||||
* Return array (arrow)
|
* Return array (arrow)
|
||||||
@ -307,6 +343,7 @@ NetworkmapController.prototype.exists_arrow = function(arrows, arrow) {
|
|||||||
var arrow_from = arrow['from']['graph_id'];
|
var arrow_from = arrow['from']['graph_id'];
|
||||||
|
|
||||||
switch (arrow['type']) {
|
switch (arrow['type']) {
|
||||||
|
case 'AF_or_FF':
|
||||||
case 'AA':
|
case 'AA':
|
||||||
case 'AMMA':
|
case 'AMMA':
|
||||||
if (a_to == arrow_to) {
|
if (a_to == arrow_to) {
|
||||||
@ -344,8 +381,14 @@ NetworkmapController.prototype.paint_arrows = function() {
|
|||||||
|
|
||||||
var clean_arrows = [];
|
var clean_arrows = [];
|
||||||
|
|
||||||
var arrows_AA;
|
|
||||||
$.each(edges, function(i, edge) {
|
$.each(edges, function(i, edge) {
|
||||||
|
var arrow_AF_or_FF = self.get_arrow_AF_or_FF(edge['to'], edge['from']);
|
||||||
|
if (arrow_AF_or_FF !== null) {
|
||||||
|
if (!self.exists_arrow(clean_arrows, arrow_AF_or_FF)) {
|
||||||
|
clean_arrows.push(arrow_AF_or_FF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var arrow_AA = self.get_arrow_AA(edge['to'], edge['from']);
|
var arrow_AA = self.get_arrow_AA(edge['to'], edge['from']);
|
||||||
if (arrow_AA !== null) {
|
if (arrow_AA !== null) {
|
||||||
if (!self.exists_arrow(clean_arrows, arrow_AA)) {
|
if (!self.exists_arrow(clean_arrows, arrow_AA)) {
|
||||||
@ -389,19 +432,9 @@ NetworkmapController.prototype.paint_arrows = function() {
|
|||||||
.attr("data-from_module", function(d) {
|
.attr("data-from_module", function(d) {
|
||||||
return d['from_module'];});
|
return d['from_module'];});
|
||||||
|
|
||||||
create_arrow(arrow_layouts);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function create_arrow
|
|
||||||
* Return void
|
|
||||||
* This function creates the arrow
|
|
||||||
*/
|
|
||||||
function create_arrow(arrow_layouts) {
|
|
||||||
arrow_layouts.each(function(d) {
|
arrow_layouts.each(function(d) {
|
||||||
self.arrow_by_pieces(self._target + " svg", d);
|
self.arrow_by_pieces(self._target + " svg", d);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -422,6 +455,7 @@ NetworkmapController.prototype.arrow_by_pieces = function (target, arrow_data, w
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (arrow_data['type']) {
|
switch (arrow_data['type']) {
|
||||||
|
case 'AF_or_FF':
|
||||||
case 'AA':
|
case 'AA':
|
||||||
MapController.prototype.arrow_by_pieces.call(
|
MapController.prototype.arrow_by_pieces.call(
|
||||||
this, self._target + " svg", arrow_data, wait);
|
this, self._target + " svg", arrow_data, wait);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user