RepBase.cxx
Go to the documentation of this file.
1 
11 // for dll interface warning
12 #ifdef _MSC_VER
13 #include "msdevstudio/MSconfig.h"
14 #endif
15 
16 #include "RepBase.h"
17 
18 #include "graphics/ViewBase.h"
19 
20 using std::string;
21 
22 using namespace hippodraw;
23 
24 const Color RepBase::s_desel_color ( 225, 225, 225 );
25 
26 RepBase::RepBase ( const char * string, float size )
27  : m_name ( string ),
28  m_size ( size ),
29  m_desel ( false )
30 {
31 }
32 
33 RepBase::RepBase ( const RepBase & rep )
34  : m_name ( rep.m_name ),
35  m_text ( rep.m_text ),
36  m_color ( rep.m_color ),
37  m_size ( rep.m_size ),
38  m_desel ( rep.m_desel )
39 {
40 }
41 
42 /* virtual */
44 {
45 }
46 
47 const string & RepBase::name () const
48 {
49  return m_name;
50 }
51 
52 void
53 RepBase::setColor ( const Color & color )
54 {
55  m_color = color;
56 }
57 
58 const Color & RepBase::getColor () const
59 {
60  return m_color;
61 }
62 
63 const Color & RepBase::color () const
64 {
65  if ( m_desel ) {
66  return s_desel_color;
67  }
68 
69  return m_color;
70 }
71 
72 void RepBase::setSelected ( bool yes )
73 {
74  m_desel = !yes;
75 }
76 
77 bool
79 isSelected () const
80 {
81  return m_desel == false;
82 }
83 
84 void
86 setHighLighted ( bool yes )
87 {
88  m_highlite = yes;
89 }
90 
91 float RepBase::size () const
92 {
93  return m_size;
94 }
95 
96 void RepBase::setSize ( float size )
97 {
98  m_size = size;
99 }
100 
101 void
102 RepBase::
103 setStyle ( unsigned int )
104 {
105  // do nothing
106 }
107 
108 unsigned int
109 RepBase::
110 getStyle ( ) const
111 {
112  return 0;
113 }
114 
115 /* virtual */
116 bool RepBase::xError () const
117 {
118  return false;
119 }
120 
121 /* virtual */
122 bool RepBase::yError () const
123 {
124  return false;
125 }
126 
127 void
128 RepBase::
130 {
131 }
132 
133 void RepBase::setText ( const std::string & text )
134 {
135  m_text = text;
136 }
137 
138 const std::string &
140 {
141  return m_text;
142 }
143 
144 
145 const BinToColor *
146 RepBase::
148 {
149  return 0;
150 }
151 
152 void
153 RepBase::
155 {
156  // do nothing
157 }
158 
159 void
160 RepBase::
162 {
163  string error ( "Error: " );
164  error += m_name;
165  error += " can not be displayed.";
166  view.drawText ( error, 5.0, 0.0, m_size, 0, 'l', 't', true );
167 }
168 
169 bool
170 RepBase::
172 {
173  return true;
174 }
175 
176 bool
177 RepBase::
178 uses ( Line::Style ) const
179 {
180  return false;
181 }
182 
183 bool
184 RepBase::
186 {
187  return false;
188 }

Generated for HippoDraw Class Library by doxygen