version 1.2, 1999/11/17 21:53:43
|
version 1.5, 2000/06/28 03:41:48
|
Line 1
|
Line 1
|
<html> |
<html> |
|
<frameset rows="1,50,*" border=0> |
<!-- |
<frame name=server src="server.html" noresize noscroll> |
The LearningOnline Network |
<frame name=code src="code.html"> |
Resource Assembly Tool |
<frame name=mapout src="map.html"> |
7/23,7/24,7/26, |
</frameset> |
8/11,8/14,8/18,8/19,8/20,8/21,8/22,8/25,8/26,8/28,8/30,8/31, |
|
9/1,9/2,9/4,9/5,9/6 Gerd Kortemeyer with Scott Harrison |
|
11/10 Scott Harrison |
|
--> |
|
|
|
|
|
<head> |
|
<script language="JavaScript"> |
|
|
|
var row=new Array(); var maxrow=-1; var rowtype=new Array(); |
|
var col=new Array(); var maxcol=-1; var coltype=new Array(); |
|
|
|
var rowcont=new Array(); |
|
|
|
var colmap=new Array(); |
|
|
|
var colmap2=new Array(); var colmap3=new Array(); var colmap4=new Array(); var colmap5=new Array(); |
|
|
|
var obj=new Array(); var maxobj=-1; |
|
|
|
var rcol=new Array(); var rrow=new Array(); |
|
|
|
var cw=new Array(); var rh=new Array(); |
|
|
|
var data1=new Array(1024); var data2=new Array(1024); var data3=new Array(1024); var data4=new Array(1024); |
|
|
|
// ----------------------------------------- Functions to switch between images |
|
|
|
function ssws(doc,i,j) { |
|
var name='s'+i+'_'+j; |
|
doc.document[name].src='insrow.gif'; |
|
} |
|
|
|
function sswe(doc,i,j) { |
|
var name='s'+i+'_'+j; |
|
doc.document[name].src='sempty.gif'; |
|
} |
|
|
|
function sswet(doc,i,j) { |
|
var name='s'+i+'_'+j; |
|
doc.document[name].src='std.gif'; |
|
} |
|
|
|
function csws(doc,i,j) { |
|
var name='c'+i+'_'+j; |
|
doc.document[name].src='inscond.gif'; |
|
} |
|
|
|
function cswe(doc,i,j) { |
|
var name='c'+i+'_'+j; |
|
doc.document[name].src='sctd.gif'; |
|
} |
|
|
|
function isws(doc,i,j) { |
|
var name='i'+i+'_'+j; |
|
doc.document[name].src='inscol.gif'; |
|
} |
|
|
|
function iswel(doc,i,j) { |
|
var name='i'+i+'_'+j; |
|
doc.document[name].src='sld.gif'; |
|
} |
|
|
|
function iswed(doc,i,j) { |
|
var name='i'+i+'_'+j; |
|
doc.document[name].src='std.gif'; |
|
} |
|
|
|
function iswedt(doc,i,j) { |
|
var name='i'+i+'_'+j; |
|
doc.document[name].src='stdl.gif'; |
|
} |
|
|
|
|
|
function isweb(doc,i,j) { |
|
var name='i'+i+'_'+j; |
|
doc.document[name].src='sempty.gif'; |
|
} |
|
|
|
function bsws(doc,i,j) { |
|
var name='b'+i+'_'+j; |
|
doc.document[name].src='insres.gif'; |
|
} |
|
|
|
function bswe(doc,i,j) { |
|
var name='b'+i+'_'+j; |
|
doc.document[name].src='bempty.gif'; |
|
} |
|
|
|
function bswet(doc,i,j) { |
|
var name='b'+i+'_'+j; |
|
doc.document[name].src='btd.gif'; |
|
} |
|
|
|
// Insert a resource |
|
|
|
function insertresource(i,j) { |
|
var cols=tr[i].split(":"); |
|
cols[j]='r'+i+j; |
|
tr[i]=cols.join(':'); |
|
|
|
// This is only a test |
|
joinres(tti,ttj,i,j,'nodraw'); |
|
|
|
draw('edit'); |
|
} |
|
|
|
// Insert a condition |
|
|
|
function insertcondition(i,j) { |
|
var cols=tc[i].split(":"); |
|
cols[j]='r'+i+j; |
|
tc[i]=cols.join(':'); |
|
draw('edit'); |
|
} |
|
|
|
// ------------------------------------------------ Insert a row into the table |
|
|
|
function insertrow(j,size,ex1,ex2) { |
|
objects1=''; |
|
objects2=''; |
|
for (kj=0;kj<=maxrow;kj++) { |
|
if ( row[kj]==j ) { objects1=rowcont[kj]; } |
|
if ( row[kj]==j+1 ) { objects2=rowcont[kj]; } |
|
if ( row[kj]>j ) { row[kj]++; } |
|
} |
|
maxrow++; |
|
row[maxrow]=j+1; |
|
rowtype[maxrow]=size; |
|
rowcont[maxrow]=':'; |
|
colcover=':'+ex1+':'+ex2+':'; |
|
objects=objects1+':'+objects2; |
|
data1=objects.split(':'); |
|
for (kj=0;kj<data1.length;kj++) { |
|
if (data1[kj]!='') { |
|
thisisobj=obj[data1[kj]]; |
|
thisobjtype=thisisobj.split('&')[0]; |
|
if (thisobjtype=='v') { |
|
if (rowcont[maxrow].indexOf(':'+data1[kj]+':',0)==-1) { |
|
thisobjcol=thisisobj.split('&')[1]; |
|
if (colcover.indexOf(':'+thisobjcol+':',0)==-1) { |
|
colcover+=thisobjcol+':'; |
|
rowcont[maxrow]+=data1[kj]+':'; |
|
} |
|
} |
|
} |
|
if (thisobjtype=='h') { |
|
updown=thisisobj.split('&')[4]; |
|
leftupdown=updown.split(':')[0]; |
|
rightupdown=updown.split(':')[1]; |
|
thisobjdest=thisisobj.split('&')[3]; |
|
thisobjtofrom=thisisobj.split('&')[2]; |
|
thisobjfrom=thisobjtofrom.split(':')[0]; |
|
thisobjto=thisobjtofrom.split(':')[1]; |
|
thisobjdir=col[thisobjto]-col[thisobjfrom]; |
|
thisobjrow=row[thisisobj.split('&')[1]]; |
|
topbottom=thisobjrow-j-1; |
|
newobj=''; |
|
if (leftupdown==-1) { |
|
if (topbottom<0) { |
|
if (thisobjdir<0) { |
|
newobj='v&'+thisobjto+'&'+thisobjdest+'&-1'; |
|
} else { |
|
newobj='v&'+thisobjfrom+'&'+thisobjdest+'&1'; |
|
} |
|
} |
|
} else { |
|
if (topbottom>0) { |
|
if (thisobjdir<0) { |
|
newobj='v&'+thisobjto+'&'+thisobjdest+'&1'; |
|
} else { |
|
newobj='v&'+thisobjfrom+'&'+thisobjdest+'&-1'; |
|
} |
|
} |
|
} |
|
if (newobj!='') { |
|
thisobjcol=newobj.split('&')[1]; |
|
if (colcover.indexOf(':'+thisobjcol+':',0)==-1) { |
|
colcover+=thisobjcol+':'; |
|
rowcont[maxrow]+=obj.length+':'; |
|
obj[obj.length]=newobj; |
|
} |
|
} |
|
newobj=''; |
|
if (rightupdown==-1) { |
|
if (topbottom<0) { |
|
if (thisobjdir<0) { |
|
newobj='v&'+thisobjfrom+'&'+thisobjdest+'&1'; |
|
} else { |
|
newobj='v&'+thisobjto+'&'+thisobjdest+'&-1'; |
|
} |
|
} |
|
} else { |
|
if (topbottom>0) { |
|
if (thisobjdir<0) { |
|
newobj='v&'+thisobjfrom+'&'+thisobjdest+'&-1'; |
|
} else { |
|
newobj='v&'+thisobjto+'&'+thisobjdest+'&1'; |
|
} |
|
} |
|
} |
|
if (newobj!='') { |
|
thisobjcol=newobj.split('&')[1]; |
|
if (colcover.indexOf(':'+thisobjcol+':',0)==-1) { |
|
colcover+=thisobjcol+':'; |
|
rowcont[maxrow]+=obj.length+':'; |
|
obj[obj.length]=newobj; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (rowcont[maxrow]!=':') { |
|
rowcont[maxrow]=rowcont[maxrow].substring(1,rowcont[maxrow].length-1); |
|
} else { |
|
rowcont[maxrow]=''; |
|
} |
|
} |
|
|
|
// --------------------------------------------- Insert a column into the table |
|
|
|
function insertcol(j,size) { |
|
for (kj=0;kj<=maxcol;kj++) { |
|
if ( col[kj]>j ) { col[kj]++; } |
|
} |
|
maxcol++; |
|
col[maxcol]=j+1; |
|
coltype[maxcol]=size; |
|
} |
|
|
|
// --------------------------------------------------------------- Find the row |
|
|
|
function findrow(jid) { |
|
for (j=0;j<=maxrow;j++) { if (row[j]==jid) { return j; } } |
|
return -1; |
|
} |
|
|
|
// --------------------------------------------------------------- Find the col |
|
|
|
function findcol(jid) { |
|
for (j=0;j<=maxcol;j++) { if (col[j]==jid) { return j; } } |
|
return -1; |
|
} |
|
|
|
// -------------------------------------------------------------- Map out a row |
|
// |
|
// b&rowID&colID:inObj:outObj:outCond&... |
|
// h&rowID&incolID:outcolID&inObj:outObj&inupdown:outupdown |
|
// v&colID&inObj:outObj&updown |
|
// |
|
// returns middle (col number of middle of obj1) |
|
// sets colmap (map of cols with object numbers) |
|
|
|
function maprow (jid,obj1,ign) { |
|
middle=-1; |
|
for (j=0;j<=maxcol;j++) { colmap[j]=0; } |
|
if (rowcont[jid]!='') { |
|
data2=rowcont[jid].split(':'); |
|
for (j=0;j<data2.length;j++) { |
|
data3=obj[data2[j]].split('&'); |
|
if (data3[0]=='b') { |
|
left=maxcol; |
|
right=0; |
|
for (k=2;k<data3.length;k++) { |
|
thiscol=col[data3[k].split(':')[0]]; |
|
if (thiscol<left) { left=thiscol; } |
|
if (thiscol>right) { right=thiscol; } |
|
} |
|
} |
|
if (data3[0]=='h') { |
|
data4=data3[2].split(':'); |
|
if (col[data4[1]]>col[data4[0]]) { |
|
left=col[data4[0]]; |
|
right=col[data4[1]]; |
|
} else { |
|
right=col[data4[0]]; |
|
left=col[data4[1]]; |
|
} |
|
} |
|
if (data3[0]=='v') { left=col[data3[1]]; right=left; } |
|
if (data2[j]==obj1) { middle=Math.round((left+right)/2); } |
|
if ((data3[0]!='h') || (ign!=1)) { |
|
for (k=left;k<=right;k++) { colmap[k]=data2[j]; } |
|
} else { |
|
colmap[left]=data2[j]; |
|
colmap[right]=data2[j]; |
|
} |
|
} |
|
} |
|
return middle; |
|
} |
|
|
|
// --------------------------------------------------------- Find hole in a row |
|
// jid: rowID |
|
// kid: colID, find point close to this |
|
// dkid: destination colID |
|
// returns colID |
|
|
|
function comingthru (jid,kid,dkid) { |
|
maprow(jid,-1,1); |
|
knum=col[kid]; |
|
if (colmap[knum]==0) { return kid; } |
|
right=-1; |
|
for (k=knum+1;(k<colmap.length) && (right==-1);k++) { |
|
if ((right==-1) && (colmap[k]!=colmap[knum])) { right=k; } |
|
} |
|
left=-1; |
|
for (k=knum-1;(k>=0) && (left==-1);k--) { |
|
if ((left==-1) && (colmap[k]!=colmap[knum])) { left=k; } |
|
} |
|
kup=-1; |
|
// if ((left==-1) && (right==-1)) { right=colmap.length; } |
|
dknum=col[dkid]; |
|
dleft=left-dknum; |
|
dright=right-dknum; |
|
if (dleft<0) { dleft=-dleft; } |
|
if (dright<0) { dright=-dright; } |
|
if ((dright<=dleft) && (right!=-1)) { kup=right; } |
|
if ((dright>=dleft) && (left!=-1)) { kup=left; } |
|
if (colmap[kup]==0) { return findcol(kup); } |
|
if (kup==right) { kup--; } |
|
insertcol(kup,1); |
|
return maxcol; |
|
} |
|
|
|
// ----------------------------------------------------- Insert port into block |
|
// obj1: object number |
|
// d: direction from middle (>0: right, <0 left) |
|
// inout: in or out port (1: in, 2: out) |
|
// linkobj: object that the link goes to/comes from |
|
// sets incol,inrow or outcol,outrow |
|
|
|
function insertport (obj1,d,inout,linkobj) { |
|
data1=obj[obj1].split('&'); |
|
middle=maprow(data1[1],obj1,0); |
|
if (inout==1) { |
|
inrow=data1[1]; |
|
} else { |
|
outrow=data1[1]; |
|
} |
|
if (d>0) { |
|
for (k=middle;(colmap[k]==obj1) && (k<colmap.length);k++) { data3[k]=0; } |
|
} else { |
|
for (k=middle;(colmap[k]==obj1) && (k>=0);k--) { data3[k]=0; } |
|
} |
|
for (k=2;k<data1.length;k++) { |
|
data2=data1[k].split(':'); |
|
data3[col[data2[0]]]=data2[inout]; |
|
} |
|
port=-1; |
|
if (d>0) { |
|
for (k=middle;(colmap[k]==obj1) && (k<colmap.length);k++) { |
|
if ((data3[k]==0) && (colmap[k]==obj1) && (port==-1)) { port=k; } |
|
} |
|
} else { |
|
for (k=middle;(colmap[k]==obj1) && (k>=0);k--) { |
|
if ((data3[k]==0) && (colmap[k]==obj1) && (port==-1)) { port=k; } |
|
} |
|
} |
|
|
|
if (port==-1) { |
|
if (colmap[k]==0) { |
|
port=k; |
|
if (inout==1) { |
|
data1[data1.length]=findcol(port)+":"+linkobj+":0:0"; |
|
} else { |
|
data1[data1.length]=findcol(port)+":0:"+linkobj+":0"; |
|
} |
|
} else { |
|
if (d>0) { |
|
insertcol(k-1,2); |
|
port=k; |
|
} else { |
|
insertcol(k,2); |
|
port=k+1; |
|
} |
|
if (inout==1) { |
|
data1[data1.length]=maxcol+":"+linkobj+":0:0"; |
|
} else { |
|
data1[data1.length]=maxcol+":0:"+linkobj+":0"; |
|
} |
|
} |
|
} else { |
|
portfound=-1; |
|
for (k=2;k<data1.length;k++) { |
|
data2=data1[k].split(':'); |
|
if (col[data2[0]]==port) { |
|
data2[inout]=linkobj; |
|
data1[k]=data2.join(':'); |
|
portfound=1; |
|
} |
|
} |
|
if (portfound==-1) { |
|
if (inout==1) { |
|
data1[data1.length]=findcol(port)+":"+linkobj+":0:0"; |
|
} else { |
|
data1[data1.length]=findcol(port)+":0:"+linkobj+":0"; |
|
} |
|
} |
|
} |
|
if (inout==1) { |
|
incol=findcol(port); |
|
coltype[incol]=2; |
|
} else { |
|
outcol=findcol(port); |
|
coltype[outcol]=2; |
|
} |
|
obj[obj1]=data1.join('&'); |
|
} |
|
|
|
// ---------------------------- Make a new object and add it to the row content |
|
|
|
function addobj(kjid,objs) { |
|
if (rowcont[kjid]!='') { rowcont[kjid]+=':'; } |
|
rowcont[kjid]+=obj.length; |
|
obj[obj.length]=objs; |
|
} |
|
|
|
// ---------------------------------------- Make horizontal connection for hrid |
|
// hoffs=-1: this line goes on top of hrid |
|
|
|
function horizontal(hrid,hoffs,hfcol,htcol,hdest,hends) { |
|
hcrid=-1; |
|
if (hoffs==-1) { |
|
hbrid=findrow(row[hrid]-1); |
|
} else { |
|
hbrid=findrow(row[hrid]+1); |
|
} |
|
if (hbrid!=-1) { |
|
maprow(hbrid,-1,0); |
|
hcrid=hbrid; |
|
if (col[hfcol]>col[htcol]) { left=col[htcol]; right=col[hfcol]; } |
|
else { right=col[htcol]; left=col[hfcol]; } |
|
if (colmap[left]!=0) { |
|
hcrid=-1; |
|
} else { |
|
if (colmap[right]!=0) { |
|
hcrid=-1; |
|
} else { |
|
for (kh=left+1;kh<right;kh++) { |
|
if (colmap[kh]!=0) { |
|
if (obj[colmap[kh]].split('&')[0]!='v') { hcrid=-1; } |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
if (hcrid==-1) { |
|
insertrow(row[hrid]+hoffs,1,hfcol,htcol); |
|
addobj(maxrow,'h&'+maxrow+'&'+hfcol+':'+htcol+'&'+hdest+'&'+hends); |
|
} else { |
|
addobj(hcrid,'h&'+hcrid+'&'+hfcol+':'+htcol+'&'+hdest+'&'+hends); |
|
} |
|
} |
|
|
|
// ----------------------------------------------------------- Join two objects |
|
// Links obj1 with obj2 |
|
|
|
function joinres (obj1,obj2) { |
|
data3=obj[obj1].split('&'); |
|
sum=0; |
|
for (k=2;k<data3.length;k++) { sum+=col[data3[k].split(':')[0]]; } |
|
outmiddle=sum/(data3.length-2); |
|
data3=obj[obj2].split('&'); |
|
sum=0; |
|
for (k=2;k<data3.length;k++) { sum+=col[data3[k].split(':')[0]]; } |
|
inmiddle=sum/(data3.length-2); |
|
d=inmiddle-outmiddle; |
|
insertport(obj1,d,2,obj2); |
|
insertport(obj2,-d,1,obj1); |
|
dest=obj1+':'+obj2; |
|
if (row[inrow]<row[outrow]) { |
|
updown=1; |
|
tcol=comingthru(inrow,incol,outcol); |
|
horizontal(inrow,-1,tcol,incol,dest,'-1:-1'); |
|
addobj(inrow,'v&'+tcol+'&'+dest+'&1'); |
|
incol=tcol; |
|
tcol=comingthru(outrow,outcol,incol); |
|
horizontal(outrow,0,outcol,tcol,dest,'1:1'); |
|
addobj(outrow,'v&'+tcol+'&'+dest+'&1'); |
|
outcol=tcol; |
|
} else { |
|
updown=-1; |
|
} |
|
|
|
if (inrow==outrow) { |
|
tcol=comingthru(inrow,incol,outcol); |
|
horizontal(inrow,-1,tcol,incol,dest,'-1:-1'); |
|
addobj(inrow,'v&'+tcol+'&'+dest+'&1'); |
|
horizontal(outrow,0,outcol,tcol,dest,'1:1'); |
|
} else { |
|
if (updown==-1) { |
|
for (kr=row[outrow]+1;kr<row[inrow];kr++) { |
|
rid=findrow(kr); |
|
ncol=comingthru(rid,outcol,incol); |
|
if (ncol!=outcol) { |
|
insertrow(k-1,1,outcol,ncol); |
|
if (col[ncol]>col[incol]) { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+ncol+'&'+dest+'&-1:1'); |
|
} else { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+ncol+'&'+dest+'&1:-1'); |
|
} |
|
} |
|
addobj(rid,'v&'+ncol+'&'+dest+'&-1'); |
|
outcol=ncol; |
|
} |
|
if (incol!=outcol) { |
|
insertrow(row[inrow]-1,1,outcol,incol); |
|
if (col[outcol]>col[incol]) { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+incol+'&'+dest+'&-1:1'); |
|
} else { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+incol+'&'+dest+'&1:-1'); |
|
} |
|
} |
|
} else { |
|
for (kr=row[outrow]-1;kr>row[inrow];kr--) { |
|
rid=findrow(kr); |
|
ncol=comingthru(rid,outcol,incol); |
|
if (ncol!=outcol) { |
|
insertrow(k,1,outcol,ncol); |
|
if (col[outcol]>col[ncol]) { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+ncol+'&'+dest+'&1:-1'); |
|
} else { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+ncol+'&'+dest+'&-1:1'); |
|
} |
|
} |
|
addobj(rid,'v&'+ncol+'&'+dest+'&1'); |
|
outcol=ncol; |
|
} |
|
if (incol!=outcol) { |
|
insertrow(row[inrow],1,outcol,incol); |
|
if (col[outcol]>col[incol]) { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+incol+'&'+dest+'&1:-1'); |
|
} else { |
|
addobj(maxrow,'h&'+maxrow+'&'+outcol+':'+incol+'&'+dest+'&-1:1'); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
// -------------------------------------------------------------- Draw an entry |
|
|
|
function drawcell (rtype,ctype,what,cm,mode2) { |
|
doc.document.write('<td width='+cw[ctype]+'>'); |
|
if (what!='') { |
|
if (cm!=0) { |
|
if (what.substring(0,2)=='r:') { |
|
doc.document.write(what); |
|
} else { |
|
doc.document.write('<img src="'+rtype+'.'+ctype+'.'+what+'.gif">'); |
|
} |
|
} else { |
|
doc.document.write('<img src="'+rtype+'.'+ctype+'.'+what+'.gif">'); |
|
} |
|
} |
|
doc.document.write('</td>'); |
|
} |
|
|
|
// ----------------------------------------------------------------- Draw a row |
|
|
|
function drawrow (jid,mode2) { |
|
for (j=0;j<=maxcol;j++) { |
|
colmap[j]=''; colmap2[j]=''; colmap3[j]=''; colmap4[j]=''; colmap5[j]=''; |
|
} |
|
doc.document.writeln('<tr height='+rh[rowtype[jid]]+'>'); |
|
if (rowcont[jid]!='') { |
|
data2=rowcont[jid].split(':'); |
|
for (jk=0;jk<data2.length;jk++) { |
|
data3=obj[data2[jk]].split('&'); |
|
if (data3[0]=='b') { |
|
left=maxcol; |
|
leftin=maxcol; |
|
leftout=maxcol; |
|
right=0; |
|
rightin=0; |
|
rightout=0; |
|
for (k=2;k<data3.length;k++) { |
|
data1=data3[k].split(':'); |
|
thiscol=col[data1[0]]; |
|
if (thiscol<left) { left=thiscol; } |
|
if (thiscol>right) { right=thiscol; } |
|
if (data1[1]!=0) { |
|
if (thiscol<leftin) { leftin=thiscol; } |
|
if (thiscol>rightin) { rightin=thiscol; } |
|
colmap4[thiscol]=data1[1]; |
|
} |
|
if (data1[2]!=0) { |
|
if (thiscol<leftout) { leftout=thiscol; } |
|
if (thiscol>rightout) { rightout=thiscol; } |
|
if (data1[3]!=0) { |
|
colmap3[thiscol]='r:'+data1[3]; |
|
colmap5[thiscol]=2; |
|
} else { |
|
colmap3[thiscol]='ctd'; |
|
} |
|
} |
|
} |
|
middle=Math.round((left+right)/2); |
|
colmap[middle]='r:'+data2[jk]; |
|
colmap5[middle]=1; |
|
|
|
if (rightin>middle) { |
|
for (k=middle+1;k<rightin;k++) { |
|
if (colmap4[k]!='') { |
|
colmap[k]='rlt'; |
|
} else { |
|
colmap[k]='rl'; |
|
} |
|
} |
|
colmap[rightin]='tl'; |
|
} |
|
if (leftin<middle) { |
|
for (k=middle-1;k>leftin;k--) { |
|
if (colmap4[k]!='') { |
|
colmap[k]='lrt'; |
|
} else { |
|
colmap[k]='lr'; |
|
} |
|
} |
|
colmap[leftin]='tr'; |
|
} |
|
|
|
if (leftout>middle) { |
|
if (colmap3[leftout]!='') { |
|
colmap2[middle]='tr'; |
|
} |
|
} |
|
if (leftout==middle) { |
|
if (rightout==middle) { colmap2[middle]='td'; } |
|
if (rightout>middle) { colmap2[middle]='rtd'; } |
|
} |
|
if (leftout<middle) { |
|
if (rightout<middle) { colmap2[middle]='tl'; } |
|
if (rightout==middle) { colmap2[middle]='tdl'; } |
|
if (rightout>middle) { |
|
if (colmap3[middle]!='') { |
|
colmap2[middle]='rtdl'; |
|
} else { |
|
colmap2[middle]='rtl'; |
|
} |
|
} |
|
} |
|
if (leftout<middle) { |
|
for (k=middle-1;k>leftout;k--) { |
|
if (colmap3[k]!='') { |
|
colmap2[k]='rld'; |
|
} else { |
|
colmap2[k]='rl'; |
|
} |
|
} |
|
colmap2[leftout]='rd'; |
|
} |
|
if (rightout>middle) { |
|
for (k=middle+1;k<rightout;k++) { |
|
if (colmap3[k]!='') { |
|
colmap2[k]='lrd'; |
|
} else { |
|
colmap2[k]='lr'; |
|
} |
|
} |
|
colmap2[rightout]='ld'; |
|
} |
|
} |
|
if (data3[0]=='h') { |
|
data4=data3[2].split(':'); |
|
if (col[data4[1]]>col[data4[0]]) { |
|
left=col[data4[0]]; |
|
right=col[data4[1]]; |
|
thisarrow='lr'; |
|
} else { |
|
right=col[data4[0]]; |
|
left=col[data4[1]]; |
|
thisarrow='rl'; |
|
} |
|
if (data3[4].split(':')[0]==1) { |
|
colmap[left]='tr'; |
|
} else { |
|
colmap[left]='rd'; colmap2[left]='utd'; colmap3[left]='utd'; |
|
} |
|
for (k=left+1;k<right;k++) { |
|
if (colmap[k]=='') { |
|
colmap[k]=thisarrow; |
|
} else { |
|
colmap[k]='tdrl'; |
|
} |
|
} |
|
if (data3[4].split(':')[1]==1) { |
|
colmap[right]='tl'; |
|
} else { |
|
colmap[right]='ld'; colmap2[right]='utd'; colmap3[right]='utd'; |
|
} |
|
} |
|
if (data3[0]=='v') { |
|
left=col[data3[1]]; |
|
if (colmap[left]=='') { |
|
if (data3[3]==1) { colmap[left]='dt'; } else { colmap[left]='td'; } |
|
} else { |
|
colmap[left]='tdrl'; |
|
} |
|
colmap2[left]='utd'; colmap3[left]='utd'; |
|
} |
|
} |
|
rtype=rowtype[jid]; |
|
for (k=0;k<=maxcol;k++) { |
|
drawcell(rtype,coltype[rcol[k]],colmap[k],colmap5[k],mode2); |
|
} |
|
if (rowtype[jid]==2) { |
|
doc.document.writeln('</tr><tr>'); |
|
for (k=0;k<=maxcol;k++) { |
|
drawcell(1,coltype[rcol[k]],colmap2[k],colmap5[k],mode2); |
|
} |
|
doc.document.writeln('</tr><tr>'); |
|
for (k=0;k<=maxcol;k++) { |
|
drawcell(1,coltype[rcol[k]],colmap3[k],colmap5[k],mode2); |
|
} |
|
} |
|
} |
|
doc.document.writeln('</tr>'); |
|
} |
|
|
|
// ------------------------------------------------------------- Draw the table |
|
|
|
function draw (mode,mode2) { |
|
if (mode=='debug') { |
|
var options="scrollbars=1,resizable=1,menubar=0,width=200,height=300"; |
|
deb=open("","debout",options); |
|
deb.document.clear(); |
|
deb.document.writeln('<html><body bgcolor="#FFFFFF">'); |
|
|
|
for (k=0;k<obj.length;k++) { deb.document.writeln(k+' - '+obj[k]+'<br>'); } |
|
deb.document.writeln('<hr>Cols: '+col+'<hr>Rows: '+row+'<hr>'); |
|
for (kr=0;kr<=maxrow;kr++) { |
|
kid=findrow(kr); |
|
maprow(kid,-1,0); |
|
deb.document.writeln(kid+' : '+colmap+' '+rowcont[kid]+"<br>"); |
|
} |
|
|
|
deb.document.writeln('</body></html>'); |
|
deb.document.close(); |
|
} |
|
|
|
for (k=0;k<=maxrow;k++) { rrow[row[k]]=k; } |
|
for (k=0;k<=maxcol;k++) { rcol[col[k]]=k; } |
|
rh[1]=30; |
|
rh[2]=60; |
|
cw[1]=30; |
|
cw[2]=60; |
|
var options="scrollbars=1,resizable=1,menubar=0,width=200,height=300"; |
|
doc=open("","mapout",options); |
|
doc.document.clear(); |
|
doc.document.writeln('<html><body bgcolor="#AAFFAA">'); |
|
doc.document.writeln('<table cellpadding=0 cellspacing=0 border=0>'); |
|
|
|
for (kr=0;kr<=maxrow;kr++) { drawrow(rrow[kr],mode2); } |
|
|
|
doc.document.writeln('</table>'); |
|
doc.document.writeln('</body></html>'); |
|
doc.document.close(); |
|
|
|
} |
|
|
|
function main() { |
|
row[0]=0; |
|
row[1]=1; |
|
row[2]=2; |
|
rowcont[0]='5:4'; |
|
rowtype[0]=2; |
|
rowcont[1]='3'; |
|
rowtype[1]=2; |
|
rowcont[2]='7'; |
|
rowtype[2]=2; |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
insertcol(0,1); |
|
swap=col[8]; |
|
col[8]=col[3]; |
|
col[3]=swap; |
|
swap=col[6]; |
|
col[6]=col[4]; |
|
col[4]=swap; |
|
maxrow=2; |
|
obj[3]='b&1&4:0:0:0'; |
|
coltype[4]=2; |
|
obj[4]='b&0&8:0:0:0'; |
|
coltype[8]=2; |
|
obj[5]='b&0&2:0:0:0'; |
|
coltype[2]=2; |
|
obj[7]='b&2&5:0:0:0'; |
|
coltype[5]=2; |
|
joinres(7,4); |
|
joinres(4,7); |
|
joinres(7,5); |
|
joinres(5,7); |
|
joinres(7,7); |
|
joinres(4,5); |
|
joinres(5,5); |
|
joinres(3,4); |
|
joinres(3,7); |
|
joinres(5,3); |
|
joinres(7,3); |
|
joinres(4,3); |
|
draw('debug','edit'); |
|
} |
|
|
|
</script> |
|
</head> |
|
|
|
<! body onLoad="main()"> |
|
<body> |
|
Welcome to the Resource Assembly Tool.<P>Your browser must be javascript enabled to use this tool. Enjoy! |
|
</body> |
|
|
|
</html> |
</html> |
|
|