+
+#include "view_btree_data.h"
+
+ViewBTreeData::ViewBTreeData (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2):
+ Canvas::Rect (*parent, x1, y1, x2, y2)
+{
+ this->data = data;
+ property_fill_color () = "red";
+ property_outline_color () = "black";
+}
+
+
+ViewBTreeData*
+ViewBTreeData::Create (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2)
+{
+ if (dynamic_cast<BTreeChildData *>(data))
+ return new ViewBTreeChildData (data, parent, x1, y1, x2, y2);
+
+ return new ViewBTreeData (data, parent, x1, y1, x2, y2);
+}
+
+ViewBTreeChildData::ViewBTreeChildData (BTreeData *data, Canvas::Group *parent, double x1, double y1, double x2, double y2):
+ ViewBTreeData (data, parent, x1, y1, x2, y2)
+{
+ property_fill_color () = "yellow";
+ property_outline_color () = "black";
+
+ double w = x2 - x1;
+ double h = y2 - y1;
+
+ std::string s = *data;
+ Canvas::Text *text = new Canvas::Text (*parent, x1 + w/2, y1 + h/2, s);
+}
+