com.smartgwt.client.widgets.drawing

## Class DrawLabel

- java.lang.Object
- - com.google.gwt.user.client.ui.UIObject
  - - com.google.gwt.user.client.ui.Widget
    - - com.smartgwt.client.widgets.BaseWidget
      - - com.smartgwt.client.widgets.drawing.DrawItem
        - - com.smartgwt.client.widgets.drawing.DrawLabel

- All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsWidget, LogicalStructure, HasClickHandlers, HasDragMoveHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMovedHandlers, HasResizedHandlers, HasShowContextMenuHandlers

      public class DrawLabel
      extends DrawItem

  DrawItem subclass to render a single-line text label.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

      `com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled`

  - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.widgets.BaseWidget

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

    - ### Fields inherited from class com.google.gwt.user.client.ui.UIObject

      `DEBUG_ID_PREFIX`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)` Changes the defaults for Canvas AutoChildren named `autoChildName`.
    `static void` | `changeAutoChildDefaults(java.lang.String autoChildName, DrawItem defaults)` Changes the defaults for DrawItem AutoChildren named `autoChildName`.
    `static void` | `changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)` Changes the defaults for FormItem AutoChildren named `autoChildName`.
    `protected com.google.gwt.core.client.JavaScriptObject` | `create()`
    `java.lang.String` | `getAlignment()` Sets the text alignment from the x position.
    `Point` | `getCenter()` Get the center point of the label.
    `java.lang.String` | `getContents()` This is the content that will exist as the label.
    `java.lang.String` | `getEditProxyConstructor()` Default class used to construct the `EditProxy` for this component when the component is `first placed into edit mode`.
    `java.lang.String` | `getFontFamily()` Font family name, similar to the CSS font-family attribute.
    `int` | `getFontSize()` Font size in pixels, similar to the CSS font-size attribute.
    `java.lang.String` | `getFontStyle()` Font style, similar to the CSS font-style attribute, eg "normal", "italic".
    `java.lang.String` | `getFontWeight()` Font weight, similar to the CSS font-weight attribute, eg "normal", "bold".
    `KnobType[]` | `getKnobs()` DrawLabel only supports the `KnobType.MOVE` knob type.
    `int` | `getLeft()` Sets the amount from the left of its positioning that the element should be placed.
    `java.lang.String` | `getLineColor()` The text color of the label.
    `com.smartgwt.logicalstructure.core.LogicalStructureObject` | `getLogicalStructure()` Getter implementing the `LogicalStructure` interface, which supports Eclipse's logical structure debugging facility.
    `static DrawLabel` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `float` | `getRotation()` Deprecated. `GwtFloatVsDouble`
    `double` | `getRotationAsDouble()` Rotation in degrees about the `top` `left` corner.
    `int` | `getTop()` Sets the amount from the top of its positioning that the element should be placed.
    `void` | `setAlignment(java.lang.String alignment)` Sets the text alignment from the x position.
    `void` | `setContents(java.lang.String contents)` This is the content that will exist as the label.
    `static void` | `setDefaultProperties(DrawLabel drawLabelProperties)` Class level method to set the default properties of this class.
    `void` | `setEditProxyConstructor(java.lang.String editProxyConstructor)` Default class used to construct the `EditProxy` for this component when the component is `first placed into edit mode`.
    `void` | `setFontFamily(java.lang.String fontFamily)` Font family name, similar to the CSS font-family attribute.
    `void` | `setFontSize(int fontSize)` Font size in pixels, similar to the CSS font-size attribute.
    `void` | `setFontStyle(java.lang.String fontStyle)` Font style, similar to the CSS font-style attribute, eg "normal", "italic".
    `void` | `setFontWeight(java.lang.String fontWeight)` Font weight, similar to the CSS font-weight attribute, eg "normal", "bold".
    `void` | `setKnobs(KnobType... knobs)` DrawLabel only supports the `KnobType.MOVE` knob type.
    `void` | `setLeft(int left)` Sets the amount from the left of its positioning that the element should be placed.
    `void` | `setLineColor(java.lang.String lineColor)` The text color of the label.
    `com.smartgwt.logicalstructure.core.LogicalStructureObject` | `setLogicalStructure(com.smartgwt.logicalstructure.widgets.drawing.DrawLabelLogicalStructure s)` Setter implementing the `LogicalStructure` interface, which supports Eclipse's logical structure debugging facility.
    `void` | `setRotation(double rotation)` Rotation in degrees about the `top` `left` corner.
    `void` | `setRotation(float rotation)` Deprecated. `GwtFloatVsDouble`
    `void` | `setTop(int top)` Sets the amount from the top of its positioning that the element should be placed.

    - ### 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, bringToFront, computeAngle, computeAngleAsDouble, dragResizeMove, draw, erase, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getBoundingBox, getBoundingBoxAsDouble, getCanDrag, getCanHover, getCanvasAutoChild, getContextMenu, getCornerResizeKnob, getCursor, getDestroyed, getDestroying, getDragStartDistance, getDrawGroup, getDrawItemAutoChild, getDrawPane, getEndArrow, getEndKnob, getEventOpaque, getFillColor, getFillGradient, getFillGradientAsString, getFillOpacity, getFormItemAutoChild, getHoverDelay, getHoverHTML, getKeepInParentRect, getLineCap, getLineOpacity, getLinePattern, getLineWidth, getMoveKnob, getMoveKnobOffset, getMoveKnobPoint, getPageLeft, getPageTop, getPrompt, getProportionalResizeModifiers, getProportionalResizing, getRef, getResizeBoundingBox, getResizeBoundingBoxAsDouble, getResizeKnobPoints, getResizeOutline, getResizeViaLocalTransformOnly, getScale, getShadow, getShowHover, getShowResizeOutline, getShowTitleLabelBackground, getSideResizeKnob, getStartArrow, getStartKnob, getSvgString, getTitle, getTitleLabel, getTitleLabelBackground, getTitleLabelPadding, getTitleRotationMode, getTranslate, getXShearFactor, getYShearFactor, getZIndex, hide, hideAllKnobs, hideKnobs, hideKnobs, hover, isInBounds, isPointInPath, moveBy, moveTo, resizeBy, resizeTo, rotateBy, rotateTo, scaleBy, scaleTo, sendToBack, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setCanDrag, setCanHover, setCenterPoint, setContextMenu, setCursor, setDefaultProperties, setDragStartDistance, setDrawGroup, setDrawPane, setEndArrow, setEventOpaque, setFillColor, setFillGradient, setFillGradient, setFillOpacity, setHoverDelay, setKeepInParentRect, setKeepInParentRect, setLineCap, setLineOpacity, setLinePattern, setLineWidth, setLogicalStructure, setMoveKnobOffset, setMoveKnobPoint, setPrompt, setPropertyValue, setProportionalResizeModifiers, setProportionalResizing, setResizeKnobPoints, setResizeViaLocalTransformOnly, setScale, setShadow, setShapeData, setShowHover, setShowResizeOutline, setShowTitleLabelBackground, setStartArrow, setTitle, setTitleLabelPadding, setTitleRotationMode, setTranslate, setXShearFactor, setYShearFactor, setZIndex, show, showAllKnobs, showKnobs, showKnobs, supportsEndArrow, supportsStartArrow`

    - ### Methods inherited from class com.smartgwt.client.widgets.BaseWidget

      `addDrawHandler, applyFactoryProperties, completeCreation, destroy, doAddHandler, doInit, doOnRender, equals, error, errorIfNotCreated, getAttribute, getAttributeAsDateArray, getAttributeAsFloatArray, getAttributeAsIntArray, getAttributeAsRecord, getAttributeAsStringArray, getById, getByJSObject, getClassName, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getScClassName, hasAutoAssignedID, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, isDrawn, isFactoryCreated, onBind, onDestroy, onDraw, onInit, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDefaultProperties, setDragTracker, setFactoryCreated, setHtmlElement, setID, setJavaScriptObject, setLogicalStructure, setLogicalStructure, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString`

    - ### Methods inherited from class com.google.gwt.user.client.ui.Widget

      `addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents`

    - ### Methods inherited from class com.google.gwt.user.client.ui.UIObject

      `addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkBitlessEvent`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

      `fireEvent`

- - ### Constructor Detail

    - #### DrawLabel

          public DrawLabel()

    - #### DrawLabel

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

  - ### Method Detail

    - #### getOrCreateRef

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

    - #### changeAutoChildDefaults

          public static void changeAutoChildDefaults(java.lang.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:
        `AutoChildUsage`

    - #### changeAutoChildDefaults

          public static void changeAutoChildDefaults(java.lang.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:
        `AutoChildUsage`

    - #### changeAutoChildDefaults

          public static void changeAutoChildDefaults(java.lang.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:
        `AutoChildUsage`

    - #### create

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

      Overrides:
        `create` in class `DrawItem`

    - #### setAlignment

          public void setAlignment(java.lang.String alignment)
                            throws java.lang.IllegalStateException

      Sets the text alignment from the x position. Similar to html5 context.textAlign, eg "start", "center", "end"
      Parameters:
        `alignment` - Default value is "start"
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getAlignment

          public java.lang.String getAlignment()

      Sets the text alignment from the x position. Similar to html5 context.textAlign, eg "start", "center", "end"
      Returns:
        String

    - #### setContents

          public void setContents(java.lang.String contents)

      This is the content that will exist as the label.
      If this method is called after the component has been drawn/initialized: Sets this DrawLabel's `contents`.
      Parameters:
        `contents` - the new contents.. Default value is null

    - #### getContents

          public java.lang.String getContents()

      This is the content that will exist as the label.
      Returns:
        String

    - #### setEditProxyConstructor

          public void setEditProxyConstructor(java.lang.String editProxyConstructor)
                                       throws java.lang.IllegalStateException

      Default class used to construct the `EditProxy` for this component when the component is `first placed into edit mode`.
      Overrides:
        `setEditProxyConstructor` in class `DrawItem`
      Parameters:
        `editProxyConstructor` -
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created
      See Also:
        `SCClassName . Default value is "DrawLabelEditProxy"`

    - #### getEditProxyConstructor

          public java.lang.String getEditProxyConstructor()

      Default class used to construct the `EditProxy` for this component when the component is `first placed into edit mode`.
      Overrides:
        `getEditProxyConstructor` in class `DrawItem`
      Returns:
      See Also:
        `SCClassName`

    - #### setFontFamily

          public void setFontFamily(java.lang.String fontFamily)
                             throws java.lang.IllegalStateException

      Font family name, similar to the CSS font-family attribute.
      Parameters:
        `fontFamily` - Default value is "Tahoma"
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getFontFamily

          public java.lang.String getFontFamily()

      Font family name, similar to the CSS font-family attribute.
      Returns:
        String

    - #### setFontSize

          public void setFontSize(int fontSize)

      Font size in pixels, similar to the CSS font-size attribute.
      If this method is called after the component has been drawn/initialized: Sets this DrawLabel's `fontSize`.
      Parameters:
        `fontSize` - the new font size in pixels.. Default value is 18

    - #### getFontSize

          public int getFontSize()

      Font size in pixels, similar to the CSS font-size attribute.
      Returns:
        int

    - #### setFontStyle

          public void setFontStyle(java.lang.String fontStyle)
                            throws java.lang.IllegalStateException

      Font style, similar to the CSS font-style attribute, eg "normal", "italic".
      Parameters:
        `fontStyle` - Default value is "normal"
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getFontStyle

          public java.lang.String getFontStyle()

      Font style, similar to the CSS font-style attribute, eg "normal", "italic".
      Returns:
        String

    - #### setFontWeight

          public void setFontWeight(java.lang.String fontWeight)
                             throws java.lang.IllegalStateException

      Font weight, similar to the CSS font-weight attribute, eg "normal", "bold".
      Parameters:
        `fontWeight` - Default value is "bold"
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getFontWeight

          public java.lang.String getFontWeight()

      Font weight, similar to the CSS font-weight attribute, eg "normal", "bold".
      Returns:
        String

    - #### setKnobs

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

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

    - #### getKnobs

          public KnobType[] getKnobs()

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

    - #### setLeft

          public void setLeft(int left)
                       throws java.lang.IllegalStateException

      Sets the amount from the left of its positioning that the element should be placed.
      Parameters:
        `left` - Default value is 0
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getLeft

          public int getLeft()

      Sets the amount from the left of its positioning that the element should be placed.
      Returns:
        int

    - #### setLineColor

          public void setLineColor(java.lang.String lineColor)

      The text color of the label.
      If this method is called after the component has been drawn/initialized: Sets the text color of the label.
      Overrides:
        `setLineColor` in class `DrawItem`
      Parameters:
        `lineColor` - new text color.
      See Also:
        `CSSColor . Default value is "#808080"`

    - #### getLineColor

          public java.lang.String getLineColor()

      The text color of the label.
      Overrides:
        `getLineColor` in class `DrawItem`
      Returns:
      See Also:
        `CSSColor`

    - #### setRotation

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

      Deprecated. `GwtFloatVsDouble`
      Rotation in degrees about the `top` `left` corner. The positive direction is clockwise.
      Overrides:
        `setRotation` in class `DrawItem`
      Parameters:
        `rotation` - Default value is 0.0
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getRotation

          public float getRotation()

      Deprecated. `GwtFloatVsDouble`
      Rotation in degrees about the `top` `left` corner. The positive direction is clockwise.
      Overrides:
        `getRotation` in class `DrawItem`
      Returns:
        float

    - #### setRotation

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

      Rotation in degrees about the `top` `left` corner. The positive direction is clockwise.
      Overrides:
        `setRotation` in class `DrawItem`
      Parameters:
        `rotation` - Default value is 0.0
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getRotationAsDouble

          public double getRotationAsDouble()

      Rotation in degrees about the `top` `left` corner. The positive direction is clockwise.
      Overrides:
        `getRotationAsDouble` in class `DrawItem`
      Returns:
        double

    - #### setTop

          public void setTop(int top)
                      throws java.lang.IllegalStateException

      Sets the amount from the top of its positioning that the element should be placed.
      Parameters:
        `top` - Default value is 0
      Throws:
        `java.lang.IllegalStateException` - this property cannot be changed after the component has been created

    - #### getTop

          public int getTop()

      Sets the amount from the top of its positioning that the element should be placed.
      Returns:
        int

    - #### getCenter

          public Point getCenter()

      Get the center point of the label.
      Overrides:
        `getCenter` in class `DrawItem`
      Returns:
        the center point

    - #### setDefaultProperties

          public static void setDefaultProperties(DrawLabel drawLabelProperties)

      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:
        `drawLabelProperties` - properties that should be used as new defaults when instances of this class are created
      See Also:
        `SGWTProperties`

    - #### setLogicalStructure

          public com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.drawing.DrawLabelLogicalStructure s)

      Setter implementing the `LogicalStructure` interface, which supports Eclipse's logical structure debugging facility.

    - #### getLogicalStructure

          public com.smartgwt.logicalstructure.core.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 `DrawItem`