kivio
kivio_painter.cpp
00001 /* 00002 * Kivio - Visual Modelling and Flowcharting 00003 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 #include "kivio_fill_style.h" 00020 #include "kivio_line_style.h" 00021 #include "kivio_painter.h" 00022 #include "kivio_point.h" 00023 00024 KivioPainter::KivioPainter() 00025 : m_pFillStyle(NULL) 00026 { 00027 m_pFillStyle = new KivioFillStyle(); 00028 m_pLineStyle = new KivioLineStyle(); 00029 } 00030 00031 KivioPainter::~KivioPainter() 00032 { 00033 if( m_pFillStyle ) 00034 { 00035 delete m_pFillStyle; 00036 m_pFillStyle = NULL; 00037 } 00038 00039 if( m_pLineStyle ) 00040 { 00041 delete m_pLineStyle; 00042 m_pLineStyle = NULL; 00043 } 00044 } 00045 00046 00047 void KivioPainter::setFGColor( const QColor &c ) 00048 { 00049 m_pLineStyle->setColor(c); 00050 } 00051 00052 QColor KivioPainter::fgColor() const 00053 { 00054 return m_pLineStyle->color(); 00055 } 00056 00057 float KivioPainter::lineWidth() const 00058 { 00059 return m_pLineStyle->width(); 00060 } 00061 00062 void KivioPainter::setLineWidth( const float &f ) 00063 { 00064 m_pLineStyle->setWidth(f); 00065 } 00066 00067 void KivioPainter::setLineStyle( KivioLineStyle *pStyle ) 00068 { 00069 pStyle->copyInto( m_pLineStyle ); 00070 } 00071 00072 void KivioPainter::setFillStyle( KivioFillStyle * s ) 00073 { 00074 s->copyInto( m_pFillStyle ); 00075 }