/**** * * Class BoxArrowDiagram displays data in the form of colored boxes with arrows * between them. * */ #ifndef boxarrowdiagramIncluded #define boxarrowdiagramIncluded #include "label.h" #include "view.h" #include #include #include typedef Graphic* BoxId; class BoxArrowDiagram : public View { public: BoxArrowDiagram(Screen* s, int height = 200, int width = 200); /* * Construct this with the given dimensions, in pixels. */ BoxId DrawBox(int l, int b, int r, int t, Color* c, Label* la); /* * Draw a generic box at the given l,b,r,t coordinates, which are the left, * bottom top, right coordiates of the box's rectangle. Paint the box the * given color with the given label in its center. */ BoxId DrawBox(int l, int b, int r, int t, Graphic* g) /* * Draw a box at the given l,b,r,t coordinates, with the given graphic as * its painted image. */ void Select(BoxId id); /* * Select this by highlighting it in some way. For now it does nothing. * Later it will do something like put little handles on each corner. */ void Deselect(BoxId id); /* * Remove the highlighting effect. */ Connect(BoxId id1, BoxId id2); /* * Draw a connecting line between the boxes of the given two ids. For now * the line is drawn center to center. Later it will be from the center of * the two nearest edges. */ protected: Picture* p; // The main rep that holds all of the drawn // boxes and arrows }; #endif