From 2c25a45ee0b7b81ca4a74a86dbeb966092c8129c Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 14 Apr 2010 00:34:36 +0000 Subject: [PATCH] --- ferramentas/outputformat/index.js.php | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+), 0 deletions(-) create mode 100644 ferramentas/outputformat/index.js.php diff --git a/ferramentas/outputformat/index.js.php b/ferramentas/outputformat/index.js.php new file mode 100644 index 0000000..c0d263c --- /dev/null +++ b/ferramentas/outputformat/index.js.php @@ -0,0 +1,143 @@ + +/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ +/* +About: Licença + +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br + +Este programa é software livre; você pode redistribuí-lo +e/ou modificá-lo sob os termos da Licença Pública Geral +GNU conforme publicada pela Free Software Foundation; +tanto a versão 2 da Licença. +Este programa é distribuído na expectativa de que seja útil, +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. +Consulte a Licença Pública Geral do GNU para mais detalhes. +Você deve ter recebido uma cópia da Licença Pública Geral do +GNU junto com este programa; se não, escreva para a +Free Software Foundation, Inc., no endereço +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. +*/ +if(typeof(i3GEOF) === 'undefined'){ + i3GEOF = []; +} +/* +Class: i3GEOF.outputformat + +Abre janela de opções para escolha do formato de imagem utilizada na geração do mapa +*/ +i3GEOF.outputformat = { + /* + Variavel: aguarde + + Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. + */ + aguarde: "", + /* + Function: inicia + + Inicia a ferramenta. É chamado por criaJanelaFlutuante + + Parametro: + + iddiv {String} - id do div que receberá o conteudo HTML da ferramenta + */ + inicia: function(iddiv){ + try{ + $i(iddiv).innerHTML += i3GEOF.outputformat.html(); + } + catch(erro){alert(erro);} + + }, + /* + Function: html + + Gera o código html para apresentação das opções da ferramenta + + Retorno: + + String com o código html + */ + html:function(){ + var ins = '

Escolha o tipo de imagem para a geração do mapa. Para mais detalhes veja outputformat

' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + + '
AGG_QFormato PNG com 256 cores gerado com a tecnologia AGG. Utilizado como default na versão 4.3 e posteriores do i3Geo
png1Formato PNG com 256 cores gerado com o driver GD
jpegFormato JPEG com 256 cores gerado com o driver GD
'; + return ins; + }, + /* + Function: criaJanelaFlutuante + + Cria a janela flutuante para controle da ferramenta. + */ + criaJanelaFlutuante: function(){ + var janela,divid,temp,titulo,cabecalho,minimiza; + cabecalho = function(){}; + minimiza = function(){ + i3GEO.janela.minimiza("i3GEOF.outputformat"); + }; + //cria a janela flutuante + titulo = "Formato da imagem    "; + janela = i3GEO.janela.cria( + "300px", + "260px", + "", + "", + "", + titulo, + "i3GEOF.outputformat", + false, + "hd", + cabecalho, + minimiza + ); + divid = janela[2].id; + $i("i3GEOF.outputformat_corpo").style.backgroundColor = "white"; + $i("i3GEOF.outputformat_corpo").style.textAlign = "left"; + i3GEOF.outputformat.aguarde = $i("i3GEOF.outputformat_imagemCabecalho").style; + i3GEOF.outputformat.inicia(divid); + }, + /* + Function: aplicar + + Aplica o filtro de imagem escolhido + */ + aplicar: function(tipo){ + if(i3GEOF.outputformat.aguarde.visibility === "visible") + {return;} + i3GEOF.outputformat.aguarde.visibility = "visible"; + try{ + var cp = new cpaint(), + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=mudaOutputFormat&tipo="+tipo, + temp = function(retorno){ + i3GEOF.outputformat.aguarde.visibility = "hidden"; + if(retorno.data != "erro") + {i3GEO.atualiza();} + else + {alert("Nao foi possivel alterar o tipo");} + }; + cp.set_response_type("JSON"); + cp.call(p,"void",temp); + } + catch(e){alert("Nao foi possivel alterar o tipo");i3GEOF.outputformat.aguarde.visibility = "hidden";} + } +}; + \ No newline at end of file -- libgit2 0.21.2