本文整理匯總了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();
}