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


Java EditPartViewer.Conditional方法代码示例

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


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

示例1: getTargetingConditional

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
 * @see org.eclipse.gef.tools.SelectionTool#getTargetingConditional()
 */
@Override
protected Conditional getTargetingConditional() {
    return new EditPartViewer.Conditional() {
        public boolean evaluate(EditPart editpart) {
            if(editpart instanceof LifeLineEditPart) {
                if(getLocation().y >= FigureConstant.FIGURE_LIFELINE_TOP_MARGIN + FigureConstant.FIGURE_LIFELINE_HEAD_HEIGHT) {
                    Rectangle bounds = ((LifeLineEditPart) editpart).getFigure().getBounds();
                    if(bounds.x + bounds.width/2 - LineEditPart.LINE_SELECTABLE_WIDTH/2 <= getLocation().x
                        && bounds.x + bounds.width/2 + LineEditPart.LINE_SELECTABLE_WIDTH/2 >= getLocation().x) {
                        return editpart.isSelectable();  
                    } else {
                        return false;                            
                    }
                } else {
                    return editpart.isSelectable();                                   
                }         
            } else {
                return editpart.isSelectable();
            }
        }
    };
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:SequenceSelectionTool.java

示例2: getTargetingConditional

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
 * Returns a new Conditional that evaluates to <code>true</code> if the
 * queried edit part's {@link EditPart#isSelectable()} method returns
 * <code>true</code>.
 * 
 * @see TargetingTool#getTargetingConditional()
 */
protected EditPartViewer.Conditional getTargetingConditional() {
	return new EditPartViewer.Conditional() {
		public boolean evaluate(EditPart editpart) {
			EditPart targetEditPart = editpart
					.getTargetEditPart(getTargetRequest());
			return targetEditPart != null && targetEditPart.isSelectable();
		}
	};
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:17,代码来源:SelectionTool.java

示例3: getTargetingConditional

import org.eclipse.gef.EditPartViewer; //导入方法依赖的package包/类
/**
 * Returns the conditional object used for obtaining the target editpart
 * from the current viewer. By default, a conditional is returned that tests
 * whether an editpart at the current mouse location indicates a target for
 * the operation's request, using
 * {@link EditPart#getTargetEditPart(Request)}. If <code>null</code> is
 * returned, then the conditional fails, and the search continues.
 * 
 * @see EditPartViewer#findObjectAtExcluding(Point, Collection,
 *      EditPartViewer.Conditional)
 * @return the targeting conditional
 */
protected EditPartViewer.Conditional getTargetingConditional() {
	return new EditPartViewer.Conditional() {
		public boolean evaluate(EditPart editpart) {
			return editpart.getTargetEditPart(getTargetRequest()) != null;
		}
	};
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:20,代码来源:TargetingTool.java


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