Package chemaxon.util

Class HTMLTools

java.lang.Object
chemaxon.util.HTMLTools

Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed, no replacement.
Tools that can be applied in the development of servlets or JSP scripts handling JChem resources.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Converts a string to a format that can be used as a value of an applet parameter in an HTML page.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Converts a string to a format that can be used as a value of JavaScript variable in an HTML page.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates an HTML page that displays the message(s) of an exception.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Prints the message(s) of an exception in HTML format
    static Color
    Deprecated, for removal: This API element is subject to removal in a future version.
    Converts the string to a Color Object.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the HTML string representation of a Color
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Inserts the specified string before the ends of lines.
    static String
    Deprecated, for removal: This API element is subject to removal in a future version.
    Creates an HTML page that displays the specified HTML text.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • insertStringBeforeLineEnds

      public static String insertStringBeforeLineEnds(String input, String insertion)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Inserts the specified string before the ends of lines. For example, the insertion of backslash characters is needed for placing molfiles and compressed molfiles into HTML pages generated by scripts or servlets.
      Parameters:
      input - string containing line terminators
      insertion - string to be inserted into inputString before line terminators
      Returns:
      the modified string.
    • convertForJavaScript

      public static String convertForJavaScript(String input)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Converts a string to a format that can be used as a value of JavaScript variable in an HTML page. Converts line separators to UNIX style and replaces new line characters with a backslash and an "n" character.
      Parameters:
      input - original string containing line terminators
      Returns:
      the modified string.
    • convertForAppletParameter

      public static String convertForAppletParameter(String input)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Converts a string to a format that can be used as a value of an applet parameter in an HTML page. Converts line separators to UNIX style and places a backslash after line separators.
      Parameters:
      input - original string containing line terminators
      Returns:
      the modified string.
    • exceptionToString

      public static String exceptionToString(Throwable e)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Prints the message(s) of an exception in HTML format
      Parameters:
      e - the exception to convert
      Returns:
      a string containing the message.
    • stringToPage

      public static String stringToPage(String text)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an HTML page that displays the specified HTML text.
      Parameters:
      text - the content of the page
      Returns:
      a string containing the HTML page.
    • exceptionToPage

      public static String exceptionToPage(Throwable e)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an HTML page that displays the message(s) of an exception.
      Parameters:
      e - the exception to use.
      Returns:
      a string containing the HTML page.
    • getHTMLColorString

      public static String getHTMLColorString(Color color)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the HTML string representation of a Color
      Parameters:
      color - the color
      Returns:
      the HTML color string, for example #ff0000 is red.
    • getColor

      public static Color getColor(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Converts the string to a Color Object. String may be in hexadecimal HTML format, or a color constant. Supported colors:
       1.: Hexa RGB: #RRGGBB                exmaple: "#00FF00" means full green
       2.: Java awt.Color constant names    examples: "cyan", "orange", "pink"
       3.: Standard VGA colors:
            "black"         #000000
            "white"         #FFFFFF
            "red"           #FF0000
            "yellow"        #FFFF00
            "lime"          #00FF00
            "aqua"          #00FFFF
            "blue"          #0000FF
            "fuchsia"       #FF00FF
            "gray"          #808080
            "silver"        #C0C0C0
            "maroon"        #800000
            "olive"         #808000
            "green"         #008000
            "teal"          #008080
            "navy"          #000080
            "purple"        #800080
       4.: Other colors:
            "brown"         #5C3317
           "darkgreen"     #006400
       
      Parameters:
      s - the color String to be parsed
      Returns:
      the corresponding Color object, or null, if parsing was not successful since 2.2