Exemplo n.º 1
0
void LinePath::setLineWidth( uint width ) {
    QCanvasLine * line = 0;
    QColor linecolor;
    LineListIt it( m_LineList );
    while( ( line = it.current() ) ) {
        linecolor = line->pen().color();
        line -> setPen( QPen( linecolor, width ) );
        ++it;
    }
    LineListIt hit( m_HeadList );
    while( ( line = hit.current() ) ) {
        linecolor = line->pen().color();
        line -> setPen( QPen( linecolor, width ) );
        ++hit;
    }
    LineListIt pit( m_ParallelList );
    while( ( line = pit.current() ) ) {
        linecolor = line->pen().color();
        line -> setPen( QPen( linecolor, width ) );
        ++pit;
    }

    if( m_pCircle ) {
        linecolor = m_pCircle->pen().color();
        m_pCircle->setPen( QPen(linecolor, width) );
    }
}
Exemplo n.º 2
0
void LinePath::setLineColor( const QColor &color ) {
    QCanvasLine * line = 0;
    uint linewidth = 0;
    LineListIt it( m_LineList );
    while( ( line = it.current() ) ) {
        linewidth = line->pen().width();
        line -> setPen( QPen( color, linewidth ) );
        ++it;
    }
    LineListIt hit( m_HeadList );
    while( ( line = hit.current() ) ) {
        linewidth = line->pen().width();
        line -> setPen( QPen( color, linewidth ) );
        ++hit;
    }
    LineListIt pit( m_ParallelList );
    while( ( line = pit.current() ) ) {
        linewidth = line->pen().width();
        line -> setPen( QPen( color, linewidth ) );
        ++pit;
    }

    if( getAssocType() == Uml::at_Aggregation )
        if (m_pClearPoly) m_pClearPoly -> setBrush( QBrush( Qt::white ) );
        else if( getAssocType() == Uml::at_Composition )
            if (m_pClearPoly) m_pClearPoly -> setBrush( QBrush( color ) );

    if( m_pCircle ) {
        linewidth = m_pCircle->pen().width();
        m_pCircle->setPen( QPen(color, linewidth) );
    }
}