Example #1
0
static void setVisualRole(DObject &object, DObject::VisualPrimaryRole visualRole)
{
    if (visualRole == DObject::DeprecatedPrimaryRoleDarker) {
        object.setVisualPrimaryRole(DObject::PrimaryRoleNormal);
        object.setVisualSecondaryRole(DObject::SecondaryRoleDarker);
    } else if (visualRole == DObject::DeprecatedPrimaryRoleLighter) {
        object.setVisualPrimaryRole(DObject::PrimaryRoleNormal);
        object.setVisualSecondaryRole(DObject::SecondaryRoleLighter);
    } else if (visualRole == DObject::DeprecatedPrimaryRoleOutline) {
        object.setVisualPrimaryRole(DObject::PrimaryRoleNormal);
        object.setVisualSecondaryRole(DObject::SecondaryRoleOutline);
    } else if (visualRole == DObject::DeprecatedPrimaryRoleSoften) {
        object.setVisualPrimaryRole(DObject::PrimaryRoleNormal);
        object.setVisualSecondaryRole(DObject::SecondaryRoleSoften);
    } else {
        object.setVisualPrimaryRole(visualRole);
    }
}
void DFlatAssignmentVisitor::visitDObject(const DObject *object)
{
    visitDElement(object);
    DObject *target = dynamic_cast<DObject *>(_target);
    QMT_CHECK(target);
    target->setStereotypes(object->getStereotypes());
    target->setName(object->getName());
    target->setPos(object->getPos());
    target->setRect(object->getRect());
    target->setAutoSize(object->hasAutoSize());
    target->setDepth(object->getDepth());
    target->setVisualPrimaryRole(object->getVisualPrimaryRole());
    target->setVisualSecondaryRole(object->getVisualSecondaryRole());
    target->setVisualEmphasized(object->isVisualEmphasized());
    target->setStereotypeDisplay(object->getStereotypeDisplay());
}