Class IfElse
Branches to two different
DrawObject depending on a predicate.- Author:
- Owen Feehan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for the condition that is tested, to determine whichDrawObjectto use. -
Constructor Summary
ConstructorsConstructorDescriptionIfElse()IfElse(IfElse.Predicate predicate, DrawObject whenTrue, DrawObject whenFalse) Creates for a particular condition. -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawSingle(ObjectWithProperties object, RGBStack stack, ObjectDrawAttributes attributes, int iteration, BoundingBox restrictTo) Draws a single-object on top of a RGB-stack.TheDrawObjectthat is used whencondition==false.TheDrawObjectthat is used whencondition==true.voidsetWhenFalse(DrawObject whenFalse) TheDrawObjectthat is used whencondition==false.voidsetWhenTrue(DrawObject whenTrue) TheDrawObjectthat is used whencondition==true.Methods inherited from class org.anchoranalysis.overlay.bean.DrawObject
drawCollection, drawCollectionMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
IfElse
Creates for a particular condition.- Parameters:
predicate- the condition that is tested, to determine whichDrawObjectto use.whenTrue- theDrawObjectthat is used whencondition==true.whenFalse- theDrawObjectthat is used whencondition==false.
-
IfElse
public IfElse()
-
-
Method Details
-
drawSingle
public void drawSingle(ObjectWithProperties object, RGBStack stack, ObjectDrawAttributes attributes, int iteration, BoundingBox restrictTo) throws OperationFailedException Description copied from class:DrawObjectDraws a single-object on top of a RGB-stack.- Specified by:
drawSinglein classDrawObject- Parameters:
object- the object to draw.stack- the image to draw on.attributes- attributes for each object when drawing.iteration- the current iteration.restrictTo- a restriction on which part of stack we draw onto to (considered in terms of the possibly-zoomed pixel coordinates).- Throws:
OperationFailedException- if the object cannot be successfully drawn.
-
getWhenTrue
TheDrawObjectthat is used whencondition==true. -
setWhenTrue
TheDrawObjectthat is used whencondition==true. -
getWhenFalse
TheDrawObjectthat is used whencondition==false. -
setWhenFalse
TheDrawObjectthat is used whencondition==false.
-