import javax.swing.*;
import java.awt.*;
import java.io.*;

class MapPanel<T> extends JPanel {

  private Tree<MeasuredData<T>> t;

  public MapPanel(Tree<MeasuredData<T>> t) {
    this.t = t;
  }

  public void paintComponent(Graphics g) {

    super.paintComponent(g);

    // An example of drawing: run this starter code to see a line drawn.
    // You will change this to draw rectangles representing the data in t.
    Dimension size = getSize(); // size of this window
    g.setColor(Color.RED);
    g.drawLine(size.width / 5, size.height / 4, size.width / 3, size.height / 2);

  }

  public static void main(String[] args) {
    JFrame f = new JFrame();
    f.getContentPane().add(new MapPanel<File>
                           (FileWalker.measure
                              (FileWalker.fileTree
                                 (new File
                                    (JOptionPane.showInputDialog
                                       ("Please input a file/directory name"))))));
    f.setSize(320, 240);
    f.setVisible(true);
  }

}

