Class HTMLHelper
- java.lang.Object
-
- com.nomagic.magicdraw.uml.symbols.shapes.html.HTMLHelper
-
@OpenApiAll public class HTMLHelper extends java.lang.Object
The class is used for html document creation.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MD_ICON_TAG
-
Constructor Summary
Constructors Constructor Description HTMLHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String
applyFontSizeStyleSheetColorOnP(java.lang.String html, java.awt.Font font, boolean ptUnits, int red, int green, int blue)
Deprecated.useHtmlStyleUtils.applyFontSizeStyleSheetColorOnP(String, Font, boolean, int, int, int)
static java.lang.String
applyFontSizeStyleSheetOnP(java.lang.String html, java.awt.Font font, boolean ptUnits)
Deprecated.useHtmlStyleUtils.applyFontSizeStyleSheetOnP(String, Font, boolean)
static void
applyStyleSheet(javax.swing.text.html.StyleSheet styles, com.nomagic.magicdraw.uml.symbols.shapes.TextObject obj, boolean takeZoomFactor)
Changes the properties of the given style sheet according to the properties of the given text object.static java.lang.String
constructHTMLText(java.lang.String text)
Deprecated.static java.lang.String
constructHTMLText(java.lang.String text, boolean convertCharacters, boolean addEnterAfterP)
Deprecated.useHtmlTextUtilsInternal.toHtmlText(String, boolean, boolean)
static javax.swing.text.html.HTMLDocument
createDefaultDocument(com.nomagic.magicdraw.uml.symbols.shapes.TextObject obj)
Creates the html document for given text object with given style sheet.static javax.swing.text.View
createHTMLView(com.nomagic.magicdraw.uml.symbols.shapes.TextObject object, java.lang.String html, Project project)
Create a html renderer for the text object and string of html.static javax.swing.text.View
createHTMLView(java.lang.String html, javax.swing.text.StyledDocument doc, Project project)
static javax.swing.text.View
createHTMLView(java.lang.String html, javax.swing.text.StyledDocument document, Project project, ShapeElement object, boolean useAlphaChannelForTransparency)
Create html renderer for the html text and document containerstatic javax.swing.text.View
createHTMLView(java.lang.String html, javax.swing.text.StyledDocument document, Project project, ShapeElement object, boolean useAlphaChannelForTransparency, javax.swing.JTextPane customContainer)
Create html renderer for the html text and document containerstatic java.net.URL
getDocumentBase()
static java.lang.String
getHTMLBody(java.lang.String text)
Deprecated.static java.lang.String
getPureText(javax.swing.text.Document doc)
Deprecated.static java.lang.String
getPureTextFromHTMLSource(java.lang.String source)
Deprecated.static boolean
isHTMLText(java.lang.String text)
Deprecated.static java.lang.String
makeEndTag(java.lang.String tag)
Deprecated.static java.lang.String
makeStartTag(java.lang.String tag)
Deprecated.static java.lang.String
removeHTMLHeader(java.lang.String text)
Deprecated.static void
setPStyleProperties(javax.swing.text.html.StyleSheet styleSheet, int fontSize, java.lang.String family, java.awt.Color foreground)
Set Style propertystatic java.lang.String
stringToHTMLString(java.lang.String string)
Deprecated.static java.lang.String
wrapAsHTML(java.lang.String text)
Deprecated.static java.lang.StringBuilder
wrapAsHTML(java.lang.StringBuilder text)
Deprecated.static java.lang.String
wrapAsHTMLDocument(java.lang.String text)
Deprecated.static java.lang.String
wrapByHtmlBody(java.lang.String text)
Deprecated.
-
-
-
Field Detail
-
MD_ICON_TAG
public static final java.lang.String MD_ICON_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDocumentBase
public static java.net.URL getDocumentBase()
-
createHTMLView
public static javax.swing.text.View createHTMLView(com.nomagic.magicdraw.uml.symbols.shapes.TextObject object, java.lang.String html, @CheckForNull Project project)
Create a html renderer for the text object and string of html.- Parameters:
object
- the given text object.html
- the given html text.
-
createHTMLView
@Deprecated public static javax.swing.text.View createHTMLView(java.lang.String html, javax.swing.text.StyledDocument doc, @CheckForNull Project project)
-
createHTMLView
public static javax.swing.text.View createHTMLView(java.lang.String html, javax.swing.text.StyledDocument document, @CheckForNull Project project, @CheckForNull ShapeElement object, boolean useAlphaChannelForTransparency)
Create html renderer for the html text and document container- Parameters:
html
- the given html textdocument
- documentobject
- the given text object
-
createHTMLView
public static javax.swing.text.View createHTMLView(java.lang.String html, javax.swing.text.StyledDocument document, @CheckForNull Project project, @CheckForNull ShapeElement object, boolean useAlphaChannelForTransparency, @CheckForNull javax.swing.JTextPane customContainer)
Create html renderer for the html text and document container- Parameters:
html
- the given html textdocument
- documentobject
- the given text objectcustomContainer
- custom renderer component. Used to override font metrics
-
createDefaultDocument
public static javax.swing.text.html.HTMLDocument createDefaultDocument(com.nomagic.magicdraw.uml.symbols.shapes.TextObject obj)
Creates the html document for given text object with given style sheet.- Parameters:
obj
- the text object.
-
applyStyleSheet
public static void applyStyleSheet(javax.swing.text.html.StyleSheet styles, com.nomagic.magicdraw.uml.symbols.shapes.TextObject obj, boolean takeZoomFactor)
Changes the properties of the given style sheet according to the properties of the given text object.- Parameters:
styles
- the given style sheet.obj
- the given text object.
-
setPStyleProperties
public static void setPStyleProperties(javax.swing.text.html.StyleSheet styleSheet, int fontSize, java.lang.String family, java.awt.Color foreground)
Set Style property- Parameters:
styleSheet
- Style sheetfontSize
- Font sizefamily
- Font Familyforeground
- foreground color
-
applyFontSizeStyleSheetOnP
@Deprecated public static java.lang.String applyFontSizeStyleSheetOnP(java.lang.String html, java.awt.Font font, boolean ptUnits)
Deprecated.useHtmlStyleUtils.applyFontSizeStyleSheetOnP(String, Font, boolean)
-
applyFontSizeStyleSheetColorOnP
@Deprecated public static java.lang.String applyFontSizeStyleSheetColorOnP(java.lang.String html, java.awt.Font font, boolean ptUnits, int red, int green, int blue)
Deprecated.useHtmlStyleUtils.applyFontSizeStyleSheetColorOnP(String, Font, boolean, int, int, int)
-
wrapAsHTML
@Deprecated public static java.lang.String wrapAsHTML(java.lang.String text)
Deprecated.
-
wrapAsHTML
@Deprecated public static java.lang.StringBuilder wrapAsHTML(java.lang.StringBuilder text)
Deprecated.
-
wrapAsHTMLDocument
@Deprecated public static java.lang.String wrapAsHTMLDocument(java.lang.String text)
Deprecated.
-
wrapByHtmlBody
@Deprecated public static java.lang.String wrapByHtmlBody(java.lang.String text)
Deprecated.
-
stringToHTMLString
@Deprecated public static java.lang.String stringToHTMLString(java.lang.String string)
Deprecated.
-
getPureText
@Deprecated public static java.lang.String getPureText(javax.swing.text.Document doc)
Deprecated.
-
getPureTextFromHTMLSource
@Deprecated public static java.lang.String getPureTextFromHTMLSource(java.lang.String source)
Deprecated.
-
isHTMLText
@Deprecated public static boolean isHTMLText(@CheckForNull java.lang.String text)
Deprecated.
-
removeHTMLHeader
@Deprecated public static java.lang.String removeHTMLHeader(java.lang.String text)
Deprecated.
-
getHTMLBody
@Deprecated public static java.lang.String getHTMLBody(java.lang.String text)
Deprecated.
-
constructHTMLText
@Deprecated public static java.lang.String constructHTMLText(java.lang.String text)
Deprecated.
-
constructHTMLText
@Deprecated public static java.lang.String constructHTMLText(java.lang.String text, boolean convertCharacters, boolean addEnterAfterP)
Deprecated.useHtmlTextUtilsInternal.toHtmlText(String, boolean, boolean)
-
makeStartTag
@Deprecated public static java.lang.String makeStartTag(java.lang.String tag)
Deprecated.
-
makeEndTag
@Deprecated public static java.lang.String makeEndTag(java.lang.String tag)
Deprecated.
-
-