Package Tipos

Examples of Tipos.Elemento


                    Element imagen =e.getChild("imagen");
                    // System.out.println("imagen elemento: "+ imagen.getText());
                   
                    Element sonido =e.getChild("sonido");
                   //  System.out.println("sonido elemento: "+ sonido.getText());
                    mise.Add(new Elemento(nombre.getText(),imagen.getText(),sonido.getText()));

                }
                // almaceno los elementos
                CopiaTablero.elementos=mise;
                // Muestro todos los elementos
//                for (int i=0; i< CopiaTablero.elementos.size(); i++){
//                    System.out.println("Elemento "+ i +  " nombre: " + CopiaTablero.elementos.get(i).nombre +" im: "
//                            + CopiaTablero.elementos.get(i).nombreImagen + " sonido: " + CopiaTablero.elementos.get(i).nombreSonido);
//                }
            }
            // botones
               
            Element botones= raiz.getChild("botones");
            // altura
            Element altura= botones.getChild("altura");
            CopiaTablero.altoBoton= Integer.parseInt(altura.getText().trim());
            System.out.println("Altura boton: " + CopiaTablero.altoBoton);
           
            // anchura
            Element anchura= botones.getChild("anchura");
            CopiaTablero.anchoBoton= Integer.parseInt(anchura.getText().trim());
            System.out.println("Ancho boton: " + CopiaTablero.anchoBoton);
           
            // color de los botones tengo q mirar a ver si es este
            Element colorFondo= botones.getChild("colorFondo");
            CopiaTablero.colorBot= new Color(Integer.parseInt(colorFondo.getText().trim()));
            System.out.println("Color botones: " + CopiaTablero.colorBotones);
           
            // simetria
            int simetriaI;
            Element simetria= botones.getChild("simetria");
            simetriaI= Integer.parseInt(simetria.getValue().trim());
            if (simetriaI==0){
                CopiaTablero.simetria=false;
               
            }
            else{
                CopiaTablero.simetria=true;
            }
            System.out.println("VALOR SIMETRIA: " + CopiaTablero.simetria);
            // cojo todos los botones
           
           
            List listaBotones=botones.getChildren("boton");
            // cogere todos los botones
           
            System.out.println("Formada por:"+ listaBotones.size() + " botones");
            if (listaBotones.size()>0){
               
                MiColeccion mc = new MiColeccion();
                mc.clear();
               
                Iterator bot = listaBotones.iterator();
                int j=0;
                while (bot.hasNext()){
                    Element b= (Element)bot.next();
                    Element nombre =b.getChild("nombre");
//                    System.out.println("nombre elemento: "+ nombre.getText());
                   
                    // obtengo el elemento de ese boton
                    Elemento el= CopiaTablero.elementos.Item(nombre.getText());
                    mc.Add(new MiBoton(el.nombre, j, el.nombreImagen));
                    System.out.println("A�ado boton: " + j + ", : " + el.nombre);
                    j++;   
                }
//                // almaceno los botones
View Full Code Here

TOP

Related Classes of Tipos.Elemento

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.