src/java.desktop/share/classes/javax/swing/text/GlyphView.java

Print this page




1136     /**
1137      * The prototype painter used by default.
1138      */
1139     static GlyphPainter defaultPainter;
1140 
1141     private JustificationInfo justificationInfo = null;
1142 
1143     /**
1144      * A class to perform rendering of the glyphs.
1145      * This can be implemented to be stateless, or
1146      * to hold some information as a cache to
1147      * facilitate faster rendering and model/view
1148      * translation.  At a minimum, the GlyphPainter
1149      * allows a View implementation to perform its
1150      * duties independant of a particular version
1151      * of JVM and selection of capabilities (i.e.
1152      * shaping for i18n, etc).
1153      *
1154      * @since 1.3
1155      */
1156     public static abstract class GlyphPainter {
1157 
1158         /**
1159          * Determine the span the glyphs given a start location
1160          * (for tab expansion).
1161          * @param v  the {@code GlyphView}
1162          * @param p0 the beginning position
1163          * @param p1 the ending position
1164          * @param e  how to expand the tabs when encountered
1165          * @param x the X coordinate
1166          * @return the span the glyphs given a start location
1167          */
1168         public abstract float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x);
1169 
1170         /**
1171          * Returns of the height.
1172          * @param v  the {@code GlyphView}
1173          * @return of the height
1174          */
1175         public abstract float getHeight(GlyphView v);
1176 




1136     /**
1137      * The prototype painter used by default.
1138      */
1139     static GlyphPainter defaultPainter;
1140 
1141     private JustificationInfo justificationInfo = null;
1142 
1143     /**
1144      * A class to perform rendering of the glyphs.
1145      * This can be implemented to be stateless, or
1146      * to hold some information as a cache to
1147      * facilitate faster rendering and model/view
1148      * translation.  At a minimum, the GlyphPainter
1149      * allows a View implementation to perform its
1150      * duties independant of a particular version
1151      * of JVM and selection of capabilities (i.e.
1152      * shaping for i18n, etc).
1153      *
1154      * @since 1.3
1155      */
1156     public abstract static class GlyphPainter {
1157 
1158         /**
1159          * Determine the span the glyphs given a start location
1160          * (for tab expansion).
1161          * @param v  the {@code GlyphView}
1162          * @param p0 the beginning position
1163          * @param p1 the ending position
1164          * @param e  how to expand the tabs when encountered
1165          * @param x the X coordinate
1166          * @return the span the glyphs given a start location
1167          */
1168         public abstract float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x);
1169 
1170         /**
1171          * Returns of the height.
1172          * @param v  the {@code GlyphView}
1173          * @return of the height
1174          */
1175         public abstract float getHeight(GlyphView v);
1176