< prev index next >

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

Print this page

        

*** 100,116 **** --- 100,118 ---- /** * Fetch the currently installed glyph painter. * If a painter has not yet been installed, and * a default was not yet needed, null is returned. + * @return the currently installed glyph painter */ public GlyphPainter getGlyphPainter() { return painter; } /** * Sets the painter to use for rendering glyphs. + * @param p the painter to use for rendering glyphs */ public void setGlyphPainter(GlyphPainter p) { painter = p; }
*** 142,151 **** --- 144,154 ---- * Fetch the background color to use to render the * glyphs. If there is no background color, null should * be returned. This is implemented to call * <code>StyledDocument.getBackground</code> if the associated * document is a styled document, otherwise it returns null. + * @return the background color to use to render the glyphs */ public Color getBackground() { Document doc = getDocument(); if (doc instanceof StyledDocument) { AttributeSet attr = getAttributes();
*** 163,172 **** --- 166,176 ---- * <code>StyledDocument.getBackground</code> if the associated * document is a StyledDocument. If the associated document * is not a StyledDocument, the associated components foreground * color is used. If there is no associated component, null * is returned. + * @return the foreground color to use to render the glyphs */ public Color getForeground() { Document doc = getDocument(); if (doc instanceof StyledDocument) { AttributeSet attr = getAttributes();
*** 185,194 **** --- 189,199 ---- * <code>StyledDocument.getFont</code> if the associated * document is a StyledDocument. If the associated document * is not a StyledDocument, the associated components font * is used. If there is no associated component, null * is returned. + * @return the font that the glyphs should be based upon */ public Font getFont() { Document doc = getDocument(); if (doc instanceof StyledDocument) { AttributeSet attr = getAttributes();
*** 202,245 **** --- 207,255 ---- } /** * Determine if the glyphs should be underlined. If true, * an underline should be drawn through the baseline. + * @return if the glyphs should be underlined */ public boolean isUnderline() { AttributeSet attr = getAttributes(); return StyleConstants.isUnderline(attr); } /** * Determine if the glyphs should have a strikethrough * line. If true, a line should be drawn through the center * of the glyphs. + * @return if the glyphs should have a strikethrough line */ public boolean isStrikeThrough() { AttributeSet attr = getAttributes(); return StyleConstants.isStrikeThrough(attr); } /** * Determine if the glyphs should be rendered as superscript. + * @return if the glyphs should be rendered as superscript */ public boolean isSubscript() { AttributeSet attr = getAttributes(); return StyleConstants.isSubscript(attr); } /** * Determine if the glyphs should be rendered as subscript. + * @return if the glyphs should be rendered as subscript */ public boolean isSuperscript() { AttributeSet attr = getAttributes(); return StyleConstants.isSuperscript(attr); } /** * Fetch the TabExpander to use if tabs are present in this view. + * @return the TabExpander to use if tabs are present in this view */ public TabExpander getTabExpander() { return expander; }
*** 1146,1166 **** --- 1156,1202 ---- public static abstract class GlyphPainter { /** * Determine the span the glyphs given a start location * (for tab expansion). + * @return the span the glyphs given a start location + * @param v the {@code GlyphView} + * @param p0 the beginning position + * @param p1 the ending position + * @param e how to expand the tabs when encountered + * @param x the X coordinate */ public abstract float getSpan(GlyphView v, int p0, int p1, TabExpander e, float x); + /** + * Returns of the height. + * @return of the height + * @param v the {@code GlyphView} + */ public abstract float getHeight(GlyphView v); + /** + * Returns of the ascent. + * @return of the ascent + * @param v the {@code GlyphView} + */ public abstract float getAscent(GlyphView v); + /** + * Returns of the descent. + * @return of the descent + * @param v the {@code GlyphView} + */ public abstract float getDescent(GlyphView v); /** * Paint the glyphs representing the given range. + * @param v the {@code GlyphView} + * @param g the graphics context + * @param a the current allocation of the view + * @param p0 the beginning position + * @param p1 the ending position */ public abstract void paint(GlyphView v, Graphics g, Shape a, int p0, int p1); /** * Provides a mapping from the document model coordinate space
*** 1229,1238 **** --- 1265,1275 ---- * the painter doesn't hold any significant state, it can * return itself. The default behavior is to return itself. * @param v the <code>GlyphView</code> to provide a painter for * @param p0 the starting document offset &gt;= 0 * @param p1 the ending document offset &gt;= p0 + * @return a painter to use for the given GlyphView */ public GlyphPainter getPainter(GlyphView v, int p0, int p1) { return this; }
< prev index next >