LabelView is a styled chunk of text
that represents a view mapped over an element in the
text model. It caches the character level attributes
used for rendering.
| Modifier and Type | Field and Description |
|---|---|
| private Color | |
| private Color | |
| private Font | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | changedUpdate(DocumentEvent
the change information from the associated document e, Shape the current allocation of the view a, ViewFactory the factory to use to rebuild if the view has children f)Overrides javax. Gives notification from the document that attributes were changed in a location that this view is responsible for. |
| public Color | Returns: the cached background colorOverrides javax. Fetches the background color to use to render the glyphs. |
| public Font | Returns: the cached fontOverrides javax. Fetches the font that the glyphs should be based upon. |
| protected FontMetrics | Returns: theFontMetrics used for this view
Deprecated
FontMetrics are not used for glyph rendering
when running in the JDK.
Fetches the |
| public Color | Returns: the cached foreground colorOverrides javax. Fetches the foreground color to use to render the glyphs. |
| public boolean | Returns: the value of the cachedstrikeThrough propertyOverrides javax. Determines if the glyphs should have a strikethrough line. |
| public boolean | Returns: the value of the cachedsubscript propertyOverrides javax. Determines if the glyphs should be rendered as superscript. |
| public boolean | Returns: the value of the cachedsuperscript propertyOverrides javax. Determines if the glyphs should be rendered as subscript. |
| public boolean | Returns: the value of the cachedunderline propertyOverrides javax. Determines if the glyphs should be underlined. |
| protected void | |
| protected void | |
| protected void | setStrikeThrough(boolean
true if the view has a strike/line
through it, otherwise false s)Sets whether or not the view has a strike/line through it. |
| protected void | setSubscript(boolean
true if the view represents a
subscript, otherwise false s)Sets whether or not the view represents a subscript. |
| protected void | setSuperscript(boolean
true if the view represents a
superscript, otherwise false s)Sets whether or not the view represents a superscript. |
| protected void | setUnderline(boolean
true if the view is underlined, otherwise
false u)Sets whether or not the view is underlined. |
| pack-priv final void |
| bg | back to summary |
|---|---|
| private Color bg | |
| fg | back to summary |
|---|---|
| private Color fg | |
| font | back to summary |
|---|---|
| private Font font | |
| strike | back to summary |
|---|---|
| private boolean strike | |
| subscript | back to summary |
|---|---|
| private boolean subscript | |
| superscript | back to summary |
|---|---|
| private boolean superscript | |
| underline | back to summary |
|---|---|
| private boolean underline | |
| LabelView | back to summary |
|---|---|
| public LabelView(Element elem) Constructs a new view wrapped on an element.
| |
| changedUpdate | back to summary |
|---|---|
| public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) Overrides javax. Gives notification from the document that attributes were changed in a location that this view is responsible for.
| |
| getBackground | back to summary |
|---|---|
| public Color getBackground() Overrides javax. Fetches the background color to use to render the glyphs.
This is implemented to return a cached background color,
which defaults to
| |
| getFont | back to summary |
|---|---|
| public Font getFont() Overrides javax. Fetches the font that the glyphs should be based upon. This is implemented to return a cached font.
| |
| getFontMetrics | back to summary |
|---|---|
| protected FontMetrics getFontMetrics()
Deprecated FontMetrics are not used for glyph rendering when running in the JDK. Fetches the
| |
| getForeground | back to summary |
|---|---|
| public Color getForeground() Overrides javax. Fetches the foreground color to use to render the glyphs.
This is implemented to return a cached foreground color,
which defaults to
| |
| isStrikeThrough | back to summary |
|---|---|
| public boolean isStrikeThrough() Overrides javax. Determines if the glyphs should have a strikethrough
line. If true, a line should be drawn through the center
of the glyphs. This is implemented to return the
cached When you request this property,
| |
| isSubscript | back to summary |
|---|---|
| public boolean isSubscript() Overrides javax. Determines if the glyphs should be rendered as superscript. When you request this property,
| |
| isSuperscript | back to summary |
|---|---|
| public boolean isSuperscript() Overrides javax. Determines if the glyphs should be rendered as subscript. When you request this property,
| |
| isUnderline | back to summary |
|---|---|
| public boolean isUnderline() Overrides javax. Determines if the glyphs should be underlined. If true, an underline should be drawn through the baseline. This is implemented to return the cached underline property. When you request this property,
| |
| setBackground | back to summary |
|---|---|
| protected void setBackground(Color bg) Sets the background color for the view. This method is typically
invoked as part of configuring this
| |
| setPropertiesFromAttributes | back to summary |
|---|---|
| protected void setPropertiesFromAttributes() Sets the cached properties from the attributes. | |
| setStrikeThrough | back to summary |
|---|---|
| protected void setStrikeThrough(boolean s) Sets whether or not the view has a strike/line through it. Note that this setter is protected and is really only meant if you need to update some additional state when set.
| |
| setSubscript | back to summary |
|---|---|
| protected void setSubscript(boolean s) Sets whether or not the view represents a subscript. Note that this setter is protected and is really only meant if you need to update some additional state when set.
| |
| setSuperscript | back to summary |
|---|---|
| protected void setSuperscript(boolean s) Sets whether or not the view represents a superscript. Note that this setter is protected and is really only meant if you need to update some additional state when set.
| |
| setUnderline | back to summary |
|---|---|
| protected void setUnderline(boolean u) Sets whether or not the view is underlined. Note that this setter is protected and is really only meant if you need to update some additional state when set.
| |
| sync | back to summary |
|---|---|
| pack-priv final void sync() Synchronize the view's cached values with the model. This causes the font, metrics, color, etc to be re-cached if the cache has been invalidated. | |