Class IfElse
Branches to two different
DrawObject
depending on a predicate.- Author:
- Owen Feehan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface for the condition that is tested, to determine whichDrawObject
to use. -
Constructor Summary
ConstructorsConstructorDescriptionIfElse()
IfElse
(IfElse.Predicate predicate, DrawObject whenTrue, DrawObject whenFalse) Creates for a particular condition. -
Method Summary
Modifier and TypeMethodDescriptionvoid
drawSingle
(ObjectWithProperties object, RGBStack stack, ObjectDrawAttributes attributes, int iteration, BoundingBox restrictTo) Draws a single-object on top of a RGB-stack.TheDrawObject
that is used whencondition==false
.TheDrawObject
that is used whencondition==true
.void
setWhenFalse
(DrawObject whenFalse) TheDrawObject
that is used whencondition==false
.void
setWhenTrue
(DrawObject whenTrue) TheDrawObject
that is used whencondition==true
.Methods inherited from class org.anchoranalysis.overlay.bean.DrawObject
drawCollection, drawCollection
Methods 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 whichDrawObject
to use.whenTrue
- theDrawObject
that is used whencondition==true
.whenFalse
- theDrawObject
that 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:DrawObject
Draws a single-object on top of a RGB-stack.- Specified by:
drawSingle
in 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
TheDrawObject
that is used whencondition==true
. -
setWhenTrue
TheDrawObject
that is used whencondition==true
. -
getWhenFalse
TheDrawObject
that is used whencondition==false
. -
setWhenFalse
TheDrawObject
that is used whencondition==false
.
-