com.smartgwt.client.widgets.drawing

## Class DrawPolygon

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

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers, HasClickHandlers, HasDragMoveHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMovedHandlers, HasResizedHandlers, HasShowContextMenuHandlers
  Direct Known Subclasses:
    DrawTriangle

      public class DrawPolygon
      extends DrawPath

  DrawItem subclass to render polygons

- - ### Field Summary

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

      `config, configOnly, factoryCreated, factoryProperties, id, scClassName`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.gwt.core.client.JavaScriptObject` | `create()`
    `KnobType[]` | `getKnobs()` DrawPolygon only supports the `KnobType.MOVE` knob type.
    `LineCap` | `getLineCap()` Style of drawing the corners of the polygon.
    `static DrawPolygon` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `Point[]` | `getPoints()` Array of points of the polygon, specified in the `local coordinate system`.
    `boolean` | `getShowTitleLabelBackground()` If the `titleLabel` is showing, should the `titleLabelBackground` be created and placed behind the `titleLabel`?
    `TitleRotationMode` | `getTitleRotationMode()` The mode in which the `titleLabel` (if shown) is rotated with this draw item.
    `void` | `setKnobs(KnobType... knobs)` DrawPolygon only supports the `KnobType.MOVE` knob type.
    `void` | `setLineCap(LineCap lineCap)` Style of drawing the corners of the polygon.
    `void` | `setPoints(Point... points)` Array of points of the polygon, specified in the `local coordinate system`.
    `void` | `setShowTitleLabelBackground(boolean showTitleLabelBackground)` If the `titleLabel` is showing, should the `titleLabelBackground` be created and placed behind the `titleLabel`?
    `void` | `setTitleRotationMode(TitleRotationMode titleRotationMode)` The mode in which the `titleLabel` (if shown) is rotated with this draw item.

    - ### Methods inherited from class com.smartgwt.client.widgets.drawing.DrawPath

      `getCenter, moveBy, moveFirstPointTo, resizeBy, resizeTo, setDefaultProperties`

    - ### Methods inherited from class com.smartgwt.client.widgets.drawing.DrawItem

      `addClickHandler, addDragMoveHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMovedHandler, addResizedHandler, addShowContextMenuHandler, changeAutoChildDefaults, changeAutoChildDefaults, changeAutoChildDefaults, computeAngle, computeAngleAsDouble, dragResizeMove, draw, erase, getAttributeAsIntArray, getBoundingBox, getBoundingBoxAsDouble, getCanDrag, getCanHover, getCanvasAutoChild, getContextMenu, getCornerResizeKnob, getCursor, getDestroyed, getDestroying, getDragStartDistance, getDrawGroup, getDrawItemAutoChild, getDrawPane, getEditProxyConstructor, getEndArrow, getEndKnob, getEventOpaque, getFillColor, getFillGradient, getFillGradientAsString, getFillOpacity, getFormItemAutoChild, getHoverDelay, getHoverHTML, getKeepInParentRect, getLineColor, getLineOpacity, getLinePattern, getLineWidth, getMoveKnob, getMoveKnobOffset, getMoveKnobPoint, getPageLeft, getPageTop, getPrompt, getProportionalResizeModifiers, getProportionalResizing, getRef, getResizeBoundingBox, getResizeBoundingBoxAsDouble, getResizeKnobPoints, getResizeOutline, getResizeViaLocalTransformOnly, getRotation, getRotationAsDouble, getScale, getShadow, getShowHover, getShowResizeOutline, getSideResizeKnob, getStartArrow, getStartKnob, getSvgString, getTitle, getTitleLabel, getTitleLabelBackground, getTitleLabelPadding, getTranslate, getXShearFactor, getYShearFactor, hide, hideAllKnobs, hideKnobs, hideKnobs, hover, isInBounds, isPointInPath, moveTo, rotateBy, rotateTo, scaleBy, scaleTo, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setCanDrag, setCanHover, setCenterPoint, setContextMenu, setCursor, setDefaultProperties, setDragStartDistance, setDrawGroup, setDrawPane, setEditProxyConstructor, setEndArrow, setEventOpaque, setFillColor, setFillGradient, setFillGradient, setFillOpacity, setHoverDelay, setKeepInParentRect, setKeepInParentRect, setLineColor, setLineOpacity, setLinePattern, setLineWidth, setMoveKnobOffset, setMoveKnobPoint, setPrompt, setPropertyValue, setProportionalResizeModifiers, setProportionalResizing, setResizeKnobPoints, setResizeViaLocalTransformOnly, setRotation, setRotation, setScale, setShadow, setShapeData, setShowHover, setShowResizeOutline, setStartArrow, setTitle, setTitleLabelPadding, setTranslate, setXShearFactor, setYShearFactor, show, showAllKnobs, showKnobs, showKnobs, supportsEndArrow, supportsStartArrow`

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

      `applyFactoryProperties, asSGWTComponent, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getJsObj, getOrCreateJsObj, getScClassName, getTestInstance, hasAutoAssignedID, internalSetID, internalSetID, isConfigOnly, isCreated, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setJavaScriptObject, setProperty, setProperty, setProperty, setProperty, setScClassName`

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

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

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

      `fireEvent`

- - ### Constructor Detail

    - #### DrawPolygon

          public DrawPolygon()

    - #### DrawPolygon

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

  - ### Method Detail

    - #### getOrCreateRef

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

    - #### create

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

      Overrides:
        `create` in class `DrawPath`

    - #### setKnobs

          public void setKnobs(KnobType... knobs)
                        throws java.lang.IllegalStateException

      DrawPolygon only supports the `KnobType.MOVE` knob type.
      Overrides:
        `setKnobs` in class `DrawPath`
      Parameters:
        `knobs` - Default value is null
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created
      See Also:
        `DrawItem.setKnobs(com.smartgwt.client.types.KnobType...)`

    - #### getKnobs

          public KnobType[] getKnobs()

      DrawPolygon only supports the `KnobType.MOVE` knob type.
      Overrides:
        `getKnobs` in class `DrawPath`
      Returns:
        KnobType...
      See Also:
        `DrawItem.getKnobs()`

    - #### setLineCap

          public void setLineCap(LineCap lineCap)

      Style of drawing the corners of the polygon.
      Overrides:
        `setLineCap` in class `DrawItem`
      Parameters:
        `lineCap` - Default value is "butt"

    - #### getLineCap

          public LineCap getLineCap()

      Style of drawing the corners of the polygon.
      Overrides:
        `getLineCap` in class `DrawItem`
      Returns:
        LineCap

    - #### setPoints

          public void setPoints(Point... points)

      Array of points of the polygon, specified in the `local coordinate system`.
      Overrides:
        `setPoints` in class `DrawPath`
      Parameters:
        `points` - Default value is [[0,0], [50,50], [100,0]]

    - #### getPoints

          public Point[] getPoints()

      Array of points of the polygon, specified in the `local coordinate system`.
      Overrides:
        `getPoints` in class `DrawPath`
      Returns:
        Point...

    - #### setShowTitleLabelBackground

          public void setShowTitleLabelBackground(boolean showTitleLabelBackground)
                                           throws java.lang.IllegalStateException

      If the `titleLabel` is showing, should the `titleLabelBackground` be created and placed behind the `titleLabel`?

      This defaults to true for `DrawSector`s and shapes that are not commonly filled (e.g. `DrawLine`s).

      Note : This is an advanced setting

      Overrides:
        `setShowTitleLabelBackground` in class `DrawPath`
      Parameters:
        `showTitleLabelBackground` - Default value is false
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying 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 `DrawSector`s and shapes that are not commonly filled (e.g. `DrawLine`s).

      Overrides:
        `getShowTitleLabelBackground` in class `DrawPath`
      Returns:
        boolean

    - #### setTitleRotationMode

          public void setTitleRotationMode(TitleRotationMode titleRotationMode)
                                    throws java.lang.IllegalStateException

      The mode in which the `titleLabel` (if shown) is rotated with this draw item.

      Note : This is an advanced setting

      Overrides:
        `setTitleRotationMode` in class `DrawItem`
      Parameters:
        `titleRotationMode` - Default value is "withItemAlwaysUp"
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the underlying component has been created
      See Also:
        `DrawItem.setTitle(java.lang.String)`

    - #### getTitleRotationMode

          public TitleRotationMode getTitleRotationMode()

      The mode in which the `titleLabel` (if shown) is rotated with this draw item.
      Overrides:
        `getTitleRotationMode` in class `DrawItem`
      Returns:
        TitleRotationMode
      See Also:
        `DrawItem.getTitle()`