#ifndef __COLOR_LEGEND_H__
#define __COLOR_LEGEND_H__
#include "box.h"
#include "label.h"
#include <vector>
namespace blop
{
class graphd_colorscale;
class tic;
class color_legend : public box
{
private:
void init_();
std::vector<blop::tic> colortics_;
static length default_sample_width_;
length sample_width_;
length sample_right_;
length tic_left_;
length sep_;
length ticlabel_pos_;
length ticlabel_width_;
label title_;
std::vector<blop::graphd_colorscale*> owners_;
friend class graphd_colorscale;
double min_, max_;
color_legend(const color_legend &);
const color_legend &operator= (const color_legend &rhs);
public:
color_legend();
color_legend(graphd_colorscale *d);
~color_legend();
static color_legend &mknew();
color_legend &title(const var &t);
const var &title() const;
color_legend &sample_width(const length &l);
static void default_sample_width(const length &l);
void print(terminal *term);
void prepare_for_draw();
void calculate_tics();
void clear_tics();
void remove_owner(graphd_colorscale *);
const std::vector<blop::tic> tics() const { return colortics_; }
double min() const;
double max() const;
};
}
#endif