Support for providing html views for the swing components.
Support for providing html views for the swing components. This translates a simple html string to a javax.swing.text.View implementation that can render the html and provide the necessary layout semantics.
Create an html renderer for the given component and
string of html.
pack-privatestatic int
getBaseline
(JComponent c, int y, int ascent, int w, int h)
Gets the baseline for the specified component.
Gets the baseline for the specified component. This digs out the View client property, and if non-null the baseline is calculated from it. Otherwise the baseline is the value y + ascent.
pack-privatestatic int
getBaseline
(View view, int w, int h)
publicstatic int
getHTMLBaseline
(View view, int w, int h)
Returns the baseline for the html renderer.
Returns the baseline for the html renderer.
Returns:
baseline or a value < 0 indicating there is no reasonable
baseline
Parameters: - view - the View to get the baseline for
- w - the width to get the baseline for
- h - the height to get the baseline for
Throws: - IllegalArgumentException - if width or height is < 0
Since:
1.6
See Also:FontMetrics,
JComponent.getBaseline(int,int),
Stash the HTML render for the given text into the client
properties of the given JComponent.
Stash the HTML render for the given text into the client
properties of the given JComponent. If the given text is
NOT HTML the property will be cleared of any
renderer.
This method is useful for ComponentUI implementations
that are static (i.e. shared) and get their state
entirely from the JComponent.
Key stored as a client property to indicate the base that relative
references are resolved against.
Key stored as a client property to indicate the base that relative references are resolved against. For example, lets say you keep your images in the directory resources relative to the code path, you would use the following the set the base: