Added full cake dot name support to reuse the internal enum naming
This commit is contained in:
parent
ad864152ed
commit
158bb0c6f4
|
@ -33,7 +33,6 @@ import org.x4o.fc18.cake2.FourCornerX00PetitVide;
|
|||
import org.x4o.fc18.cake2.FourCornerX06BaklavaPointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX08MuffinPointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX18CakePointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX18CakeWord;
|
||||
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
||||
import org.x4o.fc18.zion7.FourCornerZion7Candlelier;
|
||||
import org.x4o.fc18.zion7.FourCornerZionStenoLexer;
|
||||
|
@ -172,14 +171,15 @@ public class FourCornerUnicodeDisplay {
|
|||
output.append(value);
|
||||
} else {
|
||||
FourCornerX00PetitVide videPoint = videPoints[offset];
|
||||
if (videPoint instanceof FourCornerX18CakeWord) {
|
||||
FourCornerX18CakeWord cakeWord = FourCornerX18CakeWord.class.cast(videPoint);
|
||||
FourCornerX18CakePointSequence[] wordDefault = cakeWord.nameDefault();
|
||||
for (FourCornerX18CakePointSequence letter : wordDefault) {
|
||||
if (videPoint.kaasX18CakeDotName().isPresent()) {
|
||||
List<FourCornerX18CakePointSequence> nameX18 = videPoint.kaasX18CakeDotName().get().nameX18();
|
||||
for (FourCornerX18CakePointSequence letter : nameX18) {
|
||||
letter.kaasX21CodeSequence().ifPresent(v -> {
|
||||
v.codePointSequence().forEach(vv -> output.appendCodePoint(vv));
|
||||
});
|
||||
}
|
||||
// should be equal to
|
||||
//output.append(videPoint.kaasX18CakeDotName().get().name());
|
||||
}
|
||||
}
|
||||
if (renderSeperator != null && wasExternalWord) {
|
||||
|
|
|
@ -25,8 +25,6 @@ package org.x4o.fc18.cake2;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.x4o.fc18.FourCornerUnicodeImport;
|
||||
|
||||
/**
|
||||
* Glue for clock speech token support.
|
||||
*
|
||||
|
@ -34,9 +32,7 @@ import org.x4o.fc18.FourCornerUnicodeImport;
|
|||
* @author Willem Cazander
|
||||
* @version 1.0 Dec 30, 2024
|
||||
*/
|
||||
public interface FourCornerDotColleCLK extends FourCornerX18CakeWord {
|
||||
|
||||
String name();
|
||||
public interface FourCornerDotColleCLK extends FourCornerX18CakePointDotIndex {
|
||||
|
||||
FourCornerDotColleCLKParler[] clockParlers();
|
||||
|
||||
|
@ -49,10 +45,6 @@ public interface FourCornerDotColleCLK extends FourCornerX18CakeWord {
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
default FourCornerX18CakePointSequence[] nameDefault() {
|
||||
return FourCornerUnicodeImport.strict().convertToX18(name()).toArray(new FourCornerX18CakePointSequence[] {});
|
||||
}
|
||||
|
||||
@Override
|
||||
default List<Integer> cakePointSequence() {
|
||||
return List.of(cakePointDotIndex());
|
||||
|
|
|
@ -46,6 +46,10 @@ public interface FourCornerX00PetitVide {
|
|||
return this instanceof FourCornerX18CakePointDotIndex?Optional.of(FourCornerX18CakePointDotIndex.class.cast(this)):Optional.empty();
|
||||
}
|
||||
|
||||
default Optional<FourCornerX18CakePointDotName> kaasX18CakeDotName() {
|
||||
return this instanceof FourCornerX18CakePointDotName?Optional.of(FourCornerX18CakePointDotName.class.cast(this)):Optional.empty();
|
||||
}
|
||||
|
||||
default Optional<FourCornerX18CakePointSequence> kaasX18CakeSequence() {
|
||||
return this instanceof FourCornerX18CakePointSequence?Optional.of(FourCornerX18CakePointSequence.class.cast(this)):Optional.empty();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ package org.x4o.fc18.cake2;
|
|||
///
|
||||
/// @author Willem Cazander
|
||||
/// @version 1.0 Jan 19, 2025
|
||||
public interface FourCornerX18CakePointDotIndex extends FourCornerX18CakePointSequence {
|
||||
public interface FourCornerX18CakePointDotIndex extends FourCornerX18CakePointSequence, FourCornerX18CakePointDotName {
|
||||
|
||||
/// One cake piece weights 800 gram
|
||||
int cakePointDotIndex();
|
||||
|
|
|
@ -22,12 +22,19 @@
|
|||
*/
|
||||
package org.x4o.fc18.cake2;
|
||||
|
||||
/// Fall back word provider.
|
||||
import java.util.List;
|
||||
|
||||
import org.x4o.fc18.FourCornerUnicodeImport;
|
||||
|
||||
/// Access to the internal dot cake point glyph name.
|
||||
///
|
||||
/// @author Willem Cazander
|
||||
/// @version 1.0 Jan 11, 2025
|
||||
public interface FourCornerX18CakeWord extends FourCornerX18CakePointDotIndex {
|
||||
public interface FourCornerX18CakePointDotName extends FourCornerX00PetitVide {
|
||||
|
||||
/// Default word provider
|
||||
FourCornerX18CakePointSequence[] nameDefault();
|
||||
String name(); // copy name from internal enum value
|
||||
|
||||
default List<FourCornerX18CakePointSequence> nameX18() {
|
||||
return FourCornerUnicodeImport.strict().convertToX18(name());
|
||||
}
|
||||
}
|
|
@ -50,7 +50,8 @@ import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent;
|
|||
*/
|
||||
public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter {
|
||||
|
||||
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=20)
|
||||
// NOTE: Table are not allowed in details
|
||||
// @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=20)
|
||||
public void writeDefaultSummary(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
|
||||
// NOTE: copyed from defaultWriteSummary as that only called with zero summaries + changes name end in; Words
|
||||
ApiDocContentWriter writer = event.getWriter();
|
||||
|
@ -72,7 +73,7 @@ public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter {
|
|||
}
|
||||
writer.docTableEnd();
|
||||
}
|
||||
|
||||
|
||||
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={TDocCakeSlice.class}, nodeBodyOrders=1)
|
||||
public void writeCakeSliceDetails(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
|
||||
ApiDocContentWriter writer = event.getWriter();
|
||||
|
@ -84,6 +85,7 @@ public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter {
|
|||
writer.docTableRow("Size", Integer.toString(slice.getLength()));
|
||||
writer.docTableRow("External word", Boolean.toString(slice.isExternWord()));
|
||||
}
|
||||
writeDefaultSummary(event);
|
||||
// }
|
||||
//
|
||||
// @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={FourCornerDotCake.class}, nodeBodyOrders=10)
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.Optional;
|
|||
import org.x4o.fc18.cake2.FourCornerX00PetitVideCoinCarne;
|
||||
import org.x4o.fc18.cake2.FourCornerX06BaklavaPointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX08MuffinPointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX18CakePointDotName;
|
||||
import org.x4o.fc18.cake2.FourCornerX18CakePointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX21CodePointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX00PetitVide;
|
||||
|
@ -54,26 +55,43 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
|
|||
TDocCakeWord word = event.getEventObject().toUserData(TDocCakeWord.class);
|
||||
FourCornerX00PetitVide[] videPoints = word.getSlice().getVidePoints();
|
||||
if (videPoints.length == 0) {
|
||||
writer.printTagStart(Tag.pre);
|
||||
writer.printCharacters("None PetitVide for: " + word.toString());
|
||||
writer.printTagEnd(Tag.pre);
|
||||
return;
|
||||
}
|
||||
writer.docTableStart("Points Summary", "Encode point for all systems.",ApiDocContentCss.overviewSummary);
|
||||
writer.docTableHeader("System", "Point Sequence");
|
||||
FourCornerX00PetitVide videPoint = videPoints[word.getOffset()];
|
||||
Optional<FourCornerX21CodePointSequence> x21CodeDisplay = videPoint.kaasX21CodeSequence();
|
||||
Optional<FourCornerX06BaklavaPointSequence> x06BaklavaSequence = videPoint.kaasX06BaklavaSequence();
|
||||
Optional<FourCornerX08MuffinPointSequence> x08MuffinSequence = videPoint.kaasX08MuffinSequence();
|
||||
Optional<FourCornerX18CakePointSequence> x18CakeSequence = videPoint.kaasX18CakeSequence();
|
||||
if (x06BaklavaSequence.isPresent()) {
|
||||
writeSequence(writer, "X06", 2, x06BaklavaSequence.get().baklavaPointSequence());
|
||||
}
|
||||
if (x08MuffinSequence.isPresent()) {
|
||||
writeSequence(writer, "X08", 2, x08MuffinSequence.get().muffinPointSequence());
|
||||
}
|
||||
if (x18CakeSequence.isPresent()) {
|
||||
writeSequence(writer, "X18", 6, x18CakeSequence.get().cakePointSequence());
|
||||
Optional<FourCornerX18CakePointDotName> x18DotName = videPoint.kaasX18CakeDotName();
|
||||
|
||||
writer.docTableStart("Glyph Summary", "The cake point as unicode glyph.",ApiDocContentCss.overviewSummary);
|
||||
writer.docTableHeader("Glyph", "Value");
|
||||
String name = word.toString();
|
||||
String value = name;
|
||||
if (x18DotName.isPresent()) {
|
||||
name = x18DotName.get().name();
|
||||
}
|
||||
if (x21CodeDisplay.isPresent()) {
|
||||
writeSequence(writer, "X21", 6, x21CodeDisplay.get().codePointSequence());
|
||||
StringBuilder buf = new StringBuilder();
|
||||
x21CodeDisplay.get().codePointSequence().forEach(v -> buf.appendCodePoint(v));
|
||||
value = buf.toString();
|
||||
}
|
||||
writer.docTableRow(name, value);
|
||||
|
||||
if (x06BaklavaSequence.isPresent()) {
|
||||
writeSequence(writer, "Sequence-X06", 2, x06BaklavaSequence.get().baklavaPointSequence());
|
||||
}
|
||||
if (x08MuffinSequence.isPresent()) {
|
||||
writeSequence(writer, "Sequence-X08", 2, x08MuffinSequence.get().muffinPointSequence());
|
||||
}
|
||||
if (x18CakeSequence.isPresent()) {
|
||||
writeSequence(writer, "Sequence-X18", 6, x18CakeSequence.get().cakePointSequence());
|
||||
}
|
||||
if (x21CodeDisplay.isPresent()) {
|
||||
writeSequence(writer, "Sequence-X21", 6, x21CodeDisplay.get().codePointSequence());
|
||||
}
|
||||
writer.docTableEnd();
|
||||
// }
|
||||
|
@ -90,7 +108,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
|
|||
// FourCornerX00PetitVide videPoint = videPoints[word.getOffset()];
|
||||
Optional<FourCornerX00PetitVideCoinCarne> x00CoinCarne = videPoint.kaasX00CoinCarne();
|
||||
writer.docTableStart("Kerning Summary", "Kerning all pattern displays.",ApiDocContentCss.overviewSummary);
|
||||
writer.docTableHeader("Location", "Corner indents");
|
||||
writer.docTableHeader("Location", "Corner dents");
|
||||
if (x00CoinCarne.isPresent()) {
|
||||
FourCornerX00PetitVideCoinCarne cornerKerning = x00CoinCarne.get();
|
||||
writer.docTableRow("Top", cornerKerning.coinCarneFrapper().kerningTop().name());
|
||||
|
@ -99,6 +117,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
|
|||
writer.docTableEnd();
|
||||
}
|
||||
|
||||
|
||||
private void writeSequence(ApiDocContentWriter writer, String system, int minHex, List<Integer> sequence) throws IOException {
|
||||
String displayFormat = "0x%0" + minHex + "X";
|
||||
StringBuilder buf = new StringBuilder();
|
||||
|
@ -112,22 +131,4 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter {
|
|||
}
|
||||
writer.docTableRow(system, buf.toString());
|
||||
}
|
||||
|
||||
@ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL,targetClasses={TDocCakeWord.class})
|
||||
public void writeCakeWordDetail(ApiDocWriteEvent<ApiDocNode> event) throws IOException {
|
||||
ApiDocContentWriter writer = event.getWriter();
|
||||
TDocCakeWord word = event.getEventObject().toUserData(TDocCakeWord.class);
|
||||
FourCornerX00PetitVide[] videPoints = word.getSlice().getVidePoints();
|
||||
if (videPoints.length == 0) {
|
||||
return;
|
||||
}
|
||||
FourCornerX00PetitVide letter = videPoints[word.getOffset()];
|
||||
StringBuilder buf = new StringBuilder();
|
||||
letter.kaasX21CodeSequence().ifPresent(v -> {
|
||||
v.codePointSequence().forEach(vv -> buf.appendCodePoint(vv));
|
||||
});
|
||||
writer.printTagStart(Tag.pre);
|
||||
writer.printCharacters(buf.toString());
|
||||
writer.printTagEnd(Tag.pre);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,4 +49,8 @@ public class TDocCakeWord {
|
|||
public int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format("%s.0x%06X", slice.name(), slice.getStart() + offset);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue