Package com.google.gwt.xml.client

Examples of com.google.gwt.xml.client.Document


     * @param levels The number of levels to display.
     */
    public static void URLRead(String map, int levels){
     
      try{
        Document doc = XMLParser.parse(map);
        XMLParser.removeWhitespace(doc);
        if (doc != null) {
          Node rootnode = doc.getFirstChild();
          if (rootnode.getNodeName().equals("graph")){
            Node node = rootnode.getFirstChild();
            if(node.getNodeName().equals("focus"))
              load(node,levels);
            else if(node.getNodeName().equals("update"))
View Full Code Here


     * @param levels The number of levels to display.
     */
    public static void URLRead(String map, int levels){
     
      try{
        Document doc = XMLParser.parse(map);
        XMLParser.removeWhitespace(doc);
        if (doc != null) {
          Node rootnode = doc.getFirstChild();
          if (rootnode.getNodeName().equals("graph")){
            Node node = rootnode.getFirstChild();
            if(node.getNodeName().equals("focus"))
              load(node,levels);
            else if(node.getNodeName().equals("update"))
View Full Code Here

     * @param levels The number of levels to display.
     */
    public static void URLRead(String map, int levels){
     
      try{
        Document doc = XMLParser.parse(map);
        XMLParser.removeWhitespace(doc);
        if (doc != null) {
          Node rootnode = doc.getFirstChild();
          if (rootnode.getNodeName().equals("graph")){
            Node node = rootnode.getFirstChild();
            if(node.getNodeName().equals("focus"))
              load(node,levels);
            else if(node.getNodeName().equals("update"))
View Full Code Here

     * @param levels The number of levels to display.
     */
    public static void URLRead(String map, int levels){
     
      try{
        Document doc = XMLParser.parse(map);
        XMLParser.removeWhitespace(doc);
        if (doc != null) {
          Node rootnode = null;
          for(int ii = 0; ii < doc.getChildNodes().getLength(); ii++){
            if(doc.getChildNodes().item(ii).getNodeName().equals("graph"))
              rootnode = doc.getChildNodes().item(ii);
          }
          if(rootnode != null){
            for(int i = 0;i < rootnode.getAttributes().getLength();i++){
              if(rootnode.getAttributes().item(i).getNodeName().equals("levels")){
                levels = Integer.parseInt(rootnode.getAttributes().item(i).getNodeValue());
View Full Code Here

     * @param levels The number of levels to display.
     */
    public static void URLRead(String map, int levels){
     
      try{
        Document doc = XMLParser.parse(map);
        XMLParser.removeWhitespace(doc);
        if (doc != null) {
          Node rootnode = doc.getFirstChild();
          if (rootnode.getNodeName().equals("graph")){
            Node node = rootnode.getFirstChild();
            if(node.getNodeName().equals("focus"))
              load(node,levels);
            else if(node.getNodeName().equals("update"))
View Full Code Here

     * @param levels The number of levels to display.
     */
    public static void URLRead(String map, int levels){
     
      try{
        Document doc = XMLParser.parse(map);
        XMLParser.removeWhitespace(doc);
        if (doc != null) {
          Node rootnode = null;
          for(int ii = 0; ii < doc.getChildNodes().getLength(); ii++){
            if(doc.getChildNodes().item(ii).getNodeName().equals("graph"))
              rootnode = doc.getChildNodes().item(ii);
          }
          if(rootnode != null){
            for(int i = 0;i < rootnode.getAttributes().getLength();i++){
              if(rootnode.getAttributes().item(i).getNodeName().equals("levels")){
                levels = Integer.parseInt(rootnode.getAttributes().item(i).getNodeValue());
                Navigator.DEPTH.setValue(String.valueOf(levels));
              }
              if(rootnode.getAttributes().item(i).getNodeName().equals("radius")){
                RADIUS = Integer.parseInt(rootnode.getAttributes().item(i).getNodeValue());
                Position.setB();
              }
              if(rootnode.getAttributes().item(i).getNodeName().equals("viewlevel"))
                VIEW = Integer.parseInt(rootnode.getAttributes().item(i).getNodeValue());
              if(rootnode.getAttributes().item(i).getNodeName().equals("imgsizeatview"))
                IMAGE_PIXEL_SIZE = Integer.parseInt(rootnode.getAttributes().item(i).getNodeValue());
              if(rootnode.getAttributes().item(i).getNodeName().equals("forces"))
                if(rootnode.getAttributes().item(i).getNodeValue().equals("Y")){
                  Position.AUTO = true;
                  Navigator.AUTO.setValue(true);
                }
              if(rootnode.getAttributes().item(i).getNodeName().equals("threedimension"))
                if(rootnode.getAttributes().item(i).getNodeValue().equals("Y")){
                  Position.GRAPH_3D = true;
                  Navigator.GRAPH_3D.setValue(true);
                }
              if(rootnode.getAttributes().item(i).getNodeName().equals("wrapoperation"))
                if(rootnode.getAttributes().item(i).getNodeValue().equals("Y"))
                  Operations.WRAP = true;
            }
            Node node = rootnode.getFirstChild();
            if(node.getNodeName().equals("focus"))
              load(node,levels);
            else if(node.getNodeName().equals("update")){
              if(FOCUS != null){
                reload(node);
              }
            }else
              webError("XML Error, check schema at " + node.getNodeName());
          }else
            webError("XML Error, check schema at graph " + doc.getNodeName());
        }else
          webError("Document Error.");
      }catch(Exception e){
        webError("XML Parsing Error.\n" + e.toString().substring(0, 1000) + "...");
      }
View Full Code Here

    public abstract static class Callback extends AbstractCallback<Feed> {
       
        @Override @Nonnull
        protected Feed parse(@Nonnull final Response response) {
            Document document = convertFromXML(response);
            if (document != null) {
                return new Feed(document);
            } else {
                return Feed.EMPTY;
            }
View Full Code Here

public class FreedomoticStompHelper {

    public static Payload parseMessage(String message) {
        final Payload payload = new Payload();

        Document messageDom = XMLParser.parse(message);
        NodeList statements = messageDom.getElementsByTagName("it.freedomotic.reactions.Statement");
        for (int i = 0; i < statements.getLength(); i++) {
            Element statement = (Element) statements.item(i);
            payload.enqueueStatement(parseStatement(statement));
        }
        return payload;
View Full Code Here

  public static Payload parseMessage(String message)
  {
    final Payload payload = new Payload();
   
    Document messageDom = XMLParser.parse(message);   
    NodeList statements = messageDom.getElementsByTagName("it.freedomotic.reactions.Statement");           
    for (int i = 0; i < statements.getLength(); i++) {
      Element statement = (Element)statements.item(i);
       payload.enqueueStatement(parseStatement(statement));    
     }       
        return payload;                          
View Full Code Here

      @Override
      public void loaded()
      {
        PUWeb.engine().fillTexture(mSpriteTexture, image);
       
        Document infoDom = XMLParser.parse(imageInfo);
       
        NodeList sprites = infoDom.getElementsByTagName("sprite");
        PU_Resources.this.mSpriteCount = sprites.getLength();
        for(int i = 0; i < sprites.getLength(); i++)
        {
          Element element = (Element) sprites.item(i);
         
View Full Code Here

TOP

Related Classes of com.google.gwt.xml.client.Document

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.