本文整理汇总了Java中org.eclipse.draw2d.ConnectionLayer.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionLayer.getChildren方法的具体用法?Java ConnectionLayer.getChildren怎么用?Java ConnectionLayer.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.ConnectionLayer
的用法示例。
在下文中一共展示了ConnectionLayer.getChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIncomingConnections
import org.eclipse.draw2d.ConnectionLayer; //导入方法依赖的package包/类
/**
* Returns incoming connection figures of the figure parameter.
*
* @param connectionLayer
* @param figure
* @return
*/
public static List<Connection> getIncomingConnections(
ConnectionLayer connectionLayer, IFigure figure) {
final List<Connection> incomingConnectionList = new ArrayList<Connection>();
for (final Object object : connectionLayer.getChildren()) {
if (object instanceof Connection) {
final Connection connection = (Connection) object;
if (connection.getTargetAnchor().getOwner() == figure) {
incomingConnectionList.add(connection);
}
}
}
return incomingConnectionList;
}
示例2: getOutgoingConnections
import org.eclipse.draw2d.ConnectionLayer; //导入方法依赖的package包/类
/**
* Returns outgoing connection figures of the figure parameter.
*
* @param connectionLayer
* @param figure
* @return
*/
public static List<Connection> getOutgoingConnections(
ConnectionLayer connectionLayer, IFigure figure) {
final List<Connection> outgoingConnectionList = new ArrayList<Connection>();
for (final Object object : connectionLayer.getChildren()) {
if (object instanceof Connection) {
final Connection connection = (Connection) object;
if (connection.getSourceAnchor().getOwner() == figure) {
outgoingConnectionList.add(connection);
}
}
}
return outgoingConnectionList;
}