public class IfElse extends DrawObject
Branches to two different DrawObject depending on a predicate.
Author:
Owen Feehan
  • Constructor Details

    • IfElse

      public IfElse(IfElse.Predicate predicate, DrawObject whenTrue, DrawObject whenFalse)
      Creates for a particular condition.
      Parameters:
      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.
    • 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 class DrawObject
      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

      public DrawObject getWhenTrue()
      The DrawObject that is used when condition==true.
    • setWhenTrue

      public void setWhenTrue(DrawObject whenTrue)
      The DrawObject that is used when condition==true.
    • getWhenFalse

      public DrawObject getWhenFalse()
      The DrawObject that is used when condition==false.
    • setWhenFalse

      public void setWhenFalse(DrawObject whenFalse)
      The DrawObject that is used when condition==false.