public class DrawLabel extends DrawItem
config, configOnly, factoryCreated, factoryProperties, id, nativeObject, scClassName
Constructor and Description |
---|
DrawLabel() |
DrawLabel(com.google.gwt.core.client.JavaScriptObject jsObj) |
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() |
LabelAlignment |
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 . |
boolean |
getEscapeContents()
|
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.
|
double |
getLeftAsDouble()
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.
|
double |
getRotationAsDouble()
|
java.lang.String |
getStyleName()
For
drawingType "svg" only, the CSS class applied to
this label. |
int |
getTop()
Sets the amount from the top of its positioning that the element should be placed.
|
double |
getTopAsDouble()
Sets the amount from the top of its positioning that the element should be placed.
|
DrawLabel |
setAlignment(LabelAlignment alignment)
Sets the text alignment from the x position.
|
void |
setAlignment(java.lang.String alignment)
Deprecated.
Use the method which takes a LabelAlignment.
|
DrawLabel |
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.
|
DrawLabel |
setEditProxyConstructor(java.lang.String editProxyConstructor)
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
DrawLabel |
setEscapeContents(boolean escapeContents)
|
DrawLabel |
setFontFamily(java.lang.String fontFamily)
Font family name, similar to the CSS font-family attribute.
|
DrawLabel |
setFontSize(int fontSize)
Font size in pixels, similar to the CSS font-size attribute.
|
DrawLabel |
setFontStyle(java.lang.String fontStyle)
Font style, similar to the CSS font-style attribute, eg "normal", "italic".
|
DrawLabel |
setFontWeight(java.lang.String fontWeight)
Font weight, similar to the CSS font-weight attribute, eg "normal", "bold".
|
DrawLabel |
setKnobs(KnobType... knobs)
DrawLabel only supports the
KnobType.MOVE knob type. |
DrawLabel |
setLeft(int left)
Sets the amount from the left of its positioning that the element should be placed.
|
DrawLabel |
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. |
DrawLabel |
setRotation(double rotation)
|
DrawLabel |
setRotation(float rotation)
Deprecated.
|
void |
setStyleName(java.lang.String styleName)
For
drawingType "svg" only, the CSS class applied to
this label. |
DrawLabel |
setTop(int top)
Sets the amount from the top of its positioning that the element should be placed.
|
addClickHandler, addDragMoveHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addDrawEndHandler, addDrawStartHandler, 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, getById, getByJSObject, 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, getPaletteDefaults, getPrompt, getProportionalResizeModifiers, getProportionalResizing, getRef, getResizeBoundingBox, getResizeBoundingBoxAsDouble, getResizeKnobPoints, getResizeOutline, getResizeViaLocalTransformOnly, getRotateKnob, getScale, getShadow, getShowHover, getShowResizeOutline, getShowTitleLabelBackground, getSideResizeKnob, getStartArrow, getStartKnob, getSvgString, getTitle, getTitleAutoFit, getTitleAutoFitMargin, getTitleAutoFitRotationMode, getTitleLabel, getTitleLabelBackground, getTitleLabelPadding, getTitleRotationMode, getTranslate, getUnderlyingGWTCanvas, getUseSimpleTransform, 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, setTitleAutoFit, setTitleAutoFitMargin, setTitleAutoFitRotationMode, setTitleLabelPadding, setTitleRotationMode, setTranslate, setUseSimpleTransform, setXShearFactor, setYShearFactor, setZIndex, show, showAllKnobs, showKnobs, showKnobs, supportsEndArrow, supportsStartArrow
addDrawHandler, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, clearDynamicProperty, completeCreation, destroy, doAddHandler, doInit, doOnRender, equals, error, errorIfNotCreated, getAttribute, getAttributeAsDateArray, getAttributeAsFloatArray, getAttributeAsIntArray, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getClassName, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getScClassName, hasAutoAssignedID, hasDynamicProperty, 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
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkBitlessEvent
public DrawLabel()
public DrawLabel(com.google.gwt.core.client.JavaScriptObject jsObj)
public static DrawLabel getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public static void changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)
autoChildName
.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
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)
autoChildName
.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
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, DrawItem defaults)
autoChildName
.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
.AutoChildUsage
protected com.google.gwt.core.client.JavaScriptObject create()
public DrawLabel setAlignment(LabelAlignment alignment) throws java.lang.IllegalStateException
Note that this setting is ignored for DrawItem.titleLabel
autochildren, which are always
considered to have "start" alignment to make handling of DrawItem.titleRotationMode
simpler.
alignment
- New alignment value. Default value is DrawLabel.STARTDrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic LabelAlignment getAlignment()
Note that this setting is ignored for DrawItem.titleLabel
autochildren, which are always
considered to have "start" alignment to make handling of DrawItem.titleRotationMode
simpler.
public DrawLabel setContents(java.lang.String contents)
contents
.contents
- the new contents. Default value is nullDrawLabel
instance, for chaining setter callssetEscapeContents(boolean)
public java.lang.String getContents()
getEscapeContents()
public DrawLabel setEditProxyConstructor(java.lang.String editProxyConstructor) throws java.lang.IllegalStateException
EditProxy
for this component when the component is
first placed into edit mode
.setEditProxyConstructor
in class DrawItem
editProxyConstructor
- New editProxyConstructor value. Default value is "DrawLabelEditProxy"DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSCClassName
public java.lang.String getEditProxyConstructor()
EditProxy
for this component when the component is
first placed into edit mode
.getEditProxyConstructor
in class DrawItem
SCClassName
public DrawLabel setEscapeContents(boolean escapeContents)
SVG-based
DrawPane
s, whether to escape the specified
contents
of this label so that any markup syntax is
rendered "as is," without being
interpreted as SVG. This setting should not be customized when working with other
drawingType
s, as the contents
are always escaped in such
case.
In SVG, a DrawLabel
's contents
are rendered inside a <text>
tag, so any SVG that's legal inside that tag can be set as the contents
when
escapeContents
is false. See
Mozilla SVG Developer
Reference
for more information about what exactly is supported.
Note that the Framework will not be able to determine the width or height of a
DrawLabel
when this property is false, so the Framework will consider both
dimensions
to be zero, and centering will not work (e.g. for DrawItem.titleLabel
autochildren).
For top-level DrawLabel
s, you may be able to get the DOM to center your
content by
setting alignment
as "center" - the DOM will then
interpret the
left
, top
coordinates of the label as its centerpoint even though our
Framework
doesn't know the label's actual size.
For a titleLabel
, the alignment
setting
is ignored, as the Framework always positions it using "start" alignment, but SVG code such
as the following demonstrates that centering is possible (via the "style" setting):
<tspan text-decoration='underline' font-size='20px' style='dominant-baseline:central; text-anchor:middle;'>MyLabel </tspan>
escapeContents
property for this DrawLabel.escapeContents
- whether to escape contents
. Default value is trueDrawLabel
instance, for chaining setter callssetContents(java.lang.String)
,
setAlignment(com.smartgwt.client.types.LabelAlignment)
public boolean getEscapeContents()
SVG-based
DrawPane
s, whether to escape the specified
contents
of this label so that any markup syntax is
rendered "as is," without being
interpreted as SVG. This setting should not be customized when working with other
drawingType
s, as the contents
are always escaped in such
case.
In SVG, a DrawLabel
's contents
are rendered inside a <text>
tag, so any SVG that's legal inside that tag can be set as the contents
when
escapeContents
is false. See
Mozilla SVG Developer
Reference
for more information about what exactly is supported.
Note that the Framework will not be able to determine the width or height of a
DrawLabel
when this property is false, so the Framework will consider both
dimensions
to be zero, and centering will not work (e.g. for DrawItem.titleLabel
autochildren).
For top-level DrawLabel
s, you may be able to get the DOM to center your
content by
setting alignment
as "center" - the DOM will then
interpret the
left
, top
coordinates of the label as its centerpoint even though our
Framework
doesn't know the label's actual size.
For a titleLabel
, the alignment
setting
is ignored, as the Framework always positions it using "start" alignment, but SVG code such
as the following demonstrates that centering is possible (via the "style" setting):
<tspan text-decoration='underline' font-size='20px' style='dominant-baseline:central; text-anchor:middle;'>MyLabel </tspan>
getContents()
,
getAlignment()
public DrawLabel setFontFamily(java.lang.String fontFamily) throws java.lang.IllegalStateException
fontFamily
- New fontFamily value. Default value is "Tahoma"DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetStyleName(java.lang.String)
public java.lang.String getFontFamily()
getStyleName()
public DrawLabel setFontSize(int fontSize)
fontSize
.fontSize
- the new font size in pixels. Default value is 18DrawLabel
instance, for chaining setter callssetStyleName(java.lang.String)
public int getFontSize()
getStyleName()
public DrawLabel setFontStyle(java.lang.String fontStyle) throws java.lang.IllegalStateException
fontStyle
- New fontStyle value. Default value is "normal"DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetStyleName(java.lang.String)
public java.lang.String getFontStyle()
getStyleName()
public DrawLabel setFontWeight(java.lang.String fontWeight) throws java.lang.IllegalStateException
fontWeight
- New fontWeight value. Default value is "bold"DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetStyleName(java.lang.String)
public java.lang.String getFontWeight()
getStyleName()
public DrawLabel setKnobs(KnobType... knobs) throws java.lang.IllegalStateException
KnobType.MOVE
knob type.setKnobs
in class DrawItem
knobs
- New knobs value. Default value is nullDrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdDrawItem.setKnobs(com.smartgwt.client.types.KnobType...)
public KnobType[] getKnobs()
KnobType.MOVE
knob type.getKnobs
in class DrawItem
DrawItem.getKnobs()
public DrawLabel setLeft(int left) throws java.lang.IllegalStateException
left
- New left value. Default value is 0DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getLeft()
public double getLeftAsDouble()
public DrawLabel setLineColor(java.lang.String lineColor)
setLineColor
in class DrawItem
lineColor
- new text color. Default value is "#808080"DrawLabel
instance, for chaining setter callsCSSColor
public java.lang.String getLineColor()
getLineColor
in class DrawItem
CSSColor
public DrawLabel setRotation(float rotation) throws java.lang.IllegalStateException
GwtFloatVsDouble
setRotation
in class DrawItem
rotation
- New rotation value. Default value is 0.0DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic float getRotation()
GwtFloatVsDouble
getRotation
in class DrawItem
public DrawLabel setRotation(double rotation) throws java.lang.IllegalStateException
setRotation
in class DrawItem
rotation
- New rotation value. Default value is 0.0DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic double getRotationAsDouble()
getRotationAsDouble
in class DrawItem
public void setStyleName(java.lang.String styleName)
drawingType
"svg" only, the CSS class applied to
this label. Similar to Canvas.styleName
. The font properties
fontSize
, fontWeight
, fontStyle
, and fontFamily
, unless set to null, take priority over any CSS
settings. This property can be used in combination with escapeContents
if needed. but note that in SVG, the
precedence of CSS and inline styling applied to an element works differently that it does in HTML. See Mozilla SVG Developer Reference
Note that only font sizes defined in pixels are supported through this property.
If this method is called after the component has been drawn/initialized:
Sets this DrawLabel's styleName
.
setStyleName
in class com.google.gwt.user.client.ui.UIObject
styleName
- the new styleName. Default value is "normal"setEscapeContents(boolean)
,
CSSStyleName
public java.lang.String getStyleName()
drawingType
"svg" only, the CSS class applied to
this label. Similar to Canvas.styleName
. The font properties
fontSize
, fontWeight
, fontStyle
, and fontFamily
, unless set to null, take priority over any CSS
settings. This property can be used in combination with escapeContents
if needed. but note that in SVG, the
precedence of CSS and inline styling applied to an element works differently that it does in HTML. See Mozilla SVG Developer Reference
Note that only font sizes defined in pixels are supported through this property.
getStyleName
in class com.google.gwt.user.client.ui.UIObject
getEscapeContents()
,
CSSStyleName
public DrawLabel setTop(int top) throws java.lang.IllegalStateException
top
- New top value. Default value is 0DrawLabel
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getTop()
public double getTopAsDouble()
public Point getCenter()
public static void setDefaultProperties(DrawLabel drawLabelProperties)
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.
drawLabelProperties
- properties that should be used as new defaults when instances of this class are createdSGWTProperties
public void setAlignment(java.lang.String alignment) throws java.lang.IllegalStateException
alignment
- Default value is "start"java.lang.IllegalStateException
- Thrown upon attempt to change after component creation.public com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.drawing.DrawLabelLogicalStructure s)
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.getLogicalStructure
in interface LogicalStructure
getLogicalStructure
in class DrawItem