本文整理汇总了Java中org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart.getSourceConnections方法的典型用法代码示例。如果您正苦于以下问题:Java ShapeNodeEditPart.getSourceConnections方法的具体用法?Java ShapeNodeEditPart.getSourceConnections怎么用?Java ShapeNodeEditPart.getSourceConnections使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart
的用法示例。
在下文中一共展示了ShapeNodeEditPart.getSourceConnections方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectEditpartsToShow
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; //导入方法依赖的package包/类
/**
* Add the children to show to the map.
*
* @param editPart the parent node.
*/
private void collectEditpartsToShow(ShapeNodeEditPart editPart) {
for (Object link : editPart.getSourceConnections()) {
ConnectionNodeEditPart dLink = (ConnectionNodeEditPart) link;
if (!dLink.getFigure().isVisible()) {
// checks descendants.
collectEditpartsToShow((ShapeNodeEditPart) (dLink.getTarget()));
changeVisibleEditPartSet.add(dLink);
}
}
if (((DcaseDelegateNodeEditPart) editPart).getBackgroundColorEx() == CONST_HIDE_COLOR) {
changeBackgroundColorEditPartMap.put(
(DcaseDelegateNodeEditPart) editPart, CONST_SHOW_COLOR);
}
// doesn't add the selected node to the map.
if (editPart != selectedElement) {
changeVisibleEditPartSet.add(editPart);
}
}
示例2: getTargetEditPart
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; //导入方法依赖的package包/类
/**
* Returns the list of the children of the selected node.
*
* @param selectedElement the selected node.
* @return the list of the children of the selected node.
*/
@SuppressWarnings("unchecked")
private List<ConnectionNodeEditPart> getTargetEditPart(
ShapeNodeEditPart selectedElement) {
List<ConnectionNodeEditPart> targetLinks = new ArrayList<ConnectionNodeEditPart>();
// gets links.
List<ConnectionNodeEditPart> sourceLinks = selectedElement
.getSourceConnections();
for (ConnectionNodeEditPart editPart : sourceLinks) {
if (DcaseEditorUtil.isDcaseLinkEditPart(editPart)) {
targetLinks.add(editPart);
}
}
return targetLinks;
}
示例3: getHideNodeChildren
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; //导入方法依赖的package包/类
/**
* Add the children to hide to the map.
* Throws exception if the looped link,the conjunction or the link besides D-Case links is detected.
*
* @param editPart the parent node.
*/
private void getHideNodeChildren(ShapeNodeEditPart editPart) {
String uuid = DcaseEditorUtil.getUUIDs(editPart);
// adds to the history.
cyclicRoute.add(uuid);
// checks the conjunction.
if (selectedElement != editPart) {
checkJunctionLink(editPart);
}
// checks the looped link.
if (!checkedNodeList.contains(uuid)) {
checkedNodeList.add(uuid);
} else {
MessageWriter.writeMessageToConsole(NLS.bind(
"Cyclic state was found.({0})", cyclicRoute.toString()), //$NON-NLS-1$
MessageTypeImpl.DIAGNOSIS);
throw new DcaseRuntimeException(Messages.NodeChildrenHideHandler_0,
null, null, 0, MessageTypeImpl.HIDE_CHILDREN_HIDE_FAILED);
}
for (Object link : editPart.getSourceConnections()) {
// throws exception if the link besides the D-Case links is detected.
if (!DcaseEditorUtil.isDcaseLinkEditPart(link)) {
throw new DcaseRuntimeException(
Messages.NodeChildrenHideHandler_3, null, null, 0,
MessageTypeImpl.HIDE_CHILDREN_HIDE_FAILED);
}
ConnectionNodeEditPart dLink = (ConnectionNodeEditPart) link;
if (dLink.getFigure().isVisible()) {
// checks descendants.
getHideNodeChildren((ShapeNodeEditPart) (dLink.getTarget()));
changeVisibleEditPartSet.add(dLink);
}
}
// doesn't add the selected node to the map.
if (selectedElement != editPart) {
changeVisibleEditPartSet.add(editPart);
}
cyclicRoute.removeLast();
}