本文整理汇总了Java中org.eclipse.gef.EditPartViewer.Conditional类的典型用法代码示例。如果您正苦于以下问题:Java Conditional类的具体用法?Java Conditional怎么用?Java Conditional使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Conditional类属于org.eclipse.gef.EditPartViewer包,在下文中一共展示了Conditional类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTargetingConditional
import org.eclipse.gef.EditPartViewer.Conditional; //导入依赖的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();
}
}
};
}
示例2: getTargetingConditional
import org.eclipse.gef.EditPartViewer.Conditional; //导入依赖的package包/类
@Override
protected Conditional getTargetingConditional() {
System.out.println("getTargetingConditional()");
return super.getTargetingConditional();
}