示例#1
0
void LinePath::setAssociation(AssociationWidget * association ) {
    if( !association )
        return;
    cleanup();
    m_pAssociation = association;
    createHeadLines();
    if( getAssocType() == Uml::at_Coll_Message )
        setupParallelLine();
    UMLView * view =  (UMLView *)m_pAssociation -> parent();
    connect( view, SIGNAL( sigColorChanged( Uml::IDType ) ), this, SLOT( slotLineColorChanged( Uml::IDType ) ) );
    connect( view, SIGNAL( sigLineWidthChanged( Uml::IDType ) ), this, SLOT( slotLineWidthChanged( Uml::IDType ) ) );
}
示例#2
0
/**
 * This will setup the class ready to display the line correctly.
 * This MUST be called before you can use this class.
 */
void AssociationLine::setAssociation(AssociationWidget * association)
{
    if( !association )
        return;
    cleanup();
    m_pAssociation = association;
    createHeadLines();
    createSubsetSymbol();
    if( getAssocType() == Uml::AssociationType::Coll_Message )
        setupParallelLine();
    UMLView * view =  (UMLView *)m_pAssociation->parent();
    if (view) {
        connect(view, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotLineColorChanged(Uml::IDType)));
        connect(view, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType)));
    }
    else {
        uWarning() << "Parent is null. Can not connect SIGNAL/SLOT.";
    }

}
示例#3
0
void LinePath::cleanup() {
    if (m_pAssociation)
        m_LineList.clear();
    m_HeadList.clear();
    m_RectList.clear();
    m_ParallelList.clear();

    if( m_pClearPoly )
        delete m_pClearPoly;
    if( m_pCircle )
        delete m_pCircle;
    m_pCircle = 0;
    m_pClearPoly = 0;
    m_bHeadCreated = m_bParallelLineCreated = false;
    if( m_pAssociation ) {
        UMLView * view =  (UMLView *)m_pAssociation -> parent();
        if(view) {
            disconnect( view, SIGNAL( sigColorChanged( Uml::IDType ) ), this, SLOT( slotLineColorChanged( Uml::IDType ) ) );
            disconnect( view, SIGNAL( sigLineWidthChanged( Uml::IDType ) ), this, SLOT( slotLineWidthChanged( Uml::IDType ) ) );
        }
        m_pAssociation = NULL;
    }
}