Commit faf9e9dc authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

matrix (new)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48314 954022d7-b5bf-4e40-9824-e11837661b57
parent b54b7823
...@@ -19,27 +19,6 @@ CDegreeOrdinary.prototype.init_2 = function(base) ...@@ -19,27 +19,6 @@ CDegreeOrdinary.prototype.init_2 = function(base)
this.addMCToContent(base, degree); this.addMCToContent(base, degree);
} }
CDegreeOrdinary.prototype.old_setContent = function()
{
var oBase = null;
if(arguments.length > 0)
oBase = arguments[0];
else
{
oBase = new CMathContent();
oBase.init( this.params );
oBase.relate(this);
oBase.fillPlaceholders();
}
var oDegree = new CMathContent();
oDegree.init( this.params );
oDegree.relate(this);
oDegree.fillPlaceholders();
oDegree.setFont(getTypeDegree(this.params.font), -1);
CDegreeOrdinary.superclass.setContent.call(this, oBase, oDegree);
}
CDegreeOrdinary.prototype.setIndex = function(index) CDegreeOrdinary.prototype.setIndex = function(index)
{ {
this.index = index; this.index = index;
...@@ -276,39 +255,6 @@ CDegreeSubSup.prototype.init_2 = function(oBase) ...@@ -276,39 +255,6 @@ CDegreeSubSup.prototype.init_2 = function(oBase)
this.addMCToContent(oIters, oBase); this.addMCToContent(oIters, oBase);
} }
} }
CDegreeSubSup.prototype.old_setContent = function()
{
var oBase = null;
if(arguments.length > 0)
oBase = arguments[0];
else
{
oBase = new CMathContent();
oBase.init( this.params );
oBase.relate(this);
oBase.fillPlaceholders();
}
var oIters = new CIterators();
oIters.init( this.params );
oIters.relate(this);
oIters.fillPlaceholders();
oIters.setFont(getTypeDegree(this.params.font), -1);
oIters.lUp = 0;
oIters.lD = 0;
if(this.type == 0)
{
oIters.alignHor(-1, 0);
CDegreeSubSup.superclass.setContent.call(this, oBase, oIters);
}
else
{
oIters.alignHor(-1, 1);
CDegreeSubSup.superclass.setContent.call(this, oIters, oBase);
}
}
CDegreeSubSup.prototype.recalculateSize = function() CDegreeSubSup.prototype.recalculateSize = function()
{ {
if(this.type == 0) if(this.type == 0)
......
...@@ -63,30 +63,6 @@ CMinimaxFunc.prototype.init = function() ...@@ -63,30 +63,6 @@ CMinimaxFunc.prototype.init = function()
this.addMCToContent(oBase, oIter); this.addMCToContent(oBase, oIter);
} }
CMinimaxFunc.prototype.old_setContent = function()
{
var oBase = new CMathContent();
var GParams = Common_CopyObj(this.params);
GParams.bMText = false;
oBase.init(GParams);
oBase.relate(this);
if(this.num == 0)
oBase.addText("min");
else if(this.num == 1)
oBase.addText("max");
else
oBase.addText("lim");
var oIter = new CMathContent();
GParams = Common_CopyObj(this.params);
GParams.font = getTypeDegree(this.params.font);
oIter.init(GParams);
oIter.relate(this);
oIter.fillPlaceholders();
CMinimaxFunc.superclass.setContent.call(this, oBase, oIter);
}
CMinimaxFunc.prototype.getCenter = function() CMinimaxFunc.prototype.getCenter = function()
{ {
return this.elements[0][0].size.center; return this.elements[0][0].size.center;
...@@ -128,27 +104,6 @@ CMinimax.prototype.init = function() ...@@ -128,27 +104,6 @@ CMinimax.prototype.init = function()
this.addMCToContent(oFunc, oArg); this.addMCToContent(oFunc, oArg);
} }
CMinimax.prototype.old_setContent = function()
{
var oFunc = new CMinimaxFunc(this.num);
oFunc.init(this.params);
oFunc.relate(this);
oFunc.setContent();
var oArg = new CMathContent();
oArg.init(this.params);
oArg.relate(this);
oArg.fillPlaceholders();
CMinimax.superclass.setContent.call(this, oFunc, oArg);
}
CMinimax.prototype.old_setDistance = function()
{
//todo
//переделать !
this.dW = slashWidth(this.params.font);
this.dH = 0;
}
CMinimax.prototype.getFunction = function() CMinimax.prototype.getFunction = function()
{ {
return this.elements[0][0].getBase(); return this.elements[0][0].getBase();
......
...@@ -248,6 +248,9 @@ CMathContent.prototype = ...@@ -248,6 +248,9 @@ CMathContent.prototype =
case 20: case 20:
mathElem = new CStructArrow(); mathElem = new CStructArrow();
break; break;
case 21:
mathElem = new CMathMatrix();
break;
case 30: case 30:
mathElem = new CMathBase(); mathElem = new CMathBase();
break; break;
...@@ -1752,6 +1755,256 @@ CMathContent.prototype = ...@@ -1752,6 +1755,256 @@ CMathContent.prototype =
var base = arrow.getBase(); var base = arrow.getBase();
base.addTxt(""); base.addTxt("");
break; break;
case 206:
var matrix = this.createMComponent(21);
matrix.init(1, 2);
matrix.fillPlaceholders();
break;
case 207:
var matrix = this.createMComponent(21);
matrix.init(2, 1);
matrix.fillPlaceholders();
break;
case 208:
var matrix = this.createMComponent(21);
matrix.init(1, 3);
matrix.fillPlaceholders();
break;
case 209:
var matrix = this.createMComponent(21);
matrix.init(3, 1);
matrix.fillPlaceholders();
break;
case 210:
var matrix = this.createMComponent(21);
matrix.init(2, 2);
matrix.fillPlaceholders();
break;
case 211:
var matrix = this.createMComponent(21);
matrix.init(2, 3);
matrix.fillPlaceholders();
break;
case 212:
var matrix = this.createMComponent(21);
matrix.init(3, 2);
matrix.fillPlaceholders();
break;
case 213:
var matrix = this.createMComponent(21);
matrix.init(3, 3);
matrix.fillPlaceholders();
break;
case 214:
this.addTxt("");
break;
case 215:
this.addTxt("");
break;
case 216:
this.addTxt("");
break;
case 217:
this.addTxt("");
break;
case 218:
var matrix = this.createMComponent(21);
matrix.init(2, 2);
elem1 = matrix.getElement(0,0);
elem1.addTxt("1");
elem2 = matrix.getElement(0,1);
elem2.addTxt("0");
elem3 = matrix.getElement(1,0);
elem3.addTxt("0");
elem4 = matrix.getElement(1,1);
elem4.addTxt("1");
break;
case 219:
var matrix = this.createMComponent(21);
matrix.init(2, 2);
matrix.hidePlaceholder(true);
elem1 = matrix.getElement(0,0);
elem1.addTxt("1");
elem2 = matrix.getElement(0,1);
elem2.fillPlaceholders();
elem3 = matrix.getElement(1,0);
elem3.fillPlaceholders();
elem4 = matrix.getElement(1,1);
elem4.addTxt("1");
break;
case 220:
var matrix = this.createMComponent(21);
matrix.init(3, 3);
elem1 = matrix.getElement(0,0);
elem1.addTxt("1");
elem2 = matrix.getElement(0,1);
elem2.addTxt("0");
elem3 = matrix.getElement(0,2);
elem3.addTxt("0");
elem4 = matrix.getElement(1,0);
elem4.addTxt("0");
elem5 = matrix.getElement(1,1);
elem5.addTxt("1");
elem6 = matrix.getElement(1,2);
elem6.addTxt("0");
elem7 = matrix.getElement(2,0);
elem7.addTxt("0");
elem8 = matrix.getElement(2,1);
elem8.addTxt("0");
elem9 = matrix.getElement(2,2);
elem9.addTxt("1");
break;
case 221:
var matrix = this.createMComponent(21);
matrix.init(3, 3);
matrix.hidePlaceholder(true);
elem1 = matrix.getElement(0,0);
elem1.addTxt("1");
elem2 = matrix.getElement(0,1);
elem2.fillPlaceholders();
elem3 = matrix.getElement(0,2);
elem3.fillPlaceholders();
elem4 = matrix.getElement(1,0);
elem4.fillPlaceholders();
elem5 = matrix.getElement(1,1);
elem5.addTxt("1");
elem6 = matrix.getElement(1,2);
elem6.fillPlaceholders();
elem7 = matrix.getElement(2,0);
elem7.fillPlaceholders();
elem8 = matrix.getElement(2,1);
elem8.fillPlaceholders();
elem9 = matrix.getElement(2,2);
elem9.addTxt("1");
break;
case 222:
var delim = this.createMComponent(9);
delim.init(0, 4, 0, 1);
base = delim.getBase();
var matrix = base.createMComponent(21);
matrix.init(2, 2);
matrix.fillPlaceholders();
break;
case 223:
var delim = this.createMComponent(9);
delim.init(2, 4, 0, 1);
base = delim.getBase();
var matrix = base.createMComponent(21);
matrix.init(2, 2);
matrix.fillPlaceholders();
break;
case 224:
var delim = this.createMComponent(9);
delim.init(5, 4, 0, 1);
base = delim.getBase();
var matrix = base.createMComponent(21);
matrix.init(2, 2);
matrix.fillPlaceholders();
break;
case 225:
var delim = this.createMComponent(9);
delim.init(6, 4, 0, 1);
base = delim.getBase();
var matrix = base.createMComponent(21);
matrix.init(2, 2);
matrix.fillPlaceholders();
break;
case 226:
var delim = this.createMComponent(9);
delim.init(0, 4, 0, 1);
base = delim.getBase();
var matrix = base.createMComponent(21);
matrix.init(3, 3);
elem1 = matrix.getElement(0,0);
elem1.fillPlaceholders();
elem2 = matrix.getElement(0,1);
elem2.addTxt("");
elem3 = matrix.getElement(0,2);
elem3.fillPlaceholders();
elem4 = matrix.getElement(1,0);
elem4.addTxt("");
elem5 = matrix.getElement(1,1);
elem5.addTxt("");
elem6 = matrix.getElement(1,2);
elem6.addTxt("");
elem7 = matrix.getElement(2,0);
elem7.fillPlaceholders();
elem8 = matrix.getElement(2,1);
elem8.addTxt("");
elem9 = matrix.getElement(2,2);
elem9.fillPlaceholders();
break;
case 227:
var delim = this.createMComponent(9);
delim.init(2, 4, 0, 1);
base = delim.getBase();
var matrix = base.createMComponent(21);
matrix.init(3, 3);
elem1 = matrix.getElement(0,0);
elem1.fillPlaceholders();
elem2 = matrix.getElement(0,1);
elem2.addTxt("");
elem3 = matrix.getElement(0,2);
elem3.fillPlaceholders();
elem4 = matrix.getElement(1,0);
elem4.addTxt("");
elem5 = matrix.getElement(1,1);
elem5.addTxt("");
elem6 = matrix.getElement(1,2);
elem6.addTxt("");
elem7 = matrix.getElement(2,0);
elem7.fillPlaceholders();
elem8 = matrix.getElement(2,1);
elem8.addTxt("");
elem9 = matrix.getElement(2,2);
elem9.fillPlaceholders();
break;
} }
}, },
...@@ -2330,6 +2583,8 @@ CMathContent.prototype = ...@@ -2330,6 +2583,8 @@ CMathContent.prototype =
for(var i = 0; i < this.content.length; i++) for(var i = 0; i < this.content.length; i++)
this.content[i].value.Resize(); this.content[i].value.Resize();
this.rInterval.startPos = this.rInterval.endPos = this.CurPos;
this.recalculateSize(); this.recalculateSize();
}, },
draw: function() draw: function()
......
This diff is collapsed.
...@@ -2081,44 +2081,6 @@ CStructArrow.prototype.init = function(type, loc, turn) ...@@ -2081,44 +2081,6 @@ CStructArrow.prototype.init = function(type, loc, turn)
this.addMCToContent(argument, operator); this.addMCToContent(argument, operator);
} }
CStructArrow.prototype.old_setContent = function()
{
var operator;
if(this.type == 0)
operator = new CHalfArrow();
else if(this.type == 1)
operator = new CSingleArrow();
else if(this.type == 2)
operator = new CLeftRightArrow();
else if(this.type == 3)
operator = new CDoubleArrow();
else if(this.type == 4)
operator = new CLR_DoubleArrow();
else if(this.type == 5)
operator = new CCombiningArrow();
operator.init(this.params);
operator.setLocation(this.loc, this.turn);
var params2 = Common_CopyObj(this.params);
params2.font = getTypeDegree(params2.font);
var argument = new CMathContent();
//var argument = new CDenominator();
argument.init(params2);
argument.relate(this);
argument.fillPlaceholders();
if(this.loc == 0)
{
CStructArrow.superclass.setContent.call(this, operator, argument);
}
else
{
CStructArrow.superclass.setContent.call(this, argument, operator);
}
}
CStructArrow.prototype.getCenter = function() CStructArrow.prototype.getCenter = function()
{ {
var center, sizeGlyph; var center, sizeGlyph;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment