本文整理汇总了Java中fj.data.Option.isSome方法的典型用法代码示例。如果您正苦于以下问题:Java Option.isSome方法的具体用法?Java Option.isSome怎么用?Java Option.isSome使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fj.data.Option
的用法示例。
在下文中一共展示了Option.isSome方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endDrag
import fj.data.Option; //导入方法依赖的package包/类
public void endDrag( final PullerNode pullerNode ) {
blueKnots.append( redKnots ).foreach( _removeHighlight );
Option<KnotNode> attachNode = getAttachNode( pullerNode );
if ( attachNode.isSome() ) {
Point2D hands = pullerNode.getGlobalAttachmentPoint();
Point2D knot = attachNode.some().getGlobalFullBounds().getCenter2D();
Vector2D delta = new Vector2D( hands, knot );
Dimension2D localDelta = rootNode.globalToLocal( new Dimension2DDouble( delta.x, delta.y ) );
pullerNode.animateToPositionScaleRotation( pullerNode.getOffset().getX() + localDelta.getWidth(), pullerNode.getOffset().getY() + localDelta.getHeight(), pullerNode.scale, 0,
//if the rope is moving, automatically translate to the right location otherwise the target will be puller arrives
mode.get() == Mode.GOING ? 0 : ANIMATION_DURATION );
//attach everything
attachNode.some().setPullerNode( pullerNode );
pullerNode.setKnot( attachNode.some() );
updateForceListeners();
}
else {
detach( pullerNode );
pullerNode.animateHome();
}
}
示例2: animateSliceToBucket
import fj.data.Option; //导入方法依赖的package包/类
public PieSet animateSliceToBucket( CellPointer cell, long randomSeed ) {
//Cell that should be moved
//May choose a slice that is on its way to a pie
final Slice prototype = sliceFactory.createPieCell( pies.length(), cell.container, cell.cell, denominator );
final Option<Slice> sliceOption = slices.find( new F<Slice, Boolean>() {
@Override public Boolean f( Slice m ) {
return ( m.position.equals( prototype.position ) && m.angle == prototype.angle ) || m.movingToward( prototype );
}
} );
final Slice slice = sliceOption.isSome() ? sliceOption.some() : slices.find( new F<Slice, Boolean>() {
@Override public Boolean f( Slice s ) {
return s.position.getY() == prototype.position.getY();
}
} ).some();
//Could be none if still animating
return animateSliceToBucket( slice, randomSeed );
}
示例3: pick
import fj.data.Option; //导入方法依赖的package包/类
@Override protected Option<PickResult> pick( final Vector2D vector2D, final MockState mockState ) {
for ( SNode sNode : children.reverse() ) {
final Option<PickResult> picked = sNode.pick( vector2D, mockState );
if ( picked.isSome() ) {
return picked;
}
}
return Option.none();
}
示例4: updatePickable
import fj.data.Option; //导入方法依赖的package包/类
private void updatePickable() {
for ( T card : cards ) {
card.setAllPickable( false );
}
final Option<T> front = getFrontCardInStack();
if ( front.isSome() ) {
front.some().setAllPickable( true );
front.some().moveToFront();
}
moveNonStackCardsToFront();
}
示例5: dragStarted
import fj.data.Option; //导入方法依赖的package包/类
@Override protected void dragStarted() {
showShadow();
final Option<Double> nextAngle = context.getNextAngle( this );
if ( nextAngle.isSome() ) {
animateToAngle( nextAngle.some() );
}
}
示例6: intersectsAny
import fj.data.Option; //导入方法依赖的package包/类
private boolean intersectsAny( final Option<ForceArrowNode> other ) {
return other.isSome() && getSign( forceInNewtons ) == getSign( other.some().forceInNewtons );
}
示例7: containsSite
import fj.data.Option; //导入方法依赖的package包/类
private boolean containsSite( int containerIndex ) {
final Option<SingleContainerNode> containerNode = getSingleContainerNode( containerIndex );
return containerNode.isSome() && containerNode.some().containsPiece();
}