• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GraphicalEditPart类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setCompositeStateLayoutConstraint

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * Iterates through all {@link StateEditPart}s of the current selection and
 * computes layout constraints for the composite node.
 * 
 * @param compositeStateNode
 *            node of the composite state
 */
protected void setCompositeStateLayoutConstraint(Node compositeStateNode) {

	Rectangle newbounds = null;
	
	for (GraphicalEditPart editPart : getContextObjects()) {
		Rectangle childBounds = editPart.getFigure().getBounds();
		if (newbounds == null)
			newbounds = childBounds.getCopy();
		
		newbounds.union(childBounds);
	}
	newbounds.expand(new Insets(PADDING, PADDING, PADDING, PADDING));

	Bounds bounds = NotationFactory.eINSTANCE.createBounds();
	bounds.setX(newbounds.x);
	bounds.setY(newbounds.y);
	bounds.setWidth(newbounds.width);
	bounds.setHeight(newbounds.height);
	compositeStateNode.setLayoutConstraint(bounds);
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:28,代码来源:GroupStatesIntoCompositeRefactoring.java


示例2: hideConnectionLabelsForEditParts

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * Hides the labels on the connections of the given elements
 * 
 * @param elements
 *            - The EditParts which's connection labels is to be hidden
 * @param excluding
 *            - The types of connection labels which are not wanted to be
 *            hidden
 */
public static void hideConnectionLabelsForEditParts(List<GraphicalEditPart> elements,
		List<java.lang.Class<?>> excluding) {
	for (EditPart editpart : elements) {
		GraphicalEditPart ep = ((GraphicalEditPart) editpart);
		@SuppressWarnings("unchecked")
		List<ConnectionNodeEditPart> connections = ep.getSourceConnections();
		for (ConnectionNodeEditPart connection : connections) {
			@SuppressWarnings("unchecked")
			List<ConnectionNodeEditPart> labels = connection.getChildren();
			for (EditPart label : labels) {
				if (!isInstanceOfAny(label, excluding)) {
					ShowHideLabelsRequest request = new ShowHideLabelsRequest(false, ((View) label.getModel()));
					Command com = connection.getCommand(request);
					if (com != null && com.canExecute())
						com.execute();
				}
			}

		}
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:31,代码来源:DiagramElementsModifier.java


示例3: arrangeChildren

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
@Override
protected void arrangeChildren(GraphicalEditPart state, IProgressMonitor monitor) throws ArrangeException{
	assert state instanceof RoundedCompartmentEditPart;
	boolean isCompositeState = false;
	
	RegionCompartmentEditPart regionCompartement = getRegionCompatementEditPart((RoundedCompartmentEditPart)state);
	
	if(regionCompartement != null){
		@SuppressWarnings("unchecked")
		List<GraphicalEditPart> editparts = regionCompartement.getChildren();
		for(GraphicalEditPart ep : editparts){
			if(isValidStateClass(ep)){
				isCompositeState = true;
				this.arrangeChildren(ep, monitor);
			}
		}

		if(isCompositeState){
			super.arrangeChildren(regionCompartement, monitor);
			Dimension d = calculatePreferredSize(editparts);
			DiagramElementsModifier.resizeGraphicalEditPart(state, d.width, d.height);
		}
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:25,代码来源:StateMachineDiagramElementsTxtUmlArranger.java


示例4: calculatePreferredSize

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
private Dimension calculatePreferredSize(List<? extends GraphicalEditPart> editparts){
	
	FreeFormLayoutEx manager = (FreeFormLayoutEx) editparts.get(0).getFigure().getParent().getLayoutManager();
	
	Point topLeft = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
	Point bottomRight = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);
	
	for(GraphicalEditPart ep : editparts){
		Rectangle constraint = (Rectangle) manager.getConstraint(ep.getFigure());
		Dimension preferredSize = ep.getFigure().getPreferredSize();
		constraint.width = constraint.width < preferredSize.width ? preferredSize.width : constraint.width;
		constraint.height = constraint.height < preferredSize.height ? preferredSize.height : constraint.height;
				
		topLeft.x = constraint.x < topLeft.x ? constraint.x : topLeft.x;
		topLeft.y = constraint.y < topLeft.y ? constraint.y : topLeft.y;
		
		bottomRight.x = constraint.getBottomRight().x > bottomRight.x ? constraint.getBottomRight().x : bottomRight.x;
		bottomRight.y = constraint.getBottomRight().y > bottomRight.y ? constraint.getBottomRight().y : bottomRight.y;
	}
	
	return new Dimension(bottomRight.x-topLeft.x, bottomRight.y-topLeft.y);
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:23,代码来源:StateMachineDiagramElementsTxtUmlArranger.java


示例5: createObjectRectangleMappingFromObjectsAndEditParts

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
private Map<GraphicalEditPart, hu.elte.txtuml.utils.diagrams.Rectangle> createObjectRectangleMappingFromObjectsAndEditParts(Set<RectangleObject> objects,
		List<GraphicalEditPart> editParts) {
	Map<GraphicalEditPart, hu.elte.txtuml.utils.diagrams.Rectangle> result = new HashMap<>();
	for(RectangleObject obj : objects){
		Optional<Element> e = txtUmlRegistry.findElement(obj.getName());
		if(e.isPresent()){
			GraphicalEditPart ep = (GraphicalEditPart) getEditPartOfModelElement(editParts, e.get());
			if(ep != null){
				hu.elte.txtuml.utils.diagrams.Rectangle rect =  new hu.elte.txtuml.utils.diagrams.Rectangle(obj.getPosition().getX(), obj.getPosition().getY(),
												obj.getPixelWidth(), obj.getPixelHeight());
				result.put(ep, rect);
			}
		}
	}
	return result;
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:17,代码来源:AbstractDiagramElementsTxtUmlArranger.java


示例6: modifyConnectionEditParts

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
private void modifyConnectionEditParts(
		Map<ConnectionNodeEditPart, List<hu.elte.txtuml.utils.diagrams.Point>> linksTransform,
		Map<GraphicalEditPart, hu.elte.txtuml.utils.diagrams.Rectangle> objectTransform) {
	linksTransform.forEach((ConnectionNodeEditPart connection, List<hu.elte.txtuml.utils.diagrams.Point> route)  ->{
				if(connection != null && route.size() >= 2){
					hu.elte.txtuml.utils.diagrams.Rectangle source = objectTransform.get(connection.getSource());
					hu.elte.txtuml.utils.diagrams.Rectangle target = objectTransform.get(connection.getTarget());

		        	String anchor_start = getAnchor(source.getTopLeft(), route.get(0), source.width(), source.height());
		        	String anchor_end = getAnchor(target.getTopLeft(), route.get(route.size()-1), target.width(), target.height());

		        	DiagramElementsModifier.setConnectionAnchors(connection, anchor_start, anchor_end);
		        	List<Point> gmfRoute = route.stream().map(p -> new Point(p.x(), p.y())).collect(Collectors.toList());
		        	DiagramElementsModifier.setConnectionPoints(connection, gmfRoute);
				}
	});
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:18,代码来源:AbstractDiagramElementsTxtUmlArranger.java


示例7: calculatePreferredSize

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
private Dimension calculatePreferredSize(List<? extends GraphicalEditPart> editparts){
	
	FreeFormLayoutEx manager = (FreeFormLayoutEx) editparts.get(0).getFigure().getParent().getLayoutManager();
	
	Point topLeft = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
	Point bottomRight = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE);
	
	for(GraphicalEditPart ep : editparts){
		Rectangle constraint = (Rectangle) manager.getConstraint(ep.getFigure());
		Dimension preferredSize = ep.getFigure().getPreferredSize();
		constraint.width = constraint.width < preferredSize.width ? preferredSize.width : constraint.width;
		constraint.height = constraint.height < preferredSize.height ? preferredSize.height : constraint.height;
				
		topLeft.x = constraint.x < topLeft.x ? constraint.x : topLeft.x;
		topLeft.y = constraint.y < topLeft.y ? constraint.y : topLeft.y;
		
		bottomRight.x = constraint.getBottomRight().x > bottomRight.x ? constraint.getBottomRight().x : bottomRight.x;
		bottomRight.y = constraint.getBottomRight().y > bottomRight.y ? constraint.getBottomRight().y : bottomRight.y;
	}
	
	return new Dimension(bottomRight.x, bottomRight.y);
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:23,代码来源:CompositeDiagramElementsTxtUmlArranger.java


示例8: arrange_and_resize_recursively

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * Calls an {@link AbstractDiagramElementsGmfArranger#autoresizeGraphicalEditPart(GraphicalEditPart) autosize}
 * and {@link AbstractDiagramElementsGmfArranger#arrangeChildren(EditPart) arrangeChildren} 
 * on the given statemachine.
 * The method is called recursively for all children which are {@link StateEditPart}s
 * @param stateEP - The StateEditPart
 */
private void arrange_and_resize_recursively(GraphicalEditPart stateEP) {
	@SuppressWarnings("unchecked")
	List<GraphicalEditPart> stateCompartements = stateEP.getChildren();

	@SuppressWarnings("unchecked")
	List<GraphicalEditPart> regions =  ((EditPart) stateCompartements.get(1)).getChildren();
	
	for(GraphicalEditPart region: regions){		
		GraphicalEditPart regioncompartement = (GraphicalEditPart) region.getChildren().get(0);
		@SuppressWarnings("unchecked")
		List<EditPart> listEp = regioncompartement.getChildren();
		
		for(EditPart Ep : listEp){
			if(Ep instanceof StateEditPart){
				arrange_and_resize_recursively((StateEditPart) Ep);				
			}
		}
		super.autoresizeGraphicalEditPart(stateEP);
		super.arrangeChildren(regioncompartement);
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:29,代码来源:StateMachineDiagramElementsGmfArranger.java


示例9: arrange_recurively

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * Calls an {@link AbstractDiagramElementsGmfArranger#arrangeChildren(EditPart) arrangeChildren}
 *  and a hideConnectionLabels on the children of the given GraphicalEditPart
 * @param stateEP - The GraphicalEditPart
 */
private void arrange_recurively(GraphicalEditPart stateEP) {
	@SuppressWarnings("unchecked")
	List<GraphicalEditPart> stateCompartements = stateEP.getChildren();

	@SuppressWarnings("unchecked")
	List<GraphicalEditPart> regions =  ((EditPart) stateCompartements.get(1)).getChildren();
	
	for(GraphicalEditPart region: regions){		
		GraphicalEditPart regioncompartement = (GraphicalEditPart) region.getChildren().get(0);
		@SuppressWarnings("unchecked")
		List<GraphicalEditPart> listEp = regioncompartement.getChildren();
		
		for(GraphicalEditPart Ep : listEp){
			if(Ep instanceof StateEditPart){
				arrange_recurively(Ep);				
			}
		}
		super.arrangeChildren(regioncompartement);
		DiagramElementsModifier.hideConnectionLabelsForEditParts(listEp, Arrays.asList(CustomTransitionGuardEditPart.class));	
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:27,代码来源:StateMachineDiagramElementsGmfArranger.java


示例10: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * @generated
 */
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget
			.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart
			|| editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof SimpleBPMN.diagram.part.SimpleBPMNDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(
					decoratorTarget));
		}
	}
}
 
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:26,代码来源:SimpleBPMNValidationDecoratorProvider.java


示例11: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed)
				.getEditorPart() instanceof edu.toronto.cs.se.modelepedia.icse15_sequencediagram_mavo.diagram.part.ICSE15_SequenceDiagram_MAVODiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:24,代码来源:ICSE15_SequenceDiagram_MAVOValidationDecoratorProvider.java


示例12: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * @generated
 */
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget
			.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart
			|| editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof edu.toronto.cs.se.modelepedia.necsis14_classdiagram.diagram.part.NECSIS14_ClassDiagramDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(
					decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:26,代码来源:NECSIS14_ClassDiagramValidationDecoratorProvider.java


示例13: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * @generated
 */
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget
			.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart
			|| editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof edu.toronto.cs.se.modelepedia.necsis14_databaseschema.diagram.part.NECSIS14_DatabaseSchemaDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(
					decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:26,代码来源:NECSIS14_DatabaseSchemaValidationDecoratorProvider.java


示例14: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * @generated
 */
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof MIDDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:23,代码来源:MIDValidationDecoratorProvider.java


示例15: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof MIDDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:23,代码来源:MIDValidationDecoratorProvider.java


示例16: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed)
				.getEditorPart() instanceof edu.toronto.cs.se.modelepedia.relationaldatabase_mavo.diagram.part.RelationalDatabase_MAVODiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:24,代码来源:RelationalDatabase_MAVOValidationDecoratorProvider.java


示例17: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * @generated
 */
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget
			.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart
			|| editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof RelationalDatabaseDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(
					decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:26,代码来源:RelationalDatabaseValidationDecoratorProvider.java


示例18: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed)
				.getEditorPart() instanceof edu.toronto.cs.se.modelepedia.istar_mavo.diagram.part.IStar_MAVODiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:24,代码来源:IStar_MAVOValidationDecoratorProvider.java


示例19: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * @generated
 */
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget
			.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart
			|| editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof IStarDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(
					decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:26,代码来源:IStarValidationDecoratorProvider.java


示例20: createDecorators

import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; //导入依赖的package包/类
/**
 * @generated
 */
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget
			.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart
			|| editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof StateMachineDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(
					decoratorTarget));
		}
	}
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:26,代码来源:StateMachineValidationDecoratorProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataNodeFaultInjector类代码示例发布时间:2022-05-22
下一篇:
Java SingleTermsEnum类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap