import java.awt.*;
import java.util.Vector;
import javax.swing.*;
import javax.swing.tree.*;

public class TestSgfReader
{ 
  public static void main(String[] args){
    SgfReader sr=new SgfReader();
    Kifu kifu=sr.read("二連星大桂馬がかり.sgf");

    OrderOfMoves order=kifu.getOrderOfMoves();
    for(int i=0;i<order.size();i++){
      Move move=order.getMove(i);
      System.out.println("move" + i + "=" + move.getStoneColor() + "," + move.getRow() + "," + move.getCol());
    }
    System.out.println("PB=" + kifu.getGameInformation().getBlackPlayer());
    System.out.println("PW=" + kifu.getGameInformation().getWhitePlayer());


    JTree tree=new JTree(sr.getSgfTree());
    tree.setFont(new Font("MS Gothic",Font.PLAIN,20));
    JScrollPane pane = new JScrollPane(tree);
    JFrame frame=new JFrame("データ表示");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(pane,BorderLayout.CENTER);
    frame.setSize(new Dimension(800,500));
    frame.setVisible(true);
  }
}