javax.swing.text.html
Class ImageView.ImageLabelView
java.lang.Object
javax.swing.text.View
javax.swing.text.GlyphView
javax.swing.text.LabelView
javax.swing.text.html.InlineView
javax.swing.text.html.ImageView.ImageLabelView
- All Implemented Interfaces:
- Cloneable, SwingConstants, TabableView
- Enclosing class:
- ImageView
- private class ImageView.ImageLabelView
- extends InlineView
ImageLabelView is used if the image can't be loaded, and
the attribute specified an alt attribute. It overriden a handle of
methods as the text is hardcoded and does not come from the document.
Fields inherited from class javax.swing.text.html.InlineView |
|
Fields inherited from class javax.swing.text.LabelView |
|
Fields inherited from class javax.swing.text.GlyphView |
|
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Method Summary |
View |
breakView(int axis,
int p0,
float pos,
float len)
Breaks this view on the given axis at the given length.
|
int |
getEndOffset()
Fetches the portion of the model that this view is responsible for. |
Color |
getForeground()
Fetches the foreground color to use to render the glyphs.
|
int |
getStartOffset()
Fetches the portion of the model that this view is responsible for. |
Segment |
getText(int p0,
int p1)
Fetch a reference to the text that occupies
the given range. |
void |
paint(Graphics g,
Shape a)
Renders a portion of a text style run. |
void |
reset(String text)
|
Methods inherited from class javax.swing.text.LabelView |
getBackground, getFont, getFontMetrics, isStrikeThrough, isSubscript, isSuperscript, isUnderline, setStrikeThrough, setSubscript, setSuperscript, setUnderline |
Methods inherited from class javax.swing.text.GlyphView |
checkPainter, clone, createFragment, getAlignment, getGlyphPainter, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getTabbedSpan, getTabExpander, insertUpdate, modelToView, removeUpdate, setGlyphPainter, viewToModel |
Methods inherited from class javax.swing.text.View |
append, forwardUpdate, forwardUpdateToView, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getMinimumSpan, getParent, getResizeWeight, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModel |
segment
private Segment segment
fg
private Color fg
ImageView.ImageLabelView
ImageView.ImageLabelView(Element e,
String text)
reset
public void reset(String text)
paint
public void paint(Graphics g,
Shape a)
- Description copied from class:
GlyphView
- Renders a portion of a text style run.
- Overrides:
paint
in class GlyphView
- Parameters:
g
- the rendering surface to usea
- the allocated region to render into
getText
public Segment getText(int p0,
int p1)
- Description copied from class:
GlyphView
- Fetch a reference to the text that occupies
the given range. This is normally used by
the GlyphPainter to determine what characters
it should render glyphs for.
- Overrides:
getText
in class GlyphView
- Parameters:
p0
- the starting document offset >= 0p1
- the ending document offset >= p0
- Returns:
- the
Segment
containing the text
getStartOffset
public int getStartOffset()
- Description copied from class:
GlyphView
- Fetches the portion of the model that this view is responsible for.
- Overrides:
getStartOffset
in class GlyphView
- Returns:
- the starting offset into the model
- See Also:
View.getStartOffset()
getEndOffset
public int getEndOffset()
- Description copied from class:
GlyphView
- Fetches the portion of the model that this view is responsible for.
- Overrides:
getEndOffset
in class GlyphView
- Returns:
- the ending offset into the model
- See Also:
View.getEndOffset()
breakView
public View breakView(int axis,
int p0,
float pos,
float len)
- Description copied from class:
GlyphView
- Breaks this view on the given axis at the given length.
This is implemented to attempt to break on a whitespace
location, and returns a fragment with the whitespace at
the end. If a whitespace location can't be found, the
nearest character is used.
- Overrides:
breakView
in class GlyphView
- Parameters:
axis
- may be either View.X_AXIS or View.Y_AXISp0
- the location in the model where the
fragment should start it's representation >= 0.pos
- the position along the axis that the
broken view would occupy >= 0. This may be useful for
things like tab calculations.len
- specifies the distance along the axis
where a potential break is desired >= 0.
- Returns:
- the fragment of the view that represents the
given span, if the view can be broken. If the view
doesn't support breaking behavior, the view itself is
returned.
- See Also:
View.breakView(int, int, float, float)
getForeground
public Color getForeground()
- Description copied from class:
LabelView
- Fetches the foreground color to use to render the glyphs.
This is implemented to return a cached foreground color,
which defaults to
null
.
- Overrides:
getForeground
in class LabelView
- Returns:
- the cached foreground color