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


Java Shape类代码示例

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


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

示例1: testDeleteClass

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
@Test
public void testDeleteClass() throws Exception {
    URI sourceModelURI = createResourceModelURI(TestEnvironmentConstants.TEST_PLUGIN_ID, "ClassDiagramSingleClass.notation");
    URI umlModelURI = createResourceModelURI(TestEnvironmentConstants.TEST_PLUGIN_ID, "ClassDiagramSingleClass.uml");

    // first transformation
    Trace transformationTrace = new Trace(Collections.emptyList());
    ModelExtent transformationResult = runTransformation(TRANSFORMATION_URI, sourceModelURI, umlModelURI,
            transformationTrace);

    // delete class from graphical model
    Resource notationResource = getResourceSet().getResource(sourceModelURI, false);
    Shape umlClassShape = ((Shape) ((Diagram) notationResource.getContents().get(0)).getChildren().get(0));
    org.eclipse.uml2.uml.Class umlClass = (org.eclipse.uml2.uml.Class) umlClassShape.getElement();
    EcoreUtil.remove(umlClassShape);
    EcoreUtil.remove(umlClass);
    ClassDiagram textualDiagram = (ClassDiagram) transformationResult.getContents().get(0);
    textualDiagram.getRootPackage().getClassifiers().get(0)
            .eUnset(TextualCommonsPackage.Literals.UML_REFERENCING_ELEMENT__REFERENCED_ELEMENT);

    // second transformation (incremental)
    transformationResult = runTransformation(TRANSFORMATION_URI, sourceModelURI, umlModelURI, transformationResult,
            transformationTrace);

    assertEquals(0, textualDiagram.getRootPackage().getClassifiers().size());
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:27,代码来源:GraphicalToTextualClassTest.java

示例2: colorDiagramElement

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
public static void colorDiagramElement(View diagramView, int color, int fontColor) throws MMINTException {

		if (!(diagramView instanceof Shape) && !(diagramView instanceof Connector)) {
			throw new MMINTException("Diagram element not supported: " + diagramView.getClass().getName());
		}

		if (diagramView instanceof Shape) {
			Shape node = (Shape) diagramView;
			node.setFillColor(color);
			node.setLineColor(color);
			node.setFontColor(fontColor);
		}
		else if (diagramView instanceof Connector) {
			Connector edge = (Connector) diagramView;
			edge.setLineColor(color);
			FontStyle labelFont = (FontStyle) edge.getStyles().get(0);
			labelFont.setFontColor(fontColor);
		}
	}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:20,代码来源:GMFUtils.java

示例3: caseShape

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Object caseShape(Shape object) {
    if (object.getType() == "Comment_Shape" || object.getType() == "Association_Shape") {
        if (!Stream
                .concat((Stream<EObject>) object.getSourceEdges().stream(),
                        (Stream<EObject>) object.getTargetEdges().stream())
                .allMatch(elementDeleter::testRegisterChangeIfNecessary)) {
            return true;
        }
    }
    return processObject(object);
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:14,代码来源:NotationPostProcessingSwitch.java

示例4: validateCooperateModel

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
@Override
protected boolean validateCooperateModel(IValidationContext ctx, Shape target) {
    IDiagramType diagramType = DiagramTypeRegistry.getInstance()
            .getByDiagramTypeDeprecated(DiagramTypesDeprecated.USECASE).get();
    if (!diagramType.getPapyrusDiagramType().equals(target.getDiagram().getType())) {
        return true;
    }

    if (!RELEVANT_SHAPE_TYPE.equals(target.getType())) {
        return true;
    }

    return target.getElement() instanceof Component;
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:15,代码来源:UseCaseSystemMustBeOfTypeComponent.java

示例5: createRole_3001

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
 * @generated
 */
public Node createRole_3001(EObject domainElement, View containerView,
		int index, boolean persisted, PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(SmcVisualIDRegistry.getType(RoleEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint
			.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(
			prefStore, IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE
			.getLineStyle_LineColor(), FigureUtilities
			.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node
			.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore,
				IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter
				.getColor(prefStore, IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB)
				.intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(
			prefStore, IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE
			.getFillStyle_FillColor(), FigureUtilities
			.RGBToInteger(fillRGB));
	Node label5001 = createLabel(node, SmcVisualIDRegistry
			.getType(WrappingLabel2EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:43,代码来源:SmcViewProvider.java

示例6: findByName

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
public static EditPart findByName(final EditPart theParent, final String theName) {
    for (final Object o : theParent.getChildren()) {
        final EditPart editPart = (EditPart) o;
        if (ObjectUtils.equals(theName, UMLExt.getName(((Shape) editPart.getModel()).getElement()))) {
            return editPart;
        }
    }
    return null;
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:10,代码来源:PapyrusUtils.java

示例7: findByElement

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
public static EditPart findByElement(final EditPart theParent, final EObject theElement) {
    for (final Object o : theParent.getChildren()) {
        final EditPart editPart = (EditPart) o;
        if (ObjectUtils.equals(theElement, ((Shape) editPart.getModel()).getElement())) {
            return editPart;
        }
    }
    return null;
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:10,代码来源:PapyrusUtils.java

示例8: createSoftGoal_2001

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createSoftGoal_2001(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.SoftGoalEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5001 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.SoftGoalNameEditPart.VISUAL_ID));
	Node label5002 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabelEditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:43,代码来源:IStar_MAVOViewProvider.java

示例9: createTask_2002

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createTask_2002(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.TaskEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5003 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.TaskNameEditPart.VISUAL_ID));
	Node label5004 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabel2EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:43,代码来源:IStar_MAVOViewProvider.java

示例10: createResource_2003

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createResource_2003(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.ResourceEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5005 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.ResourceNameEditPart.VISUAL_ID));
	Node label5006 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabel3EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:43,代码来源:IStar_MAVOViewProvider.java

示例11: createGoal_2004

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createGoal_2004(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.GoalEditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	stampShortcut(containerView, node);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5007 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.GoalNameEditPart.VISUAL_ID));
	Node label5008 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabel4EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:43,代码来源:IStar_MAVOViewProvider.java

示例12: createSoftGoal_3001

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createSoftGoal_3001(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.SoftGoal2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5009 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.SoftGoalName2EditPart.VISUAL_ID));
	Node label5010 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabel6EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:42,代码来源:IStar_MAVOViewProvider.java

示例13: createTask_3002

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createTask_3002(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.Task2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5011 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.TaskName2EditPart.VISUAL_ID));
	Node label5012 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabel7EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:42,代码来源:IStar_MAVOViewProvider.java

示例14: createResource_3003

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createResource_3003(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.Resource2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5013 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.ResourceName2EditPart.VISUAL_ID));
	Node label5014 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabel8EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:42,代码来源:IStar_MAVOViewProvider.java

示例15: createGoal_3004

import org.eclipse.gmf.runtime.notation.Shape; //导入依赖的package包/类
/**
* @generated
*/
public Node createGoal_3004(EObject domainElement, View containerView, int index, boolean persisted,
		PreferencesHint preferencesHint) {
	Shape node = NotationFactory.eINSTANCE.createShape();
	node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
	node.setType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry
			.getType(edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.Goal2EditPart.VISUAL_ID));
	ViewUtil.insertChildView(containerView, node, index, persisted);
	node.setElement(domainElement);
	// initializeFromPreferences 
	final IPreferenceStore prefStore = (IPreferenceStore) preferencesHint.getPreferenceStore();

	org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_LINE_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getLineStyle_LineColor(),
			FigureUtilities.RGBToInteger(lineRGB));
	FontStyle nodeFontStyle = (FontStyle) node.getStyle(NotationPackage.Literals.FONT_STYLE);
	if (nodeFontStyle != null) {
		FontData fontData = PreferenceConverter.getFontData(prefStore, IPreferenceConstants.PREF_DEFAULT_FONT);
		nodeFontStyle.setFontName(fontData.getName());
		nodeFontStyle.setFontHeight(fontData.getHeight());
		nodeFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
		nodeFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
		org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(prefStore,
				IPreferenceConstants.PREF_FONT_COLOR);
		nodeFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
	}
	org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(prefStore,
			IPreferenceConstants.PREF_FILL_COLOR);
	ViewUtil.setStructuralFeatureValue(node, NotationPackage.eINSTANCE.getFillStyle_FillColor(),
			FigureUtilities.RGBToInteger(fillRGB));
	Node label5015 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.GoalName2EditPart.VISUAL_ID));
	Node label5016 = createLabel(node,
			edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVOVisualIDRegistry.getType(
					edu.toronto.cs.se.modelepedia.istar_mavo.diagram.edit.parts.WrappingLabel9EditPart.VISUAL_ID));
	return node;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:42,代码来源:IStar_MAVOViewProvider.java


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