Package com.mxgraph.shape
Class mxHtmlTextShape
java.lang.Object
com.mxgraph.shape.mxHtmlTextShape
- All Implemented Interfaces:
mxITextShape
To set global CSS for all HTML labels, use the following code:
mxGraphics2DCanvas.putTextShape(mxGraphics2DCanvas.TEXT_SHAPE_HTML,
new mxHtmlTextShape()
{
protected String createHtmlDocument(Mapinvalid input: '<'String, Object> style, String text)
{
return mxUtils.createHtmlDocument(style, text, 1, 0,
"invalid input: '<'style type=\"text/css\">.selectRef { " +
"font-size:9px;font-weight:normal; }");
}
}
);
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanSpecifies if linefeeds should be replaced with breaks in HTML markup. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateHtmlDocument(Map<String, Object> style, String text, int w, int h) booleanReturns replaceHtmlLinefeedsvoidpaintShape(mxGraphics2DCanvas canvas, String text, mxCellState state, Map<String, Object> style) voidsetReplaceHtmlLinefeeds(boolean value) Returns replaceHtmlLinefeeds
-
Field Details
-
replaceHtmlLinefeeds
protected boolean replaceHtmlLinefeedsSpecifies if linefeeds should be replaced with breaks in HTML markup. Default is true.
-
-
Constructor Details
-
mxHtmlTextShape
public mxHtmlTextShape()
-
-
Method Details
-
isReplaceHtmlLinefeeds
public boolean isReplaceHtmlLinefeeds()Returns replaceHtmlLinefeeds -
setReplaceHtmlLinefeeds
public void setReplaceHtmlLinefeeds(boolean value) Returns replaceHtmlLinefeeds -
createHtmlDocument
-
paintShape
public void paintShape(mxGraphics2DCanvas canvas, String text, mxCellState state, Map<String, Object> style) - Specified by:
paintShapein interfacemxITextShape
-