99 | | * |
| 99 | * Method names in the layout are logged at INFO level. |
| 100 | * Layout algorithm refactoring |
| 101 | * The basic design idea is preserved, but moved out of Atom, because it does not take into account that each unit can have a different pre-style, post-style, etc. Thus, units can not be grouped inside an atom, and the Atom should still represent a separate glyph, laid out at once. |
| 102 | * The grouping of units in Atom is replaced by grouping of atoms in TextRange. |
| 103 | * The atom grouping idea is implemented in a new abstract class AtomManager (renamed from design's AtomKind) |
| 104 | * WordManager extending AtomManager is added (renamed from design's WordKind) |
| 105 | * UnitManager extending AtomManager is added (renamed from design's UnitKind) |
| 106 | * AtomManager is with package visibility in the layout package. |
| 107 | * Method TextRange.getAtomManager() is added to be able to get the atoms related to the current TextRange. |
| 108 | * Delegation is not used, because TextRange does not need to be polluted by the Atom handling interface. |
| 109 | * Side effect of this is that AtomManager is not extracted to a separate package so that is could be used in the layout algorithm directly. |
| 110 | * Solutions for bottlenecks found by profiling |
| 111 | * NaiveHotText methods are refactored to extract ProLib properties in local variables for each method. |
| 112 | * Atom.getAdvance() is refactored to cache the advance. |
| 113 | * Usage of Navigator.GetIndex is decreased. |
| 114 | * Layout performance is improved by around 40% (LayoutBuilderTest.testLayoutPerformance runs in 0.3-0.32 sec on average). |
| 121 | * Issues to be addressed in the next revision |
| 122 | * Bottlenecks found after profiling (in order of influence on layout performance) |
| 123 | * NaiveHotText's methods and their utilization of ProLib () |
| 124 | * HotTextLogic.INPUT_CHAR -> text.replaceText -> units().get().addAll |
| 125 | * getUnits |
| 126 | * NaiveNavigator.getIndex |
| 127 | * NaiveNavigator.isPresent |
| 128 | * Cycles on units elements (even with iterators) |
| 129 | * HotTextFontMapping.createInitialFont() -> Toolkit.getDefaultToolkit().getScreenResolution() |
| 130 | * Atom.getAdvance() -> FontDesignMetrics.stringWidth |
| 131 | * Implement new AtomManagers |
| 132 | * RowManager - groups the atoms belonging to one row/line of text. |
| 133 | * SizeManager - groups atoms by means of an area to fit in. |
| 134 | * SentenceManager - groups atoms belonging to one sentence. |
| 135 | |
| 136 | |