Package de.axxeed.animosy.tools

Examples of de.axxeed.animosy.tools.FileHandler


    loc.translate((PanelRepository.get(PanelRepository.MAIN_WINDOW).getWidth()-640)/2, 75);
    this.setLocation( loc );
   
    htmlBox.setEditorKit(new HTMLEditorKit());

    FileHandler htmlFile = new FileHandler(filename);
    String msg = htmlFile.readAll();
    log.debug("L�nge: "+msg.length());
     
    htmlBox.setText(msg.toString());
    htmlBox.setEditable(false);
    htmlBox.setCaretPosition(0);
View Full Code Here


   
    /**This method reads the text file which contains the map*/
    private static void readFile()
    {
        try {
      FileHandler map = new FileHandler("de/axxeed/animosy/scotmap.txt");
      log.info("Reading map network list <"+map.getInfo()+">");
      // RandomAccessFile map=new RandomAccessFile(f,"r");
      String buffer=map.readLine();
      StringTokenizer token;
      token=new StringTokenizer(buffer);
      noOfNodes=Integer.parseInt(token.nextToken());
      nodes=new Node[noOfNodes];
      for(int i=0;i<nodes.length;i++)
          nodes[i]=new Node(i);
      buffer=map.readLine();
      while(buffer!=null && buffer.trim().length()>0) {
        // System.out.println(i+": "+buffer);
        token=new StringTokenizer(buffer);
        int node1=Integer.parseInt(token.nextToken());
        int node2=Integer.parseInt(token.nextToken());
        String strType=token.nextToken();
        int type=INF;
        if(strType.equals("T")) type=TAXI;
        if(strType.equals("B")) type=BUS;
        if(strType.equals("U")) type=UG;
        if(strType.equals("X")) type=BLACK;
        nodes[node1].addLink(nodes[node2],type);
        nodes[node2].addLink(nodes[node1],type);
        buffer=map.readLine();
      }
      map.close();
      }
        catch(Exception e) {
      e.printStackTrace();
          System.out.println("Error in file reading. Exitting!!! "+e);
      System.exit(1);
View Full Code Here

 
    /**This method reads the text file which contains the map*/
    private void readMapPositions() {
        // file with graphics information
        try {
        FileHandler map = new FileHandler("de/axxeed/animosy/scotmapg.txt");
        log.info("Loading board info <"+map.getInfo()+">");
       
      String buffer=map.readLine();
      StringTokenizer token;
      token=new StringTokenizer(buffer);
      int numPos=Integer.parseInt(token.nextToken());
      pos=new Point[numPos];
      for(int i=0;i<numPos;i++)
      {
          pos[i]=new Point(0,0);
        buffer=map.readLine();
        // System.out.println(i+": "+buffer);
        token=new StringTokenizer(buffer);
        int posNo=Integer.parseInt(token.nextToken());
        int posX=Integer.parseInt(token.nextToken());
        int posY=Integer.parseInt(token.nextToken());
View Full Code Here

TOP

Related Classes of de.axxeed.animosy.tools.FileHandler

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.