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


Java EditPart.getChildren方法代码示例

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


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

示例1: checkWatcher

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
/**
 * Return true if watch point enable otherwise false
 *
 * @return boolean
 */
public boolean checkWatcher(Component selectedComponent, String portName) {
	ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getActiveEditor();
	GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor).getAdapter(GraphicalViewer.class);

	for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();) {
		EditPart editPart = iterator.next();
		if (editPart instanceof ComponentEditPart) {
			Component comp = ((ComponentEditPart) editPart).getCastedModel();
			if (comp.equals(selectedComponent)) {
				List<PortEditPart> portEditParts = editPart.getChildren();
				for (AbstractGraphicalEditPart part : portEditParts) {
					if (part instanceof PortEditPart) {
						String port_Name = ((PortEditPart) part).getCastedModel().getTerminal();
						if (port_Name.equals(portName)) {
							return ((PortEditPart) part).getPortFigure().isWatched();
						}
					}
				}
			}
		}
	}
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:30,代码来源:ViewDataUtils.java

示例2: removeWatch

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
private void removeWatch(Port sourcePort, Component sourceComponent){
	ELTGraphicalEditor editor=(ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
	GraphicalViewer	graphicalViewer =(GraphicalViewer) ((GraphicalEditor)editor).getAdapter(GraphicalViewer.class);
	for (Object objectEditPart : graphicalViewer.getEditPartRegistry().values()) 
	{
		EditPart editPart = (EditPart) objectEditPart;
		if(editPart instanceof ComponentEditPart) 
		{
			Component comp = ((ComponentEditPart)editPart).getCastedModel();
			if(comp.equals(sourceComponent)){
				List<PortEditPart> portEditParts = editPart.getChildren();
				for(AbstractGraphicalEditPart part:portEditParts)
				{
					if(part instanceof PortEditPart){
						if(((PortEditPart)part).getCastedModel().getTerminal().equals(sourcePort.getTerminal())){
							((PortEditPart)part).getPortFigure().removeWatcherColor();
							((PortEditPart)part).getPortFigure().setWatched(false);
						} 
					}
				}
			}
		} 
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:ComponentDeleteCommand.java

示例3: removeWatch

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
private void removeWatch(Port sourcePort, Component sourceComponent){
	ELTGraphicalEditor editor=(ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
	GraphicalViewer	graphicalViewer =(GraphicalViewer) ((GraphicalEditor)editor).getAdapter(GraphicalViewer.class);
	for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();)
	{
		EditPart editPart = (EditPart) iterator.next();
		if(editPart instanceof ComponentEditPart) 
		{
			Component comp = ((ComponentEditPart)editPart).getCastedModel();
			if(comp.equals(sourceComponent)){
				List<PortEditPart> portEditParts = editPart.getChildren();
				for(AbstractGraphicalEditPart part:portEditParts)
				{
					if(part instanceof PortEditPart){
						if(((PortEditPart)part).getCastedModel().getTerminal().equals(sourcePort.getTerminal())){
							((PortEditPart)part).getPortFigure().removeWatcherColor();
							((PortEditPart)part).getPortFigure().setWatched(false);
						} 
					}
				}
			}
		} 
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:LinkDeleteCommand.java

示例4: checkWatcher

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
/**
 * This function returns that watcher is added on selected port
 *
 */
public boolean checkWatcher(Component selectedComponent, String portName) {
	EditPart editPart = (EditPart) selectedComponent.getComponentEditPart();
	List<PortEditPart> portEdit = editPart.getChildren();
	for(AbstractGraphicalEditPart part : portEdit){
		if(part instanceof PortEditPart){
			String portLabel = ((PortEditPart) part).getCastedModel().getTerminal();
			if(portLabel.equals(portName)){
				return  ((PortEditPart) part).getPortFigure().isWatched();
			}
		}
	}
				
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:19,代码来源:DebugHelper.java

示例5: checkWatcher

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
private boolean checkWatcher(Component selectedComponent, String portName) {
	ELTGraphicalEditor editor = (ELTGraphicalEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			.getActiveEditor();
	IPath path = new Path(editor.getTitleToolTip());
	String currentJob = path.lastSegment().replace(Constants.JOB_EXTENSION, "");
	watchRecordInner.setCurrentJob(currentJob);
	GraphicalViewer graphicalViewer = (GraphicalViewer) ((GraphicalEditor) editor).getAdapter(GraphicalViewer.class);
	String uniqueJobId = editor.getJobId();
	watchRecordInner.setUniqueJobId(uniqueJobId);

	for (Iterator<EditPart> iterator = graphicalViewer.getEditPartRegistry().values().iterator(); iterator.hasNext();) {
		EditPart editPart = (EditPart) iterator.next();
		if (editPart instanceof ComponentEditPart) {
			Component comp = ((ComponentEditPart) editPart).getCastedModel();
			if (comp.equals(selectedComponent)) {
				List<PortEditPart> portEditParts = editPart.getChildren();
				for (AbstractGraphicalEditPart part : portEditParts) {
					if (part instanceof PortEditPart) {
						String port_Name = ((PortEditPart) part).getCastedModel().getTerminal();
						if (port_Name.equals(portName)) {
							return ((PortEditPart) part).getPortFigure().isWatched();
						}
					}
				}
			}
		}
	}
	return false;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:30,代码来源:WatchRecordAction.java

示例6: changePortColor

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
private void changePortColor(Component selectedComponent, String portName){
	EditPart editPart = (EditPart) selectedComponent.getComponentEditPart();
	List<PortEditPart> portEdit = editPart.getChildren();
	for(AbstractGraphicalEditPart part : portEdit){
		if(part instanceof PortEditPart && ((PortEditPart)part).getCastedModel().getTerminal().equals(portName)){
				((PortEditPart)part).getPortFigure().changeWatcherColor();
				((PortEditPart)part).getCastedModel().setWatched(true);
				((PortEditPart)part).getPortFigure().setWatched(true);
				((PortEditPart)part).getPortFigure().repaint();
		}
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:13,代码来源:AddWatcherAction.java

示例7: changePortColor

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
private void changePortColor(Component selectedComponent, String portName){
	EditPart editPart = (EditPart) selectedComponent.getComponentEditPart();
	List<PortEditPart> portEdit = editPart.getChildren();
	for(AbstractGraphicalEditPart part : portEdit){
		if(part instanceof PortEditPart && ((PortEditPart)part).getCastedModel().getTerminal().equals(portName)){
				((PortEditPart)part).getPortFigure().removeWatcherColor();
				((PortEditPart)part).getPortFigure().setWatched(false);
				((PortEditPart)part).getCastedModel().setWatched(false);
		}
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:RemoveWatcherAction.java


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