com.smartgwt.client.widgets.drawing

## Class DrawItem

- java.lang.Object
- - com.smartgwt.client.core.BaseClass
  - - com.smartgwt.client.widgets.drawing.DrawItem

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers, HasClickHandlers, HasDragMoveHandlers, HasDragResizeMoveHandlers, HasDragStartHandlers, HasDragStopHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMovedHandlers, HasResizedHandlers, HasShowContextMenuHandlers
  Direct Known Subclasses:
    DrawCurve, DrawGroup, DrawImage, DrawLabel, DrawLine, DrawLinePath, DrawOval, DrawPath, DrawRect, DrawSector

      public class DrawItem
      extends BaseClass
      implements HasClickHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMovedHandlers, HasDragMoveHandlers, HasDragResizeMoveHandlers, HasDragStartHandlers, HasDragStopHandlers, HasResizedHandlers, HasShowContextMenuHandlers

  Base class for graphical elements drawn in a DrawPane. All properties and methods documented here are available on all DrawItems unless otherwise specified.

  Note that DrawItems as such should never be created, only concrete subclasses such as `DrawGroup` and `DrawLine`.

  See `DrawPane` for the different approaches to create DrawItems.

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.BaseClass

      `config, id, scClassName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DrawItem()`
    `DrawItem(com.google.gwt.core.client.JavaScriptObject jsObj)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.gwt.event.shared.HandlerRegistration` | `addClickHandler(ClickHandler handler)` Add a click handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addDragMoveHandler(DragMoveHandler handler)` Add a dragMove handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addDragResizeMoveHandler(DragResizeMoveHandler handler)` Add a dragResizeMove handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addDragStartHandler(DragStartHandler handler)` Add a dragStart handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addDragStopHandler(DragStopHandler handler)` Add a dragStop handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addMouseDownHandler(MouseDownHandler handler)` Add a mouseDown handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addMouseMoveHandler(MouseMoveHandler handler)` Add a mouseMove handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addMouseOutHandler(MouseOutHandler handler)` Add a mouseOut handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addMouseOverHandler(MouseOverHandler handler)` Add a mouseOver handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addMouseUpHandler(MouseUpHandler handler)` Add a mouseUp handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addMovedHandler(MovedHandler handler)` Add a moved handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addResizedHandler(ResizedHandler handler)` Add a resized handler.
    `com.google.gwt.event.shared.HandlerRegistration` | `addShowContextMenuHandler(ShowContextMenuHandler handler)` Add a showContextMenu handler.
    `float` | `computeAngle(int px1, int py1, int px2, int py2)` returns the angle in degrees between any two points
    `double` | `computeAngleAsDouble(int px1, int py1, int px2, int py2)` returns the angle in degrees between any two points
    `com.google.gwt.core.client.JavaScriptObject` | `create()`
    `void` | `dragResizeMove(java.lang.String position, java.lang.Integer x, java.lang.Integer y, java.lang.Integer dX, java.lang.Integer dY)` If `canDrag` and `canDrag` are both true and the `control knobs` include "resize" knobs, then this notification method will be fired when the user drag-resizes the draw item.
    `void` | `draw()` Draw this item into its current `DrawPane`.
    `void` | `erase()` Erase this drawItem's visual representation and remove it from its DrawGroup (if any) and DrawPane.
    `protected int[]` | `getAttributeAsIntArray(java.lang.String property)`
    `int[]` | `getBoundingBox()` Returns the startPoint endPoint
    `java.lang.Boolean` | `getCanDrag()` Is this drawItem draggable? Note that dragging must be enabled for the dragPane in which this item is rendered via `canDrag` for this to have an effect.
    `java.lang.Boolean` | `getCanHover()` Will this DrawItem fire hover events when the user hovers over it?
    `int[]` | `getCenter()` Get the center coordinates of the rectangle
    `Menu` | `getContextMenu()` Context menu to show for this object, an instance of the Menu widget.
    `Cursor` | `getCursor()` If set, specifies the cursor to display when the mouse pointer is over this DrawItem.
    `java.lang.Boolean` | `getDestroyed()` Flag indicating a drawItem has been destroyed, similar to `destroyed`.
    `java.lang.Boolean` | `getDestroying()` Flag indicating a drawItem is mid-destruction, similar to `destroying`.
    `int` | `getDragStartDistance()` Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
    `DrawGroup` | `getDrawGroup()` `DrawGroup` this drawItem is a member of.
    `DrawPane` | `getDrawPane()` `DrawPane` this drawItem should draw in.
    `ArrowStyle` | `getEndArrow()` Style of arrowhead to draw at the end of the line or path.
    `java.lang.String` | `getFillColor()` Fill color to use for shapes.
    `Gradient` | `getFillGradient()` Fill gradient to use for shapes.
    `float` | `getFillOpacity()` Opacity of the fillColor, as a number between 0 (transparent) and 1 (opaque).
    `java.lang.String` | `getHoverHTML()` If `showHover` is true, when the user holds the mouse over this DrawItem for long enough to trigger a hover event, a hover canvas is shown by default.
    `java.lang.Boolean` | `getKeepInParentRect()` Constrains drag-resizing and drag-repositioning of this draw item to either the current visible area of the `draw pane` or an arbitrary bounding box (if set to an array of the form `[left, top, left + width, top + height]`).
    `KnobType[]` | `getKnobs()` Array of control knobs to display for this item.
    `LineCap` | `getLineCap()` Style of drawing the endpoints of a line.
    `java.lang.String` | `getLineColor()` Line color
    `float` | `getLineOpacity()` Opacity for lines, as a number between 0 (transparent) and 1 (opaque).
    `LinePattern` | `getLinePattern()` Pattern for lines, eg "solid" or "dash"
    `int` | `getLineWidth()` Pixel width for lines.
    `int[]` | `getMoveKnobOffset()` Array holds 2 values representing the x and y offset from moveKnobPoint.
    `java.lang.String` | `getMoveKnobPoint()` If this item is showing a `"move"` `control knob`, this attribute specifies where the knob should appear with respect to the drawItem.
    `static DrawItem` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `int` | `getPageLeft()` Returns the page-relative left coordinate of the widget on the page, in pixels.
    `int` | `getPageTop()` Returns the page-relative top coordinate of the widget on the page, in pixels
    `java.lang.String` | `getPrompt()` Default `hover HTML` that is displayed in the global hover canvas if the user hovers over this DrawItem and `showHover` is true.
    `static DrawItem` | `getRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `java.lang.String[]` | `getResizeKnobPoints()` If this item is showing `"resize"` `control knobs`, this attribute specifies which sides / edges should show knobs.
    `float` | `getRotation()` Rotation in degrees.
    `int[]` | `getScale()` Array holds 2 values representing scaling along x and y dimensions.
    `Shadow` | `getShadow()` Shadow used for all DrawItem subtypes.
    `boolean` | `getShowHover()` If `canHover` is true, should we show the global hover canvas by default when the user hovers over this DrawItem?
    `ArrowStyle` | `getStartArrow()` Style of arrowhead to draw at the beginning of the line or path.
    `void` | `getSvgString()` Generates a string containing the SVG source of this DrawItem.
    `void` | `hide()` Hide this drawItem.
    `void` | `hideKnobs(KnobType... knobType)` Hides a set of control knobs for this drawItem.
    `boolean` | `hover()` If `canHover` is true for this DrawItem, the hover() string method will be fired when the user hovers over this DrawItem.
    `java.lang.Boolean` | `isInBounds(int x, int y)` returns true if point is in getBoundingBox()
    `java.lang.Boolean` | `isPointInPath(int x, int y)` returns true if point is in path
    `void` | `moveBy(int dX, int dY)` Move the shape by the specified deltas for the left and top coordinate.
    `void` | `resizeBy(int dX, int dY)` Resize the shape by the specified deltas for the left and top coordinate.
    `void` | `resizeTo(int width, int height)` Resize to the specified size
    `void` | `rotateBy(double degrees)` Rotate the shape by the relative rotation in degrees
    `void` | `rotateBy(float degrees)` Rotate the shape by the relative rotation in degrees
    `void` | `rotateTo(double degrees)` Rotate the shape by the absolute rotation in degrees
    `void` | `rotateTo(float degrees)` Rotate the shape by the absolute rotation in degrees
    `void` | `scaleBy(double x, double y)` Scale the shape by the x, y multipliers
    `void` | `scaleBy(float x, float y)` Scale the shape by the x, y multipliers
    `void` | `scaleTo(double x, double y)` Scale the shape by the x, y multipliers
    `void` | `scaleTo(float x, float y)` Scale the shape by the x, y multipliers
    `protected void` | `setAttribute(java.lang.String attribute, java.lang.Float[] value, boolean allowPostCreate)`
    `void` | `setCanDrag(java.lang.Boolean canDrag)` Is this drawItem draggable? Note that dragging must be enabled for the dragPane in which this item is rendered via `canDrag` for this to have an effect.
    `void` | `setCanHover(java.lang.Boolean canHover)` Will this DrawItem fire hover events when the user hovers over it?
    `void` | `setContextMenu(Menu contextMenu)` Context menu to show for this object, an instance of the Menu widget.
    `void` | `setCursor(Cursor cursor)` If set, specifies the cursor to display when the mouse pointer is over this DrawItem.
    `static void` | `setDefaultProperties(DrawItem drawItemProperties)` Class level method to set the default properties of this class.
    `void` | `setDragStartDistance(int dragStartDistance)` Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
    `void` | `setDrawGroup(DrawGroup drawGroup)` `DrawGroup` this drawItem is a member of.
    `void` | `setDrawPane(DrawPane drawPane)` `DrawPane` this drawItem should draw in.
    `void` | `setEndArrow(ArrowStyle endArrow)` Style of arrowhead to draw at the end of the line or path.
    `void` | `setFillColor(java.lang.String fillColor)` Fill color to use for shapes.
    `void` | `setFillGradient(Gradient fillGradient)` Fill gradient to use for shapes.
    `void` | `setFillOpacity(float fillOpacity)` Opacity of the fillColor, as a number between 0 (transparent) and 1 (opaque).
    `void` | `setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `void` | `setKeepInParentRect(java.lang.Boolean keepInParentRect)` Constrains drag-resizing and drag-repositioning of this draw item to either the current visible area of the `draw pane` or an arbitrary bounding box (if set to an array of the form `[left, top, left + width, top + height]`).
    `void` | `setKeepInParentRect(java.lang.Float... keepInParentRect)` Constrains drag-resizing and drag-repositioning of this draw item to either the current visible area of the `draw pane` or an arbitrary bounding box (if set to an array of the form `[left, top, left + width, top + height]`).
    `void` | `setKnobs(KnobType... knobs)` Array of control knobs to display for this item.
    `void` | `setLineCap(LineCap lineCap)` Style of drawing the endpoints of a line.
    `void` | `setLineColor(java.lang.String lineColor)` Line color If this method is called after the component has been drawn/initialized: Update lineColor for this drawItem.
    `void` | `setLineOpacity(float lineOpacity)` Opacity for lines, as a number between 0 (transparent) and 1 (opaque).
    `void` | `setLinePattern(LinePattern linePattern)` Pattern for lines, eg "solid" or "dash" If this method is called after the component has been drawn/initialized: Update linePattern for this drawItem.
    `void` | `setLineWidth(int lineWidth)` Pixel width for lines.
    `void` | `setMoveKnobOffset(int[] offset)` Array holds 2 values representing the x and y offset from moveKnobPoint.
    `void` | `setMoveKnobPoint(java.lang.String moveKnobPoint)` If this item is showing a `"move"` `control knob`, this attribute specifies where the knob should appear with respect to the drawItem.
    `void` | `setPrompt(java.lang.String prompt)` Default `hover HTML` that is displayed in the global hover canvas if the user hovers over this DrawItem and `showHover` is true.
    `void` | `setResizeKnobPoints(java.lang.String[] resizeKnobPoints)` If this item is showing `"resize"` `control knobs`, this attribute specifies which sides / edges should show knobs.
    `void` | `setRotation(float rotation)` Rotation in degrees.
    `void` | `setScale(int[] scale)` Array holds 2 values representing scaling along x and y dimensions.
    `void` | `setShadow(Shadow shadow)` Shadow used for all DrawItem subtypes.
    `void` | `setShowHover(boolean showHover)` If `canHover` is true, should we show the global hover canvas by default when the user hovers over this DrawItem?
    `void` | `setStartArrow(ArrowStyle startArrow)` Style of arrowhead to draw at the beginning of the line or path.
    `void` | `show()` Make this drawItem visible.
    `void` | `showKnobs(KnobType... knobType)` Shows a set of control knobs for this drawItem.

    - ### Methods inherited from class com.smartgwt.client.core.BaseClass

      `asSGWTComponent, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getJsObj, getOrCreateJsObj, getScClassName, internalSetID, internalSetID, isCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setID, setProperty, setProperty, setProperty, setProperty, setScClassName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.google.gwt.event.shared.HasHandlers

      `fireEvent`

- - ### Constructor Detail

    - #### DrawItem

          public DrawItem()

    - #### DrawItem

          public DrawItem(com.google.gwt.core.client.JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static DrawItem getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setJavaScriptObject

          public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### create

          public com.google.gwt.core.client.JavaScriptObject create()

      Specified by:
        `create` in class `BaseClass`

    - #### setCanDrag

          public void setCanDrag(java.lang.Boolean canDrag)

      Is this drawItem draggable? Note that dragging must be enabled for the dragPane in which this item is rendered via `canDrag` for this to have an effect.

      Note : This is an advanced setting

      Parameters:
        `canDrag` - canDrag Default value is false

    - #### getCanDrag

          public java.lang.Boolean getCanDrag()

      Is this drawItem draggable? Note that dragging must be enabled for the dragPane in which this item is rendered via `canDrag` for this to have an effect.
      Returns:
        Boolean

    - #### setCanHover

          public void setCanHover(java.lang.Boolean canHover)

      Will this DrawItem fire hover events when the user hovers over it?
      Parameters:
        `canHover` - canHover Default value is null
      See Also:
        `setShowHover(boolean)`

    - #### getCanHover

          public java.lang.Boolean getCanHover()

      Will this DrawItem fire hover events when the user hovers over it?
      Returns:
        Boolean
      See Also:
        `getShowHover()`

    - #### setContextMenu

          public void setContextMenu(Menu contextMenu)

      Context menu to show for this object, an instance of the Menu widget.

      Note: if `Canvas.destroy` is called on a canvas, any specified context menu is not automatically destroyed as well. This is in contrast to `MenuButton`s which automatically destroy their specified `menu` by default. The behavior is intentional as context menus are commonly reused across components.

      Parameters:
        `contextMenu` - contextMenu Default value is null
      See Also:
        `ShowContextMenuEvent`, `Cues overview and related methods`, Context menus Example

    - #### getContextMenu

          public Menu getContextMenu()

      Context menu to show for this object, an instance of the Menu widget.

      Note: if `Canvas.destroy` is called on a canvas, any specified context menu is not automatically destroyed as well. This is in contrast to `MenuButton`s which automatically destroy their specified `menu` by default. The behavior is intentional as context menus are commonly reused across components.

      Returns:
        Menu
      See Also:
        `ShowContextMenuEvent`, `Cues overview and related methods`, Context menus Example

    - #### setCursor

          public void setCursor(Cursor cursor)

      If set, specifies the cursor to display when the mouse pointer is over this DrawItem.

      Note : This is an advanced setting

      Parameters:
        `cursor` - cursor Default value is null

    - #### getCursor

          public Cursor getCursor()

      If set, specifies the cursor to display when the mouse pointer is over this DrawItem.
      Returns:
        Cursor

    - #### getDestroyed

          public java.lang.Boolean getDestroyed()
                                         throws java.lang.IllegalStateException

      Flag indicating a drawItem has been destroyed, similar to `destroyed`.

      Note : This method should be called only after the underlying component has been created.

      Returns:
        Boolean
      Throws:
        `java.lang.IllegalStateException` - if the underlying component has not yet been created.

    - #### getDestroying

          public java.lang.Boolean getDestroying()
                                          throws java.lang.IllegalStateException

      Flag indicating a drawItem is mid-destruction, similar to `destroying`.

      Note : This method should be called only after the underlying component has been created.

      Returns:
        Boolean
      Throws:
        `java.lang.IllegalStateException` - if the underlying component has not yet been created.

    - #### setDragStartDistance

          public void setDragStartDistance(int dragStartDistance)

      Number of pixels the cursor needs to move before the EventHandler starts a drag operation.

      Note : This is an advanced setting

      Parameters:
        `dragStartDistance` - dragStartDistance Default value is 5
      See Also:
        `Dragdrop overview and related methods`

    - #### getDragStartDistance

          public int getDragStartDistance()

      Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
      Returns:
        int
      See Also:
        `Dragdrop overview and related methods`

    - #### setDrawGroup

          public void setDrawGroup(DrawGroup drawGroup)
                            throws java.lang.IllegalStateException

      `DrawGroup` this drawItem is a member of.
      Parameters:
        `drawGroup` - drawGroup Default value is null
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getDrawGroup

          public DrawGroup getDrawGroup()

      `DrawGroup` this drawItem is a member of.
      Returns:
        DrawGroup

    - #### setDrawPane

          public void setDrawPane(DrawPane drawPane)
                           throws java.lang.IllegalStateException

      `DrawPane` this drawItem should draw in.

      If this item has a `DrawGroup`, the drawGroup's drawPane is automatically used.

      Parameters:
        `drawPane` - drawPane Default value is null
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getDrawPane

          public DrawPane getDrawPane()

      `DrawPane` this drawItem should draw in.

      If this item has a `DrawGroup`, the drawGroup's drawPane is automatically used.

      Returns:
        DrawPane

    - #### setEndArrow

          public void setEndArrow(ArrowStyle endArrow)

      Style of arrowhead to draw at the end of the line or path.
      If this method is called after the component has been drawn/initialized: Set the arrowhead at the end of this path.
      Parameters:
        `endArrow` - style of arrow to use. Default value is null

    - #### getEndArrow

          public ArrowStyle getEndArrow()

      Style of arrowhead to draw at the end of the line or path.
      Returns:
        ArrowStyle

    - #### setFillColor

          public void setFillColor(java.lang.String fillColor)

      Fill color to use for shapes. The default of 'null' is transparent.
      If this method is called after the component has been drawn/initialized: Update fillColor for this drawItem.
      Parameters:
        `fillColor` - new fillColor to use. Pass null for transparent.. See `CSSColor`. Default value is null

    - #### getFillColor

          public java.lang.String getFillColor()

      Fill color to use for shapes. The default of 'null' is transparent.
      Returns:
        . See `CSSColor`

    - #### setFillOpacity

          public void setFillOpacity(float fillOpacity)

      Opacity of the fillColor, as a number between 0 (transparent) and 1 (opaque).
      If this method is called after the component has been drawn/initialized: Update fillOpacity for this drawItem.
      Parameters:
        `fillOpacity` - new opacity, as a number between 0 (transparent) and 1 (opaque).. Default value is 1.0

    - #### getFillOpacity

          public float getFillOpacity()

      Opacity of the fillColor, as a number between 0 (transparent) and 1 (opaque).
      Returns:
        float

    - #### setKeepInParentRect

          public void setKeepInParentRect(java.lang.Boolean keepInParentRect)

      Constrains drag-resizing and drag-repositioning of this draw item to either the current visible area of the `draw pane` or an arbitrary bounding box (if set to an array of the form `[left, top, left + width, top + height]`). When using a bounding box-type argument the left/top values can be negative, or the width/height values can be greater than the dimensions of the viewable area, to allow positioning or resizing the draw item beyond the confines of the draw pane.

      Note: keepInParentRect affects only user drag interactions, not programmatic moves or resizes.

      Note : This is an advanced setting

      Parameters:
        `keepInParentRect` - keepInParentRect Default value is null

    - #### getKeepInParentRect

          public java.lang.Boolean getKeepInParentRect()

      Constrains drag-resizing and drag-repositioning of this draw item to either the current visible area of the `draw pane` or an arbitrary bounding box (if set to an array of the form `[left, top, left + width, top + height]`). When using a bounding box-type argument the left/top values can be negative, or the width/height values can be greater than the dimensions of the viewable area, to allow positioning or resizing the draw item beyond the confines of the draw pane.

      Note: keepInParentRect affects only user drag interactions, not programmatic moves or resizes.

      Returns:
        Boolean

    - #### setKeepInParentRect

          public void setKeepInParentRect(java.lang.Float... keepInParentRect)

      Constrains drag-resizing and drag-repositioning of this draw item to either the current visible area of the `draw pane` or an arbitrary bounding box (if set to an array of the form `[left, top, left + width, top + height]`). When using a bounding box-type argument the left/top values can be negative, or the width/height values can be greater than the dimensions of the viewable area, to allow positioning or resizing the draw item beyond the confines of the draw pane.

      Note: keepInParentRect affects only user drag interactions, not programmatic moves or resizes.

      Note : This is an advanced setting

      Parameters:
        `keepInParentRect` - keepInParentRect Default value is null

    - #### setKnobs

          public void setKnobs(KnobType... knobs)

      Array of control knobs to display for this item. Each `KnobType` specified in this will turn on UI element(s) allowing the user to manipulate this drawItem. To update the set of knobs at runtime use `DrawItem.showKnobs` and `DrawItem.hideKnobs`.

      NOTE: Unless otherwise documented, DrawItem types only support `KnobType.RESIZE` and `KnobType.MOVE` knobs.

      Parameters:
        `knobs` - knobs Default value is null

    - #### getKnobs

          public KnobType[] getKnobs()

      Array of control knobs to display for this item. Each `KnobType` specified in this will turn on UI element(s) allowing the user to manipulate this drawItem. To update the set of knobs at runtime use `DrawItem.showKnobs` and `DrawItem.hideKnobs`.

      NOTE: Unless otherwise documented, DrawItem types only support `KnobType.RESIZE` and `KnobType.MOVE` knobs.

      Returns:
        KnobType

    - #### setLineCap

          public void setLineCap(LineCap lineCap)

      Style of drawing the endpoints of a line.

      Note that for dashed and dotted lines, the lineCap style affects each dash or dot.
      If this method is called after the component has been drawn/initialized: Update lineCap for this drawItem.

      Parameters:
        `lineCap` - new lineCap to use. Default value is "round"

    - #### getLineCap

          public LineCap getLineCap()

      Style of drawing the endpoints of a line.

      Note that for dashed and dotted lines, the lineCap style affects each dash or dot.

      Returns:
        LineCap

    - #### setLineColor

          public void setLineColor(java.lang.String lineColor)

      Line color
      If this method is called after the component has been drawn/initialized: Update lineColor for this drawItem.
      Parameters:
        `lineColor` - new line color. Pass null for transparent.. See `CSSColor`. Default value is "#808080"

    - #### getLineColor

          public java.lang.String getLineColor()

      Line color
      Returns:
        . See `CSSColor`

    - #### setLineOpacity

          public void setLineOpacity(float lineOpacity)

      Opacity for lines, as a number between 0 (transparent) and 1 (opaque).
      If this method is called after the component has been drawn/initialized: Update lineOpacity for this drawItem.
      Parameters:
        `lineOpacity` - new opacity, as a number between 0 (transparent) and 1 (opaque).. Default value is 1.0

    - #### getLineOpacity

          public float getLineOpacity()

      Opacity for lines, as a number between 0 (transparent) and 1 (opaque).
      Returns:
        float

    - #### setLinePattern

          public void setLinePattern(LinePattern linePattern)

      Pattern for lines, eg "solid" or "dash"
      If this method is called after the component has been drawn/initialized: Update linePattern for this drawItem.
      Parameters:
        `linePattern` - new linePattern to use. Default value is "solid"

    - #### getLinePattern

          public LinePattern getLinePattern()

      Pattern for lines, eg "solid" or "dash"
      Returns:
        LinePattern

    - #### setLineWidth

          public void setLineWidth(int lineWidth)

      Pixel width for lines.
      If this method is called after the component has been drawn/initialized: Update lineWidth for this drawItem.
      Parameters:
        `lineWidth` - new pixel lineWidth. Default value is 3

    - #### getLineWidth

          public int getLineWidth()

      Pixel width for lines.
      Returns:
        int

    - #### setMoveKnobPoint

          public void setMoveKnobPoint(java.lang.String moveKnobPoint)

      If this item is showing a `"move"` `control knob`, this attribute specifies where the knob should appear with respect to the drawItem. Valid options are:

             "TL" Top Left corner
             "TR" Top Right corner
             "BL" Bottom Left corner
             "BR" Bottom Right corner

      Parameters:
        `moveKnobPoint` - . See `String`. Default value is "TL"

    - #### getMoveKnobPoint

          public java.lang.String getMoveKnobPoint()

      If this item is showing a `"move"` `control knob`, this attribute specifies where the knob should appear with respect to the drawItem. Valid options are:

             "TL" Top Left corner
             "TR" Top Right corner
             "BL" Bottom Left corner
             "BR" Bottom Right corner

      Returns:
        . See `String`

    - #### setPrompt

          public void setPrompt(java.lang.String prompt)

      Default `hover HTML` that is displayed in the global hover canvas if the user hovers over this DrawItem and `showHover` is true.
      Parameters:
        `prompt` - . See `HTMLString`. Default value is null

    - #### getPrompt

          public java.lang.String getPrompt()

      Default `hover HTML` that is displayed in the global hover canvas if the user hovers over this DrawItem and `showHover` is true.
      Returns:
        . See `HTMLString`

    - #### setRotation

          public void setRotation(float rotation)
                           throws java.lang.IllegalStateException

      Rotation in degrees.
      Parameters:
        `rotation` - rotation Default value is 0.0
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getRotation

          public float getRotation()

      Rotation in degrees.
      Returns:
        float

    - #### setShadow

          public void setShadow(Shadow shadow)

      Shadow used for all DrawItem subtypes.
      If this method is called after the component has been drawn/initialized: Update shadow for this drawItem.
      Parameters:
        `shadow` - new shadow. Default value is null

    - #### getShadow

          public Shadow getShadow()

      Shadow used for all DrawItem subtypes.
      Returns:
        Shadow

    - #### setShowHover

          public void setShowHover(boolean showHover)

      If `canHover` is true, should we show the global hover canvas by default when the user hovers over this DrawItem?
      Parameters:
        `showHover` - showHover Default value is true
      See Also:
        `getHoverHTML()`

    - #### getShowHover

          public boolean getShowHover()

      If `canHover` is true, should we show the global hover canvas by default when the user hovers over this DrawItem?
      Returns:
        boolean
      See Also:
        `getHoverHTML()`

    - #### setStartArrow

          public void setStartArrow(ArrowStyle startArrow)

      Style of arrowhead to draw at the beginning of the line or path.
      If this method is called after the component has been drawn/initialized: Set the arrowhead at the beginning of this path.
      Parameters:
        `startArrow` - style of arrow to use. Default value is null

    - #### getStartArrow

          public ArrowStyle getStartArrow()

      Style of arrowhead to draw at the beginning of the line or path.
      Returns:
        ArrowStyle

    - #### addClickHandler

          public com.google.gwt.event.shared.HandlerRegistration addClickHandler(ClickHandler handler)

      Add a click handler.

      Executed when the left mouse is clicked (pressed and then released) on this widget. No default implementation.

      Specified by:
        `addClickHandler` in interface `HasClickHandlers`
      Parameters:
        `handler` - the click handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### computeAngle

          public float computeAngle(int px1,
                           int py1,
                           int px2,
                           int py2)

      returns the angle in degrees between any two points
      Parameters:
        `px1` -
        `py1` -
        `px2` -
        `py2` -
      Returns:

    - #### computeAngleAsDouble

          public double computeAngleAsDouble(int px1,
                                    int py1,
                                    int px2,
                                    int py2)

      returns the angle in degrees between any two points
      Parameters:
        `px1` -
        `py1` -
        `px2` -
        `py2` -
      Returns:

    - #### dragResizeMove

          public void dragResizeMove(java.lang.String position,
                            java.lang.Integer x,
                            java.lang.Integer y,
                            java.lang.Integer dX,
                            java.lang.Integer dY)

      If `canDrag` and `canDrag` are both true and the `control knobs` include "resize" knobs, then this notification method will be fired when the user drag-resizes the draw item.
      Parameters:
        `position` - provides which knob of the `resizeKnobPoints` was dragged
        `x` - new x-coordinate of the knob
        `y` - new y-coordinate of the knob
        `dX` - horizontal distance moved
        `dY` - vertical distance moved

    - #### draw

          public void draw()

      Draw this item into its current `DrawPane`.

    - #### erase

          public void erase()

      Erase this drawItem's visual representation and remove it from its DrawGroup (if any) and DrawPane.

      To re-draw the item within the DrawPane, call `DrawItem.draw` again, or use `DrawPane.addDrawItem` to move to another DrawGroup.

    - #### getHoverHTML

          public java.lang.String getHoverHTML()

      If `showHover` is true, when the user holds the mouse over this DrawItem for long enough to trigger a hover event, a hover canvas is shown by default. This method returns the contents of that hover canvas. Default implementation returns `prompt` - override for custom hover HTML. Note that returning `null` or an empty string will suppress the hover canvas altogether.
      Returns:
        the HTML to show in the hover

    - #### getPageLeft

          public int getPageLeft()

      Returns the page-relative left coordinate of the widget on the page, in pixels.
      Returns:
        global left coordinate
      See Also:
        `Positioning overview and related methods`

    - #### getPageTop

          public int getPageTop()

      Returns the page-relative top coordinate of the widget on the page, in pixels
      Returns:
        GLOBAL top coordinate
      See Also:
        `Positioning overview and related methods`

    - #### getSvgString

          public void getSvgString()

      Generates a string containing the SVG source of this DrawItem.

      NOTE: The generated SVG source assumes that the default namespace is `http://www.w3.org/2000/svg` and that namespace prefix `xlink` refers to namespace name `http://www.w3.org/1999/xlink`.

    - #### hide

          public void hide()

      Hide this drawItem.

    - #### hover

          public boolean hover()

      If `canHover` is true for this DrawItem, the hover() string method will be fired when the user hovers over this DrawItem. If this method returns false, it will suppress the default behavior of showing a hover canvas if `showHover` is true.
      Returns:
        false to cancel the hover event.

    - #### isInBounds

          public java.lang.Boolean isInBounds(int x,
                                     int y)

      returns true if point is in getBoundingBox()
      Parameters:
        `x` -
        `y` -
      Returns:

    - #### isPointInPath

          public java.lang.Boolean isPointInPath(int x,
                                        int y)

      returns true if point is in path
      Parameters:
        `x` -
        `y` -
      Returns:

    - #### addMouseDownHandler

          public com.google.gwt.event.shared.HandlerRegistration addMouseDownHandler(MouseDownHandler handler)

      Add a mouseDown handler.

      Executed when the left mouse down is pressed on this widget. No default implementation.

      Specified by:
        `addMouseDownHandler` in interface `HasMouseDownHandlers`
      Parameters:
        `handler` - the mouseDown handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addMouseMoveHandler

          public com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)

      Add a mouseMove handler.

      Executed when the mouse moves within this widget. No default implementation.

      Specified by:
        `addMouseMoveHandler` in interface `HasMouseMoveHandlers`
      Parameters:
        `handler` - the mouseMove handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addMouseOutHandler

          public com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(MouseOutHandler handler)

      Add a mouseOut handler.

      Executed when the mouse leaves this widget. No default implementation.

      Specified by:
        `addMouseOutHandler` in interface `HasMouseOutHandlers`
      Parameters:
        `handler` - the mouseOut handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addMouseOverHandler

          public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(MouseOverHandler handler)

      Add a mouseOver handler.

      Executed when mouse enters this widget. No default implementation.

      Specified by:
        `addMouseOverHandler` in interface `HasMouseOverHandlers`
      Parameters:
        `handler` - the mouseOver handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addMouseUpHandler

          public com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(MouseUpHandler handler)

      Add a mouseUp handler.

      Executed when the left mouse is released on this widget. No default implementation.

      Specified by:
        `addMouseUpHandler` in interface `HasMouseUpHandlers`
      Parameters:
        `handler` - the mouseUp handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### moveBy

          public void moveBy(int dX,
                    int dY)

      Move the shape by the specified deltas for the left and top coordinate.
      Parameters:
        `dX` - change to left coordinate in pixels
        `dY` - change to top coordinate in pixels

    - #### addMovedHandler

          public com.google.gwt.event.shared.HandlerRegistration addMovedHandler(MovedHandler handler)

      Add a moved handler.

      Notification method fired when this component is explicitly moved. Note that a component's position on the screen may also changed due to an ancestor being moved. The parentMoved method provides a notification entry point to catch that case as well.

      Specified by:
        `addMovedHandler` in interface `HasMovedHandlers`
      Parameters:
        `handler` - the moved handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addDragMoveHandler

          public com.google.gwt.event.shared.HandlerRegistration addDragMoveHandler(DragMoveHandler handler)

      Add a dragMove handler.

      If `canDrag` is true and `canDrag` is true, this notification method will be fired when the user drags the drawItem

      Specified by:
        `addDragMoveHandler` in interface `HasDragMoveHandlers`
      Parameters:
        `handler` - the dragMove handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addDragResizeMoveHandler

          public com.google.gwt.event.shared.HandlerRegistration addDragResizeMoveHandler(DragResizeMoveHandler handler)

      Add a dragResizeMove handler.

      If `canDrag` and `canDrag` are both true and the `control knobs` include "resize" knobs, then this notification method will be fired when the user drags the resize knobs of the draw item.

      Specified by:
        `addDragResizeMoveHandler` in interface `HasDragResizeMoveHandlers`
      Parameters:
        `handler` - the dragResizeMove handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addDragStartHandler

          public com.google.gwt.event.shared.HandlerRegistration addDragStartHandler(DragStartHandler handler)

      Add a dragStart handler.

      If `canDrag` is true and `canDrag` is true, this notification method will be fired when the user starts to drag the drawItem

      Specified by:
        `addDragStartHandler` in interface `HasDragStartHandlers`
      Parameters:
        `handler` - the dragStart handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### addDragStopHandler

          public com.google.gwt.event.shared.HandlerRegistration addDragStopHandler(DragStopHandler handler)

      Add a dragStop handler.

      If `canDrag` is true and `canDrag` is true, this notification method will be fired when the user completes a drag on the drawItem

      Specified by:
        `addDragStopHandler` in interface `HasDragStopHandlers`
      Parameters:
        `handler` - the dragStop handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### resizeBy

          public void resizeBy(int dX,
                      int dY)

      Resize the shape by the specified deltas for the left and top coordinate.
      Parameters:
        `dX` - change to left coordinate in pixels
        `dY` - change to top coordinate in pixels

    - #### addResizedHandler

          public com.google.gwt.event.shared.HandlerRegistration addResizedHandler(ResizedHandler handler)

      Add a resized handler.

      Observable method called whenever a DrawItem changes size.

      Specified by:
        `addResizedHandler` in interface `HasResizedHandlers`
      Parameters:
        `handler` - the resized handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### resizeTo

          public void resizeTo(int width,
                      int height)

      Resize to the specified size
      Parameters:
        `width` - new width
        `height` - new height

    - #### rotateBy

          public void rotateBy(float degrees)

      Rotate the shape by the relative rotation in degrees
      Parameters:
        `degrees` - number of degrees to rotate from current orientation.

    - #### rotateBy

          public void rotateBy(double degrees)

      Rotate the shape by the relative rotation in degrees
      Parameters:
        `degrees` - number of degrees to rotate from current orientation.

    - #### rotateTo

          public void rotateTo(float degrees)

      Rotate the shape by the absolute rotation in degrees
      Parameters:
        `degrees` - number of degrees to rotate

    - #### rotateTo

          public void rotateTo(double degrees)

      Rotate the shape by the absolute rotation in degrees
      Parameters:
        `degrees` - number of degrees to rotate

    - #### scaleBy

          public void scaleBy(float x,
                     float y)

      Scale the shape by the x, y multipliers
      Parameters:
        `x` - scale in the x direction
        `y` - scale in the y direction

    - #### scaleBy

          public void scaleBy(double x,
                     double y)

      Scale the shape by the x, y multipliers
      Parameters:
        `x` - scale in the x direction
        `y` - scale in the y direction

    - #### scaleTo

          public void scaleTo(float x,
                     float y)

      Scale the shape by the x, y multipliers
      Parameters:
        `x` - scale in the x direction
        `y` - scale in the y direction

    - #### scaleTo

          public void scaleTo(double x,
                     double y)

      Scale the shape by the x, y multipliers
      Parameters:
        `x` - scale in the x direction
        `y` - scale in the y direction

    - #### show

          public void show()

      Make this drawItem visible.

    - #### addShowContextMenuHandler

          public com.google.gwt.event.shared.HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)

      Add a showContextMenu handler.

      Executed when the right mouse button is clicked. The default implementation of this method auto-creates a `Menu` from the `contextMenu` property on this component and then calls `Menu.showContextMenu` on it to show it.

      If you want to show a standard context menu, you can simply define your Menu and set it as the contextMenu property on your component - you do not need to override this method.

      If you want to do some other processing before showing a menu or do something else entirely, then you should override this method. Note that the return value from this method controls whether or not the native browser context menu is shown.

      Specified by:
        `addShowContextMenuHandler` in interface `HasShowContextMenuHandlers`
      Parameters:
        `handler` - the showContextMenu handler
      Returns:
        `HandlerRegistration` used to remove this handler

    - #### setDefaultProperties

          public static void setDefaultProperties(DrawItem drawItemProperties)

      Class level method to set the default properties of this class. If set, then all subsequent instances of this class will automatically have the default properties that were set when this method was called. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.

      Parameters:
        `drawItemProperties` - properties that should be used as new defaults when instances of this class are created

    - #### getRef

          public static DrawItem getRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### getCenter

          public int[] getCenter()

      Get the center coordinates of the rectangle
      Returns:
        x, y coordinates

    - #### getBoundingBox

          public int[] getBoundingBox()

      Returns the startPoint endPoint
      Returns:
        x1, y1, x2, y2 coordinates

    - #### getAttributeAsIntArray

          protected int[] getAttributeAsIntArray(java.lang.String property)

    - #### hideKnobs

          public void hideKnobs(KnobType... knobType)

      Hides a set of control knobs for this drawItem. Updates `knobs` to remove the specified knobType, and clears any drawn knobs for this knobType.
      Parameters:
        `knobType` - knobs to hide

    - #### showKnobs

          public void showKnobs(KnobType... knobType)

      Shows a set of control knobs for this drawItem. Updates `knobs` to include the specified knobType, and if necessary draws out the appropriate control knobs.
      Parameters:
        `knobType` - knobs to show

    - #### setResizeKnobPoints

          public void setResizeKnobPoints(java.lang.String[] resizeKnobPoints)

      If this item is showing `"resize"` `control knobs`, this attribute specifies which sides / edges should show knobs. May include any of the following values:

             "TL" Top Left corner
             "TR" Top Right corner
             "BL" Bottom Left corner
             "BR" Bottom Right corner

      Parameters:
        `resizeKnobPoints` - resizeKnobPoints Default value is ["TL","TR","BL","BR"]

    - #### getResizeKnobPoints

          public java.lang.String[] getResizeKnobPoints()

      If this item is showing `"resize"` `control knobs`, this attribute specifies which sides / edges should show knobs. May include any of the following values:

             "TL" Top Left corner
             "TR" Top Right corner
             "BL" Bottom Left corner
             "BR" Bottom Right corner

      Returns:
        String[]

    - #### setScale

          public void setScale(int[] scale)
                        throws java.lang.IllegalStateException

      Array holds 2 values representing scaling along x and y dimensions.
      Parameters:
        `scale` - scale Default value is null
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getScale

          public int[] getScale()

      Array holds 2 values representing scaling along x and y dimensions.
      Returns:
        int[]

    - #### setMoveKnobOffset

          public void setMoveKnobOffset(int[] offset)
                                 throws java.lang.IllegalStateException

      Array holds 2 values representing the x and y offset from moveKnobPoint.
      Parameters:
        `scale` - scale Default value is null
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created

    - #### getMoveKnobOffset

          public int[] getMoveKnobOffset()

      Array holds 2 values representing the x and y offset from moveKnobPoint.
      Returns:
        int[]

    - #### setFillGradient

          public void setFillGradient(Gradient fillGradient)

      Fill gradient to use for shapes. If a string it uses the gradient identifier parameter provided in `drawPane.createSimpleGradient`, `drawPane.createRadialGradient` or `drawPane.createLinearGradient`. Otherwise it expects one of `SimpleGradient`, `LinearGradient` or `RadialGradient`.
      If this method is called after the component has been drawn/initialized: Update fillGradient for this drawItem.
      Parameters:
        `fillGradient` - new gradient to use. Pass null for transparent.. Default value is null
      See Also:
        `Gradient`

    - #### getFillGradient

          public Gradient getFillGradient()

      Fill gradient to use for shapes. If a string it uses the gradient identifier parameter provided in `drawPane.createSimpleGradient`, `drawPane.createRadialGradient` or `drawPane.createLinearGradient`. Otherwise it expects one of `SimpleGradient`, `LinearGradient` or `RadialGradient`.
      Returns:
        Gradient
      See Also:
        `Gradient`

    - #### setAttribute

          protected void setAttribute(java.lang.String attribute,
                          java.lang.Float[] value,
                          boolean allowPostCreate)