diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCake.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCake.java index 8f6443e..473be11 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCake.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCake.java @@ -54,7 +54,7 @@ public class FCDocSegmentWriterCake implements FCDocSegmentWriter { }; @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DESCRIPTION_NODE,targetClasses={TDocCake.class}) - public void writeSchemaViewSummary(ApiDocWriteEvent event) throws SAXException, IOException { + public void writeSchemaViewSummary(ApiDocWriteEvent event) throws IOException { ApiDocContentWriter writer = event.getWriter(); writer.printCharacters("Four corner is 18 bit text encoding for 144 bit computers."); writer.printTagStartEnd(Tag.br); diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java index 509eeb9..fc2ebc3 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeSlice.java @@ -41,7 +41,6 @@ import org.x4o.o2o.tdoc.dom.ApiDocConcept; import org.x4o.o2o.tdoc.dom.ApiDocNode; import org.x4o.o2o.tdoc.dom.ApiDocNodeBody; import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; -import org.xml.sax.SAXException; /** * Cake doc segment slice writer. @@ -52,7 +51,7 @@ import org.xml.sax.SAXException; public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter { @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={FourCornerDotCake.class}, nodeBodyOrders=20) - public void writeDefaultSummary(ApiDocWriteEvent event) throws SAXException, IOException { + public void writeDefaultSummary(ApiDocWriteEvent event) throws IOException { // NOTE: copyed from defaultWriteSummary as that only called with zero summaries ApiDocContentWriter writer = event.getWriter(); ApiDocNode parent = event.getEventObject(); @@ -75,7 +74,7 @@ public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter { } @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={FourCornerDotCake.class}, nodeBodyOrders=10) - public void writeSchemaViewSummary(ApiDocWriteEvent event) throws SAXException, IOException { + public void writeMuffinSummary(ApiDocWriteEvent event) throws IOException { ApiDocContentWriter writer = event.getWriter(); FourCornerDotCake slice = (FourCornerDotCake)event.getEventObject().getUserData(); if (slice.getStart() >= FourCornerDotCake.__MIND_THE_GAP8.getStart()) { @@ -109,7 +108,7 @@ public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter { return; } if (FourCornerDotCake.FC_CDC1604_P6.equals(slice)) { - try (ContentCloseable table = writer.docTable(FourCornerDotCake.FC_CDC1604_P6.nameSpec(), null, ApiDocContentCss.overviewSummary)) { + try (ContentCloseable table = writer.docTable("Cake Points", null, ApiDocContentCss.overviewSummary)) { writeTableBoxHeaderNumeric(writer, 17); writeCDC(writer, 0x00); writeCDC(writer, 0x10); @@ -121,9 +120,22 @@ public class FCDocSegmentWriterCakeSlice implements FCDocSegmentWriter { } private void writeP7xSlice(ApiDocContentWriter writer, FourCornerDotCake slice, Function conv) throws IOException { - try (ContentCloseable table = writer.docTable(slice.nameSpec(), null, ApiDocContentCss.overviewSummary)) { + try (ContentCloseable table = writer.docTable("Cake Points", null, ApiDocContentCss.overviewSummary)) { writeTableBoxHeaderNumeric(writer, 28, true); writeP7x(writer, slice, conv); } } + + @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY, targetClasses={FourCornerDotCake.class}, nodeBodyOrders=1) + public void writeCakeSliceDetails(ApiDocWriteEvent event) throws IOException { + ApiDocContentWriter writer = event.getWriter(); + FourCornerDotCake slice = (FourCornerDotCake)event.getEventObject().getUserData(); + try (ContentCloseable table = writer.docTable("Cake Slice", null, ApiDocContentCss.overviewSummary)) { + writer.docTableHeader("Information", "Value"); + writer.docTableRow("Start index", String.format("0x%06X", slice.getStart())); + writer.docTableRow("Stop index", String.format("0x%06X", slice.getStop())); + writer.docTableRow("Size", Integer.toString(slice.getLength())); + writer.docTableRow("External word", Boolean.toString(slice.isExternWord())); + } + } } diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java index 9776034..5b2152b 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/cake2/fcdoc/FCDocSegmentWriterCakeWord.java @@ -23,15 +23,16 @@ package org.x4o.fc18.cake2.fcdoc; import java.io.IOException; +import java.util.Arrays; import org.x4o.fc18.cake2.FourCornerX00PetitVidePoints; +import org.x4o.o2o.io.ContentWriterHtml.Tag; import org.x4o.o2o.tdoc.ApiDocContentCss; import org.x4o.o2o.tdoc.ApiDocContentWriter; import org.x4o.o2o.tdoc.ApiDocNodeWriterMethod; import org.x4o.o2o.tdoc.dom.ApiDocNode; import org.x4o.o2o.tdoc.dom.ApiDocNodeBody; import org.x4o.o2o.tdoc.dom.ApiDocWriteEvent; -import org.xml.sax.SAXException; /** * Cake doc word writer. @@ -42,7 +43,7 @@ import org.xml.sax.SAXException; public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter { @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.SUMMARY,targetClasses={TDocCakeWord.class}) - public void writeSchemaViewSummary(ApiDocWriteEvent event) throws SAXException, IOException { + public void writeCakeWordSummary(ApiDocWriteEvent event) throws IOException { ApiDocContentWriter writer = event.getWriter(); TDocCakeWord word = (TDocCakeWord)event.getEventObject().getUserData(); FourCornerX00PetitVidePoints[] videPoints = word.getSlice().getVidePoints(); @@ -67,7 +68,7 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter { writer.docTableEnd(); } - private void writeSequence(ApiDocContentWriter writer, String system, int[] sequence) throws SAXException, IOException { + private void writeSequence(ApiDocContentWriter writer, String system, int[] sequence) throws IOException { StringBuilder buf = new StringBuilder(); for (int i = 0; i < sequence.length; i++) { int seq = sequence[i]; @@ -79,4 +80,24 @@ public class FCDocSegmentWriterCakeWord implements FCDocSegmentWriter { } writer.docTableRow(system, buf.toString()); } + + @ApiDocNodeWriterMethod(nodeBody=ApiDocNodeBody.DETAIL,targetClasses={TDocCakeWord.class}) + public void writeCakeWordDetail(ApiDocWriteEvent event) throws IOException { + ApiDocContentWriter writer = event.getWriter(); + TDocCakeWord word = (TDocCakeWord)event.getEventObject().getUserData(); + FourCornerX00PetitVidePoints[] videPoints = word.getSlice().getVidePoints(); + if (videPoints.length == 0) { + return; + } + FourCornerX00PetitVidePoints letter = videPoints[word.getOffset()]; + if (!letter.isX21()) { + return; + } + StringBuilder buf = new StringBuilder(); + Arrays.stream(letter.toX21().codePoints()).forEach(v -> buf.appendCodePoint(v)); + + writer.printTagStart(Tag.pre); + writer.printCharacters(buf.toString()); + writer.printTagEnd(Tag.pre); + } }