Class DecisionFigureText
java.lang.Object
network.ike.docs.koncept.DecisionFigureText
What a figure builder knows about text without a font engine: an estimate of a run's width
from the average widths of a Helvetica-like sans face, in em per character, so the geometry a
layout computes from label widths is the same on every machine and in every medium, and the
figure's palette and number formats, which the live JavaFX surface shares.
Kept word for word in step with its twin in komet-claude-plugin, package network.ike.komet.claude.decision.render.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat a swept quantity is: a share of those at a node, money, or anything else with a unit of its own. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe colour of an axis and its labels.static final StringThe colour of a caption.static final Stringstatic final StringThe colour of the chosen alternative, and of a tornado bar where the base choice holds.static final Stringstatic final StringThe colour of a derived value, which the reader cannot move.static final StringThe font family the writers name, whose average widths the estimate is of.static final Stringstatic final StringThe colour of a gap: a value the rollback could not determine, or a bar where another alternative wins.static final StringThe colour of a flip and its threshold.static final StringThe ink of ordinary text and outlines.static final StringThe colour of a choice left open.static final Stringstatic final StringWhen nothing is priced: the choice is left open, and the ledger alone weighs the alternatives. -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleascent(double size) Where the baseline of a line of text of a size sits beneath its top.static StringatStep(double value, double step) A value at a step's resolution: as many decimals as the step has, so a slider stepping by 0.05 shows 0.35, never 0.34999999.static Stringchip(double lower, double upper, boolean lowerOpen, boolean upperOpen, boolean computed, DecisionFigureText.Unit unit, String symbol) A measure's bounds as a chip on the tree prints them, in the measure's unit: a share as a percentage, money after its symbol, anything else followed by its unit's name; an interval in brackets.static Stringcount(double count) A count of a cohort: whole from ten up, to two significant figures beneath, so 214.2 reads 214, 3.31 reads 3.3, 2.04 reads 2 and 0.41 reads 0.41.static StringcountClause(String sparer, boolean chosenSpares, String countText, String unit, String perText, String eachText) A clause for one counted unit: who spares how many, per how many cases, and at what in money each, when the other side pays for it.static StringThe text, or as much of it as fits a width with an ellipsis.static Stringlength(double value) A length as the writers print it: at most two decimals, no trailing zeros.static doublelineHeight(double size) The height of a line of text of a size, as the builders space lines.static StringofCohort(double count, double size) How many of a cohort go a way, as a branch says it: "214 of 1,000", or "all 1,000" when every one does.static Stringpercent(double share) A computed share as a percentage; seepercent(double, boolean).static Stringpercent(double share, boolean computed) A share as a reader says it: a computed one as a percentage to three significant figures, no wider, so a threshold of 0.017463 reads 1.75%; a stated one as the block wrote it, so 0.214 reads 21.4% and 0.9 reads 90%.static Stringquantity(double value, DecisionFigureText.Unit unit, String symbol) A quantity on a tornado's caption or threshold, with its unit: a share as a percentage, money after its symbol to the whole unit, anything else to three significant figures followed by its unit's name when it has one.static Stringshown(double value, boolean computed, boolean money) A measure's value as its chip shows it.static StringThe sign a money unit is written with when it has a familiar one, from the unit's name: a dollar's$, a euro's€, a pound's£, a yen's¥; empty for any other, which then prints its name.static StringWhere a cohort ends up, entering a tree of consequences with no choice at its root whenentering.static StringWhere a cohort that takes one alternative ends up, as one sentence: the outcomes largest first, each with its count and, where fewer than a third arrive, how rare it is as one in so many.static Stringtradeoff(String chosen, String other, double money, String moneyText, double health, String healthText, String priceText, String pricedText) What the choice at the root trades, as one sentence: how the chosen alternative stands against the next best in money and in health, and the price of a healthy year at which they tie, against the price the tree was read at.static Stringtradeoff(String chosen, String other, double money, String moneyText, double health, String healthText, String priceText, String pricedText, boolean countedAgainst, List<String> clauses) The trade with what the tree counts weighed in:countedAgainstwhen the chosen alternative brings more of some counted unit than the next best, so that it does not win outright however health is priced; and a clause per counted unit that differs, already worded, which follows the sentence.static Stringvalue(double value) A measure's value as a threshold or a caption reads it: whole above a hundred, two decimals above one, four beneath, since a flip found by bisection is only as exact as its range.static doubleThe estimated width of a run of text: each character by its class in a Helvetica-like face, bold a twentieth wider, a space between words narrow.The text broken into lines no wider than a width, at spaces.
-
Field Details
-
INK
-
CHOSEN
The colour of the chosen alternative, and of a tornado bar where the base choice holds.- See Also:
-
GAP
The colour of a gap: a value the rollback could not determine, or a bar where another alternative wins.- See Also:
-
HOT
-
OPEN
-
AXIS
-
DERIVED
The colour of a derived value, which the reader cannot move.- See Also:
-
CAPTION
-
DECISION_FILL
- See Also:
-
CHANCE_FILL
- See Also:
-
OUTCOME_FILL
- See Also:
-
FOLDED_FILL
- See Also:
-
FAMILY
The font family the writers name, whose average widths the estimate is of.- See Also:
-
UNPRICED
When nothing is priced: the choice is left open, and the ledger alone weighs the alternatives.- See Also:
-
-
Method Details
-
lineHeight
public static double lineHeight(double size) The height of a line of text of a size, as the builders space lines. -
ascent
public static double ascent(double size) Where the baseline of a line of text of a size sits beneath its top. -
width
The estimated width of a run of text: each character by its class in a Helvetica-like face, bold a twentieth wider, a space between words narrow. -
fit
-
wrap
-
value
A measure's value as a threshold or a caption reads it: whole above a hundred, two decimals above one, four beneath, since a flip found by bisection is only as exact as its range. -
percent
A share as a reader says it: a computed one as a percentage to three significant figures, no wider, so a threshold of 0.017463 reads 1.75%; a stated one as the block wrote it, so 0.214 reads 21.4% and 0.9 reads 90%. -
percent
A computed share as a percentage; seepercent(double, boolean). -
symbolFor
-
chip
public static String chip(double lower, double upper, boolean lowerOpen, boolean upperOpen, boolean computed, DecisionFigureText.Unit unit, String symbol) A measure's bounds as a chip on the tree prints them, in the measure's unit: a share as a percentage, money after its symbol, anything else followed by its unit's name; an interval in brackets. A stated number prints as the block wrote it, a computed one no wider than it earns, asshown(double, boolean, boolean)prints them. -
quantity
A quantity on a tornado's caption or threshold, with its unit: a share as a percentage, money after its symbol to the whole unit, anything else to three significant figures followed by its unit's name when it has one. A negative amount of money carries its sign before the symbol. -
shown
A measure's value as its chip shows it. A stated number prints as the block wrote it and no wider; a computed one is held to what its inputs can carry: money to the whole unit of its currency, a share or a quantity to three significant figures, since a product of two-figure assumptions never earns a fifth decimal. -
atStep
A value at a step's resolution: as many decimals as the step has, so a slider stepping by 0.05 shows 0.35, never 0.34999999. -
count
A count of a cohort: whole from ten up, to two significant figures beneath, so 214.2 reads 214, 3.31 reads 3.3, 2.04 reads 2 and 0.41 reads 0.41. -
ofCohort
How many of a cohort go a way, as a branch says it: "214 of 1,000", or "all 1,000" when every one does. -
tally
public static String tally(String alternative, double size, List<String> names, List<Double> counts) Where a cohort that takes one alternative ends up, as one sentence: the outcomes largest first, each with its count and, where fewer than a third arrive, how rare it is as one in so many. The outcome names and counts are given in order. -
tally
-
tradeoff
public static String tradeoff(String chosen, String other, double money, String moneyText, double health, String healthText, String priceText, String pricedText) What the choice at the root trades, as one sentence: how the chosen alternative stands against the next best in money and in health, and the price of a healthy year at which they tie, against the price the tree was read at.- Parameters:
money- how much more money the chosen costs, printed with its sign dropped; negative means lesshealth- how much more healthy life the chosen keeps, printed with its sign dropped; negative means less
-
tradeoff
public static String tradeoff(String chosen, String other, double money, String moneyText, double health, String healthText, String priceText, String pricedText, boolean countedAgainst, List<String> clauses) The trade with what the tree counts weighed in:countedAgainstwhen the chosen alternative brings more of some counted unit than the next best, so that it does not win outright however health is priced; and a clause per counted unit that differs, already worded, which follows the sentence. -
countClause
public static String countClause(String sparer, boolean chosenSpares, String countText, String unit, String perText, String eachText) A clause for one counted unit: who spares how many, per how many cases, and at what in money each, when the other side pays for it. "“scan” spares 3.3 ruptures per 1,000, at $590,000 each."; "“wear test” would spare 185,400 patients with an implant removed per 100, at $54 each." -
length
A length as the writers print it: at most two decimals, no trailing zeros.
-