Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

Legend.h

Go to the documentation of this file.
00001 //LabPlot: Legend.h
00002 
00003 #ifndef LEGEND_H
00004 #define LEGEND_H
00005 
00006 #include <qfont.h>
00007 #include <qpainter.h>
00008 #include "GraphList.h"
00009 #include "Symbol.h"
00010 
00011 class Legend {
00012 public:
00013         Legend();
00014         void save(QTextStream *t);
00015         void open(QTextStream *t, int version);
00016         QDomElement saveXML(QDomDocument doc);
00017         void openXML(QDomNode node);
00018         void setFont(QFont f) { font = f; }
00019         QFont Font() { return font; }
00020         void enable(bool b=true) { enabled = b; }
00021         bool Enabled() { return enabled; }
00022         void setPosition(double X, double Y) { x = X; y = Y; }
00023         double X() { return x; }
00024         double Y() { return y; }
00025         void enableBorder(bool b=true) { border = b; }
00026         bool BorderEnabled() { return border; }
00027         void setColor(QColor c) { color = c; }
00028         void setColor(QString c) { color = QColor(c); }
00029         QColor Color() { return color; }
00030         void setTransparent(bool t=true) { transparent=t; }
00031         bool Transparent() { return transparent; }
00032         bool getOrientation() { return orientation; }
00033         void setOrientation(bool o) { orientation=o; }
00034         int drawGraphs(QPainter *p, GraphList *gl, PType type, Point size, QFont tmpfont);
00035         void draw(QPainter *p, PType type, GraphList *graphlist, Point pos, Point size,int w, int h);
00036         bool inside(int X, int Y);
00037         int TicLabelLength() { return ticlabellength; }
00038         void setTicLabelLength(int l) { ticlabellength = l; }
00039 private:
00040         double x,y;                     // position 0..1
00041         int x1, y1, x2, y2;             // legend box
00042         QFont font;                             // legend font
00043         bool border;                    // border enabled
00044         bool enabled;                           // legend enabled
00045         QColor color;                   // legend background color
00046         bool transparent;               // transparent ?
00047         int namelength;         // legend width
00048         bool orientation;               // 0: BottomTop, 1:LeftRight
00049         int ticlabellength;             // max length of tic label. used for border 
00050 };
00051 
00052 #endif //LEGEND_H

Generated on Sat Oct 13 21:55:01 2007 for LabPlot by  doxygen 1.4.4