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


Java EditPart.setModel方法代码示例

本文整理汇总了Java中org.eclipse.gef.EditPart.setModel方法的典型用法代码示例。如果您正苦于以下问题:Java EditPart.setModel方法的具体用法?Java EditPart.setModel怎么用?Java EditPart.setModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.gef.EditPart的用法示例。


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

示例1: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
@Override
public EditPart createEditPart(EditPart context, Object model) {
	final EditPart res;

	if (model instanceof PossibleStep) {
		res = new PossibleStepEditPart(withLabel);
	} else if (model instanceof Connection) {
		res = new ConnectionEditPart();
	} else if (model instanceof Choice) {
		res = new ChoiceEditPart();
	} else if (model instanceof Branch) {
		res = new BranchEditPart();
	} else if (model instanceof TimelineWindow) {
		res = new TimelineWindowEditPart();
	} else {
		throw new IllegalStateException("don't know what to do with " + model.getClass().getName());
	}

	res.setModel(model);

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

示例2: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
@Override
public EditPart createEditPart(EditPart context, Object model) {
	EditPart editPart = null;
	if (model instanceof Schema) {
		editPart = new SchemaEditPart();
	} else if (model instanceof Table) {
		editPart = new TableEditPart();
	} else if (model instanceof Column) {
		editPart = new ColumnEditPart();
	} else if (model instanceof Connection) {
		editPart = new ConnectionEditPart();
	}
	if(editPart!=null){			
		editPart.setModel(model);
	}
	return editPart;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:18,代码来源:DbToolEditPartFactory.java

示例3: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
public EditPart createEditPart(EditPart arg0, Object arg1) {
	EditPart part = null;
	if (arg1 instanceof CFGGraph){
		part = new CFGGraphEditPart();
	}
	else if (arg1 instanceof CFGNode){
		part = new CFGNodeEditPart();
	}
	else if (arg1 instanceof CFGEdge){
		part = new CFGEdgeEditPart();	
	}
	else if (arg1 instanceof CFGFlowData){
		part = new FlowDataEditPart();
	}
	else if (arg1 instanceof CFGPartialFlowData){
		part = new PartialFlowDataEditPart();
	}
	else if (arg1 instanceof CFGFlowInfo){
		part = new FlowInfoEditPart();
	}
	else if (arg1 instanceof CFGNodeData){
		part = new NodeDataEditPart();
	}
	part.setModel(arg1);
	return part;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:27,代码来源:CFGPartFactory.java

示例4: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
public EditPart createEditPart(EditPart arg0, Object arg1) {
	EditPart part = null;
	if (arg1 instanceof Graph){
		part = new GraphEditPart();
	}
	else if (arg1 instanceof SimpleNode){
		part = new SimpleNodeEditPart();
	}
	else if (arg1 instanceof Edge){
		part = new EdgeEditPart();	
	}
	else if (arg1 instanceof ComplexNode){
		part = new ComplexNodeEditPart();
	}
	
	part.setModel(arg1);
	return part;
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:19,代码来源:PartFactory.java

示例5: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
/**
 * Creates edit parts for given model.
 */
@Override
public EditPart createEditPart(EditPart context, Object model) {
	// get EditPart for model element
	EditPart part = null;
	if (model instanceof Container) {
		part = new ContainerEditPart();
	}
	else if (model instanceof Component) {
		part = new ComponentEditPart();
	}
	else if (model instanceof Link) {
		part = new LinkEditPart();
	}
	else if (model instanceof Port){
		part = new PortEditPart();
	}
	else if (model instanceof ComponentLabel){
		part = new ComponentLabelEditPart();
	}
	else if (model instanceof CommentBox){
		part = new CommentBoxEditPart();
	}
	else{
		logger.error("Can't create edit part for model element {}", ((model != null) ? model.getClass().getName() : "null"));
		throw new RuntimeException("Can't create edit part for model element: "	+ 
					((model != null) ? model.getClass().getName() : "null"));
	}
	logger.trace("Created edit part for : {}", model.getClass().getName()); 
	// store model element in EditPart
	part.setModel(model);
	return part;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:36,代码来源:ComponentsEditPartFactory.java

示例6: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
public EditPart createEditPart(EditPart context, Object model) {
	EditPart editPart = null;
	if (model instanceof Schema) {
		editPart = new SchemaTreeEditPart();
	} else if (model instanceof Table) {
		editPart = new TableTreeEditPart();
	} else if (model instanceof Column) {
		editPart = new ColumnTreeEditPart();
	}
	if(editPart!=null){			
		editPart.setModel(model);
	}
	return editPart;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:15,代码来源:DbToolTreeEditPartFactory.java

示例7: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
public EditPart createEditPart(EditPart context, Object model) {
	EditPart editPart = null;
	if (model instanceof String) {
		final String s = (String) model;
		return new AbstractGraphicalEditPart() {
			protected IFigure createFigure() {
				return new Label(s);
			}

			protected void createEditPolicies() {
			}
		};
	} else if (model instanceof Graph) {
		editPart = new GraphEditPart(viewer);
	} else if (model instanceof Branch) {
		editPart = new BranchEditPart();
	} else if (model instanceof Path) {
		editPart = new PathEditPart();
	} else if (model instanceof Node) {
		editPart = new RevisionEditPart();
	}
	if (editPart == null)
		throw new RuntimeException("cannot create EditPart for "+model.getClass().getName()+" class");
	else
		editPart.setModel(model);
	return editPart;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:28,代码来源:GraphEditPartFactory.java

示例8: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
@Override
public EditPart createEditPart(EditPart context, Object model) {
	EditPart part = null;
	
	if(model instanceof DwFeatureModelWrapped){
		part = new DwFeatureModelEditorEditPart(editor);
		viewer.getControl().addControlListener((DwFeatureModelEditPart)part);
		viewer.addPropertyChangeListener((DwFeatureModelEditPart)part);
		
		featureModel = (DwFeatureModelWrapped)model;
	}else if(model instanceof DwRootFeatureWrapped){
		part = new DwRootFeatureEditorEditPart(editor, featureModel);
	}else if(model instanceof DwFeatureWrapped){
		part = new DwFeatureEditorEditPart(editor, featureModel);
	}else if(model instanceof DwGroupWrapped){
		part = new DwGroupEditorEditPart(editor, featureModel);
	}else if(model instanceof DwParentChildConnection){
		part = new DwParentChildConnectionEditorEditPart(editor, featureModel);
	}else if(model instanceof HyVersion){
		part = new DwVersionEditorEditPart(editor, featureModel);
	}else if(model instanceof HyFeatureAttribute){
		part = new DwAttributeEditorEditPart(editor, featureModel);
	}else if(model instanceof DwEnumContainerWrapped){
		part = new DwEnumContainerEditPart(editor, featureModel);
	}else if(model instanceof HyEnum){
		part = new DwEnumEditorEditPart(editor, featureModel);			
	}else if(model instanceof HyEnumLiteral){
		part = new DwEnumLiteralEditorEditPart(editor, featureModel);
	}

	if(context != null && model != null && !(model instanceof DwParentChildConnection)){
		part.setParent(context);
	}
	
	if(part != null){
		part.setModel(model);
	}	

	
	return part;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:42,代码来源:DwFeatureModelEditorEditPartFactory.java

示例9: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
@Override
public EditPart createEditPart(EditPart context, Object model) {
	EditPart part = null;
	
	
	if(model instanceof DwFeatureModelWrapped){
		part = new DwFeatureModelEditPart(editor);
		viewer.getControl().addControlListener((DwFeatureModelEditPart)part);
		viewer.addPropertyChangeListener((DwFeatureModelEditPart)part);
		
		featureModel = (DwFeatureModelWrapped)model;
	}else if(model instanceof DwRootFeatureWrapped){
		part = new DwRootFeatureEditPart(editor, featureModel);
	}else if(model instanceof DwFeatureWrapped){
		part = new DwFeatureEditPart(editor, featureModel);
	}else if(model instanceof DwGroupWrapped){
		part = new DwGroupEditPart(editor, featureModel);
	}else if(model instanceof DwParentChildConnection){
		part = new DwParentChildConnectionEditPart(editor, featureModel);
	}else if(model instanceof HyVersion){
		part = new DwVersionEditPart(editor, featureModel);
	}else if(model instanceof HyFeatureAttribute){
		part = new DwAttributeEditPart(editor, featureModel);
	}else if(model instanceof DwEnumContainerWrapped){
		part = new DwEnumContainerEditPart(editor, featureModel);
	}else if(model instanceof HyEnum){
		part = new DwEnumEditPart(editor, featureModel);			
	}else if(model instanceof HyEnumLiteral){
		part = new DwEnumLiteralEditPart(editor, featureModel);
	}


	if(context != null && model != null && !(model instanceof DwParentChildConnection)){
		part.setParent(context);
	}
	if(part != null){
		part.setModel(model);
	}		
	
	return part;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:42,代码来源:DwFeatureModelEditPartFactory.java

示例10: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
@Override
public EditPart createEditPart(EditPart context, Object model) {
	EditPart part = null;
	
	if(model instanceof DwFeatureModelWrapped){
		part = new DwConfiguratorFeatureModelEditPart(editor);
		viewer.getControl().addControlListener((DwConfiguratorFeatureModelEditPart)part);
		viewer.addPropertyChangeListener((DwConfiguratorFeatureModelEditPart)part);
		
		featureModel = (DwFeatureModelWrapped)model;
	}else if(model instanceof DwRootFeatureWrapped){
		part = new DwConfiguratorFeatureEditPart(editor, featureModel);
	}else if(model instanceof DwFeatureWrapped){
		part = new DwConfiguratorFeatureEditPart(editor, featureModel);
	}else if(model instanceof DwGroupWrapped){
		part = new DwGroupEditPart(editor, featureModel);
	}else if(model instanceof DwParentChildConnection){
		part = new DwParentChildConnectionEditPart(editor, featureModel);
	}else if(model instanceof HyVersion){
		part = new DwConfiguratorVersionEditPart(editor, featureModel);
	}else if(model instanceof HyFeatureAttribute){
		part = new DwConfiguratorAttributeEditPart(editor, featureModel);
	}else if(model instanceof HyEnum){
		part = new DwEnumEditPart(editor, featureModel);
	}else if(model instanceof DwEnumContainerWrapped){
		part = new DwEnumContainerEditPart(editor, featureModel);
	}else if(model instanceof HyEnum){
		part = new DwEnumEditPart(editor, featureModel);			
	}else if(model instanceof HyEnumLiteral){
		part = new DwEnumLiteralEditPart(editor, featureModel);
	}

	if(context != null && model != null && !(model instanceof DwParentChildConnection)){
		part.setParent(context);
	}
	if(part != null){
		part.setModel(model);
	}		
	
	return part;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:42,代码来源:DwConfiguratorEditPartFactory.java

示例11: createEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
@Override
public EditPart createEditPart(EditPart context, Object model) {
	EditPart part = null;
	
	if(model instanceof DwFeatureModelWrapped){
		part = new DwConfiguratorEditorFeatureModelEditPart(editor);
		viewer.getControl().addControlListener((DwConfiguratorEditorFeatureModelEditPart)part);
		viewer.addPropertyChangeListener((DwConfiguratorEditorFeatureModelEditPart)part);
		
		featureModel = (DwFeatureModelWrapped)model;
	}else if(model instanceof DwRootFeatureWrapped){
		part = new DwConfiguratorEditorFeatureEditPart(editor, featureModel);
	}else if(model instanceof DwFeatureWrapped){
		part = new DwConfiguratorEditorFeatureEditPart(editor, featureModel);
	}else if(model instanceof DwGroupWrapped){
		part = new DwGroupEditPart(editor, featureModel);
	}else if(model instanceof DwParentChildConnection){
		part = new DwParentChildConnectionEditPart(editor, featureModel);
	}else if(model instanceof HyVersion){
		part = new DwConfiguratorEditorVersionEditPart(editor, featureModel);
	}else if(model instanceof HyFeatureAttribute){
		part = new DwConfiguratorEditorAttributeEditPart(editor, featureModel);
	}else if(model instanceof HyEnum){
		part = new DwEnumEditPart(editor, featureModel);
	}else if(model instanceof DwEnumContainerWrapped){
		part = new DwEnumContainerEditPart(editor, featureModel);
	}else if(model instanceof HyEnum){
		part = new DwEnumEditPart(editor, featureModel);			
	}else if(model instanceof HyEnumLiteral){
		part = new DwEnumLiteralEditPart(editor, featureModel);
	}

	if(context != null && model != null && !(model instanceof DwParentChildConnection)){
		part.setParent(context);
	}
	if(part != null){
		part.setModel(model);
	}		
	
	return part;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:42,代码来源:DwConfiguratorEditorEditPartFactory.java


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