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