public class IfElse extends DrawObject
DrawObject
depending on a predicate.Modifier and Type | Class and Description |
---|---|
static interface |
IfElse.Predicate
Interface for the condition that is tested, to determine which
DrawObject to use. |
Constructor and Description |
---|
IfElse() |
IfElse(IfElse.Predicate predicate,
DrawObject whenTrue,
DrawObject whenFalse)
Creates for a particular condition.
|
Modifier and Type | Method and Description |
---|---|
void |
drawSingle(ObjectWithProperties object,
RGBStack stack,
ObjectDrawAttributes attributes,
int iteration,
BoundingBox restrictTo)
Draws a single-object on top of a RGB-stack.
|
DrawObject |
getWhenFalse()
The
DrawObject that is used when condition==false . |
DrawObject |
getWhenTrue()
The
DrawObject that is used when condition==true . |
void |
setWhenFalse(DrawObject whenFalse)
The
DrawObject that is used when condition==false . |
void |
setWhenTrue(DrawObject whenTrue)
The
DrawObject that is used when condition==true . |
drawCollection, drawCollection
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public IfElse(IfElse.Predicate predicate, DrawObject whenTrue, DrawObject whenFalse)
predicate
- the condition that is tested, to determine which DrawObject
to use.whenTrue
- the DrawObject
that is used when condition==true
.whenFalse
- the DrawObject
that is used when condition==false
.public IfElse()
public void drawSingle(ObjectWithProperties object, RGBStack stack, ObjectDrawAttributes attributes, int iteration, BoundingBox restrictTo) throws OperationFailedException
DrawObject
drawSingle
in class DrawObject
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).OperationFailedException
- if the object cannot be successfully drawn.public DrawObject getWhenTrue()
DrawObject
that is used when condition==true
.public void setWhenTrue(DrawObject whenTrue)
DrawObject
that is used when condition==true
.public DrawObject getWhenFalse()
DrawObject
that is used when condition==false
.public void setWhenFalse(DrawObject whenFalse)
DrawObject
that is used when condition==false
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.