|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.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 HTMLEditorKit |
_kit
|
protected Image |
_rendered
|
protected Rectangle |
_rsize
|
protected StyleSheet |
_style
|
protected HTMLView.BridgeView |
_view
|
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
_alpha, _backgrounds, _borders, _colors, _ctx, _cursor, _enabled, _height, _hover, _hoverable, _insets, _listeners, _parent, _preferredSize, _properties, _rect, _styleConfigs, _tipmouse, _tiptext, _tooltipStyle, _transferHandler, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Constructor Summary | |
|---|---|
HTMLView(GlContext ctx)
Creates a blank HTML view. |
|
HTMLView(GlContext ctx,
String stylesheet,
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()
|
HTMLEditorKit |
getEditorKit()
Returns the HTML editor kit used by this view. |
StyleSheet |
getStyleSheet()
Returns the stylesheet in effect for this view. |
protected void |
layout()
Instructs this component to lay itself out. |
protected void |
renderComponent(Renderer renderer)
Renders any custom bits for this component. |
void |
setAntialiased(boolean antialias)
Configures whether or not our text is antialiased. |
void |
setContents(HTMLDocument document)
Configures the contents of this HTML view. |
void |
setContents(String contents)
Configures the contents of this HTML view. |
void |
setStyleSheet(String stylesheet)
Configures the stylesheet used to render HTML in this view. |
void |
setStyleSheet(StyleSheet stylesheet)
Configures the stylesheet used to render HTML in this view. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected StyleSheet _style
protected Rectangle _rsize
protected HTMLView.BridgeView _view
protected Image _rendered
protected boolean _antialias
protected HTMLEditorKit _kit
| Constructor Detail |
|---|
public HTMLView(GlContext ctx)
setContents(java.lang.String).
public HTMLView(GlContext ctx,
String stylesheet,
String contents)
| Method Detail |
|---|
public void setAntialiased(boolean antialias)
public void setStyleSheet(String stylesheet)
public void setStyleSheet(StyleSheet stylesheet)
public StyleSheet getStyleSheet()
public HTMLEditorKit getEditorKit()
public void setContents(String contents)
public void setContents(HTMLDocument document)
protected void layout()
Component
layout in class Componentprotected void renderComponent(Renderer renderer)
Component
renderComponent in class Component
protected Dimension computePreferredSize(int whint,
int hhint)
Component
computePreferredSize in class Componentprotected void forceRelayout()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||