Top Description Inners Fields Constructors Methods
com.sun.jfx.incubator.scene.control.richtext

public Class RtfStyledOutput

extends Object
implements StyledOutput
Class Inheritance
All Implemented Interfaces
jfx.incubator.scene.control.richtext.model.StyledOutput, java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.IOException, .Writer, java.util.ArrayList, .HashMap, .List, javafx.scene.Node, javafx.scene.image.WritableImage, javafx.scene.paint.Color, com.sun.jfx.incubator.scene.control.richtext.util.RichUtils, jfx.incubator.scene.control.richtext.StyleResolver, jfx.incubator.scene.control.richtext.model.StyleAttributeMap, .StyledOutput, .StyledSegment

StyledOutput which generates RTF. RTF 1.5 Spec: https://www.biblioscape.com/rtf15_spec.htm

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
RtfStyledOutput.LookupTable<T>

RTF is unable to specify colors inline it seems, needs a color lookup table

Field Summary

Modifier and TypeField and Description
private Color
private boolean
private Color
private final RtfStyledOutput.LookupTable<Color>
private String
private Double
private final RtfStyledOutput.LookupTable<String>
private boolean
private StyleAttributeMap
private final StyleResolver
private boolean
private boolean
private boolean
private final Writer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.

public void
private static String
encode(String text)

public StyledOutput
public void
private static Color
private static void
hex2(StringBuilder sb, byte b)

private static int
private String
private static String
toInt255(double x)

private void
private void
public void
private void
private void
public void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backgroundback to summary
private Color background
boldback to summary
private boolean bold
colorback to summary
private Color color
colorTableback to summary
private final RtfStyledOutput.LookupTable<Color> colorTable
fontFamilyback to summary
private String fontFamily
fontSizeback to summary
private Double fontSize
fontTableback to summary
private final RtfStyledOutput.LookupTable<String> fontTable
italicback to summary
private boolean italic
prevStyleback to summary
private StyleAttributeMap prevStyle
resolverback to summary
private final StyleResolver resolver
startOfLineback to summary
private boolean startOfLine
strikeback to summary
private boolean strike
underback to summary
private boolean under
writerback to summary
private final Writer writer

Constructor Detail

RtfStyledOutputback to summary
public RtfStyledOutput(StyleResolver r, Writer wr)

Method Detail

checkCancelledback to summary
private static void checkCancelled() throws IOException
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
consumeback to summary
public void consume(StyledSegment seg) throws IOException

Implements jfx.incubator.scene.control.richtext.model.StyledOutput.consume.

Doc from jfx.incubator.scene.control.richtext.model.StyledOutput.consume.

Consumes the next styled segment.

Annotations
@Override
Exceptions
IOException:
when an I/O error occurs
encodeback to summary
private static String encode(String text)
firstPassBuilderback to summary
public StyledOutput firstPassBuilder()
flushback to summary
public void flush() throws IOException

Implements jfx.incubator.scene.control.richtext.model.StyledOutput.flush.

Doc from jfx.incubator.scene.control.richtext.model.StyledOutput.flush.

Flushes this output stream.

Annotations
@Override
Exceptions
IOException:
when an I/O error occurs
getTextColorback to summary
private static Color getTextColor(StyleAttributeMap a)
hex2back to summary
private static void hex2(StringBuilder sb, byte b)
indexOfSpecialCharback to summary
private static int indexOfSpecialChar(String text)
lookupFontFamilyback to summary
private String lookupFontFamily(String name)
toInt255back to summary
private static String toInt255(double x)
writeback to summary
private void write(String s) throws IOException
writeEndOfLineback to summary
private void writeEndOfLine() throws IOException
writeEpilogueback to summary
public void writeEpilogue() throws IOException
writeNewLineback to summary
private void writeNewLine() throws IOException
writeParagraphback to summary
private void writeParagraph(Node n) throws IOException
writePrologueback to summary
public void writePrologue() throws IOException
writeTextSegmentback to summary
private void writeTextSegment(StyledSegment seg) throws IOException
Annotations
@SuppressWarnings:null
com.sun.jfx.incubator.scene.control.richtext back to summary

protected Class RtfStyledOutput.LookupTable<T>

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.jfx.incubator.scene.control.richtext.RtfStyledOutput.LookupTable

RTF is unable to specify colors inline it seems, needs a color lookup table

Field Summary

Modifier and TypeField and Description
private final HashMap<T, Integer>
private final ArrayList<T>

Constructor Summary

AccessConstructor and Description
public
LookupTable(T initValue)

Method Summary

Modifier and TypeMethod and Description
public void
add(T item)

public int
getIndexFor(T c)

returns index or 0 if not found

public List<T>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

indexesback to summary
private final HashMap<T, Integer> indexes
itemsback to summary
private final ArrayList<T> items

Constructor Detail

LookupTableback to summary
public LookupTable(T initValue)

Method Detail

addback to summary
public void add(T item)
getIndexForback to summary
public int getIndexFor(T c)

returns index or 0 if not found

getItemsback to summary
public List<T> getItems()