mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-01 15:26:12 +00:00
62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
doInclude ([
|
|
include ("features/base_handler/index.js")
|
|
])
|
|
|
|
/**
|
|
* Save/Load graph from Incidence matrix.
|
|
*
|
|
*/
|
|
function ShowIncidenceMatrix(app)
|
|
{
|
|
BaseHandler.apply(this, arguments);
|
|
this.message = "";
|
|
}
|
|
|
|
// inheritance.
|
|
ShowIncidenceMatrix.prototype = Object.create(BaseHandler.prototype);
|
|
// First selected.
|
|
ShowIncidenceMatrix.prototype.firstObject = null;
|
|
// Path
|
|
ShowIncidenceMatrix.prototype.pathObjects = null;
|
|
|
|
ShowIncidenceMatrix.prototype.show = function()
|
|
{
|
|
var handler = this;
|
|
var dialogButtons = {};
|
|
|
|
$('#IncidenceMatrixField').unbind();
|
|
$( "#IncidenceMatrixField" ).on('keyup change', function (eventObject)
|
|
{
|
|
if (!handler.app.TestIncidenceMatrix($( "#IncidenceMatrixField" ).val(), [], []))
|
|
{
|
|
$( "#BadIncidenceMatrixFormatMessage" ).show();
|
|
}
|
|
else
|
|
{
|
|
$( "#BadIncidenceMatrixFormatMessage" ).hide();
|
|
}
|
|
});
|
|
|
|
dialogButtons[g_save] = function() {
|
|
handler.app.PushToStack("IncidenceMatrixChanged");
|
|
handler.app.SetIncidenceMatrixSmart($( "#IncidenceMatrixField" ).val());
|
|
$( this ).dialog( "close" );
|
|
};
|
|
dialogButtons[g_cancel] = function() {
|
|
$( this ).dialog( "close" );
|
|
};
|
|
|
|
$( "#IncidenceMatrixField" ).val(this.app.GetIncidenceMatrix());
|
|
$( "#BadIncidenceMatrixFormatMessage" ).hide();
|
|
|
|
$( "#incidenceMatrix" ).dialog({
|
|
resizable: false,
|
|
height: "auto",
|
|
width: "auto",
|
|
modal: true,
|
|
title: g_incidenceMatrixText,
|
|
buttons: dialogButtons,
|
|
dialogClass: 'EdgeDialog'
|
|
});
|
|
}
|