當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。