Class DrawItem

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClickHandlers, HasDragMoveHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDrawEndHandlers, HasDrawStartHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMovedHandlers, HasResizedHandlers, HasShowContextMenuHandlers
Direct Known Subclasses:
DrawCurve, DrawDiamond, DrawGroup, DrawImage, DrawLabel, DrawLine, DrawLinePath, DrawOval, DrawPath, DrawRect, DrawSector, DrawShape

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

Each DrawItem has its own local transform that maps its local coordinate system to the drawing coordinate system that is shared by all DrawItems in the same DrawPane (explained here). The local transform is a combination of rotation, scaling, and other affine transformations. The DrawItem is first translated, then scaled, then sheared in the direction of the x-axis, then sheared in the directiton of the y-axis, and then finally rotated.

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.

  • Constructor Details

    • DrawItem

      public DrawItem()
    • DrawItem

      public DrawItem(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static DrawItem getOrCreateRef(JavaScriptObject jsObj)
    • getPaletteDefaults

      public Map getPaletteDefaults()
      This method returns a Map of config properties suitable for use as the "defaults" attribute of a PaletteNode. Use it when you need to work with PaletteNodes indirectly, such when setting up TileRecords that will be used in a TilePalette. See the dev tools overview for examples of how to assemble and acquire a suitable defaults object when you are creating a PaletteNode indirectly
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, DrawItem defaults)
      Changes the defaults for DrawItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - DrawItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class BaseWidget
    • setCanDrag

      public DrawItem setCanDrag(Boolean canDrag)
      Is this DrawItem draggable? If true, then the DrawItem can be drag-repositioned by the user.

      If this method is called after the component has been drawn/initialized: Setter for canDrag.

      Note : This is an advanced setting

      Parameters:
      canDrag - new value for this.canDrag. Default value is false
      Returns:
      DrawItem instance, for chaining setter calls
    • getCanDrag

      public Boolean getCanDrag()
      Is this DrawItem draggable? If true, then the DrawItem can be drag-repositioned by the user.
      Returns:
      Current canDrag value. Default value is false
    • setCanHover

      public DrawItem setCanHover(Boolean canHover)
      Will this DrawItem fire hover events when the user hovers over it?
      Parameters:
      canHover - New canHover value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getCanHover

      public Boolean getCanHover()
      Will this DrawItem fire hover events when the user hovers over it?
      Returns:
      Current canHover value. Default value is null
      See Also:
    • setContextMenu

      public DrawItem 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 MenuButtons which automatically destroy their specified MenuButton.menu by default. The behavior is intentional as context menus are commonly reused across components.

      Parameters:
      contextMenu - New contextMenu value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • 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 MenuButtons which automatically destroy their specified MenuButton.menu by default. The behavior is intentional as context menus are commonly reused across components.

      Returns:
      Current contextMenu value. Default value is null
      See Also:
    • getCornerResizeKnob

      public DrawKnob getCornerResizeKnob()
      Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

      If this item is showing KnobType.RESIZE control knobs, this attribute specifies the MultiAutoChild for the DrawKnob that allows a user to resize the DrawItem with help of knobs located at corners of a bounding rectangle of current DrawItem. The default shape is a light teal circle.

      Returns:
      null
    • setCursor

      public DrawItem 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 - new cursor. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
    • getCursor

      public Cursor getCursor()
      If set, specifies the cursor to display when the mouse pointer is over this DrawItem.
      Returns:
      Current cursor value. Default value is null
    • getDestroyed

      public Boolean getDestroyed() throws IllegalStateException
      Flag indicating a drawItem has been destroyed, similar to Canvas.destroyed.

      Note : This method should be called only after the widget has been rendered.

      Returns:
      Current destroyed value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • getDestroying

      public Boolean getDestroying() throws IllegalStateException
      Flag indicating a drawItem is mid-destruction, similar to Canvas.destroying.

      Note : This method should be called only after the widget has been rendered.

      Returns:
      Current destroying value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setDragStartDistance

      public DrawItem 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 - New dragStartDistance value. Default value is 5
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getDragStartDistance

      public int getDragStartDistance()
      Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
      Returns:
      Current dragStartDistance value. Default value is 5
      See Also:
    • setDrawGroup

      public DrawItem setDrawGroup(DrawGroup drawGroup) throws IllegalStateException
      DrawGroup this drawItem is a member of.
      Parameters:
      drawGroup - New drawGroup value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getDrawGroup

      public DrawGroup getDrawGroup()
      DrawGroup this drawItem is a member of.
      Returns:
      Current drawGroup value. Default value is null
    • setDrawPane

      public DrawItem setDrawPane(DrawPane drawPane)
      DrawPane or global ID of the DrawPane this drawItem should draw in.

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

      If this method is called after the component has been drawn/initialized: Setter for drawPane.

      Parameters:
      drawPane - new value for this.drawPane. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
    • getDrawPane

      public DrawPane getDrawPane()
      DrawPane or global ID of the DrawPane this drawItem should draw in.

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

      Returns:
      Current drawPane value. Default value is null
    • setDrawPane

      public DrawItem setDrawPane(String drawPane)
      DrawPane or global ID of the DrawPane this drawItem should draw in.

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

      If this method is called after the component has been drawn/initialized: Setter for drawPane.

      Parameters:
      drawPane - new value for this.drawPane. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
    • getDrawPaneAsString

      public String getDrawPaneAsString()
      DrawPane or global ID of the DrawPane this drawItem should draw in.

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

      Returns:
      Current drawPane value. Default value is null
    • setEditProxyConstructor

      public DrawItem setEditProxyConstructor(String editProxyConstructor) throws IllegalStateException
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "DrawItemEditProxy"
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEditProxyConstructor

      public String getEditProxyConstructor()
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Returns:
      Current editProxyConstructor value. Default value is "DrawItemEditProxy"
      See Also:
    • setEndArrow

      public DrawItem setEndArrow(ArrowStyle endArrow)
      Style of arrow head 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.

      NOTE: Not all DrawItem classes support arrowheads. You can use supportsEndArrow() to dynamically check whether a DrawItem instance supports this method.

      Parameters:
      endArrow - style of arrow to use. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getEndArrow

      public ArrowStyle getEndArrow()
      Style of arrow head to draw at the end of the line or path.
      Returns:
      Current endArrow value. Default value is null
      See Also:
    • getEndKnob

      public DrawKnob getEndKnob() throws IllegalStateException
      If this item is showing KnobType.ENDPOINT control knobs, this attribute specifies the AutoChild for the DrawKnob for end point of current drawItem.

      This component is an AutoChild named "endKnob". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current endKnob value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setEventOpaque

      public DrawItem setEventOpaque(boolean eventOpaque) throws IllegalStateException
      Should events inside this DrawItem be attributed to it regardless of which pixels are actually set, if no fill is specified? If set for DrawItems that aren't closed, will capture events occurring in the region that would filled if a fill were specified. This property is true by default for closed shapes, and false for paths, lines, etc.

      Note: this property must be true if you're writing to an HTML5 <canvas> element directly in your code (only applies to DrawingType DrawingType.BITMAP).

      Note : This is an advanced setting

      Parameters:
      eventOpaque - New eventOpaque value. Default value is varies
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEventOpaque

      public boolean getEventOpaque()
      Should events inside this DrawItem be attributed to it regardless of which pixels are actually set, if no fill is specified? If set for DrawItems that aren't closed, will capture events occurring in the region that would filled if a fill were specified. This property is true by default for closed shapes, and false for paths, lines, etc.

      Note: this property must be true if you're writing to an HTML5 <canvas> element directly in your code (only applies to DrawingType DrawingType.BITMAP).

      Returns:
      Current eventOpaque value. Default value is varies
      See Also:
    • setFillColor

      public DrawItem setFillColor(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. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getFillColor

      public String getFillColor()
      Fill color to use for shapes. The default of 'null' is transparent.
      Returns:
      Current fillColor value. Default value is null
      See Also:
    • setFillGradient

      public DrawItem setFillGradient(Gradient fillGradient)
      Fill gradient to use for shapes. If a string it uses the gradient identifier parameter provided in DrawPane.addGradient(). 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
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getFillGradient

      public Gradient getFillGradient()
      Fill gradient to use for shapes. If a string it uses the gradient identifier parameter provided in DrawPane.addGradient(). Otherwise it expects one of SimpleGradient, LinearGradient or RadialGradient.
      Returns:
      Current fillGradient value. Default value is null
      See Also:
    • setFillGradient

      public DrawItem setFillGradient(String fillGradient)
      Fill gradient to use for shapes. If a string it uses the gradient identifier parameter provided in DrawPane.addGradient(). 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
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getFillGradientAsString

      public String getFillGradientAsString()
      Fill gradient to use for shapes. If a string it uses the gradient identifier parameter provided in DrawPane.addGradient(). Otherwise it expects one of SimpleGradient, LinearGradient or RadialGradient.
      Returns:
      Current fillGradient value. Default value is null
      See Also:
    • setFillOpacity

      public DrawItem 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
      Returns:
      DrawItem instance, for chaining setter calls
    • getFillOpacity

      public float getFillOpacity()
      Opacity of the fillColor, as a number between 0 (transparent) and 1 (opaque).
      Returns:
      Current fillOpacity value. Default value is 1.0
    • setHoverDelay

      public DrawItem setHoverDelay(int hoverDelay)
      If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired
      Parameters:
      hoverDelay - New hoverDelay value. Default value is 300
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getHoverDelay

      public int getHoverDelay()
      If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired
      Returns:
      Current hoverDelay value. Default value is 300
      See Also:
    • setKeepInParentRect

      public DrawItem setKeepInParentRect(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 - New keepInParentRect value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
    • getKeepInParentRect

      public 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:
      Current keepInParentRect value. Default value is null
    • setKeepInParentRect

      public DrawItem setKeepInParentRect(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 - New keepInParentRect value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
    • setKnobs

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

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

      Parameters:
      knobs - New knobs value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getKnobs

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

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

      Returns:
      Current knobs value. Default value is null
    • setLineCap

      public DrawItem 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"
      Returns:
      DrawItem instance, for chaining setter calls
    • 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:
      Current lineCap value. Default value is "round"
    • setLineColor

      public DrawItem setLineColor(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. Default value is "#808080"
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getLineColor

      public String getLineColor()
      Line color
      Returns:
      Current lineColor value. Default value is "#808080"
      See Also:
    • setLineOpacity

      public DrawItem 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
      Returns:
      DrawItem instance, for chaining setter calls
    • getLineOpacity

      public float getLineOpacity()
      Opacity for lines, as a number between 0 (transparent) and 1 (opaque).
      Returns:
      Current lineOpacity value. Default value is 1.0
    • setLinePattern

      public DrawItem setLinePattern(LinePattern linePattern)
      Pattern for lines, eg "solid" or "dash".

      Note that support in old browsers, such as Internet Explorer versions before IE11, is limited for drawingType "bitmap" to items with straight edges - DrawLines, DrawPaths, and DrawRects with no rounding.

      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"
      Returns:
      DrawItem instance, for chaining setter calls
    • getLinePattern

      public LinePattern getLinePattern()
      Pattern for lines, eg "solid" or "dash".

      Note that support in old browsers, such as Internet Explorer versions before IE11, is limited for drawingType "bitmap" to items with straight edges - DrawLines, DrawPaths, and DrawRects with no rounding.

      Returns:
      Current linePattern value. Default value is "solid"
    • setLineWidth

      public DrawItem 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
      Returns:
      DrawItem instance, for chaining setter calls
    • getLineWidth

      public int getLineWidth()
      Pixel width for lines.
      Returns:
      Current lineWidth value. Default value is 3
    • getMoveKnob

      public DrawKnob getMoveKnob() throws IllegalStateException
      If this item is showing KnobType.MOVE control knobs, this attribute specifies the AutoChild for the DrawKnob that allows a user to move the DrawItem with help of a knob located at moveKnobPoint. Default move knob shape is green circle.

      This component is an AutoChild named "moveKnob". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current moveKnob value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setMoveKnobOffset

      public DrawItem setMoveKnobOffset(int[] moveKnobOffset)
      If this item is showing a "move" control knob, this attribute allows you to specify an offset in pixels from the moveKnobPoint for the move knob. Offset should be specified as a 2-element array of [left offset, top offset].

      This offset overrides the built-in offset used when showing both resize and move knobs.

      If this method is called after the component has been drawn/initialized: Setter for moveKnobOffset.

      Note : This is an advanced setting

      Parameters:
      moveKnobOffset - the new move knob offset. This is a 2-element array of [left offset, top offset]. If null, then new int[] {0, 0} is assumed. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getMoveKnobOffset

      public int[] getMoveKnobOffset()
      If this item is showing a "move" control knob, this attribute allows you to specify an offset in pixels from the moveKnobPoint for the move knob. Offset should be specified as a 2-element array of [left offset, top offset].

      This offset overrides the built-in offset used when showing both resize and move knobs.

      Returns:
      Current moveKnobOffset value. Default value is null
      See Also:
    • setMoveKnobPoint

      public DrawItem setMoveKnobPoint(MoveKnobPoint moveKnobPoint) throws IllegalStateException
      If this item is showing a KnobType.MOVE control knob, this attribute specifies where the knob should appear with respect to the draw item.

      The resize and move knobs show at the same position by default. However, when both knobs are shown the move knob is offset slightly to allow access to both. This position can be adjusted manually with moveKnobOffset.

      Parameters:
      moveKnobPoint - New moveKnobPoint value. Default value is "TL"
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getMoveKnobPoint

      public MoveKnobPoint getMoveKnobPoint()
      If this item is showing a KnobType.MOVE control knob, this attribute specifies where the knob should appear with respect to the draw item.

      The resize and move knobs show at the same position by default. However, when both knobs are shown the move knob is offset slightly to allow access to both. This position can be adjusted manually with moveKnobOffset.

      Returns:
      Current moveKnobPoint value. Default value is "TL"
      See Also:
    • setPrompt

      public DrawItem setPrompt(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 - New prompt value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getPrompt

      public 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:
      Current prompt value. Default value is null
      See Also:
    • setProportionalResizing

      public DrawItem setProportionalResizing(ProportionalResizeMode proportionalResizing) throws IllegalStateException
      This property specifies the conditions for when proportional resizing is used.

      By default the DrawItem is forced to only resize proportionally while any modifier key specified in proportionalResizeModifiers is pressed. For example, the DrawItem will change its width and height by the same percentage as long as the "Shift" key is held down.

      Note that this property only has an effect if the DrawItem is showing KnobType.RESIZE control knobs.

      Parameters:
      proportionalResizing - New proportionalResizing value. Default value is "modifier"
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getProportionalResizing

      public ProportionalResizeMode getProportionalResizing()
      This property specifies the conditions for when proportional resizing is used.

      By default the DrawItem is forced to only resize proportionally while any modifier key specified in proportionalResizeModifiers is pressed. For example, the DrawItem will change its width and height by the same percentage as long as the "Shift" key is held down.

      Note that this property only has an effect if the DrawItem is showing KnobType.RESIZE control knobs.

      Returns:
      Current proportionalResizing value. Default value is "modifier"
    • setResizeKnobPoints

      public DrawItem setResizeKnobPoints(ResizeKnobPoint... resizeKnobPoints) throws IllegalStateException
      If this item is showing KnobType.RESIZE control knobs, this attribute specifies the points with respect to the draw item where resize knobs should appear.
      Parameters:
      resizeKnobPoints - New resizeKnobPoints value. Default value is ["TL","TR","BL","BR","T","R","B","L"]
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getResizeKnobPoints

      public ResizeKnobPoint[] getResizeKnobPoints()
      If this item is showing KnobType.RESIZE control knobs, this attribute specifies the points with respect to the draw item where resize knobs should appear.
      Returns:
      Current resizeKnobPoints value. Default value is ["TL","TR","BL","BR","T","R","B","L"]
    • getResizeOutline

      public DrawRect getResizeOutline() throws IllegalStateException
      If this item is showing KnobType.RESIZE control knobs, this attribute specifies the AutoChild for the DrawRect that draws a rectangle frame which connects all resize knobs of current DrawItem.

      This component is an AutoChild named "resizeOutline". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current resizeOutline value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setResizeViaLocalTransformOnly

      public DrawItem setResizeViaLocalTransformOnly(boolean resizeViaLocalTransformOnly) throws IllegalStateException
      If this DrawItem is showing KnobType.RESIZE control knobs, should resizing the shape solely update the local transform (for example, the DrawItem's scale or translation)?.

      The default is false, which means that the DrawItem is allowed to modify its shape properties in order to fit within a given width and height. Some examples:

      • A DrawOval might decrease its radius when resized to a smaller size.
      • A DrawPath might change its points to lengthen all line segments in the path by some proportion so that it fits into a larger size.
      This approach allows a DrawItem to maintain the same line width even as it is being resized.

      If this property is set to true then all visual aspects of the DrawItem, including the line width and the fill, will be magnified or reduced during resizes as if the DrawItem were placed under a lens.

      Parameters:
      resizeViaLocalTransformOnly - New resizeViaLocalTransformOnly value. Default value is false
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getResizeViaLocalTransformOnly

      public boolean getResizeViaLocalTransformOnly()
      If this DrawItem is showing KnobType.RESIZE control knobs, should resizing the shape solely update the local transform (for example, the DrawItem's scale or translation)?.

      The default is false, which means that the DrawItem is allowed to modify its shape properties in order to fit within a given width and height. Some examples:

      • A DrawOval might decrease its radius when resized to a smaller size.
      • A DrawPath might change its points to lengthen all line segments in the path by some proportion so that it fits into a larger size.
      This approach allows a DrawItem to maintain the same line width even as it is being resized.

      If this property is set to true then all visual aspects of the DrawItem, including the line width and the fill, will be magnified or reduced during resizes as if the DrawItem were placed under a lens.

      Returns:
      Current resizeViaLocalTransformOnly value. Default value is false
    • getRotateKnob

      public DrawKnob getRotateKnob() throws IllegalStateException
      If this item is showing KnobType.ROTATE control knobs, this attribute specifies the AutoChild for the DrawKnob that allows a user to rotate the DrawItem with help of a knob located above. Default rotate knob shape is green circle.

      This component is an AutoChild named "rotateKnob". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current rotateKnob value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setRotation

      public DrawItem setRotation(float rotation) throws IllegalStateException
      Deprecated.
      Rotation in degrees about the center point. The positive direction is clockwise.
      Parameters:
      rotation - New rotation value. Default value is 0.0
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getRotation

      public float getRotation()
      Deprecated.
      Rotation in degrees about the center point. The positive direction is clockwise.
      Returns:
      Current rotation value. Default value is 0.0
    • setRotation

      public DrawItem setRotation(double rotation) throws IllegalStateException
      Rotation in degrees about the center point. The positive direction is clockwise.
      Parameters:
      rotation - New rotation value. Default value is 0.0
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getRotationAsDouble

      public double getRotationAsDouble()
      Rotation in degrees about the center point. The positive direction is clockwise.
      Returns:
      Current rotation value. Default value is 0.0
    • setScale

      public DrawItem setScale(float[] scale) throws IllegalStateException
      Array holds 2 values representing scaling along x and y dimensions.

      Note : This is an advanced setting

      Parameters:
      scale - New scale value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getScale

      public float[] getScale()
      Array holds 2 values representing scaling along x and y dimensions.
      Returns:
      Current scale value. Default value is null
    • setShadow

      public DrawItem 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
      Returns:
      DrawItem instance, for chaining setter calls
    • getShadow

      public Shadow getShadow()
      Shadow used for all DrawItem subtypes.
      Returns:
      Current shadow value. Default value is null
    • setShapeData

      public DrawItem setShapeData(Map shapeData) throws IllegalStateException
      An opaque object specifying the local transformation that should be applied to this DrawItem, obtained through a call to getShapeData().

      Note: if this property is specified, you should avoid also specifying a translate, scale, xShearFactor, yShearFactor, or rotation.

      Parameters:
      shapeData - New shapeData value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • setShowHover

      public DrawItem 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 - New showHover value. Default value is true
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • 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:
      Current showHover value. Default value is true
      See Also:
    • setShowResizeOutline

      public DrawItem setShowResizeOutline(boolean showResizeOutline)
      If this item is showing KnobType.RESIZE control knobs will the resize outline be shown or not.
      Parameters:
      showResizeOutline - New showResizeOutline value. Default value is true
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
      • com.smartgwt.client.widgets.drawing.DrawItem#setResizeOutline
    • getShowResizeOutline

      public boolean getShowResizeOutline()
      If this item is showing KnobType.RESIZE control knobs will the resize outline be shown or not.
      Returns:
      Current showResizeOutline value. Default value is true
      See Also:
    • setShowTitleLabelBackground

      public DrawItem setShowTitleLabelBackground(boolean showTitleLabelBackground) throws IllegalStateException
      If the titleLabel is showing, should the titleLabelBackground be created and placed behind the titleLabel?

      This defaults to true for DrawSectors and shapes that are not commonly filled (e.g. DrawLines).

      Note : This is an advanced setting

      Parameters:
      showTitleLabelBackground - New showTitleLabelBackground value. Default value is false
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowTitleLabelBackground

      public boolean getShowTitleLabelBackground()
      If the titleLabel is showing, should the titleLabelBackground be created and placed behind the titleLabel?

      This defaults to true for DrawSectors and shapes that are not commonly filled (e.g. DrawLines).

      Returns:
      Current showTitleLabelBackground value. Default value is false
    • getSideResizeKnob

      public DrawKnob getSideResizeKnob()
      Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

      If this item is showing KnobType.RESIZE control knobs, this attribute specifies the MultiAutoChild for the DrawKnob that allows a user to resize the DrawItem with help of knobs located at centers of edges of a bounding rectangle of current DrawItem. The default shape is a light teal square.

      Returns:
      null
    • setStartArrow

      public DrawItem setStartArrow(ArrowStyle startArrow)
      Style of arrow head 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.

      NOTE: Not all DrawItem classes support arrowheads. You can use supportsStartArrow() to dynamically check whether a DrawItem instance supports this method.

      Parameters:
      startArrow - style of arrow to use. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getStartArrow

      public ArrowStyle getStartArrow()
      Style of arrow head to draw at the beginning of the line or path.
      Returns:
      Current startArrow value. Default value is null
      See Also:
    • getStartKnob

      public DrawKnob getStartKnob() throws IllegalStateException
      If this item is showing KnobType.STARTPOINT control knobs, this attribute specifies the AutoChild for the DrawKnob for start point of current drawItem.

      This component is an AutoChild named "startKnob". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current startKnob value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setTitle

      public void setTitle(String title)
      A string to show at the center point of this DrawItem.

      When set to a non-null value (including an empty string), the titleLabel DrawLabel AutoChild will be created automatically and positioned at the center of this DrawItem.

      If this method is called after the component has been drawn/initialized: Setter for the title of this DrawItem.

      Note : This is an advanced setting

      Overrides:
      setTitle in class BaseWidget
      Parameters:
      title - new title. Default value is null
      See Also:
    • getTitle

      public String getTitle()
      A string to show at the center point of this DrawItem.

      When set to a non-null value (including an empty string), the titleLabel DrawLabel AutoChild will be created automatically and positioned at the center of this DrawItem.

      Overrides:
      getTitle in class BaseWidget
      Returns:
      Current title value. Default value is null
      See Also:
    • setTitleAutoFit

      public DrawItem setTitleAutoFit(boolean titleAutoFit) throws IllegalStateException
      Whether the titleLabel should be scaled to the maximum possible size that fits inside the bounds of this item. Currently only DrawRects and DrawPolygons with 90 degree angles are supported.

      Note that titleAutoFit isn't supported for rotated, sheared, or scaled DrawItems, and that therefore the value of TitleRotationMode, which relates to rotation of the item, is ignored when this property is set. However, we do support having the label automatically rotate to run vertically if there's more space - see titleAutoFitRotationMode.

      Parameters:
      titleAutoFit - New titleAutoFit value. Default value is false
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
      • com.smartgwt.client.widgets.drawing.DrawItem#setTitleLabel
    • getTitleAutoFit

      public boolean getTitleAutoFit()
      Whether the titleLabel should be scaled to the maximum possible size that fits inside the bounds of this item. Currently only DrawRects and DrawPolygons with 90 degree angles are supported.

      Note that titleAutoFit isn't supported for rotated, sheared, or scaled DrawItems, and that therefore the value of TitleRotationMode, which relates to rotation of the item, is ignored when this property is set. However, we do support having the label automatically rotate to run vertically if there's more space - see titleAutoFitRotationMode.

      Returns:
      Current titleAutoFit value. Default value is false
      See Also:
    • setTitleAutoFitMargin

      public DrawItem setTitleAutoFitMargin(int titleAutoFitMargin) throws IllegalStateException
      Specifies margin between label and item edges when using titleAutoFit.
      Parameters:
      titleAutoFitMargin - New titleAutoFitMargin value. Default value is 2
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
      • com.smartgwt.client.widgets.drawing.DrawItem#setTitleLabel
    • getTitleAutoFitMargin

      public int getTitleAutoFitMargin()
      Specifies margin between label and item edges when using titleAutoFit.
      Returns:
      Current titleAutoFitMargin value. Default value is 2
      See Also:
    • setTitleAutoFitRotationMode

      public DrawItem setTitleAutoFitRotationMode(TitleAutoFitRotationMode titleAutoFitRotationMode) throws IllegalStateException
      Whether to rotate the titleLabel 90 degrees clockwise while trying to maximize its size in accordance with titleAutoFit. If automatic rotation is specified, the default, the label will be rotated if and only if it allows the label to become larger.
      Parameters:
      titleAutoFitRotationMode - New titleAutoFitRotationMode value. Default value is "auto"
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTitleAutoFitRotationMode

      public TitleAutoFitRotationMode getTitleAutoFitRotationMode()
      Whether to rotate the titleLabel 90 degrees clockwise while trying to maximize its size in accordance with titleAutoFit. If automatic rotation is specified, the default, the label will be rotated if and only if it allows the label to become larger.
      Returns:
      Current titleAutoFitRotationMode value. Default value is "auto"
      See Also:
    • getTitleLabel

      public DrawLabel getTitleLabel() throws IllegalStateException
      When a non-null title is set, this AutoChild is created automatically and positioned at the center of this DrawItem . The titleLabel moves with this DrawItem and, depending on titleRotationMode, can rotate with this DrawItem as well.

      The following passthrough applies:
      title for DrawLabel.contents.

      Related to the titleLabel is the titleLabelBackground which allows a border to be placed around the titleLabel and/or a background added. By default, shapes that are commonly filled such as DrawTriangles, with the exception of DrawSectors, do not show the titleLabelBackground (see showTitleLabelBackground).

      This component is an AutoChild named "titleLabel". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current titleLabel value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
      See Also:
    • getTitleLabelBackground

      public DrawRect getTitleLabelBackground() throws IllegalStateException
      When the titleLabel is showing and showTitleLabelBackground is true, this DrawRect AutoChild is created and placed behind the titleLabel.

      This component is an AutoChild named "titleLabelBackground". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current titleLabelBackground value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
      See Also:
    • setTitleLabelPadding

      public DrawItem setTitleLabelPadding(int titleLabelPadding) throws IllegalStateException
      If the titleLabelBackground is visible, how much padding should be left between the bounds of the titleLabel and the edges of the titleLabelBackground?

      Note : This is an advanced setting

      Parameters:
      titleLabelPadding - New titleLabelPadding value. Default value is 2
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getTitleLabelPadding

      public int getTitleLabelPadding()
      If the titleLabelBackground is visible, how much padding should be left between the bounds of the titleLabel and the edges of the titleLabelBackground?
      Returns:
      Current titleLabelPadding value. Default value is 2
    • setTitleRotationMode

      public DrawItem setTitleRotationMode(TitleRotationMode titleRotationMode) throws IllegalStateException
      The mode in which the titleLabel (if shown) is rotated with this draw item.

      Note : This is an advanced setting

      Parameters:
      titleRotationMode - New titleRotationMode value. Default value is "neverRotate"
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTitleRotationMode

      public TitleRotationMode getTitleRotationMode()
      The mode in which the titleLabel (if shown) is rotated with this draw item.
      Returns:
      Current titleRotationMode value. Default value is "neverRotate"
      See Also:
    • setTranslate

      public DrawItem setTranslate(float[] translate) throws IllegalStateException
      Array holds two values representing translation along the x and y dimensions.

      Note : This is an advanced setting

      Parameters:
      translate - New translate value. Default value is null
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getTranslate

      public float[] getTranslate()
      Array holds two values representing translation along the x and y dimensions.
      Returns:
      Current translate value. Default value is null
    • setUseSimpleTransform

      public DrawItem setUseSimpleTransform(boolean useSimpleTransform)
      If true, when a DrawItem is moved or resized, the transform is applied by manipulating the shape coordinates, if possible, rather than by introducing scaling, shearing, rotation, or translation. This is only supported currently for DrawRect, DrawOval, DrawDiamond, DrawImage, and DrawLabel, and only if no shearing is already present. Further, it's only possible to keep the transform simple if both axes are scaled by the same amount during the resize (or end up at the same scale if the DrawItem is already scaled unevenly), unless the rotation angle is a multiple of 90 degrees.

      For DrawPolygon and other shapes not based on a box (top/left/width/height), we can't safely just modify coordinates to effect a resize as we can do for DrawRect (and similar), so resizing will normally introduce or modify the transform, potentially introducing scaling or shearing, rather than modifying coordinates. For such DrawItems, we avoid trying to manipulate the coordinates, in part, because there's a danger that the floating point error may accumulate over time and warp the shape.

      Note : This is an advanced setting

      Parameters:
      useSimpleTransform - New useSimpleTransform value. Default value is true
      Returns:
      DrawItem instance, for chaining setter calls
      See Also:
    • getUseSimpleTransform

      public boolean getUseSimpleTransform()
      If true, when a DrawItem is moved or resized, the transform is applied by manipulating the shape coordinates, if possible, rather than by introducing scaling, shearing, rotation, or translation. This is only supported currently for DrawRect, DrawOval, DrawDiamond, DrawImage, and DrawLabel, and only if no shearing is already present. Further, it's only possible to keep the transform simple if both axes are scaled by the same amount during the resize (or end up at the same scale if the DrawItem is already scaled unevenly), unless the rotation angle is a multiple of 90 degrees.

      For DrawPolygon and other shapes not based on a box (top/left/width/height), we can't safely just modify coordinates to effect a resize as we can do for DrawRect (and similar), so resizing will normally introduce or modify the transform, potentially introducing scaling or shearing, rather than modifying coordinates. For such DrawItems, we avoid trying to manipulate the coordinates, in part, because there's a danger that the floating point error may accumulate over time and warp the shape.

      Returns:
      Current useSimpleTransform value. Default value is true
      See Also:
    • setXShearFactor

      public DrawItem setXShearFactor(double xShearFactor) throws IllegalStateException
      The slope of an x-shearing transformation applied to this DrawItem. Each point in the shape is moved along the x-axis a distance that is proportional to the initial y-coordinate of the point.

      Note : This is an advanced setting

      Parameters:
      xShearFactor - New xShearFactor value. Default value is 0.0
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getXShearFactor

      public double getXShearFactor()
      The slope of an x-shearing transformation applied to this DrawItem. Each point in the shape is moved along the x-axis a distance that is proportional to the initial y-coordinate of the point.
      Returns:
      Current xShearFactor value. Default value is 0.0
    • setYShearFactor

      public DrawItem setYShearFactor(double yShearFactor) throws IllegalStateException
      The slope of a y-shearing transformation applied to this DrawItem. Each point in the shape is moved along the y-axis a distance that is proportional to the initial x-coordinate of the point.

      Note : This is an advanced setting

      Parameters:
      yShearFactor - New yShearFactor value. Default value is 0.0
      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getYShearFactor

      public double getYShearFactor()
      The slope of a y-shearing transformation applied to this DrawItem. Each point in the shape is moved along the y-axis a distance that is proportional to the initial x-coordinate of the point.
      Returns:
      Current yShearFactor value. Default value is 0.0
    • setZIndex

      public DrawItem setZIndex(Integer zIndex) throws IllegalStateException
      Relative stacking order of this draw item with respect to other items in the same DrawPane or DrawGroup.

      null means that the zIndex has not been resolved. Upon adding this draw item to a DrawPane or DrawGroup, this item's zIndex will be resolved to the next higher auto-assigned zIndex. Note that this may still be less than another item's zIndex if bringToFront() was called on that item.

      If two items within the same DrawPane or DrawGroup have the same zIndex, then they are stacked in the order in which they were added to the DrawPane or DrawGroup.

      When the DrawPane's drawingType is DrawingType.BITMAP, zIndex, bringToFront(), and sendToBack() are not supported for DrawLabels on iOS due to platform limitations.

      If this method is called after the component has been drawn/initialized: Setter for zIndex.

      Parameters:
      zIndex - new zIndex. If null and this draw item is already in a DrawPane or DrawGroup, then this item's zIndex will be set to the next higher auto-assigned zIndex.

      Note that when setting draw items' zIndexes via this advanced API, the application should take over management of all draw items' zIndexes, and bringToFront() / sendToBack() should not be used, as those APIs assume automatic management of zIndexes. Default value is null

      Returns:
      DrawItem instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getZIndex

      public Integer getZIndex()
      Relative stacking order of this draw item with respect to other items in the same DrawPane or DrawGroup.

      null means that the zIndex has not been resolved. Upon adding this draw item to a DrawPane or DrawGroup, this item's zIndex will be resolved to the next higher auto-assigned zIndex. Note that this may still be less than another item's zIndex if bringToFront() was called on that item.

      If two items within the same DrawPane or DrawGroup have the same zIndex, then they are stacked in the order in which they were added to the DrawPane or DrawGroup.

      When the DrawPane's drawingType is DrawingType.BITMAP, zIndex, bringToFront(), and sendToBack() are not supported for DrawLabels on iOS due to platform limitations.

      Returns:
      Returns the zIndex of this draw item. Default value is null
      See Also:
    • bringToFront

      public void bringToFront()
      Places this draw item at the top of the stacking order so that it appears in front of other draw items in the same DrawPane or DrawGroup.

      When the DrawPane's drawingType is DrawingType.BITMAP, zIndex, bringToFront(), and sendToBack() are not supported for DrawLabels on iOS due to platform limitations.

      See Also:
    • addClickHandler

      public HandlerRegistration addClickHandler(ClickHandler handler)
      Add a click handler.

      Notification fired when the user clicks on this DrawItem.

      Note that if this item is part of a DrawGroup, then the group's useGroupRect setting affects whether this item receives the notification. If useGroupRect is true, then this item will not receive the notification. Otherwise, the item receives the notification and notification bubbles up to the group.

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

      public void dragResizeMove(String position, Integer x, Integer y, Integer dX, Integer dY)
      If canDrag is 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()
      Draws this item into its current drawPane.

      NOTE: For performance reasons, the DrawPane may draw this item on a delay to allow multiple items to be added and drawn at one time. The DrawPane.refreshNow() API will force this item to be drawn immediately.

      Overrides:
      draw in class BaseWidget
    • addDrawEndHandler

      public HandlerRegistration addDrawEndHandler(DrawEndHandler handler)
      Add a drawEnd handler.

      Called when we finish drawing for this DrawItem to the DrawItem.drawPane's underlying HTML5 <canvas> element. Only called if the DrawingType is DrawingType.BITMAP.

      Specified by:
      addDrawEndHandler in interface HasDrawEndHandlers
      Parameters:
      handler - the drawEnd handler
      Returns:
      HandlerRegistration used to remove this handler
    • addDrawStartHandler

      public HandlerRegistration addDrawStartHandler(DrawStartHandler handler)
      Add a drawStart handler.

      Called when we start drawing for this DrawItem to the DrawItem.drawPane's underlying HTML5 <canvas> element. Only called if the DrawingType is DrawingType.BITMAP.

      Specified by:
      addDrawStartHandler in interface HasDrawStartHandlers
      Parameters:
      handler - the drawStart handler
      Returns:
      HandlerRegistration used to remove this handler
    • 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 draw() again, or use DrawPane.addDrawItem() to move to another DrawGroup.

    • getCenter

      public Point getCenter()
      Returns the center point of this draw item in local coordinates. Generally this is the center of the bounding box, but some item types may use a different point. For example, DrawTriangle uses the incenter of the triangle.
      Returns:
      the center point in local coordinates
    • getHoverHTML

      public 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. See HTMLString
    • getPageLeft

      public int getPageLeft()
      Returns the page-relative left coordinate of the widget on the page, in pixels.
      Returns:
      global left coordinate
      See Also:
    • getPageTop

      public int getPageTop()
      Returns the page-relative top coordinate of the widget on the page, in pixels
      Returns:
      GLOBAL top coordinate
      See Also:
    • 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.
    • hideAllKnobs

      public void hideAllKnobs()
      Hides all control knobs for this drawItem. Updates knobs to remove all knobTypes and clears any drawn knobs.
    • 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
    • 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
    • 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 boolean isInBounds(int x, int y)
      Returns true if the given point in the drawing coordinate system, when converted to coordinates in this DrawItem's local coordinate system, is within the bounding box of this DrawItem's shape.

      This method can be used to quickly check whether the given point is definitely not within the DrawItem shape. To check whether the point is within the DrawItem shape, use the slower but exact isPointInPath() method.

      Parameters:
      x - X coordinate of the point in the drawing coordinate system.
      y - Y coordinate of the point in the drawing coordinate system.
      Returns:
    • isPointInPath

      public boolean isPointInPath(int x, int y)
      Returns true if the given point in the drawing coordinate system is within this DrawItem's shape, taking into account local transforms.
      Parameters:
      x - X coordinate of the test point.
      y - Y coordinate of the test point.
      Returns:
    • addMouseDownHandler

      public HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
      Add a mouseDown handler.

      Notification fired when the user presses the left mouse button on this DrawItem.

      Note that if this item is part of a DrawGroup, then the group's useGroupRect setting affects whether this item receives the notification. If useGroupRect is true, then this item will not receive the notification. Otherwise, the item receives the notification and notification bubbles up to the group.

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

      public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
      Add a mouseMove handler.

      Notification fired when the user moves the mouse over this DrawItem.

      Note that if this item is part of a DrawGroup, then the group's useGroupRect setting affects whether this item receives the notification. If useGroupRect is true, then this item will not receive the notification. Otherwise, the item receives the notification and notification bubbles up to the group.

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

      public HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
      Add a mouseOut handler.

      Notification fired when the mouse leaves this DrawItem.

      Note that if this item is part of a DrawGroup, then the group's useGroupRect setting affects whether this item receives the notification. If useGroupRect is true, then this item will not receive the notification. Otherwise, the item receives the notification and notification bubbles up to the group.

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

      public HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
      Add a mouseOver handler.

      Notification fired when the mouse enters this DrawItem.

      Note that if this item is part of a DrawGroup, then the group's useGroupRect setting affects whether this item receives the notification. If useGroupRect is true, then this item will not receive the notification. Otherwise, the item receives the notification and notification bubbles up to the group.

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

      public HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
      Add a mouseUp handler.

      Notification fired when the user releases the left mouse button on this DrawItem.

      Note that if this item is part of a DrawGroup, then the group's useGroupRect setting affects whether this item receives the notification. If useGroupRect is true, then this item will not receive the notification. Otherwise, the item receives the notification and notification bubbles up to the group.

      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 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 be 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
    • moveTo

      public void moveTo(Integer left, Integer top)
      Move the DrawItem to the specified coordinates in the global coordinate system. The specified coordinates will become the top-left point of the resize bounding box.
      Parameters:
      left - new left coordinate in pixels
      top - new top coordinate in pixels
    • addDragMoveHandler

      public HandlerRegistration addDragMoveHandler(DragMoveHandler handler)
      Add a dragMove handler.

      If DrawItem.canDrag is true, this notification method will be fired when the user drags the draw item.

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

      public HandlerRegistration addDragResizeMoveHandler(DragResizeMoveHandler handler)
      Add a dragResizeMove handler.

      If DrawItem.canDrag is 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
    • addDragResizeStartHandler

      public HandlerRegistration addDragResizeStartHandler(DragResizeStartHandler handler)
      Add a dragResizeStart handler.

      If DrawItem.canDrag is true and the control knobs include "resize" knobs then this notification method will be fired when the user starts to drag the resize knobs of the draw item.

      Specified by:
      addDragResizeStartHandler in interface HasDragResizeStartHandlers
      Parameters:
      handler - the dragResizeStart handler
      Returns:
      HandlerRegistration used to remove this handler
    • addDragResizeStopHandler

      public HandlerRegistration addDragResizeStopHandler(DragResizeStopHandler handler)
      Add a dragResizeStop handler.

      If DrawItem.canDrag is true and the control knobs include "resize" knobs then this notification method will be fired when the user completes a drag on the resize knobs of the draw item.

      Specified by:
      addDragResizeStopHandler in interface HasDragResizeStopHandlers
      Parameters:
      handler - the dragResizeStop handler
      Returns:
      HandlerRegistration used to remove this handler
    • addDragStartHandler

      public HandlerRegistration addDragStartHandler(DragStartHandler handler)
      Add a dragStart handler.

      If DrawItem.canDrag is true, this notification method will be fired when the user starts to drag the draw item.

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

      public HandlerRegistration addDragStopHandler(DragStopHandler handler)
      Add a dragStop handler.

      If DrawItem.canDrag is true, this notification method will be fired when the user completes a drag on the draw item.

      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.
      Parameters:
      dX - number of pixels to resize by horizontally
      dY - number of pixels to resize by vertically
    • addResizedHandler

      public HandlerRegistration addResizedHandler(ResizedHandler handler)
      Add a resized handler.

      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(Integer width, Integer height)
      Resize to the specified size
      Parameters:
      width - new width
      height - new height
    • 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(double degrees)
      Rotate the shape by the absolute rotation in degrees
      Parameters:
      degrees - number of degrees to rotate
    • 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(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
    • sendToBack

      public void sendToBack()
      Places this draw item at the bottom of the stacking order so that it appears behind other draw items in the same DrawPane or DrawGroup.

      When the DrawPane's drawingType is DrawingType.BITMAP, zIndex, bringToFront(), and sendToBack() are not supported for DrawLabels on iOS due to platform limitations.

      See Also:
    • setCenterPoint

      public void setCenterPoint(int left, int top)
      Change the center point for this DrawItem.
      Parameters:
      left - X coordinate of the center point (in the global coordinate system).
      top - Y coordinate of the center point (in the global coordinate system).
    • setPropertyValue

      public void setPropertyValue(String propertyName, Object newValue)
      Sets a property on this DrawItem, calling the appropriate setter method if one is found and is supported.
      Parameters:
      propertyName - name of the property to set
      newValue - new value for the property
    • show

      public void show()
      Make this drawItem visible.
    • showAllKnobs

      public void showAllKnobs()
      Shows all supported control knobs for this drawItem. Updates knobs to include the supported knobTypes and if necessary draws out the appropriate control knobs.
    • addShowContextMenuHandler

      public 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 Canvas.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
    • 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
    • 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
    • supportsEndArrow

      public boolean supportsEndArrow()
      Does this DrawItem support setEndArrow()? For example, this is false for DrawRect and DrawOval, and true for DrawLine.
      Returns:
      whether setEndArrow() is supported by this DrawItem.
    • supportsStartArrow

      public boolean supportsStartArrow()
      Does this DrawItem support setStartArrow()? For example, this is false for DrawRect and DrawOval, and true for DrawLine.
      Returns:
      whether setStartArrow() is supported by this DrawItem.
    • setDefaultProperties

      public static void setDefaultProperties(DrawItem drawItemProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. 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 affect 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. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      drawItemProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • getById

      public static DrawItem getById(String ID)
      Retrieve a DrawItem by its global ID.
      Parameters:
      ID - global ID of the DrawItem
      Returns:
      the DrawItem, or null if not found or not a DrawItem
    • getByJSObject

      public static DrawItem getByJSObject(JavaScriptObject jsObj)
      Retrieve a DrawItem from its JavaScriptObject.
      Parameters:
      jsObj - SmartClient object associated with Canvas
      Returns:
      the DrawItem, or null if not found or not a DrawItem
    • getRef

      public static DrawItem getRef(JavaScriptObject jsObj)
    • computeAngle

      public static float computeAngle(double px1, double py1, double px2, double py2)
      Deprecated.
      Computes the angle in degrees from the positive X axis to the difference vector v2 - v1 between the two given vectors.
      Parameters:
      px1 - X coordinate of v1
      py1 - Y coordinate of v1
      px2 - X coordinate of v2
      py2 - Y coordinate of v2
      Returns:
      the angle in degrees, in the range [0, 360).
    • computeAngleAsDouble

      public static double computeAngleAsDouble(double px1, double py1, double px2, double py2)
      Computes the angle in degrees from the positive X axis to the difference vector v2 - v1 between the two given vectors.
      Parameters:
      px1 - X coordinate of v1
      py1 - Y coordinate of v1
      px2 - X coordinate of v2
      py2 - Y coordinate of v2
      Returns:
      the angle in degrees, in the range [0, 360).
    • getBoundingBoxAsDouble

      public Double[] getBoundingBoxAsDouble()
      Returns the startPoint endPoint
      Returns:
      x1, y1, x2, y2 coordinates
    • getBoundingBox

      public int[] getBoundingBox()
      Returns the startPoint endPoint
      Returns:
      x1, y1, x2, y2 coordinates
    • getResizeBoundingBoxAsDouble

      public Double[] getResizeBoundingBoxAsDouble()
      Returns the bounding box of the shape reflected by the resize outline shown when dragging the resize knobs. This method is similar to getBoundingBoxAsDouble except that the coordinates returned by this method are in the global coordinate system (described here).
      Returns:
      The x1, y1, x2, y2 coordinates. When the width and height are both positive, point (x1, y1) is the top-left point of the bounding box and point (x2, y2) is the bottom-right point of the bounding box.
      See Also:
    • getResizeBoundingBox

      public int[] getResizeBoundingBox()
      Returns the bounding box of the shape reflected by the resize outline shown when dragging the resize knobs. This method is similar to getBoundingBox except that the coordinates returned by this method are in the global coordinate system (described here).
      Returns:
      The x1, y1, x2, y2 coordinates. When the width and height are both positive, point (x1, y1) is the top-left point of the bounding box and point (x2, y2) is the bottom-right point of the bounding box.
      See Also:
    • setAutoChildConstructor

      public void setAutoChildConstructor(String autoChildName, String className)
      Sets the SmartClient constructor for the AutoChild named autoChildName.
      Parameters:
      autoChildName - the name of the AutoChild
      className - the SmartClient class name to use when constructing the AutoChild.
      See Also:
    • setAutoChildProperties

      public void setAutoChildProperties(String autoChildName, Canvas properties) throws IllegalStateException
      Sets the properties for creating a Canvas AutoChild named autoChildName.

      properties must not have already been created (properties.isCreated() must be false).

      NOTE: Overrides at override points are not applied to AutoChildren created from properties; that is, if the Java Class of properties overrides a Smart GWT override point, the custom method implementation will not be called.

      Throws:
      IllegalStateException - if properties has been created.
      See Also:
    • setAutoChildProperties

      public void setAutoChildProperties(String autoChildName, FormItem properties) throws IllegalStateException
      Sets the properties for creating a FormItem AutoChild named autoChildName.

      properties must not have already been created (properties.isCreated() must be false).

      NOTE: Overrides at override points are not applied to AutoChildren created from properties; that is, if the Java Class of properties overrides a Smart GWT override point, the custom method implementation will not be called.

      Throws:
      IllegalStateException - if properties has been created.
      See Also:
    • setAutoChildProperties

      public void setAutoChildProperties(String autoChildName, DrawItem properties) throws IllegalStateException
      Sets the properties for creating a DrawItem AutoChild named autoChildName.

      properties must not have already been created (properties.isCreated() must be false).

      NOTE: Overrides at override points are not applied to AutoChildren created from properties; that is, if the Java Class of properties overrides a Smart GWT override point, the custom method implementation will not be called.

      Throws:
      IllegalStateException - if properties has been created.
      See Also:
    • setAutoChildProperties

      public void setAutoChildProperties(String autoChildName, EditProxy properties) throws IllegalStateException
      Sets the properties for creating an AutoChild named autoChildName.

      properties must not have already been created (properties.isCreated() must be false).

      Throws:
      IllegalStateException - if properties has been created.
      See Also:
    • setAutoChildVisibility

      public void setAutoChildVisibility(String autoChildName, boolean visible)
      Sets whether to create and show the AutoChild named autoChildName.

      NOTE: This API is not valid for all AutoChildren because some AutoChildren cannot be hidden without destroying the main functions of the component.

      Parameters:
      autoChildName - name of an AutoChild
      visible - whether to show the AutoChild
    • getCanvasAutoChild

      public final Canvas getCanvasAutoChild(String autoChildName)
      Returns the Canvas AutoChild named autoChildName if already created.
      Parameters:
      autoChildName - name of an AutoChild to return.
      Throws:
      RuntimeException - if the AutoChild is not a SmartClient Canvas object.
    • getFormItemAutoChild

      public final FormItem getFormItemAutoChild(String autoChildName)
      Returns the FormItem AutoChild named autoChildName if already created.
      Parameters:
      autoChildName - name of an AutoChild to return.
      Throws:
      RuntimeException - if the AutoChild is not a SmartClient FormItem object.
    • getDrawItemAutoChild

      public final DrawItem getDrawItemAutoChild(String autoChildName)
      Returns the DrawItem AutoChild named autoChildName if already created.
      Parameters:
      autoChildName - name of an AutoChild to return.
      Throws:
      RuntimeException - if the AutoChild is not a SmartClient DrawItem object.
    • setProportionalResizeModifiers

      public void setProportionalResizeModifiers(String... proportionalResizeModifiers) throws IllegalStateException
      If proportionalResizing is set to ProportionalResizeMode.MODIFIER or ProportionalResizeMode.MODIFIER_OFF then proportional resizing of the DrawItem is activated or deactivated, respectively, whenever at least one key in this set of modifier keys is pressed.

      The keys allowed in this set are: "Alt", "Ctrl", and "Shift". If this set of keys is empty then proportional resizing is always used if proportionalResizing is MODIFIER and is never used if proportionalResizing is MODIFIER_OFF.

      Parameters:
      proportionalResizeModifiers - Default value is ["Shift"]
      Throws:
      IllegalStateException - this property cannot be changed after the underlying component has been created
    • getProportionalResizeModifiers

      public String[] getProportionalResizeModifiers()
      If proportionalResizing is set to ProportionalResizeMode.MODIFIER or ProportionalResizeMode.MODIFIER_OFF then proportional resizing of the DrawItem is activated or deactivated, respectively, whenever at least one key in this set of modifier keys is pressed.

      The keys allowed in this set are: "Alt", "Ctrl", and "Shift". If this set of keys is empty then proportional resizing is always used if proportionalResizing is MODIFIER and is never used if proportionalResizing is MODIFIER_OFF.

      Returns:
      String...
    • setAttribute

      public DrawItem setAttribute(String attribute, String value, boolean allowPostCreate)
      Expose as public the setAttribute() methods of BaseWidget
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, Boolean value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, Map value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, int[] value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, BaseClass[] value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, DataClass[] value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, double value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, Date value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, ValueEnum[] value, boolean allowPostCreate)
    • setAttribute

      public DrawItem setAttribute(String attribute, DataClass value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, JavaScriptObject value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, String[] value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • setAttribute

      public DrawItem setAttribute(String attribute, Element value, boolean allowPostCreate)
      Overrides:
      setAttribute in class BaseWidget
    • getAttributeAsString

      public String getAttributeAsString(String property)
      Expose as public the getAttributeAsXXX() methods of BaseWidget
      Overrides:
      getAttributeAsString in class BaseWidget
    • getAttributeAsDate

      public Date getAttributeAsDate(String property)
      Overrides:
      getAttributeAsDate in class BaseWidget
    • getAttributeAsInt

      public Integer getAttributeAsInt(String property)
      Overrides:
      getAttributeAsInt in class BaseWidget
    • getAttributeAsDouble

      public Double getAttributeAsDouble(String property)
      Overrides:
      getAttributeAsDouble in class BaseWidget
    • getAttributeAsElement

      public Element getAttributeAsElement(String property)
      Overrides:
      getAttributeAsElement in class BaseWidget
    • getAttributeAsJavaScriptObject

      public JavaScriptObject getAttributeAsJavaScriptObject(String property)
      Overrides:
      getAttributeAsJavaScriptObject in class BaseWidget
    • getAttributeAsFloat

      public Float getAttributeAsFloat(String property)
      Overrides:
      getAttributeAsFloat in class BaseWidget
    • getAttributeAsBoolean

      public Boolean getAttributeAsBoolean(String property)
      Overrides:
      getAttributeAsBoolean in class BaseWidget
    • getAttributeAsMap

      public Map getAttributeAsMap(String property)
      Overrides:
      getAttributeAsMap in class BaseWidget
    • getUnderlyingGWTCanvas

      public Canvas getUnderlyingGWTCanvas()
      Returns the GWT Canvas associated with this DrawItem. Throws an InvalidDrawingTypeException if the DrawingType isn't a DrawingType.BITMAP.
      Returns:
      the GWT Canvas
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(DrawItemLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class BaseWidget