package com.treelogic.proteus.visualization;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.treelogic.proteus.visualization.model.Barchart;
import com.treelogic.proteus.visualization.model.Linechart;
import com.treelogic.proteus.visualization.model.Streamgraph;
import com.treelogic.proteus.visualization.model.points.BasicPoint;
import com.treelogic.proteus.visualization.model.points.StreamPoint;

public class Main {
	public static void main(String[] args) {
		//
		//
		// BARCHART
		//
		//
		Barchart<String, Integer> barchart = new Barchart<String, Integer>();
		barchart.addPoint(new BasicPoint<String, Integer>("España", 2))
				.addPoint(new BasicPoint<String, Integer>("Hungría", 5))
				.addPoint(new BasicPoint<String, Integer>("Alemania", 1));
		//
		//
		// STREAMGRAPH
		//
		//
		Streamgraph<Date, Integer, String> streamgraph = new Streamgraph<Date, Integer, String>();
		streamgraph
<<<<<<< HEAD
				.addPoint(
						new StreamPoint<Date, Integer, String>(new Date(), 1,
								2, "A"))
				.addPoint(
						new StreamPoint<Date, Integer, String>(new Date(), 3,
								4, "B"))
				.addPoint(
						new StreamPoint<Date, Integer, String>(new Date(), 5,
								6, "C"));
=======
			.addPoint(new StreamPoint<Date, Integer, String>(new Date(),1,2, "A"))
			.addPoint(new StreamPoint<Date, Integer, String>(new Date(),3,4, "B"))
			.addPoint(new StreamPoint<Date, Integer, String>(new Date(),5,6, "C"));
		
		//
		//
		// LINECHART
		//
		//
		Linechart<Date, Integer> linechart = new Linechart<Date, Integer>();
		SimpleDateFormat sdf = new SimpleDateFormat("MM/yy");
		Date d1 = null, d2 = null, d3 = null;
		try {
			d1 = sdf.parse("01/16");
			d2 = sdf.parse("02/16");
			d3 = sdf.parse("03/16");
		} catch (ParseException e) {
			e.printStackTrace();
		}
		linechart
			.addPoint(new BasicPoint<Date, Integer>(d1, 1))
			.addPoint(new BasicPoint<Date, Integer>(d2, 1))
			.addPoint(new BasicPoint<Date, Integer>(d3, 1));
>>>>>>> 91d04d4db6cea21e861aa9f9ae36b0fd027e8d09

		System.out.println(barchart.toJson());
		System.out.println(streamgraph.toJson());
		System.out.println(linechart.toJson());
	}
}

@@ -498,23 +498,25 @@
 main
+ 
 (String
+ 
 %5B%5D args)
  %7B%0A%09
@@ -511,19 +511,20 @@
 %5B%5D args)
- 
 %7B%0A
+%09%09
 %09%09//%0A%09%09/
@@ -534,24 +534,25 @@
 %09// BARCHART
+ 
 %0A%09%09//%0A%09%09//%0A%09
@@ -632,16 +632,20 @@
 barchart
+%0A%09%09%09
 .addPoin
@@ -692,17 +692,16 @@
 a%22, 2))%0A
-%09
 %09%09%09.addP
@@ -751,25 +751,24 @@
 %C3%ADa%22, 5))%0A%09%09%09
-%09
 .addPoint(ne
@@ -840,16 +840,17 @@
 EAMGRAPH
+ 
 %0A%09%09//%0A%09%09
@@ -963,306 +963,8 @@
 aph%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A%09%09%09%09.addPoint(%0A%09%09%09%09%09%09new StreamPoint%3CDate, Integer, String%3E(new Date(), 1,%0A%09%09%09%09%09%09%09%092, %22A%22))%0A%09%09%09%09.addPoint(%0A%09%09%09%09%09%09new StreamPoint%3CDate, Integer, String%3E(new Date(), 3,%0A%09%09%09%09%09%09%09%094, %22B%22))%0A%09%09%09%09.addPoint(%0A%09%09%09%09%09%09new StreamPoint%3CDate, Integer, String%3E(new Date(), 5,%0A%09%09%09%09%09%09%09%096, %22C%22));%0A=======%0A
 %09%09%09.
@@ -1707,57 +1707,8 @@
 1));
-%0A%3E%3E%3E%3E%3E%3E%3E 91d04d4db6cea21e861aa9f9ae36b0fd027e8d09
 %0A%0A%09%09
@@ -1836,9 +1836,8 @@
 ));%0A%09%7D%0A%7D
-%0A

Add websocket support and some testing functions