Package com.smartgwt.client.types
Enum DrawingType
- All Implemented Interfaces:
ValueEnum
,Serializable
,Comparable<DrawingType>
,Constable
The type of drawing back-end used by a
DrawPane
to draw its draw items
on screen. SVG and bitmap tradeoffs
- SVG is best supported in IE9+ and Opera 12.16 and earlier, but may also be used in Chrome, Opera 15+, Firefox 4+, and Safari.
- SVG tends to be higher quality, especially when it comes to text and drawing on high-DPI displays and mobile devices.
DrawItem.zIndex
,DrawItem.bringToFront()
, andDrawItem.sendToBack()
are not supported on iOS devices in bitmap drawing mode due to platform limitations. These APIs are supported on iOS in SVG drawing mode.- Incremental updates to just a few elements of a drawing are faster in SVG, whereas whole drawing refreshes are faster in bitmap mode.
- Browsers have limits on the maximum dimensions or area of the <canvas> element used in bitmap drawing.
The limits on a <canvas> imposed by the browser translate to the same limits on the dimensions or area of a
DrawPane
using bitmap drawing. Internet Explorer, for example, limits the width and height of a <canvas> to 8192 pixels: http://msdn.microsoft.com/en-us/library/ie/ff975062(v=vs.85).aspx; therefore, in IE using bitmap drawing, aDrawPane
can be at most 8192×8192 in size. To make larger drawings, you can either switch to SVG drawing, use multipleDrawPane
s, or enabledrag-scrolling
. - In bitmap drawing, each pixel uses
around 4 to 8 bytes of memory. Large bitmap drawings can therefore use a lot of memory. A 4000×2000 bitmap drawing
will use around 31 to 61 Megabytes of memory.
Note: To minimize memory use when using bitmap drawing for a large drawing, it may be useful to employ slicing if possible. For example, if the drawing is mostly a solid color except for content located at a few small-area places on screen, aCanvas
can be created with the solid background color and oneDrawPane
can be created for each content area. EachDrawPane
isadded as a child
to theCanvas
. Theleft
andtop
properties of theDrawPane
s are used to absolutely-position them within theCanvas
parent.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetValue()
static DrawingType
Returns the enum constant of this type with the specified name.static DrawingType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SVG
Use Scalable Vector Graphics (SVG). SVG is a W3C standard supported by IE9+, Chrome, Firefox 4+, Safari, and Opera.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "svg". -
BITMAP
Use an HTML5 <canvas> element. "bitmap" drawing is supported by IE9+, Chrome, Firefox, Safari, and Opera.If this enumerated value is used in a
Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "bitmap". -
VML
Use Vector Markup Language (VML). VML is a deprecated vector graphics technology supported only by Internet Explorer 6 through 9. In IE 6, 7, and 8, "vml" drawing is the only supported drawing 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
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
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 nameNullPointerException
- if the argument is null
-
getValue
-