Commit 62101b4eba8a799720adea75f31b41da28889596

Authored by Edmar Moretti
1 parent f05eeb06

--no commit message

classesphp/classe_alteraclasse.php
... ... @@ -452,12 +452,40 @@ A nova classe será uma cópia da classe 0.
452 452 if(!$this->layer){return "erro";}
453 453 $classe = $this->layer->getclass(0);
454 454 $c = ms_newClassObj($this->layer, $classe);
455   - //$classe = $this->layer->getclass(0);
456   - //$nova = $classe->clone;
457 455 $this->layer->setMetaData("cache","");
458 456 return("ok");
459 457 }
460 458 /*
  459 +function: sobeclasse
  460 +
  461 +Sobe uma classe na ordem de desenho
  462 +
  463 +Parametro:
  464 +
  465 +$idclasse {numerico} - id da classe (índice)
  466 +*/
  467 + function sobeclasse($idclasse)
  468 + {
  469 + if(!$this->layer){return "erro";}
  470 + $this->layer->moveclassup($idclasse);
  471 + return("ok");
  472 + }
  473 +/*
  474 +function: desceclasse
  475 +
  476 +Desce uma classe na ordem de desenho
  477 +
  478 +Parametro:
  479 +
  480 +$idclasse {numerico} - id da classe (índice)
  481 +*/
  482 + function desceclasse($idclasse)
  483 + {
  484 + if(!$this->layer){return "erro";}
  485 + $this->layer->moveclassdown($idclasse);
  486 + return("ok");
  487 + }
  488 +/*
461 489 function: adicionaopacidade
462 490  
463 491 Adiciona opacidade variável de 0 a 100 conforme o número de classes
... ... @@ -488,6 +516,11 @@ function: alteracor
488 516  
489 517 Aplica uma nova cor aos estilos de uma classe
490 518  
  519 +Parametros:
  520 +
  521 +$idclasse {numerico} - id da classe (índice)
  522 +
  523 +$cor {string} - cor rgb
491 524 */
492 525 function alteracor($idclasse,$cor)
493 526 {
... ... @@ -512,6 +545,9 @@ function: alterageometria
512 545  
513 546 Altera a geometria de representação de todos os estilos de todas as classes de um layer
514 547  
  548 +Parametro:
  549 +
  550 +$tipo {string} - tipo de representação
515 551 */
516 552 function alterageometria($tipo)
517 553 {
... ... @@ -538,6 +574,7 @@ function: alteraCoresClasses
538 574 Altera as cores das classes existentes em um objeto layer gerando uma paleta de cores de acordo com um valor inicial e final.
539 575  
540 576 Parametros:
  577 +
541 578 $cori - cor inicial.
542 579  
543 580 $corf - cor final.
... ...
classesphp/mapa_controle.php
... ... @@ -1468,7 +1468,11 @@ Altera uma classe de um tema, aplicando uma nova classificação ou modificando pa
1468 1468 $cores = str_replace(")","",$cores);
1469 1469 $cores = str_replace("(","",$cores);
1470 1470 $retorno = $m->aplicacoresrgb(explode(";",$cores));
1471   - }
  1471 + }
  1472 + if ($opcao == "sobeclasse")
  1473 + {$retorno = $m->sobeclasse($idclasse);}
  1474 + if ($opcao == "desceclasse")
  1475 + {$retorno = $m->desceclasse($idclasse);}
1472 1476 if ($opcao == "alteracor")
1473 1477 {$retorno = $m->alteracor($idclasse,$cor);}
1474 1478 if ($opcao == "adicionaopacidade")
... ...
ferramentas/legenda/index.js.php
... ... @@ -142,18 +142,17 @@ i3GEOF.legenda = {
142 142 );
143 143 if(navm)
144 144 {$i("i3GEOlegendabotao2-button").style.width = "0px";}
  145 +
145 146 new YAHOO.widget.Button(
146 147 "i3GEOlegendabotao3",
147 148 {onclick:{fn: i3GEOF.legenda.adicionaConta}}
148 149 );
149   - if(navm)
150   - {$i("i3GEOlegendabotao3-button").style.width = "0px";}
  150 +
151 151 new YAHOO.widget.Button(
152 152 "i3GEOlegendabotao15",
153 153 {onclick:{fn: i3GEOF.legenda.adicionaOpacidade}}
154 154 );
155   - if(navm)
156   - {$i("i3GEOlegendabotao15-button").style.width = "0px";}
  155 +
157 156 new YAHOO.widget.Button(
158 157 "i3GEOlegendabotao4",
159 158 {onclick:{fn: i3GEOF.legenda.paleta}}
... ... @@ -246,33 +245,34 @@ i3GEOF.legenda = {
246 245 ' </ul>'+
247 246 '</div><br>'+
248 247 '<div id=i3GEOlegendaguia6obj style="width:99%;text-align:left;">'+
249   - ' <p class=paragrafo ><input type=checkbox onclick="" checked id=i3GEOFlegendamostra style="cursor:pointer;border:0px solid white;" /> <span style="cursor:pointer;position:relative;top:-2px;">Mostra as classes desse tema na legenda do mapa</span>' +
250   - ' <table summary="" class=lista5 ><tr>' +
251   - ' <td><input id=i3GEOlegendabotao3 size="25" type="button" value="+ contagem" title="incluir o número de ocorrências no nome de cada classe"></td>' +
252   - ' <td><input id=i3GEOlegendabotao15 size="25" type="button" value="Opacidade variável" title="aplicar opacidade nas classes existente, variando de 10 até 100"></td>' +
253   - ' </tr></table>' +
  248 + ' <p class=paragrafo >&nbsp;<input type=checkbox onclick="" checked id=i3GEOFlegendamostra style="cursor:pointer;border:0px solid white;" /> <span style="cursor:pointer;position:relative;top:-2px;">Mostra as classes desse tema na legenda do mapa</span></p>' +
  249 + ' <p class=paragrafo ><input id=i3GEOlegendabotao3 type="button" value="Inclui número de ocorrências" title="incluir o número de ocorrências no nome de cada classe"></p>' +
  250 + ' <p class=paragrafo ><input id=i3GEOlegendabotao15 type="button" value="Aplica opacidade variável" title="aplicar opacidade nas classes existente, variando de 10 até 100"></p>' +
  251 + ' <p class=paragrafo ><input id=i3GEOlegendabotaoRamp type="button" size=15 value="Escolher paleta de cores" title="escolher e aplicar as variações de cores, entre dois extremos, nas classes existentes"></p>' +
  252 +
254 253 ' <table summary="" class=lista5 >' +
255 254 ' <tr>' +
256   - ' <td><input id=i3GEOlegendabotao4 type="button" size=15 value="Gerar cores" title="aplicar variações de cores, entre dois extremos, nas classes existentes"></td>' +
257   - ' <td>de:</td>' +
  255 + ' <td>Gerar cores de:</td>' +
258 256 ' <td>' +
259 257 $inputText("","","i3GEOlegendaacori","",12,"0,0,0") +
260   - ' </td><td><img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacori\')" /> ' +
261 258 ' </td>' +
262   - ' <td>at&eacute;:</td><td>'+
  259 + ' <td><img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacori\')" /> ' +
  260 + ' </td>' +
  261 + ' <td>at&eacute;:</td>' +
  262 + ' <td>'+
263 263 $inputText("","","i3GEOlegendaacorf","",12,"255,255,255") +
264   - ' </td><td><img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacorf\')" /> ' +
265   - ' </td><td>ou</td>' +
266   - ' <td><input id=i3GEOlegendabotaoRamp type="button" size=15 value="escolher" title="escolher e aplicar as variações de cores, entre dois extremos, nas classes existentes"></td>' +
  264 + ' </td>' +
  265 + ' <td><img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEOF.legenda.corj(\'i3GEOlegendaacorf\')" /> ' +
  266 + ' </td>' +
  267 + ' <td><input id=i3GEOlegendabotao4 type="button" size=15 value="Aplicar" title="aplicar variações de cores, entre dois extremos, nas classes existentes"></td>' +
267 268 ' </tr>' +
268 269 ' </table>' +
269 270 '</div>' +
270 271 '<div id=i3GEOlegendaguia1obj style="width:99%;text-align:left;">'+
271 272 ' <table summary="" class=lista5 ><tr>' +
272 273 ' <td><input id=i3GEOlegendabotao1 size="22" type="button" value="Aplicar alterações" ></td>'+
273   - ' <td><input id=i3GEOlegendabotao2 size="22" type="button" value="+ classe" title="adicionar uma nova classe na legenda" ></td>' +
274   - ' </tr></table>' +
275   -
  274 + ' <td><input id=i3GEOlegendabotao2 size="22" type="button" value="Adicionar classe" title="adicionar uma nova classe na legenda" ></td>' +
  275 + ' </tr></table><br>' +
276 276 ' <div id="i3GEOlegendaresultado" style="text-align:left;width:100%;display:block;left:0px">' +
277 277 ' </div>'+
278 278 '</div>'+
... ... @@ -424,10 +424,12 @@ i3GEOF.legenda = {
424 424 ajuda,
425 425 id,
426 426 re,
427   - exp;
  427 + exp,
  428 + n;
428 429 if (retorno.data[0].proc === ""){
429 430 ins.push("<table class=lista4 id=i3GEOlegendalegenda ><tr><td><img src='"+i3GEO.configura.locaplic+"/imagens/inverter.png' title='Inverter cores' onclick='i3GEOF.legenda.inverteCores()' style=cursor:pointer /></td><td style=background-color:white ><img src='"+i3GEO.configura.locaplic+"/imagens/tamanho.png' title='Calcula tamanho' onclick='i3GEOF.legenda.calculaTamanho()' style=cursor:pointer /></td><td style=background-color:yellow ></td><td style=background-color:yellow >nome</td><td style=background-color:yellow >express&atilde;o</td></tr>");
430   - for (i=0;i<retorno.data.length;i++){
  431 + n = retorno.data.length;
  432 + for (i=0;i<n;i++){
431 433 id = retorno.data[i].tema+"-"+retorno.data[i].idclasse; //layer+indice da classe
432 434 re = new RegExp("'", "g");
433 435 exp = (retorno.data[i].expressao).replace(re,'"');
... ... @@ -437,7 +439,12 @@ i3GEOF.legenda = {
437 439 ins.push($inputText("","","i3GEOlegendaid_"+id,"digite o novo nome",30,retorno.data[i].nomeclasse,"nome","javascript:i3GEOF.legenda.aviso()"));
438 440 ins.push("</td><td>");
439 441 ins.push($inputText("","","i3GEOlegendaid_"+id,"digite a nova express&atilde;o",30,exp,"expressao","javascript:i3GEOF.legenda.aviso()"));
440   - ins.push("</td></tr>");
  442 + ins.push("</td>");
  443 + if(n>1){
  444 + ins.push("<td><img src='"+i3GEO.configura.locaplic+"/imagens/sobe1.png' style=cursor:pointer title='sobe' onclick=i3GEOF.legenda.sobelinhaf('"+retorno.data[i].idclasse+"') /></td>");
  445 + ins.push("<td><img src='"+i3GEO.configura.locaplic+"/imagens/desce1.png' style=cursor:pointer title='desce' onclick=i3GEOF.legenda.descelinhaf('"+retorno.data[i].idclasse+"') /></td>");
  446 + }
  447 + ins.push("</tr>");
441 448 }
442 449 ins.push("</table><br>");
443 450 $i("i3GEOlegendaresultado").innerHTML = ins.join("");
... ... @@ -810,9 +817,45 @@ i3GEOF.legenda = {
810 817 p.removeChild(p.childNodes[0]);
811 818 } while (p.childNodes.length > 0);
812 819 p.parentNode.removeChild(p);
813   - //i3GEOF.legenda.mudaLegenda();
  820 + i3GEOF.legenda.mudaLegenda();
814 821 },
815 822 /*
  823 + Function: sobelinhaf
  824 +
  825 + Sobe uma linha na tabela de edição de classes da legendda
  826 + */
  827 + sobelinhaf: function(idclasse){
  828 + if(i3GEOF.legenda.aguarde.visibility === "visible")
  829 + {return;}
  830 + i3GEOF.legenda.aguarde.visibility = "visible";
  831 + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=ALTERACLASSE&opcao=sobeclasse&tema="+i3GEOF.legenda.tema+"&idclasse="+idclasse,
  832 + cp = new cpaint(),
  833 + temp = function(){
  834 + i3GEOF.legenda.aguarde.visibility = "hidden";
  835 + i3GEOF.legenda.mudaLegenda();
  836 + };
  837 + cp.set_response_type("JSON");
  838 + cp.call(p,"foo",temp);
  839 + },
  840 + /*
  841 + Function: descelinhaf
  842 +
  843 + Desce uma linha na tabela de edição de classes da legendda
  844 + */
  845 + descelinhaf: function(idclasse){
  846 + if(i3GEOF.legenda.aguarde.visibility === "visible")
  847 + {return;}
  848 + i3GEOF.legenda.aguarde.visibility = "visible";
  849 + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=ALTERACLASSE&opcao=desceclasse&tema="+i3GEOF.legenda.tema+"&idclasse="+idclasse,
  850 + cp = new cpaint(),
  851 + temp = function(){
  852 + i3GEOF.legenda.aguarde.visibility = "hidden";
  853 + i3GEOF.legenda.mudaLegenda();
  854 + };;
  855 + cp.set_response_type("JSON");
  856 + cp.call(p,"foo",temp);
  857 + },
  858 + /*
816 859 Function: editaSimbolo
817 860  
818 861 Abre o editor de símbolos
... ...