Commit e5f68ac7d6e68bc56aab71201608bec84d26654c

Authored by Edmar Moretti
1 parent 640467f3

--no commit message

classesjs/classe_barradebotoes.js
... ... @@ -72,6 +72,20 @@ i3GEO.barraDeBotoes = {
72 72 */
73 73 OFFSET: -205,
74 74 /*
  75 + Propriedade: MAXBOTOES
  76 +
  77 + Número de botões iniciais (válido apenas para o tipo "olhodepeixe")
  78 +
  79 + Se for 0, todos os botões serão mostrados
  80 +
  81 + Tipo:
  82 + {numeric}
  83 +
  84 + Default:
  85 + {10}
  86 + */
  87 + MAXBOTOES: 10,
  88 + /*
75 89 Propriedade: AJUDA
76 90  
77 91 Mostra um texto de ajuda colado ao ícone da ferramenta
... ... @@ -86,7 +100,7 @@ i3GEO.barraDeBotoes = {
86 100 /*
87 101 Propriedade: ORIENTACAO
88 102  
89   - Orientação vertical ou horizontal da barra
  103 + Orientação vertical ou horizontal da barra (não se aplica ao tipo "olhodepeixe"
90 104  
91 105 Tipo:
92 106 {string}
... ... @@ -297,7 +311,7 @@ i3GEO.barraDeBotoes = {
297 311 }
298 312  
299 313 Tipo:
300   - {JSON}
  314 + {obj}
301 315 */
302 316 INCLUIBOTAO: {
303 317 zoomli: true,
... ... @@ -308,13 +322,13 @@ i3GEO.barraDeBotoes = {
308 322 mede: true,
309 323 area: true,
310 324 imprimir: true,
311   - reinicia: true,
312   - exten: true,
  325 + selecao: true,
  326 + google: true,
313 327 referencia: true,
  328 + exten: true,
314 329 inserexy: true,
315 330 textofid: true,
316   - selecao: true,
317   - google: true,
  331 + reinicia: true,
318 332 buscafotos: true,
319 333 wiki: true,
320 334 metar: true,
... ... @@ -323,6 +337,67 @@ i3GEO.barraDeBotoes = {
323 337 inseregrafico: true,
324 338 v3d: true
325 339 },
  340 + /*
  341 + Propriedade: ICONEBOTAO
  342 +
  343 + Ícones utilizados em cada um dos botões da barra.
  344 +
  345 + Esses ícones são utilizados apenas se i3GEO.barraDeBotoes.TIPO = "olhodepeixe". Para cada elemento existente em
  346 + i3GEO.barraDeBotoes.INCLUIBOTAO deve existir um elemento nesse objeto. A chave de cada elemento é a mesma do objeto INCLUIBOTAO.
  347 + O endereço da imagem será complementado pelo i3geo, adicionando no início da string o valor da variável i3GEO.configura.locaplic
  348 +
  349 + Default:
  350 +
  351 + ICONEBOTAO: {
  352 +
  353 + zoomli: "/imagens/gisicons/eudock/zoom-region.png",
  354 +
  355 + pan: "/imagens/gisicons/eudock/pan.png",
  356 +
  357 + zoomtot: "/imagens/gisicons/eudock/zoom-extent.png",
  358 +
  359 + identifica: "/imagens/gisicons/eudock/identify.png",
  360 +
  361 + identificaBalao: "/imagens/gisicons/eudock/tips.png",
  362 +
  363 + mede: "/imagens/gisicons/eudock/length-measure.png",
  364 +
  365 + area: "/imagens/gisicons/eudock/area-measure.png",
  366 +
  367 + imprimir: "/imagens/gisicons/eudock/print.png",
  368 +
  369 + reinicia: "/imagens/gisicons/eudock/redraw.png",
  370 +
  371 + exten: "/imagens/gisicons/eudock/map-extent-info.png",
  372 +
  373 + referencia: "/imagens/gisicons/eudock/map-reference.png",
  374 +
  375 + inserexy: "/imagens/gisicons/eudock/point-create.png",
  376 +
  377 + textofid: "/imagens/gisicons/eudock/text-add.png",
  378 +
  379 + selecao: "/imagens/gisicons/eudock/select.png",
  380 +
  381 + google: "/imagens/gisicons/eudock/google-map.png",
  382 +
  383 + buscafotos: "/imagens/gisicons/eudock/fotos.png",
  384 +
  385 + wiki: "/imagens/gisicons/eudock/wiki.png",
  386 +
  387 + metar: "/imagens/gisicons/eudock/metar.png",
  388 +
  389 + lentei: "/imagens/gisicons/eudock/lente.png",
  390 +
  391 + confluence: "/imagens/gisicons/eudock/confluence.png",
  392 +
  393 + inseregrafico: "/imagens/gisicons/eudock/grafico.png",
  394 +
  395 + v3d: "/imagens/gisicons/eudock/v3d.png"
  396 + }
  397 +
  398 + Type:
  399 + {obj}
  400 + */
326 401 ICONEBOTAO: {
327 402 zoomli: "/imagens/gisicons/eudock/zoom-region.png",
328 403 pan: "/imagens/gisicons/eudock/pan.png",
... ... @@ -585,39 +660,79 @@ i3GEO.barraDeBotoes = {
585 660 if(padrao === "")
586 661 {this.ativaIcone("");}
587 662 },
588   - execBotao: function(id,x,y){
589   - var l,b,d,temp,n = 38;
  663 + /*
  664 + Function: execBotao
  665 +
  666 + Com base no código de um botão (iddiv), obtém a função armazenada em i3GEO.barraDeBotoes.LISTABOTOES e executa.
  667 +
  668 + Parametros:
  669 +
  670 + id {string} - identificador do botão, conforme definido no elemento iddiv de i3GEO.barraDeBotoes.LISTABOTOES
  671 +
  672 + x {numeric} - (opcional) posição em pixels da tela onde foi feito o clique do mouse
  673 +
  674 + y {numeric} - (opcional) posição em pixels da tela onde foi feito o clique do mouse
  675 + */
  676 + execBotao: function(id,x,y,posX,posY){
  677 + var temp,
  678 + n = 38,
  679 + botao = i3GEO.barraDeBotoes.defBotao(id);
590 680 i3GEO.barraDeBotoes.BOTAOCLICADO = id;
  681 + if(botao === false)
  682 + {return;}
  683 + try{
  684 + if(botao.tipo === "dinamico" && x){
  685 + i3GEO.util.criaPin("i3geoMarcaIcone",i3GEO.configura.locaplic+"/imagens/gisicons/eudock/sobe1.png","10px","10px");
  686 + temp = $i("i3geoMarcaIcone");
  687 + temp.style.display = "block"
  688 + temp.style.top = posY + 43;//(parseInt(y / n,10) * n) + 40;
  689 + temp.style.left = posX + 18;//(parseInt(x / n,10) * n) + 6;
  690 + }
  691 + if(botao.funcaoonclick){
  692 + botao.funcaoonclick.call();
  693 + }
  694 + }
  695 + catch(e){
  696 + if(typeof(console) !== 'undefined'){console.error("Erro no botao "+id+" "+e);}
  697 + }
  698 + },
  699 + /*
  700 + Function: defBotao
  701 +
  702 + Obtém as definições de um botão conforme o seu código (iddiv)
  703 +
  704 + Retorno:
  705 +
  706 + {objeto} - ver i3GEO.barraDeBotoes.LISTABOTOES
  707 + */
  708 + defBotao: function(iddiv){
  709 + var l,b,d,temp;
591 710 l = i3GEO.barraDeBotoes.LISTABOTOES;
592 711 b = l.length-1;
593 712 if (b >= 0){
594 713 do{
595 714 temp = l[b].iddiv;
596   - if (temp === id){
597   - try{
598   - if(l[b].tipo === "dinamico"){
599   - i3GEO.util.criaPin("i3geoMarcaIcone",i3GEO.configura.locaplic+"/imagens/gisicons/eudock/sobe1.png","10px","10px");
600   - temp = $i("i3geoMarcaIcone");
601   - temp.style.display = "block"
602   - temp.style.top = (parseInt(y / n,10) * n) + 40;
603   - temp.style.left = (parseInt(x / n,10) * n) + 25;
604   - }
605   - if(l[b].funcaoonclick){
606   - l[b].funcaoonclick.call();
607   - return;
608   - }
609   - }
610   - catch(e){
611   - if(typeof(console) !== 'undefined'){console.error("Erro no botao "+id+" "+e);}
612   - }
  715 + if (l[b].iddiv === iddiv){
  716 + return l[b];
613 717 }
614 718 }
615 719 while (b--);
616 720 }
617   - },
  721 + return false;
  722 + },
  723 + /*
  724 + Function: inicializaBarraOP
  725 +
  726 + Inicializa a barra de botões quando for do tipo "olhodepeixe"
  727 +
  728 + O objeto euEnv armazena todas as características da barra
  729 +
  730 + */
618 731 inicializaBarraOP: function(){
  732 + i3GEO.barraDeBotoes.AJUDA = false;
619 733 euEnv.imageBasePath=i3GEO.configura.locaplic+"/pacotes/eudock/";
620   - var i,
  734 + var botao,
  735 + i,
621 736 dock = new euDock(),
622 737 temp = "",
623 738 chaves = i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO),
... ... @@ -628,17 +743,61 @@ i3GEO.barraDeBotoes = {
628 743 horizontal:{euImage:{image:i3GEO.configura.locaplic+"/pacotes/eudock/barImages/dockBg-c-o.gif"}},
629 744 right:{euImage:{image:i3GEO.configura.locaplic+"/pacotes/eudock/barImages/dockBg-r.png"}}
630 745 });
631   - dock.setIconsOffset(5);
  746 + dock.setIconsOffset(7);
  747 + if(i3GEO.barraDeBotoes.MAXBOTOES > 0)
  748 + {n = i3GEO.barraDeBotoes.MAXBOTOES;}
632 749 for(i=0;i<n;i+=1){
633   - if(i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] === true){
634   - dock.addIcon(new Array({euImage:{image:i3GEO.configura.locaplic+i3GEO.barraDeBotoes.ICONEBOTAO[chaves[i]]}}),
635   - {mouseInsideClick : function(x,y,id){
636   - //alert(euEnv.euDockArray[id].idBotao)
637   - i3GEO.barraDeBotoes.execBotao(euEnv.euDockArray[id].idBotao,x,y);
638   - },idBotao:chaves[i]});
  750 + if(i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] && i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] === true){
  751 + botao = i3GEO.barraDeBotoes.defBotao(chaves[i]);
  752 + if(botao === false)
  753 + {temp = "";}
  754 + else{
  755 + if(botao.dica)
  756 + {temp = botao.dica;}
  757 + else
  758 + {temp = "";}
  759 + }
  760 + dock.addIcon(new Array({euImage:{image:i3GEO.configura.locaplic+i3GEO.barraDeBotoes.ICONEBOTAO[chaves[i]]}}),{
  761 + mouseInsideClick : function(x,y,id,posX,posY){
  762 + i3GEO.barraDeBotoes.execBotao(euEnv.euDockArray[id].idBotao,x,y,posX,posY );
  763 + },
  764 + idBotao:chaves[i],
  765 + dica: temp
  766 + });
639 767 }
640 768 }
641   -
  769 + $i(euEnv.euDockArray.euDock_0.bar.elementsArray.left.id).onclick = function(){
  770 + i3GEO.ajuda.abreJanela();
  771 + };
  772 + $i(euEnv.euDockArray.euDock_0.bar.elementsArray.right.id).onclick = function(){
  773 + var temp = "",
  774 + chaves = i3GEO.util.listaChaves(i3GEO.barraDeBotoes.INCLUIBOTAO),
  775 + n = chaves.length,
  776 + nb = euEnv.euDockArray.euDock_0.iconsArray.length,
  777 + i;
  778 + if(i3GEO.barraDeBotoes.MAXBOTOES > 0 && n > nb){
  779 + for(i=nb;i<n;i+=1){
  780 + if(i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] && i3GEO.barraDeBotoes.INCLUIBOTAO[chaves[i]] === true){
  781 + botao = i3GEO.barraDeBotoes.defBotao(chaves[i]);
  782 + if(botao === false)
  783 + {temp = "";}
  784 + else{
  785 + if(botao.dica)
  786 + {temp = botao.dica;}
  787 + else
  788 + {temp = "";}
  789 + }
  790 + dock.addIcon(new Array({euImage:{image:i3GEO.configura.locaplic+i3GEO.barraDeBotoes.ICONEBOTAO[chaves[i]]}}),{
  791 + mouseInsideClick : function(x,y,id,posX){
  792 + i3GEO.barraDeBotoes.execBotao(euEnv.euDockArray[id].idBotao,x,y,posX);
  793 + },
  794 + idBotao:chaves[i],
  795 + dica: temp
  796 + });
  797 + }
  798 + }
  799 + }
  800 + };
642 801 },
643 802 /*
644 803 Function: inicializaBarra
... ... @@ -1016,6 +1175,18 @@ i3GEO.barraDeBotoes = {
1016 1175 */
1017 1176 recria: function(id){
1018 1177 if(typeof(console) !== 'undefined'){console.info("i3GEO.barraDeBotoes.recria()");}
  1178 + if(i3GEO.barraDeBotoes.TIPO === "olhodepeixe"){
  1179 + euEnv.euDockArray = [];
  1180 + //euEnv.Kost = [];
  1181 + euEnv.Kost.num = 0;
  1182 + if($i("euDock_0_bar")){
  1183 + document.body.removeChild($i("euDock_0_bar").parentNode);
  1184 + }
  1185 + i3GEO.barraDeBotoes.inicializaBarra();
  1186 + $i("i3geoMarcaIcone").style.display = "none";
  1187 + return;
  1188 + }
  1189 +
1019 1190 var n,temp,novoel,barraZoom,x,y,
1020 1191 BARRAS = i3GEO.barraDeBotoes.BARRAS,
1021 1192 iu = i3GEO.util;
... ... @@ -1070,8 +1241,11 @@ i3GEO.barraDeBotoes = {
1070 1241 }
1071 1242 },
1072 1243 mostraJanela: function(objeto,mensagem,evt){
1073   - if(mensagem === "")
1074   - {try{clearTimeout(timeMostraAjudaBotoes);}catch(e){};return;}
  1244 + if(mensagem === ""){
  1245 + try{clearTimeout(timeMostraAjudaBotoes);}catch(e){}
  1246 + try{clearTimeout(timeAjudaBotoes);}catch(e){}
  1247 + return;
  1248 + }
1075 1249 var divmensagem = $i("divMensagemBarraDeBotoes"),balloonAjuda,
1076 1250 pos = YAHOO.util.Dom.getXY(objeto);
1077 1251 if(this.AJUDA === false || $i("janelaMenTexto")){
... ... @@ -1123,12 +1297,14 @@ i3GEO.barraDeBotoes = {
1123 1297 balloonAjuda.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GBubblec';
1124 1298 mensagem = "<table style='z-index:20000' ><tr><td style='text-align:left;'><span style='text-align:right;cursor:pointer;color:blue;' onclick='javascript:i3GEO.util.insereCookie(\"botoesAjuda\",\"nao\");i3GEO.barraDeBotoes.AJUDA = false;'>fecha</span><br><div style='vertical-align:middle;text-align:left;width:250px;border: 0px solid black;border-left:1px;' id='divMensagemBarraDeBotoesCorpo'>"+mensagem+"</div></td></tr></table>";
1125 1299 try{clearTimeout(timeAjudaBotoes);}catch(e){}
1126   -
1127 1300 timeMostraAjudaBotoes = setTimeout(function(){
1128 1301 balloonAjuda.cleanup();
1129 1302 balloonIsVisible = false;
1130 1303 //alert(mensagem);
1131   - balloonAjuda.showTooltip(objeto,mensagem,null,null,null,pos[0]+12,pos[1]);
  1304 + if(i3GEO.barraDeBotoes.TIPO === "olhodepeixe")
  1305 + {balloonAjuda.showTooltip(objeto,mensagem,null,null,null,pos[0],pos[1]-40);}
  1306 + else
  1307 + {balloonAjuda.showTooltip(objeto,mensagem,null,null,null,pos[0]+12,pos[1]);}
1132 1308 try{clearTimeout(timeMostraAjudaBotoes);}catch(e){}
1133 1309 timeAjudaBotoes = setTimeout(function(){balloonAjuda.cleanup();},4000);
1134 1310 },4000);
... ...
interface/openlayers.htm
... ... @@ -228,6 +228,7 @@ i3GEO.configura.mapaRefDisplay = &quot;none&quot;;
228 228  
229 229 i3GEO.barraDeBotoes.TIPO = "olhodepeixe";
230 230 i3GEO.barraDeBotoes.OFFSET = -220;
  231 +i3GEO.barraDeBotoes.MAXBOTOES = 10;
231 232 //barra de botoes normal. descomente para usar
232 233 /*
233 234 i3GEO.barraDeBotoes.TIPO = "yui";
... ...
pacotes/eudock/barImages/dockBg-c-o.gif

189 Bytes | W: | H:

148 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
pacotes/eudock/barImages/dockBg-l.png

1.75 KB | W: | H:

1.53 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
pacotes/eudock/barImages/dockBg-r.png

1.78 KB | W: | H:

1.53 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
pacotes/eudock/js/euDock.2.0.js
... ... @@ -497,6 +497,7 @@ var euOPAQUE = 16;
497 497 var venusWidth;
498 498 var venusHeight;
499 499 var overIcon;
  500 + var temp;
500 501 if (this.position==euUP || this.position==euDOWN || this.position==euHORIZONTAL){
501 502 venusWidth = this.getVenusWidth();
502 503 for (var i in this.iconsArray) if (this.iconsArray[i].id)
... ... @@ -507,6 +508,12 @@ var euOPAQUE = 16;
507 508 mouseRelX = this.iconsArray[i].posX+border;
508 509 border=0;
509 510 }
  511 + try{
  512 + temp = $i(this.iconsArray[i].elementsArray[0].id);
  513 + if(temp)
  514 + {i3GEO.barraDeBotoes.mostraJanela(temp,this.iconsArray[i].dica);}
  515 + }
  516 + catch(e){}
510 517 }
511 518 for (var i in this.iconsArray) if (this.iconsArray[i].id){
512 519 mediana = this.iconsArray[i].posX+this.iconsArray[i].getWidth()/2;
... ... @@ -580,22 +587,26 @@ var euOPAQUE = 16;
580 587 };
581 588  
582 589 this.kernelMouseOut = function(){
  590 + //i3GEO.barraDeBotoes.mostraJanela("","");
583 591 var ret=false;
584   - for (var i in this.iconsArray) if (this.iconsArray[i].id)
  592 + for (var i in this.iconsArray){
  593 + if (this.iconsArray[i].id)
585 594 ret|=this.iconsArray[i].setAllFrameTo(0);
586   - if (ret)
587   - this.updateDims();
  595 + if (ret){
  596 + this.updateDims();
  597 + }
  598 + }
588 599 return ret;
589 600 };
590 601  
591 602 this.mouseOut = function(){
592 603 this.isInside=false;
593   - euEnv.exeThreadWhiteLoop=5;
  604 + euEnv.exeThreadWhiteLoop=5;
594 605 };
595 606  
596 607 this.mouseOver = function(){
597 608 this.isInside=true;
598   - euEnv.exeThreadWhiteLoop=5;
  609 + euEnv.exeThreadWhiteLoop=5;
599 610 };
600 611  
601 612 this.mouseMove = function(x,y){
... ... @@ -912,7 +923,7 @@ var euOPAQUE = 16;
912 923 }else
913 924 document.location.href=this.link;
914 925 else if (this.mouseInsideClick)
915   - this.mouseInsideClick(x,y,this.id);
  926 + this.mouseInsideClick(x,y,this.id,this.getAbsolutePosX(),this.getAbsolutePosY());
916 927 }
917 928 };
918 929  
... ...