Record Class DecisionFigure

java.lang.Object
java.lang.Record
network.ike.docs.koncept.DecisionFigure
Record Components:
width - the figure's width, in its units
height - the figure's height
role - what the figure is: decision-tree or decision-tornado
marks - the marks, in drawing order: what comes later is drawn over what comes before

public record DecisionFigure(double width, double height, String role, List<DecisionFigure.Mark> marks) extends Record
A decision-tree figure as marks on a page: rectangles, circles, polygons, polylines and text, each at a place in the figure's own units, each with its paint and a role naming what it stands for. A figure is the whole of what a writer needs: DecisionFigureSvg and DecisionFigureTypst translate the marks and decide nothing, so the two media draw the same picture, and a test reads the roles back from the SVG.

This class, the text metrics, the writers and the tornado builder are kept word for word in step with their twins in komet-claude-plugin (network.ike.komet.claude.decision.render), where the live surface draws the same figures over the stored tree; only the package line and the adapters differ.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A circle about its centre.
    static interface 
    One mark of the figure.
    static final record 
    A closed polygon through its points, as x0, y0, x1, y1, ….
    static final record 
    An open polyline through its points, as x0, y0, x1, y1, …, round-capped and round-joined.
    static final record 
    An axis-aligned rectangle from its top-left corner.
    static final record 
    How a mark's outline is drawn; null for no outline.
    static final record 
    A run of text whose top-left corner is at (x, top): the writers set the baseline from the size, so a label sits where the builder put its box.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DecisionFigure(double width, double height, String role, List<DecisionFigure.Mark> marks)
    Creates an instance of a DecisionFigure record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    double
    Returns the value of the height record component.
    Returns the value of the marks record component.
    Returns the value of the role record component.
    final String
    Returns a string representation of this record class.
    double
    Returns the value of the width record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DecisionFigure

      public DecisionFigure(double width, double height, String role, List<DecisionFigure.Mark> marks)
      Creates an instance of a DecisionFigure record class.
      Parameters:
      width - the value for the width record component
      height - the value for the height record component
      role - the value for the role record component
      marks - the value for the marks record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • width

      public double width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public double height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • role

      public String role()
      Returns the value of the role record component.
      Returns:
      the value of the role record component
    • marks

      public List<DecisionFigure.Mark> marks()
      Returns the value of the marks record component.
      Returns:
      the value of the marks record component