Exemple #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 ) ) );
}
Exemple #2
0
void LinePath::update() {
    if (getAssocType() == Uml::at_Coll_Message) {
        if (m_bParallelLineCreated) {
            calculateParallelLine();
            updateParallelLine();
        } else
            setupParallelLine();
    } else if (m_bHeadCreated) {
        calculateHead();
        updateHead();
    } else {
        createHeadLines();
    }
}
Exemple #3
0
void LinePath::setAssocType( Uml::Association_Type type ) {
    LineListIt it( m_LineList );
    QCanvasLine * line = 0;
    while( ( line = it.current() ) ) {
        line -> setPen( getPen() );
        ++it;
    }
    if( m_pClearPoly ) {
        delete m_pClearPoly;
        m_pClearPoly = 0;
    }
    if( type == Uml::at_Coll_Message )
        setupParallelLine();
    else
        createHeadLines();
    update();
}
Exemple #4
0
/**
 * Sets the Association type.
 */
void LinePath::setAssocType( Uml::Association_Type type )
{
    QList<Q3CanvasLine*>::Iterator it = m_LineList.begin();
    QList<Q3CanvasLine*>::Iterator end = m_LineList.end();

    for( ; it != end; ++it )
        (*it) -> setPen( getPen() );

    delete m_pClearPoly;
    m_pClearPoly = 0;

    if( type == Uml::at_Coll_Message ) {
        setupParallelLine();
    }
    else {
        createHeadLines();
        createSubsetSymbol();
    }
    update();
}
/**
 * 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.";
    }

}
/**
 * Calls a group of methods to update the line. Used to save you calling multiple methods.
 */
void AssociationLine::update()
{
    if (getAssocType() == Uml::AssociationType::Coll_Message) {
        if (m_bParallelLineCreated) {
            calculateParallelLine();
            updateParallelLine();
        } else
            setupParallelLine();
    } else if (m_bHeadCreated) {
        calculateHead();
        updateHead();
    } else {
        createHeadLines();
    }

    if ( m_bSubsetSymbolCreated ) {
        updateSubsetSymbol();
    } else {
        createSubsetSymbol();
    }
}