|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jmex.bui.BComponent
com.jmex.bui.text.HTMLView
public class HTMLView
Displays HTML using Java's HTML rendering support to layout and render the HTML. This is not a part of the text factory system as we're not going to write our own HTML renderer to avoid dependence on Sun's JDK. If you don't want to depend on that, don't use this class.
Note: width and height hints do not work. The Java HTML code doesn't seem to handle being sized to a particular width or height and then determining its preferred span along the other axis. So we always get the "natural" preferred size of the HTML without any forced wrapping. Of course if the component is forcibly made smaller, the HTML will be wrapped, but it may not fit in the vertical or horizontal space made available. Caveat user.
| Nested Class Summary | |
|---|---|
protected class |
HTMLView.BridgeView
|
| Field Summary | |
|---|---|
protected boolean |
_antialias
|
protected javax.swing.text.html.HTMLEditorKit |
_kit
|
protected BImage |
_rendered
|
protected java.awt.Rectangle |
_rsize
|
protected javax.swing.text.html.StyleSheet |
_style
|
protected HTMLView.BridgeView |
_view
|
| Fields inherited from class com.jmex.bui.BComponent |
|---|
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Constructor Summary | |
|---|---|
HTMLView()
Creates a blank HTML view. |
|
HTMLView(java.lang.String stylesheet,
java.lang.String contents)
Creates an HTML view with the specified contents. |
|
| Method Summary | |
|---|---|
protected Dimension |
computePreferredSize(int whint,
int hhint)
Computes and returns a preferred size for this component. |
protected void |
forceRelayout()
|
javax.swing.text.html.HTMLEditorKit |
getEditorKit()
Returns the HTML editor kit used by this view. |
javax.swing.text.html.StyleSheet |
getStyleSheet()
Returns the stylesheet in effect for this view. |
protected void |
layout()
Instructs this component to lay itself out. |
protected void |
release()
|
protected void |
renderComponent(com.jme.renderer.Renderer renderer)
Renders any custom bits for this component. |
void |
setAntialiased(boolean antialias)
Configures whether or not our text is antialiased. |
void |
setContents(javax.swing.text.html.HTMLDocument document)
Configures the contents of this HTML view. |
void |
setContents(java.lang.String contents)
Configures the contents of this HTML view. |
void |
setStyleSheet(java.lang.String stylesheet)
Configures the stylesheet used to render HTML in this view. |
void |
setStyleSheet(javax.swing.text.html.StyleSheet stylesheet)
Configures the stylesheet used to render HTML in this view. |
protected void |
wasRemoved()
This method is called when we are removed from a hierarchy that is connected to a top-level window. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected javax.swing.text.html.StyleSheet _style
protected java.awt.Rectangle _rsize
protected HTMLView.BridgeView _view
protected BImage _rendered
protected boolean _antialias
protected javax.swing.text.html.HTMLEditorKit _kit
| Constructor Detail |
|---|
public HTMLView()
setContents(java.lang.String).
public HTMLView(java.lang.String stylesheet,
java.lang.String contents)
| Method Detail |
|---|
public void setAntialiased(boolean antialias)
public void setStyleSheet(java.lang.String stylesheet)
public void setStyleSheet(javax.swing.text.html.StyleSheet stylesheet)
public javax.swing.text.html.StyleSheet getStyleSheet()
public javax.swing.text.html.HTMLEditorKit getEditorKit()
public void setContents(java.lang.String contents)
public void setContents(javax.swing.text.html.HTMLDocument document)
protected void wasRemoved()
BComponentBComponent.wasAdded(), this is a fine place
to do so.
wasRemoved in class BComponentprotected void layout()
BComponent
layout in class BComponentprotected void renderComponent(com.jme.renderer.Renderer renderer)
BComponent
renderComponent in class BComponent
protected Dimension computePreferredSize(int whint,
int hhint)
BComponent
computePreferredSize in class BComponentprotected void forceRelayout()
protected void release()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||