Enum DrawingType

java.lang.Object
java.lang.Enum<DrawingType>
com.smartgwt.client.types.DrawingType
All Implemented Interfaces:
ValueEnum, Serializable, Comparable<DrawingType>, Constable

public enum DrawingType extends Enum<DrawingType> implements ValueEnum
The drawing back-end a DrawPane uses to render its draw items.

Defaults to "svg", which every supported browser provides. There is normally no reason to change this, and "svg" is the better choice for almost any drawing:

  • Higher quality, particularly for text and on high-DPI displays.
  • Faster for incremental updates — changing a few properties touches only those elements, where bitmap drawing repaints the whole pane. On first paint the two measured about the same: for a 2,500-point scatter plot, SVG was marginally quicker than bitmap in both Chrome and Firefox.
  • No size ceiling. Browsers cap <canvas> dimensions at around 65,000px, and a DrawPane in bitmap drawing inherits that cap. SVG panes have no comparable limit.
  • No bitmap memory cost. A bitmap drawing spends roughly 4 to 8 bytes per pixel, so a 4000×2000 pane costs 31–61MB; the same drawing in SVG costs nothing comparable.
  • DrawItem.zIndex, DrawItem.bringToFront() and DrawItem.sendToBack() work for every item. In bitmap drawing on iOS, DrawLabels default to HTML rendering and those three APIs do not apply to them; set useHTML:false on the label to opt out.

Choose "bitmap" only for a drawing that is rebuilt wholesale far more often than it is updated in place, and that stays well inside the browser's canvas size limit.

  • Enum Constant Details

    • SVG

      public static final DrawingType SVG
      Scalable Vector Graphics. The default, and available in every supported browser.

      If this enumerated value is used in a Component XML file or server-side DataSource descriptor (.ds.xml file), use the value "svg".

    • BITMAP

      public static final DrawingType BITMAP
      An HTML5 <canvas> element. See the limits above.

      If this enumerated value is used in a Component XML file or server-side DataSource descriptor (.ds.xml file), use the value "bitmap".

    • VML

      public static final DrawingType VML
      Vector Markup Language, an Internet Explorer technology. Retained for backwards compatibility only: Internet Explorer is not a supported browser, and no supported browser selects this back-end.

      If this enumerated value is used in a Component XML file or server-side DataSource descriptor (.ds.xml file), use the value "vml".

  • Method Details

    • values

      public static DrawingType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DrawingType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public String getValue()
      Specified by:
      getValue in interface ValueEnum