Interface DrawCommandFactory

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DrawCommandFactory
Turns a space and a style into a concrete DrawCommand.

The seam that lets one DrawBuilder serve every primitive: the geometry is captured when the builder is created and the presentation is applied when it is submitted, so there is one fluent chain rather than six near-identical ones.

  • Method Details

    • create

      DrawCommand.Primitive create(DrawSpace space, DrawStyle style)
      Build the command this factory was created for.

      The return type narrowed from DrawCommand to DrawCommand.Primitive. A lambda is unaffected, since its return type is inferred; an explicit implements DrawCommandFactory whose create was declared to return DrawCommand no longer overrides this and must narrow. The narrowing is what makes a batch unable to carry a highlight — see DrawCommand.Highlight.