当前位置: 首页>>代码示例>>Java>>正文


Java DRepresentationDescriptor类代码示例

本文整理汇总了Java中org.eclipse.sirius.viewpoint.DRepresentationDescriptor的典型用法代码示例。如果您正苦于以下问题:Java DRepresentationDescriptor类的具体用法?Java DRepresentationDescriptor怎么用?Java DRepresentationDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DRepresentationDescriptor类属于org.eclipse.sirius.viewpoint包,在下文中一共展示了DRepresentationDescriptor类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRepresentations

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
/**
 * Gets the {@link List} of {@link DRepresentation} representing the given instruction.
 * 
 * @param session
 *            the {@link Session}
 * @param instructionURI
 *            the instruction {@link URI}
 * @return the {@link List} of {@link DRepresentation} representing the given instruction
 */
public static List<DRepresentation> getRepresentations(Session session, URI instructionURI) {
	final List<DRepresentation> res = new ArrayList<DRepresentation>();

	final EObject instruction = session.getTransactionalEditingDomain().getResourceSet().getEObject(
			instructionURI, false);

	for (DView view : session.getSelectedViews()) {
		for (DRepresentationDescriptor rdescriptor : view.getOwnedRepresentationDescriptors()) {
			DRepresentation representation = rdescriptor.getRepresentation();
			if (representSemanticElement(representation, instruction)) {
				res.add(representation);
			}
		}
	}

	return res;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:27,代码来源:SiriusEditorUtils.java

示例2: getAssociatedRepresentationByName

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
/**
 * Retrieve all representations whose target is the specified EObject.
 * 
 * @param representationName
 *            the name of the representation from which we want to create an image.
 * @param session
 *            the Sirius session from which we want to find the representation with the given name.
 * @return the corresponding representation.
 */
public static DRepresentationDescriptor getAssociatedRepresentationByName(String representationName,
        Session session) {
    if (representationName != null) {
        Collection<DRepresentationDescriptor> representations = DialectManager.INSTANCE
                .getAllRepresentationDescriptors(session);

        // Filter representations to keep only those in a selected viewpoint
        Collection<Viewpoint> selectedViewpoints = session.getSelectedViewpoints(false);

        for (DRepresentationDescriptor representation : representations) {
            boolean isDangling = new DRepresentationDescriptorQuery(representation).isDangling();
            if (!isDangling && representation != null && representationName.equals(representation.getName())
                && representation.getDescription().eContainer() instanceof Viewpoint) {
                Viewpoint vp = (Viewpoint) representation.getDescription().eContainer();
                if (selectedViewpoints.contains(vp)) {
                    return representation;
                }
            }
        }
    }

    return null;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:33,代码来源:SiriusRepresentationUtils.java

示例3: asImageByRepresentationName

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
@Documentation(
    value = "Insert the image of the given representation name.",
    params = {
        @Param(name = "representationName", value = "the name of the searched representation"),
    },
    result = "Insert the image of the given representation name",
    examples = {
        @Example(expression = "'MyEPackage class diagram'.asImageByRepresentationName()", result = "insert the image"),
    }
)
// @formatter:on
public MImage asImageByRepresentationName(String representationName) throws SizeTooLargeException, IOException {
    final MImage res;

    final DRepresentationDescriptor descriptor = SiriusRepresentationUtils
            .getAssociatedRepresentationByName(representationName, session);
    if (descriptor != null) {
        res = asImage(descriptor.getRepresentation());
    } else {
        res = null;
    }

    return res;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:25,代码来源:M2DocSiriusServices.java

示例4: asTableByRepresentationName

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
@Documentation(
    value = "Insert the table of the given representation name.",
    params = {
        @Param(name = "representationName", value = "the name of the searched representation"),
    },
    result = "Insert the table of the given representation name",
    examples = {
        @Example(expression = "'MyEPackage class diagram'.asTableByRepresentationName()", result = "insert the table"),
    }
)
// @formatter:on
public MTable asTableByRepresentationName(String representationName) {
    final MTable res;

    final DRepresentationDescriptor description = SiriusRepresentationUtils
            .getAssociatedRepresentationByName(representationName, session);
    if (description != null && description.getRepresentation() instanceof DTable) {
        res = asTable((DTable) description.getRepresentation());
    } else {
        res = null;
    }

    return res;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:25,代码来源:M2DocSiriusServices.java

示例5: run

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
/**
 * delete the representation.
 */
@Override
public void run() {
    final Set<DRepresentationDescriptor> representations = new LinkedHashSet<DRepresentationDescriptor>();
    representations.add(representation);
    session.getTransactionalEditingDomain().getCommandStack()
            .execute(new DeleteRepresentationCommand(session, representations));
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:11,代码来源:CleaningAIRDJob.java

示例6: getRepresentationByRepresentationDescriptionName

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
/**
 * Gets the {@link List} of {@link DRepresentation} with the given {@link RepresentationDescription#getName() description name} for the
 * given {@link EObject}.
 * 
 * @param session
 *            the {@link Session}
 * @param eObj
 *            the {@link EObject}
 * @param descriptionName
 *            the {@link RepresentationDescription#getName() description name}
 * @return the {@link List} of {@link DRepresentation} with the given description name for the given {@link EObject}
 */
public static List<DRepresentation> getRepresentationByRepresentationDescriptionName(Session session, EObject eObj,
        String descriptionName) {
    final List<DRepresentation> res = new ArrayList<DRepresentation>();

    final Collection<DRepresentationDescriptor> repDescs = DialectManager.INSTANCE
            .getRepresentationDescriptors(eObj, session);
    // Filter representations to keep only those in a selected viewpoint
    final Collection<Viewpoint> selectedViewpoints = session.getSelectedViewpoints(false);

    for (DRepresentationDescriptor repDesc : repDescs) {
        boolean isDangling = new DRepresentationDescriptorQuery(repDesc).isDangling();
        if (!isDangling && repDesc.getDescription() instanceof DiagramDescription
            && descriptionName.equals(repDesc.getDescription().getName())
            && repDesc.getDescription().eContainer() instanceof Viewpoint) {
            Viewpoint vp = (Viewpoint) repDesc.getDescription().eContainer();
            if (selectedViewpoints.contains(vp)) {
                res.add(repDesc.getRepresentation());
            }
        }
    }

    return res;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:36,代码来源:SiriusRepresentationUtils.java

示例7: asTableByRepresentationDescriptionName

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
@Documentation(
    value = "Gets the Sequence of tables for the tables associated to the given EObject with the given description name.",
    params = {
        @Param(name = "eObject", value = "Any eObject that is in the session where to search"),
        @Param(name = "representationDescriptionName", value = "the name of the searched representation description"),
    },
    result = "the Sequence of tables for the tables associated to the given EObject with the given description name.",
    examples = {
        @Example(expression = "ePackage.asTableByRepresentationDescriptionName('dependency table')", result = "Sequence{table1, table2}"),
    }
)
// @formatter:on
public List<MTable> asTableByRepresentationDescriptionName(EObject eObj, String descriptionName) {
    final List<MTable> res = new ArrayList<>();

    final Collection<DRepresentationDescriptor> repDescs = DialectManager.INSTANCE
            .getRepresentationDescriptors(eObj, session);
    // Filter representations to keep only those in a selected viewpoint
    final Collection<Viewpoint> selectedViewpoints = session.getSelectedViewpoints(false);

    for (DRepresentationDescriptor repDesc : repDescs) {
        boolean isDangling = new DRepresentationDescriptorQuery(repDesc).isDangling();
        if (!isDangling && repDesc.getDescription() instanceof TableDescription
            && descriptionName.equals(repDesc.getDescription().getName())
            && repDesc.getDescription().eContainer() instanceof Viewpoint) {
            Viewpoint vp = (Viewpoint) repDesc.getDescription().eContainer();
            if (selectedViewpoints.contains(vp)) {
                res.add(asTable((DTable) repDesc.getRepresentation()));
            }
        }
    }

    return res;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:35,代码来源:M2DocSiriusServices.java

示例8: CleaningAIRDJob

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
/**
 * Create a new {@link CleaningAIRDJob} instance given a semantic object a session and a representation.
 * 
 * @param semantic
 *            the semantic object
 * @param session
 *            the session.
 * @param representation
 *            the representation to delete.
 */
public CleaningAIRDJob(EObject semantic, Session session, DRepresentationDescriptor representation) {
    if (semantic == null || session == null || representation == null) {
        throw new IllegalArgumentException("a null argument has been passed to the CleaningAIRDJob constructor");
    }
    this.session = session;
    this.representation = representation;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:18,代码来源:CleaningAIRDJob.java

示例9: getAssociatedRepresentationByDescriptionAndName

import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; //导入依赖的package包/类
/**
 * Retrieve all representations whose target is the specified EObject and description the given one.
 * 
 * @param targetRootObject
 *            Object which is the target of the representations.
 * @param representationId
 *            the diagram description from which we want to retrieve representations.
 * @return all representations whose target is the specified EObject
 */
protected List<DRepresentationDescriptor> getAssociatedRepresentationByDescriptionAndName(EObject targetRootObject,
        String representationId) {
    return getAssociatedRepresentationByDescriptionAndName(targetRootObject, representationId, false);
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:14,代码来源:M2DocSiriusServices.java


注:本文中的org.eclipse.sirius.viewpoint.DRepresentationDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。